Skip to content

fix: close PR registration scan gaps - #8110

Merged
kunchenguid merged 23 commits into
kunchenguid:mainfrom
Dematom1:fm/fm-pr-reg-gaps
Nov 12, 2026
Merged

kunchenguid merged 23 commits into
kunchenguid:mainfrom
Dematom1:fm/fm-pr-reg-gaps

Conversation

@Dematom1

@Dematom1 Dematom1 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Close three remaining gaps in the watcher's PR registration scan. A registration that times out is silent: it should publish a notice that the PR merge watch could not be armed. A replacement PR URL on a newer canonical line should take over a recorded pr= so a lane does not keep watching a closed PR. Non-canonical done lines, such as done: compared against PR <url> checks green or a done line followed by a later working or failed line, must not register a PR.

What Changed

  • Tightened PR registration to accept only the newest crew-declared canonical done line, excluding prose mentions and superseded completions.
  • Let a newer canonical PR replace a recorded PR when the status log establishes that the previous URL was recorded there.
  • Queue and report a notice when PR registration is refused or times out, while retaining retry behavior.

Risk Assessment

✅ Low: The changes are narrowly scoped to watcher PR registration, replacement, and timeout notification, with surrounding shared transitions and tests reviewed and no material reachable defect found.

Testing

Live watcher verification passed: the timeout row used stubbed gh because a hung forge cannot be staged for real, as agreed; the other rows used disposable real PRs on Dematom1/firstmate. Captured both lab logs and confirmed cleanup reported zero open lab PRs and branches. The stub lab emitted incidental setup warnings but all required assertions passed.

  • Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Real watcher, real PRs on Dematom1/firstmate: a replacement PR on a newer ready line takes over pr= and the merge poll ✅ pass live real-pr-lab.log
Real watcher, real PRs on Dematom1/firstmate: a pr= the status log never named stays put ✅ pass live real-pr-lab.log
Real watcher, real PRs on Dematom1/firstmate: a prose done line, and a ready line followed by working or failed, register nothing ✅ pass live real-pr-lab.log
Real watcher, stubbed gh: a timed-out registration publishes one notice and retries ✅ pass live stub-gh-lab.log
Evidence: Stubbed gh live watcher lab

Source: Stubbed gh live watcher lab

