Skip to content

feat(skills): re-land reverse any video on the HyperFrames plan, with clearer credit wording - #6833

Merged
miguel-heygen merged 12 commits into
mainfrom
miao/reverse-wording
Oct 31, 2026
Merged

miguel-heygen merged 12 commits into
mainfrom
miao/reverse-wording

Conversation

@WaterrrForever

@WaterrrForever WaterrrForever commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

What

This re-lands #6754 (reverse any video on the HyperFrames plan, reverted in #6840 until the web plan pages were live) together with its follow-up fixes:

Why

  • feat(skills): reverse any video on the HyperFrames plan #6754 was reverted because billing subscribe opened /pricing and billing top-up opened /account/plan, and both answered 404. /pricing and /plan now exist on the web app, so the CLI's two links lead somewhere: /pricing?from=cli sells Pro and then says to go back to the terminal, and /plan shows the plan and its credits.
  • J4: the agent said "about 522 more credits than your account has". 522 is what the step needs in total, not the shortfall.
  • J5: after its two tries, the agent said how many credits were spent and what the next try would cost. Money should come up only when a step doesn't fit.
  • Avatar: the estimate used the old API price, about 5× what the plan charges. A 15 s script planned at 1,217 credits, so --max-credits 500 refused a call that fits and billing top-up --needed asked for too much.

How

  • main is merged in. The merge keeps feat(skills): reverse any video on the HyperFrames plan #6754's files where the revert deleted them, so the branch is main plus feat(skills): reverse any video on the HyperFrames plan #6754 plus the fixes below; no other file differs from main.
  • The out-of-credits refusal now says this step needs about N in total.
  • media-use/references/heygen.md tells the agent to stop and ask after its last try without saying what was spent or what another try costs.
  • Avatar credits are 800 a minute, the Avatar IV photo row, so that 15 s script now plans at 200. The general avatar row bills only seconds left over after Avatar IV, such as padding, which the estimate leaves out: a 17 s draft costs about 205. The USD estimate is unchanged.
  • pageUrl("credits") defaults to <web>/plan; HYPERFRAMES_CREDITS_URL still overrides it. The test pins the production and dev links.

Doc comments kept to four lines

Re-landing #6754 makes its files new code against main, so the comment limit (four lines, 120 characters) now applies to them. The comments in measure/diff.ts, drawn.ts, events.ts, face.ts, media.ts and person.ts were tightened; the constant groups in diff.ts now carry their notes beside the constants they describe. What moved here:

  • Calibration (reverse bench, 10-23): drawn elements score 0.82–0.94 for correct titles and captions, 0.40–0.66 for wrong ones. Framing: goat round 3's 8.0–10.0 s shot is 0.23 off and ×0.82; dan round 2 at most 0.16 and ×0.93–1.10; cindy round 3 0.02; dan round 3 misses its 35 s close-up at ×0.77 (and is 0.21–0.23 off at 3.6 s and 30 s, which face boxes cannot tell from goat). Carried text (ig03 round 2): t12's "Transparency", "a deep understanding", "of this market" score 0.30, 0.45, 0.56; every clean box 0.24 or less.
  • Missing content: thresholds are provisional, calibrated on the reverse bench.
  • drawn.ts: wrong tracking, slant, or a doubled letter also leave ink unmatched.
  • placeClips: a clip's own start is where HeyGen's shot begins; with no ledger window, it comes from lining the clip's sound (the original's voice it was made from) up with the original's.
  • carriedText: the clip is judged alone, against the original over the same window.
  • shotFraming: boxes are shares of a frame aspect wide per unit high; a stray detection can be a photo or a hand.
  • faceFit: the clip element fills the canvas with object-fit: cover; t counts from each side's window start.

Test plan

