diff --git a/.agents/skills/sf-wiki/SKILL.md b/.agents/skills/repo-map/SKILL.md similarity index 100% rename from .agents/skills/sf-wiki/SKILL.md rename to .agents/skills/repo-map/SKILL.md diff --git a/src/resources/skills/sf-wiki/SKILL.md b/src/resources/skills/repo-map/SKILL.md similarity index 100% rename from src/resources/skills/sf-wiki/SKILL.md rename to src/resources/skills/repo-map/SKILL.md diff --git a/src/tests/headless-triage-uok-gates.test.ts b/src/tests/headless-triage-uok-gates.test.ts index de4687ae2..65e54cd95 100644 --- a/src/tests/headless-triage-uok-gates.test.ts +++ b/src/tests/headless-triage-uok-gates.test.ts @@ -136,6 +136,17 @@ describe("runTriageApply emits gate_run trace events with schema-v2 metadata", ( expect(reviewEvents).toHaveLength(1); expect(reviewEvents[0].outcome).toBe("pass"); expect(reviewEvents[0].surface).toBe("headless"); + + // Mutation gate fires after the agree-path apply phase (codex audit + // 2026-05-14 follow-up). Since the test project has no real ledger + // entry for sf-test-1, markResolved rejects it and the gate lands + // "fail" with rejectedCount=1, not "pass". + const mutationEvents = gates.get("triage-apply-mutation-gate") ?? []; + expect(mutationEvents).toHaveLength(1); + expect(mutationEvents[0].outcome).toBe("fail"); + expect(mutationEvents[0].surface).toBe("headless"); + expect(mutationEvents[0].rejectedCount).toBe(1); + expect(mutationEvents[0].resolvedCount).toBe(0); }); test("disagree_path_emits_review_gate_as_fail", async () => { @@ -159,6 +170,11 @@ describe("runTriageApply emits gate_run trace events with schema-v2 metadata", ( expect(reviewEvents).toHaveLength(1); expect(reviewEvents[0].outcome).toBe("fail"); expect(reviewEvents[0].surface).toBe("headless"); + + // Mutation gate must NOT fire on disagree path — no mutations means + // no apply phase ran. + const mutationEvents = gates.get("triage-apply-mutation-gate") ?? []; + expect(mutationEvents).toHaveLength(0); }); test("unknown_id_in_plan_emits_validation_gate_fail_and_no_review_gate", async () => {