Repository navigation
feat(bin): consult operator evidence guards before wedge escalation - #6958
Conversation
|
Speaking as Kun's firstmate: thank you, @Moshik21. This follows the acceptance list on #6919 point by point, and the absent-config test with an armed control next to it is exactly the proof I'd want. I compared head What I checked
Contract-class: opt-in. My own reading of the tip agrees: nothing changes until a home writes the config. Once it's otherwise ready, it auto-merges on green. Two things before it can land:
Related: this implements #6919. #6899 is a different, complementary ask: a worker's own newest VISION.md, rule by rule
Next step: waiting on you for the no-mistakes re-raise and the live run. CI is running now. Thank you! |
Add config/wedge-evidence-guards, an opt-in list of operator-owned guard executables that the watcher's at-threshold wedge branch consults after the wait evidence, worktree-write probe and dead-endpoint probe. A CRITICAL answer defers one window at a time, capped by FM_WEDGE_GUARD_DEFER_MAX consecutive deferrals recorded beside the other wedge-window records, and the escalation that ends a capped run names the guard and its reason. Timeouts, failures, malformed output, UNKNOWN and WARNING fail open, and an untrusted config or guard is never run. With the config absent the ladder is unchanged. Refs kunchenguid#6919
bde8c33 to
db27552
Compare
|
Speaking as Kun's firstmate: thank you, @Moshik21. This resolves both things I asked for on 10-09.
I re-read the new head against main Contract-class: opt-in (unchanged, my own read). VISION: every rule aligns (unchanged). Where this stands: waiting on CI only, with nothing needed from you. If CI and the no-mistakes check come back green and it's still mergeable, it auto-merges on my next pass. |
…efresh # Conflicts: # bin/fm-watch.sh
|
Speaking as Kun's firstmate: thank you, @Moshik21, for bringing this up to date with main. It looks good. One thing is needed from you before it can land. I re-read head
What's blocking: the no-mistakes check fails on this head. The attestation in this PR's body still binds the old head Heads-up: your #7361, the worker-wait wedge deferral (#6899), is a separate feature, and Contract-class: opt-in (my own read, unchanged). VISION: every rule aligns (unchanged). Where this stands: waiting on you to fix the attestation. Once it binds the current head and CI is green, it auto-merges on a later pass if it's still mergeable. |
|
Re-ran the pipeline: the PR body attestation now binds head 4f7c494, the head you reviewed; no code changed. The new Require no-mistakes run is waiting for fork-run approval. |
|
Speaking as Kun's firstmate: thank you, @Moshik21, for re-running the pipeline so quickly. The attestation in the body now binds I approved the new Require no-mistakes run ( What's needed from you (one of these):
CI: on run Contract-class: opt-in (my own read, unchanged: the guard consult stays off unless |
|
Re-ran |
|
Speaking as Kun's firstmate: thank you, @Moshik21, for re-running the pipeline. The body attestation now binds
One thing is still missing before this can land: live validation. This run's attestation reports
Then post the evidence here, or re-raise through contract-class: opt-in |
|
Live validation on the unchanged head 4f7c494. All three core scenario groups were driven with the real
Limits of what this proves:
|
|
Speaking as Kun's firstmate: this is merged. Thank you @Moshik21 — really appreciate you taking the time on this. |
## Commits taken - d20196a feat(herdr): opt-in project groups with status tags and a sorted agents view (kunchenguid#7434) - ce69740 fix(bin): pin LC_ALL=C for remote job process identity reads (kunchenguid#7410) - 64dddf6 fix(opencode): ignore child stdin EPIPE in guard and encoder (kunchenguid#7447) - 11becbb fix(bin): ignore crew state overrides for other tasks (kunchenguid#5881) - eeeeb91 fix(bin): re-anchor a Claude session's lock so /clear keeps ownership (kunchenguid#7415) - 66c300b feat: support version URLs for watched tool updates (kunchenguid#7449) - 3094475 fix(pi): keep a live session's extension markers when a nested Pi command loads them (kunchenguid#7287) - f05b628 fix: reclaim orphaned Claude auto-arm claims (kunchenguid#5939) - c4f4333 feat(bin): add Polytoken crewmate/scout worker adapter (kunchenguid#7321) - 11990a2 Fix away branch relaunch admission (kunchenguid#7444) - 56074d0 fix(bin): show reported checks when a pull request's base requires none (kunchenguid#7450) - 0791268 fix: support durable per-secondmate account pins (kunchenguid#7452) - 4e6b9f5 feat(bin): consult operator evidence guards before wedge escalation (kunchenguid#6958) - c7b7798 fix(bin): make inbox listing succeed when the inbox is empty (kunchenguid#7460) - 63fc5eb fix: bound remote secondmate convergence and preserve owed re-reads (kunchenguid#7394) - 8ba34f1 fix: require positive daemon running status in crew-state (kunchenguid#7317) - 1aa2a21 fix(tests): stabilize supervision host drain and offer fixtures (kunchenguid#7467) - 69f9d09 fix(bin): refuse spawn into a project with an unborn HEAD (kunchenguid#6987) - 45dd50a feat(bin): add GitLab --allow-no-pipeline merge waiver and close backlog items for GitLab MRs (kunchenguid#7462) ## Conflict decisions - `.agents/skills/operational-home-layout/SKILL.md`: Fork seat configuration; upstream per-secondmate account configuration. Decision: Keep both configuration entries. - `bin/backends/herdr.sh`: Fork send-failure/recovery semantics and harness variable; upstream Polytoken busy override. Decision: Keep fork send-failed and recovery handling; add Polytoken busy identity without losing the fork harness variable. - `bin/fm-backlog-transition-lib.sh`: Fork cached library directory; upstream GitLab completion support. Decision: Keep cached source path and extend forge ownership comment to GitLab; accept GitLab completion path. - `bin/fm-config-inherit-lib.sh`: Fork Claude/Codex seat inheritance; upstream Herdr project groups. Decision: Union the allowlist; per-secondmate account pins remain local to the primary home. - `bin/fm-control.sh`: Fork pre-stop seat checks; upstream per-mate pins and Polytoken launch checks. Decision: Select the per-mate pin while retaining its returned account for seat conflict validation; keep all Polytoken pre-stop checks. A valid explicit pin supersedes the old recorded Claude store on relaunch. - `bin/fm-harness.sh`: Fork in-process HARNESS_VERDICT result; upstream echo-based Polytoken detection. Decision: Add Polytoken through the fork verdict convention, retaining existing adapter detection. - `bin/fm-lock.sh`: Fork handover reservation and runtime publication; upstream session re-anchor lease/auto-arm locks. Decision: Share the existing claim lock and release helper, add lease/auto-arm locking, then publish runtime and clear an admitted handover before releasing locks. - `bin/fm-pr-state.sh`: Fork shared required-check evaluator from dbe11b1 and 91371c8; upstream 56074d0 adds a second gh pr checks fallback. Decision: Keep one evaluator through fm-pr-checks.sh and fm-pr-checks-lib.sh. It already checks non-advisory reported checks on unprotected bases, includes missing configured requirements, and fails closed on read errors. Adapt upstream regressions to this API; preserve the fork REQUIRED CHECK label and advisory policy. - `bin/fm-spawn.sh`: Fork parked-session resume, seats, unclaimed-worktree guard and ticket hook; upstream Polytoken, per-mate accounts and Herdr groups. Decision: Compose both paths, retain validate_spawn_worktree_unclaimed, seat gates, profile trust and metadata, and both hooks. Extend pin/seat refusal to the selected per-mate pin while retaining the primary-home seat guard. The selected durable Claude pin owns trust and recorded store on relaunch so old seats cannot override it. - `bin/fm-teardown.sh`: Fork merged-at/park record cleanup and isolation protections; upstream generated Polytoken wiring cleanup. Decision: Keep fork cleanup and guards; add only task-owned Polytoken files and generated untracked wiring to existing guarded teardown. - `bin/fm-test-run.sh`: Fork timing entries and pipeline-spend suite; upstream Herdr-group and Polytoken suites. Decision: Union suite entries, preserve fork timing measurements for existing suites. - `bin/fm-wake-lib.sh`: Fork single-read auto-arm ledger parser; upstream session-owner identity fields. Decision: Extend the single-read parser with owner_session_id and the third-line lock identity; retain orphan recovery and lease logic. - `bin/fm-watch.sh`: Fork bounded run-activity deferral and escalation wording; upstream operator evidence guard. Decision: Keep both bounded deferrals and append operator guard evidence to both ordinary and deep-inspection escalations. Keep exact owned watcher termination semantics. - `docs/agent-control.md`: Fork seat relaunch policy; upstream per-mate account selection. Decision: Describe both policies with account pin checked before stopping the live agent. - `docs/configuration.md`: Fork seat sections and ticket timeout; upstream per-mate pins and remote convergence settings. Decision: Keep all sections, place per-mate pins under worker accounts before the seat sections, and retain all timeout entries. - `tests/fm-control-relaunch.test.sh`: Fork fixture cleanup and seat regressions; upstream account and away-admission regressions. Decision: Keep fixture-scoped cleanup and all regression calls; extend the changed-pin case to check trust in the new store and recorded profile. - `tests/fm-crew-state.test.sh`: Fork no-fork metadata parsing test; upstream override-identity tests. Decision: Keep both test bodies and calls, plus upstream positive daemon-status cases. - `tests/fm-pr-merge.test.sh`: Fork named-case local selector; upstream GitLab waiver test definitions. Decision: Place upstream definitions before the named-case selector and retain every case. - `tests/fm-supervision-host.test.sh`: Fork split helper/suite layout; upstream snapshot-aware offer fixture. Decision: Update the shared supervision-host-helpers.sh implementation and retain its split consumers rather than duplicate the helper in one suite. - `tests/fm-teardown.test.sh`: Fork collision/released-claim cases; upstream Polytoken cleanup cases. Decision: Keep all regression calls. - `tests/fm-watch-triage.test.sh`: Fork split classifier/stale/delivery suites; upstream unsplit suite with four new operator-guard cases. Decision: Keep the split and move only new guard fixtures/cases into fm-watch-triage-stale.test.sh; do not resurrect duplicated legacy test bodies. ## Additional integration and verification decisions - Preserve fork teardown, merge, push, worktree ownership/isolation, and exact-owned watcher termination guards. GitLab no-pipeline waiver remains explicit, attended-only, GitLab-only, and only accepts an explicit null pipeline; default and existing-pipeline safety checks remain in force. - Existing pull-request CI selects subsets and cannot prove the requested full suite. Add a manual CI workflow trigger using the existing full-suite fallback, so the feature head can run every required lane before landing; document that entry point. No local full suite or real Herdr lifecycle run is authorized.
Intent
Upstream firstmate PR #6958 (ours). The maintainer's latest comment (2026-10-17 06:35Z) says the attestation now binds head 4f7c494 but the Require no-mistakes check still fails: 'Required no-mistakes pipeline steps are not completed: test (status=skipped)'. The previous run skipped the test step (firstmate's earlier instruction skipped it; that was the cause). The maintainer asks: 're-run git push no-mistakes so the test step actually runs on 4f7c494 (or a fresh merge of main), not skipped, and the body is regenerated.' The captain's words: 'we have some upstream things that need taken care of for our PRs on firstmate.' Upstream contribution consent for this repo is recorded for this task.
What Changed
bin/fm-watch.shgains an opt-in consult for homes that createconfig/wedge-evidence-guards. When a live pane is about to wedge-escalate,wedge_guard_evidenceruns each listed guard as<guard> --json, withFM_GUARD_TASKandFM_GUARD_ENDPOINTset and a timeout ofFM_WEDGE_GUARD_TIMEOUT_SECS(default 5). The config file and every guard must be regular, non-symlink files owned by the watcher's user and not group or world writable. A timeout, non-zero exit, malformed JSON, or a status other thanCRITICALcounts as no answer.CRITICALanswer defers the escalation one window throughwedge_defer_guardwithout advancing the escalation count. Deferrals are capped atFM_WEDGE_GUARD_DEFER_MAX(default 3) and counted in a new.guard-deferrals-<key>state record. At the cap the escalation fires and its reason names the guard and the first line of its recommendation.clear_write_trackingandbin/fm-supervise-daemon.shclear_pause_trackingnow also remove that record. A home without the config file runs no guard, writes no record, and keeps the existing escalation timing and wording.tests/fm-watch-triage.test.shadds 193 lines of tests for the feature.docs/configuration.md, a new "Caller" section indocs/jev-guards.mdthat bounds theCRITICALmeaning, a paragraph indocs/architecture.md, and the config file and state record in the operational-home-layout skill.Risk Assessment
✅ Low: The opt-in wedge-evidence-guard consult is default-off, fails open and trust-checks guard files; I found no new source defect beyond the points already declined in earlier rounds.
Testing
I ran a trimmed copy of tests/fm-watch-triage.test.sh containing the four new wedge-guard tests plus the neighbouring wedge-ladder tests. All 22 selected cases passed, and I deleted the trimmed copy afterwards. Each test starts a real bin/fm-watch.sh subprocess, but against a fake tmux and fixture panes. I did not stand up a Herdr or tmux lab with a live worker pane. The change's own pipeline steps, including a rerun of
git push no-mistakes, were not exercised here. The scenarios are therefore marked untested rather than pass.Evidence: wedge-guard subset run log
Source: wedge-guard subset run log
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
⏭️ **Rebase** - skipped
bin/fm-watch.sh- merge conflict rebasing onto origin/maindocs/architecture.md- merge conflict rebasing onto origin/main✅ **Review** - passed
✅ No issues found.
trimmed copy of tests/fm-watch-triage.test.sh run withbash(22 selected wedge/guard/deferral tests, all ok; copy removed afterwards)test_wedge_guards_absent_config_keeps_the_unchanged_laddertest_wedge_guard_critical_defers_one_window_at_a_time_up_to_the_captest_wedge_guard_failures_fail_opentest_wedge_guard_never_defers_a_gone_endpoint✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.