fails without the fix: with packages/cli/src/heygen/plan.ts, pricing.ts and v3.ts restored to #6754's versions, src/heygen fails 3 of 37, one per fix: "links the web app for HYPERFRAMES_ENV and tells the page the buyer came from the CLI" (plan.test.ts, the credits link), "names what an out-of-credits step needs, from the call's own price when HeyGen does not say" (v3.test.ts, the "in total" wording) and "prices an avatar on the plan's avatar rows, not its API price" (generate.test.ts, the avatar estimate). At this head all 37 pass.

  • Unit tests: src/heygen and src/measure pass (99), with an avatar price pin and both credits links pinned.
  • check-core-skills passes.
  • J4 and J5 rerun against the dev plan at this head.
  • The CLI journeys at this head on dev with Stripe test mode: a Free account stops at the plan gate, buys Pro on /pricing?from=cli and reruns; a Pro account out of credits gets the top-up link to /plan.

Merges only once https://hyperframes.studio/pricing answers on production.

@WaterrrForever WaterrrForever changed the title fix(cli,skills): say a step's credits are its total, and keep cost out of retries fix(cli,skills): plan avatar credits from the price rows, and clearer credit wording Oct 30, 2026
Base automatically changed from miao/reverse-skill to main October 30, 2026 13:42
@mintlify

mintlify Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
hyperframes 🟢 Ready View Preview Oct 30, 2026, 4:43 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

…t of retries

An out-of-credits refusal named what the step needs, and an agent read
that as the shortfall. It now says the number is the step's total.

After its last try, an agent told the person what was spent and what
another try would cost. The HeyGen reference now says not to.
An avatar's credits came from its old API price, about five times what
the plan charges, so --max-credits refused calls that fit and a top-up
asked for too much. They now use the Avatar IV photo row plus the
general avatar video row, 950 credits a minute.

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at bc2b6618f37f288468fc8ace5673d48c4e71d853 (rebased onto main; all three commits are patch-identical to cc5460d88 by git range-diff).

Need: yes · Size: ok · Reuse: EF's HF price rows and scene bucketing · Simpler: price IV seconds without the general admission row · Structure: fine
Risk: medium — this estimate controls credit-limit refusal and top-up guidance.

The refusal now explicitly names the step's total (v3.ts:100), and the retry instruction avoids reporting spend or the next attempt's cost (heygen.md:19).

Pre-existing, partially fixed — the general row does not bill every Avatar IV second (packages/cli/src/heygen/pricing.ts:89). On EF master ebdc4a6db82a, admission checks one second of both rows, but settlement subtracts raw IV duration from the general bucket:

950/min is too high for all-IV speech. An extracted-production-bucketing witness with 15 IV seconds in a 15-second draft gives 0 general seconds and 200 credits; adding 2 seconds of non-IV padding gives 205, not 238. The actual CLI priceOf still gives 238 for 30 words and checkLimit(..., 220) refuses, although that conditional 200-credit all-IV case fits. This is a rate/bucketing counterexample, not a live claim that every 30-word script lasts exactly 15 seconds. This does not mean the backend charges 950/min.

Concrete fix: use seconds * HF_AVATAR_IV_PHOTO_PER_S for the IV portion, remove the unconditional general-per-second addition, and update the avatar test to pin 200 plus acceptance at a 220-credit cap. If estimating known padding, add only its residual seconds at 150/min. That aligns the audited standard photo-IV rate; the USD estimate can stay unchanged.

Nit: add a positive concept pin for the new last-retry/no-spend instruction; the existing core-skill checks do not assert that sentence's concept.

No existing reviews or inline findings were present on #6833 at intake or the fresh pre-post read; this verifies the avatar-estimate follow-up Genesis raised on #6754. The old 4,830/min estimate already overestimated more severely, so this is a continuing issue improved by the PR, not a new backend charge or a new blocking review.

