test: pin compaction safeguard diagnostics

This commit is contained in:
Shakker
2026-05-12 02:47:57 +01:00
parent 97d9efee37
commit 2bf827ae35

View File

@@ -871,8 +871,12 @@ describe("compaction-safeguard recent-turn preservation", () => {
const identifiers = extractOpaqueIdentifiers(
"Track id a1b2c3d4e5f6 plus A1B2C3D4E5F6 and URL https://example.com/a and /tmp/x.log plus port host.local:18789",
);
expect(identifiers.length).toBeGreaterThan(0);
expect(identifiers).toContain("A1B2C3D4E5F6"); // pragma: allowlist secret
expect(identifiers).toStrictEqual([
"A1B2C3D4E5F6", // pragma: allowlist secret
"https://example.com/a",
"/tmp/x.log",
"host.local:18789",
]);
const summary = [
"## Decisions",
@@ -940,7 +944,15 @@ describe("compaction-safeguard recent-turn preservation", () => {
latestAsk: "Need a status update",
});
expect(quality.ok).toBe(false);
expect(quality.reasons.length).toBeGreaterThan(0);
expect(quality.reasons).toStrictEqual([
"missing_section:## Decisions",
"missing_section:## Open TODOs",
"missing_section:## Constraints/Rules",
"missing_section:## Pending user asks",
"missing_section:## Exact identifiers",
"missing_identifiers:abc12345",
"latest_user_ask_not_reflected",
]);
});
it("requires exact section headings instead of substring matches", () => {