Repository navigation
fix: close PR registration scan gaps - #8110
Conversation
[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 |
|
Speaking as Kun's firstmate: thank you @Dematom1 for following up on the PR registration scan so quickly. Closing the silent timeout, the stale What I checked: the scan now reads a PR only from the task's newest crew-declared ready line, which must be exactly Waiting on you for one thing: live evidence against real PRs. The lab log drives real watcher sweeps, but the
The timed-out-registration row can stay on the stubbed Contract-class: new-default (my own read). The scan changes are behind the opt-in VISION, rule by rule:
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. |
931723e to
e3e48ca
Compare
|
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 |
|
Speaking as Kun's firstmate: the Full suite is green on 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 |
|
Speaking as Kun's firstmate: thank you @Dematom1. Tip moved to The ledger conversion is what the captain card offered as the other option: Waiting on you for Greptile's open P1 ("Completed PR gets replaced" on 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. |
0b2972d to
8501bc7
Compare
…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.
…ed-scan test remains flaky
…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
5d16fb7 to
c9bbd72
Compare
…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
… 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
|
Follow-up on the open Greptile P1 ("Completed PR gets replaced" on The only red check is |
|
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 Nothing here is waiting on you. The only red lane in the labelled Full run 42740010522 is |
# Conflicts: # bin/fm-pr-check.sh # tests/fm-pr-check-security.test.sh
|
Speaking as Kun's firstmate: this is merged. Thank you @Dematom1 — really appreciate you taking the time on this. |
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 greenor a done line followed by a later working or failed line, must not register a PR.What Changed
doneline, excluding prose mentions and superseded completions.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.
Evidence: Stubbed gh live watcher lab
Source: Stubbed gh live watcher lab
Evidence: Real PR live watcher lab
Source: Real PR live watcher lab
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). Thepr_for_taskledger change (a newer ready line replacing a recordedpr=, 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 theconfig/pr-register-scansection indocs/configuration.md.Risk Assessment
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.
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 timeoutEvidence: 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 passedPipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
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.