Repository navigation
feat(host): route a card by its own handoff - #1791
Conversation
A card now carries its route. Recording a handoff puts the card in the target
role's pool: a card created with handoff.to starts there, and a handoff written
on a card a member holds hands it on in the same write, so the producer lets go
and the target role claims it with no supervisor step. task-drive offers a pool
with no room to every local Bot of that role, so a chain needs no shared group,
and a role with no idle member leaves the card in the pool for the next pass.
The receiving role's admission is the claim (accept) or `track_tasks { rework }`
(return), which opens one reworkOf child aimed at the producing role.
Tests: core/test/task-handoff-route.test.js (4 cases; red on the base source).
Docs: docs/subsystems/core-host.md.
core/ is ds-bot/ + patches, so the branch carries the generated form too: the two new host files and the new test go into patches/ds-bot/files/, and the one upstream file the slice touches (track_tasks' rework argument) gets its own 0017 patch. node scripts/ds-bot-patches.mjs check passes (11 patches, core/ equals ds-bot/ + patches).
…#1775) core/ is ds-bot/ + patches, so the branch carries the generated form too: the two new host files and the new test go into patches/ds-bot/files/, and the rework argument on track_tasks goes into 0002, the patch that already owns src/host/tools.js, so the series stays ten patches. The 0017 patch of the previous commit is dropped. node scripts/ds-bot-patches.mjs check passes: ten patches apply in order and core/ equals ds-bot/ + patches/ds-bot/.
|
Verdict: PASS at 8eda4ad Ran at this tip: Tier: T3 ( Scope (compare API, base CI at the tip: 14 check runs, all terminal. Review of the change itself: Not run: Observation, non-blocking: no |
Written-by: Dev
Fixes #1775
Owner: Dev
Reviewer: Reviewer
Tip SHA: 8eda4ad
Base: 92a4cf2
What
The card carries its own route (
handoff.to). Recording a handoff puts the card in the target role's pool: one created withhandoff.tostarts there, and one written on a card a member holds hands it on in the same write (the producer lets go: claim, lease and worker cleared, cardopenin the target pool). The task drive's queue pass offers a pool with no room to every local Bot of that role, so a chain needs no shared group and no graph; a role with no idle member leaves the card in the pool for the next pass, never dropped. The receiving role's admission is the claim (accept) ortrack_tasks { rework: { task, reason } }(return), which opens onetaskClass: 'rework'child withreworkOfnaming the original andhandoff.tothe producing role — the producer claims it from its own pool, and the original staysworkinguntil that child is accepted.Why
The 7 fixed workflow graphs make every handover an edge, so a new repo or kind of work needs another graph and the Chief stays a single point: the layer that runs the work does not know who owns the next step (#1775). This slice lets a card route itself between roles with one dispatch.
How
core/src/host/tasks.js:routeToPoolfromwriteContract;requeuetakes the actor label; a roomless claim goes toclaimHandoff(same compare-and-set, WIP = 1 and lease as the room queue);returnToProducerand anopenReworkbyargument open the reworkOf child for the producing role.core/src/host/task-drive.js: the queue pass keys on the role and, with no room, offers the pool to every local Bot of that role.core/src/host/tools.js:track_taskstakesrework { task, reason }.core/test/task-handoff-route.test.js(4 cases).patches/ds-bot/files/, and the newtrack_tasksargument goes into0002-flybot-api-host.patch, which already ownssrc/host/tools.js— the series stays at ten patches.Ran
node --import ./test/harness-resolve.mjs --test test/task-handoff-route.test.js— 4/4 pass at the tip; 0/4 withtasks.js,task-drive.jsandtools.jstaken back to the base blob (red first).node --import ./test/harness-resolve.mjs --test test/task-contract.test.js test/task-queue.test.js test/task-queue-lease.test.js test/task-audit.test.js test/bot-tasks.test.js test/task-drive.test.js test/tasks.test.js— 104/104 pass.Ran
node scripts/ds-bot-patches.mjs check— 11 patches apply cleanly in order,core/equalsds-bot/+patches/ds-bot/(pin skipped: no git on this box).Not run
npm run verify(core lint, plugin suites, patch check) — the local box has no full install for the whole tree; the branch is pushed for CI to run it.index.js).plugins/workflow/admission rules: not in this commit — see the checkpointnext.Checkpoint
{
"pr": 1791, "claim": "Dev", "issue": 1775,
"summary": "A card carries its own route: recording handoff.to puts it in the target role's pool in the same write, and a producer's handoff hands the card on (claim, lease and worker cleared). The task drive offers a pool with no room to every local Bot of that role, so a chain needs no shared group and no graph; a role with no idle member leaves the card in the pool for the next pass. The receiving role's admission is the claim (accept) or track_tasks { rework } (return), which opens one reworkOf child aimed at the producing role. The 7 fixed graphs and the room queue path are untouched.",
"files": ["core/src/host/tasks.js", "core/src/host/task-drive.js", "core/src/host/tools.js", "core/test/task-handoff-route.test.js", "docs/subsystems/core-host.md", "patches/ds-bot/0002-flybot-api-host.patch"],
"checks": { "ran": "node scripts/ds-bot-patches.mjs check", "result": "green", "at": "8eda4ad4379259dd37eb9ffc81051f27f3ddaf08" },
"next": "plugins/workflow/ admission config (accept/return per role) and docs/subsystems/workflow.md are the rest of the brief; core routing, pool claim and rework land here."
}