Skip to content

fix(hub): split writers by document kind and hand off outdated coordinators - #140

Merged
TheGreatAxios merged 5 commits into
mainfrom
cl-12085-give-each-writer-a-save-tool-for-just-its-own-document-so
Nov 4, 2026
Merged

TheGreatAxios merged 5 commits into
mainfrom
cl-12085-give-each-writer-a-save-tool-for-just-its-own-document-so

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Closes CL-12085

What changed

  • Each document kind has its own writer package. Its save tool lists only that kind's fields, flat, so xAI models stop sending empty saves.
  • The install record and project scope are keyed by package.
  • An outdated coordinator is replaced before it acts on old code: when it starts a specialist (held until running writers finish), or while it waits on its own approval, which is withdrawn so the replacement asks it once.
  • Between coordinators, the conversation stays on screen instead of going blank, and a replaced coordinator's refused start never shows as a failed card.
  • Stored single-writer installs are reinstalled on their next scope read.

How it was verified

  • lint, format:check, typecheck, test and pins:verify pass.
  • Tests cover flat writer schemas, each writer filing only its own kind, old bundles still reading their scope, and the hub's handoff notes never showing as the person's message.
  • Live, with open projects' coordinators made outdated: a coordinator starting a writer and two coordinators waiting on an approval were each replaced; each project was asked once, one specialist started, and the thread stayed on screen.
  • Not yet run: a live xAI and ChatGPT project. The end-to-end replay is CL-12129.

@linear-code

linear-code Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

@TheGreatAxios
TheGreatAxios marked this pull request as ready for review November 4, 2026 08:44
@TheGreatAxios

Copy link
Copy Markdown
Contributor Author
image

xAI seems to be working well now

@corbits-triage corbits-triage Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No defects reported.

@TheGreatAxios
TheGreatAxios force-pushed the cl-12085-give-each-writer-a-save-tool-for-just-its-own-document-so branch from c827617 to f5b0ddc Compare November 4, 2026 20:51
@TheGreatAxios TheGreatAxios changed the title fix(hub): give each writer a save tool for only its own document fix(hub): split writers by document kind and hand off outdated coordinators Nov 4, 2026

@corbits-triage corbits-triage Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Triage requests changes:

  • Conventions: added code matches a code pattern
    • apps/hub/src/projects/coordinator-upgrade.ts:441-450 promise-chain: Promise chain; use async/await with try/catch.
    • apps/web/src/api/conversation.ts:51 empty-list-fallback: Invented fallback `?? []`; handle the missing value instead.
    • apps/web/src/api/conversation.ts:52 empty-list-fallback: Invented fallback `?? []`; handle the missing value instead.
  • Invented fallbacks: added code matches a code pattern
    • apps/hub/src/mail/conversation-routes.ts:135 empty-fallback: Invented fallback (an empty string, list, object or zero); handle the missing value instead.

@TheGreatAxios
TheGreatAxios force-pushed the cl-12085-give-each-writer-a-save-tool-for-just-its-own-document-so branch from f5b0ddc to 9447416 Compare November 4, 2026 21:56

@corbits-triage corbits-triage Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Triage requests changes:

  • Conventions: added code matches a code pattern
    • apps/hub/src/mail/conversation-routes.ts:223-231 promise-chain: Promise chain; use async/await with try/catch.
  • Invented fallbacks: added code matches a code pattern
    • apps/hub/src/mail/conversation-routes.ts:140 empty-fallback: Invented fallback (an empty string, list, object or zero); handle the missing value instead.
    • apps/hub/src/mail/conversation-routes.ts:214 empty-fallback: Invented fallback (an empty string, list, object or zero); handle the missing value instead.

@TheGreatAxios
TheGreatAxios force-pushed the cl-12085-give-each-writer-a-save-tool-for-just-its-own-document-so branch from 9447416 to 4c6c4ca Compare November 4, 2026 22:04
@corbits-triage

corbits-triage Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Merged before Triage finished on 952ac67.

Grok read the writer's four-kind union schema as having no fields and sent
empty saves. Each document kind now has its own writer package whose
write_artifact lists that kind's fields flat; the hub adds the kind.
Writers accept a kind matching their own, which models echo from the task.
The scope keeps writer for non-coordinator bundles frozen before the split.
deploy_writer offers only writer kinds, and each role's packages must share
one offering to count as current.
Each writer package has its own key in the install record and project scope, so one key returns its deployment; a single package table maps each package to its role for build, install and upgrade. An unreadable install record now reinstalls the tenant instead of refusing every scope read, and the up-to-date check matches each package against its own offering. A contract test keeps the scope readable by specialists frozen on the last release.
@TheGreatAxios
TheGreatAxios force-pushed the cl-12085-give-each-writer-a-save-tool-for-just-its-own-document-so branch from 4c6c4ca to 952ac67 Compare November 4, 2026 22:33
@TheGreatAxios
TheGreatAxios merged commit 5ce8200 into main Nov 4, 2026
9 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.

1 participant