Skip to content

fix(lavish): remove persistent browser automation anchor - #114

Open
ruby-dlee wants to merge 5 commits into
mainfrom
fm/chrome-board-leak-root-fix
Open

fix(lavish): remove persistent browser automation anchor#114
ruby-dlee wants to merge 5 commits into
mainfrom
fm/chrome-board-leak-root-fix

Conversation

@ruby-dlee

Copy link
Copy Markdown
Owner

Intent

Remove the Lavish board browser anchor entirely so opening and answering a board never leaves an npm chrome-devtools parent or dedicated Chrome process tree behind. Do not solve the leak with teardown, cleanup, kill, trap, server, poller, watcher, timer, long-poll, filesystem watcher, or resident listener logic; remove the persistent browser automation profile and armed submission check instead. Keep the board immediately usable through the operating system default browser, which the helper hands off to and then exits. Preserve the proven durable answer path end to end: the captain answers the self-contained board, its home-bound schema-version-2 JSON is downloaded with a manual payload backup, the captain tells firstmate directly, and one bounded lavish-axi intake scan recovers and validates the payload against the immutable request digest and ordered question/item set before committing answer.toon, the declared destination, and receipt.toon. Preserve the terminal lavish answer fallback. The PR description must explicitly state this safety property and manual handoff because it is the mechanism that has actually worked.

What Changed

  • Replaced the dedicated Chrome DevTools profile and armed submission check with an operating-system default-browser handoff that exits immediately, leaving no persistent npm chrome-devtools parent or dedicated Chrome process tree.
  • Made boards download home-bound schema-version-2 JSON with an identical manual payload backup; after the captain tells firstmate directly, one bounded intake validates the immutable request digest and ordered question/item set before committing answer.toon, the declared destination, and receipt.toon.
  • Made payload recovery request-bound and collision-safe across download locations while preserving the exact lavish answer ... --home ... terminal fallback.

Risk Assessment

✅ Low: Captain, the change is well-bounded and the complete source path now preserves home-bound, collision-safe intake without reintroducing persistent browser automation or resident cleanup logic.

Testing

Completed 1 recorded test check.

  • Outcome: ⚠️ 1 error across 2 runs (12h55m41s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 2 issues found → auto-fixed (3) ✅
  • 🚨 tools/lavish/src/board.mjs:457 - The required “one bounded lavish-axi intake scan recovers” path fails when a pending decision already has an earlier downloaded answer. A second download can produce the already-supported (1) filename; recoverLandingPayloads then treats differing valid payloads as a conflict and aborts before committing either. Resolve authorization at the shared intake candidate-selection boundary without restoring browser automation or submission checks.
  • 🚨 bin/fm-lavish-board.sh:193 - The requirement that the helper “hands off to [the default browser] and then exits” is not guaranteed by the Linux fallback: the script synchronously waits for xdg-open, whose documented behavior may keep it running for the lifetime of the launched application (xdg-open manual). Use an opener contract with explicit no-wait handoff semantics or fail closed where that cannot be guaranteed.

🔧 Fix: Make Lavish downloads collision-safe and Linux handoff fail-closed
1 error still open:

  • 🚨 tools/lavish/src/cli.mjs:565 - This contradicts the authorized requirement that colliding files “can never mix up, silently lose, or ambiguously select an answer.” Collision suffixes are only directory-local filenames, but intake ranks them globally across the effective state directory, LAVISH_DOWNLOADS_DIR, and ~/Downloads; therefore a stale (1) answer in one directory silently outranks the captain’s new unsuffixed answer in another and can be committed. At the shared intake boundary, fail closed whenever validated candidates for the same home/request disagree, unless authority is established by payload-bound protocol data rather than a filename suffix.

🔧 Fix: Bind Lavish collision authority to validated payload metadata
1 error still open:

  • 🚨 tools/lavish/src/protocol.mjs:670 - The required “home-bound schema-version-2 JSON” invariant is not enforced for the new authoritative landing payloads. Intake passes allowMissingHomeMarker: true, and landing validation is independent of that check, so a payload containing landing but no home_marker validates and can outrank a home-bound answer in another home sharing the same decision id/request digest. Require home_marker whenever landing is present; retain missing-marker compatibility only for legacy payloads without landing authority.

🔧 Fix: Require home binding for Lavish landing authority
✅ 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; base=$(mktemp -d); mdir="$base/manifests"; mkdir -p "$mdir"; pids=""; for s in 1 2 3 4 5 6 7 8; do ( TMPDIR="$base/$s/tmp"; TMUX_TMPDIR="$base/$s/tmux"; export TMPDIR TMUX_TMPDIR; mkdir -p "$TMPDIR" "$TMUX_TMPDIR"; bin/fm-behavior-shards.sh --run "$s" 8 "$mdir/executed-$s.tsv" >"$base/shard-$s.log" 2>&1 ) & pids="$pids $!"; done; for p in $pids; do wait "$p" || rc=1; done; for s in 1 2 3 4 5 6 7 8; do echo "== behavior shard $s/8 =="; cat "$base/shard-$s.log"; done; bin/fm-behavior-shards.sh --verify 8 "$mdir" || rc=1; rm -rf "$base"; 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: No code fix; Lavish failures were host-load timeouts
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; base=$(mktemp -d); mdir="$base/manifests"; mkdir -p "$mdir"; pids=""; for s in 1 2 3 4 5 6 7 8; do ( TMPDIR="$base/$s/tmp"; TMUX_TMPDIR="$base/$s/tmux"; export TMPDIR TMUX_TMPDIR; mkdir -p "$TMPDIR" "$TMUX_TMPDIR"; bin/fm-behavior-shards.sh --run "$s" 8 "$mdir/executed-$s.tsv" >"$base/shard-$s.log" 2>&1 ) & pids="$pids $!"; done; for p in $pids; do wait "$p" || rc=1; done; for s in 1 2 3 4 5 6 7 8; do echo "== behavior shard $s/8 =="; cat "$base/shard-$s.log"; done; bin/fm-behavior-shards.sh --verify 8 "$mdir" || rc=1; rm -rf "$base"; 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** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

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