Repository navigation
workflow: log the source graph when a claim yields to a Bot - #2481
Merged
Merged
Conversation
Collaborator
|
Verdict: PASS at b24a1be Ran at this tip: Red first, one file, one command: with only Review, T2 (
Not run: the smoke test (no |
This was referenced Nov 5, 2026
Closed
ingest() resolved `from` and then let both early returns attach the new target without it: a card handed to a local Bot, and a card handed back to a lane that already runs it, left the source workflow's log silent, so the card vanished from the graph that lost it (ThinkFlowLab#2480). The push is now one closure called on every leg that writes the new claim — still once per write — and a Bot target is named by its roster name instead of its id. An ingest that changes nothing still writes nothing. 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 the two early returns match that sentence, so there is no new wording to document.
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.
Fixes #2480
Owner: Dev-5
Reviewer: Birfy
Written-by: FlyBot Dev-5
Claim-Id: fe151eacfb6f475dbe97bd6c4c3430df
Risk tier: T2 —
plugins/**is a T2 path (plugins/workflow/test/**reads T2 ahead of itsplugins/*/test/**T1 rule);changelog.d/**is T1.risk-gaterun offline over the three changed files:risk-tier: T2; basis: plugins/workflow/src/service.js=T2, plugins/workflow/test/claim-reroute-log.test.js=T2, changelog.d/2480-reroute-bot-source-log.fixed.md=T1, 93 changed lines.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" — and this change makes the two early returns match that sentence, so there is no new wording to document.What was wrong
#1668/#2470 gave the source graph its line, but only on the leg that reaches
assign().ingest()resolvesfromand then two early returns attach the new claim and leave before the push:decision.kind === 'bot'— a card that yields to a local Bot (anassigneenaming it, or abot:token);queuedOrRunning(...)— a card handed back to a lane that already runs it:already: true, nothing starts, and the graph that lost it says nothing either.In both, the claim moves and the source log stays on its old line, so the card simply disappears from the graph that lost it. The claim can yield to a
bot:token or an assignee naming a local Bot (invariant 8), so this is the documented contract applied to the legs that skipped it, not a new feature.What this changes
logSource()closure, called from the bot early return, from thequeuedOrRunningearly return, and fromfinish— so each of the three lands exactly one line inside that leg's singlewrite(), and the targets' own lines are untouched.Chief), not its id: when the decision is a Bot,tois resolved frombots(), falling back to the id for a roster that no longer lists it. A workflow destination is named exactly as before.prev?.key === keyreturn both stay ahead of the push, so a repeat ingest adds no line and no bytes.Red first
cd plugins/workflow && TZ=UTC node --import ./test/resolve.mjs --test test/claim-reroute-log.test.js, on clean mainf8ec27c2with only the new cases added and no source change:Both failures are the same shape: the source log does not move (
4 !== 5), which is the defect. After the fix the same assertions pass and the workflow suite is green.One case rewritten, not deleted
#1668: already:true appends 0 entries, even on a reroute whose target already runs the cardpinned the queued leg's silence in its own assertions (an already:true ingest writes no source line) — that is the behaviour this issue names as the defect, so it could not stay. It is rewritten in place, same sequence and same return-value assertions, now asserting the one line, the untouched target log and the moved claim. The red-first run above carried both new cases; the queued one was then folded into that case rather than kept as a second copy of the same scenario, which is why 7 tests were red-run and the file ends with 6 (5 kept, 1 new).Ran
TZ=UTC ARCH_DOCS_BASE=f8ec27c289babf9c266580d5a7766c29e681235a npm run verify— exit 0,# fail 0: core 2893/2893, social 577/577, tree 137/137, timeline 141/141, workflow 433/433,.github671/671, interop 37/37, live-e2e 26/26 — 4915 passed, 0 failed;arch-docs: OK (3 changed file(s)).node scripts/ds-bot-patches.mjs check—ok ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70 (tree 5834c00, v0.1.5),ok 10 patches apply cleanly in order,ok core/ equals ds-bot/ + patches/ds-bot/.cd plugins/workflow && TZ=UTC node --import ./test/resolve.mjs --test "test/*.test.js"— 433 passed, 0 failed (432 on the base + the one new case).Not run: the smoke test (no
index.js/src/host/change), typecheck, actionlint.Checkpoint
{ "pr": 2481, "claim": "Dev-5", "issue": 2480, "summary": "A claim that yields from a workflow to a local Bot now leaves one line on the source graph saying where the card went. The same line is written when the card is handed back to a lane that already runs it, where nothing starts but the source log used to stay silent. Both ride the write that attaches the new claim, so each lands once. A Bot destination is named by its roster name, and an ingest that changes nothing still writes nothing.", "files": ["plugins/workflow/src/service.js", "plugins/workflow/test/claim-reroute-log.test.js", "changelog.d/2480-reroute-bot-source-log.fixed.md"], "checks": { "ran": "TZ=UTC ARCH_DOCS_BASE=f8ec27c2 npm run verify; node scripts/ds-bot-patches.mjs check", "result": "green", "at": "b24a1be9e8b8af48835d7f95e0caa900dd7655ba" }, "next": "none — ready for review" }