Pin merge SHA, lock conflict repair, bound subprocess/proxy output, fail-fast incomplete R2/webhook config, redact validation/stderr secrets, and document that webhook 202 is best-effort after ACK. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
import assert from "node:assert/strict";
import test from "node:test";
import {
formatValidationLogOutput,
formatValidationResult
} from "../src/review/conflictResolver.js";
test("validation log output keeps the useful tail within bounds", () => {
const longOutput = "x".repeat(30_000) + "\nfinal error line";
const formatted = formatValidationLogOutput(longOutput);
assert.ok(formatted.length <= 12_100, `length ${formatted.length}`);
assert.match(formatted, /truncated \d+ leading characters/);
assert.match(formatted, /final error line/);
});
test("validation log output strips ANSI escapes and normalizes newlines", () => {
const formatted = formatValidationLogOutput("error\r\nline2");
assert.equal(formatted, "error\nline2");
});
test("validation result redacts credentials before prompt or log exposure", () => {
const formatted = formatValidationResult("npm test", {
code: 1,
stdout: "",
stderr: "fatal: https://user:ghp_ABCDEFGHIJKLMNOPQRSTUVWXYZ123456@github.com/x"
});
assert.equal(formatted.includes("ghp_"), false);
assert.match(formatted, /REDACTED|Exit code: 1/);
});
import test from "node:test";
import {
formatValidationLogOutput,
formatValidationResult
} from "../src/review/conflictResolver.js";
test("validation log output keeps the useful tail within bounds", () => {
const longOutput = "x".repeat(30_000) + "\nfinal error line";
const formatted = formatValidationLogOutput(longOutput);
assert.ok(formatted.length <= 12_100, `length ${formatted.length}`);
assert.match(formatted, /truncated \d+ leading characters/);
assert.match(formatted, /final error line/);
});
test("validation log output strips ANSI escapes and normalizes newlines", () => {
const formatted = formatValidationLogOutput("error\r\nline2");
assert.equal(formatted, "error\nline2");
});
test("validation result redacts credentials before prompt or log exposure", () => {
const formatted = formatValidationResult("npm test", {
code: 1,
stdout: "",
stderr: "fatal: https://user:ghp_ABCDEFGHIJKLMNOPQRSTUVWXYZ123456@github.com/x"
});
assert.equal(formatted.includes("ghp_"), false);
assert.match(formatted, /REDACTED|Exit code: 1/);
});