lab code: {run-worktree} head=64614a6d82279fe0dcf9b7ae3810069a2853c2a3
.lab-live/stub-lab.sh: line 42: [: : integer expected
.lab-live/stub-lab.sh: line 46: /var/folders/nd/580vz3l92ljds7vw6j8_q3xm0000gn/T//fm-pr-reg-lab.mY9mXH/wakes: No such file or directory
sweep bound=12 secs=9 gh_reads=1 wakes: pr-register: hung reported https://github.com/o/r/pull/9 in a done line, but its PR merge watch could not be armed: registration timed out a|
converged after 1 sweep(s): the hung registration published its notice
sweep bound=12 secs=9 gh_reads=1 wakes: 
PASS: hung registration queued exactly one could-not-be-armed notice
sweep bound=30 secs=3 gh_reads=3 wakes: /var/folders/nd/580vz3l92ljds7vw6j8_q3xm0000gn/T//fm-pr-reg-lab.mY9mXH/home/state/contributions.check.sh: contributions: observation unavail|
converged after 1 sweep(s): the retry recorded the PR
PASS: the retry armed the merge watch
PASS: the retry published the poll
sweep bound=30 secs=6 gh_reads=4 wakes: /var/folders/nd/580vz3l92ljds7vw6j8_q3xm0000gn/T//fm-pr-reg-lab.mY9mXH/home/state/contributions.check.sh: contributions: observation unavail|
converged after 1 sweep(s): the replacement took over
PASS: the replacement took over pr=
PASS: the poll sidecar names the replacement
sweep bound=12 secs=10 gh_reads=3 wakes: pr-register: hung reported https://github.com/o/r/pull/11 in a done line, but its PR merge watch could not be armed: registration timed out |
converged after 1 sweep(s): the cut replacement published its notice
PASS: a replacement cut at the bound kept pr=
PASS: a replacement cut at the bound kept the poll sidecar
sweep bound=30 secs=3 gh_reads=5 wakes: /var/folders/nd/580vz3l92ljds7vw6j8_q3xm0000gn/T//fm-pr-reg-lab.mY9mXH/home/state/contributions.check.sh: contributions: observation unavail|
converged after 1 sweep(s): the cut replacement took over on retry
PASS: the retried replacement moved the poll sidecar
sweep bound=30 secs=4 gh_reads=7 wakes: /var/folders/nd/580vz3l92ljds7vw6j8_q3xm0000gn/T//fm-pr-reg-lab.mY9mXH/home/state/contributions.check.sh: contributions: observation unavail|
converged after 1 sweep(s): the control registered in the sweep the unnamed pr= was read
PASS: control: this sweep ran and registered a canonical line
PASS: a pr= the log never named stayed
sweep bound=30 secs=4 gh_reads=8 wakes: /var/folders/nd/580vz3l92ljds7vw6j8_q3xm0000gn/T//fm-pr-reg-lab.mY9mXH/home/state/contributions.check.sh: contributions: observation unavail|
converged after 1 sweep(s): the control registered in the sweep the bad lines were read
PASS: control: this sweep ran and registered a canonical line
PASS: prose registered no PR
PASS: red registered no PR
PASS: later registered no PR
PASS: failed registered no PR
LAB PASS
Evidence: Real PR live watcher lab

Source: Real PR live watcher lab

real disposable PRs on Dematom1/firstmate (base fm-lab-pr-reg/base):
  A https://github.com/Dematom1/firstmate/pull/9
  B https://github.com/Dematom1/firstmate/pull/10
  C https://github.com/Dematom1/firstmate/pull/11
  D https://github.com/Dematom1/firstmate/pull/12

=== code: head ({run-worktree}), env -i, HOME=throwaway, config/pr-register-scan present

-- a lane reports PR A, closes it, reports PR B
  A recorded: 1 sweep(s)
  forge: A is OPEN
  lane: pr=https://github.com/Dematom1/firstmate/pull/9 poll=https://github.com/Dematom1/firstmate/pull/9
PASS: head: first sweep recorded A
  B took over: 1 sweep(s)
  forge: A is CLOSED, B is OPEN
  lane: pr=https://github.com/Dematom1/firstmate/pull/10 poll=https://github.com/Dematom1/firstmate/pull/10
  merge poll reads in that sweep:
    gh pr view https://github.com/Dematom1/firstmate/pull/10 --json state -q .state
PASS: head: pr= moved to B
PASS: head: the merge poll sidecar names B
PASS: head: the sweep's merge poll read B from the forge

-- a pr= the status log never named stays put
  control registered: 1 sweep(s)
  chosen: pr=https://github.com/Dematom1/firstmate/pull/11 poll=https://github.com/Dematom1/firstmate/pull/11
  control: pr=https://github.com/Dematom1/firstmate/pull/12 poll=https://github.com/Dematom1/firstmate/pull/12
PASS: head: control, this sweep registered a canonical line
PASS: head: the unnamed pr= stayed
PASS: head: its merge poll stayed

-- a prose done line, and a ready line followed by working or failed, register nothing
  control registered: 1 sweep(s)
  prose: pr= poll=
  later: pr= poll=
  failed: pr= poll=
  control2: pr=https://github.com/Dematom1/firstmate/pull/12 poll=https://github.com/Dematom1/firstmate/pull/12
PASS: head: control, this sweep registered a canonical line
PASS: head: prose registered no PR
PASS: head: prose armed no poll
PASS: head: later registered no PR
PASS: head: later armed no poll
PASS: head: failed registered no PR
PASS: head: failed armed no poll

REAL LAB PASS
cleanup: open lab PRs=0, lab branches=0

Opt-in

This change is opt-in. It is off by default; enable it per home with touch config/pr-register-scan (home-local, not inherited by second mates). The pr_for_task ledger change (a newer ready line replacing a recorded pr=, and non-GitHub forge URLs) now applies only when this flag exists, the same flag that already gates the registration scan. Without it, the ledger behaves exactly like main. See the config/pr-register-scan section in docs/configuration.md.

Risk Assessment

⚠️ Medium: The change makes coordinated watcher, registration, and replacement-state updates with substantial concurrency-sensitive logic; inspection found no concrete source defect, but tests were intentionally not run in this review phase.

Testing

Drove the actual scan, watcher, and reconciliation scripts against disposable local homes with synthetic forge responses. Canonical-line filtering, replacement and rollback, timeout notice/retry behavior, and reconciliation opt-in/out all produced the expected observable state and output; temporary runner files were removed.

  • Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Canonical ready lines register; prose and superseded lines do not ✅ pass live PR registration scan behavior log
A newer canonical PR replaces the recorded watch safely ✅ pass live PR registration scan behavior log
A registration timeout is reported, retried, and deduplicated ✅ pass live PR registration scan behavior log
Reconciliation uses replacement PR only with scan opt-in ✅ pass live Reconciliation opt-in behavior log
Evidence: PR registration scan behavior

Source: PR registration scan behavior

ok - the scan registers nothing from a non-canonical or superseded done line ok - a replacement PR on a newer ready line takes over pr= and the merge poll ok - a timed-out registration publishes one notice, retries, and clears on success ok - a failed scan replacement restores the previous watch without degraded watching ok - the watcher sweep scans only with config/pr-register-scan present, then records a reported PR and queues a refusal or a timeout

ok - the scan registers nothing from a non-canonical or superseded done line
ok - a replacement PR on a newer ready line takes over pr= and the merge poll
ok - a timed-out registration publishes one notice, retries, and clears on success
ok - a failed scan replacement restores the previous watch without degraded watching
ok - the watcher sweep scans only with config/pr-register-scan present, then records a reported PR and queues a refusal or a timeout
Evidence: Reconciliation opt-in behavior

Source: Reconciliation opt-in behavior

ok - with the scan opt-in, a child report names a replacement or forge PR and keeps a recorded PR the log never named ok - without the scan opt-in, a child report keeps the recorded PR and accepts only a GitHub-shaped ready line targeted inactive reconciliation scenarios passed

actionable: inactive terminal outcome awaiting captain presentation: child=child state=done
ok - main direct terminal presentation has a durable receipt
ok - busy agent withholds the terminal outcome
ok - idle agent on a newer incarnation withholds the terminal outcome
actionable: inactive terminal outcome awaiting captain presentation: child=child state=done
ok - idle finished agent keeps the terminal outcome
actionable: inactive terminal outcome awaiting captain presentation: child=child state=done
ok - idle finished agent with rewritten meta keeps the terminal outcome
actionable: inactive terminal outcome awaiting captain presentation: child=child state=done
ok - dead agent keeps the terminal outcome
actionable: inactive terminal outcome awaiting captain presentation: child=child state=done
ok - a branch-actor acknowledgement retires the inactive-outcome receipt and later scans stay quiet
ok - unpushed CI-ready ship done: is not published upstream
ok - inactive reconciliation pins local readiness under its existing lock before one parent delivery
ok - a delivered ship done: skips the git gate on later polls
ok - secondmate delivers a child's terminal ledger line once, on the next poll, from the ledger alone
ok - multiline terminal outcomes are reported once before or during a state read
ok - an unterminated continuation line does not withhold a proven child outcome
ok - later status prose does not change the inactive terminal receipt identity
ok - busy child locks do not starve later ledger outcomes
ok - ledger delivery carries the report pointer, the failed verb, and each new terminal line
ok - pr= requires the recorded PR or a ready-signal terminal line, whatever its stamp, and never a scout
ok - terminal lines arriving during state reads remain ledger-owned
ok - inactive and ledger paths reconcile one raced completion without hiding later events
ok - progress after an inactive fallback starts a distinct terminal event
ok - complete long ledger lines retain distinct receipt identities
ok - a ledger line still being appended waits for its newline
ok - the remote route carries a child's ledger line once
ok - report delivers a child's final line, owes nothing twice, and refuses only an unwritable channel
actionable: child outcome needs parent report: child=child state=done (missing or unreadable parent binding .fm-secondmate-parent)
ok - a pending ship done: is delivered by report after teardown removed the worktree
ok - report preserves teardown's metadata-before-scan lock order
actionable: child outcome needs parent report: child=child state=failed (missing or unreadable parent binding .fm-secondmate-parent)
ok - relative local parent homes fail closed
ok - invalid secondmate markers block routing and surface the obligation
ok - remote parent-replies mirror input is durable and idempotent
ok - reused task ids retain per-incarnation terminal receipts
ok - legacy metadata rewrites preserve terminal receipt identity
ok - with the scan opt-in, a child report names a replacement or forge PR and keeps a recorded PR the log never named
ok - without the scan opt-in, a child report keeps the recorded PR and accepts only a GitHub-shaped ready line
targeted inactive reconciliation scenarios passed

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - medium risk

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Canonical ready lines register; prose and superseded lines do not ✅ pass live PR registration scan behavior log
A newer canonical PR replaces the recorded watch safely ✅ pass live PR registration scan behavior log
A registration timeout is reported, retried, and deduplicated ✅ pass live PR registration scan behavior log
Reconciliation uses replacement PR only with scan opt-in ✅ pass live Reconciliation opt-in behavior log
  • Created temporary targeted runners in .lab-live/ for the change-specific scenarios and removed them after execution.
  • .lab-live/pr-check-targeted.sh (selected canonical-line, replacement/rollback, timeout, and watcher-sweep scenarios)
  • .lab-live/inactive-targeted.sh (selected reconciliation opt-in and opt-out scenarios)
  • git status --short (confirmed no remaining worktree changes from validation)
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@greptile-apps

greptile-apps Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable defect was established.

Reviews (17) · Last reviewed commit: "no-mistakes(document): Document PR regis..." · Reviewed by Greptile

Comment thread bin/fm-inactive-reconcile.sh Resolved
Comment thread bin/fm-inactive-reconcile.sh Resolved
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thank you @Dematom1 for following up on the PR registration scan so quickly. Closing the silent timeout, the stale pr= after a replacement PR, and prose done: lines were exactly the edges left open. This is my first triage pass on the PR. I read head 931723ed against main 60f95dfa.

What I checked: the scan now reads a PR only from the task's newest crew-declared ready line, which must be exactly PR <url>, PR <url> checks green or PR <url> published for review. Later resolved: and captain-held: lines don't withdraw it. A newer ready PR replaces a recorded pr= only when the status log named that recorded URL, matched as a whole whitespace-separated token. A registration cut at the time bound now prints one check: pr-register: notice and retries quietly, and teardown clears its marker. The attestation binds 931723ed with every step completed. Repo invariants, Test coverage guard and "PR must be raised via no-mistakes" pass. Greptile is 5/5, and both P1 threads are fixed and resolved. The branch merges cleanly with main, and on that merge I ran tests/fm-pr-check-security.test.sh (68 ok, 0 not ok) and tests/fm-inactive-reconcile.test.sh (52 ok, 0 not ok) locally. The red "Full suite" is only because the full-ci label isn't on yet, so it isn't yours to fix.

Waiting on you for one thing: live evidence against real PRs. The lab log drives real watcher sweeps, but the gh responses are synthetic, so the forge side wasn't real. For #8086 the bar was real watcher sweeps against real PRs, and I'd like the same here. When you can, please run a lab home with config/pr-register-scan present on a real repo you own and show:

  • a lane that reports PR A, then closes it and reports PR B, with pr= and the merge poll moving to B;
  • a pr= the status log never named staying put;
  • a prose done: line, and a ready line followed by a later working: or failed: line, registering nothing.

The timed-out-registration row can stay on the stubbed gh. A hung forge is hard to stage for real, and your test covers it. Post the output here, or include it in a git push no-mistakes re-raise.

Contract-class: new-default (my own read). The scan changes are behind the opt-in config/pr-register-scan flag. But the pr_for_task change in bin/fm-inactive-reconcile.sh runs on every home: a child's newer ready line can now replace the recorded pr= in the parent's ledger report, and the fallback also accepts GitLab, Gerrit and Forgejo URLs. That's a sensible fix, but it changes the unconfigured path, so once everything is green this goes to Kun as a merge-or-leave decision rather than auto-merging.

VISION, rule by rule:

  • One captain, one interface: aligns. A timed-out arm is now reported instead of silent, and there's one notice per task, PR and reason.
  • Authority is explicit: aligns. The scan stays opt-in, and a supervisor-chosen pr= the log never named is left alone.
  • Scripts own the mechanics: aligns. Exact line shapes and exact URL tokens, with no meaning read from prose.
  • A restart is a non-event: aligns. The replacement and timeout state live in meta, poll and marker files.
  • Delegation with a spine: aligns. Prose and superseded lines can't claim a delivery, and registration still goes through the named-head gate and draft refusal.
  • The fleet outlives any vendor: aligns. It uses the shared forge URL parser across forges.
  • Scope: aligns.

Security note, not blocking: worker-written status lines can now move an armed merge watch. That only happens when the log named the old PR, and the new PR still goes through the ordinary refusals. The polls only observe.

Comment thread bin/fm-pr-check.sh Resolved
@Dematom1 Dematom1 changed the title fix(watcher): close PR registration scan gaps fix: close PR registration scan gaps Nov 3, 2026
Comment thread bin/fm-watch.sh Resolved
Comment thread bin/fm-watch.sh Resolved
@kunchenguid kunchenguid added the full-ci Maintainer go-ahead: run the full CI suite on this outside pull request label Nov 3, 2026
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thank you @Dematom1, the real-PR lab is exactly what I asked for. Real watcher sweeps on real PRs show the replacement taking over pr= and the merge poll, an unnamed pr= staying put, and prose or superseded lines registering nothing. Thanks also for fixing the timeout-notice points Greptile raised along the way. Every thread is resolved. At fdfc3406 the attestation binds the head with every step completed. On a merge with main 87f26ac7, tests/fm-pr-check-security.test.sh (70 ok, 0 not ok) and tests/fm-inactive-reconcile.test.sh (57 ok) pass locally. Contract-class: new-default (unchanged: the parent ledger's pr_for_task change runs on every home). I've started the full suite. If it's green, this goes to Kun as a merge-or-leave decision, so from there it's waiting on Kun, not you. Nothing more is needed from you.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: the Full suite is green on fdfc3406, so this is now waiting on Kun, not you, @Dematom1. Thank you for the real-PR lab and for working through every review point.

Kun, the decision: this closes three gaps in the watcher's PR registration scan. A timed-out registration now publishes a notice that the merge watch couldn't be armed (and still retries). A newer canonical done line with a replacement PR takes over a recorded pr= when the status log named the old one. Prose mentions and superseded done lines no longer register a PR. The scan itself stays behind config/pr-register-scan, but the parent ledger's pr_for_task change in bin/fm-inactive-reconcile.sh runs on every home, so contract-class: new-default. Options: merge as is, or ask for the ledger part to be gated too. Security FYI, not blocking: a worker-written ready line can move an armed merge watch, but only when the status log named the old PR, and the polls only observe. Rockets: none. It merges cleanly with main c6b62326.

@Dematom1 Dematom1 changed the title fix: close PR registration scan gaps fix: gate PR registration scan ledger changes Nov 8, 2026
Comment thread bin/fm-pr-check.sh Resolved
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thank you @Dematom1. Tip moved to 0b2972de (past the Nov 3 captain card on fdfc3406). I re-read this head against main bf05a4fc.

The ledger conversion is what the captain card offered as the other option: pr_for_task now returns early when config/pr-register-scan is absent, keeping recorded pr= and only the existing GitHub-shaped done: PR <url> fallback. Your flag-absent live parent-channel output is identical to main. Contract-class is now opt-in (reclassified from new-default). The no-mistakes attestation binds this head with every step completed. Coverage guard, repo invariants and the no-mistakes check pass. The full-ci label is already on; Full run 42441478018 is still in progress, and I am not treating that as red.

Waiting on you for Greptile's open P1 ("Completed PR gets replaced" on bin/fm-pr-check.sh). The scan checks retirement while collecting candidates, before the slower forge reads. A merge that finishes during those reads can still replace a completed delivery and move its poll. Your latest commit adds a retirement/merge-notice recheck under the task-metadata lock immediately before replacement; Greptile reviewed this same head (0b2972de) and still asks for a shared lock around that retirement check and the replacement write. Please fix that race or reply on the thread saying why the current lock is enough. Until that P1 is fixed or answered, this stays with you even if Full comes back green.

This is waiting on you, not on Kun. The earlier captain card does not apply to this new head while that review point is open.

@Dematom1 Dematom1 changed the title fix: gate PR registration scan ledger changes fix: close PR registration scan gaps Nov 8, 2026
Comment thread bin/fm-pr-check.sh Resolved
…nly ready lines

The watcher's PR registration scan had three remaining gaps.
A registration cut at the scan's bound was silent, so a task that always
timed out never produced a notice; it now reports once per task and PR that
the merge watch could not be armed, and runs under the grace-bounded runner so
its cleanup trap finishes.
A recorded pr= was never replaced, so a lane that closed a PR and opened
another kept watching the closed one; a newer ready line now takes over a pr=
its status log named, and a pr= the log never named stays the supervisor's.
Any done line naming a PR registered it; only the newest crew-declared line in
an exact ready shape now counts.
…e URLs through the shared parser, while retaining legacy `/pull/<number>` URLs on unconfigured hosts. Added a GitLab merge-request replacement report case. `bash -n` and `git diff --check` pass. `bash tests/fm-inactive-reconcile.test.sh` fails earlier at “ledger fallback did not prefer the terminal ready line PR,” before reaching the new test
…ncile.sh`; the unconfigured-host `/pull/<number>` fallback now matches as intended. Verified with `FM_LIVE=0 bash tests/fm-inactive-reconcile.test.sh` (passed)
The scan wrote its once-only marker before the watcher queued the notice, so a
watcher that stopped or failed to append in that window lost the notice, and
the marker kept later sweeps silent. The scan now queues the wake itself, then
writes the marker, then prints, so a stop between them repeats a notice rather
than losing it. Both the timeout and the refusal paths share this order.
…registration scan-cut reason, so an interrupted candidate scan is not only printed. Verified `bash -n bin/fm-watch.sh` and `git diff --check`
…tinguishing the watcher’s outer check cut from scan-generated notices; outer-cut wake append failures now fail the watcher. Added a watcher regression test. `bash -n` and `git diff --check` passed; the security suite passed 43 tests before the 300-second timeout, prior to reaching the new test
…st captures `real_sed` before invoking the watcher and embeds that path in the fake. `bash -n` and `git diff --check` passed. The full security test script timed out after 60 seconds, before reaching this regression test
Without the opt-in, pr_for_task keeps main's behavior: a recorded pr= always
stands and only a GitHub-shaped ready line fills in a missing one. With
config/pr-register-scan present, a newer ready line can replace a recorded
PR the status log named and any recognized forge URL is accepted.
…sk metadata lock immediately before replacement, plus a regression test for a merge notice arriving during candidate registration. Targeted security suite timed out after 300 seconds before reaching that test
…ment

The scan's recheck of a recorded PR's merge record and its replacement pr=
write now run under the task's existing merge-notification lock, the lock
fm_merge_outcome_report holds while it records a merge, so a replacement can
never interleave with recording the merge of the PR it replaces. The merge
path itself is unchanged: taking the task meta lock there instead would
deadlock a re-arm made during the notice write.
…o ShellCheck recognizes the state path consumed by sourced helpers. `shellcheck -x tests/fm-pr-check-security.test.sh` and `git diff --check` pass. Full suite is downstream of the failed lint lane; targeted security suite timed out after 300s, after 27 tests passed
…r the existing metadata and merge-notification locks, the newest status must still report the captured URL as ready. Added a deterministic regression test that waits for the slow pull/8 forge read, withdraws readiness, then checks pull/7 metadata and poll remain unchanged. ShellCheck, bash syntax checks, and git diff check pass. The targeted security suite passed 27 tests but exceeded the 300-second limit before reaching this regression test
Comment thread bin/fm-pr-check.sh Resolved
…a, scan replacements now use the existing baseline backup/restore path even when degraded watching is disabled. Added a public scan-interface regression test asserting PR A and its poll survive a failed publication. Shell syntax checks passed; `FM_LIVE=0 bash tests/fm-pr-check-security.test.sh` exceeded 300 seconds before reaching the new test
Comment thread bin/fm-pr-check.sh Resolved
Comment thread tests/fm-pr-check-security.test.sh Resolved
… the failed-replacement regression test. `git diff --check` passed. Security suite timed out after 900s; inactive-reconcile suite failed at the bounded-scan resume assertion, outside the changed code
@Dematom1

Copy link
Copy Markdown
Contributor Author

Follow-up on the open Greptile P1 ("Completed PR gets replaced" on bin/fm-pr-check.sh): fixed in f8a88c1, which holds the merge-notification lock across a scan replacement, so a merge that finishes during the forge reads can no longer be replaced. Greptile resolved that thread itself. Later commits c9bbd72, cb78f28 and 686fa8c close the remaining CI findings, and all 10 review threads are resolved on head 686fa8c.

The only red check is Behavior portable serial 9 ("Pi Calm queued operational rows": pendingBashComponents is not iterable), which also fails on main and is tracked in #8325. As far as I can tell nothing on this PR is waiting on the author now.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thank you @Dematom1, and sorry this sat on an old status. You're right: Greptile's "Completed PR gets replaced" P1 is fixed (f8a88c1 holds the merge-notice lock across a scan replacement), and the later commits close the remaining findings. On head 686fa8ce, all review threads are resolved and Greptile is 5/5. The no-mistakes attestation binds this head with every step completed, and the no-mistakes check, coverage guard and repo invariants pass. Contract-class: opt-in (re-checked against current main bb3b2d69, which merges cleanly). Without config/pr-register-scan, the watcher, pr_for_task and fm-pr-check.sh behave as on main.

Nothing here is waiting on you. The only red lane in the labelled Full run 42740010522 is Behavior portable serial 9 (pendingBashComponents is not iterable). That run tested this branch merged with main 913bb7a7, which was before main's fix in #8318. It isn't from this PR. The Full suite needs a fresh run against current main, and that's on our side.

@kunchenguid kunchenguid added full-ci Maintainer go-ahead: run the full CI suite on this outside pull request and removed full-ci Maintainer go-ahead: run the full CI suite on this outside pull request labels Nov 11, 2026
@kunchenguid
kunchenguid merged commit a02b089 into kunchenguid:main Nov 12, 2026
25 checks passed
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: this is merged. Thank you @Dematom1 — really appreciate you taking the time on this.

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

Labels

full-ci Maintainer go-ahead: run the full CI suite on this outside pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants