Skip to content

fix(crew-state): stop reporting passed runs as PR merged/closed - #3381

Closed
hajekt2 wants to merge 1 commit into
kunchenguid:mainfrom
hajekt2:fm/fm-crewstate-passed-claims-merged
Closed

hajekt2 wants to merge 1 commit into
kunchenguid:mainfrom
hajekt2:fm/fm-crewstate-passed-claims-merged

Conversation

@hajekt2

@hajekt2 hajekt2 commented Aug 31, 2026

Copy link
Copy Markdown

Intent

Stop bin/fm-crew-state.sh from claiming a pull request merged when nothing landed. In the passed outcome mapping, run completion must not be presented as PR merged or closed: passed establishes only that the validation run completed successfully, not the pull request's forge merge or closure state. Report the known run result. Keep the checks-passed arm unchanged and prefer the small wording-only change; do not add a live forge read because it must be cheap and reliable at every call site, and wrong-but-quiet reporting is the defect. Add a colocated behavioral regression test through the executable/public interface that pins the passed-outcome wording and verifies a completed run with an open, unmerged PR is never described as merged or closed. Keep the diff tight and do not refactor the state reader. Do not include, depend on, or work around PR 3328's separate active-run trust changes. Do not push commits trying to turn action_required CI or Require no-mistakes gates green, and do not merge. Shellcheck must be clean on touched shell scripts.

What Changed

  • Changed the passed outcome mapping in bin/fm-crew-state.sh so RUN_DETAIL reports run passed instead of claiming "PR merged/closed"; the checks-passed arm is unchanged.
  • Added assertions to tests/fm-crew-state.test.sh pinning the passed-outcome wording and verifying a completed run with an unmerged PR is never described as merged or closed.

Risk Assessment

✅ Low: A minimal wording-only change plus a colocated behavioral regression test that fails pre-fix, with lint clean and no reachable path left claiming merge/closure for a passed run.

Testing

Exercised the change through bin/fm-crew-state.sh's public CLI: the focused fm-crew-state suite passes with the new passed-outcome wording assertions, the new test was proven to fail against the pre-fix script (true regression coverage), shellcheck is clean on both touched scripts under the project's lint config, and a manual CLI transcript captured the actual user-visible output "state: done · source: run-step · run passed" for a completed run with an open unmerged PR — no merge or closure claim.

Evidence: fm-crew-state.sh CLI transcript for a completed passed run with an open, unmerged PR

Source: fm-crew-state.sh CLI transcript for a completed passed run with an open, unmerged PR

$ bin/fm-crew-state.sh feat-openpr # completed passed run, PR #1 still open state: done · source: run-step · run passed $ bin/fm-crew-state.sh feat-openpr | grep -iE "merged|closed" || echo "no merged/closed claim in output" no merged/closed claim in output

$ bin/fm-crew-state.sh feat-openpr   # completed passed run, PR #1 still open
state: done · source: run-step · run passed

$ bin/fm-crew-state.sh feat-openpr | grep -iE "merged|closed" || echo "no merged/closed claim in output"
no merged/closed claim in output

Pipeline

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-crew-state.test.sh — full focused crew-state behavior suite passes, including test_terminal_passed with the new assertions (asserts "state: done · source: run-step · run passed" and absence of "merged"/"closed") against the real bin/fm-crew-state.sh executable via the harness fake no-mistakes/tmux/herdr drivers
  • Regression proof: temporarily checked out the base-commit bin/fm-crew-state.sh (0866a77) and re-ran the suite — the new assertion fails with "not ok - passed run does not claim the PR merged (unexpected: 'merged')", then restored the fixed script and confirmed byte-identical restoration
  • shellcheck --norc --external-sources bin/fm-crew-state.sh tests/fm-crew-state.test.sh — clean under the project's pinned shellcheck 0.11.0 and fm-lint.sh's exact invocation flags, satisfying the shellcheck requirement on touched scripts
  • Manual end-to-end CLI check mirroring the end-user surface: invoked bin/fm-crew-state.sh directly against the harness fixture (completed run, outcome passed, PR open and unmerged) and captured the transcript showing state: done · source: run-step · run passed with grep confirming no merged/closed claim
⚠️ **Document** - 1 info
  • ℹ️ bin/fm-crew-state.sh:318 - The nm_ci_checks_state rationale comment still states that for captain-merge repos no-mistakes 'only reaches outcome=passed once the PR is actually merged'. This is pre-existing historical incident evidence for the ci-log check and was not made stale by this change (which altered only the passed-outcome presentation wording), so it was left untouched per scope discipline. It does carry a residual implication (passed implies merged) that contrasts with this change's premise that passed establishes only run completion; a future maintainer reconciling that comment with the new conservative wording may want to soften it, but verifying current no-mistakes outcome semantics was out of scope for this documentation pass.
✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-08-31T12:55:32.779652Z f2a0234 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Aug 31, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

The PR appears safe to merge, with the changed output matching the known run result and focused regression coverage protecting the intended behavior.

The change only narrows an inaccurate status detail; existing repository consumers retain the unchanged state and source fields, and no accepted functional, security, or rule-compliance issue remains.

Reviews (1): Last reviewed commit: "fix: report passed runs without merge cl..." | Re-trigger Greptile

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: reviewed this HEAD (f2a023414a85). Contract-class restore: passed now reports run passed and never claims PR merged/closed. Attestation MATCH. This is the smallest wording-only restore in the overlap set with #3434 (live forge verify plus Linear), #3421 (stale done/failed masking on different lines of the same file), and #2778. It does not add a live forge read and does not patch the same hunks as #3421.

I approved first-time fork CI 33393945837 and Require no-mistakes 33393945752 after a security read (one-line wording plus tests; no workflow files). This is waiting on CI, not on the author and not a captain hold. I will not merge until those checks are green, and I will merge at most this one of the overlap set if it stays green.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants