Repository navigation
Conversation
|
Closed as superseded — this work already landed on main via #4624. — Kun's Firstmate |
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.
A concluded validation run now reports
run completedand its PR URL. Merge or closure claims require forge evidence; run completion alone supplies none.Delivery verification: inspected published commit
1d22de1d574ee367c6296e6758a7e6445fed8730and confirmed the completion wording, shared PR URL helper, strengthened regression assertions, and removal of the redundant test function. Local review, regression tests, documentation checks, and lint passed. CI was skipped because fork workflows await upstream maintainer approval. CI has NOT run against tip1d22de1d574ee367c6296e6758a7e6445fed8730, so CI remains unverified. Both workflows reportedaction_required. The pipeline completed only after the explicitly authorized skip; its terminal outcome does not establish CI success or PR merge. Skipping CI ended this run and its CI/merge monitor.Out of scope and separately filed: the CI-readiness reader treats
no CI checks reported - still monitoring until merged or closedas green. This PR does not change that separate readiness rule.Intent
firstmate’s current-state reader rendered a concluded validation run as a merged or closed pull request while the pull request was open and the default branch untouched, which is a claim about work having landed that no forge was ever asked to confirm. This makes a merge or closure claim come only from the forge saying so, and renders a concluded run as exactly that when the forge has not been consulted, with regression coverage pinning it so the claim cannot silently return.
What Changed
bin/fm-crew-state.shnow renders a terminalpassedrun asrun completedplus the run's PR URL instead of claimingPR merged/closed, so the merge/closure claim is never synthesized from run completion alone - only forge evidence can make it.nm_append_run_pr_urlhelper, reused by both thepassedbranch and the existing held-for-merge reclassification, and corrected thenm_ci_checks_statecomment that assertedoutcome=passedimplies a merged PR (a run can pass withciskipped and the PR still open).terminal_passedtest to pin the new detail string, assert the PR URL is surfaced, and assert the output contains neither "merged" nor "closed"; documented the rule indocs/architecture.md.Risk Assessment
✅ Low: A tightly scoped, single-site change to one rendered detail string plus a two-call-site helper extraction: it removes an unproven merge/closure claim at the reader's only owner of that mapping, makes no wrong claim on any traced state, is invisible to every downstream consumer (all of which parse state/source or read PR URLs from the status log rather than this line), and is pinned by assertions that fail against the pre-fix string.
Testing
I stood the reader up the way the captain runs it - real throwaway git worktrees, realstate/<id>.meta, and ano-mistakesCLI on PATH serving liveaxi statusrun records - and drove every terminal-outcome branch this change touches, then replayed the identical driver against the base commit to reproduce the defect. Base reportedrun passed: PR merged/closedfor a run whose PR was still open; head reportsrun completed: https://github.com/o/r/pull/1. Empty and missingprfields both fall back to a barerun completedwith no dangling separator, the held-green sibling path still appends its URL after the extraction intonm_append_run_pr_url,checks-passedis unchanged, and a stale status-log event asserting "merged and closed" does not leak into the line. The composedfm-fleet-snapshot.sh --jsonthe captain actually reads shows the same before/after and splits the appended URL cleanly intodetail. The added regression assertions, run unchanged against the pre-fix tree, fail withnot ok - passed outcome reports only run completion, and the full targeted suite passes on head. No screenshot or rendered-HTML artifact applies: this change has no UI surface - its end-user output is a single terminal status line and a JSON field, both captured verbatim in the transcripts.bin/fm-crew-state.sh feat-open->state: done · source: run-step · run completed: https://github.com/o/r/pull/1; same command on base b1ad702 ->run passed: PR merged/closed(crew-state-before-a…bin/fm-crew-state.sh feat-noprwithpr: ""->state: done · source: run-step · run completed(crew-state-before-after.txt, S2)bin/fm-crew-state.sh feat-noprfieldwith nopr:key at all ->state: done · source: run-step · run completed(crew-state-before-after.txt, S2b)done: PR https://github.com/o/r/pull/3 merged and closed+ concluded run ->state: done · source: run-step · run completed: https://github.com/o/r/pull/3(crew-state-before-…state: done · source: run-step · checks green: PR held for merge (ci monitor ended): https://github.com/o/r/pull/7, identical o…bin/fm-crew-state.sh feat-cpwithoutcome: checks-passed->checks green: PR ready for reviewon both base and head (crew-state-before-after.txt, S4)bin/fm-fleet-snapshot.sh --json->current_state.detail: "run completed: https://github.com/o/r/pull/1"with state/source split intact; base emitted"run passed: PR merged/closed"(fleet-snapsho…tests/fm-crew-state.test.shrun unchanged over a base-commit tree ->not ok - passed outcome reports only run completion; on head ->ok - terminal passed run is authoritative(regression-…Evidence: fm-crew-state.sh CLI transcript, base vs head, all terminal-outcome scenarios
Source: fm-crew-state.sh CLI transcript, base vs head, all terminal-outcome scenarios
Evidence: Captain-facing fleet snapshot JSON, base vs head
Source: Captain-facing fleet snapshot JSON, base vs head
Evidence: Regression pin fails before the fix, passes after
Source: Regression pin fails before the fix, passes after
not ok - passed outcome reports only run completion (missing: 'run completed') state: done · source: run-step · run passed: PR merged/closed ...and against the fixed product (head bed96c5): ok - terminal passed run is authoritativeEvidence: Live driver script for the crew-state scenarios (reproducible)
Source: Live driver script for the crew-state scenarios (reproducible)
Evidence: Live driver script for the fleet-snapshot scenario (reproducible)
Source: Live driver script for the fleet-snapshot scenario (reproducible)
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 2 issues found → auto-fixed ✅
tests/fm-crew-state.test.sh:947- tests/fm-crew-state.test.sh:947 adds test_terminal_run_with_skipped_ci_does_not_claim_pr_landed, but neither of its two arms is required by the intent's regression-coverage requirement. Its full arm feeds the same run_passed fixture, branch, and head as the strengthened test_terminal_passed (tests/fm-crew-state.test.sh:941-943), which already fails before the fix and passes after; the appended steps[3] table with ci,skipped is never read, because the outcome branch at bin/fm-crew-state.sh:663 short-circuits before any steps parsing, so the 'skipped CI' scenario the name advertises is decorative. Its coarse arm exercises bin/fm-crew-state.sh:640, a path that already emitted 'run completed' before this commit, so its merged/closed/checks-green assertions are vacuous and could never have caught the defect. Narrower form that satisfies the intent: keep the three assertions already added to test_terminal_passed and drop the new function. The remedy is removal, not hardening.bin/fm-crew-state.sh:666- The new 'run completed' detail at bin/fm-crew-state.sh:666 drops the only signal that a terminal run had a PR at all. The run object carries pr: (run_passed emits https://github.com/o/r/pull/1), and the sibling held-green path at bin/fm-crew-state.sh:457-459 appends that URL precisely so the captain sees an artifact still awaiting a decision. After this change a concluded run whose PR is open reads as 'state: done - source: run-step - run completed' with no pointer: honest, but less actionable than before. This is a product-behavior question, and surfacing the URL would extend the change past its stated intent rather than correct what it already does, so it needs the author's call rather than an automatic fix.🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
bin/fm-crew-state.sh feat-open->state: done · source: run-step · run completed: https://github.com/o/r/pull/1; same command on base b1ad702 ->run passed: PR merged/closed(crew-state-before-a…bin/fm-crew-state.sh feat-noprwithpr: ""->state: done · source: run-step · run completed(crew-state-before-after.txt, S2)bin/fm-crew-state.sh feat-noprfieldwith nopr:key at all ->state: done · source: run-step · run completed(crew-state-before-after.txt, S2b)done: PR https://github.com/o/r/pull/3 merged and closed+ concluded run ->state: done · source: run-step · run completed: https://github.com/o/r/pull/3(crew-state-before-…state: done · source: run-step · checks green: PR held for merge (ci monitor ended): https://github.com/o/r/pull/7, identical o…bin/fm-crew-state.sh feat-cpwithoutcome: checks-passed->checks green: PR ready for reviewon both base and head (crew-state-before-after.txt, S4)bin/fm-fleet-snapshot.sh --json->current_state.detail: "run completed: https://github.com/o/r/pull/1"with state/source split intact; base emitted"run passed: PR merged/closed"(fleet-snapsho…tests/fm-crew-state.test.shrun unchanged over a base-commit tree ->not ok - passed outcome reports only run completion; on head ->ok - terminal passed run is authoritative(regression-…bash tests/fm-crew-state.test.sh(full targeted suite for the changed script - all cases pass)Live driver over the real product: real git worktrees + realstate/<id>.meta+ ano-mistakesCLI on PATH servingaxi statusrun records, runningbin/fm-crew-state.sh <id>for outcomes passed (open PR), passed (emptypr:), passed (noprfield), failed/held-green, checks-passed, and passed-with-stale-merged-logSame driver replayed against the base commit'sbin/(git archive b1ad702 bin) to reproduce therun passed: PR merged/closeddefect end to endFM_HOME=<fixture> bin/fm-fleet-snapshot.sh --json | jq '.tasks[] | {id, current_state}'on both base and head, to confirm the captain-facing composition carries the honest detail and parses the appended URL intodetailtests/fm-crew-state.test.shfrom the head commit run unchanged against a base-commit tree, to prove the new assertions fail before the fix✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.