Repository navigation
fix: persist watcher wakes across supervision gaps - #29
Conversation
|
Shipped. The phone app is built and in use on main: it reaches the machine and shows the fleet (#38, #39), opens a pane as chat (#40), answers by voice (#41) and keyboard (#44), watches a pane live and flags the one that needs you (#42), and reports failures plainly (#43). A first working Viu is on the phone. Closing as delivered. |
The Land Inspection agent, on n8nThe ministry already hosts and maintains n8n. That is the best available answer n8n owns the clock, the pause, the approval queue and the run history a Where it stands
The three months the section head confirmed reproduce exactly, cell for cell, and What it does that is worth arguing aboutIt stops. Exit It never tells you the data is clean. The closing phase has no send capability in it. Not restricted, absent. The approval covers what she was shown. Every figure, every ruling that was A stale ruling announces itself. Three defects found the expensive way, recorded rather than tidied away
Not mergedThe captain picks in the morning. Two other lanes are building the same agent on |
Where this lane ended43 of 43 on the practice suite. The engineering below is the part I would defend; the argument The lane's argument, in one paragraphThe ministry already hosts and maintains n8n, and that is the best available answer to who runs this Measured
The two things worth the captain's attention⭐ Rendering one finished document and looking at it found the entire rules section in English ⭐ A confidentiality audit of the produced pack found three of four categories of internal material What is not proven, named rather than hidden
Not merged. |
A project clone commonly carries an `upstream` fork parent beside `origin`, and gh-axi may resolve that one. Verified against this clone: `gh-axi pr view 29` returned kunchenguid#29 - a different, already merged pull request by another author - instead of the #29 under review, with no error and entirely plausible output. `gh-axi pr checks 29` reported that other pull request's checks the same way. The mismatch surfaces only on a write, and then as a confusing message about blank shas. A reviewer following a brief built on bare commands would read a stranger's pull request, review it, and post findings on the wrong repository. Every gh-axi command the review brief generates and the pr-review skill prints now carries -R <owner>/<repo>, taken from the reviewed pull request's own URL, which is the only authority on where that pull request is. The head checkout goes through `gh-axi pr checkout` rather than a hand-written fetch from `origin`, for the same reason. docs/verification/pr-review.md records this and the two other vendor facts the contract states: GitHub refuses an approve review on a pull request opened by the same account, so the reviewer posts a comment review carrying its verdict in the body, and that review reads back through `gh-axi pr view --reviews`. Tests cover the new brief kind and its dispatch, including a direct assertion that no gh-axi command in a generated review brief omits its repository. Each new assertion was confirmed to fail against a mutated source before being trusted.
) * feat(bin): review a pull request with a dedicated reviewer crewmate Replace the in-session validation pipeline as the default rigor for a direct-PR ship with a reviewer that posts its findings on the pull request, where the captain can read them. bin/fm-brief.sh --review <github-pr-url> writes the reviewer contract and is its single owner: the four disciplines carried over from the pipeline (a finding is one instance of a class, read the primary source and name what you could not verify, separate a defect from a preference, and never decide a finding that would widen what the captain asked for), the numbered finding format, and the requirement that the review be posted and read back. A review is scout-shaped in every mechanical respect, so it is spawned and torn down as a scout and writes the local pointer the scout teardown gate requires. bin/fm-dispatch.sh --review dispatches one in a single call and refuses a brief whose review shape disagrees with the call. The new pr-review skill owns the path end to end - who pushes, when the pull request opens, who reviews, the merge gate, and what happens when checks are red - plus how firstmate rules on findings, posts the captain's words verbatim, and lands fixes one finding per commit. It states explicitly that this is one pass and not a pipeline: no rounds, no counters, no re-review requirement. AGENTS.md states the path in one bullet and points at the skill. The no-mistakes pipeline's code and documentation are untouched; projects that select it are unaffected. * fix(bin): name the repository on every gh-axi call a review makes A project clone commonly carries an `upstream` fork parent beside `origin`, and gh-axi may resolve that one. Verified against this clone: `gh-axi pr view 29` returned kunchenguid#29 - a different, already merged pull request by another author - instead of the #29 under review, with no error and entirely plausible output. `gh-axi pr checks 29` reported that other pull request's checks the same way. The mismatch surfaces only on a write, and then as a confusing message about blank shas. A reviewer following a brief built on bare commands would read a stranger's pull request, review it, and post findings on the wrong repository. Every gh-axi command the review brief generates and the pr-review skill prints now carries -R <owner>/<repo>, taken from the reviewed pull request's own URL, which is the only authority on where that pull request is. The head checkout goes through `gh-axi pr checkout` rather than a hand-written fetch from `origin`, for the same reason. docs/verification/pr-review.md records this and the two other vendor facts the contract states: GitHub refuses an approve review on a pull request opened by the same account, so the reviewer posts a comment review carrying its verdict in the body, and that review reads back through `gh-axi pr view --reviews`. Tests cover the new brief kind and its dispatch, including a direct assertion that no gh-axi command in a generated review brief omits its repository. Each new assertion was confirmed to fail against a mutated source before being trusted. * docs(scripts): record the review brief and its dispatch note in the toolbelt index * fix(bin): validate a review URL on the dispatch path that reuses a brief fm-dispatch.sh's own contract is to validate every input before touching anything, but --review was checked only by bin/fm-brief.sh. A brief that already exists is reused without calling it, so on that path nothing stood between a malformed or non-GitHub URL and the backlog note that records it. The check now runs at step 1 through the shared PR parser, where the contract says it belongs, and a test drives the reuse path specifically. * style(bin): match the scope discipline's wording to the finding field it names The discipline said to mark a finding `widens scope: yes` while the template field is `Widens scope:`, so the instruction did not name the field the reviewer is filling in. Also split a two-sentence line in the pr-review skill to keep the repo's one-sentence-per-line rule.
…tream-3 chore(harness): sync fork main with upstream/main (repair ancestry break)
* Add capability outcome log and dispatch-time evidence reader. Record harness/model/effort outcomes at teardown, rank or advise within cost-allowed dispatch profiles, and keep scout-tax suggestions advisory. * fix(tests): symlink capability lib in gotmp teardown fixtures. Teardown now sources fm-capability-lib.sh, so the fake FM_HOME bin/ must expose it the same way as the other sourced helpers.
…nguid#31) * Polish onboarding and port verify for beginner-safe touch-ups. Name the firstmate folder in the slug-test prompt, treat missing jq as an advisory in the Herdr protocol probe, avoid exit in the pasted checkpoint, and label verify's un-failable .env check as VERIFY_INFO. * Fix backend conformance fixture for capability-lib source. fm-teardown.sh gained a source of fm-capability-lib.sh in kunchenguid#29; the old-vs-new shim must symlink that sibling or the extracted BASE_REF teardown aborts.
Screenshots and applied migrations (author's note)
|
…ream-catchup-2026-11-08 feat(bin): catch up with upstream firstmate through 47e07b4
Intent
Implement Phase 1 of GitHub issue #27 for firstmate supervision reliability. Preserve the current one-shot watcher model while adding a durable tab-separated state/.wake-queue, atomic fm-wake-drain.sh, portable mkdir-based watcher singleton and queue locks, enqueue-before-suppress semantics for signal/stale/check/heartbeat wake paths, guard warnings for pending queued wakes, and minimal AGENTS.md/README documentation noting P2/P3 are deferred. Add fast behavior tests using temp state roots for concurrent append/drain safety, catch-up signals, stale enqueue ordering, singleton enforcement, atomic drain dedupe, stale lock reclaim, guard warning behavior, plus CI coverage for those tests.
What Changed
state/.wake-queuewith locked enqueue/drain helpers so watcher wakes are recorded before suppression markers advance and can be recovered atomically after interruptions.Risk Assessment
✅ Low: Captain, the change is well-bounded to watcher queueing and documentation, and I did not identify material correctness or recovery regressions in the diff.
Testing
Inspected the watcher, guard, drain, CI, and docs changes, ran the focused wake-queue behavior suite via both shell and exact CI-style invocation, and produced a manual CLI transcript showing catch-up signal detection, durable queue persistence, guard warning, drain dedupe, and empty queue after drain; all checks passed.
Evidence: Behavior test output
Evidence: Manual wake-queue CLI transcript
Evidence: Queued signal before drain
Evidence: Drain output after dedupe
Evidence: Guard pending-queue warning
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 2 issues found → auto-fixed (2) ✅
bin/fm-watch.sh:22- The singleton path trusts any live PID in.watch.lockand exits before checking whether the watcher heartbeat is stale. If the current watcher is alive but wedged, the guard will tell the operator to re-arm the watcher, but every re-arm attempt just printsalready running, leaving supervision without a working watcher. Reclaim based on a stale heartbeat or return an actionable failure instead of silently no-oping.AGENTS.md:196- The recovery checklist drains queued wakes only after reading status files, peeking orphan panes, and surfacing decisions. That conflicts with the new section 8 rule that recovery must drain the durable queue first, so a restarted agent can still consume state out of order. Movefm-wake-drain.shahead of the status/pane reads in this checklist.🔧 Fix: Captain, harden watcher recovery flow
2 warnings still open:
bin/fm-guard.sh:36- When queued wakes exist and the watcher beacon is also stale or missing, the guard now prints both "drain them ... before anything else" and the old final "Restart it NOW, before anything else" instruction. That is the main missed-wake recovery path, so the tool gives contradictory ordering and can steer the operator to re-arm before draining the durable queue. Make the liveness instruction conditional, for example: drain queued wakes first, then re-arm the watcher.AGENTS.md:188- The recovery checklist drains and removes queued wake records before acquiring the single-firstmate session lock. If a restarted or secondary firstmate session runs this while another live session holdsstate/.lock, it can consume that session's wake queue and only then discover it must operate read-only. Acquire the session lock before the destructive drain, while still draining before pane/status inspection.🔧 Fix: Captain, fix queued wake recovery ordering
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-wake-queue.test.shtests/fm-wake-queue.test.shManual CLI scenario withFM_STATE_OVERRIDE=/var/folders/5x/4nqprlbx0518k3ybcb1sz6gr0000gn/T/no-mistakes-evidence/01KVJ1ZJZWJWZZ3RN96XFWP4JF/wakequeue-signal-e2e/state: createdtask.statuswhile no watcher was running, ranbin/fm-watch.sh, inspectedstate/.wake-queue, ranbin/fm-guard.sh, drained withbin/fm-wake-drain.sh, and verified the queue was emptygit status --short --ignoredto confirm testing left no transient files in the worktree✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.