rename .story_kit directory to .storkit and update all references

Renames the config directory and updates 514 references across 42 Rust
source files, plus CLAUDE.md, .gitignore, Makefile, script/release,
and .mcp.json files. All 1205 tests pass.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Dave
2026-03-20 11:34:53 +00:00
parent 375277f86e
commit 9581e5d51a
406 changed files with 531 additions and 530 deletions

View File

@@ -1,10 +1,10 @@
//! Filesystem watcher for `.story_kit/work/` and `.story_kit/project.toml`.
//! Filesystem watcher for `.storkit/work/` and `.storkit/project.toml`.
//!
//! Watches the work pipeline directories for file changes, infers the lifecycle
//! stage from the target directory name, auto-commits with a deterministic message,
//! and broadcasts a [`WatcherEvent`] to all connected WebSocket clients.
//!
//! Also watches `.story_kit/project.toml` for modifications and broadcasts
//! Also watches `.storkit/project.toml` for modifications and broadcasts
//! [`WatcherEvent::ConfigChanged`] so the frontend can reload the agent roster
//! without a server restart.
//!
@@ -45,7 +45,7 @@ pub enum WatcherEvent {
/// The deterministic git commit message used (or that would have been used).
commit_msg: String,
},
/// `.story_kit/project.toml` was modified at the project root (not inside a worktree).
/// `.storkit/project.toml` was modified at the project root (not inside a worktree).
ConfigChanged,
/// An agent's state changed (started, stopped, completed, etc.).
/// Triggers a pipeline state refresh so the frontend can update agent
@@ -61,8 +61,8 @@ pub enum WatcherEvent {
},
}
/// Return `true` if `path` is the root-level `.story_kit/project.toml`, i.e.
/// `{git_root}/.story_kit/project.toml`.
/// Return `true` if `path` is the root-level `.storkit/project.toml`, i.e.
/// `{git_root}/.storkit/project.toml`.
///
/// Returns `false` for paths inside worktree directories (paths containing
/// a `worktrees` component).
@@ -71,7 +71,7 @@ pub fn is_config_file(path: &Path, git_root: &Path) -> bool {
if path.components().any(|c| c.as_os_str() == "worktrees") {
return false;
}
let expected = git_root.join(".story_kit").join("project.toml");
let expected = git_root.join(".storkit").join("project.toml");
path == expected
}
@@ -92,7 +92,7 @@ fn stage_metadata(stage: &str, item_id: &str) -> Option<(&'static str, String)>
/// Return the pipeline stage name for a path if it is a `.md` file living
/// directly inside one of the known work subdirectories, otherwise `None`.
///
/// Explicitly returns `None` for any path under `.story_kit/worktrees/` so
/// Explicitly returns `None` for any path under `.storkit/worktrees/` so
/// that code changes made by agents in their isolated worktrees are never
/// auto-committed to master by the watcher.
fn stage_for_path(path: &Path) -> Option<String> {
@@ -117,11 +117,11 @@ fn stage_for_path(path: &Path) -> Option<String> {
/// Stage all changes in the work directory and commit with the given message.
///
/// Uses `git add -A .story_kit/work/` to catch both additions and deletions in
/// Uses `git add -A .storkit/work/` to catch both additions and deletions in
/// a single commit. Returns `Ok(true)` if a commit was made, `Ok(false)` if
/// there was nothing to commit, and `Err` for unexpected failures.
fn git_add_work_and_commit(git_root: &Path, message: &str) -> Result<bool, String> {
let work_rel = PathBuf::from(".story_kit").join("work");
let work_rel = PathBuf::from(".storkit").join("work");
let add_out = std::process::Command::new("git")
.args(["add", "-A"])
@@ -170,7 +170,7 @@ fn should_commit_stage(stage: &str) -> bool {
///
/// Only files that still exist on disk are used to derive the commit message
/// (they represent the destination of a move or a new file). Deletions are
/// captured by `git add -A .story_kit/work/` automatically.
/// captured by `git add -A .storkit/work/` automatically.
///
/// Only terminal stages (`1_backlog` and `6_archived`) trigger git commits.
/// All stages broadcast a [`WatcherEvent`] so the frontend stays in sync.
@@ -338,9 +338,9 @@ fn sweep_done_to_archived(work_dir: &Path, git_root: &Path, done_retention: Dura
/// Start the filesystem watcher on a dedicated OS thread.
///
/// `work_dir` — absolute path to `.story_kit/work/` (watched recursively).
/// `work_dir` — absolute path to `.storkit/work/` (watched recursively).
/// `git_root` — project root (passed to `git` commands as cwd, and used to
/// derive the config file path `.story_kit/project.toml`).
/// derive the config file path `.storkit/project.toml`).
/// `event_tx` — broadcast sender; each connected WebSocket client holds a receiver.
/// `watcher_config` — initial sweep configuration loaded from `project.toml`.
pub fn start_watcher(
@@ -367,8 +367,8 @@ pub fn start_watcher(
return;
}
// Also watch .story_kit/project.toml for hot-reload of agent config.
let config_file = git_root.join(".story_kit").join("project.toml");
// Also watch .storkit/project.toml for hot-reload of agent config.
let config_file = git_root.join(".storkit").join("project.toml");
if config_file.exists()
&& let Err(e) = watcher.watch(&config_file, RecursiveMode::NonRecursive)
{
@@ -521,9 +521,9 @@ mod tests {
.expect("git initial commit");
}
/// Create the `.story_kit/work/{stage}/` dir tree inside `root`.
/// Create the `.storkit/work/{stage}/` dir tree inside `root`.
fn make_stage_dir(root: &std::path::Path, stage: &str) -> PathBuf {
let dir = root.join(".story_kit").join("work").join(stage);
let dir = root.join(".storkit").join("work").join(stage);
fs::create_dir_all(&dir).expect("create stage dir");
dir
}
@@ -702,7 +702,7 @@ mod tests {
make_stage_dir(tmp.path(), "2_current");
let deleted_path = tmp
.path()
.join(".story_kit")
.join(".storkit")
.join("work")
.join("2_current")
.join("42_story_foo.md");
@@ -731,7 +731,7 @@ mod tests {
let tmp = TempDir::new().unwrap();
init_git_repo(tmp.path());
// File sits in an unrecognised directory.
let unknown_dir = tmp.path().join(".story_kit").join("work").join("9_unknown");
let unknown_dir = tmp.path().join(".storkit").join("work").join("9_unknown");
fs::create_dir_all(&unknown_dir).unwrap();
let path = unknown_dir.join("42_story_foo.md");
fs::write(&path, "---\nname: test\n---\n").unwrap();
@@ -889,7 +889,7 @@ mod tests {
#[test]
fn stage_for_path_recognises_pipeline_dirs() {
let base = PathBuf::from("/proj/.story_kit/work");
let base = PathBuf::from("/proj/.storkit/work");
assert_eq!(
stage_for_path(&base.join("2_current/42_story_foo.md")),
Some("2_current".to_string())
@@ -911,7 +911,7 @@ mod tests {
#[test]
fn stage_for_path_ignores_worktree_paths() {
let worktrees = PathBuf::from("/proj/.story_kit/worktrees");
let worktrees = PathBuf::from("/proj/.storkit/worktrees");
// Code changes inside a worktree must be ignored.
assert_eq!(
@@ -922,14 +922,14 @@ mod tests {
// Even if a worktree happens to contain a path component that looks
// like a pipeline stage, it must still be ignored.
assert_eq!(
stage_for_path(&worktrees.join("42_story_foo/.story_kit/work/2_current/42_story_foo.md")),
stage_for_path(&worktrees.join("42_story_foo/.storkit/work/2_current/42_story_foo.md")),
None,
);
// A path that only contains the word "worktrees" as part of a longer
// segment (not an exact component) must NOT be filtered out.
assert_eq!(
stage_for_path(&PathBuf::from("/proj/.story_kit/work/2_current/not_worktrees_story.md")),
stage_for_path(&PathBuf::from("/proj/.storkit/work/2_current/not_worktrees_story.md")),
Some("2_current".to_string()),
);
}
@@ -968,7 +968,7 @@ mod tests {
#[test]
fn is_config_file_identifies_root_project_toml() {
let git_root = PathBuf::from("/proj");
let config = git_root.join(".story_kit").join("project.toml");
let config = git_root.join(".storkit").join("project.toml");
assert!(is_config_file(&config, &git_root));
}
@@ -977,7 +977,7 @@ mod tests {
let git_root = PathBuf::from("/proj");
// project.toml inside a worktree must NOT be treated as the root config.
let worktree_config = PathBuf::from(
"/proj/.story_kit/worktrees/42_story_foo/.story_kit/project.toml",
"/proj/.storkit/worktrees/42_story_foo/.storkit/project.toml",
);
assert!(!is_config_file(&worktree_config, &git_root));
}
@@ -987,11 +987,11 @@ mod tests {
let git_root = PathBuf::from("/proj");
// Random files must not match.
assert!(!is_config_file(
&PathBuf::from("/proj/.story_kit/work/2_current/42_story_foo.md"),
&PathBuf::from("/proj/.storkit/work/2_current/42_story_foo.md"),
&git_root
));
assert!(!is_config_file(
&PathBuf::from("/proj/.story_kit/README.md"),
&PathBuf::from("/proj/.storkit/README.md"),
&git_root
));
}
@@ -999,7 +999,7 @@ mod tests {
#[test]
fn is_config_file_rejects_wrong_root() {
let git_root = PathBuf::from("/proj");
let other_root_config = PathBuf::from("/other/.story_kit/project.toml");
let other_root_config = PathBuf::from("/other/.storkit/project.toml");
assert!(!is_config_file(&other_root_config, &git_root));
}
@@ -1008,7 +1008,7 @@ mod tests {
#[test]
fn sweep_moves_old_items_to_archived() {
let tmp = TempDir::new().unwrap();
let work_dir = tmp.path().join(".story_kit").join("work");
let work_dir = tmp.path().join(".storkit").join("work");
let done_dir = work_dir.join("5_done");
let archived_dir = work_dir.join("6_archived");
fs::create_dir_all(&done_dir).unwrap();
@@ -1036,7 +1036,7 @@ mod tests {
#[test]
fn sweep_keeps_recent_items_in_done() {
let tmp = TempDir::new().unwrap();
let work_dir = tmp.path().join(".story_kit").join("work");
let work_dir = tmp.path().join(".storkit").join("work");
let done_dir = work_dir.join("5_done");
fs::create_dir_all(&done_dir).unwrap();
@@ -1053,7 +1053,7 @@ mod tests {
#[test]
fn sweep_respects_custom_retention() {
let tmp = TempDir::new().unwrap();
let work_dir = tmp.path().join(".story_kit").join("work");
let work_dir = tmp.path().join(".storkit").join("work");
let done_dir = work_dir.join("5_done");
let archived_dir = work_dir.join("6_archived");
fs::create_dir_all(&done_dir).unwrap();
@@ -1083,7 +1083,7 @@ mod tests {
#[test]
fn sweep_custom_retention_keeps_younger_items() {
let tmp = TempDir::new().unwrap();
let work_dir = tmp.path().join(".story_kit").join("work");
let work_dir = tmp.path().join(".storkit").join("work");
let done_dir = work_dir.join("5_done");
fs::create_dir_all(&done_dir).unwrap();
@@ -1128,7 +1128,7 @@ mod tests {
let git_root = tmp.path().to_path_buf();
init_git_repo(&git_root);
let work_dir = git_root.join(".story_kit").join("work");
let work_dir = git_root.join(".storkit").join("work");
let done_dir = work_dir.join("5_done");
fs::create_dir_all(&done_dir).unwrap();
@@ -1169,7 +1169,7 @@ mod tests {
let git_root = tmp.path().to_path_buf();
init_git_repo(&git_root);
let work_dir = git_root.join(".story_kit").join("work");
let work_dir = git_root.join(".storkit").join("work");
let archived_dir = work_dir.join("6_archived");
fs::create_dir_all(&archived_dir).unwrap();
@@ -1204,7 +1204,7 @@ mod tests {
let git_root = tmp.path().to_path_buf();
init_git_repo(&git_root);
let work_dir = git_root.join(".story_kit").join("work");
let work_dir = git_root.join(".storkit").join("work");
let done_dir = work_dir.join("5_done");
fs::create_dir_all(&done_dir).unwrap();