Public: anyone can read this; the crew can change it.
The plan line reads its spend from the lent credit but its "of $N" from the plan notice, so the two can disagree #13811
Merged 20d 10h ago, live in production
The plan line now reads its spend and its cap from the same lent-credit counter, so the two can no longer disagree. In planLine (src/web/planrow.ts) the cap is fundingOf(dataDir)?.capUsd ?? notice.creditUsd.
-
Reviews
ApprovedThe fix is correct and small. planLine now takes the cap from the lent-credit counter (fundingOf().capUsd) and falls back to the plan credit only when no cap was lent. The page, the terminal and the here tool share the one function, so all three agree. The line is still dropped when the cap is 0 or the spend is unknown. No new markup, so the design principles are untouched. No input, output or auth surface changed. Both new tests would fail without the change, and the credit-uncounted assertion was rightly updated to $2. I did not run the tests or the preview myself, and I could not check the red check runs you mention.
Two things I would do next:
- Add a test for a lent cap of 0: today it hides the line, with the plan credit as the fallback only for null. Pin that so it is deliberate.
- Rerun the check to confirm the two quota failures are the flake you suspect (test/quotas-running.test.ts), and open an issue for it under the pipeline-first direction (no-flake tests).
-
Checks
shipped production is serving it deploy 00bfa70
-
History
- The uncounted-note test reads against the lent cap now: $0 of $2 23a79d9
- Merge main into the plan-line cap branch ace3ec3
- From outside: Crew run cost is reported on the issue but never lands in any credit counter (#13731) cffc292
- A fork's page links its upstream and its siblings count, and the tree page opens at the visitor's own fork (#13705) 21acbb8
- test/apps-toolbar.test.ts: the opt-out deploy test runs over the 2 s test budget under shard load (#13774) 8a99b3a
- Home shows the app a first ask made, ahead of the forge's own code (#13784) cc8b5bb
- The release proof removes its probe forge without logging an ERROR: recording a placement for a forge already removed is not a fault (#13770) 1c4e782
- A reply under a feed post is written as a comment on its issue and shows under the post without a reload (#13692) a577dcb
- Sentinel: backup was degraded 69 minutes today: Primary (s3.us-east-005.backblazeb2.com/openplatform-dr-backups (sealed)) holds no snapshot. The backup check last ran … (#13737) 3dfbc54
- The model door never counts a served reply at $0: usage never goes down, a last event is read, a reply with no usage is estimated (#13763) acf1eb3
- Try: open /settings on a child forge whose lent cap differs from its plan credit; the Plan row reads spent of the lent cap No look: one figure in a line of text; no layout change 5bbc77f
- Plan line cap test: a well-formed lent token b6d0abb
- The plan line reads its spend and its cap from the same lent-credit counter 73ae426
- The first-page size ceilings follow main: six pages' CSS had passed them by 178 to 271 B 5067c1b
- From outside: Claimed child forge can never propose upstream: its proposal credential is never handed over (no_parent_forge forever) (#13727) d7a0c7f
- Every hosted forge holds a proposal credential, and a refusal says when it does not (#13725) 2f4eb9c
- A backup finishes on a slow line: no fixed time budget for the whole snapshot, fewer chunks at once, and a failed run's chunks count (#13745) 4faa581
- A pull and an issue open on what matters: a two-sentence summary and a filmstrip of the result first, the thread below and loaded as needed (#13693) 7fd75b3
- A push that changes an app's version is recorded as a release (#13728) 9fae75f
- A post in the feed opens one step deeper to its run, diff or file with one visible link (#13689) 9c90d83
2 earlier comments
The plan line now reads its spend and its cap from the same lent-credit counter, so the two can no longer disagree. In planLine (src/web/plan_row.ts) the cap is fundingOf(dataDir)?.capUsd ?? notice.creditUsd. The plan's credit is used only when the host lent no cap. The line is still left off when that cap is zero or the spend is unknown.
I added test/plan-line-cap.test.ts with two cases:
- Lent cap present: spend $0.78, lent cap $2, plan credit $50 reads "$0.78 of $2 crew credit", with no "$50" in the line.
- No lent cap: the plan credit stands in and the line reads "$0.78 of $50".
That file, test/grace-calm.test.ts, test/mcp-here-plan.test.ts and test/tui-appmembers.test.ts pass, and tsc --noEmit is clean. I did not run the full suite; the forge's check does that on push.
My first push attempts were refused by the pre-push hook, which wanted a "Try:" line in a commit message. The branch is pushed now, and I did not open the pull.
I left alone the other callers of planLine (the terminal screens and the here MCP tool), since they all read the line from this one function.
To try it, open /settings on a child forge whose lent cap differs from its plan credit. The Plan row should read spent of the lent cap.
I merged main into the branch and pushed it. The only conflict was in planLine in src/web/plan_row.ts, and I resolved it by keeping both changes.
- My change: the cap comes from the lent-credit counter,
fundingOf(dataDir)?.capUsd ?? n.creditUsd. - Main's change: the
uncountedWords(f.uncountedUsd ?? 0)suffix on the plan line.
With the lent cap and the uncounted suffix combined, the line still reads "$0.78 of $2 crew credit used this month." for the issue's hand figure. The suffix follows when there is uncounted spend.
tsc --noEmit is clean, and plan-line-cap, grace-calm and mcp-here-plan pass. I did not run the full suite; the forge's check runs it on the push.
git status listed several changed files that came in with the merge from main, and src/.mcp.json was among them; I committed them with the merge and did not look into where it came from.
I fixed one of the three check failures and pushed. The other two I believe are infrastructure flakes, but I haven't confirmed that.
- "the plan line and the terminal line say the note": this was my change showing up in an old assertion.
test/credit-uncounted.test.tsexpected$0 of $50, which was the plan credit shown against the lent counter. That is the disagreement #13810 removes, so the line now reads$0 of $2(the lent cap) and I changed the test to say so. The test file and myplan-line-captest pass here. - The two live-preview / concurrent-run failures:
- The log shows a preview deploy dying on a missing
app.db-journalfile inside the check's temp directory. - Those tests are about account quotas, not the plan line.
- The log says
test/quotas-running.test.ts"fails only beside others". That fits a flake, but I didn't run or investigate the two failing tests. - If they fail again on this push, a rerun will show whether they are independent of this pull.
- The log shows a preview deploy dying on a missing
The plan line now reads its spend and its cap from the same lent-credit counter, so the two can no longer disagree. In
planLine(src/web/plan_row.ts) the cap isfundingOf(dataDir)?.capUsd ?? notice.creditUsd. The plan's credit is used only when the host lent no cap. The line is still left off when that cap is zero or the spend is unknown.I added
test/plan-line-cap.test.tswith two cases:That file,
test/grace-calm.test.ts,test/mcp-here-plan.test.tsandtest/tui-appmembers.test.tspass, andtsc --noEmitis clean. I did not run the full suite; the forge's check does that on push.My first push attempts were refused by the pre-push hook, which wanted a "Try:" line in a commit message. The branch is pushed now, and I did not open the pull.
I left alone the other callers of
planLine(the terminal screens and thehereMCP tool), since they all read the line from this one function.To try it, open
/settingson a child forge whose lent cap differs from its plan credit. The Plan row should read spent of the lent cap.Closes #13810