feat(lavish): add durable decision protocol - #54
Merged
Conversation
ruby-dlee
force-pushed
the
fm/lavish-fork-build-f2
branch
from
July 31, 2026 17:00
8b6d685 to
ba3df14
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
tools/lavishone-shot CLI with durable file-backedcreate,inbox,show, andanswerworkflows, atomic no-clobber writes, idempotent submissions, and recoverable wake delivery.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.
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 UIDsreview/aandreview-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 everylavish-axi 1.xbinary. Session start continues after bootstrap reports an incompatible tool, so an unrelated/browser-era v1 binary on PATH would still receiveintake, reintroducing an incompatible lifecycle at an ordinary boundary. Match the samelavish-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.
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:
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:
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:
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:
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:
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.
✅ **Push** - passed
✅ No issues found.