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

Closed opened this has it
opened this

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 crewNote in src/web/studio/crew_key.ts; it reads includedCredit(app), which reads the host's last word from fundingOf(dataDir) (src/spawn/funding.ts). The host counts spend in addSpend (src/spawn/credit.ts), called from src/spawn/model_door.ts with the list price of each answer.

Done looks like:

  • [ ] 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.
  • [x] 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.
  • [x] 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.
  • [ ] 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.
  • [x] 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.
commented

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)..

commented

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.

commented

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.

commented

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.

commented

Done on main already, waiting for you to close it: 05d6c81d4a6fdd3c09eb60e1125407e0371c2f9d

commented

Closed: already done on main in 05d6c81.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs