diff --git a/scripts/check-core-skills.test.mjs b/scripts/check-core-skills.test.mjs index 45b7aaba9d..a1859efec5 100644 --- a/scripts/check-core-skills.test.mjs +++ b/scripts/check-core-skills.test.mjs @@ -48,12 +48,45 @@ test("reverse builds the project with init --video and asks for the run's total ); assert.match( start, - /add up what each refused step\s+needs, and run `npx hyperframes billing (?:top-up|add-credits) --needed (?: --skill reverse-any-video)?` once for that total/, + /add up what each refused step\s+needs, and give them `npx hyperframes billing (?:top-up|add-credits) --needed (?: --skill reverse-any-video)?` to run once for that total/, ); assert.doesNotMatch(read("SKILL.md"), /copy the video into the project/); assert.match(read("SKILL.md"), /`init --video` put the video in/); }); +test("reverse hands every purchase to the person instead of running billing itself", () => { + const read = (path) => + readFileSync(new URL(`../skills/reverse-any-video/${path}`, import.meta.url), "utf8"); + const start = read("references/start.md"); + const section = (heading) => start.split(`## ${heading}`)[1].split("\n## ")[0]; + assert.match( + read("SKILL.md"), + /give the person its upgrade link and `fix` to run themselves \(you never run `billing`\)/, + ); + assert.match(start, /You run every command except `billing`, which\s+is theirs/); + assert.doesNotMatch(start, /you run every command,/); + const outOfCredits = section("Out of credits mid-run"); + assert.match( + outOfCredits, + /If any refusal prints no amount, the total is unknown:\s+give plain `billing add-credits` once instead, for the whole run/, + ); + assert.doesNotMatch( + outOfCredits, + /for that one|for each (?:refused )?step|one per (?:refused )?step(?!\.)/, + ); + for (const heading of ["Signed in on Free", "Out of credits mid-run"]) { + const text = section(heading); + assert.match(text, /never run a `billing` command yourself/, heading); + assert.match(text, /for them to run|to run once for that total/, heading); + const rest = text.replace("never run a `billing` command yourself", ""); + assert.doesNotMatch( + rest, + /\b(?:run|execute|launch)\b[^.\n]{0,60}(?:`(?:npx hyperframes )?billing|`reverse\.subscribe_command`)/i, + heading, + ); + } +}); + test("flags a skill that never reports its own run", () => { assert.deepEqual( beaconProblems("slideshow", "Run `npx hyperframes events --skill=slideshow` first."), diff --git a/skills-manifest.json b/skills-manifest.json index 90499b61c5..3a0e039cc6 100644 --- a/skills-manifest.json +++ b/skills-manifest.json @@ -26,7 +26,7 @@ "files": 76 }, "reverse-any-video": { - "hash": "e4c3ac45f5deb337", + "hash": "f94599be483b10df", "files": 5 }, "slideshow": { diff --git a/skills/reverse-any-video/SKILL.md b/skills/reverse-any-video/SKILL.md index f01c3e76c8..6541cf9fd5 100644 --- a/skills/reverse-any-video/SKILL.md +++ b/skills/reverse-any-video/SKILL.md @@ -11,7 +11,7 @@ description: Rebuild any video file as an editable HyperFrames project - motion The result is a HyperFrames project whose render matches the original frame for frame and stays editable. Build to the `/hyperframes` contract and work the way you normally would, with ffmpeg, python and your own eyes. Reverse videos the person has the right to use. -Reverse is a HyperFrames Pro feature. Open with `npx hyperframes reverse start