Repository navigation
feat(cli): split portable session state from host config (#1338) - #1349
Conversation
Astro-Han
left a comment
There was a problem hiding this comment.
One more issue outside the inline comments:
[P2] planSessionBundleExport() only checks session existence if it finds a top-level sessions/ directory. I reproduced an empty stateRoot returning a successful empty plan and export. Please require the requested session before returning the plan and add coverage for an empty root and a root without sessions/.
The branch also conflicts with current main, so the checks need to run again after the rebase and metadata changes.
f7b0a76 to
8a8f307
Compare
|
Rebased onto current The final revision exports selected SQLite session metadata through the existing transfer seam, preserves every missing destination suffix, copies the explicit set of normal session-owned runtime entries, routes every skill surface through Validation on the rebased tree: format, lint, full workspace build/typecheck, Session Bundle policy 8/8, metadata maintenance 2/2, and isolated CLI runtime bootstrap 21/21. |
Astro-Han
left a comment
There was a problem hiding this comment.
Approved. The implementation uses the existing bootstrap and SQLite transfer seams, keeps the state/config trust boundary explicit, and addresses the previously reported correctness issues. I did not find a blocking implementation problem in the current head.
Non-blocking follow-ups:
- [P2] Strengthen the bundle round-trip test. The happy-path fixture currently writes schema-invalid run and artifact records and then verifies copied bytes. Please create representative state through the public stores and reopen the exported bundle through those same stores, so the test proves that selected runs, artifacts, shell runs, and runtime events remain consumable.
- [P2] Exercise device-ID isolation through the real bootstrap path. The current test calls
getOrCreateCliClaudeDeviceId(configRoot)directly, so it would still pass if one of the bootstrap call sites regressed toworkspaceRoot. Trigger the Claude device-ID path throughcreateMakaCliRuntimeContext, and keep one representative state-root/config-root journey for the other routed stores. - [P3] Make execution-phase export failures recoverable. If filtering fails after copying begins—for example, on malformed artifact metadata—the destination is left partially populated and a retry fails with
destination_not_empty. Consider exporting into a staging directory and renaming on success, or reliably cleaning the destination on failure.
These do not block the state/config split itself, but they would make the trust-boundary tests and export failure behavior substantially stronger.
|
The two P2 test gaps and the P3 cleanup behavior are worth following up, but none changes the correctness of the state/config split or makes the current implementation unsafe to merge. The current head is approved, and its typecheck, test, and e2e jobs are green. Merging this as-is; the follow-ups can be handled separately. |
Closes #1338
Summary
stateRootandconfigRootinputs at the CLI runtime bootstrap seam while retainingworkspaceRootas the backward-compatible default.stateRoot.configRoot.sessions.sqlite.runtime.sqliteby session.Compression, manifests, activation inputs, and the
maka activatecontrol plane remain out of scope.Validation
npm run format:checknpm run lintnpm run build:testnpm run typecheckgit diff --checkThe three existing background ShellRun timing cases can exceed their 3-second polling deadline when run concurrently with heavy build/review load; the unchanged cases passed immediately when rerun in isolation.