Skip to content
This repository was archived by the owner on Aug 25, 2026. It is now read-only.

fix(backends): harden Herdr presentation lifecycle - #95

Merged
JTInventory merged 9 commits into
mainfrom
fm/firstmate-herdr-presentation-e2e-0806
Aug 13, 2026
Merged

JTInventory merged 9 commits into
mainfrom
fm/firstmate-herdr-presentation-e2e-0806

Conversation

@JTInventory

Copy link
Copy Markdown
Owner

Intent

Timeboxed Herdr presentation e2e freeze remainder (2026-08-06): prove a scoped Herdr launch and teardown path that fails closed with precise diagnostics, not a 96-suite drive. The proof must show no failure path produces an empty or silent exit 1; launch and teardown are bound to the exact recorded Herdr workspace, tab, pane, and process identity rather than a guessed or focused pane; Herdr run submission is atomic or refuses before a half-created workspace; and preflight refuses with the existing loud error when live teardown cannot be made safe because the installed host lacks pane.close_bound(expected_pid). Preserve the narrow scope: do not run bin/fm-run-behavior-tests.sh full 96 suite, restart continuous auto-fix, port the authority-broker cascade item, run herdr update, change the captain's live Herdr session, merge, or restore unrelated deleted Herdr farm files. Concurrent-create reconciliation and production launch atomicity are deferred to the isolated-session ship, not this scoped e2e. Restore or implement only files the focused e2e actually needs. Deliver the committed change through JTInventory/firstmate no-mistakes.

What Changed

  • Hardened the Herdr adapter with capability preflight, exact workspace/tab/pane identity checks, atomic pane.run submission, and process-bound teardown with explicit fail-closed diagnostics.
  • Added reconciliation for failed or stale workspace and task-tab mutations, refusing when cleanup cannot be verified.
  • Added focused Herdr presentation e2e coverage and documented the related contracts.

Risk Assessment

⚠️ Medium: The safety-sensitive change is broad, but the reviewed identity checks and fail-closed reconciliation paths are bounded and consistent with the provider contract.

Testing

The provided baseline passed, and the focused Herdr E2E passed against installed Herdr 0.8.0 protocol 19. The captured CLI transcript demonstrates fail-closed preflight, exact identity binding, atomic launch, precise diagnostics, and safe teardown reconciliation.

Evidence: Focused Herdr presentation E2E transcript
ok - installed Herdr 0.8.0 protocol-19 preflight refuses before session mutation
ok - Herdr preflight refuses when bound task-tab reconciliation is unavailable
ok - Herdr refuses an unverifiable task-tab inventory
ok - Herdr workspace-create mutation is reconciled before refusal
ok - Herdr reconciles a mutated workspace when provider output is empty
ok - Herdr reconciles workspace creation from an exact provider snapshot
ok - Herdr refuses and reconciles a zero-exit workspace-create identity mismatch
ok - launch records the exact Herdr workspace, tab, and pane returned by the provider
ok - Herdr launch submit uses one atomic pane.run against the recorded pane
ok - Herdr atomic submit failure reports a precise fail-closed reason
ok - Herdr literal launch failure reports a precise fail-closed reason
ok - Herdr launch submit-key failure reports a precise fail-closed reason
ok - Herdr teardown refuses a live target without process identity
ok - Herdr teardown refuses an unrecognized agent state
ok - Herdr bound teardown failure reports a precise fail-closed reason
ok - Herdr teardown closes only the exact recorded pane with bound process identity
ok - Herdr refuses and reconciles a zero-exit task-create identity mismatch
ok - Herdr task-tab failure reports a precise fail-closed reason
ok - Herdr task-tab failure reconciles a provider mutation without a half-created task endpoint
ok - Herdr reconciles stale task-create ids through fresh identity
ok - Herdr refuses when post-close task-tab absence cannot be verified
ok - scoped Herdr presentation launch/teardown proof completed

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 3 issues found → auto-fixed ✅
  • 🚨 bin/backends/herdr.sh:579 - A zero-exit workspace-create response is accepted without verifying its IDs against provider state. A stale tuple can orphan the new workspace and bind work to the wrong workspace. Verify before persisting; reconcile and refuse on mismatch.
  • 🚨 bin/backends/herdr.sh:1812 - A zero-exit task-tab response accepts any non-empty tab/pane IDs. Stale IDs can route launch to the seed or another pane while leaving the new task tab orphaned. Validate identity, then reconcile and refuse on mismatch.
  • ⚠️ tests/fm-backend-herdr-presentation-e2e.test.sh:535 - The intent requires teardown to bind to the exact recorded workspace, tab, pane, and process identity. The E2E directly calls fm_backend_herdr_kill with injected PID values instead of exercising fm-teardown.sh's identity boundary. Add that executable scenario, or confirm adapter-only scope is intentional.

🔧 Fix: Guard Herdr workspace/task identities and reconcile stale responses
✅ Re-checked - no issues remain.

✅ **Test** - passed

✅ No issues found.

  • bash tests/fm-worker-isolation.test.sh && bash tests/fm-watch-session.test.sh && bash tests/fm-slot-occupant-proof.test.sh && FM_TEARDOWN_TEST_FOCUS=s1 bash tests/fm-teardown.test.sh
  • bash tests/fm-backend-herdr-presentation-e2e.test.sh
  • Baseline already provided by the outer gate: bash tests/fm-worker-isolation.test.sh && bash tests/fm-watch-session.test.sh && bash tests/fm-slot-occupant-proof.test.sh && FM_TEARDOWN_TEST_FOCUS=s1 bash tests/fm-teardown.test.sh
  • Captured the complete focused CLI transcript in /tmp/no-mistakes-evidence/01KZXSMA2GCC04BNMHSMRBE56F/herdr-presentation-e2e.log
✅ **Document** - passed

✅ No issues found.

⏭️ **Lint** - skipped

Step was skipped.

✅ **Push** - passed

✅ No issues found.

@JTInventory
JTInventory merged commit f0899b8 into main Aug 13, 2026
5 checks passed
@JTInventory
JTInventory deleted the fm/firstmate-herdr-presentation-e2e-0806 branch August 13, 2026 15:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant