Repository navigation
fix(bin): only claim a task's PR from meta or a ready-signal line - #4148
Conversation
|
CI note: Behavior portable parallel 1 is the only non-green check. The runner cancelled it at the workflow's 10-minute cap (the known shard-timeout issue that #4123 addresses) rather than reporting any test failure. The job log shows every test that ran passing, then the cap cancellation arriving mid-suite: All 6 test files that completed in the shard exited 0 (278 passing assertions, zero failures). The cancellation cut the run mid |
Intent
Captain, 2026-09-10: the effort-impact triage (data/fm-issue-triage-effort-impact-2/report.md) picked three upstream issues and the captain ruled "pick 3 issues and get them done in the firstmate repo": ship this one as a PR to kunchenguid/firstmate. The hard rule from that triage: touch NO hot file (bin/fm-spawn.sh, bin/fm-test-run.sh, bin/fm-teardown.sh, bin/fm-watch.sh, bin/fm-bootstrap.sh, bin/fm-brief.sh, bin/fm-wake-lib.sh, tests/fm-brief.test.sh, tests/fm-teardown.test.sh, docs/scripts.md, docs/configuration.md, AGENTS.md, docs/architecture.md), add no new script and change no documented interface, so the PR cannot deadlock on rebases the way #2839 did. Load firstmate-coding-guidelines before editing. The upstream repo requires the no-mistakes attestation on every PR, and its "Behavior portable parallel" shards time out at their 10-minute cap until #4123 merges; if that shard is the only red check, close the gate on the evidence that its tests passed and say so in the PR. PR body: "Fixes #" lines, the reproduction, and the test evidence. No co-author. This pick: upstream issue #4099. In bin/fm-inactive-reconcile.sh, pr_for_task (around lines 315-326) reads meta pr= first, then scrapes a PR URL from the preferred line, then falls back to grepping the WHOLE status log with tail -1, so any PR URL a worker ever mentioned in prose, including a scout citing someone else's PR, becomes "the task's delivered PR" in the parent-channel terminal report (embedded as pr= around lines 331-337). Task kind is available in the same script (around line 475) for a scout carve-out.
What Changed
pr_for_taskinbin/fm-inactive-reconcile.shso a task's delivered PR comes only from the recordedpr=meta field or a preferred terminal line in a mode's ready-signal shape (done: PR <url>/done: PR <url> checks green); removed the fallback that grepped the whole status log withtail -1, so a PR URL merely mentioned in prose is never reported as the delivery.pr_for_taskreturns nothing for akind=scouttask, so a scout citing someone else's PR never surfaces one in the parent-channel terminal report. Dropped the now-unused<status>argument at both call sites.test_pr_field_requires_recorded_pr_or_ready_signal_lineand updated the existing ledger-delivery test to assert the newdone: PR <url>shape.Risk Assessment
✅ Low: A tightly scoped fix to a single shared helper that stops prose-mentioned PR URLs from being claimed as deliveries; it matches the DoD-instructed done-line shapes exactly, both call sites are correctly updated, no forbidden hot files are touched, and the change conforms to the authoritative intent.
Testing
Ran the smallest relevant suite, tests/fm-inactive-reconcile.test.sh, which exercises the reconcile pipeline end-to-end and asserts the actual parent-channel terminal report content rather than source text. All tests pass on the target commit. I confirmed the new test is a true regression by running it against the pre-fix base, where it fails exactly as upstream #4099 describes (a prose-mentioned PR URL and a scout URL both claimed as the delivered PR), then passes after restoring the fix. No screenshot applies: this is a shell/CLI status-log behavior change with no rendered UI surface; the evidence is a CLI before/after transcript.
Evidence: pr_for_task provenance before/after transcript
Source: pr_for_task provenance before/after transcript
BEFORE FIX (base 869ae90): not ok - a PR mentioned only in prose was claimed as the delivery: done [...]: child prose done: cleanup finished pr=https://example.test/other/repo/pull/33 ... (scout lookout line got pr=.../pull/1) AFTER FIX (target 33727ac): ok - pr= requires the recorded PR or a ready-signal terminal line, and never a scoutPipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-inactive-reconcile.test.shon target commit 33727ac - all inactive reconciliation tests pass, includingtest_pr_field_requires_recorded_pr_or_ready_signal_lineRegression confirmation: replaced bin/fm-inactive-reconcile.sh with the pre-fix base (869ae90) version and reran the file - the new test fails, wrongly claiming a prose-mentioned URL (pr=.../pull/33) and a stray scout PR; restoring the fix makes it passVerified worktree left clean (git status --short empty) after tests✅ **Document** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.