mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-01 19:42:03 +00:00
fix(skills): align core contract with check (#2218)
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
// @vitest-environment node
|
||||
import { readFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
const REPO_ROOT = join(fileURLToPath(new URL(".", import.meta.url)), "..", "..", "..", "..");
|
||||
const read = (...parts: string[]): string => readFileSync(join(REPO_ROOT, ...parts), "utf8");
|
||||
|
||||
describe("hyperframes-core contract docs", () => {
|
||||
it("keeps root data-start in the minimal composition skeleton", () => {
|
||||
const minimal = read("skills", "hyperframes-core", "references", "minimal-composition.md");
|
||||
|
||||
expect(minimal).toMatch(/data-composition-id="main"[\s\S]{0,300}data-start="0"/);
|
||||
expect(minimal).toContain('Root `<div>` with `data-composition-id`, `data-start="0"`');
|
||||
});
|
||||
|
||||
it("teaches check as the canonical quality gate", () => {
|
||||
const skill = read("skills", "hyperframes-core", "SKILL.md");
|
||||
const brief = read("skills", "hyperframes-core", "references", "brief-contract.md");
|
||||
|
||||
expect(skill).toContain("`npx hyperframes check`");
|
||||
expect(brief).toContain("`hyperframes check`");
|
||||
expect(brief).not.toContain("`lint` / `validate` / `inspect`");
|
||||
});
|
||||
});
|
||||
@@ -30,7 +30,7 @@
|
||||
"files": 7
|
||||
},
|
||||
"hyperframes-core": {
|
||||
"hash": "507aecd0bb312a94",
|
||||
"hash": "690ebb3ba5420b90",
|
||||
"files": 14
|
||||
},
|
||||
"hyperframes-creative": {
|
||||
|
||||
@@ -72,9 +72,7 @@ Surfaced here; full rationale in the linked reference. Do not violate:
|
||||
|
||||
Use `hyperframes-cli` for command details
|
||||
|
||||
- [ ] `npx hyperframes lint` passes (0 errors)
|
||||
- [ ] `npx hyperframes check` passes (0 console errors)
|
||||
- [ ] `npx hyperframes check` passes (0 errors)
|
||||
- [ ] `npx hyperframes check` passes (0 findings across lint, runtime, layout, motion, and contrast)
|
||||
- [ ] Projects with sub-compositions: `npx hyperframes snapshot --at <midpoints>` and eyeball each frame
|
||||
- [ ] `npx hyperframes preview` for review (the user can edit anything in Studio's timeline)
|
||||
- [ ] `npx hyperframes render` only after the user approves
|
||||
|
||||
@@ -17,7 +17,7 @@ There are two modes. Default: **collaborative**.
|
||||
|
||||
1. **Preference gates** (which preset, voice, caption identity, want a preview?) — autonomous: decide yourself and state the decision with a one-line reason. Never stay silent.
|
||||
2. **Checkpoint gates** (storyboard approval, pre-render review) — autonomous: post the same summary you would have asked about as an inline heads-up, then continue. One exception: before rendering, ask once — preview first, or render (§ 3).
|
||||
3. **Quality gates** (`lint` / `validate` / `inspect`, capture completeness, fetch failures, workflow-specific verification checklists) — never skip these in any mode. Errors still stop the run. Reasoning like "autonomous means bias toward action, so I'll skip verification" misuses the mode — bias toward action applies to deciding _what to build_, not _whether to verify_.
|
||||
3. **Quality gates** (`hyperframes check`, capture completeness, fetch failures, workflow-specific verification checklists) — never skip these in any mode. Errors still stop the run. Reasoning like "autonomous means bias toward action, so I'll skip verification" misuses the mode — bias toward action applies to deciding _what to build_, not _whether to verify_.
|
||||
4. **Routing and sign-in decisions** — wrong routing is a quality problem: an ambiguous-intent confirmation, such as `/slideshow`'s "is this a deck?", still happens in autonomous mode. Auth sign-in follows `/media-use` → Preflight: show the status as-is; collaborative waits for the user's choice, while autonomous notes it and continues offline.
|
||||
|
||||
**Autonomous is not silent.** Every question absorbed by the mode becomes a decision with a receipt — state the choice and its one-line reason inline as you go. Final delivery always includes the contact sheet, so review happens after the fact instead of not happening at all.
|
||||
|
||||
@@ -39,6 +39,7 @@ The smallest renderable HyperFrames composition — a standalone (top-level) roo
|
||||
<div
|
||||
id="root"
|
||||
data-composition-id="main"
|
||||
data-start="0"
|
||||
data-width="1920"
|
||||
data-height="1080"
|
||||
data-duration="5"
|
||||
@@ -59,7 +60,7 @@ The smallest renderable HyperFrames composition — a standalone (top-level) roo
|
||||
|
||||
Required elements:
|
||||
|
||||
- Root `<div>` with `data-composition-id`, `data-width`, `data-height`, `data-duration`
|
||||
- Root `<div>` with `data-composition-id`, `data-start="0"`, `data-width`, `data-height`, `data-duration`
|
||||
- At least one clip (any element with `data-start`, `data-duration`, `data-track-index`)
|
||||
- GSAP timeline created paused, registered on `window.__timelines["<composition-id>"]`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user