Repository navigation
Conversation
|
At |
|
An automatic pipeline repair added an unrelated watcher-wait change in |
fe60b28 to
83c7b17
Compare
|
Speaking as Kun's firstmate: Thanks @Moshik21, and thanks for the detailed scenario transcript. I read the whole diff at Contract-class: new-default. This changes what happens on a fresh install. On any GitHub base branch with no required checks, which is common for a captain's own projects, On VISION, the parts Kun will weigh:
Before it goes to Kun, I need two things from you. This is waiting on you:
CI: Behavior portable serial 2 was cancelled at the 30-minute limit (the known #7255 ceiling), and everything else is green. I re-ran that job once (run 39499574511). Please re-raise through |
1f6ea87 to
81da486
Compare
|
Speaking as Kun's firstmate: Thanks @Moshik21, this covers both things I asked for on
The one red check is Behavior portable serial 2. It was cancelled at the 30-minute ceiling (#7255), which isn't caused by this PR. I've re-run that job once. Nothing else is needed from you. The contract class is still new-default: on a GitHub base with no required checks, a fresh install would start refusing merges that go through today. Once CI is green, this goes to Kun as a merge-or-leave decision. That hold is Kun's call, not something waiting on you. |
81da486 to
7c5bc84
Compare
|
Speaking as Kun's firstmate: Thanks @Moshik21 for refreshing this onto current main. I compared the new head
CI run 40459004178 on this head is still in progress, so I'm waiting on that. Nothing else is needed from you. The contract class is still new-default: on a GitHub base with no required checks, a fresh install would start refusing merges that go through today. Once this run is green, it goes to Kun as a merge-or-leave decision. That hold is Kun's call, not something waiting on you. Your own risk note, that the suite record isn't bound to the validated head, is one of the things he'll weigh. |
7c5bc84 to
af93890
Compare
[Critical impact] The PR appears safe to merge; no outstanding or new actionable issues were found. Reviews (4) · Last reviewed commit: "test(bin): give the waived-red behind ca..." · Reviewed by Greptile |
|
Refresh, 2026-11-12. New head
No Checks: Known follow-ups, not changed in this refresh: the two Greptile comments on this head. The |
|
Speaking as Kun's firstmate: thanks @Moshik21 for the refresh onto This is waiting on you (author): the two open Greptile P1s need fixing in this PR. You called them follow-ups that would change the guard's contract. The guard is new in this PR, so fixing them completes its contract rather than changing an existing one:
After that, please resolve the two threads and re-raise through |
… base has no required checks On GitHub, when the base branch has no required checks, fm-pr-merge.sh refuses a head behind the live base and requires the ship worker's recorded full-suite result bound to that base commit, with an explicit no-suite escape and the attended override. The direct-PR and no-mistakes briefs now tell the worker to record it as its last step.
…d suite result The captain-hold lifecycle merge cases use a fake gh whose base reports no required checks. The merge guard now also reads a forge compare and the worker's recorded suite result for such a base, so the fake answers the compare with a current base and run_pr_merge records a passing suite against it.
…fixture regression. The fake GitHub base in tests/fm-pr-check-security.test.sh reports no required checks, so the new fail-closed guard in bin/fm-pr-merge.sh (`github_unchecked_base_refusals`) needs a compare read and a recorded suite result. The fixture supplied neither. The invariant is that any merge-driving fixture against a base with no required checks must supply a compare read (behind_by=0 and a valid base_sha) and a suite=pass record bound to that same base. I kept the prior agent's 14-line candidate, which is the only change in the worktree. It adds three things: - **Compare handler:** the fake `gh` answers `api repos/*/compare/*` with `behind_by=0` and `base_sha=eeee…`. - **`write_suite_record` helper:** it writes `suite=pass`, `base=eeee…` and `ran=…` to the record path. `write_task_meta` calls it, so every task written through that helper gets a record. - **Two direct calls:** one in the legacy task-id merge flow and one in the teardown-race case. Those two don't go through `write_task_meta`. Production code is untouched, and I added no test cases. Verified: `bin/fm-test-run.sh tests/fm-pr-check-security.test.sh` exited 0 with 47 `ok` lines, no `not ok`, and `failed=0`. It took about 11.9 minutes. `bash -n` on the test file also passes. Not run: the repo's lint and other required checks. As instructed, I did not re-run the upstream baseline or the unmodified branch. ci-2 (the cancelled serial 2 job) needs no code change. The change is uncommitted in the worktree, ready for the pipeline to commit and publish
…iling script was tests/fm-backend-herdr-presentation-e2e.test.sh. It failed at "concurrent secondmate recovery" with "herdr presentation recovery could not acquire its session lock; refusing a concurrent resume". All other Herdr scripts passed. The rm "Permission denied" lines in the log are temp-dir cleanup noise after the failure. Invariant: a test that expects two concurrent exact-resume recoveries to serialize on the Herdr session lock must wait for the lock. The default is a bounded attempt of about 5s, then a hard refusal. On a slow CI runner the first recovery can hold the lock longer than that. Cause: a pre-existing timing race in the test. The PR touches only the merge, DoD and brief scripts and their fixtures, none of which are on the Herdr presentation path. Fix: in tests/fm-backend-herdr-presentation-e2e.test.sh I added the documented `--herdr-resume-lock-wait` flag to the two concurrent recovery spawns (primary-wave-resume and bravo-wave-resume). No production code changed. The other backgrounded spawns in the file are clean creates, which fall back flat on contention. The default-refuse test and the existing opt-in wait test are untouched. Verified: `bash -n` on the edited test file passes. NOT verified: the local run of `bin/fm-test-run.sh tests/fm-backend-herdr-presentation-e2e.test.sh` was killed at the background time limit before it finished, so the changed test has not been shown to pass locally. Lint and the other required checks were not run. The next CI run of the Herdr job will confirm the fix. ci-2 (the cancelled serial 2 job) needs no code change, per the earlier decision
…e suite record step Add regression tests to tests/fm-pr-merge.test.sh for a head behind the base tip, a stale recorded base, suite=fail, suite=none with and without a reason, a missing, symlinked or unparsable record, an unreadable compare, and the attended override (waived when attended, not while away). Add a tests/fm-dod-lib.test.sh case for the suite record step in the PR-publishing DoD. Remove the unrelated --herdr-resume-lock-wait change to tests/fm-backend-herdr-presentation-e2e.test.sh that an automatic CI repair added.
…rgument Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… the suite record once The --attended-override waiver of the behind-base and suite-record conditions is now refused when the away-posture record appears before the merge runs under its lock, like the other attended-only waivers. The suite record is read into one copy before its fields are parsed, so a record being rewritten cannot pair an old suite= with a new base=, and the worker brief says to replace the record with a temporary file and mv.
af93890 to
047b954
Compare
The recorded full-suite result carried only base=, so a passing record made before a later push still approved the newer head. The record now names head=<sha> and the merge guard requires it to equal the live pull request head before accepting suite=pass. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Speaking as Kun's firstmate: thanks @Moshik21, all three P1s are closed in the code. I've queued the full suite (
All three threads are resolved, and Greptile is 5/5 on Contract class: still new-default. On a GitHub base with no required checks, a fresh install would start refusing merges that go through today, and PR-publishing briefs gain a suite-record step. So if the suite is green, this goes to Kun as a merge-or-leave decision. VISION.md: every rule aligns. It strengthens a refusal path and never runs repository code. Nothing is needed from you right now. It's waiting on CI. |
…ad matches the suite record Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Fixes for the two review threads, 2026-11-12. New head
Checks on this head: 19 of 22 full-suite jobs passed, plus Greptile Review and the no-mistakes check. |
Intent
Fix the two review findings on open upstream pull request 7495 (guard merges on bases with no required checks) on kunchenguid/firstmate that the maintainer says must be fixed in the PR; the owner approved publishing the fixes on 2026-11-12. The pull request makes bin/fm-pr-merge.sh refuse a merge on a GitHub base branch with no required checks unless the head is not behind the live base tip and the ship worker's recorded full-suite result holds (suite=pass bound to the live base commit, or suite=none with a reason), with an --attended-override that waives both conditions only while no away-posture record exists. The two findings the maintainer asks to fix in the PR: (1) Waiver survives going away: on main, require_current_away_authority re-checks every attended-only waiver (--allow-red, --allow-missing, --allow-no-pipeline) under the away-record lock and refuses if an away record appeared since preflight, but the --attended-override waiver of the behind-base and suite-record conditions is decided once from the pre-lock posture and never re-checked, so a merge can run under away authority with neither condition checked; add the matching re-check (refuse, or re-run the two conditions, when the waiver was used and the away posture is now true), with a test. (2) Separate reads mix suite results: suite=, base= and reason= come from three separate reads of a record file the worker may be rewriting, so an old suite=pass can pair with a new base=; read the record once and parse that copy, ideally also have the worker brief say to write the record atomically (temporary file then mv), and add a test if possible.
What Changed
bin/fm-pr-merge.shnow refuses a GitHub merge on a base branch with an empty required-check set unless the head is not behind the live base tip and the ship worker's recorded full-suite result holds (suite=passbound to the live base commit, orsuite=nonewith areason=).--attended-overridewaives both conditions only while no away-posture record exists.require_current_away_authoritynow re-checks that waiver under the away-record lock and refuses if an away record appeared after preflight. The suite record is read once and parsed from that single copy, sosuite=,base=andreason=cannot come from different rewrites.bin/fm-dod-lib.shadds a suite-record step to the PR-publishing definitions of done. The worker writes<data>/<task-id>/suite-resultas its last step, using a temporary file andmvso the write is atomic.fm_dod_blocktakes the data directory as an eighth argument, passed bybin/fm-brief.shandbin/fm-promote.sh.bin/fm-pr-lib.shgainsfm_pr_suite_record_pathas the one owner of the record location.docs/architecture.mdanddocs/scripts.mddescribe the new condition. Tests intests/fm-pr-merge.test.sh,tests/fm-dod-lib.test.sh,tests/fm-pr-check-security.test.shandtests/fm-captain-hold-lifecycle.test.shcover the no-required-checks refusals, the suite-record step, and the dod-block argument.Risk Assessment
✅ Low: Both required fixes are present and I could not construct a failing sequence for either: the attended-override waiver is re-checked under the away-record lock, and the suite record is read once and parsed from that copy.
Testing
I drove the real
bin/fm-pr-merge.shagainst a fakeghthrough the five no-required-checks tests, using a trimmed copy of the merge test file. All five pass. Those cover the refusals, thesuite=noneattestation, the attended-only override, the new late-away-record refusal, and the single-read suite record. Both new tests fail against the pre-fix script and pass against the fix. The brief wording test intests/fm-dod-lib.test.shalso passes. I did not run the fulltests/fm-pr-merge.test.sh(about 20 minutes). It is not live Herdr or tmux product validation, since the merge guard is exercised only through the fakegh. The worktree is clean; temporary files were removed.gh pr mergeEvidence: Trimmed merge-guard run against the fixed script (all ok)
Source: Trimmed merge-guard run against the fixed script (all ok)
Evidence: New tests failing against the pre-fix script
Source: New tests failing against the pre-fix script
Evidence: DoD lib test run
Source: DoD lib test run
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
🔧 **Rebase** - 1 issue found → auto-fixed ✅
bin/fm-pr-merge.sh- merge conflict rebasing onto origin/main🔧 Fix applied.
✅ Re-checked - no issues remain.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
gh pr mergeTrimmed copy oftests/fm-pr-merge.test.sh(same harness and fixtures) running only the five no-required-checks tests, with all other tests stripped from the copy. Exit 0, allok.The same trimmed run against the pre-fixbin/fm-pr-merge.sh(from047b9541^, swapped in temporarily and restored): the late-away-waiver test failed withexpected exit 2, got 0, and the torn-record test failed withexpected exit 1, got 0.bin/fm-test-run.sh tests/fm-dod-lib.test.sh: exit 0, including the new assertion that the worker brief says tomvthe record into place atomically.✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.