Repository navigation
fix(mod): "next 5h" only before a share; test the cold token figure - #1174
Conversation
Two non-blocking notes from the round-2 review of #1135: - Below 80 columns the band wrote "next 5h 90.0k wr cold" when the warm state had no price and the fit did not learn the entry's write tier. The "5h" label had no share after it. Now the label is "next 5h" only when a share follows it. - New test: a cold band whose write tier the fit did not learn shows "next message 90.0k wr" in the warning color, with no "of 5h", at 140 and 60 columns. Assisted-By: Claude Signed-off-by: DAVID AMID <[email protected]>
|
Owner decision (David Amid, 2026-11-16): approved. The label change below 80 columns ( |
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (claude, user of @amiddavid) | Claude Code 2.1.325 | offload-review skill, @amiddavid's session | fresh | 2 of 2 | 1 of 2 | df6937570954 |
approve |
Verdict: approve
Findings
None.
Non-blocking
register.tsx:342— the new comment is in the wrong place. It sits aboveconst cmd = rotatingTip(now), which is not related. Move it to thenarrow ? … 'next 5h 'line (355), or next tocoldShare(341).- Narrow row with a warm share and a cold token figure is still unclear. At 60 columns, a warm 1-hour entry with an unlearned 1-hour write reads
next 5h ≈0.1% · 90.0k wr cold. The leading5hreads as if it applies to both figures. The wide row is clear (≈0.1% of 5h · 90.0k wr if cold). This is old behavior, not from this PR. No test pins the narrow form of this state. Consider a follow-up test, or a decision on the wording. register.test.tsx:455— the regex/of 5h|5h/has a redundant branch./5h/alone covers it.- The first new test passes on the base too. The cold branch did not change, so this test adds coverage and does not pin the fix. The second test pins the fix: on the base,
isShareis true and the row startsnext 5h, so/^◆ next 90\.0k wr cold/fails.
What I checked
- The full diff (1 commit, 2 files, +33/−1) and the PR body.
register.tsx:294-375: the band row 1,warm/cold/isShare/coldShare, and the warm and cold branches.model.ts:87-120,nextPrice:sharereturns withwarmundefined only whenwarmUsdis missing.coldIsTokensis true when the write tier's weight is not learned.- The new label logic, case by case, below 80 columns:
- warm share, cold share or cold tokens →
next 5h(as before). - no warm, cold share →
next 5h ≈x% cold(as before). - no warm, cold tokens →
next 90.0k wr cold(new; the5hhad nothing to qualify). - tokens or usd →
next(as before).
- warm share, cold share or cold tokens →
- The wide row and the cold-cache row do not read
narrowfor the label, so they do not change. - The pane (
register.tsx:510-513) has its owncoldUnitlogic and does not change. - Test fixtures:
entry()puts expiry atend_ts + ttl_s. Test 1 usesend_ts = NOW − 2h,ttl_s = 3600, so the cache is cold.WEIGHTShascache_write_1h: false, so the cold figure stays in tokens. Test 2 dropsnext_warm_usdfrom the doc and the main thread, sowarmis undefined. The cold figure is90.0k wr. - The behavior change is named at the top of the PR, with who, old, new and how to turn it off. It asks for the owner's yes, as
CLAUDE.mdrequires. - Data dependence: no change. The band reads the same counts and weights. No row file is needed.
- I did not run the tests (live tests not approved for this review).
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (bob, user of @amiddavid) | IBM Bob Shell 1.0.3 | offload-review skill, @amiddavid's session | fresh | 1 of 2 | 1 of 2 | df6937570954 |
approve |
Verdict: approve
Findings
None.
Non-blocking
None.
What I checked
- The diff: One logic change in
register.tsxline 357, one comment added line 341, two new tests inregister.test.tsxlines 445-474. - The change: The condition for showing "next 5h" prefix now checks
isShare && (warm !== undefined || coldShare)instead of justisShare. This ensures "next 5h" appears only when a share percentage follows it, not when a token figure follows. - The tests: Two new tests cover the fixed cases:
- Cold band with unlearned write tier shows "90.0k wr" with no "of 5h" or "5h" (lines 445-460)
- Warm band below 80 columns with no warm price and unlearned write tier shows "next 90.0k wr cold" with no "5h" (lines 462-474)
- Correctness: The logic is correct. When
isShareis true but neitherwarmnorcoldSharehas a value, the display would show "next 5h" followed by nothing or a token figure. The fix prevents this. - Test coverage: Both new tests verify the exact output format and check that "5h" does not appear. The cold test also verifies the warning color.
- Commit: DCO signed, follows conventional commit format, includes Assisted-By attribution.
- No behavior change: This fixes a display inconsistency. No functional logic changes. No data flow changes.
- Fail-open: Not applicable. This is a display-only change in the plugin UI layer.
- Documentation: The inline comment at line 341 explains the rule clearly.
The fix addresses the non-blocking notes from #1135 round 2 review. The change is minimal, well-tested, and correct.
Review note on #1174 (reviewer 1): the comment sat above an unrelated line. Comment-only change. Assisted-By: Claude Signed-off-by: DAVID AMID <[email protected]>
|
Round 1 answers. Both reviewers approve. Reviewer 1 (approve), non-blocking notes
Reviewer 2 (approve)No findings. Backends in this roundThe GLM gateway did not answer (DNS, |
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (claude, user of @amiddavid) | Claude Code 2.1.325 | offload-review skill, @amiddavid's session | resumed | 2 of 2 | 2 of 2 | 90de887d6071 |
approve |
Verdict: approve
Findings
None.
Earlier notes
No reviewer raised a blocking finding in round 1. My 4 non-blocking notes:
- Comment in the wrong place: fixed in
90de887d. The comment now sits aboveisShare, next to the other comment about the narrow row (register.tsx:337-339). next 5h ≈0.1% · 90.0k wr coldat 60 columns: kept by the author. Reason: old behavior, and a share leads the row, so5hbelongs to it. I accept this. It is not from this PR.- Redundant
/of 5h|5h/branch: kept. I accept this. It does no harm. - First new test passes on the base: the author agrees. It is coverage, as the #1135 note asked. The second test pins the fix.
Non-blocking
- The round-1 answers comment lists my 4 notes under "Reviewer 1". Reviewer 1 had no notes. They came from reviewer 2. The record is wrong, but the answers are right.
What I checked
- Last review: round 1,
df69375709541eaf42a7d74be7bdc44875828089, 2026-11-16T19:18:17Z - New commits read: 1 —
90de887ddocs(mod): put the narrow-label comment next to the code it explains - Read in full: 2 reviews, 2 comments, 0 inline comments (from the three files)
- New items since my last review:
- Reviewer 1 round-1 review (19:19:07Z): approve, no findings, no notes. Nothing to answer.
- Author's round-1 answers (19:20:29Z): checked each answer against my notes, as above.
- The owner's decision comment (19:13:09Z) is older than my last review. I read it now: the owner approves the label change. This satisfies the behavior-change rule in
CLAUDE.md.
- The new diff is 1 comment line moved, +1/−1. No code changed. The full PR diff from base is the same logic as in round 1.
- I did not run the tests (live tests not approved for this review).
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (bob, user of @amiddavid) | IBM Bob Shell 1.0.3 | offload-review skill, @amiddavid's session | resumed | 1 of 2 | 2 of 2 | 90de887d6071 |
approve |
Verdict: approve
Findings
None.
Earlier notes
I had no findings or non-blocking notes in round 1. Reviewer 2 had 4 non-blocking notes. The author addressed note 1 (comment placement) in commit 90de887d. Notes 2-4 were kept by the author with valid reasons.
Non-blocking
None.
What I checked
- Last review: round 1,
df69375709541eaf42a7d74be7bdc44875828089, 2026-11-16T19:19:07Z - New commits read: 1 —
90de887d"docs(mod): put the narrow-label comment next to the code it explains" - Read in full: 3 reviews, 2 comments, 0 inline comments (from the three files)
- New items since my last review:
- Reviewer 2 round-1 review (19:18:17Z): approve with 4 non-blocking notes about comment placement, narrow row wording, redundant regex, and test coverage
- Author's round-1 answers (19:20:29Z): fixed comment placement in
90de887d, kept other items with reasons - Reviewer 2 round-2 review (19:21:07Z): approve, confirms comment fix, accepts author's reasons for keeping other items
- Owner decision (19:13:09Z, older than my round 1 but read now): approves the label change
- The new commit
90de887d:- Moves comment from line 342 to line 339 (above
isSharedeclaration) - Comment now sits next to
coldShareand the other narrow-row comment - No code changed, only comment position
- Diff: +1/-1, one line moved
- Moves comment from line 342 to line 339 (above
- Verified the comment now explains the correct code: it sits above
isShareand describes when "5h" leads the narrow row - The full PR diff from base remains the same logic as round 1: the condition change at line 357 and the two new tests
- DCO signed, conventional commit format, Assisted-By attribution
- I did not run the tests (live tests not approved for this review)
The comment-only change is correct. The PR is ready to merge.
Plugin versions for v0.7.4: - Claude Code plugin 0.7.3 -> 0.7.4 (#1096, #1135, #1174, #1177, #1199, #1216). - Codex plugin 0.2.12 -> 0.2.13 (#1115, #1135). - Pi package 0.1.1 -> 0.1.2 (#1113). - Bob plugin 0.1.1 -> 0.1.2 (#1093, #1111, #1118, #1124, #1126, #1127). The owner's Bob hold (#1221) covers release tests only. - OpenCode: PINNED_VERSION v0.7.3 -> v0.7.4 in opencode-plugin/index.js, its README, docs/how-to/install-opencode-plugin.md and 3 tests. Behavior change: the version numbers; the OpenCode plugin's first start downloads proxy v0.7.4. Release bumps are approved by the owner ("I approve version bumps"). Data dependence: none. Reviews: 2 offload review rounds (GLM): both approve at ab79001. After it: 1422093, a merge of main with no hand resolution (remerge-diff 0; approval-still-valid: SAME CHANGE). Signed-off-by: DAVID AMID <[email protected]> Assisted-By: Claude Opus 5.5 <[email protected]>
Behavior change
next 5h 90.0k wr cold. The5hlabel had no share after it.next 90.0k wr cold.Summary
This PR fixes the 2 non-blocking notes from the round-2 review of #1135 (reviewer 2). Follow-up to #1095.
What changed
context-guru-plugin/hooks/register.tsx: below 80 columns, row 1 starts withnext 5honly when a share follows it. A lone token figure gets plainnext.context-guru-plugin/hooks/register.test.tsx, 2 new tests:○ cache cold · next message 90.0k wr, warning color, noof 5h, at 140 and 60 columns.next 90.0k wr cold, with no5h.Data dependence
No change. The band reads the same token counts and weights as before.
How it was tested
claude plugin test context-guru-plugin: 120 pass, 5 fail.origin/maintoday: 118 pass, 5 fail. This PR adds 2 tests, and both pass. The 5 fails are not from this PR: one is test(mod): 'no data: the band is left to the engine' fails with no implementation for clock.now #1019, and the other 4 are test(mod): 4 band tests fail on main with Claude Code 2.1.325 (an extra engine row) #1175.🤖 Generated with Claude Code