fix: activate lifecycle bridges during installer onboarding - #62
Conversation
|
Warning Review limit reachedNext included review available in 38 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (7)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Summary by QodoInitialize lifecycle bridges during installer onboarding
AI Description
Diagram
High-Level Assessment
Files changed (8)
|
Code Review by Qodo
1. Custom-root users get partial setup
|
| SQLiteMemoryStore::open(&db_path).map_err(|err| err.to_string())?; | ||
| (true, Some(awareness)) | ||
| let (initialized, awareness, status) = if init { | ||
| let (awareness, status) = crate::initialize_project(root)?; |
There was a problem hiding this comment.
1. Custom-root users get partial setup 🐞 Bug ≡ Correctness
welcome::run now sends every requested root into initialize_project, whose activation layer requires the final directory to be exactly .tree-ring even though the CLI and installer accept any memory-store root. With --root cache or any other basename, awareness files and memory.sqlite are created first and manifest loading then errors, so installer onboarding exits unsuccessfully after leaving a partially initialized store.
Agent Prompt
## Issue description
`welcome --init` now partially initializes custom memory roots before activation rejects them for not being named `.tree-ring`.
## Issue Context
The CLI and installer expose `--root` as a general memory-store directory, but activation enforces a stricter project-local `.tree-ring` shape. Make that contract consistent: either safely support configured roots throughout activation, or reject unsupported roots before creating awareness files or the SQLite database and update the exposed contract accordingly. Add coverage for installer onboarding with a non-default root.
## Fix Focus Areas
- crates/tree-ring-memory-cli/src/welcome.rs[30-36]
- crates/tree-ring-memory-cli/src/main.rs[1391-1416]
- crates/tree-ring-memory-cli/src/activation/bridge.rs[2193-2199]
- install.sh[60-61]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| SQLiteMemoryStore::open(&db_path).map_err(|err| err.to_string())?; | ||
| (true, Some(awareness)) | ||
| let (initialized, awareness, status) = if init { | ||
| let (awareness, status) = crate::initialize_project(root)?; |
There was a problem hiding this comment.
2. Nested projects call the wrong store 🐞 Bug ≡ Correctness
initialize_project emits bridge commands that derive project_root from git rev-parse and hard-code $project_root/.tree-ring, rather than using the memory root whose parent was initialized. When --root nested/.tree-ring identifies a nested project inside a larger Git checkout and a native harness is detected there, its new hooks target the outer checkout's store instead of the initialized nested store.
Agent Prompt
## Issue description
Lifecycle hooks created by onboarding can address the outer Git checkout's `.tree-ring` instead of the configured nested project's store.
## Issue Context
Activation derives the project from the configured memory root, but generated hook commands independently redefine the project as the Git top level. Generate commands that resolve the same project and memory root initialized by onboarding, while retaining safe behavior from nested working directories. Add a test for a nested project within a larger Git checkout.
## Fix Focus Areas
- crates/tree-ring-memory-cli/src/welcome.rs[30-34]
- crates/tree-ring-memory-cli/src/main.rs[1407-1416]
- crates/tree-ring-memory-cli/src/activation/lifecycle.rs[14-20]
- crates/tree-ring-memory-cli/src/activation/bridge.rs[66-102]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
A fresh
install.sh --project --initinvokedtree-ring welcome --init, which created the database and guidance but skippedactivation.jsonand native hooks. Onboarding printed “ready,” yet lifecycle activation failed with “activation manifest is unavailable.”Make
welcome --initandinitshare the same create-only project initializer. Installer onboarding now creates the activation manifest and safe detected harness bridges, reports each harness's actual readiness, and preserves existing files and memory. Plainwelcomestays read-only and JSON onboarding still emits exactly one document.Release CLI 0.15.7 and pair the upcoming Agent Zero 3.4.1 bundle with that minimum. The existing 0.15.6 release remains immutable.
Validation: the full Rust workspace passes; onboarding tests cover activation creation and read-only welcome. The generated-hook acceptance test now starts through
welcome --init, then exercises capture and recall across sessions from nested directories with only a project-local CLI.High-level PR Summary
This PR fixes a bug where installer onboarding (
install.sh --project --initviatree-ring welcome --init) created the database and guidance files but skipped the activation manifest and native hooks, causing lifecycle activation to fail. The fix refactorswelcome --initto share the same project initialization logic as theinitcommand, ensuring both create the activation manifest and safe harness bridges while preserving existing files. The CLI version is bumped from 0.15.6 to 0.15.7, with Agent Zero 3.4.1 paired to require this minimum version. Read-onlywelcomebehavior and JSON onboarding output format remain unchanged.⏱️ Estimated Review Time: 15-30 minutes
💡 Review Order Suggestion
README.mdCargo.tomlCargo.lockcrates/tree-ring-memory-cli/Cargo.tomlcrates/tree-ring-memory-cli/src/main.rscrates/tree-ring-memory-cli/src/welcome.rscrates/tree-ring-memory-cli/tests/harness_activation_acceptance.rscrates/tree-ring-memory-cli/src/activation/adapters.rs