-
Notifications
You must be signed in to change notification settings - Fork 2
fix: activate lifecycle bridges during installer onboarding #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,9 +3,8 @@ use std::io::{self, IsTerminal, Write}; | |
| use std::path::Path; | ||
| use std::thread; | ||
| use std::time::Duration; | ||
| use tree_ring_memory_sqlite::SQLiteMemoryStore; | ||
|
|
||
| use crate::agent_awareness::{ensure_agent_awareness, AgentAwarenessReport}; | ||
| use crate::agent_awareness::AgentAwarenessReport; | ||
| use crate::ring_mark::{ | ||
| pulse_index, ring_mark_rows_with_activity, RingMarkActivity, RingMarkCell, RingMarkLayer, | ||
| }; | ||
|
|
@@ -30,12 +29,11 @@ const CORAL_BG: &str = "48;2;255;101;83"; | |
|
|
||
| pub fn run(root: &Path, init: bool, no_animation: bool, json_output: bool) -> Result<(), String> { | ||
| let db_path = root.join("memory.sqlite"); | ||
| let (initialized, awareness) = if init { | ||
| let awareness = ensure_agent_awareness(root)?; | ||
| 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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2. Nested projects call the wrong store 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
|
||
| (true, Some(awareness), Some(status)) | ||
| } else { | ||
| (db_path.exists(), None) | ||
| (db_path.exists(), None, None) | ||
| }; | ||
|
|
||
| if json_output { | ||
|
|
@@ -48,6 +46,7 @@ pub fn run(root: &Path, init: bool, no_animation: bool, json_output: bool) -> Re | |
| "initialized": initialized, | ||
| "init_requested": init, | ||
| "agent_awareness": awareness, | ||
| "activation": status, | ||
| "next": next_commands(root), | ||
| }) | ||
| ); | ||
|
|
@@ -63,6 +62,17 @@ pub fn run(root: &Path, init: bool, no_animation: bool, json_output: bool) -> Re | |
| color, | ||
| !no_animation, | ||
| )?; | ||
| if let Some(status) = status { | ||
| println!("\nHarness readiness"); | ||
| for entry in status.integrations { | ||
| println!( | ||
| " {}: {}", | ||
| entry.name, | ||
| crate::activation_state_name(entry.state) | ||
| ); | ||
| println!(" {}", entry.next_step); | ||
| } | ||
| } | ||
| Ok(()) | ||
| } | ||
|
|
||
|
|
@@ -396,6 +406,17 @@ mod tests { | |
| assert!(contains_active_style(&scar_frame, CORAL, CORAL_FG)); | ||
| } | ||
|
|
||
| #[test] | ||
| fn welcome_without_init_does_not_create_project_state() { | ||
| let dir = tempdir().unwrap(); | ||
| let root = dir.path().join(".tree-ring"); | ||
|
|
||
| run(&root, false, true, true).unwrap(); | ||
|
|
||
| assert!(!root.exists()); | ||
| assert!(!dir.path().join(".codex/hooks.json").exists()); | ||
| } | ||
|
|
||
| #[test] | ||
| fn no_animation_welcome_can_initialize_store() { | ||
| let dir = tempdir().unwrap(); | ||
|
|
@@ -404,6 +425,8 @@ mod tests { | |
| run(&root, true, true, false).unwrap(); | ||
|
|
||
| assert!(root.join("memory.sqlite").exists()); | ||
| assert!(root.join("activation.json").exists()); | ||
| assert!(root.join("activation/agent-zero.json").exists()); | ||
| assert!(root.join("AGENTS.md").exists()); | ||
| assert!(root.join("SKILL.md").exists()); | ||
| assert!(root.join("CLI.md").exists()); | ||
|
|
@@ -417,6 +440,8 @@ mod tests { | |
| run(&root, true, true, true).unwrap(); | ||
|
|
||
| assert!(root.join("memory.sqlite").exists()); | ||
| assert!(root.join("activation.json").exists()); | ||
| assert!(root.join("activation/agent-zero.json").exists()); | ||
| assert!(root.join("AGENTS.md").exists()); | ||
| assert!(root.join("SKILL.md").exists()); | ||
| assert!(root.join("CLI.md").exists()); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. Custom-root users get partial setup
🐞 Bug≡ CorrectnessAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools