mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-07 18:26:17 +00:00
docs(guides): resolve the Send-to fidelity contradiction (preserve substance, adapt form) (#2620)
* docs(guides): resolve the fidelity contradiction (preserve substance, adapt form) The guide called the rebuild 'lossy by nature' while the checklist demanded 'content match the brief exactly', with no rule for what to preserve vs adapt. On a live import CD kept fonts/palette/hero but genericized the source's real figures (2.4M signals/sec, +240% spike) into vague phrases. Resolve around one principle: substance (real copy, exact palette/fonts, distinctive figures/data, product names, signature visuals) is preserved verbatim; only the form (static page to timed multi-scene motion) adapts. * 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. * style(guides): oxfmt the Send-to fidelity-contract test Wrap the readFileSync call to oxfmt form (printWidth 100); unblocks required Format + its preflight/preview-regression cascade on #2620.
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
// @vitest-environment node
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
// Semantic pin for the Claude Design "Send to HyperFrames" authoring guide. The guide is
|
||||
// LLM-facing prompt text, so a wording regression silently reintroduces a real failure mode.
|
||||
// A live Send-to import genericized a source design's concrete figures ("2.4M signals/sec" ->
|
||||
// "streaming now") because the guide both called the rebuild "lossy by nature" AND demanded
|
||||
// "content match the brief exactly" — a contradiction with no rule for what to preserve. This
|
||||
// pins the resolved "preserve substance, adapt form" instruction and asserts the two retired
|
||||
// contradictory phrases cannot silently return. validate-docs proves syntax, not intent.
|
||||
const REPO_ROOT = join(fileURLToPath(new URL(".", import.meta.url)), "..", "..", "..", "..", "..");
|
||||
const GUIDE = readFileSync(
|
||||
join(REPO_ROOT, "docs", "guides", "claude-design-send-to-hyperframes.md"),
|
||||
"utf8",
|
||||
);
|
||||
|
||||
describe("Send-to guide fidelity contract", () => {
|
||||
it("carries the resolved 'preserve substance, adapt form' instruction", () => {
|
||||
expect(GUIDE).toContain("Preserve substance; adapt form");
|
||||
expect(GUIDE).toContain("do NOT genericize");
|
||||
expect(GUIDE).toContain("do NOT invent copy or numbers");
|
||||
});
|
||||
|
||||
it("does not restore the retired contradictory fidelity phrasing", () => {
|
||||
expect(GUIDE).not.toContain("lossy by nature");
|
||||
expect(GUIDE).not.toContain("content match the brief exactly");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user