The great storkit name conversion

This commit is contained in:
Dave
2026-03-20 12:26:02 +00:00
parent 51d878e117
commit c4e45b2841
25 changed files with 1522 additions and 1333 deletions

View File

@@ -10,12 +10,12 @@ mod io;
mod llm;
pub mod log_buffer;
mod matrix;
pub mod slack;
mod state;
mod store;
pub mod transport;
mod workflow;
pub mod slack;
pub mod whatsapp;
mod workflow;
mod worktree;
use crate::agents::AgentPool;
@@ -96,7 +96,10 @@ async fn main() -> Result<(), std::io::Error> {
} else {
// No .storkit/ found — fall back to cwd so existing behaviour is preserved.
// TRACE:MERGE-DEBUG — remove once root cause is found
slog!("[MERGE-DEBUG] main: no .storkit/ found, falling back to cwd {:?}", cwd);
slog!(
"[MERGE-DEBUG] main: no .storkit/ found, falling back to cwd {:?}",
cwd
);
*app_state.project_root.lock().unwrap() = Some(cwd.clone());
}
}
@@ -125,12 +128,7 @@ async fn main() -> Result<(), std::io::Error> {
let watcher_config = config::ProjectConfig::load(root)
.map(|c| c.watcher)
.unwrap_or_default();
io::watcher::start_watcher(
work_dir,
root.clone(),
watcher_tx.clone(),
watcher_config,
);
io::watcher::start_watcher(work_dir, root.clone(), watcher_tx.clone(), watcher_config);
}
}
@@ -139,8 +137,7 @@ async fn main() -> Result<(), std::io::Error> {
{
let watcher_auto_rx = watcher_tx.subscribe();
let watcher_auto_agents = Arc::clone(&agents);
let watcher_auto_root: Option<PathBuf> =
app_state.project_root.lock().unwrap().clone();
let watcher_auto_root: Option<PathBuf> = app_state.project_root.lock().unwrap().clone();
if let Some(root) = watcher_auto_root {
tokio::spawn(async move {
let mut rx = watcher_auto_rx;
@@ -152,9 +149,7 @@ async fn main() -> Result<(), std::io::Error> {
"[auto-assign] Watcher detected work item in {stage}/; \
triggering auto-assign."
);
watcher_auto_agents
.auto_assign_available_work(&root)
.await;
watcher_auto_agents.auto_assign_available_work(&root).await;
}
}
});
@@ -162,8 +157,7 @@ async fn main() -> Result<(), std::io::Error> {
}
// Reconciliation progress channel: startup reconciliation → WebSocket clients.
let (reconciliation_tx, _) =
broadcast::channel::<agents::ReconciliationEvent>(64);
let (reconciliation_tx, _) = broadcast::channel::<agents::ReconciliationEvent>(64);
// Permission channel: MCP prompt_permission → WebSocket handler.
let (perm_tx, perm_rx) = tokio::sync::mpsc::unbounded_channel();
@@ -262,11 +256,15 @@ async fn main() -> Result<(), std::io::Error> {
let app = build_routes(ctx, whatsapp_ctx, slack_ctx);
// Optional Matrix bot: connect to the homeserver and start listening for
// messages if `.storkit/bot.toml` is present and enabled.
if let Some(ref root) = startup_root {
matrix::spawn_bot(root, watcher_tx_for_bot, perm_rx_for_bot, Arc::clone(&startup_agents));
matrix::spawn_bot(
root,
watcher_tx_for_bot,
perm_rx_for_bot,
Arc::clone(&startup_agents),
);
}
// On startup:
@@ -275,15 +273,11 @@ async fn main() -> Result<(), std::io::Error> {
// 2. Auto-assign free agents to remaining unassigned work in the pipeline.
if let Some(root) = startup_root {
tokio::spawn(async move {
slog!(
"[startup] Reconciling completed worktrees from previous session."
);
slog!("[startup] Reconciling completed worktrees from previous session.");
startup_agents
.reconcile_on_startup(&root, &startup_reconciliation_tx)
.await;
slog!(
"[auto-assign] Scanning pipeline stages for unassigned work."
);
slog!("[auto-assign] Scanning pipeline stages for unassigned work.");
startup_agents.auto_assign_available_work(&root).await;
});
}
@@ -292,7 +286,7 @@ async fn main() -> Result<(), std::io::Error> {
println!(
"\x1b[95;1m ____ _ _ ___ _ \n / ___|| |_ ___ _ __| | _|_ _| |_ \n \\___ \\| __/ _ \\| '__| |/ /| || __|\n ___) | || (_) | | | < | || |_ \n |____/ \\__\\___/|_| |_|\\_\\___|\\__|\n\x1b[0m"
);
println!("STORYKIT_PORT={port}");
println!("STORKIT_PORT={port}");
println!("\x1b[96;1mFrontend:\x1b[0m \x1b[94mhttp://{addr}\x1b[0m");
println!("\x1b[92;1mOpenAPI Docs:\x1b[0m \x1b[94mhttp://{addr}/docs\x1b[0m");
@@ -352,7 +346,9 @@ name = "coder"
let args = vec!["/some/absolute/path".to_string()];
let result = parse_project_path_arg(&args, &cwd).unwrap();
// Absolute path returned as-is (canonicalize may fail, fallback used)
assert!(result.ends_with("absolute/path") || result == PathBuf::from("/some/absolute/path"));
assert!(
result.ends_with("absolute/path") || result == PathBuf::from("/some/absolute/path")
);
}
#[test]