Repository navigation
Conversation
|
Speaking as Kun's firstmate: thank you @Shazellb — treating a missing Herdr registration as "gone" was clearly wrong when the pane still has a live Claude process, and failing closed on inconclusive process evidence is the right side to err on. I reviewed tip Contract-class: restore. The unconfigured Herdr liveness probe already promised not to relaunch a live secondmate; this makes the VISION.md: one-interface / authority / scripts / restart / spine / vendor / scope: align (corrective probe; quarantine stays on the named Herdr adapter; no new default-on surface). Status: waiting-ci. Main is red right now on unrelated Pi 1.2 type drift — no merges this wake. If this PR's CI fails only on those same main-red shards, that is not on you. When main is green and this is green → auto-merge (restore). Nothing else needed from you unless CI is red for a reason other than that main drift. |
|
Speaking as Kun's firstmate: thank you @Shazellb for the two follow-up commits. I looked at CI on
The remote-lifecycle failure deserves a real look, not just a fake. The shell-only proof reads the local process table. For a remote Herdr pane, the probe may never be able to prove shell-only, so a genuinely agent-free remote pane would never read dead. If that fail-closed result is intended, the test and Contract-class: restore (unchanged). VISION.md: all rules still align. This is a corrective probe on the named Herdr adapter with no new default-on surface. Status: waiting on you for those suites. Once CI is green apart from main's drift and main itself is green, this goes to auto-merge. |
…r-related suites locally and found four that broke because of this PR. The PR's probe change is correct and I didn't touch it. A missing agent registration now only counts as "no agent" when the process view proves the pane is shell-only, and it reads as live when the process view finds a harness. Four test fakes still modelled "unregistered pane" with no process evidence, or with a fake `claude` process. Under the new rule that reads as live or unknown, so these tests failed. All four now pass locally, and I changed only test fakes: - `tests/fm-control-relaunch.test.sh`: the fake `pane process-info` and `ps` now show a shell-only pane unless the fake agent is live. - `tests/fm-crew-state.test.sh`: the husk-pane test sets `FM_FAKE_HERDR_PROCESS=shell`. - `tests/fm-herdr-session-cleanup.test.sh`: stubbed `fm_backend_herdr_pane_process_state` to report `shell`. - `tests/fm-secondmate-sync.test.sh`: the fake herdr now answers `pane process-info` for the stale pane with a shell-only view. `fm-session-start`'s "locked session start did not publish the home summary ledger" also fails locally, but it fails identically with the pre-PR `herdr.sh`. I left it alone, and I don't know whether it is one of the failing CI shards. The CI logs gave no failing test names, so mapping fixes to the six checks is by local reproduction only. I didn't run the full CI shards or the other `agent_not_found` suites (the e2e and smoke ones)
…e more suite that broke because of this PR, but the CI logs again showed no failing test names. I mapped the failure by running the herdr-related suites locally. **What broke:** `tests/fm-agy-harness.test.sh` had a test, "an unregistered pane must read no-agent", whose fake herdr returned `agent_not_found` with no process view. Under the PR's rule that reads as `unknown`, so the test failed. The probe change itself is correct and I didn't touch it. **Invariant:** an absent registration counts as "no agent" only when `pane process-info` proves the pane is shell-only. **Fix (test fake only):** the test now gives the fake herdr a shell-only process view. It uses a live `sleep` as the pane shell, because the shell-only proof reads the real process table, the same way the stale-registration test next to it does. Both the `pane_agent_state` check and the `tab_is_husk` check in that test now get the process view, and the sleep is killed afterwards. **Result:** `fm-agy-harness` now passes. I also ran these suites, and they pass: - `fm-control-herdr-smoke` - `fm-backend-herdr` and its respawn-idem, focus-flash, prune-safety and agent-exit-shell e2e suites - `fm-herdr-pi-stale-registration-live-e2e` - `fm-afk-inject-herdr-e2e` - `fm-teardown` **Not fixed:** `fm-session-start` still fails locally with "a locked session start did not publish the home summary ledger". The previous round found it fails the same way with the pre-PR `herdr.sh`, so I left it alone. **Not run:** I haven't run the full CI shards, so I can't confirm which of the four shards this clears
…time-backends doc
f8dc6fe to
d9971f0
Compare
…start.test.sh. I did not touch bin/backends/herdr.sh. The fix is uncommitted in the worktree. The earlier timed-out agent had already left this edit there, and I verified it. **Cause:** the fake herdr husk pane in `test_session_start_relaunches_herdr_husk_secondmate` had no `pane process-info` view. Under the PR's rule, an absent registration with no process proof reads as unknown. The liveness probe then printed `SECONDMATE_LIVENESS: ... skipped: endpoint probe unreadable (backend=herdr)` and the "non-actionable" assertion failed. **Change:** - The fake herdr now answers `pane process-info` with a shell-only view: a real shell pid and an empty foreground list. - `run_session_start_herdr_secondmate` starts a short-lived `sleep` as that shell pid, because the proof reads the real process table. - The same function sets `FM_HERDR_PS_BIN=/bin/ps` so the test's fake `ps` doesn't interfere. **Verification:** `tests/fm-session-start.test.sh` passes in full locally ("all assertions passed", including the husk test). Locally this only works with `jq` on the test's base PATH. I ran it with `FM_TEST_BASE_PATH=/usr/bin:/bin:/usr/sbin:/sbin:/home/shaz/.local/bin`, because `jq` is installed in `~/.local/bin` here. Without it, the "home summary ledger" failure from earlier rounds reappears. That was a local-environment artifact and not a PR bug. CI has `jq` in `/usr/bin`. The uncommitted edits to `tests/fm-remote-secondmate-lifecycle-e2e.test.sh` and `tests/remote-herdr-fixture.sh` were also left by the timed-out agent. I left them alone and did not run them, since this round was scoped to the one fake
…ssertion in tests/fm-remote-secondmate-lifecycle-e2e.test.sh was failing because of a leftover debug edit, not a missing process view. I did not run that assertion locally. The local run exits earlier, so a full pass is unconfirmed. `tests/remote-herdr-fixture.sh` already gives an unregistered pane a shell-only `pane process-info` view. That is `$PPID` as the shell pid with an empty foreground list. A registered pane still shows a harness. So the PR's rule already holds there: no registration plus shell-only process proof reads as dead. The failure came from the timed-out agent's debug edit. That edit had been committed into the test at ~line 1291. It captured the state output with `2>&1`, printed `DBGV[...]` to stderr, and tailed the Herdr log. Because stderr was merged in, the captured value was never exactly `dead`, so the assertion failed. I restored the original `[ "$(remote_env ... state ios)" = dead ]` check and removed the debug lines. Only `tests/fm-remote-secondmate-lifecycle-e2e.test.sh` changed. I did not touch `bin/backends/herdr.sh`. I ran the test file locally. It stops at an earlier step with "remote spawn never reached its blocked inheritance write", before the edited assertion. I have not checked whether that early failure happens on main or comes from this machine; the cause is unknown. The local run also hit `rm` permission errors in its temp-dir cleanup, which I cleared by hand. The fix itself is traced by reading the fixture and the test, not by a passing run
…ests/remote-herdr-fixture.sh the unregistered 'pane process-info' branch now reports a dedicated isolated pane-shell pid (a `sleep 600` with fds redirected, pid recorded in $STATE.shell.pid and reused while alive) with empty foreground_processes, instead of the probe's $PPID. Registered panes still show codex. In tests/fm-remote-secondmate-lifecycle-e2e.test.sh the cleanup trap kills the recorded sleep, and the 'agent-free remote pane did not classify dead' assertion now fails with the actual state, the fixture's raw pane process-info and the Herdr log tail. The local lifecycle run finished but I only saw cleanup rm permission errors, so a passing run of the edited assertion is unconfirmed; earlier local runs stopped before it at 'remote spawn never reached its blocked inheritance write'. The CI shard on the pushed head is the real check
|
Speaking as Kun's firstmate: thank you @Shazellb for the follow-up commits since the waiting-author stamp on What I re-checked: the probe in CI on Contract-class: restore (unchanged). VISION.md: all rules still align. Status: waiting-ci. When main is green and this head is clean apart from that main drift / serial-2 cancel → auto-merge. Nothing else needed from you unless CI turns red for a PR-caused reason. |
|
Closing: not needed upstream, fix stays on the fork. |
Intent
Fix probe. The secondmate liveness probe reads live Claude secondmates (caseops, sentinel) as dead, so the watcher auto-relaunched them three times in about two minutes and then parked. The scout found that Herdr agent registration absence was being treated as proof of agent absence even when the pane process classifier identified a live Claude process. Fix the probe so process evidence corroborates an absent registration: keep process-proven live Claude panes alive, preserve recovery of process-proven shell-only panes, and fail closed when process evidence is inconclusive.
What Changed
bin/backends/herdr.sh: a missing Herdr agent registration (agent_not_found) no longer counts as proof the agent is absent. The probe now checkspane process-info. A pane with a live Claude process stays alive. A pane proven shell-only is still read as no-agent, so recovery is preserved. Inconclusive process evidence reads asunknown, which fails closed. This stops live Claude secondmates from being auto-relaunched.tests/fm-backend-herdr.test.shgains coverage for these cases. The fake herdr infm-agy-harness,fm-control-relaunch,fm-crew-state,fm-herdr-session-cleanupandfm-secondmate-syncnow models "unregistered pane" with a shell-only process view, since an absent registration alone no longer reads as no-agent.docs/herdr-backend.mdanddocs/verification/runtime-backends.mddescribe the process-corroborated unregistered-pane verdict.Risk Assessment
✅ Low: The only production change is a small, fail-closed tweak in herdr.sh: an agent_not_found result now maps to live when the process view finds an agent, no-agent only when it proves shell-only, and unknown otherwise. The test edits only adjust fakes to match.
Testing
I ran the herdr backend suite and drove a real Herdr lab session through bin/fm-herdr-lab.sh. An unregistered pane running a Claude-named process read
live, and an unregistered shell-only pane readno-agent, so both intent halves hold. The fail-closed case for unreadable process evidence was not driven live, because my failing-herdr shim never took effect; it is covered only by the existing unit test. I did not run a real Claude CLI. The lab was torn down and the worktree is clean.fm_backend_herdr_pane_agent_statereturnedlivewhileagent getreturnedagent_not_foundfm_backend_herdr_pane_agent_statereturnedno-agenton two separate shell-only panespane process-info, but the shim directory name used a shell PID that changed between commands, so it never took effect and the probe still read no-agen…Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-backend-herdr.test.sh(no failures; includes the new unregistered-pane test)Live Herdr lab via bin/fm-herdr-lab.sh: shell-only pane, then realclauderun in the pane, classified with fm_backend_herdr_pane_agent_stateMissing pane w9:p9 classified as dead✅ No issues found.
fm_backend_herdr_pane_agent_statereturnedlivewhileagent getreturnedagent_not_foundfm_backend_herdr_pane_agent_statereturnedno-agenton two separate shell-only panespane process-info, but the shim directory name used a shell PID that changed between commands, so it never took effect and the probe still read no-agen…bash tests/fm-backend-herdr.test.sh(0 failures, includes the unregistered-pane process-evidence test)bin/fm-herdr-lab.sh provisionandrun, drivingfm_backend_herdr_pane_agent_stateon an unregistered shell-only pane, giving no-agentThe same call on an unregistered pane running a process with argv0claude, giving livebin/fm-herdr-lab.sh teardownof the lab session✅ **Document** - passed
✅ No issues found.
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ No issues found.
✅ **Push** - passed
✅ No issues found.
✅ No issues found.