Skip to content

Log a re-matched card on the source workflow - #2470

Merged
Birfy merged 1 commit into
mainfrom
dev/1668-reroute-source-log
Nov 5, 2026
Merged

Birfy merged 1 commit into
mainfrom
dev/1668-reroute-source-log

Conversation

@Birfy

@Birfy Birfy commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Written-by: Triage
Fixes #1668
Owner: Triage
Reviewer: Reviewer
Tip SHA: b079ab5
Base: cf4e4b5
Docs-not-needed: no — docs/subsystems/workflow.md is updated in this diff.

What changed

  • plugins/workflow/src/service.js: the re-route branch of ingest now pushes one Task re-matched · {task} → {to} system line onto the source workflow, inside the same write() that attaches the new target. There is no extra write, and the target's own entries are untouched.
  • plugins/workflow/test/claim-reroute-log.test.js: the issue's five acceptance items as assertions — the source log gains exactly one entry naming the task and the destination; the target matches a fresh assignment entry for entry; a claim that simply matches writes no bytes and no mtime; already: true appends 0; MAX_MESSAGES = 200 keeps the newest line.
  • docs/subsystems/workflow.md: one sentence in the auto-assign rule (§8).
  • changelog.d/1668-reroute-source-log.fixed.md.

Tests (red first)

With plugins/workflow/src/service.js reset to the base blob, the new file is red:

$ cd plugins/workflow && TZ=UTC node --import ./test/resolve.mjs --test test/claim-reroute-log.test.js
not ok 1 - #1668: a reroute leaves exactly one line on the source workflow, naming task and destination
  error: the source log gained exactly one entry
not ok 5 - #1668: MAX_MESSAGES keeps the source log at 200 and keeps the newest line
# tests 5
# pass 3
# fail 2

At this tip all five pass.

Ran at b079ab5:

  • cd plugins/workflow && TZ=UTC node --import ./test/resolve.mjs --test "test/*.test.js" — # tests 427, # pass 427, # fail 0.
  • node scripts/ds-bot-patches.mjs check — exit 0 (skipped pin (no git); 10 patches apply cleanly; core/ equals ds-bot/ + patches/ds-bot/).
  • node .github/scripts/changelog.mjs check — 17 fragments well formed.
  • node scripts/lint-plugins.mjs workflow — 0 errors, 16 pre-existing warnings.

Not run: the rest of npm run verify (core suite and lint, social/tree/timeline suites) — this diff touches none of them, and this host has no git.

Checkpoint

{"pr":2470,"claim":"Triage","issue":1668,"summary":"A card held by one workflow and re-matched into another left no trace on the source side: the source graph showed the held card vanish with no explanation. The re-route branch of ingest now pushes one Task re-matched line onto the source workflow, inside the same store write that attaches the new target, so nothing is written twice and the target's entries stay exactly as before. The new test pins all five acceptance items from the issue, including the matching-claim no-op and the 200-message cap.","files":["plugins/workflow/src/service.js","plugins/workflow/test/claim-reroute-log.test.js","docs/subsystems/workflow.md","changelog.d/1668-reroute-source-log.fixed.md"],"checks":{"ran":"cd plugins/workflow && TZ=UTC node --import ./test/resolve.mjs --test "test/*.test.js"","result":"green","at":"b079ab521abefab3ffdfbd128e0bb8aee2dbcecc"},"next":"none — ready for review"}

@Birfy Birfy added the agent-pr Pull request opened by an agent label Nov 5, 2026
@Birfy Birfy self-assigned this Nov 5, 2026
When a card held by one workflow was re-matched into another, only the target
side got its "Task assigned"/"Started" lines: the source graph showed the held
card vanish with no explanation. The re-route branch of ingest now pushes one
`Task re-matched · {task} → {to}` system line onto the source workflow, inside
the same write that attaches the new target — no extra write(), and the
target's own entries stay exactly as they are.

The new test pins the issue's five acceptance items: source +1 naming the task
and destination, target entry-for-entry as a fresh assignment, the
matching-claim no-op writing no bytes or mtime, already:true appending 0, and
MAX_MESSAGES = 200 keeping the newest line. Reverting the source change makes
it red.
@Birfy
Birfy force-pushed the dev/1668-reroute-source-log branch from 46cb796 to b079ab5 Compare November 5, 2026 00:16
@Birfy

Birfy commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator Author

Verdict: PASS at b079ab5
Written-by: Reviewer
Attestation: b079ab5 role=Reviewer

Ran at this tip:

$ cd plugins/workflow && TZ=UTC node --import ./test/resolve.mjs --test test/claim-reroute-log.test.js
# tests 5  # pass 5  # fail 0
$ cp src/service.js /tmp/tip-service.js.bak && cp <base cf4e4b5a blob> src/service.js && TZ=UTC node --import ./test/resolve.mjs --test test/claim-reroute-log.test.js
# tests 5  # pass 3  # fail 2
$ cp /tmp/tip-service.js.bak src/service.js

Red first, one swap: with plugins/workflow/src/service.js at base cf4e4b5aa2e40cf1bbd842a19d449c0dffdcc9c8 the same file goes red (# tests 5 # pass 3 # fail 2), failing at test/claim-reroute-log.test.js:201 — expected Task re-matched · {task} → {to}, actual Started · {task} · {nodes}. Restored, re-run green. Not run here: the rest of npm run verify (core, social/tree/timeline) — the diff touches only plugins/workflow/, docs/subsystems/workflow.md and one changelog fragment.

Gate facts at this tip: tests-ok success, merge-gate success, package success, plugins (workflow|tree|social|timeline) success; only enqueue-guard is red and its reason is exactly "no Verifier report names the tip b079ab5" — that refusal is what this PASS clears. Tier from the risk job log: risk-gate (report only): PR #2470 tier T2, so a PASS at the tip is required and this is it.

Review: the change is 15 added lines in plugins/workflow/src/service.js:1815-1847 — one condition (from only when a workflow held the card and the match moves it) and one push(from.id, …) inside the existing write() that attaches the new target, so the source side gains exactly one system line and the target's entries are untouched. The prev?.key === key early return still makes a matching claim already: true with no bytes written, and the push goes through the same MAX_MESSAGES trim the other entries use. Docs: docs/subsystems/workflow.md gets the auto-assign sentence and the PR body carries a non-trivial Docs-not-needed: line; changelog.d/1668-reroute-source-log.fixed.md is a well-formed fixed fragment. Empty Reviewer:/Owner: lines are present and differ (Triage / Reviewer), agent-pr is set, the checkpoint block is well formed. No file outside the reviewed change set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

workflow: a card re-matched into another workflow leaves no trace in the source graph's log

1 participant