From c91154655f1beadad2aaa7033cd61e34ce4dba01 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Sat, 30 May 2026 11:40:58 -0700 Subject: [PATCH] test(ship): union-read redaction wiring test for the carve (T9) main's PR-body redaction-at-sink lives in sections/pr-body.md.tmpl after the carve, not the skeleton template. Read skeleton + section templates union so the redaction-wiring assertions follow the relocated content. 9/9 green. Co-Authored-By: Claude Opus 4.8 (1M context) --- test/ship-template-redaction.test.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/test/ship-template-redaction.test.ts b/test/ship-template-redaction.test.ts index 45a681701..030d26c1e 100644 --- a/test/ship-template-redaction.test.ts +++ b/test/ship-template-redaction.test.ts @@ -9,7 +9,20 @@ import * as path from "path"; import { scan } from "../lib/redact-engine"; const ROOT = path.resolve(import.meta.dir, ".."); -const TMPL = fs.readFileSync(path.join(ROOT, "ship", "SKILL.md.tmpl"), "utf-8"); +// Carved (v2 plan T9): ship is a skeleton template + sections/*.md.tmpl. The +// PR-body redaction wiring moved into sections/pr-body.md.tmpl, so assert against +// the union of the skeleton template and its section templates. +function readShipTemplateUnion(): string { + let t = fs.readFileSync(path.join(ROOT, "ship", "SKILL.md.tmpl"), "utf-8"); + const secDir = path.join(ROOT, "ship", "sections"); + if (fs.existsSync(secDir)) { + for (const f of fs.readdirSync(secDir).sort()) { + if (f.endsWith(".md.tmpl")) t += "\n" + fs.readFileSync(path.join(secDir, f), "utf-8"); + } + } + return t; +} +const TMPL = readShipTemplateUnion(); describe("/ship redaction wiring", () => { test("scans the PR body via the shared bin before create", () => {