You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Concentrate repeated local runtime policy into a few deep modules so future browser, storage, and provisioning work changes one implementation rather than lockstep CLI/MCP or command paths.
Why
Current source duplicates local session lifecycle composition across CLI and MCP, splits local teardown between explicit destroy and reaping, divides run verification among readers, and leaves provisioning privilege metadata outside execution policy. This increases change cost and makes the important interface test surface hard to exercise once.
Top priority
PR 1 — Centralize local session lifecycle composition. It removes source-confirmed duplicate transaction policy with high confidence and medium risk, while preserving browser ownership, viewer behavior, evidence wrapping, and control-state separation.
Architecture constraints
Browser sessions continue to own their private display and browser lifecycle.
A combined desktop+Android request remains a recipe for separate local records.
One local lifecycle implementation owns recipe expansion, rollback, typed destroy dispatch, and canonical status aggregation; CLI/MCP output behavior remains unchanged.
Reaper and explicit destroy use one typed runtime teardown owner; retry and durable finalization semantics remain characterized.
One provisioning implementation owns consent, dry-run, privilege routing, cancellation, and partial results; no credential material is captured or persisted.
Focused characterization tests cover the retained invariants before each migration.
Typecheck and build pass for every PR; full validation follows normal repository policy.
Dependency-ordered PR plan
PR 1 — Centralize local session lifecycle composition
Validation: bun run test packages/cli/test/commands.test.ts packages/mcp-server/test/tools.test.ts packages/mcp-server/test/browser.test.ts; bun run typecheck; bun run build
Link: pending
PR 2 — Route reaper teardown through typed runtime ownership
Prove: verified reads bind manifest identity to its directory; legacy runs remain readable; new writes follow configured storage mode with no automatic migration
Validation: bun run test packages/core/test/run.test.ts packages/core/test/evidence.test.ts packages/mcp-server/test/resources.test.ts; focused Store run artifacts outside project repositories by default #34 config/path tests; bun run typecheck; bun run build
Prove: consent, dry-run, privileged routing, cancellation, and partial failures are consistent across commands without changing command wording
Validation: bun run test packages/cli/test/executor.test.ts packages/cli/test/planner.test.ts packages/cli/test/cli.test.ts; bun run typecheck; bun run build
No feature flag. Each PR is an internal refactor or backward-compatible storage rollout with preserved current defaults and independently reviewable behavior.
Audit commit snapshot
de467fbd14d00d4afa4946f610d05d724a6fa777 on main.
Current status
Planned.
Next action
Open PR 1 with characterization tests and migrate only local lifecycle composition; do not combine teardown, storage, or privilege execution changes.
Goal
Concentrate repeated local runtime policy into a few deep modules so future browser, storage, and provisioning work changes one implementation rather than lockstep CLI/MCP or command paths.
Why
Current source duplicates local session lifecycle composition across CLI and MCP, splits local teardown between explicit destroy and reaping, divides run verification among readers, and leaves provisioning privilege metadata outside execution policy. This increases change cost and makes the important interface test surface hard to exercise once.
Top priority
PR 1 — Centralize local session lifecycle composition. It removes source-confirmed duplicate transaction policy with high confidence and medium risk, while preserving browser ownership, viewer behavior, evidence wrapping, and control-state separation.
Architecture constraints
--outremains unrestricted.Scope / acceptance checklist
Dependency-ordered PR plan
PR 1 — Centralize local session lifecycle composition
bun run test packages/cli/test/commands.test.ts packages/mcp-server/test/tools.test.ts packages/mcp-server/test/browser.test.ts;bun run typecheck;bun run buildPR 2 — Route reaper teardown through typed runtime ownership
bun run typecheckPR 3 — Establish verified run catalog and land #34 storage resolver
bun run test packages/core/test/run.test.ts packages/core/test/evidence.test.ts packages/mcp-server/test/resources.test.ts; focused Store run artifacts outside project repositories by default #34 config/path tests;bun run typecheck;bun run buildPR 4 — Deepen provisioning execution policy
bun run test packages/cli/test/executor.test.ts packages/cli/test/planner.test.ts packages/cli/test/cli.test.ts;bun run typecheck;bun run buildExisting issue coordination
Non-goals
No-feature-flag decision
No feature flag. Each PR is an internal refactor or backward-compatible storage rollout with preserved current defaults and independently reviewable behavior.
Audit commit snapshot
de467fbd14d00d4afa4946f610d05d724a6fa777onmain.Current status
Planned.
Next action
Open PR 1 with characterization tests and migrate only local lifecycle composition; do not combine teardown, storage, or privilege execution changes.