Skip to content

Conversation

@ngholiza
Copy link
Collaborator

After #111 every project page showed Registered computational experiments with all three tools, and submitting a run attached its template to the project. Projects attach unit experiments, physical or computational, so the attachment must come first.

Changes

  • Catalog at startup: the QE installations and the CellRelaxDFT, CellRelaxDFT 2D and ElasticDFT templates are registered when the API starts (ensure_catalog). They're owned by the platform (no owner, no owning organization, shared), so any project can attach them before a run exists. Rows written by earlier versions are returned to the platform on upsert.
  • Submission guard: submitting no longer attaches anything, and a tool whose template isn't attached to the project returns 400 ("Add the … unit experiment to this project before submitting it").
  • Project page: the computation section appears only when a computational experiment is attached, offering only those tools. Attaching or removing one keeps the current tool and inputs while it stays attached. A ?tool= request refused because the tool wasn't attached is applied once it is.
  • Locking: one advisory lock serializes catalog writes, so startup registration and submissions can't deadlock.
  • Help page: explains attaching computational experiments under Unit Experiments.

Review and tests

  • Codex: 3 P2 findings, then 2 follow-ups, all fixed; final verdict APPROVE.
  • 489 unit tests and 81 Postgres tests pass, including new ones for refusing unattached tools, not attaching on submit, platform-owned catalog rows, and normalizing old rows. Web type check and lint are clean for the changed files. The one remaining lint error in app/projects/[id]/page.tsx (set-state-in-effect around line 297) is already on dev.

🤖 Generated with Claude Code

Every project showed the registered computation form with all tools,
and submitting a run attached its template to the project. Projects
attach unit experiments, physical or computational, so:

- The catalog (QE installations and the three templates) is registered
  at API startup, owned by the platform with no owning organization,
  so projects can attach them before any run exists.
- Submitting no longer attaches anything; a tool whose template is not
  attached to the project is refused with 400.
- The project page shows Registered computational experiments only when
  a computational experiment is attached, offering just those tools.
- The help page explains attaching them under Unit Experiments.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QS1dbWTNbwqxXZUMEARjhm
- Catalog upserts return rows written by earlier versions to the
  platform: no owner, no owning organization, shared visibility.
- One advisory lock serializes all catalog writes, so startup
  registration and submissions cannot deadlock on each other's rows.
- Attaching or removing a computational experiment keeps the current
  tool and its inputs while it stays attached, and re-applies a
  ?tool= request that was refused before the tool was attached.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QS1dbWTNbwqxXZUMEARjhm
Keying the ?tool= request by the attached tools replayed it after any
attachment change, clearing the user's inputs, and broke manual tool
selection. Apply each request once, and retry only a request that was
refused because its tool was not yet attached.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QS1dbWTNbwqxXZUMEARjhm
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QS1dbWTNbwqxXZUMEARjhm
Sign in to join this conversation on GitHub.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant