mirror of
https://github.com/garrytan/gstack.git
synced 2026-06-17 23:30:09 +02:00
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) <noreply@anthropic.com>
This commit is contained in:
@@ -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", () => {
|
||||
|
||||
Reference in New Issue
Block a user