Repository navigation
feat(workboard): dispatch cards to Claude Code sessions on paired nodes - #18
Merged
Merged
Conversation
A card can now carry `metadata.automation.target = { kind: "node-claude",
nodeId, repoPath, worktreesRoot, baseRef?, model? }`. For such cards the
dispatcher creates the ticket worktree (`factory/<card>`) in the node's own
clone through `node.invoke` `system.run`, records its base commit with the
prepared launch, and starts a fresh Claude Code session in it through
`sessions.create` with `execNode`, `cwd`, and the card's model. Only
unrestricted dispatch may start a node ticket, and the target joins the
claim's authority check.
Node tickets cannot call Workboard tools, so the turn contract asks for a
final `workboard-report` block. `agent_end` maps it: done with passing proof
records the proof and summary and lets lifecycle sync move the card to
review; questions, blocks, failing or missing proof, and missing or invalid
reports block the card with the reason. The lifecycle sweep no longer moves a
finished node ticket to review on its own. Node tickets hold their claim for
two hours by default, and a retry reuses the worktree a failed launch left on
the card's branch.
`normalizeBoundedString` moves to `store-value-normalizers.ts` and the target
normalizer to `store-target-normalizers.ts`, keeping `store-normalizers.ts`
under its line-cap ratchet without an import cycle.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Dev-loop tickets need to run as fresh Claude Code sessions on paired nodes, in a per-ticket worktree, with a model chosen per role (design decisions D36, D38/D42, D40). Until now, Workboard dispatch could only start Gateway subagents, and node ticket sessions have no Workboard tools to report back with.
Solution
The Gateway already supports this.
sessions.createwithexecNode,cwdandmodel: "claude-cli/<model>"starts a freshclaude -pon the node in that folder, and later turns resume it. So this PR changes only the Workboard plugin; there are no core or SDK changes.Card target. A card can carry
metadata.automation.target = { kind: "node-claude", nodeId, repoPath, worktreesRoot, baseRef?, model? }.Dispatch. The dispatcher:
factory/<card>as a worktree in the node's own clone throughnode.invokesystem.run;sessions.create.Reporting. The turn contract asks the session to end with a fenced
workboard-reportJSON block.agent_endmaps that report onto the card:donewith at least one passed proof and none failedreviewneeds_inputorblockedThe 60 s sweep no longer moves a finished node ticket to
review, because that would skip the report check.Retries. Node tickets hold their claim for 2 h by default, since they can't heartbeat. A retry reuses the worktree that a failed launch left on the card's branch.
Line cap. To keep
store-normalizers.tsunder its line cap,normalizeBoundedStringmoves tostore-value-normalizers.tsand all its importers switch to it. The target normalizer moves tostore-target-normalizers.ts.Not in this slice
devpush, and node worktree cleanup (slice 2).Evidence
Real flow. I ran an isolated Gateway from this branch (profile
m1) against a Docker node host (Claude Code 2.1.293):node-claudetarget, then calledworkboard.cards.start.factory/<card>was created on the node, with its base commit recorded.b78bdb7. The base commit is its ancestor.reviewwith two passed proofs and the summary comment.Bugs the real flow found and this PR fixes:
sessions.createthat carries anidempotencyKeyis rejected ("requires an authenticated principal"), so the dispatcher no longer sends one.Tests.
dispatcher.node-ticket.test.ts(4 tests) and node-ticket cases inlifecycle-sync.test.ts(7 tests). They use a real SQLite store and fake onlygateway.request.node scripts/run-vitest.mjs extensions/workboard packages/workboard-contract: 399 passed, 64 s wall time. No real timers.Checks.
tsgo:extensions,tsgo:extensions:test,lint:extensions, the production dead-export scan,check:import-cycles, and the line-cap ratchet.main:check:test-mock-exports(3 fork test files);tsgo:core:test(node-agent-cli-runtime.test.tsfrom fix(nodes): make node-placed Claude CLI turns work end to end #16);lint:coremax-linesin 5 core files;scripts/..github/workflows/plugin-npm-release.yml, which the fork deletes. It is not part of this PR.Review.
autoreview(Codexgpt-6.1-sol, P1) found one issue: adonereport with only skipped proof could reachreview. It's fixed, and the case is covered by a test.🤖 Generated with Claude Code