Evidence: bun run --cwd packages/cli test --config review.vitest.config.ts --no-cache over generate.test.ts + v3.test.ts: 33 passed, using borrowed dependencies and a scratch config aliasing only FFmpeg discovery to system binaries (the stock config first failed collection on an unavailable @hyperframes/parsers/slideshow export). node --test scripts/check-core-skills.test.mjs: 6 passed; skills manifest --check: in sync. Independent adversarial review and root replay agree on the bucket result. Root witness commands/artifacts: python3 review-artifacts/6833/bucket-probe.py and bun review-artifacts/6833/price-probe.ts in the reviewer workspace. EF witness executes extracted production bucketing/residual code with lightweight scene DTOs; no live generation, wallet debit, or J4/J5 agent replay was performed.

Verdict: COMMENT
Reasoning: The wording changes read correctly and the estimate is substantially improved, but the requested EF-source check disproves the additive 950/min assumption. Posting the concrete remaining correction as requested rather than issuing a blocking review on the continuing overestimate.

— hf-review

Comment thread packages/cli/src/heygen/pricing.ts Outdated
return at(
Math.ceil(seconds * AVATAR_IV_PER_MIN) / 60,
`avatar video, about ${seconds} s from ${words} words at $4.83 a minute`,
seconds * (HF_AVATAR_IV_PHOTO_PER_S + HF_AVATAR_GENERAL_PER_S),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pre-existing overestimate, partially fixed: the 150/min general row is admission plus residual non-IV/padding work, not an additional charge on every photo-IV second. EF master subtracts IV seconds from general duration (movio/common/service/video.py:1635–1637). Standard all-IV 15s is 200 credits, while this estimate is 238 and refuses cap220. Use only the IV rate here; price known padding separately. Update the test to 200 and assert cap220 accepts. The old estimate was worse; this is advisory correction of the remaining discrepancy.

Suggested change
seconds * (HF_AVATAR_IV_PHOTO_PER_S + HF_AVATAR_GENERAL_PER_S),
seconds * HF_AVATAR_IV_PHOTO_PER_S,

The general avatar row is only checked at admission and billed on
seconds left after Avatar IV, so adding it to every second made a 15 s
script plan at 238 instead of 200 and a 220 limit refuse a call that fits.

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at 07815fc196658ee0de1343674989ba5c9b9f1b87, delta from my COMMENT review 5713199757 at bc2b6618f.

Need: yes · Size: ok · Reuse: EF's Avatar IV and residual general billing rows · Simpler: use the IV rate for estimated IV seconds · Structure: fine
Risk: medium — the local estimate influences credit-limit decisions.

The prior rate finding is fixed: the avatar estimate now uses only 800 credits/minute; the authored test pins 200 for 30 words at the assumed 15 seconds and accepts a 220 limit. This is a duration assumption, not a live timing measurement.

Pre-existing broader follow-up — --max-credits is an estimate guard, not an enforced spending maximum. The CLI checks checkLimit locally (commands/media-use/generate.ts:153). It passes the estimate, not the cap, to generate; the avatar POST body (heygen/generate.ts:156–173) has no spending limit. v3.call sends that body and auth/idempotency headers; the estimate is used for refusal wording only. EF's avatar admission checks one second of each billing row because synthesized speech duration is not known yet (movio/api_service/app/service/avatar_video_hf_charge.py:30–44, master source re-read). Wallet availability enforcement is separate from the person's CLI limit.

Consequently, cap 200 accepts estimate 200 even if the eventual draft has 15 IV seconds plus 2 residual seconds and settles at 205. The PR body accurately discloses this. That is acceptable for this rate correction as an approximate estimate, not as proof that a 200-credit spending limit is respected. Lowering the estimate does newly admit cap-200 requests that the previous 238 estimate rejected. I accept that changed admission behavior for this rate correction because 238 was not a justified upper bound either: speech duration was already estimated from words and there was already no server cap. Known residual padding should be included when available to improve accuracy; even that would not guarantee a maximum while speech duration is unknown. The broader fix should label avatar budgeting as approximate in the CLI help and skill (which currently say “make nothing” above the limit / “never go past it”), or refuse strictly capped avatar generation until a server quote/reservation or enforced budget is available. This needs coordinated budgeting design rather than restoring the incorrect additive rate.

Evidence: the two focused authored avatar-pricing and cap tests pass using borrowed dependencies and a scratch config aliasing FFmpeg discovery only. A broader run yielded 32 passed / 1 environment failure: the unchanged motion-mask test reaches an unavailable @hyperframes/engine/wsl-host export in borrowed dependencies. Independent adversarial source review confirms the cap transport and calibration above. No live generation, settlement, J4/J5 agent replay or backend cap guarantee is claimed. The earlier wording fixes are unchanged.

Verdict: APPROVE
Reasoning: The requested rate/test correction is implemented. The remaining inability to guarantee a strict maximum is a pre-existing estimation/transport limitation, explicitly recorded here as a follow-up rather than a blocker on correcting the rate.

— hf-review

@jrusso1020
jrusso1020 enabled auto-merge October 30, 2026 13:57
@jrusso1020
jrusso1020 disabled auto-merge October 30, 2026 14:04
meefs pushed a commit to meefs/hyperframes that referenced this pull request Oct 30, 2026
…#6840)

* revert: feat(skills): reverse any video (heygen-com#6754)

Keep the reverse-any-video skill and its CLI billing commands out of main until
web subscriptions are live (/pricing and /account/plan return 404 today).
Re-land together with heygen-com#6833 once those pages ship.

This reverts commit cb2389c.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* chore(scripts): allow the heygen-com#6754 revert deletions

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@miguel-heygen miguel-heygen changed the title fix(cli,skills): plan avatar credits from the price rows, and clearer credit wording feat(skills): re-land reverse any video on the HyperFrames plan, with clearer credit wording Oct 30, 2026
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 271 (base branch 271), smooth 101 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (0)

Unstable (1)

  • seqplainkeys-none-center-r0-root-z100: tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST CHANGES · 1 blocker · 0 important · 0 nits · head 75c1ce0d

  • blocker: the body has no fails without the fix: line, and this PR carries three fixes (the credits link, the "in total" wording, the avatar estimate). The tests already exist. With plan.ts/pricing.ts/v3.ts restored to #6754's versions, these three fail and pass here: "links the web app for HYPERFRAMES_ENV and tells the page the buyer came from the CLI" (plan.test.ts), "names what an out-of-credits step needs, from the call's own price when HeyGen does not say" (v3.test.ts), "prices an avatar on the plan's avatar rows, not its API price" (generate.test.ts). Naming them on that line clears this.
  • Merge hold: https://hyperframes.studio/pricing (and ?from=cli) answers 404 on production right now; /plan answers 200. That 404 is why #6840 reverted this, so I'll approve only once /pricing answers on production, even with the body fixed. An approval clears the gate and the merge loop would merge it.
Scope

I checked the "main + #6754 + fixes" claim: applying the reverse of #6840 to the merge-base gives the same 95 files, and only 14 differ from this head. Six of those are comment-only measure trims and one is the manifest regen; I read the rest (plan.ts, pricing.ts, v3.ts, heygen.md, tests). I trusted the #6754 body (already reviewed and merged). @jrusso1020's avatar-row finding is resolved at 07815fc and unchanged since. src/heygen passes: 37 tests.

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: COMMENT (merge hold) — 1 resolved, 0 open, 0 new · 75c1ce0 (body only). No blockers remain, but hyperframes.studio/pricing still answers 404 on production, so I am holding the approval: on this PR an approval triggers the merge loop. I will approve when /pricing answers on production and CI passes.

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE — 1 resolved, 0 open, 0 new · 75c1ce0. Merge hold lifted: hyperframes.studio/pricing (with and without ?from=cli) and /plan answer 200 on production; CI green at this head.

@miguel-heygen
miguel-heygen added this pull request to the merge queue Oct 31, 2026
Merged via the queue into main with commit f235831 Oct 31, 2026
136 of 137 checks passed
@miguel-heygen
miguel-heygen deleted the miao/reverse-wording branch October 31, 2026 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants