Skip to content

Fix: Bound the held first-request estimate and show it as a range (#915) - #1001

Merged
amiddavid merged 9 commits into
mainfrom
fix/915-unseen-warm-baseline
Nov 11, 2026
Merged

amiddavid merged 9 commits into
mainfrom
fix/915-unseen-warm-baseline

Conversation

@boazdavid

@boazdavid boazdavid commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Refs #915. This does not close it: the exact price is still unknown.

Problem

The first request on a warm provider cache that the proxy has never seen (restart with missing state, or a session begun before the proxy) is priced as if every removed token was a cold write. The response usage does not give the size of the unseen warm prefix, so the saving cannot be computed exactly. On main (#930) the row is held out of every total and books 0, where the hand figure in the issue is about $0.0216.

Change

  • New requests.estimated_saved_low_usd: a floor. It prices each removed token at the cache-read rate, because a client token never costs less than a read. The true saving lies between this floor and estimated_saved_usd.
  • With the issue's prices (8010 read, 7966 written) the hand saving falls inside the range. Covered by TestPriceMode_HeldEstimateIsBoundedByReadAndWrite and TestOverviewSumsTheHeldFloor.
  • The Overview note and the request detail row show the range ("$x to $y") instead of only the ceiling.
  • Both bounds stay out of every total. The row stays flagged estimated and held. No booked figure changes.
  • The new field is in the API, the golden stats files and docs/dashboard.md.

Not in this PR

  • The state file and its persistence are untouched. The second symptom in the issue (deleting the state file moves totals both ways) is not addressed.
  • No exact price. That needs the warm-prefix size.

Decision for the owner

Whether to book anything for these rows: the floor, the midpoint, or a prefix size from --restart-grace or the observed cache_read. Booking a number changes totals, so it needs a human yes. Recommendation: keep $0 in the totals and show the range.

Data dependence

  • Metadata only: it keeps one dollar number per request row, requests.estimated_saved_low_usd. It is computed from the count of tokens removed and the model's cache-read price, because the held estimate needs a floor beside its ceiling. It reads no text.
  • Not a change to any row's Kind or level columns. docs/data-dependence.md names the new column in the Dashboard database row.

What it does at each level (see docs/data-dependence.md):

  • Off: the dashboard database is off, so nothing is stored and the range is not shown.
  • Metadata only: works. The number is stored and shown as the range.
  • Everything: works the same way. Content capture adds no text to this column.

Tests

  • go test ./dash ./proxy -count=1 passes. go vet and gofmt -l are clean.
  • The range logic (estRange) has a test, dash/estrange.test.mjs, which CI runs through a Go wrapper. The UI text around it has no test. node --check dash/ui/app.js passes. I did not look at the page in a browser.
  • Not run end to end: run_m5.py was not on disk. The floor was not checked against a real warm-prefix session.

Assisted-By: Claude (Anthropic AI) [email protected]

…or (#915)

The first request on an unseen warm cache cannot be priced exactly: the
size of the warm prefix is not in the usage. Keep it held out of the
totals, and store and show a floor (every removed token at the read
rate) beside the existing write-rate ceiling, so the range brackets the
true saving.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: DAVID BOAZ <[email protected]>
The Overview note and the request detail row showed only the ceiling
of a held estimate, which can be about 2x too high. Show the floor
and the ceiling together, so a reader sees the bounds the true saving
lies between. Totals are unchanged.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: DAVID BOAZ <[email protected]>
@boazdavid
boazdavid force-pushed the fix/915-unseen-warm-baseline branch from ae3ff87 to fd700c8 Compare November 11, 2026 05:52
…nd add the missing insert placeholder (#915)

The rebase onto main left a conflict marker in accountant_switch_test.go and
one placeholder too few in the requests INSERT after this PR's new
estimated_saved_low_usd column, so the dash package did not build or insert.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: DAVID BOAZ <[email protected]>
@boazdavid
boazdavid marked this pull request as ready for review November 11, 2026 06:05

@boazdavid boazdavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 2 (glm, user of @boazdavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.241 offload-review skill, @boazdavid's session fresh 2 of 2 1 of 2 d731a15f8c6e blocking

Verdict: blocking

Findings

  1. dash/accountant_price.go:478 — heldFloorUSD re-prices the deferral's tokens, which the held figure excludes

    • What fails: a held request on which tool deferral acted stores a floor that is too low. The floor drops by the deferral's Saved tokens x (write rate - read rate), although the deferral's dollars are not in the held ceiling. With the new test's prices: a mask op that saves 15,976 w5m tokens plus a tooldefer op that saves 2,188 w5m tokens gives a held ceiling of 15976 x 2.5e-6 = $0.03994. The correct floor is 15976 x 0.2e-6 = $0.0031952. The code returns 0.0031952 - 2188 x (2.5e-6 - 0.2e-6) = -$0.0018. The UI then hides the range (estRange needs low > 0) and falls back to the ceiling alone. The stored floor and both Overview sums are wrong for such rows.
    • Proof: accOverride sets EstimatedSavedUSD = fig.DeltaUSD - deferFig (line 452), where deferFig = fig.ByComponent["tooldefer"]. So the held figure excludes the deferral. heldFloorUSD(p, fig.DeltaUSD-deferFig) then loops over every op in e.accRes.Ops with no operator filter (lines 480-486) and subtracts tierUSD(p, o.Saved) - readRate x o.Saved for context-guru.tooldefer ops too. Those ops' Saved tokens are not part of the figure being floored. countedSavedTokens (line 519) shows the pattern this loop is missing: it filters toolSectionOperators. The new test covers only a single mask op, so this case is untested.
    • Fix: skip o.Operator == "context-guru.tooldefer" in heldFloorUSD's loop (or derive the floor from fig's per-component tokens, which already exclude the deferral). Add a test with a tooldefer op on a held request.
  2. dash/ui/app.js:1871 — the subscription Overview now shows a dollar estimate

    • What fails: a Claude-subscription Overview shows the sentence "Estimated saving, not in any total: $x to $y" on the Preset card. The page's own contract says every saving is in tokens, not dollars: the hero, the cards and the info text all render tokens when sub is set. The base code suppressed this sentence on a subscription with (sub ? '' : ...). Commit fd700c8 drops that guard. A subscription user now sees a stray dollar figure on a token-denominated page.
    • Proof: sub is set in renderSavedLedger from state.sub (app.js around line 1741); subInfo[0] states "On a Claude subscription every saving is in tokens, not dollars." The base line was + (sub ? '' : ' Estimated saving, not in any total: ' + estUsd(...) + '.'). The new line has no sub guard. The PR names no such change, and CLAUDE.md requires a behavior change that alters what is shown to be named and approved by a human developer.
    • Fix: restore the guard, or name this change in the PR and get the owner's yes.

Non-blocking

  • docs/data-dependence.md, the Dashboard row, still says "Two more flags and one number sit beside it" and names estimated_saved_usd. The new estimated_saved_low_usd column is missing from that sentence. The dependence is the same class (a number, no text), so the row's reason still holds. Update the enumeration.
  • estRange (dash/ui/app.js:107) hides the floor whenever low <= 0 and shows only "≈ ceiling". On a held request whose true saving is small, the reader gets no sign the figure can be far lower. Finding 1 makes this state reachable. Consider "up to $x" wording for that case.
  • The comment on Event.EstimatedSavedLowUSD says the true saving lies in [low, high] for every held row. On a negative held figure the UI shows only the ceiling as a cost. Cosmetic.

What I checked

  • Read CLAUDE.md and docs/design.md. Read the full diff of 9d34f00..d731a15 and every file it touches.
  • dash/accountant_price.go: traced PriceMode, accOverride, AccountantFigure and heldFloorUSD together. Verified the ceiling/floor arithmetic of the new test by hand ($0.021569 hand figure and the bounds hold).
  • Counted the INSERT columns against its placeholders in dash/store.go (146 = 146, with 7 limitCols and 40 token columns), requestCols against scanRequest (130 = 130), the full Overview SELECT against its Scan (last term estimated_saved_low_usd into &o.EstimatedSavedLowUSD), and the lean window query against its dest list. All aligned.
  • dash/schema.go: the new column is in both the CREATE TABLE and additiveColumns, same position. Old rows default to 0 and the UI falls back to the ceiling.
  • Price and PriceMode both reset EstimatedSavedLowUSD; searched all writers of EstimateHeld/EstimatedSaved* — no path sets held without the floor.
  • Golden test: the comparison decodes JSON and diffs key by key, so the three golden edits are consistent regardless of field order. All three stats goldens updated.
  • dash/ui/app.js: read renderSavedLedger, estRange, estUsd and both call sites, plus the request detail row.
  • No live tests were run (not approved).

@boazdavid boazdavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 1 (glm, user of @boazdavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.241 offload-review skill, @boazdavid's session fresh 1 of 2 1 of 2 d731a15f8c6e blocking

Verdict: blocking

Findings

  1. dash/accountant_price.go:453 — the floor subtracts the tool deferral's read-rate adjustment, but the deferral's dollars are not in the ceiling

    • What fails: A held request that also deferred tools stores a floor that is too low. It can be negative when the true floor is positive. The UI then drops the range and shows the ceiling alone, so the range feature disappears exactly on deferred threads. The Overview sums the same wrong floor.
    • Proof: The ceiling passed in is fig.DeltaUSD - deferFig (line 452), because the deferral's figure stays on the lever and out of the held estimate (comment at lines 442-445). But heldFloorUSD (line 478) loops over every op in e.accRes.Ops with no operator filter, so it subtracts the read-rate adjustment of the context-guru.tooldefer op too. Those tokens' dollars were already removed from the base. Trace, with CacheWrite = 2.5e-6, CacheRead = 0.2e-6:
      • tooldefer op: Saved.CacheWrite5m = 12000; mask op: Saved.CacheWrite5m = 4000.
      • fig.DeltaUSD = 16000 x 2.5e-6 = 0.04; deferFig = 0.03; ceiling = 0.01.
      • heldFloorUSD subtracts 16000 x (2.5e-6 - 0.2e-6) = 0.0368, so the floor is 0.01 - 0.0368 = -0.0268.
      • The correct floor is 4000 x 0.2e-6 = 0.0008.
      • The stored estimated_saved_low_usd is -0.0268, not 0.0008. In estRange (dash/ui/app.js:107) low > 0 fails, so the request row and the Overview fall back to the ceiling alone.
      • The new tests cover only a request with no deferral op, so they cannot catch this.
    • Fix: In heldFloorUSD, skip the deferral's op, the same way accOverride removes its dollars: if o.DryRun || o.Call != nil || o.Operator == "context-guru.tooldefer" { continue }. Add a test with a held request that carries a tooldefer op, and assert the floor is the non-defer removed tokens at the read rate.
  2. dash/ui/app.js:1871 — the subscription Overview now shows the dollar estimate; before this PR it showed none

    • What fails: A Claude subscription account with held requests sees a new dollar line on the Overview. The old code suppressed the estimate on the subscription view (sub ? '' : ' Estimated saving...'). The new code always shows it. The rest of that view avoids dollars on purpose: its headline says every saving is in tokens, not dollars.
    • Proof: git show fd700c81 -- dash/ui/app.js removes the sub ? '' : guard. The commit message names only the range display. It does not name this change. The repo rule (CLAUDE.md, "No behavior change for an edge case without a human developer's permission") needs the change named at the top of the PR, with the owner's yes. I did not read the PR description, so I cannot say it is missing there; the commit does not carry it.
    • Fix: Either restore the sub guard, or name the change at the top of the PR and get the owner's confirmation.

Non-blocking

  • heldFloorUSD comment (dash/accountant_price.go:477) says the floor "equals it when nothing was priced as a write". This is not exact when Saved holds Input-tier tokens: they bill at p.Input, not at the read rate, so the floor is below the ceiling even with no write. The bound itself stays valid.
  • The Overview floor sum mixes rows from before this column with new rows. A held row written between #915 and this PR has a ceiling but a 0 floor. On such a database the low end of the summed range counts only the new rows, so it understates. Each request row handles this correctly (it falls back to the ceiling alone). This ages out on its own.
  • docs/data-dependence.md, "Dashboard database" row, names estimate_held and estimated_saved_usd. The new estimated_saved_low_usd is the same kind of number, so the dependence does not change. Add the column to that row, or state in the PR that the dependence is unchanged.
  • The golden files put the new key in different positions: before estimated_saved_usd in stats.json and stats_lean.json, after it in stats_windowed.json. The test compares values, not key order, so this is cosmetic.

What I checked

  • Read CLAUDE.md, docs/design.md, and the full diff of all three commits (fca1057, fd700c8, d731a15).
  • Read dash/accountant_price.go in full. Traced AccountantFigure, accOverride, and heldFloorUSD against each other. Checked which ops and effects enter DeltaUSD, what deferFig removes, and what the floor loop adjusts.
  • Verified the SQL plumbing by count: the requests INSERT names 99 columns + 7 limitCols + 40 token columns = 146, and the VALUES lines hold 33 + 30 + 34 + 9 + 40 = 146 placeholders. The Exec args list adds e.EstimatedSavedLowUSD in the same position as the column.
  • Checked requestCols order against scanRequest, the full Overview SELECT against its Scan list, and the lean query terms against the lean Scan list. All align.
  • Checked the migration: the column is in ddl and in additiveColumns with the same REAL NOT NULL DEFAULT 0, so a fresh and an upgraded database get the same shape. addColumns is idempotent. No SELECT * reads the requests table positionally.
  • Read both new tests and checked their arithmetic by hand: ceiling 15976 x 2.5e-6, floor 15976 x 0.2e-6, and the issue's hand figure 0.021569 bracketed by the bounds. Confirmed the helpers (SetAccountant, accNear, insertReq) exist and insertReq goes through insertBatch.
  • Checked the golden test: it unmarshals both sides and diffs values, so the key-order difference is harmless.
  • Grepped for other consumers of EstimatedSavedUSD, estimate_held, and estimated_saved_usd (Go and UI). Both UI consumers were updated to the range; declFilterInBaseline in dash/toolsuggest.go is unaffected.
  • Checked the head commit's conflict-marker cleanup: no <<<<<<<, =======, or >>>>>>> markers remain in dash/.
  • Checked the fail-open and booking rules: the floor is never booked, enters no total and no baseline, and Price resets it. No behavior of any total changed.
  • Live tests were not approved, so I did not build or run anything.

…bscription guard (#915)

heldFloorUSD re-priced the tool deferral's tokens although the held ceiling
excludes the deferral's figure, so a held request that also deferred tools
stored a negative floor. The range line also lost its subscription guard in
the merge with main, showing a dollar estimate on a token-only page.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: DAVID BOAZ <[email protected]>
@boazdavid

Copy link
Copy Markdown
Collaborator Author

Round 1 replies. Both reviewers found the same two problems. Both are fixed in 803ddfc.

  1. heldFloorUSD counted the tool deferral. Fixed.

    • The held ceiling excludes the deferral's figure, so its tokens must be out of the floor.
    • heldFloorUSD now skips the context-guru.tooldefer operator.
    • New test: TestPriceMode_HeldFloorLeavesTheDeferralOut. A held request with 4000 mask tokens and 12000 deferral tokens now has floor 4000 x read rate. Before the fix the floor was negative.
  2. The subscription Overview showed a dollar estimate. Fixed. This was my error in the merge with main.

    • I took this PR's side of the conflict in dash/ui/app.js and lost main's sub ? '' : guard.
    • The guard is back. The range text still shows for non-subscription accounts. No behavior change for subscriptions.

Non-blocking items:

  • docs/data-dependence.md now names estimated_saved_low_usd. Fixed.
  • Floor sum over rows from before the column: left as is. It ages out, and each row falls back to its ceiling.
  • Comment wording on Input-tier tokens and golden key order: left as is. Neither changes behavior.

Assisted-By: Claude (Anthropic AI) [email protected]

@boazdavid boazdavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 1 (glm, user of @boazdavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.241 offload-review skill, @boazdavid's session resumed 1 of 2 2 of 2 803ddfc67f84 approve

Verdict: approve

Findings

None.

Earlier findings

  1. My finding 1 and reviewer 2's finding 1 (the floor counted the deferral's tokens): fixed. heldFloorUSD now skips o.Operator == "context-guru."+DeferComponent (dash/accountant_price.go:482). I traced the new test TestPriceMode_HeldFloorLeavesTheDeferralOut by hand: a mask op of 4,000 write tokens and a tooldefer op of 12,000 gives fig.DeltaUSD = 0.04, deferFig = 0.03, ceiling 0.01, floor 4000 x 0.2e-6 = 0.0008. The loop skips only the tooldefer op, so the floor no longer drops by the deferral's adjustment. I also checked the skip is not too wide: toolfilter, toolschema, expand and adjudicate stay in the floor, and their dollars stay in the held ceiling, so the floor still matches the figure it bounds. The test passes the gates in accOverride (its unpriced entry is penalty_unknown, the plausibility bound excludes the tooldefer op through toolSectionOperators, and tooldefer is an envelopeComponents name).
  2. My finding 2 and reviewer 2's finding 2 (the subscription Overview showed a dollar estimate): fixed. The sub ? '' : guard is back in dash/ui/app.js:1871, in the base form. The range text still shows for non-subscription accounts. The author says the guard was lost in the merge with main. The restored line matches the base version.
  3. My non-blocking items: the data-dependence.md row now names estimated_saved_low_usd ("two flags and two numbers"), fixed. The mixed-population floor sum, the Input-tier comment wording and the golden key order were left as is, with the reasons "ages out" and "no behavior change". I accept those reasons; none of the three changes what a number means.

Non-blocking

  • None new. The items the author chose to leave are listed above and stay non-blocking.

What I checked

  • Last review: round 1, d731a15, 2026-11-11T06:12:35Z
  • New commits read: 1 (803ddfc, "fix(dash): Keep the deferral out of the held floor and restore the subscription guard (#915)")
  • Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files in my folder)
  • New items since my last review: the author's comment at 2026-11-11T06:15:48Z (round-1 replies, read and each claim checked against the code), and commit 803ddfc (diff read in full, all four files). Reviewer 2's round-1 review (06:12:23Z) I read now in full; it found the same two defects as my round 1, both now fixed.
  • Read the fixed heldFloorUSD and the new test in the file, not only the diff. Traced the test through PriceMode and accOverride: the unpriced-op rule, the plausibility bound, the row checks and the deferral lever.
  • Confirmed nothing else changed between d731a15 and 803ddfc: the commit touches only dash/accountant_price.go, dash/accountant_switch_test.go, dash/ui/app.js and docs/data-dependence.md.
  • Re-checked that the floor still enters no total and no baseline, and that both Price and PriceMode reset it.
  • Live tests were not approved, so I did not build or run anything.

@boazdavid boazdavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 2 (glm, user of @boazdavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.241 offload-review skill, @boazdavid's session resumed 2 of 2 2 of 2 803ddfc67f84 approve

Verdict: approve

Findings

None. Both round-1 findings are fixed and the fixes are correct.

Round 1 findings

  1. heldFloorUSD re-priced the deferral's tokens — fixed in 803ddfc.
    • The loop now skips o.Operator == "context-guru."+DeferComponent (dash/accountant_price.go:481), which is context-guru.tooldefer, the exact operator whose dollars deferFig removes from the held ceiling (line 452). The skipped set (DryRun, Call, tooldefer) is now exactly the set of ops whose nets are not in fig.DeltaUSD - deferFig. Cache effects are never re-priced, so no other op or effect needs skipping. The floor and the ceiling now cover the same tokens.
    • The new test TestPriceMode_HeldFloorLeavesTheDeferralOut covers the case my round-1 review said was untested. I checked its arithmetic by hand: DeltaUSD = 16000 x 2.5e-6 = $0.04, deferFig = $0.03, ceiling = 4000 x 2.5e-6 = $0.01, floor = 4000 x 0.2e-6 = $0.0008. Both assertions match. The request passes the gates: countedSavedTokens skips the tooldefer op, so the bound sees 4000 against TokensBefore 20000.
  2. The subscription Overview showed a dollar estimate — fixed in 803ddfc.
    • The sub ? '' : guard is back (dash/ui/app.js:1870), in the same form as the base code, with the range text inside it. A subscription page shows no dollar estimate again. The author confirmed this was a merge error and not an intended change.

Non-blocking

  • estRange (dash/ui/app.js:107) still hides the floor when low <= 0 and shows "≈ ceiling" alone. After the fix this state means the true floor is genuinely at or below zero, so it is rarer. The reader still gets no sign the true saving can be far below the ceiling. My round-1 note; the author's reply did not address this one. Left for a later PR.
  • Reviewer 1's note on pre-column rows in the Overview floor sum: I agree with the author's reason to leave it. The sum ages out and each request row falls back to its own ceiling.

What I checked

  • Last review: round 1, d731a15, 2026-11-11T06:12:23Z.
  • New commits read: 1 (803ddfc "fix(dash): Keep the deferral out of the held floor and restore the subscription guard (#915)").
  • Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files; .review-in-inline.txt is empty).
  • New items since my last review, and what I did about each:
    • Review by reviewer 1 at 2026-11-11T06:12:35Z: read in full. Both findings match mine. I checked the trace myself (16000/4000 token example, ceiling $0.01, wrong floor -$0.0268, correct floor $0.0008) and it is correct. No new findings in it.
    • Comment by the author at 2026-11-11T06:15:48Z: read in full. It replies to both reviewers, states the merge error on the sub guard, and lists the non-blocking dispositions. Checked each claim against the code; all are accurate.
    • Commit 803ddfc: read the full diff and the code around each change.
  • Verified the operator string: DeferComponent = "tooldefer" (dash/accountant_price.go:228), so the skip matches context-guru.tooldefer, the name toolSectionOperators and the library's operator both use.
  • Confirmed the fix touches nothing else: the commit changes only heldFloorUSD's skip, the new test, the restored sub guard, and the data-dependence row. No JSON output, golden file, column count or query changes, so the round-1 alignment checks still hold.
  • docs/data-dependence.md: the Dashboard row now names estimated_saved_low_usd ("the least it could be"). My round-1 non-blocking item is fixed.
  • No live tests were run (not approved).

@amiddavid

Copy link
Copy Markdown
Collaborator

Integrator note for v0.7.3. Two things are needed before this PR can merge:

  1. CI fails. In build-test, the dash package reaches the 20-minute limit inside TestOverviewStaysFastOnALargeWindow (dash/zz_perf_test.go). main passes that test, and this PR changes the Overview query (overview.go, query.go, overview_lean.go). Please check whether the new estimated_saved_low_usd sum makes the Overview slow on a large window, and fix it or show that it does not.
  2. Data dependence. Please add a Data dependence section to the description. It adds the column requests.estimated_saved_low_usd: say what it reads and what it does at each storage level.

The owner must still choose what to book for these rows: nothing (your recommendation), the floor, or the midpoint. I will ask the owner when CI is green.

@boazdavid

Copy link
Copy Markdown
Collaborator Author

@amiddavid, both points are answered.

  1. CI. I think the failure is a slow runner, not the new sum. I did not prove the cause on the runner itself.
    • The panic is the whole dash package reaching -timeout 20m under -race -coverpkg. TestOverviewStaysFastOnALargeWindow had run for only 32s when the alarm fired. It is the test that was in flight, not a slow one.
    • On main, the dash package took 745s to 773s in three recent runs and 1192s in a fourth. So the 20 minute limit is close to the edge on a slow runner.
    • I timed the Overview query on 10,000 rows, six runs each. This branch: 106 to 177 ms. main: 106 to 151 ms. The difference is inside the noise.
    • I re-ran the failed job. If it times out again, the next step is to raise the dash timeout or split the package, in a separate PR.
  2. Data dependence. The section is now in the description. Short version: the column reads token counts and the cache-read price, no text. It is stored at metadata level and above, and not at all when the dashboard database is off.

Booking for these rows stays the owner's decision.

Assisted-By: Claude (Anthropic AI) [email protected]

Resolve the dash/store.go conflict in the requests INSERT: main added
restored_tokens and this branch adds estimated_saved_low_usd. Keep both
columns and both placeholders (100 columns, 107 '?' incl. the dynamic
limit/stored-token parts — the same 7-offset as the merge base).

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: DAVID BOAZ <[email protected]>
estRange fell back to the ceiling alone whenever the floor was not above
zero, so a request whose true saving may be a cost read as "≈ $high". A
floor below zero comes only from a new row, so show it; a floor of exactly
0 is what an older row holds and still shows the ceiling alone.

Tests: a node test of the real estRange (fails before this change), and a
Go test pinning that the floor keeps breaks and added tokens at their
priced value and can go below zero.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: DAVID BOAZ <[email protected]>
amiddavid added a commit that referenced this pull request Nov 11, 2026
The go test time limit goes from 20m to 40m on the test and cover
targets. On main's CI, the dash package took 1140 s of the 1200 s
limit, so PRs that add dash tests (#1001, #1064, #1068) failed
build-test with "test timed out after 20m0s".

Behavior change: none (CI and local test limits only). Data
dependence: none. Follow-up: speed up or split the dash tests.

Reviews: 2 offload reviews (GLM), round 1, both approve at 0612436,
which is the PR head.

Signed-off-by: DAVID AMID <[email protected]>
Assisted-By: Claude Opus 5.5 <[email protected]>
@amiddavid

Copy link
Copy Markdown
Collaborator

Integrator note: #1082 is on main (3c876dc). It raises the go test time limit to 40m. The build-test failure here ("test timed out after 20m0s" in the dash package) came from the old limit. Please merge origin/main into this PR, so CI runs with the new limit.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 2 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.322 offload-review skill, @amiddavid's session fresh 2 of 2 3 of 3 deb710388d4f blocking

Verdict: blocking

Findings

  1. dash/estrange.test.mjs:1 — the new node test never runs: nothing wires it into go test or CI
    • What fails: deb71038 changes what the UI shows (a held estimate whose floor is a cost now shows the range). Its only test for that change is dash/estrange.test.mjs. No Go wrapper runs it, no Makefile target runs it, and no CI step runs it. go test ./dash/... — what CI's build-test runs — never executes the file. A later revert of estRange to low > 0 passes CI.
    • Proof: every other .mjs test in dash/ has a Go wrapper that runs it under go test: navhash.test.mjs ← dash/navhash_test.go:27, savings.test.mjs ← dash/savingsparts_test.go:15, ui_smoke.mjs ← dash/ui_smoke_test.go:61. A grep for estrange over all *.go, the Makefile and .github/ finds nothing. The commit message says "a node test of the real estRange (fails before this change)" — true only when run by hand. The PR description still says "The UI text has no test."
    • Fix: add a wrapper test in dash/, the same 8 lines as TestSavingsPartsAddUp (look up node, skip when absent, run node --test estrange.test.mjs, fail on error).

Non-blocking

  • The head does not contain #1082 (3c876dcb, the 40-minute go-test limit). It landed at 09:38:36Z, two minutes after the head was pushed. The integrator asked at 09:38:57Z to merge origin/main so CI runs with the new limit. CI on this head passed anyway (build-test success at 10:03:58Z), so this is open housekeeping, not a red build: merge main before this PR merges.
  • The PR description's Tests section says "The UI text has no test". deb71038 added one. The line is stale.
  • estRange still falls back to the ceiling alone when the floor is exactly 0. On a new row this can happen when a model's cache-read price is 0. The base code did the same, so this is not a regression.

Earlier findings

  1. Round 1, finding 1 (both reviewers): the floor re-priced the deferral's tokens. Fixed in 803ddfc, still intact at HEAD. heldFloorUSD skips o.Operator == "context-guru."+DeferComponent (dash/accountant_price.go:481). I re-read the function after the merge: the skip set (DryRun, Call, tooldefer) is unchanged.
  2. Round 1, finding 2 (both reviewers): the subscription Overview showed a dollar estimate. Fixed in 803ddfc, still intact at HEAD. The sub ? '' : guard is at dash/ui/app.js:1873.
  3. My round-2 non-blocking note (estRange hid a floor of 0 or below): addressed by deb7103. A negative floor now shows as a range. A floor of exactly 0 still falls back, by design: it is what a row from before the column holds (the column is REAL NOT NULL DEFAULT 0). I traced both call sites: each passes estimated_saved_low_usd || 0, so a missing key also falls back, and each is guarded (estimate_held / estimated_requests > 0).
  4. Reviewer 1's non-blocking note (the Overview floor sum mixes rows from before the column): the author rejected it with "it ages out, and each row falls back to its ceiling". I checked the reason: only the summed low end understates, each request row renders its own fallback, and no booked total changes. I accept it.

What I checked

  • Last review: round 2, 803ddfc, 2026-11-11T06:17:49Z
  • New commits read: 2 (c88ece1 "Merge main into fix/915-unseen-warm-baseline", deb7103 "fix(dash): Show a held estimate's floor when it is a cost")
  • Read in full: 4 reviews, 3 comments, 0 inline comments (from the three files; .review-in-inline.txt is empty)
  • New items since my last review, and what I did about each:
    • Comment by @amiddavid at 07:25:01Z (CI timeout in the dash package, data-dependence section wanted): checked both points. The author answered at 07:53:42Z; the data-dependence section is now in the PR description and names the column and each storage level. The CI claim I could not rerun (live tests not approved), but build-test on the final head is green.
    • Comment by @amiddavid at 09:38:57Z (merge origin/main for #1082's 40-minute limit): checked. The merge c88ece1 predates #1082 by 19 minutes, and the head predates it by 2 minutes, so the request is not yet satisfied. Noted under Non-blocking.
    • Commit c88ece1 (the merge): read the full diff against both parents. Main brought in 10 already-reviewed PRs; my job was the resolution. Nine files were changed by both sides since the merge base 9d34f00. I verified each keeps both sides:
      • dash/store.go (the hand-resolved conflict): counted the requests INSERT by script — 100 static columns, 107 static placeholders, 107 static args (97 in the first list + 7 limitArgs + auth_subscription, sweep_false_expands_warm, restored_tokens), and the order matches (main's restored_tokens and this branch's estimated_saved_low_usd each sit at the same position in columns, placeholders and args).
      • dash/query.go: aligned requestCols with scanRequest position by position, all 100 plus the dynamic token tail: estimated_saved_low_usd → &e.EstimatedSavedLowUSD, restored_tokens → &e.RestoredTokens.
      • dash/overview.go: the SELECT tail (restored_tokens, estimate_held, estimated_saved_usd, estimated_saved_low_usd) matches the Scan tail (&restoredTok, &o.EstimatedRequests, &o.EstimatedSavedUSD, &o.EstimatedSavedLowUSD).
      • dash/schema.go: both columns are in the CREATE TABLE and in additiveColumns, same definition.
      • dash/event.go, dash/accountant_price.go, dash/ui/app.js, docs/dashboard.md, docs/data-dependence.md: both sides' changes present; nothing of this branch's was dropped (the dash/ deletions in the merge are main rewriting main's own keepalive and table code).
      • Interaction check: main's #1067 adds a context-guru.expand_restore op. I read its construction (apply/restore.go:146-170): it is insert-only (SizeBefore 0, MessageSplice.Inserted 1), so it carries Caused tokens and no Saved tokens. heldFloorUSD re-prices only Saved tokens, so the restore's cost stays at its priced value in both the floor and the ceiling. No defect.
    • Commit deb7103: read the full diff and the code around each change.
      • estRange (low > 0 → low !== 0): traced both call sites (app.js:1873 and app.js:3891). Both coerce || 0 and are guarded, so low is never null or undefined. Old rows hold 0 and fall back to the ceiling; a negative floor shows -$x to $y; -0 falls back (-0 !== 0 is false). The high > low guard and the low > delta clamp in heldFloorUSD keep the range well-ordered.
      • The new Go test TestPriceMode_HeldFloorKeepsBreaksAndAddedTokensAndCanBeACost: traced the arithmetic by hand against heldFloorUSD. Floor = delta − 4000×(2.5e-6 − 0.2e-6) = 4000×0.2e-6 − 1000×2.5e-6 + brk, with brk = 500×0.2e-6 − 500×2.5e-6. That is −$0.00285, below zero as asserted. The test's expectations match the implementation.
      • The new dash/estrange.test.mjs: traced the regex extraction by hand. cut('usd') and cut('estRange') stop at their own closing braces; cut('estUsd')'s lazy first pattern spans through estRange's closing brace, so the concatenation defines estRange twice with identical text — the eval is still correct. The assertions pass on the new code and fail on the old (estUsd(0.0075) contains no -$0.0017). Then I looked for what runs it — finding 1.
  • CI on the head deb7103: all checks green (build-test, purego, build, analyze, trivy, DCO, CodeQL).
  • No live tests were run (not approved).

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 1 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.322 offload-review skill, @amiddavid's session fresh 1 of 2 3 of 3 deb710388d4f approve

Verdict: approve

Findings

None.

Earlier findings

  1. My finding 1 and reviewer 2's finding 1 (the floor counted the deferral's tokens): fixed in 803ddfc, and still fixed at HEAD after the merge with main. heldFloorUSD still skips o.Operator == "context-guru."+DeferComponent (dash/accountant_price.go:481). The merge changed nothing in that function.
  2. My finding 2 and reviewer 2's finding 2 (the subscription Overview showed a dollar estimate): fixed in 803ddfc, and still fixed at HEAD. The sub ? '' : guard is intact at both display call sites (dash/ui/app.js:1873 and the request row).
  3. Reviewer 2's round-2 non-blocking item (estRange hid a floor at or below zero): fixed by deb7103. estRange now shows a negative floor (low !== 0 in place of low > 0). I checked the semantics: an old row (floor exactly 0) still falls back to the ceiling alone; the || 0 guards at both call sites keep null and undefined at 0; a negative floor renders through usd as "-$x". The range display is this PR's own new feature — base main has no estRange — so no owner permission is needed for the negative case.

Non-blocking

  • The head does not contain #1082 (3c876dc, the Makefile's 20m → 40m test timeout). The integrator's last comment (2026-11-11T09:38:57Z) asked for a merge of origin/main so CI runs with the new limit. The head predates 3c876dc by about 2 minutes (deb7103 at 09:36:33Z, 3c876dc at 09:38:36Z), so the author could not have merged it. CI is green on this head (build-test passed, 25m16s), but it ran under the old 20m limit, and the same suite failed on a slow runner before. Main now also carries #1087 (df5110d): when a ready PR waits only for a merge of main, the integrator does that merge. So this is the integrator's step now — but the merge of main must happen before this PR merges, or the next slow runner can time build-test out again.
  • dash/estrange.test.mjs and main's dash/savings.test.mjs run in no CI workflow (only opencode-plugin/test/*.test.mjs does). The new test follows the existing precedent, so this is not this PR's defect — but a UI helper with a test CI never runs can rot silently.
  • In dash/estrange.test.mjs, cut('estUsd')'s first regex spans past estUsd's one-line body and captures estRange too (its body closes with }\n, not \n}). Harmless today — the duplicated declaration is identical text — but a helper inserted between estUsd and estRange in app.js would be swallowed into the extraction.

What I checked

  • Last review: round 2, 803ddfc, 2026-11-11T06:17:41Z
  • New commits read: 2 on the branch — c88ece1 "Merge main into fix/915-unseen-warm-baseline" and deb7103 "fix(dash): Show a held estimate's floor when it is a cost". The merge carries 11 main commits (43802c5 and below), each reviewed on its own PR; I read the merge result on every file this PR owns.
  • Read in full: 4 reviews, 4 comments, 0 inline comments (from the three files in my folder).
  • New items since my last review, and what I did about each:
    • Comment by @amiddavid at 07:25:01Z (integrator note: CI timeout, data-dependence section). Checked both points below.
    • Comment by @boazdavid at 07:53:42Z (author's reply: slow runner, Overview timings 106-177 ms branch vs 106-151 ms main, description updated). Verified the description and the query alignment myself.
    • Comment by @amiddavid at 09:38:57Z (merge origin/main for the 40m limit): checked — the head does not contain 3c876dc; see Non-blocking. CI is green on the head regardless.
    • Commit c88ece1: verified the dash/store.go conflict resolution by count — 97 static columns before limitCols = 97 static args, limitCols (7) = limitArgs (7), then auth_subscription, sweep_false_expands_warm, restored_tokens = 3 args, plus the N stored-token columns; 107 static ? + N dynamic, all aligned. Counted the merged Overview SELECT against its Scan: 59 top-level terms = 59 destinations (deferNetSum is one parenthesized expression, no extra comma). Confirmed requestCols/scanRequest carry restored_tokens at the same position, and that estimated_saved_low_usd survived everywhere (schema, INSERT, requestCols, both Overview paths, data-dependence row). Checked main's new expand_restore op against heldFloorUSD and countedSavedTokens: it saves nothing, so it enters ceiling and floor consistently and adds nothing to the plausibility bound.
    • Commit deb7103: traced the new Go test by hand through AccountantFigure and heldFloorUSD — mask op net 4000×2.5e-6 − 1000×2.5e-6, break value 500×0.2e-6 − 500×2.5e-6, ceiling 0.00635, floor −0.00285; both match the test's formulas and the floor is below zero as asserted. Verified the test passes the accOverride gates (unpriced reason is penalty_unknown, counted tokens 4000 ≤ 20000, mask row exists). Traced the node test's regex extraction against the real app.js and both assertions (-$0.0017 to $0.0075; $0.0008 to $0.01); the old low > 0 gate fails the first assertion, so the "fails before this change" claim holds.
    • PR description: read in full. The Data dependence section the integrator asked for is present and correct (metadata only, one dollar number, no text).
  • CI on the head: build-test, purego, record, build, analyze, CodeQL, DCO all pass (checked via gh pr checks). This also confirms the merge compiles and the golden files agree with the merged code.
  • Live tests were not approved, so I ran nothing myself.

@amiddavid

Copy link
Copy Markdown
Collaborator

Integrator note on GLM round 3 at deb7103: reviewer 1 approves, reviewer 2 blocks on one small point.

  • dash/estrange.test.mjs never runs in CI. No Go wrapper, Makefile target or CI step calls it, so a revert of estRange would pass CI. Fix: add a wrapper in dash/, like TestSavingsPartsAddUp in dash/savingsparts_test.go:15 (find node, skip when it is absent, run node --test estrange.test.mjs, fail on error). Also update the PR text, which still says "The UI text has no test."

After the fix, round 4 (pre-approved by the owner) runs on the new head. The owner still has to decide what to book for these rows.

estrange.test.mjs had no Go wrapper, so no CI step ran it. A revert of
estRange would have passed CI. The wrapper has the same shape as
TestSavingsPartsAddUp: it skips when node is absent, else it runs the
node test.

Assisted-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: DAVID AMID <[email protected]>
@amiddavid

Copy link
Copy Markdown
Collaborator

Fixed the finding that dash/estrange.test.mjs never ran in CI.

  • Added TestEstRangeShowsANegativeFloor in dash/savingsparts_test.go. It has the same shape as TestSavingsPartsAddUp: it skips when node is absent, else it runs node --test estrange.test.mjs.
  • Mutation check: with estRange back on low > 0, the node test fails (1 fail). With the fix, 2 pass.
  • Merged origin/main first (clean, no hand resolution).
  • PR text corrected: only the UI text has no test.

Assisted-By: Claude Opus 5.5

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 2 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.322 offload-review skill, @amiddavid's session resumed 2 of 2 4 of 4 4f652fdb31a0 approve

Verdict: approve

Findings

None.

Earlier findings

  1. Round 3, my finding 1 (dash/estrange.test.mjs never ran in CI): fixed in 4f652fd. TestEstRangeShowsANegativeFloor (dash/savingsparts_test.go:185) has the exact shape I proposed and the same shape as TestSavingsPartsAddUp: it looks up node, skips when absent, runs node --test estrange.test.mjs, fails on error. os/exec is already imported in the file. The node test reads app.js through import.meta.url, so the working directory of the go test binary does not matter. A revert of estRange to low > 0 now fails go test ./dash. The author's mutation check (old gate: 1 fail; new code: 2 pass) matches my own hand trace from round 3.
  2. Round 1, both findings (the floor re-priced the deferral; the subscription Overview showed a dollar estimate): fixed in 803ddfc, still intact at HEAD. The heldFloorUSD skip (dash/accountant_price.go:481) and the sub ? '' : guard (dash/ui/app.js:1874) are unchanged after the second merge of main.
  3. My round-2 non-blocking note (estRange hid a floor at or below zero): addressed by deb7103, unchanged at HEAD (low !== 0, both call sites coerce || 0).
  4. Round-3 non-blocking (the head lacked #1082): resolved. The merge 33d1353 brings 3c876dcb in; the Makefile test and cover targets now say -timeout 40m.
  5. Round-3 non-blocking (the PR text said "The UI text has no test"): fixed. The Tests section now says the range logic has a test that CI runs through a Go wrapper, and only the text around it has none. Accurate.

Non-blocking

  • At review time, build-test and purego were still running on the head; DCO, build, trivy, analyze and CodeQL are green. The change since the last green head is a 12-line test wrapper plus a byte-clean merge of main, so I expect them to pass, but the run was not finished when I posted.
  • Reviewer 1's round-3 note on cut('estUsd')'s regex spanning into estRange: I agree it is harmless today (I traced the same duplication in round 3; the extracted text defines estRange twice, identically). A helper inserted between the two in app.js would be swallowed; a later PR can tighten the regex.

What I checked

  • Last review: round 3, deb7103, 2026-11-11T13:24:32Z
  • New commits read: 2 on the branch (33d1353 "Merge origin/main into fix/915-unseen-warm-baseline", 4f652fd "test(dash): run estrange.test.mjs in CI (#1001)"). The merge carries 8 main commits (3c876dc #1082, e86d897 #1073, df5110d #1087, b125d4b #334, d501cdb #1064, 9dda47d #1068, f123d52 #1083, 202087d #1074), each already reviewed and merged on main.
  • Read in full: 6 reviews, 5 comments, 0 inline comments (from the three files; .review-in-inline.txt is empty)
  • New items since my last review, and what I did about each:
    • Review by reviewer 1 at 13:26:39Z (round 3, approve): read in full. No findings; its non-blocking notes are answered above.
    • Comment by @amiddavid at 13:27:30Z (integrator relay of round 3; round 4 pre-approved by the owner): the fix it asks for is the wrapper, done.
    • Comment by the author at 18:09:15Z (fix note with a mutation check): each claim checked against the code — wrapper present, main merged, PR text corrected. All accurate.
    • Commit 33d1353 (the merge): verified clean by tree identity. git merge-tree --write-tree deb71038 202087de returns tree 018b3319…, and 33d1353c^{tree} is the same tree, so the merge is the automatic result with no hand resolution and nothing of either side dropped.
    • Commit 4f652fd: read the full diff; it is the wrapper only.
  • Re-verified the branch's plumbing at HEAD after main's #1064 touched the same dash files:
    • dash/store.go requests INSERT: recounted by script — 100 static columns, 107 static placeholders, 97 args in the first list + 7 limitArgs + auth_subscription, sweep_false_expands_warm, restored_tokens, order matched.
    • dash/query.go: requestCols and scanRequest are byte-identical to the blocks I aligned in round 3 (estimated_saved_low_usd → &e.EstimatedSavedLowUSD; restored_tokens → &e.RestoredTokens).
    • dash/overview.go: the SELECT tail and Scan tail still end estimated_saved_low_usd → &o.EstimatedSavedLowUSD; overview_lean.go unchanged.
    • dash/schema.go: estimated_saved_low_usd is in the CREATE TABLE and additiveColumns.
    • dash/ui/app.js after main's #1068: usd (97), estUsd (106), estRange (112) sit unchanged, so the node test's regex extraction still cuts the right functions; both call sites keep || 0 and the sub guard.
  • Checked the one interaction the previous green CI had not seen: main's #1073 moved the accountant onto a background goroutine and landed after the last green run on this branch. At HEAD, finish calls c.accWait() (proxy/dashcapture.go:824) before SetAccountant (844) and PriceMode (857), so the floor is still computed from the complete accountant result. heldFloorUSD reads only e.accRes, which SetAccountant fills first.
  • heldFloorUSD's deferral skip re-read at HEAD: unchanged.
  • CI on the head: DCO, build, trivy, analyze, CodeQL green; build-test and purego in flight at posting time.
  • No live tests were run (not approved).

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 1 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.322 offload-review skill, @amiddavid's session resumed 1 of 2 4 of 4 4f652fdb31a0 approve

Verdict: approve

Findings

None.

Earlier findings

  1. Reviewer 2's round-3 finding 1 (dash/estrange.test.mjs never ran in CI): fixed by 4f652fd. TestEstRangeShowsANegativeFloor (dash/savingsparts_test.go:185) has exactly the shape the integrator asked for and the same shape as TestSavingsPartsAddUp: exec.LookPath("node"), skip with a hint when absent, else node --test estrange.test.mjs, fail on error. go test runs a package from its own directory, so the bare filename resolves; the .mjs reads ui/app.js through import.meta.url, not the working directory, so the run does not depend on where it starts. A revert of estRange to low > 0 now fails go test ./dash.
  2. My round-3 non-blocking item (the head lacked #1082, the 40-minute test limit): fixed by the merge 33d1353. 3c876dcb is an ancestor of HEAD, and the Makefile at HEAD passes -timeout 40m on both the test and cover targets.
  3. Reviewer 2's round-3 non-blocking item (the PR text still said "The UI text has no test"): fixed. The description's Tests section now says the range logic has a test that CI runs through a Go wrapper, and only the UI text around it has none.
  4. Round-1 findings 1 and 2 (the deferral's tokens in the floor; the lost sub guard): still fixed at HEAD after the second merge of main. heldFloorUSD still skips context-guru.tooldefer (dash/accountant_price.go:481), and the sub ? '' : guard is intact at dash/ui/app.js:1874.
  5. My round-3 non-blocking note on cut('estUsd')'s regex spanning into estRange: left as is, harmless (the duplicated declaration is identical text). Main's #1068 did not touch the usd/estUsd/estRange region, so the extraction works unchanged.

Non-blocking

  • CI on this head was still running when I posted. build, analyze, purego, trivy, DCO and CodeQL pass; build-test and record were pending. purego does not run ./dash, so the new wrapper has no green CI run yet — build-test is the job that exercises it. Nothing in my reading suggests it will fail: the wrapper copies a pattern that passes in CI on main, and the .mjs itself passed my round-3 hand trace against the same app.js text.
  • The owner's booking decision for held rows (book nothing, the floor, or the midpoint) is still open per the integrator. The PR books nothing, which is the reviewer-backed recommendation. Not a code matter.

What I checked

  • Last review: round 3, deb7103, 2026-11-11T13:26:39Z
  • New commits read: 2 on the branch — 33d1353 "Merge origin/main into fix/915-unseen-warm-baseline" and 4f652fd "test(dash): run estrange.test.mjs in CI (#1001)". The merge carries 8 main commits (#1082, #1073, #1087, #334, #1064, #1068, #1083, #1074), each reviewed on its own PR; I read the merge result on every file this PR owns.
  • Read in full: 6 reviews, 6 comments, 0 inline comments (from the three files in my folder).
  • New items since my last review, and what I did about each:
    • Review by reviewer 2 at 13:24:32Z (round 3, blocking on the estrange test never running in CI): read in full. The finding matched my round-3 non-blocking item, raised with stronger proof (the other .mjs tests all have Go wrappers). Checked the fix myself — see Earlier findings 1.
    • Comment by @amiddavid at 13:27:30Z (integrator note relaying that finding, plus the stale PR-text line): both requests done — wrapper added, PR text corrected (verified in the current description).
    • Comment by @boazdavid at 18:09:15Z (the author's fix note): each claim checked — the wrapper exists as described, the mutation claim matches my round-3 trace (the old low > 0 gate fails the first assertion), the merge is in the history, the PR text is corrected.
    • Commit 33d1353 (the merge, clean, no hand resolution): verified it disturbs nothing of this branch's. dash/accountant_price.go, dash/accountant_switch_test.go, dash/estrange.test.mjs, dash/event.go and dash/overview_lean.go are byte-identical to deb7103. dash/store.go changes only in DropOldestSessions (main's #1064); I re-counted the requests INSERT at HEAD — 97 static columns before limitCols = 97 static args (a script's 98 was a trailing comma after the last arg), 7 limitCols = 7 limitArgs, 3 columns after = 3 args, 107 static ? + N dynamic, all aligned. Re-counted the merged Overview SELECT against its Scan: 59 top-level terms = 59 destinations (deferNetSum still one parenthesized expression). Aligned requestCols with scanRequest position by position, including estimated_saved_low_usd → &e.EstimatedSavedLowUSD and restored_tokens → &e.RestoredTokens. docs/dashboard.md keeps both sides: this branch's floor paragraph (lines 179-180) and main's #1068 sections. dash/ui/app.js: the usd/estUsd/estRange region is unchanged, so the node test's regex extraction still works.
    • Commit 4f652fd (the wrapper): read the diff and the file around it. Compared it line by line with TestSavingsPartsAddUp; same imports (os/exec already in the file), same skip, same run. The commit touches nothing else.
  • PR description: re-read in full. The Tests correction is in; the Data dependence section is unchanged from round 3.
  • CI on the head at posting time: build, analyze, purego, trivy, DCO, CodeQL pass; build-test and record pending (see Non-blocking).
  • Live tests were not approved, so I ran nothing myself.

…aseline

Move the data-dependence row change for estimated_saved_low_usd into
docs/data-dependence/features/dashboard-database.md. The generated page
docs/data-dependence.md comes from go run ./cmd/gen-datadep.

Assisted-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: DAVID AMID <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants