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

opened this

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.

Notes

opened this

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.

Closes #13810

2 earlier comments
commented

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.

commented

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.

commented

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.ts expected $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 my plan-line-cap test pass here.
  • The two live-preview / concurrent-run failures:
    • The log shows a preview deploy dying on a missing app.db-journal file 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.
Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs