From 187e01e7b33b10302c16170de9134f50da31d1f8 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 15 Sep 2026 23:06:20 +0200 Subject: [PATCH] Pin the marker rule and the odd-layout refusal on their own The mutation pass found two rules that no test failed for, both because an earlier check answered first. The marker rule. Every bad parent in `parent_ids_are_parsed_strictly` also violated the digits rule, so removing the `` requirement altogether (Soul's S3) still refused every case and killed nothing. Two cases now cite the right kind with a well-formed number and the wrong kind's marker, which only the marker rule refuses. The odd-layout refusal. `a_bare_clone_has_no_main_work_tree` asserted `NotRepoRoot`, which a bare clone hits before `main_work_tree` is ever reached, so `NoMainWorkTree` was unpinned and dropping the `.git` check failed nothing. The test is renamed to `a_bare_clone_is_not_a_repo_root` for what it actually pins, and `a_separate_git_dir_has_no_main_work_tree` covers ruling 10's odd layout: a work-tree top level whose git dir is not a sibling `.git`, refused on both the write and the read path. Builds clean with no warnings; `cargo test -p epiphany-core --lib` passes 180/180. Co-Authored-By: Claude Opus 5 --- epiphany-core/src/pipeline_store.rs | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/epiphany-core/src/pipeline_store.rs b/epiphany-core/src/pipeline_store.rs index 91b99be7..be961f30 100644 --- a/epiphany-core/src/pipeline_store.rs +++ b/epiphany-core/src/pipeline_store.rs @@ -782,6 +782,10 @@ mod tests { refused(&format!("{CAMPAIGN}:cut_spec:cut-3a.r1 ")); refused(&format!("{CAMPAIGN}:cut_spec:cut-3a.r")); refused(&format!("{CAMPAIGN}:cut_report:cut-3a.h1")); + // Right kind and a well-formed number, but the marker belongs to + // another kind: the marker rule is pinned on its own. + refused(&format!("{CAMPAIGN}:cut_spec:cut-3a.h1")); + refused(&format!("{CAMPAIGN}:cut_spec:cut-3a.s1")); refused(&format!("{CAMPAIGN}:CUT_SPEC:cut-3a.r1")); refused(&format!("EUREKA-STATE:cut_spec:cut-3a.r1")); refused(&format!("{CAMPAIGN}:cut_spec:cut-3a.r1:")); @@ -1121,7 +1125,7 @@ mod tests { } #[test] - fn a_bare_clone_has_no_main_work_tree() -> Result<()> { + fn a_bare_clone_is_not_a_repo_root() -> Result<()> { let temp = tempdir()?; let bare = temp.path().join("bare.git"); std::fs::create_dir_all(&bare)?; @@ -1133,6 +1137,26 @@ mod tests { Ok(()) } + /// Ruling 10's odd-layout arm: a work-tree top level whose git dir is not a + /// sibling `.git` has no main working tree to resolve, and refuses typed. + #[test] + fn a_separate_git_dir_has_no_main_work_tree() -> Result<()> { + let temp = tempdir()?; + let root = temp.path().join("repo"); + let git_dir = temp.path().join("elsewhere.git"); + std::fs::create_dir_all(&root)?; + git_ok(&root, &["init", "-q", "-b", "main", "--separate-git-dir", &git_dir.to_string_lossy()])?; + assert!( + matches!(attach(&root, "separate").err(), Some(PipelineRefusal::NoMainWorkTree { .. })), + "a separate git dir refuses typed, with no worktree-only mode" + ); + assert!( + matches!(PipelineStore::open(&root).err(), Some(PipelineRefusal::NoMainWorkTree { .. })), + "and the read path refuses it the same way" + ); + Ok(()) + } + #[test] fn pipeline_published_schemas_match_derivation() -> Result<()> { let published = Path::new(env!("CARGO_MANIFEST_DIR")).join("../schemas/cultnet");