Files
hyperframes/skills
Michael Wang 7623f4fa12 fix(cli): a received project's job log can't lower the credit limit, and publish names the project it updates (#7970)
* fix(cli): the credit limit counts no logged row below zero and resumes only keys this account sent

A job log row whose credits are negative or not finite now holds nothing,
so no row can lower the total spent against the limit. A logged job key
skips the limit check only when this account sent it before, as noted in
a per-account record in the config folder. A logged key it never sent is
priced as a new call, without the credits the log gives that key. Applied
to both copies of credit-limit.mjs.

* fix(cli): publish's prompt names the existing project it updates and says its visibility is kept

When the publish targets an existing project (an --update id, the folder's
.hyperframes/project.json, or this machine's earlier publish of the
folder), the confirmation now names that project and says it keeps its
current visibility, which may be public, instead of promising a private
upload. The id is shown as printable text only.

* docs(cli): credit-limit says a logged row never counts below zero

The earlier commit said no row can lower the total. That is not so: a
later row for the same key with credits 0 sets that key to zero, which is
how a refused call gives back its reservation and how a charge below the
estimate replaces it. What holds is that no row counts below zero.

* fix(cli): sent job keys are noted per account and project folder, privately and capped

A logged key now resumes unchecked only when this account sent it for the
same project folder, so a key sent for one project cannot skip the limit
in another. The record keeps its newest 10,000 keys, and the config
folder and key files are created readable by their owner only.

* fix(cli): publish's prompt names the existing project in every variant

Every prompt variant, --public included, now names the existing project a
publish would update. It says the update happens only when the person is
signed in and can access that project, and that otherwise a new project
is created, which is what a signed-out publish does.

* fix(cli): the credit limit reads this account's spending from its own ledger

Each account now keeps, in its config folder, a ledger of what its jobs in
each project folder hold: every charge, reservation and refund the CLI
logs is noted there too. The limit check counts this account's keys at
the ledger's value and ignores the project log's rows for them, so a row
a sync or a pull adds cannot lower them. Any other key in the project log
counts at the most it has been seen to hold, never less, and never lets a
call skip the check. This replaces the sent-key record; the ledger keeps
its newest 10,000 lines and is readable by its owner only.

* fix(cli): publish reads the sign-in before asking, so its prompt says what will happen

The credential is now read, and --update or --space without a login is
refused, before the confirmation prompt. The prompt names an existing
target project only for a login, which is the only case that updates it
in place; signed out or on an API key, the prompt describes the new
private upload that actually happens.

* fix(cli): creditsSpent skips a malformed or null job log line

One junk line in .hyperframes/heygen-jobs.jsonl no longer blocks every
priced call in the project; the reader skips it, as the account ledger
reader does. Applied to both copies of credit-limit.mjs.

* fix(cli): the credit limit refuses a paid call when it can't tell which account is signed in

Under a credit limit, a call whose signed-in account can't be named is
refused before anything is sent, since this account's ledger can't be
read or written then. With no limit set, nothing changes.

The ledger is trimmed through a temp file and a rename, and the project
being checked keeps its last line for every key it holds. A refusal that
counts credits from job log rows no longer in the project says so and
names the ledger file. The ledger scope notes that a moved or renamed
folder starts a new ledger. The private-mode check in the ledger test is
skipped on Windows, which has no POSIX modes.
2026-11-16 23:33:53 +00:00
..