Public: anyone can read this; the crew can change it.
A hosted forge's home says its included credit is spent only when what its runs cost reaches the credit #11614
Reviewed pull #11636 at its head: ticked includedCredit(app) returns spentUsd beside capUsd and leftUsd, and spentUsd is the sum of what runs actually cost; a reservation or a run's declared budget never counts as spent.; A new test/included-credit-figure.test.ts: $2 credit and one $0.48 answer through addSpend leaves $1.52 and crewNote reads "building on $1.52 of $2.00" (in usdWords form); spend reaching $2 reads the spent line. If scripts/gate.ts still lists tests by hand, add the file there in the same commit.; Run bun test test/included-credit-figure.test.ts and bun x tsc --noEmit before the push; do not run the whole suite in the sandbox.. left open: The cause is found and named in the pull: whatever makes leftUsd reach 0 before the cost does (a per-run budget reserved as spend, a stale or missing spentUsd in the funding file, or a run refused because its declared budget exceeds what is left). Write the cause in the pull description. — The builder could not confirm a cause; the suspect (list_price.ts Opus fallback) is a hypothesis tracked in #11645.; Only src/spawn/credit.ts, src/spawn/funding.ts, src/spawn/model_door.ts, src/web/studio/crew_key.ts and the new test may change. — test/starter-crew.test.ts also changed (a necessary one-line expectation update, but outside the listed files)..
Left open after pull #11636 landed: 2 unticked items remain (The cause is found and named in the pull: whatever makes leftUsd reach 0 before the cost does (a per-run budget reserved as spend, a stale or missing spentUsd in the funding file, or a run refused because its declared budget exceeds what is left). Write the cause in the pull description.; Only src/spawn/credit.ts, src/spawn/funding.ts, src/spawn/model_door.ts, src/web/studio/crew_key.ts and the new test may change.). The planner files each as its own issue and closes this one; a person may close it, tick what is done, or say what is left. Until then the crew does not pick it again.
The open boxes were about that pull (name the cause in its description, touch only the listed files); the figure and the test are on main. Nothing to carry forward. Closing.
Already done on main in 05d6c81d4: the pull landed this issue's work; the boxes left open were constraints or pre-push steps of that pull, nothing more to build.
Done on main already, waiting for you to close it: 05d6c81d4a6fdd3c09eb60e1125407e0371c2f9d
Closed: already done on main in 05d6c81.
Part of #11541, split from #11563 (parked twice: try 1 changed five pages and a new module at once and its check was stopped for CPU; try 2 changed nothing). This piece fixes the figure and the home line only.
Seen on probe-hhmk: the home said "The included credit is spent; the crew needs a model key to go on." after $0.48 of $2.
The home line is
crewNoteinsrc/web/studio/crew_key.ts; it readsincludedCredit(app), which reads the host's last word fromfundingOf(dataDir)(src/spawn/funding.ts). The host counts spend inaddSpend(src/spawn/credit.ts), called fromsrc/spawn/model_door.tswith the list price of each answer.Done looks like:
leftUsdreach 0 before the cost does (a per-run budget reserved as spend, a stale or missingspentUsdin the funding file, or a run refused because its declared budget exceeds what is left). Write the cause in the pull description.includedCredit(app)returnsspentUsdbesidecapUsdandleftUsd, andspentUsdis the sum of what runs actually cost; a reservation or a run's declared budget never counts as spent.test/included-credit-figure.test.ts: $2 credit and one $0.48 answer throughaddSpendleaves $1.52 andcrewNotereads "building on $1.52 of $2.00" (inusdWordsform); spend reaching $2 reads the spent line. Ifscripts/gate.tsstill lists tests by hand, add the file there in the same commit.src/spawn/credit.ts,src/spawn/funding.ts,src/spawn/model_door.ts,src/web/studio/crew_key.tsand the new test may change.bun test test/included-credit-figure.test.tsandbun x tsc --noEmitbefore the push; do not run the whole suite in the sandbox.