mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-12 07:59:02 +02:00
* fix: default cross-model workflows to frontier models * chore: bump version and changelog (v1.82.1.0) Co-Authored-By: OpenAI Codex <noreply@openai.com> * fix: repair frontier eval budgets and workflow instructions Preserve frontier models and quality thresholds while fixing truncated judge output, ordered section expansion, consent checks, QA scoring, and ship audit gates. Add regression coverage and refresh generated docs. Co-Authored-By: OpenAI Codex <noreply@openai.com> * fix: resolve workflow gaps exposed by frontier evals Clarify plan-review ordering and fallback modes, preserve deploy readiness gates, honor configured merge methods, correct benchmark and canary contracts, and restore vendored installs on setup failure. Cover recovery with real-shell regressions. Co-Authored-By: OpenAI Codex <noreply@openai.com> * fix: use agent capture budgets for deploy evals Multi-turn deploy and benchmark sessions were incorrectly limited to the single-call judge timeout. Use the existing capture tier and leave outer-test cleanup headroom, with a free policy regression test. Keep all behavioral assertions and frontier models unchanged. Co-Authored-By: OpenAI Codex <noreply@openai.com> * fix: clarify retro workflow and evaluate compare instructions Include compare mode in the frontier judge excerpt, define metric sources and snapshot ordering, and preserve the existing prompt-size budget. Co-authored-by: OpenAI Codex <noreply@openai.com> * fix: make documentation release review and publication consistent Review before commit, clarify changelog safeguards and unavailable reviewer modes, and preserve raw PR bodies across separate shell calls. Keep title sync in one shell and add regression coverage. Co-authored-by: OpenAI Codex <noreply@openai.com> --------- Co-authored-by: OpenAI Codex <noreply@openai.com>
72 lines
3.2 KiB
TypeScript
72 lines
3.2 KiB
TypeScript
/**
|
|
* /ship redaction wiring (T5/T11). The PR body + title are scanned at-sink before
|
|
* create AND edit; tool output goes in attributed fences so example credentials
|
|
* WARN-degrade instead of blocking; create/edit file from the scanned temp file.
|
|
*/
|
|
import { describe, test, expect } from "bun:test";
|
|
import * as fs from "fs";
|
|
import * as path from "path";
|
|
import { scan } from "../lib/redact-engine";
|
|
|
|
const ROOT = path.resolve(import.meta.dir, "..");
|
|
// 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", () => {
|
|
expect(TMPL).toContain("gstack-redact --from-file");
|
|
expect(TMPL).toMatch(/Redaction scan \(PR body \+ title\)/);
|
|
});
|
|
test("creates from the scanned temp file (exact bytes)", () => {
|
|
expect(TMPL).toMatch(/gh pr create[\s\S]{0,120}--body-file "\$PR_BODY_FILE"/);
|
|
});
|
|
test("edit path also scans before sending", () => {
|
|
expect(TMPL).toMatch(/gh pr edit --body-file "\$PR_BODY_FILE"/);
|
|
const scanAt = TMPL.indexOf('gstack-redact --from-file "$PR_BODY_FILE"');
|
|
expect(scanAt).toBeGreaterThan(0);
|
|
expect(TMPL.indexOf('gh pr edit --body-file "$PR_BODY_FILE"')).toBeGreaterThan(scanAt);
|
|
});
|
|
test("HIGH blocks the PR (exit 3), no skip", () => {
|
|
expect(TMPL).toMatch(/BLOCKED — credential in PR body/);
|
|
});
|
|
test("instructs wrapping tool output in attributed fences (TENSION-3)", () => {
|
|
expect(TMPL).toMatch(/tool-attributed fences/);
|
|
expect(TMPL).toMatch(/codex-review/);
|
|
expect(TMPL).toMatch(/greptile/);
|
|
});
|
|
test("scans the title too", () => {
|
|
expect(TMPL).toContain('printf \'%s\' "$NEW_TITLE" | ~/.claude/skills/gstack/bin/gstack-redact');
|
|
expect(TMPL).toContain('gh pr create --base <base> --title "$NEW_TITLE"');
|
|
expect(TMPL).toContain('gh pr edit --title "$NEW_TITLE"');
|
|
});
|
|
});
|
|
|
|
describe("tool-attributed fence behavior (engine contract /ship relies on)", () => {
|
|
test("a doc-example credential inside a tool fence WARN-degrades, does not block", () => {
|
|
const body = "## Codex review\n```codex-review\nflagged your_aws_key AKIAIOSFODNN7EXAMPLE\n```";
|
|
const r = scan(body, { repoVisibility: "public" });
|
|
expect(r.counts.HIGH).toBe(0);
|
|
});
|
|
test("a live-format credential inside a tool fence STILL blocks", () => {
|
|
const body = "```codex-review\nleaked AKIA1234567890ABCDEF\n```";
|
|
const r = scan(body, { repoVisibility: "public" });
|
|
expect(r.counts.HIGH).toBe(1);
|
|
});
|
|
test("a credential in plain PR prose (no fence) blocks", () => {
|
|
const body = "We hardcoded AKIA1234567890ABCDEF in the config";
|
|
expect(scan(body, { repoVisibility: "public" }).counts.HIGH).toBe(1);
|
|
});
|
|
});
|