Skip to content

feat(lavish): add durable decision protocol - #54

Merged
ruby-dlee merged 9 commits into
mainfrom
fm/lavish-fork-build-f2
Jul 31, 2026
Merged

feat(lavish): add durable decision protocol#54
ruby-dlee merged 9 commits into
mainfrom
fm/lavish-fork-build-f2

Conversation

@ruby-dlee

Copy link
Copy Markdown
Owner

Intent

Build the firstmate-owned incompatible Lavish fork at tools/lavish, replacing the browser/session/poll runtime with a durable file protocol and one-shot terminal commands. Implement create, inbox, show, and answer; strict whole-batch validation; same-directory temp file plus atomic rename; durable wake append after rename; intake at ordinary wake/session-start boundaries with destination-first receipt semantics; explicit legacy migration that snapshots state before lifecycle changes, imports every pending prompt, reconciles only explicitly mapped actual pending decisions, never treats session status as a work queue, and retains the snapshot. Remove the old browser-oriented skill surface. Prove seven-day-old requests remain answerable, answering works with firstmate absent, interruption exposes no partial answer, duplicate submission is idempotent, failed wake append is recoverable, and every command exits with zero child processes and listening sockets. Do not add a server, browser, URL, listener, polling, timers, watchers, menu bar, or resident process; do not delete legacy state; do not merge the PR.

What Changed

  • Add the tools/lavish one-shot CLI with durable file-backed create, inbox, show, and answer workflows, atomic no-clobber writes, idempotent submissions, and recoverable wake delivery.
  • Integrate destination-first Lavish intake into bootstrap and ordinary wake boundaries while tightening teardown and wake-lock handling.
  • Replace the browser-oriented decision-board skill with durable decision guidance and an explicit legacy migration that snapshots retained state and imports pending prompts using collision-safe identities.

Risk Assessment

✅ Low: The compatibility-marker fix closes the remaining intake path, and the complete branch now satisfies the reviewed durable protocol, migration, atomicity, and one-shot runtime invariants without substantiated source risks.

Testing

Completed 1 recorded test check.

  • Outcome: ⚠️ 1 error across 6 runs (12h53m18s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 2 issues found → auto-fixed (2) ✅
  • 🚨 tools/lavish/src/protocol.mjs:693 - Intake can overwrite a concurrently created destination. After the existence check, copyFileAtomic() renames its temporary file onto the destination; POSIX rename replaces an existing file. A firstmate write landing in that interval is therefore silently lost. Commit the destination through an atomic no-clobber operation and treat an existing matching digest as idempotent success.
  • 🚨 tools/lavish/src/migration.mjs:170 - The required criterion says migration must “import every pending prompt,” but generated IDs use lossy normalization and truncation of session keys and prompt UIDs. Distinct pending prompts such as UIDs review/a and review-a, or values sharing the first 32 normalized characters, resolve to the same decision directory; the second import then fails as different content, leaving later prompts unimported. Derive IDs from the complete source identity, such as a readable prefix plus a stable digest.

🔧 Fix: Prevent intake clobbers and legacy migration ID collisions
1 error still open:

  • 🚨 bin/fm-lavish-intake.sh:15 - The intake adapter claims to require the store-forward protocol marker but accepts every lavish-axi 1.x binary. Session start continues after bootstrap reports an incompatible tool, so an unrelated/browser-era v1 binary on PATH would still receive intake, reintroducing an incompatible lifecycle at an ordinary boundary. Match the same lavish-axi 1.* (store-forward protocol 1) signature enforced by bootstrap before executing it.

🔧 Fix: Require store-forward marker before Lavish intake
✅ Re-checked - no issues remain.

⚠️ **Test** - 1 error
  • 🚨 tests failed with exit code 1
  • command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; uv run --directory tools/agent-fleet --locked pytest || rc=1; uv run --directory tools/agent-fleet --locked python -m compileall -q src || rc=1; exit "$rc"

🔧 Fix: Allow Lavish wake-drain test through gate guard
1 error still open:

  • 🚨 tests failed with exit code 1
  • command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; uv run --directory tools/agent-fleet --locked pytest || rc=1; uv run --directory tools/agent-fleet --locked python -m compileall -q src || rc=1; exit "$rc"

🔧 Fix: Bound stale wake-lock steal recursion
1 error still open:

  • 🚨 tests failed with exit code 1
  • command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; uv run --directory tools/agent-fleet --locked pytest || rc=1; uv run --directory tools/agent-fleet --locked python -m compileall -q src || rc=1; exit "$rc"

🔧 Fix: Fix spawn and teardown test fixture drift
1 error still open:

  • 🚨 tests failed with exit code 1
  • command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; uv run --directory tools/agent-fleet --locked pytest || rc=1; uv run --directory tools/agent-fleet --locked python -m compileall -q src || rc=1; exit "$rc"

🔧 Fix: Captain, stabilize failed Treehouse return fixture
1 error still open:

  • 🚨 tests failed with exit code 1
  • command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; uv run --directory tools/agent-fleet --locked pytest || rc=1; uv run --directory tools/agent-fleet --locked python -m compileall -q src || rc=1; exit "$rc"

🔧 Fix: Verify Lavish tests; preserve known isolation failures
1 error still open:

  • 🚨 tests failed with exit code 1
  • command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; uv run --directory tools/agent-fleet --locked pytest || rc=1; uv run --directory tools/agent-fleet --locked python -m compileall -q src || rc=1; exit "$rc"
✅ **Document** - passed

✅ No issues found.

⚠️ **Lint** - 1 warning
  • ⚠️ linter found issues (exit code 1)
✅ **Push** - passed

✅ No issues found.

@ruby-dlee
ruby-dlee force-pushed the fm/lavish-fork-build-f2 branch from 8b6d685 to ba3df14 Compare July 31, 2026 17:00
@ruby-dlee
ruby-dlee merged commit d7db2dc into main Jul 31, 2026
5 checks passed
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