mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-13 15:49:53 +00:00
test(pr-to-video): pin the code-vocabulary section of the frame packet (#2900)
Adds three test cases pinning the code-vocabulary section that frame-packets.mjs appends to code frames. Deleting codeVocabularySection outright left all 455 skills tests green before this change; the only assertion touching it was a doesNotMatch that passes trivially when the section is empty.
This commit is contained in:
@@ -58,7 +58,7 @@
|
|||||||
"files": 132
|
"files": 132
|
||||||
},
|
},
|
||||||
"pr-to-video": {
|
"pr-to-video": {
|
||||||
"hash": "922c2714750d5a54",
|
"hash": "41171bbed1c5d8f4",
|
||||||
"files": 30
|
"files": 30
|
||||||
},
|
},
|
||||||
"product-launch-video": {
|
"product-launch-video": {
|
||||||
|
|||||||
@@ -141,6 +141,54 @@ test("code frames without an upstream-selected excerpt fail before dispatch", ()
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// The other half of this skill's frame-packets delta. The excerpt guard above is
|
||||||
|
// pinned; the code-vocabulary injection was not — deleting `codeVocabularySection`
|
||||||
|
// outright left all 455 skills tests green, so the section a code worker reads to
|
||||||
|
// pick its registry block could have been dropped silently.
|
||||||
|
test("a code frame carries the vocabulary excerpt for the block it names", () => {
|
||||||
|
const project = mkdtempSync(join(tmpdir(), "p2v-packets-vocab-"));
|
||||||
|
write(join(project, "frame.md"), "# frame\n");
|
||||||
|
write(
|
||||||
|
join(project, "STORYBOARD.md"),
|
||||||
|
`---\nformat: 1920x1080\n---\n\n## Frame 1 — Diff\n\n- duration: 4s\n- src: compositions/frames/01-diff.html\n- focal: code-diff\n\n### Source excerpt\n\n\`\`\`diff\n-oldCall()\n+newCall()\n\`\`\`\n`,
|
||||||
|
);
|
||||||
|
|
||||||
|
const [packet] = buildFramePackets({ projectDir: project });
|
||||||
|
const contents = readFileSync(packet.path, "utf8");
|
||||||
|
|
||||||
|
assert.match(contents, /## Code block excerpt \(code-diff\)/);
|
||||||
|
assert.match(contents, /`code-diff`/);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("a code block the vocabulary does not describe still names itself for install", () => {
|
||||||
|
const project = mkdtempSync(join(tmpdir(), "p2v-packets-vocab-miss-"));
|
||||||
|
write(join(project, "frame.md"), "# frame\n");
|
||||||
|
write(
|
||||||
|
join(project, "STORYBOARD.md"),
|
||||||
|
`---\nformat: 1920x1080\n---\n\n## Frame 1 — Diff\n\n- duration: 4s\n- src: compositions/frames/01-diff.html\n- focal: code-not-in-the-vocabulary\n\n### Source excerpt\n\n\`\`\`diff\n-oldCall()\n+newCall()\n\`\`\`\n`,
|
||||||
|
);
|
||||||
|
|
||||||
|
const [packet] = buildFramePackets({ projectDir: project });
|
||||||
|
|
||||||
|
assert.match(
|
||||||
|
readFileSync(packet.path, "utf8"),
|
||||||
|
/## Code block\n\nUse registry block `code-not-in-the-vocabulary`\./,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("a mechanism frame gets no code-block section at all", () => {
|
||||||
|
const project = mkdtempSync(join(tmpdir(), "p2v-packets-mechanism-"));
|
||||||
|
write(join(project, "frame.md"), "# frame\n");
|
||||||
|
write(
|
||||||
|
join(project, "STORYBOARD.md"),
|
||||||
|
`---\nformat: 1920x1080\n---\n\n## Frame 1 — Mechanism\n\n- duration: 4s\n- src: compositions/frames/01-mechanism.html\n- focal: the request-lifecycle flow\n`,
|
||||||
|
);
|
||||||
|
|
||||||
|
const [packet] = buildFramePackets({ projectDir: project });
|
||||||
|
|
||||||
|
assert.doesNotMatch(readFileSync(packet.path, "utf8"), /## Code block/);
|
||||||
|
});
|
||||||
|
|
||||||
test("CLI capability detection rejects skills newer than the available command surface", () => {
|
test("CLI capability detection rejects skills newer than the available command surface", () => {
|
||||||
const stableHelp = `Project:\n lint Validate a composition\n snapshot Capture frames\n\nUnknown command check`;
|
const stableHelp = `Project:\n lint Validate a composition\n snapshot Capture frames\n\nUnknown command check`;
|
||||||
const currentHelp = `Project:\n lint Validate a composition\n check Run the full project validation gate\n snapshot Capture frames`;
|
const currentHelp = `Project:\n lint Validate a composition\n check Run the full project validation gate\n snapshot Capture frames`;
|
||||||
|
|||||||
Reference in New Issue
Block a user