Skip to content

Commit ecc2626

Browse files
committed
test(guides): pin the Send-to fidelity contract against silent regression
Address review on #2620: the resolved 'preserve substance, adapt form' instruction is load-bearing LLM-facing prompt text, but validate-docs only proves syntax. Add a semantic pin (mirroring packages/cli figma skillContent.test.ts) asserting the three positive concepts are present and the two retired contradictory phrases ('lossy by nature', 'content match the brief exactly') cannot silently return.
1 parent 03751cd commit ecc2626

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// @vitest-environment node
2+
import { describe, expect, it } from "vitest";
3+
import { readFileSync } from "node:fs";
4+
import { join } from "node:path";
5+
import { fileURLToPath } from "node:url";
6+
7+
// Semantic pin for the Claude Design "Send to HyperFrames" authoring guide. The guide is
8+
// LLM-facing prompt text, so a wording regression silently reintroduces a real failure mode.
9+
// A live Send-to import genericized a source design's concrete figures ("2.4M signals/sec" ->
10+
// "streaming now") because the guide both called the rebuild "lossy by nature" AND demanded
11+
// "content match the brief exactly" — a contradiction with no rule for what to preserve. This
12+
// pins the resolved "preserve substance, adapt form" instruction and asserts the two retired
13+
// contradictory phrases cannot silently return. validate-docs proves syntax, not intent.
14+
const REPO_ROOT = join(fileURLToPath(new URL(".", import.meta.url)), "..", "..", "..", "..", "..");
15+
const GUIDE = readFileSync(join(REPO_ROOT, "docs", "guides", "claude-design-send-to-hyperframes.md"), "utf8");
16+
17+
describe("Send-to guide fidelity contract", () => {
18+
it("carries the resolved 'preserve substance, adapt form' instruction", () => {
19+
expect(GUIDE).toContain("Preserve substance; adapt form");
20+
expect(GUIDE).toContain("do NOT genericize");
21+
expect(GUIDE).toContain("do NOT invent copy or numbers");
22+
});
23+
24+
it("does not restore the retired contradictory fidelity phrasing", () => {
25+
expect(GUIDE).not.toContain("lossy by nature");
26+
expect(GUIDE).not.toContain("content match the brief exactly");
27+
});
28+
});

0 commit comments

Comments
 (0)