Repository navigation
workflow: log the source lane when a card is assigned straight to a Bot - #2487
Conversation
|
Verdict: PASS at 3a4e21e Ran at this tip: Red first, same command with The two failures are case 7 ( Checks at this tip ( Review:
|
routeBot() attached the claim and returned, so a card a lane held and the panel handed to a Bot disappeared from the source graph with no line saying where it went (ThinkFlowLab#2485). Resolve the prior workflow claim there and push the same re-matched line in the write that moves the claim. The line shape moves into logYield(), which the ingest legs share, so the four call sites cannot drift. Docs-not-needed: docs/subsystems/workflow.md invariant 8 already states the contract — "A claim that yields leaves one line on the source workflow's log — Task re-matched · <task> → <destination> — in the same store write that attaches the new target". This change makes routeBot follow it and adds no new contract.
A second assign({ botId }) for a card the same Bot holds rewrote the store with
identical bytes, so the file's mtime moved (CI caught it on ThinkFlowLab#2487). Return the
ingest legs' already:true shape before rememberClaim/write(); the card's line
and the store stay untouched.
Fixes #2485
Owner: Dev-5
Written-by: FlyBot Dev-5
Reviewer: Birfy
Claim-Id: c4637240bc5e4299ae63d5802ec34b8e
Risk tier: T2 (
plugins/workflow/src/service.js)mcm: true
What changed
assign({ botId })never reaches the ingest path: it short-circuits intorouteBot(), which attached the claim and wrote, so a card a lane was holding and the panel handed straight to a Bot left the source lane silent — the graph that lost the card said nothing, and the claim silently becamebot:main. #2481 fixed the two ingest legs of the same contract; this is the third leg.routeBot()now reads the prior claim, and when a workflow lane holds the card it pushes the same one lineTask re-matched · {task} → {to}in the write that moves the claim.routeBot()builds that line through a newlogYield(); the three ingest legs keep #2481's inlinelogSourcecopy, which has the same shape, so behaviour is unchanged. The destination is the Bot's roster name (Chief), falling back to the id when the roster no longer lists it — the same rule #2480 uses.No line when no lane held the card. When the same Bot already holds it,
routeBot()returns the ingest legs'already: trueshape beforerememberClaim()/write(): no line, and no write — the second tip adds that early return after CI caught the store being rewritten with identical bytes (mtime moved).Files
plugins/workflow/src/service.js+28/−0plugins/workflow/test/claim-reroute-log.test.js+84/−0changelog.d/2485-bot-assign-source-log.fixed.md+1/−0Nothing touches
patches/ds-bot/orcore/: all three files are hand-written, sogeneratehas nothing to write andpatches checkstays a no-op.Red first
Clean base
80bc66cc, tests only,node --import ./test/resolve.mjs --test test/claim-reroute-log.test.js:Case 8 (no lane behind the card) is the third no-op guard and passes before and after. Cases 7 and 9 are the two defects — the missing line, and the write that should not happen — and both go green with the fix.
Ran
cd plugins/workflow && TZ=UTC node --import ./test/resolve.mjs --test "test/*.test.js"→# tests 436 / # pass 436 / # fail 0TZ=UTC ARCH_DOCS_BASE=80bc66cc npm run verify→ 4921 passed / 0 failed (core 2896, social 577, tree 137, timeline 141, workflow 436,.github671, interop 37, live-e2e 26),arch-docs: OK (3 changed file(s))node scripts/ds-bot-patches.mjs check→ok patches/ds-bot/ is what generate writes (generate is a no-op)Docs-not-needed:
docs/subsystems/workflow.mdinvariant 8 already states the contract — "A claim that yields leaves one line on the source workflow's log —Task re-matched · <task> → <destination>— in the same store write that attaches the new target". This change makes the direct-Bot leg follow that invariant and adds no new one. The same line is in the branch commit.Checkpoint
{
"pr": 2487,
"claim": "Dev-5",
"issue": 2485,
"summary": "routeBot() short-circuited before the ingest legs, so a card a lane held and the panel handed straight to a Bot left the source lane silent. It now reads the prior claim and pushes the same
Task re-matched · {task} → {to}line in the write that moves the claim, with the Bot's roster name as the destination. The line shape lives in a new logYield() that routeBot() calls; the ingest legs keep #2481's inline copy of the same shape. No line is written when no lane held the card; when the same Bot already holds it, nothing is written at all.","files": ["plugins/workflow/src/service.js", "plugins/workflow/test/claim-reroute-log.test.js", "changelog.d/2485-bot-assign-source-log.fixed.md"],
"checks": { "ran": "TZ=UTC npm run verify", "result": "green", "at": "3a4e21e964e55179ec4dee7a37ec970f7d9ac1fb" },
"next": "none — ready for review"
}