storkit: merge 457_bug_store_json_created_at_project_root_instead_of_inside_storkit

This commit is contained in:
dave
2026-04-02 13:24:15 +00:00
parent 46d09d4d45
commit 967a306ea8
3 changed files with 20 additions and 5 deletions
+9 -3
View File
@@ -294,6 +294,7 @@ fn write_story_kit_gitignore(root: &Path) -> Result<(), String> {
"logs/",
"token_usage.jsonl",
"wizard_state.json",
"store.json",
];
let gitignore_path = root.join(".storkit").join(".gitignore");
@@ -330,11 +331,13 @@ fn write_story_kit_gitignore(root: &Path) -> Result<(), String> {
}
/// Append root-level Story Kit entries to the project `.gitignore`.
/// Only `store.json` and `.storkit_port` remain here because they live at
/// Only `.storkit_port` and `.mcp.json` remain here because they live at
/// the project root and git does not support `../` patterns in `.gitignore`
/// files, so they cannot be expressed in `.storkit/.gitignore`.
/// `store.json` is excluded via `.storkit/.gitignore` since it now lives
/// inside the `.storkit/` directory.
fn append_root_gitignore_entries(root: &Path) -> Result<(), String> {
let entries = [".storkit_port", "store.json", ".mcp.json"];
let entries = [".storkit_port", ".mcp.json"];
let gitignore_path = root.join(".gitignore");
let existing = if gitignore_path.exists() {
@@ -705,11 +708,14 @@ mod tests {
// Root .gitignore must contain root-level storkit entries
let root_content = fs::read_to_string(dir.path().join(".gitignore")).unwrap();
assert!(root_content.contains(".storkit_port"));
assert!(root_content.contains("store.json"));
// store.json now lives inside .storkit/ and must NOT appear in root .gitignore
assert!(!root_content.contains("store.json"));
// Root .gitignore must NOT contain .storkit/ sub-directory patterns
assert!(!root_content.contains(".storkit/worktrees/"));
assert!(!root_content.contains(".storkit/merge_workspace/"));
assert!(!root_content.contains(".storkit/coverage/"));
// store.json must be in .storkit/.gitignore instead
assert!(sk_content.contains("store.json"));
}
#[test]