Skip to content

feat: offer Update in the project menu to move its runs onto the current tool code - #112

Merged
brianjfox merged 2 commits into
mainfrom
feat/project-update
Nov 3, 2026
Merged

brianjfox merged 2 commits into
mainfrom
feat/project-update

Conversation

@brianjfox

Copy link
Copy Markdown
Contributor

Closes #111

What

Adds Update… to the project menu, which moves a project's runs onto the current tool code: the specialists running on packages older than the installed ones are replaced, and the coordinator too when it is the one behind.

Why

A project's coordinator and specialists keep the tool code frozen when their run is created (#67). After a hub rebuild with a fix, a live coder kept failing the same way, and the only remedy was cancelling runs by hand in the database. The hub already replaces a stale coordinator on its own pass, but only when the coordinator's own pin is stale and never while a coder is live, and it offers the person nothing to ask for. Details in #111.

Changes

  • packages/schemas/src/project.ts: ProjectUpdateReceipt, whether runs were replaced and, when not, why: every run is current, no coordinator is live, the coordinator or a specialist is mid-turn, or an approval is pending.
  • apps/hub/src/projects/coordinator-upgrade.ts: staleRuns compares each run's frozen pin with the pins installed for its role (a coder may be on either coder package). update refuses while the coordinator is mid-turn or has an unsettled delivery, an approval is pending, or a specialist is mid-turn. Otherwise it cancels the stale specialists, and when the coordinator is stale, every parked specialist and the coordinator, then starts a fresh one as the upgrade pass does; the person's next message carries the held resume context. A parked coder is replaced too, which is what the dialog says the person gives up. Updates share the per-project in-flight gate with the pass and with opens. The shared pieces of the pass (latestCoordinator, liveSpecialists, coordinatorIdle, approvalPending) are factored out of it unchanged.
  • apps/hub/src/projects/service.ts: manage reads a project with manage authority, for an action on its runs.
  • apps/hub/src/projects/routes.ts, apps/hub/src/app.ts: POST /projects/:projectId/update, refused for an archived project.
  • packages/client: updateProject.
  • apps/web/src/pages/project-menu.tsx, config.ts: the menu item for an active project, a dialog that says what the update gives up and what to do after, and a notice with the outcome or the reason it waits.
  • Tests: coordinator-upgrade.test.ts covers staleRuns; project-menu.test.ts the outcome wording.

A project's coordinator and specialists keep the tool code frozen at their creation. The hub replaces a stale coordinator only on its own pass, never a coder, and offers the person nothing. updateProject cancels the specialists behind the installed packages, and the coordinator with every parked specialist when it is the one behind, so a fresh coordinator starts as an upgrade does; a run mid-turn or a pending approval is named instead of cut off.
Update… says what it gives up, asks the hub to move the project's runs onto the current tool code, and reports whether it did or why it waits.
@brianjfox brianjfox closed this Nov 3, 2026
@brianjfox brianjfox reopened this Nov 3, 2026
@brianjfox
brianjfox merged commit d946201 into main Nov 3, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Offer Update in the project menu to move a project's runs onto the current tool code

1 participant