Skip to content

Fix process liveness, watcher handoffs, and duplicate outcomes - #2

Merged
shishiv merged 1 commit into
mainfrom
fm/fm-terminais-monitoramento-diag
Sep 10, 2026
Merged

shishiv merged 1 commit into
mainfrom
fm/fm-terminais-monitoramento-diag

Conversation

@shishiv

@shishiv shishiv commented Sep 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • Prove Herdr agent liveness from the exact pane's bounded process tree, not a retained semantic registration. Preserve separate destructive cleanup proofs.
  • Restrict Pi build markers to the actual session owner and publish after cold-start lock acquisition.
  • Let the final Pi guard observe an already-owned restoration within the existing readiness budget, then repeat the strict health check. Never start another arm or extend grace.
  • Share bounded outcome coverage with inactive reconciliation, binding spawn/status identity and delivery/processing receipts without hiding new or unprocessed results.

Validation

  • Seventeen affected portable suites have passing results, including lifecycle/relaunch, task-state reconciliation, teardown, startup, branch outcomes, watcher/turn-end regressions, backend dispatch, process proofs and strict Pi typechecking.
  • The initial broad run exposed outdated registration-only fixtures and a recursive local tool shim; fixtures were updated and the three affected suites reran successfully. A timeout was not counted as a pass.
  • Real Herdr 0.9.0 / Pi 0.85.1: idle Pi classified alive, exit confirmed back to a nested shell, and pane/work copy preserved. The isolated lab's default-session tripwire passed.
  • Token-free, serial liveness matrix passed on seven installed harnesses. Missing harnesses were explicitly reported, not claimed verified.
  • ShellCheck 0.11.0, actionlint 1.7.12, documentation audience checks, test inventory coverage, and strict TypeScript against installed Pi.

Limits

  • No running Firstmate home, fleet terminal, or installed Herdr integration was updated or restarted.
  • Linux was live-tested; macOS and Windows were not live-verified in this delivery.
  • This is the explicitly selected direct-PR path; no no-mistakes pipeline or attestation was generated. Existing repository enforcement was not bypassed or weakened.

@shishiv
shishiv merged commit 6cba29f into main Sep 10, 2026
shishiv added a commit that referenced this pull request Sep 28, 2026
Carried onto current upstream from the fork's #2. Upstream kunchenguid#4191 already
verifies Herdr agent liveness at process level before trusting a semantic
registration, so this port keeps upstream's classifier and drops the fork's
parallel version: bin/backends/herdr-process-snapshot.py, the Herdr and tmux
adapter changes, the shared process-kind vocabulary in
bin/fm-session-lock-lib.sh, tests/fm-herdr-process-state.test.sh, and their
fixture, documentation, and live-matrix edits.

What remains:
- The inactive-outcome scan shares a bounded outcome-index reader
  (bin/fm-branch-outcome-lib.sh) with the drain and suppresses a duplicate
  only when the same incarnation's exact status coverage was delivered and
  every relevant captain outcome processed. Rows now bind spawnGen and the
  index moves to v2; v1 stays readable.
- The Pi turn-end guard observes a restoration the current watcher
  generation already owns before repeating its strict check, never arms, and
  stops delivering once its session is replaced; the lock owner rewrites its
  turn-end marker after cold-start lock acquisition. The pre-lock marker
  rule stays upstream's.
- The Herdr version-check test no longer assumes /usr/bin lacks herdr.
shishiv added a commit that referenced this pull request Sep 28, 2026
… box

Merges shishiv/firstmate main (8709a31) into local main (5bab8f1) as a
true merge, so fork/main is an ancestor and publishing to the fork's main
is a fast-forward.

The fork's main was rewritten after the originally named commits:
7fcc62a (#1) and 6cba29f (#2) survive only on fork branches such as
main-antes-20260928. fork/main carries their re-ports, c0ad743 (#1) and
8709a31 (#2), on top of an older age of the Kiro work (26e0caa,
4ae0ca5, aec0779) plus 056b9a0 (.kiro/skills). This accounting is
against those real hashes.

Resolution rule: in every conflicted file whose fork/main content equals
local 28c5629 (the local-side twin of fork aec0779), the local side is
the newer age of the same change, so local wins. That covers
bin/fm-harness.sh, bin/fm-session-lock-lib.sh, bin/fm-primary-endpoint-lib.sh,
bin/fm-kiro-turnend-hook.sh, docs/supervision-protocols/kiro-cli.md,
docs/turnend-guard.md and operational-home-layout/SKILL.md. This keeps the
shared harness/lock ancestry walk (ce770af) and the every-turn ensure
doorbell (92ee7b2, 5bab8f1) intact.

Kiro twins (26e0caa = 43a3714, aec0779 = 28c5629, 4ae0ca5 = d4ea5ad):
- superseded by the local side, except the fork-only pieces below.
- kept from 26e0caa: bin/fm-control.sh passes "$HARNESS" to
  fm_backend_composer_state on exit, which the Kiro reference documents
  (kiro-cli placeholder read as empty only under the recorded identity);
  tests/fm-gotmp.test.sh links fm-kiro-lib.sh.
- discarded: the fork's extra `cp fm-path-lib.sh` in
  tests/fm-primary-endpoint.test.sh; local copies the whole bin tree, which
  already covers it.

056b9a0 (.kiro/skills): kept whole. .kiro/skills is a real tracked
symlink to ../.agents/skills (mode 120000); the kiro.md Skill row and
the fm-kiro-harness test that proves it resolves were re-applied onto
the local versions.

c0ad743 (#1, pi nested notebook shell guard): kept whole. That covers
the .pi turn-end guard preflight with its single session_shutdown release,
bin/fm-test-run.sh routing, docs/arm-pretool-check.md, docs/cd-guard.md,
docs/verification/runtime-backends.md, tests/fm-arm-pretool-check.test.sh
and the opt-in fm-pi-notebook-live e2e and fixture. None of it existed
locally.

8709a31 (#2, process liveness and watcher continuity): kept whole. That
covers bin/fm-branch-outcome-lib.sh and its callers (fm-branch-outcome,
fm-inactive-reconcile, fm-wake-drain), the Pi watch extension and the
turn-end guard's generation-owned restoration and marker rewrite, and the
docs and tests. The only textual conflict was its guardGeneration
declaration beside local's object-shaped LockOwnership; both are kept,
and the merged guard equals fork/main's. The parts #2 had already
dropped for upstream kunchenguid#4191 (Herdr process snapshot, shared process-kind
vocabulary) stay dropped.

Verification: bash -n on all 25 touched .sh files, and shellcheck -x
plus bin/fm-lint.sh are clean. These pass with no failures:
fm-kiro-harness, fm-primary-endpoint, fm-sessionstart-nudge,
fm-omp-harness, fm-afk-return, fm-composer-lib, fm-turnend-guard,
fm-watch-checkpoint, fm-arm-pretool-check, fm-backend-herdr,
fm-branch-supervision, fm-gotmp, fm-inactive-reconcile,
fm-pi-branch-extension, fm-pi-watch-extension, fm-home-summary-refresh
and fm-control. fm-pi-notebook-live-e2e skips because it is opt-in and
no fixture was supplied.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant