Skip to content

feat(dash): remove the History tab - #731

Merged
OsherElhadad merged 6 commits into
mainfrom
feat/remove-history-tab
Oct 26, 2026
Merged

OsherElhadad merged 6 commits into
mainfrom
feat/remove-history-tab

Conversation

@vz-ibm

@vz-ibm vz-ibm commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR removes the dashboard's History tab. It showed the same capability data as the Cleanup tab, only over the time before install, and with no cost, so it was not useful. Everything that only History used is gone. Every part that pointed at History now points at Cleanup. Every other page and route works as before.

What changed

Removed (used only by History):

  • UI: dash/ui/history.js, its <script> tag in index.html, and its history: entry in the router (app.js).
  • API: GET /api/history (all of dash/historyapi.go) and its response cache (historyCache).
  • CSS: 5 .ins-own > summary rules. They styled only History's owner row. Cleanup's <summary> sits inside .ins-body, not directly in .ins-own, so Cleanup is unaffected. .ins-own itself stays.
  • Tests and docs: historyapi_test.go, historytenant_test.go, uihistory_test.go, and docs/plans/history-per-project.md.

Kept (other parts use them):

  • The transcript importer (import-history, run by install.sh). Cleanup's "Nothing measured for this selection" message reads the imported rows (CoverageFor). The removal advice reads the imported tool calls (TestAnImportedInvocationStopsTheRemovalAdvice). The Requests filter reads source.
  • dash/cachehistory.go: cache savings. It only shares the word "history".
  • Three tests that lived in the removed files but test other features. They moved to their own files:
    • TestHostedFacetsDoNotReadTheServersTranscripts (a tenant-isolation test for /api/facets) → facetstenant_test.go. Its helper is renamed hostedHistoryAPI → hostedAPI.
    • TestTheCleanupViewExplainsAProjectWithNoMeasuredTraffic → uicleanup_test.go.
    • The stripComments helper → uitest_helpers_test.go.

Changed, so the rest keeps working:

  1. Cleanup text: two sentences told the reader to "open the History tab". The pointer is removed, and the rest of each sentence is kept.
  2. /context-guru:dashboard (context-guru-plugin/scripts/dashboard.sh and its skill): it checked /api/history to see that the dashboard API runs, and it opened History first. It now checks /api/capture, which reads only in-memory counters, and it opens Cleanup only. Without this change, the command would always report "the proxy is not answering".
  3. TestEverySelfMountedViewNamesANavGroupThatExists: its minimum went from 5 to 4. History was the fifth view that mounts itself. The pattern still matches all 4 remaining views.

How it was tested

Test first. Each of these failed before the change, for the intended reason:

  • TestHistoryRouteIsGone (new): /api/history returned 200, and index.html loaded history.js.
  • TestTheDashboardOpensCleanupOnTheResolvedPort and TestTheDashboardCanPrintWithoutOpening: the script probed /api/history. The fake dashboard serves only /api/capture, so the probe failed, as it would on a real proxy after the removal.
  • TestTheDashboardSkillIsLockedToItsScript: SKILL.md still described History.
  • TestTheCleanupViewExplainsAProjectWithNoMeasuredTraffic: now checks that Cleanup does not point at History, and still checks the rest of its empty state.

Suites:

  • go build ./... and make lint: clean.
  • go test ./dash/... ./proxy/...: all pass except TestCalculatorPricesFromTheRowsModelNotABlend, which also fails on clean main on this machine.
  • go test ./context-guru-plugin/: the dashboard tests, the goldens and the vendoring test pass, once the host's ANTHROPIC_DEFAULT_*_MODEL variables are unset. With them set, the settings-card goldens fail on main too.

Live (macOS, a proxy built from this branch, over a copy of a real local database):

  • /api/history and /dashboard/history.js return 404. Every other dashboard API returns 200.
  • All 17 nav routes render the same as on main. There are no page errors. The only console error is a 404 on /api/me/keepalive/sessions on the keep-alive tab, and it appears on main too.
  • The Savings group shows: Cache strategy, Inventory, Cleanup, Usage.
  • An old bookmark #savings/history lands on the first Savings tab (keep-alive). Nothing breaks.

Not tested automatically: a browser run of the UI. TestUISmokeEveryTab skips on macOS (it looks for chrome-linux64). CI covers it on Linux.

Data dependence

  • No change to what any component or feature stores.

This PR removes a reader only. It stores nothing new and drops no table or column. The transcript importer, which writes the imported rows, stays. docs/data-dependence.md has no History row, so it needs no update.

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

  • Off: no change.
  • Metadata only: no change. The History page is no longer served.
  • Everything: no change. The History page is no longer served.

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

The History tab showed the same capability data as Cleanup, only over
the time before install, with no cost. It is removed with everything
only it used, and every part that pointed at it now points at Cleanup.

Removed:
- dash/ui/history.js, its script tag and its router entry.
- GET /api/history (dash/historyapi.go) and its response cache.
- The History-only CSS (.ins-own > summary; Cleanup's summary sits in
  .ins-body, so it is unaffected).
- Its tests and its old plan doc.

Kept, because other parts use them:
- The transcript importer (import-history): Cleanup's coverage message,
  the removal advice and the Requests filter read the imported rows.
- Three tests that lived in the removed files but test other features,
  moved to their own files: the hosted /api/facets tenant test, the
  Cleanup empty-state test, and the stripComments helper.

Changed, so the rest keeps working:
- Cleanup no longer tells the reader to open the History tab.
- /context-guru:dashboard probes /api/capture, not /api/history, and
  opens Cleanup only. Without this the command always failed.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Vitaly Zabershinsky <[email protected]>

@vz-ibm vz-ibm 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 (claude, user of @vz-ibm) Claude Code 2.1.310 offload-review skill, @vz-ibm's session fresh 1 of 2 1 of 2 b7377a4cb8f7 approve

Verdict: approve

Findings

None.

Non-blocking

  • dash/uicleanup_test.go:47-53 — an orphan comment block. The file ends with the doc comment of TestBothTabsStateTheirSpanAndPointAtEachOther, but that test is deleted. The comment says History exists and that the dashboard skill "opens both tabs side by side". Both are now false. Delete the block. (The test itself was right to go: it read ui/history.js and required Cleanup to say "history tab".)
  • dash/ui/insights.js:563 — the empty state now reads "That does not mean nothing was wasted here. Traffic in this project from now on is measured and will appear here." This is correct. But the sentence no longer gives the reader a next step. If you want one, point at the NeverCalled list that import-history prints. This is optional.

What I checked

  • Read the full diff (21 files, +181 / −2139), the commit message, and the PR body.
  • No dangling Go references. I listed every func and type that the deleted files declared (HistoryDoc, historyRoutes, history, historyFor, hostedHistoryAPI, mkSkill, mkMarketplaceSkill, containsFold, and so on). Only the 2 moved tests and stripComments still have uses, and each now has one definition (facetstenant_test.go, uicleanup_test.go, uitest_helpers_test.go). historyCache and historyRoutes have no uses left.
  • Helpers the moved tests need still exist in kept files: writeJSONL, turnLine (transcript_test.go), daysAgo (importhistory_test.go), openTestDB, jsStringLiterals, readUI, goldenAPI, get.
  • The moved tests are the same as before. TestHostedFacetsDoNotReadTheServersTranscripts is byte-for-byte the old body; only the helper name changed. TestTheCleanupViewExplainsAProjectWithNoMeasuredTraffic drops "history tab" from the required strings, adds 2 strings that exist in insights.js:560-564, and adds a check that "history tab" is absent. The order check (coverage before insChart()) is kept.
  • Library code the removed handler used stays in use or was already shared: CachedProjectGroups and FoldersOf (api.go:685, query.go:1742), isSelfOwned (insightsshape.go:282). installedSkillOwners (importhistory.go:371) now has no caller. Go does not flag an unused func, and make lint is go vet + gofmt, so it passes. It is dead code now; you can delete it here or later.
  • dashboard.sh probe. /api/capture is a real route (api.go:793, scopeTenant). In local mode (a.auth == nil) it returns 200 with in-memory stats, so curl -f passes. The fake server in dashboard_test.go now serves only /api/capture, so a probe of the removed route fails the test. Good.
  • CSS removal is safe. Cleanup builds div.ins-own > [head, details.ins-body > summary] (insights.js:366-380). Its <summary> is not a direct child of .ins-own, so the removed .ins-own > summary rules never matched it.
  • Nav count. mountTab({ appears in 4 views now (campaigns, insights, kvcache, tools). The new minimum of 4 matches.
  • No other pointers left. I searched docs/, context-guru-plugin/, dash/ui/, and scripts/ for #savings/history, /api/history, history.js, "History tab", and history-per-project. Only the new negative tests match.
  • Fail open and data dependence. The PR touches only the dashboard reader and the plugin script. No component, Store, or request path changes. The importer and the source column stay. No docs/data-dependence.md row is needed.
  • Security. The hosted-tenant facet test is kept. The removed handler read the transcript tree and plugin inventory through diskHome(), so removing it shrinks what can read the server's $HOME.
  • I did not run Go builds or tests (not approved for this review).

@vz-ibm vz-ibm 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 (claude, user of @vz-ibm) Claude Code 2.1.310 offload-review skill, @vz-ibm's session fresh 2 of 2 1 of 2 b7377a4cb8f7 blocking

Verdict: blocking

The removal itself is clean. The route, script, loader, CSS and cache field are gone, and nothing in Go or JS still refers to them. One user-facing instruction still sends users to the removed tab.

Findings

  1. context-guru-plugin/skills/install/SKILL.md:193 — the install skill still tells the agent that History exists
    • What fails: a user runs /context-guru:install. install.sh emits history_import=done (install.sh:1283). The skill tells Claude to explain that the import ran "so History is not empty on day one". Claude then points the user at a History tab that this PR removed. The user finds no such tab.
    • Proof: SKILL.md:193: "history_import=done — Claude Code's history from before this install was imported once, so History is not empty on day one; quote history_import_summary=. It shows what was used and when …". The PR changed the dashboard skill and added a test that it never says "History" (dashboard_test.go:181-183). The install skill has no such check, and the PR does not touch it.
    • Fix: say what the import feeds now. The commit message lists it: Cleanup's coverage message, the removal advice and the Requests filter. For example: "imported once, so Cleanup can tell imported projects from measured ones on day one". Drop "It shows what was used and when". Optionally extend the "no History" check to this skill too.

Non-blocking

  • dash/importhistory.go:364-371 — installedSkillOwners is now dead code. Its only callers were historyapi.go:131 and historyapi_test.go:624, and both are removed. git grep installedSkillOwners now finds only the definition. make lint runs go vet and gofmt only, so CI will not flag it. The commit says "removed with everything only it used", so either remove it or say why it stays. Also, its doc comment ran into the installedSkills doc comment (lines 358-370). That merge is older than this PR, but removing the function fixes it.
  • dash/uicleanup_test.go:528-535 — an orphan comment closes the file. The block "EACH TAB STATES ITS SPAN … AND POINTS AT THE OTHER" belonged to the removed TestBothTabsStateTheirSpanAndPointAtEachOther. It now documents no function. It also says the dashboard skill "opens both tabs side by side", which is no longer true. Delete it.
  • dash/insightsui_test.go:391: the floor of 4 is right. I count 4 mountTab({ calls: tools.js, insights.js, kvcache.js, campaigns.js.

What I checked

  • Read the whole diff of the commit b7377a4 (21 files). Read each kept or moved file in full, and listed every function in the removed files at the base commit.
  • Searched for leftover references: HistoryDoc*, calledAnywhereFor, historyRoutes, historyCache, loadHistory, history.js, /api/history, #savings/history, "History tab". Only the new negative tests mention them. app.js has no history loader, nav entry or view, and go() sends an unknown view to overview, so an old #savings/history link opens Overview instead of an empty page.
  • Checked each helper that historyapi.go used: isSelfOwned, CachedProjectGroups, FoldersOf, diskHome, scope, serveJSON still have other callers. installedSkillOwners has none (see above).
  • Moved tests: stripComments is the same as the base version. TestHostedFacetsDoNotReadTheServersTranscripts is the same apart from the rename hostedHistoryAPI → hostedAPI. The Cleanup empty-state test now checks for the new text, and that history tab is absent from the rendered literals. The new text in insights.js:563-564 contains both "does not mean nothing was wasted" and "from now on is measured".
  • dashboard.sh: the probe now uses GET /api/capture (api.go:793, scopeTenant, in-memory rec.Stats() only), so the probe stays cheap. On a local proxy with no auth it returns 200. curl -f checks only the status. The fake server serves only /api/capture, so a probe of the old route fails in the test, as the comment says. The single opener call and its error message are correct under set -u.
  • TestHistoryRouteIsGone: get mounts the real routes, and with no /api/history pattern the mux returns 404, so the test can fail if the route comes back.
  • Fail open and data dependence: this PR touches no request path or component. docs/data-dependence.md has no History row, so no change is needed there. The transcript importer stays, so nothing that reads imported rows changes.
  • I did not build or run tests: live tests are not approved for this review.

Review round 1 on #731:

- The install skill still said the import ran "so History is not empty
  on day one". It now says what the import feeds: Cleanup can tell
  imported projects from measured ones, and a skill used before install
  is not reported as unused.
- New TestNoSkillMentionsTheRemovedHistoryTab walks every skill in both
  plugins, so the next one cannot be missed the same way.
- installedSkillOwners had no caller left once /api/history was gone.
  Removed, with the doc paragraph that had run into installedSkills.
- Removed an orphan doc comment left at the end of uicleanup_test.go
  from the deleted cross-link test.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Vitaly Zabershinsky <[email protected]>
@vz-ibm

vz-ibm commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator Author

Reply to review round 1

Reviewer 1: approve. Reviewer 2: one blocking finding. All fixed in 7e7feba.

Finding 1 (reviewer 2): the install skill still says History exists

Fixed. skills/install/SKILL.md said the import ran "so History is not empty on day one". It now says what the import feeds: "so on day one Cleanup can tell imported projects from measured ones, and a skill already used before install is not reported as unused". The phrase "It shows what was used and when" is now "It records what was used and when".

Test: a new TestNoSkillMentionsTheRemovedHistoryTab walks every SKILL.md in both plugins (Claude Code and Codex), not only the dashboard skill, so the next skill cannot be missed this way. It matches the tab (History is, History tab, **History**, savings/history, /api/history, ...), not the word: "your own history" (past traffic) still passes. It failed first on exactly this line (skills/install/SKILL.md ... ("History is")).

Non-blocking

  • installedSkillOwners is dead code (reviewer 2). Removed. Its only callers were in the removed History code. My PR description said it stays. That was wrong, and this corrects it. The doc paragraph that had run into installedSkills is removed with it. installedSkills stays: NeverCalled uses it, and import-history prints that list.
  • Orphan comment at the end of uicleanup_test.go (both reviewers). Removed. It was the doc comment of the deleted cross-link test.
  • The empty state gives no next step (reviewer 1, optional). Not changed. Today the only next step is "use the project through the proxy", and the sentence already says that traffic from now on appears here. Pointing at the NeverCalled output of import-history would send a dashboard reader to a terminal command. That is a separate UX decision.
  • Floor of 4 (reviewer 2): confirmed, no change.

Checks

  • go build ./... and make lint: clean.
  • go test ./dash/... ./proxy/...: all pass except TestCalculatorPricesFromTheRowsModelNotABlend, which also fails on clean main on this machine.
  • go test ./context-guru-plugin/ -run 'TestNoSkillMentions|TestTheDashboard': pass.

@vz-ibm vz-ibm 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 (claude, user of @vz-ibm) Claude Code 2.1.310 offload-review skill, @vz-ibm's session resumed 1 of 2 2 of 2 7e7feba50f2a approve

Verdict: approve

Findings

None.

Status of earlier findings

  • Reviewer 2, finding 1 (install skill names History): fixed. skills/install/SKILL.md:193-197 now says what the import feeds. Both claims are true in the code:
    • "Cleanup can tell imported projects from measured ones": the Cleanup empty state reads coverage.measured_requests (insights.js), and imported rows carry Source = SourceImported (redact.go:84).
    • "a skill already used before install is not reported as unused": TestAnImportedInvocationStopsTheRemovalAdvice (dash/importinvocations_test.go:64) proves it.
  • Both reviewers, orphan comment at the end of uicleanup_test.go: fixed. The file now ends after TestTheCleanupViewExplainsAProjectWithNoMeasuredTraffic.
  • Both reviewers, installedSkillOwners dead code: fixed. The function and its doc paragraph are gone. installedSkills now has its own doc comment, with nothing merged into it (importhistory.go:358-363). os and filepath still have users in the file (lines 366, 373), so no import goes unused.
  • Reviewer 1, empty state gives no next step: rejected by the author. The reason is right. The only next step a dashboard reader can take is to use the project through the proxy, and the sentence says that already. I drop it.
  • Reviewer 2, floor of 4: no change needed. Confirmed in round 1.

Non-blocking

  • TestNoSkillMentionsTheRemovedHistoryTab (dashboard_test.go:192) matches a fixed list of phrases. A future line such as "open History" would pass. This is acceptable: the list covers the wording that existed, and a word match on "History" would also flag "your own history".

What I checked

  • Last review: round 1, b7377a4, 2026-10-26T09:41:57Z
  • New commits read: 1 — 7e7feba5 fix(plugin,dash): drop the last pointers to the History tab (4 files, +28 / −50)
  • Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files)
  • New items since my last review:
    • Reviewer 2 round-1 review (09:42:36Z): read it. I checked its finding 1 against the new commit (fixed, see above).
    • Author reply (09:51:48Z): read it. I checked each claim against the diff. I accept the rejection of my optional point.
  • New test, TestNoSkillMentionsTheRemovedHistoryTab:
    • readFileString exists in the same package (package plugin, preset_default_test.go:444).
    • Go tests run in the package folder, so the globs skills/*/SKILL.md and ../codex-marketplace/plugins/context-guru/skills/*/SKILL.md resolve. I count 19 + 16 = 35 files, so the < 10 guard does not trip.
    • The regex is valid RE2 (\b is supported). I ran the same pattern with grep -E over both skill trees at this head. It matches nothing. The old line 193 had "History is", so the test could fail before the fix.
  • Codex plugin: no Codex skill mentions history_import or the History tab, so no copy of the install text needs the same fix there.
  • Fail open and data dependence: the new commit changes one skill text, one test, one dead function, and one comment. No request path, component, or stored data changes.
  • I did not run Go builds or tests (not approved for this review).

@vz-ibm vz-ibm 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 (claude, user of @vz-ibm) Claude Code 2.1.310 offload-review skill, @vz-ibm's session resumed 2 of 2 2 of 2 7e7feba50f2a blocking

Verdict: blocking

The fix commit 7e7feba fixes my round-1 finding and both non-blocking points. One clause in the new install-skill text makes a claim that the code does not support. The agent repeats this text to the user. The fix is one line.

Earlier findings

  • Reviewer 2, finding 1 (install skill names History): fixed. skills/install/SKILL.md:193-197 no longer names a tab. The new TestNoSkillMentionsTheRemovedHistoryTab checks every skill in both plugins. Its regex matches line 193 as it was at b7377a4 ("History is"). It does not match the remaining lowercase "history" in the codex skills (cache-campaign, save-more). The glob finds 19 + 16 skills, so the < 10 floor holds. readFileString is in the same package (preset_default_test.go:444).
  • Reviewer 2, non-blocking (installedSkillOwners dead): fixed. The function and its run-on doc paragraph are removed. installedSkills keeps its own doc. os, filepath and dirNames still have other uses in importhistory.go (lines 375-378 and installedSkills), so no import is orphaned.
  • Both reviewers, non-blocking (orphan comment in uicleanup_test.go): fixed. The file now ends after the test.
  • Reviewer 1, non-blocking (the empty state gives no next step): rejected by the author. The reason is that a dashboard reader should not be sent to a terminal command. I accept this reason. The finding was optional.

Findings

  1. context-guru-plugin/skills/install/SKILL.md:194-195 — "a skill already used before install is not reported as unused" is false
    • What fails: a user installs, and the import finds that they used skill X last month. Later, /cg:remove-mcp-and-skills and Cleanup both list X as carried and never called. They do this because the imported use does not count as a call. The agent told the user at install that this would not happen. So the agent's statement is wrong, and the user loses trust in the removal list.
    • Proof:
      • Imported request rows leave Tools at 0 (importhistory.go:317-320, importedEvent).
      • Cleanup and /api/tools read uses only through scopedUses (toolapi.go:708-711). That query keeps only sessions with r.tools > 0, so imported sessions are excluded. buildToolReport then gives X calls == 0.
      • The plugin's unused_items (cgcost.py:363-368) lists every skill with sk["calls"] == 0. The imported use reaches it only through /api/tools/last-used (spendexplain.go:581, all of tool_uses), and only as last. cgcost.py:390-395 then adds a note, "used Nd ago - check first" or "last used Nd ago". The skill stays in the list.
      • So the true behaviour is "the removal advice warns that it was used", not "it is not reported as unused".
    • Fix: make the text say what the code does. For example: "…so on day one Cleanup can tell imported projects from measured ones, and the removal advice warns before it suggests a skill used before install". The coverage half of the sentence is correct (insightsshape.go:202-209, insightsapi.go:80-97).

Non-blocking

  • None.

What I checked

  • Last review: round 1, b7377a4, 2026-10-26T09:42:36Z
  • New commits read: 1 (7e7feba fix(plugin,dash): drop the last pointers to the History tab)
  • Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files)
  • New items since my last review:
    • Commit 7e7feba: read the whole diff (4 files, +28 / −50) and the code around it. See above.
    • Author's reply comment (2026-10-26T09:51:48Z): checked each point against the code. Points 1-4 match the diff. The new test claim (it failed first on "History is") matches the regex and the old line. The "Checks" section reports a local go test run. I cannot run it to confirm it (live tests not approved). The one failure it names, TestCalculatorPricesFromTheRowsModelNotABlend, is in code this PR does not touch.
    • Reviewer 1's round-1 review (09:41:57Z, before my last review): read in full. Its non-blocking points are handled above.
  • Traced how imported tool_uses reach Cleanup (ToolReportFor → scopedUses) and the plugin (tools_doc → /api/tools + /api/tools/last-used → unused_items → cgcost.py:390), to test the new install-skill claim.
  • Fail open and data dependence: no change in this round. The commit touches docs, a test, dead code and a comment only.
  • I did not build or run tests: live tests are not approved for this review.

Review round 2 on #731: the install skill said a skill used before
install "is not reported as unused". That is false. Imported request
rows have Tools = 0, so scopedUses (r.tools > 0) leaves their uses out
and the skill still shows calls 0. What the plugin does is warn: it
reads the imported use through /api/tools/last-used and adds "used Nd
ago - check first" (cgcost.py). The text now says that.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Vitaly Zabershinsky <[email protected]>
@vz-ibm

vz-ibm commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator Author

Reply to review round 2

Reviewer 1: approve. Reviewer 2: one blocking finding. Fixed in f7035f4.

Finding 1 (reviewer 2): "a skill already used before install is not reported as unused" is false

Correct, and fixed. I checked the trace:

  • Imported request rows have Tools = 0 (importedEvent).
  • scopedUses keeps only sessions with r.tools > 0, so imported uses never reach buildToolReport, and the skill keeps calls == 0.
  • The plugin lists it, and reads the imported use only through /api/tools/last-used, as the note "used Nd ago - check first" (cgcost.py:393).

The install skill now says: "the removal advice warns before it lists a skill that was used before install". That is what the code does.

Why my round-1 text was wrong: I relied on TestAnImportedInvocationStopsTheRemovalAdvice. That test skips (t.Skip) whenever the skill is not in the declared inventory, and for imported rows it never is. So it has never asserted its claim. I confirmed it locally: --- SKIP: TestAnImportedInvocationStopsTheRemovalAdvice.

This is a separate defect that existed before this PR. The guard reads as passing, and the behaviour it names ("an imported invocation stops the removal advice") does not hold. I have not fixed it here, because it changes what the advice does, not the History tab. I will raise it with the user as a follow-up.

Checks

  • go test ./context-guru-plugin/ -run 'TestNoSkillMentions|TestTheDashboard': pass.
  • Only SKILL.md text changed in this round.

@vz-ibm vz-ibm 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 (claude, user of @vz-ibm) Claude Code 2.1.310 offload-review skill, @vz-ibm's session resumed 2 of 2 3 of 3 f7035f4582c6 approve

Verdict: approve

Commit f7035f4 fixes my round-2 finding. The install-skill text now matches what the code does. I found no new defects.

Earlier findings

  • Reviewer 2, round 1, finding 1 (install skill names History): fixed in 7e7feba. Confirmed in round 2.
  • Reviewer 2, round 2, finding 1 ("a skill used before install is not reported as unused" is false): fixed. SKILL.md:193-195 now says "the removal advice warns before it lists a skill that was used before install". This is correct:
    • unused_items (cgcost.py:363-368) still lists the skill, because calls == 0.
    • last comes from /api/tools/last-used (spendexplain.go:581). That route reads all of tool_uses, so it includes the imported rows.
    • cgcost.py:390-395 adds "used Nd ago - check first" when the last use is 30 days ago or less (RECENT_USE_DAYS = 30). For an older use it adds "last used Nd ago".
  • Reviewer 2, non-blocking (installedSkillOwners, orphan comment): fixed in 7e7feba.
  • Reviewer 1, non-blocking (the empty state gives no next step): rejected by the author. I accepted the reason in round 2. No change.
  • Reviewer 1, round 2, status note: it said TestAnImportedInvocationStopsTheRemovalAdvice proves the old claim. The author's reply shows that this is wrong, and I agree. See Non-blocking.

Findings

None.

Non-blocking

  • dash/importinvocations_test.go:94-97 — this test never asserts its claim. This is old code, and the author found it. ToolReportFor reads uses only through scopedUses, which keeps only sessions with r.tools > 0. Imported rows have Tools = 0, so the imported skill is never in rep.Skills.Skills, found stays false, and the test always ends in t.Skip. A skip with no linked issue reads as a pass. The author plans a follow-up. Please open an issue for it and link the issue from the skip message, so the gap stays visible.
  • Wording, optional: "warns before it lists" can read as a warning before the list. The code prints the warning in the skill's row. "lists it with a warning" is more exact. The meaning is still true, so this does not block.

What I checked

  • Last review: round 2, 7e7feba, 2026-10-26T09:57:03Z
  • New commits read: 1 (f7035f4 docs(plugin): say what the removal advice really does after an import)
  • Read in full: 4 reviews, 2 comments, 0 inline comments (from the three files)
  • New items since my last review:
    • Commit f7035f4 (1 file, +5 / −4, skills/install/SKILL.md): read the diff and lines 186-198 around it. I checked the new sentence against cgcost.py:344-395 and spendexplain.go:581-601. It is correct.
    • Author's reply to round 2 (2026-10-26T09:58:57Z): checked each point. The trace matches my round-2 proof. The claim that TestAnImportedInvocationStopsTheRemovalAdvice always skips is correct (importinvocations_test.go:76-97 with toolapi.go:708-711 and importhistory.go:317-320). The author keeps the fix out of this PR because it changes behaviour, not the History tab. I accept this. The local test run it reports is not something I can confirm (live tests not approved).
    • Reviewer 1's round-2 review (2026-10-26T09:53:26Z): read in full. Its non-blocking point about the fixed phrase list in TestNoSkillMentionsTheRemovedHistoryTab is fair and acceptable. Its proof for the old install-skill claim is wrong, as the author showed.
  • TestNoSkillMentionsTheRemovedHistoryTab: the new text has no "History" with a capital letter, so the test still passes on it.
  • Fail open and data dependence: this round changes one skill text only. No request path, component or stored data changes.
  • I did not build or run tests: live tests are not approved for this review.

@vz-ibm vz-ibm 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 (claude, user of @vz-ibm) Claude Code 2.1.310 offload-review skill, @vz-ibm's session resumed 1 of 2 3 of 3 f7035f4582c6 blocking

Verdict: blocking

The new text is still wrong. The warning it describes exists in code, but no command a user runs shows it. The fix is to delete one clause.

Findings

  1. context-guru-plugin/skills/install/SKILL.md:194-195 — "the removal advice warns before it lists a skill that was used before install" is false for every removal path a user runs
    • What fails: a user installs. The import finds that they used skill X last month. The agent says, as the skill tells it, that the removal advice will warn about X. Then the user runs /context-guru:insights tools, /context-guru:remove-mcp-and-skills, or opens Cleanup. Each one lists X as never used, with no warning.
    • Proof, path by path:
      • /context-guru:insights tools → cg.py cmd_waste (cg.py:690-711). It calls C.unused_items(tools, last), which keeps "last" on each item. Then it prints only kind, name, dollars and a bar (cg.py:705, 710). It never reads i["last"]. No "check first" note.
      • /context-guru:remove-mcp-and-skills → /api/adapt/tools → AdaptTools (adapttools.go:681). It reads uses through scopedUses (adapttools.go:692), which keeps only sessions with r.tools > 0 (toolapi.go:711). Imported rows have Tools = 0, so the imported use is dropped. LastUsedMS is "always null" (adapttools.go:77-80). The renderer (cg.py:1156-1163) prints "Never used in this window" with no date.
      • Cleanup → ToolReportFor → buildToolReport. lastUsed := lastUsedOf(uses) (toolapi.go:791), and uses comes from scopedUses again. So LastUsedTS is 0 for X, and Cleanup shows "never invoked" (insightsshape.go:482).
      • The only warning is cmd_unused in cgcost.py:377-395. It is reachable only as python3 cgcost.py unused. git grep finds no skill or script that runs it. Its only caller is cost_test.go. cg.py imports cgcost for unused_items, table, spark and similar, never for cmd_unused.
    • This is the same class of defect as reviewer 2's round-2 finding. The text changed from one false claim to another. The author's reply cites cgcost.py:393, which is real code, but no user path reaches it.
    • Fix: delete the clause. For example: "…imported once, so on day one Cleanup can tell imported projects from measured ones; quote history_import_summary=." The coverage half is true (reviewer 2 checked it in round 2; I checked measured_requests in round 1). If you want the warning to be true, that is a code change in cmd_waste and the adapt renderer, and it belongs in the follow-up you named.

Status of earlier findings

  • Reviewer 2, round 1, finding 1 (install skill names History): fixed in 7e7feba. No change since.
  • Reviewer 2, round 2, finding 1 ("is not reported as unused" is false): the old claim is gone, but the new one is also false. See finding 1 above. I agree with the author's trace of scopedUses and Tools = 0.
  • Both reviewers, orphan comment; reviewer 2, dead installedSkillOwners: fixed in 7e7feba.
  • Reviewer 1, empty state next step: rejected by the author. I accepted the reason in round 2.

Non-blocking

  • dash/importinvocations_test.go:91-94 — the test skips, so it never checks its claim. The author found this, and I agree. For imported rows the skill is never in the declared inventory, so the t.Skip branch always runs. The name TestAnImportedInvocationStopsTheRemovalAdvice states behaviour that does not hold. This is older than this PR. Please open an issue and link it, so the skip has a reason and a tracked fix.

What I checked

  • Last review: round 2, 7e7feba, 2026-10-26T09:53:26Z
  • New commits read: 1 — f7035f45 docs(plugin): say what the removal advice really does after an import (1 file, +5 / −4)
  • Read in full: 4 reviews, 2 comments, 0 inline comments (from the three files)
  • New items since my last review:
    • Reviewer 2 round-2 review (09:57:03Z): read it. I checked its trace (importedEvent, scopedUses, unused_items). It is right about the old text. Its proposed new wording is the text the author used, and that text is the subject of my finding 1.
    • Author reply (09:58:57Z): read it. I checked each claim. The scopedUses and Tools = 0 points hold. The cgcost.py:393 warning exists but no user path runs it (finding 1). The skipping-test note holds (non-blocking above).
  • Read install/SKILL.md:180-200 around the change. The rest of the bullet is unchanged and still true.
  • Traced all 3 user-facing removal paths and the one direct CLI path, as listed in finding 1.
  • Confirmed the two cgcost.py copies (plugin and Codex) have no other runner of unused.
  • Fail open and data dependence: no change. The commit changes skill text only.
  • I did not run Go builds or tests (not approved for this review).

Review round 3 on #731: "the removal advice warns before it lists a skill
that was used before install" is false on every path a user runs.
/context-guru:insights tools, /context-guru:remove-mcp-and-skills and
Cleanup all read uses through scopedUses (r.tools > 0), which drops the
imported rows, and none of them prints a last-used note. The one warning
(cgcost.py cmd_unused) is reached only by running `cgcost.py unused`
by hand; no skill or script does.

Keep only the true half: Cleanup can tell imported projects from
measured ones.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Vitaly Zabershinsky <[email protected]>
@vz-ibm

vz-ibm commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator Author

Reply to review round 3

Reviewer 2: approve. Reviewer 1: one blocking finding. Fixed in f7e5055, by your suggested fix.

Finding 1 (reviewer 1): "the removal advice warns before it lists a skill that was used before install" is false for every user path

Correct. I confirmed cmd_unused (the only code that adds "used Nd ago - check first") is reached only by cgcost.py unused run directly. No skill or script runs it. /context-guru:insights tools, /context-guru:remove-mcp-and-skills and Cleanup all read uses through scopedUses (r.tools > 0), which drops imported rows, and none of them prints a last-used note. My round-2 reply cited real code, but no user path reaches it.

Fixed by deleting the clause. The install skill now keeps only the true half: "imported once, so on day one Cleanup can tell imported projects from measured ones". The import's effect on the removal advice is the follow-up already named in this PR thread (count imported uses as calls). It is a code change, not a text change, and it is not part of removing the History tab.

Checks

  • go test ./context-guru-plugin/ -run TestNoSkillMentionsTheRemovedHistoryTab: pass.
  • Only SKILL.md text changed in this round.

The round budget (3) is used. More rounds are the user's decision.

@OsherElhadad OsherElhadad 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.

Review (automated, run with Claude Code). I built and tested the PR head on Linux.

Tests

  • go build ./... and go vet ./...: clean.
  • go test ./dash/... ./proxy/...: all pass, including TestHistoryRouteIsGone. TestCalculatorPricesFromTheRowsModelNotABlend passes on this Linux host, so the main-branch failure you saw may be specific to that machine.
  • TestUISmokeEveryTab: skipped here (no browser or node).
  • go test ./context-guru-plugin/ (with ANTHROPIC_DEFAULT_*_MODEL unset and a private TMPDIR): 2 failures.
    • TestSaveMoreDefaultIncludesTheSettingsCard fails on main too. It depends on the environment and is not from this PR.
    • TestInstallSkillDelegatesRatherThanReimplementing fails on this PR and passes on main. See the inline comment.

Findings

  1. Bug (CI): skills/install/SKILL.md grows from 242 lines to 243 and breaks the length guard in plugin_test.go:7814 (the install skill is 243 lines ... should be well under 242). Details are inline.
  2. Nit: context-guru-plugin/dashboard_test.go:3 still says "The dashboard skill opens the History and Cleanup tabs". This line is outside the diff. It should say Cleanup only.
  3. Suggestion: an old #savings/history bookmark opens the first Savings tab (keep-alive). This happens because FIVE_PAGE_ALIAS is only checked for one-segment hashes (resolveNav in dash/ui/app.js). Nothing breaks, but sending it to Cleanup (history -> insights) would be a better landing for people who had the tab bookmarked. Optional.

Verified clean

  • No History references are left in Go, JS, CSS, HTML, docs, skills, scripts, or the codex-marketplace copy. Only the intentional guard tests and unrelated uses of "history" remain.
  • The assetversion_test.go entry and the index.html script tag are removed.
  • No callers are left for installedSkillOwners, calledAnywhereFor, HistoryDocFor, the History* types or historyCache. The shared helpers are still in use.
  • /api/capture is scopeTenant, the same scope as /api/history was. Hosted 200 and unauthenticated 401 behave the same, so the probe means the same thing. The route has existed since the first dashboard commit, so a new plugin works against an older proxy. The reverse does not work: an old plugin against a new proxy reports "not answering" until the plugin is updated. The removal makes that unavoidable, but a release note would help.
  • The moved tests are byte-identical, apart from the helper rename. The Cleanup empty-state test gained assertions and lost none. The nav-group minimum change from 5 to 4 is correct.

not empty on day one; quote `history_import_summary=`. It shows what was used and when, not what unused
tools cost (only the proxy sees that, from now on). `already_done`/`skipped` need no mention. `failed` is
not an install failure: give `history_import_error=` and offer `history_import_retry=` verbatim.
- `history_import=done` — Claude Code's history from before this install was imported once, so on day one

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.

Bug (CI): this rewrite takes the file from 242 lines to 243. TestInstallSkillDelegatesRatherThanReimplementing (plugin_test.go:7814) fails on this branch and passes on main:

plugin_test.go:7815: the install skill is 243 lines; ... should be well under 242

There are two ways to fix it:

  • Trim this bullet back to 4 lines. For example, merge the already_done/skipped clause into the line before it.
  • Raise the cap to 243 and add a Raised 242 -> 243 comment, like the earlier raises.

The first keeps the guard's intent.

@vz-ibm vz-ibm 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 (claude, user of @vz-ibm) Claude Code 2.1.310 offload-review skill, @vz-ibm's session resumed 1 of 2 4 of 4 f7e505583eb2 blocking

Verdict: blocking

My round-3 finding is fixed. One CI failure stays at this head. @OsherElhadad found it, and I confirm it from the file.

Findings

  1. context-guru-plugin/skills/install/SKILL.md:193-198 — the file is 243 lines, so TestInstallSkillDelegatesRatherThanReimplementing fails. I agree with @OsherElhadad's inline finding. New proof only:
    • What fails: go test ./context-guru-plugin/ fails in CI on this head.
    • Proof: the test counts "\n" in the file and fails when the count is over 242 (plugin_test.go:7814). The line count at each commit (git show <sha>:…/SKILL.md | wc -l; the file ends in \n, so wc -l equals the test's count):
      • base 2b20ef29: 242
      • b7377a4c: 242
      • 7e7feba5: 243 (this commit started the failure)
      • f7035f45: 244
      • head f7e50558: 243
    • I missed this in round 2. The author's checks ran only -run TestNoSkillMentions|TestTheDashboard and -run TestNoSkillMentionsTheRemovedHistoryTab, so they did not run this test either.
    • Fix: trim the history_import=done bullet back to 5 lines. For example, join the last line (`history_import_retry=` verbatim., 35 chars) onto the line before it. This keeps the 242 cap and its intent. The text adds no new script outcome, so raising the cap would go against the rule in the test's comment ("Raise it for a new branch; never to make room…"). Then run the whole go test ./context-guru-plugin/ package, not a -run subset.

Status of earlier findings

  • Reviewer 1, round 3, finding 1 (false removal-advice claim): fixed in f7e5055. The clause is gone. The kept half ("Cleanup can tell imported projects from measured ones") is true.
  • Reviewer 2, round 1 and round 2 findings: fixed (round 2 and round 3, unchanged since).
  • Orphan comment and dead installedSkillOwners: fixed in 7e7feba.
  • Reviewer 1, empty state next step: rejected by the author. I accepted the reason in round 2.
  • Reviewer 2, round 3, wording note ("warns before it lists"): gone with the clause.
  • Skipping TestAnImportedInvocationStopsTheRemovalAdvice (both reviewers, non-blocking): not in this PR. The author names a follow-up. I still ask for a linked issue.

Non-blocking

  • context-guru-plugin/dashboard_test.go:3 — the file header still says "opens the History and Cleanup tabs". I confirm @OsherElhadad's nit. Change it to "opens the Cleanup tab". This is one line, and the same commit can fix it.
  • Old #savings/history bookmark (@OsherElhadad, optional): an alias to Cleanup is a nicer landing. I did not trace resolveNav. Nothing breaks without it, so I leave it to the author.
  • Old plugin against a new proxy (@OsherElhadad): an old dashboard.sh probes /api/history and now reports "not answering". I agree a release note helps.

What I checked

  • Last review: round 3, f7035f4, 2026-10-26T10:18:11Z
  • New commits read: 1 — f7e50558 docs(plugin): drop the false removal-advice claim from the install skill (1 file, +2 / −3)
  • Read in full: 7 reviews, 3 comments, 1 inline comment (from the three files)
  • New items since my last review:
    • Author reply to round 3 (10:19:41Z): read it. The fix matches my proposal. Its checks ran a -run subset only, which is why the line-count failure was not seen (finding 1).
    • @OsherElhadad review (11:13:05Z, on head f7e5055): read it. A person, not a reviewer marker, so I checked each point. Finding 1 (line cap): confirmed, see my finding 1. Finding 2 (dashboard_test.go:3): confirmed, non-blocking. Suggestion 3 (bookmark alias): noted, not traced. The compatibility note on /api/capture matches what I found in round 1 (api.go:793, scopeTenant).
    • @OsherElhadad inline on SKILL.md:193: same as their finding 1. Confirmed.
  • Read install/SKILL.md:180-200 and plugin_test.go:7772-7818 in full around the change.
  • Fail open and data dependence: no change. The new commit changes skill text only.
  • I did not run Go builds or tests (not approved for this review). The line counts above come from git show and wc -l.

@vz-ibm vz-ibm 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 (claude, user of @vz-ibm) Claude Code 2.1.310 offload-review skill, @vz-ibm's session resumed 2 of 2 4 of 4 f7e505583eb2 blocking

Verdict: blocking

The text in commit f7e5055 is now true. But CI fails on this head, and this PR causes the failure. OsherElhadad found it. I confirmed it in the CI log. The fix is one line.

Earlier findings

  • Reviewer 2, round 1, finding 1 (install skill names History): fixed in 7e7feba.
  • Reviewer 2, round 2, finding 1 ("is not reported as unused" is false): fixed. That clause is gone.
  • Reviewer 1, round 3, finding 1 ("the removal advice warns" is false): fixed in f7e5055. The clause is deleted. My round-3 approval of that text was wrong. I checked only cmd_unused in cgcost.py. Reviewer 1 is right:
    • cmd_waste (cg.py:690-711) calls unused_items, but prints only kind, name, dollars and the command. It never reads i["last"].
    • The only callers of cmd_unused are the cgcost.py unused CLI (cgcost.py:512-516) and cost_test.go. No skill or script runs it.
    • The text that is left ("Cleanup can tell imported projects from measured ones") is true. I checked it in round 2 (insightsshape.go:202-209, insightsapi.go:80-97).
  • Both reviewers, orphan comment; reviewer 2, dead installedSkillOwners: fixed in 7e7feba.
  • Reviewer 1, empty state next step: rejected by the author. I accepted the reason in round 2.
  • OsherElhadad's review (11:13:05Z): the author has not replied yet. See finding 1 and the non-blocking points.

Findings

  1. context-guru-plugin/skills/install/SKILL.md:193-197 — the file is 243 lines, and the length guard allows 242. CI build-test fails. (Agree with OsherElhadad, finding 1. Here is the extra proof.)
    • What fails: TestInstallSkillDelegatesRatherThanReimplementing fails, so CI is red and the PR cannot merge as it is.
    • Proof:
      • Line counts of the file: base 242, b7377a4 242, 7e7feba 243, f7035f4 244, head f7e5055 243. The guard is plugin_test.go:7814, n > 242.
      • CI run 40306511110 is for head f7e505583eb2. Its log: --- FAIL: TestInstallSkillDelegatesRatherThanReimplementing and plugin_test.go:7815: the install skill is 243 lines; ... should be well under 242. This is the only FAIL in the log.
      • The author's replies ran only -run TestNoSkillMentions...|TestTheDashboard. That is why the local runs did not show the failure.
    • Fix: trim the bullet by one line, for example join lines 195-196. That keeps the guard's intent. Do not raise the cap: the comment at plugin_test.go:7801-7802 says to raise it only for a new branch, and this change adds no branch.

Non-blocking

  • context-guru-plugin/dashboard_test.go:3 — the file header still says "opens the History and Cleanup tabs". (Agree with OsherElhadad, finding 2.) Line 3 at this head says that. It should say Cleanup only.
  • Correction to my round-1 review. I wrote that an old #savings/history link opens Overview. That is wrong, and Osher is right. resolveNav (app.js:5019-5028) gets no match for history. The alias map applies only to one-segment hashes (line 5024). So the link falls through to firstView('savings'), the first Savings tab. Nothing breaks. Osher's optional alias to insights would be a better landing.
  • dash/importinvocations_test.go:91-97 — the test always skips. From round 3, still open. It needs a linked issue.

What I checked

  • Last review: round 3, f7035f4, 2026-10-26T10:12:42Z
  • New commits read: 1 (f7e5055 docs(plugin): drop the false removal-advice claim from the install skill)
  • Read in full: 7 reviews, 3 comments, 1 inline comment (from the three files)
  • New items since my last review:
    • Commit f7e5055 (1 file, +2 / −3): read the diff and install/SKILL.md:186-198 around it. The text is true. The line count is the defect in finding 1.
    • Reviewer 1's round-3 review (10:18:11Z): read in full. I checked its trace of cmd_waste and cmd_unused. It is correct, and my round-3 approval was wrong (see above).
    • Author's reply to round 3 (10:19:41Z): checked each point against the diff. The fix matches the reviewer's proposed fix.
    • OsherElhadad's review (11:13:05Z) and inline comment on SKILL.md:193: checked each point. Finding 1 is confirmed by the CI log and by line counts (finding 1). Finding 2 is confirmed at dashboard_test.go:3. Finding 3 is confirmed in resolveNav, and it corrects my round 1. I cannot check their Linux test results, other than the CI log. Their point about an old plugin with a new proxy is correct: the old dashboard.sh probes /api/history, which now returns 404, so it reports "not answering". A release note would help.
  • gh pr checks 731: build-test fails; build, purego, trivy and DCO pass.
  • Fail open and data dependence: no change in this round. The commit changes skill text only.
  • I did not build or run tests: live tests are not approved for this review. I read the CI log only.

… links to Cleanup

Review round 4 on #731 and a teammate review:

- skills/install/SKILL.md had grown to 243 lines, past the 242 cap in
  TestInstallSkillDelegatesRatherThanReimplementing, which broke CI. The
  history_import bullet is back to 4 lines, as on main. The text adds no
  new script outcome, so the cap stays.
- An old #savings/history bookmark opened the first Savings tab
  (keep-alive). resolveNav now maps a removed view to the tab that
  answers the same question: history -> insights (Cleanup), at any hash
  depth. navhash.test.mjs covers #/savings/history, #savings/history and
  #history.
- dashboard_test.go's header said the skill opens History and Cleanup.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Vitaly Zabershinsky <[email protected]>
@vz-ibm

vz-ibm commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator Author

Reply to review round 4 and to @OsherElhadad's review

Both reviewers and Osher found the same CI failure. All fixed in e4f834d.

1. The install skill is 243 lines and breaks the 242 cap (both reviewers, Osher)

Correct, and my mistake. I ran only -run subsets of the plugin package, because the full package exceeds Go's default 10-minute timeout on this Mac, so this test never ran locally.

Fixed by trimming, not by raising the cap. The history_import=done bullet is back to 4 lines, as on main. skills/install/SKILL.md is 242 lines again. The text adds no new script outcome, so per the test's own comment the cap stays at 242.

Now checked with the full package. I ran go test -timeout 20m ./context-guru-plugin/ (CI's timeout, with the host's ANTHROPIC_DEFAULT_*_MODEL unset). TestInstallSkillDelegatesRatherThanReimplementing passes. Of the remaining failures on this Mac:

  • 10 also fail on clean main (06b40ed) here, checked by running the same 10 there. They are install and setup tests that find this host's real ~/.local/bin/context-guru-proxy, or compare /var with /private/var.
  • 1 is flaky: TestTheConfiguredPortCanActuallyBeHonoured ("the proxy did not come up on port …") failed once in the full run, under load. It passed 3 times out of 3 when run alone. It tests start-proxy.sh, which this PR does not touch.

2. dashboard_test.go:3 still says "History and Cleanup" (Osher; reviewer 2 non-blocking)

Fixed. It now says "opens the Cleanup tab".

3. An old #savings/history bookmark lands on keep-alive (Osher, suggestion)

Done. resolveNav (app.js) now maps a removed view to the tab that answers the same question: REMOVED_VIEW = { history: 'insights' }. It matches the last segment at any depth, so #/savings/history, #savings/history and #history all open Cleanup.

Test: three cases in dash/navhash.test.mjs (run by TestNavHashCompatibility through node --test). It failed first with actual: 'keepalive', expected: 'insights'. All 10 node tests now pass.

Reviewer 2's correction (the link opened the first Savings tab, not Overview) is right. My PR description said keep-alive, and that is what happened until this change.

Still open, not in this PR

  • TestAnImportedInvocationStopsTheRemovalAdvice always skips (reviewer 2). It is a separate defect that existed before this PR: imported uses never count as calls. I will open an issue and link it here.

Checks

  • go build ./... and make lint: clean.
  • go test ./dash/ -run 'TestNavHash|TestHistoryRouteIsGone' and node --test dash/navhash.test.mjs: pass.
  • Full plugin package: see section 1.

Osher, thank you for the Linux run. It also showed that TestCalculatorPricesFromTheRowsModelNotABlend is specific to this Mac.

@vz-ibm
vz-ibm requested a review from OsherElhadad October 26, 2026 12:29

@vz-ibm vz-ibm 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 (claude, user of @vz-ibm) Claude Code 2.1.310 offload-review skill, @vz-ibm's session resumed 2 of 2 5 of 5 e4f834d2786e approve

Verdict: approve

Commit e4f834d fixes the CI failure and both of OsherElhadad's other points. CI is green on this head. I found no new defects.

Earlier findings

  • Reviewer 2 and reviewer 1, round 4, finding 1 (install skill is 243 lines, past the 242 limit): fixed.
    • wc -l gives 242, and the file ends in \n, so the test's count is also 242.
    • The history_import= bullet is 4 lines again, as on base. The limit stays at 242, as the test comment asks.
    • CI run 40317000121 is for head e4f834d2, and its conclusion is success. build-test passes, so TestInstallSkillDelegatesRatherThanReimplementing passes.
  • OsherElhadad, finding 2 (dashboard_test.go:3 header names History): fixed. It now says "opens the Cleanup tab".
  • OsherElhadad, suggestion 3 (old #savings/history bookmark): done. See "What I checked".
  • Reviewer 2, rounds 1-2; reviewer 1, round 3; orphan comment; installedSkillOwners: fixed in earlier rounds. No change since.
  • Reviewer 1, empty state next step: rejected by the author. I accepted the reason in round 2.
  • TestAnImportedInvocationStopsTheRemovalAdvice always skips (both reviewers, non-blocking): not in this PR. The author says they will open an issue and link it. The defect is older than this PR, so I accept this.

Findings

None.

Non-blocking

  • dash/navhash.test.mjs:222-224 does not prove that insights is a real view. navFromSource mounts only tools.js, kvcache.js and campaigns.js (line 40), not insights.js. resolveNav returns REMOVED_VIEW[view] without a check against GROUP_OF. So the 3 cases pass even if Cleanup's view is renamed. In that case, go() would send an old bookmark to Overview, and nothing would fail. This risk is small. A one-line test that REMOVED_VIEW's targets are in loaders would close it.
  • Old plugin with a new proxy (OsherElhadad): an old dashboard.sh checks /api/history, which now returns 404. A release note would help.

What I checked

  • Last review: round 4, f7e5055, 2026-10-26T11:26:47Z
  • New commits read: 1 (e4f834d fix(plugin,dash): keep the install skill at its cap; send old History links to Cleanup)
  • Read in full: 9 reviews, 4 comments, 1 inline comment (from the three files)
  • New items since my last review:
    • Commit e4f834d (4 files, +12 / −5): read the whole diff and the code around each change. See below.
    • Reviewer 1's round-4 review (11:25:52Z): read in full. Its finding is the same as mine, and it is now fixed.
    • Author's reply to round 4 and to OsherElhadad (11:42:16Z): checked each point against the diff and CI. Points 1-3 match the code. The author explains that their local runs left out the length test because the full package passes Go's default 10-minute timeout. They then ran the package with -timeout 20m. I cannot check their Mac failure list (live tests not approved). CI on Linux passes, so none of those failures shows there.
  • resolveNav (app.js:5019-5031):
    • The removed-view check runs after GROUP_OF.has(view) and before the alias and group fallbacks.
    • So #history, #savings/history and #/savings/history all give insights, and a live view named history would still win.
    • go() (app.js:4768-4778) then checks loaders.insights (present) and the tab's reachable(). If Cleanup is hidden or locked for this account, go() sends the user to Overview, as for any other view. Nothing new fails.
  • SKILL.md:193-196: the 4-line text is the same as at f7e5055, with new line breaks only. It still names no tab, so TestNoSkillMentionsTheRemovedHistoryTab passes.
  • gh pr checks 731: build-test, build, purego, trivy and DCO pass. deploy was skipped.
  • Fail open and data dependence: no change. The commit changes a UI hash alias, a test, a comment and skill text.
  • I did not build or run tests: live tests are not approved for this review. I read the CI status only.

@vz-ibm vz-ibm 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 (claude, user of @vz-ibm) Claude Code 2.1.310 offload-review skill, @vz-ibm's session resumed 1 of 2 5 of 5 e4f834d2786e approve

Verdict: approve

Commit e4f834d fixes the CI failure and both of @OsherElhadad's other points. CI is green on this head. I found no new defects.

Findings

None.

Status of earlier findings

  • Reviewer 1 and reviewer 2, round 4, finding 1 (install skill is 243 lines, over the 242 cap): fixed. wc -l gives 242 at this head, and the file ends in \n, so the test's count is 242 too. The cap is not raised. CI run 40317000121 is for head e4f834d2786e. Its build-test job passes: ok github.com/rossoctl/context-guru/context-guru-plugin 364.365s. The log has no --- FAIL.
  • @OsherElhadad finding 2 / reviewer 2 non-blocking (dashboard_test.go:3 names History): fixed. It now says "opens the Cleanup tab".
  • @OsherElhadad suggestion 3 (old #savings/history bookmark): done. See "What I checked".
  • Reviewer 1, round 3 (false removal-advice claim): fixed in f7e5055. The kept text is unchanged in meaning; only the line breaks moved.
  • Reviewer 2, rounds 1 and 2; orphan comment; dead installedSkillOwners: fixed in earlier commits. No change since.
  • Reviewer 1, empty state next step: rejected by the author. I accepted the reason in round 2.
  • TestAnImportedInvocationStopsTheRemovalAdvice always skips (both reviewers, non-blocking): out of scope for this PR. The author will open an issue and link it here. That link is still missing.

Non-blocking

  • The author's reply lists 10 plugin tests that fail on this Mac and on clean main. Those failures depend on the host (a real ~/.local/bin/context-guru-proxy, /var against /private/var). CI on Linux passes the whole package, so they do not block. They can make local runs hard to read. A separate issue would help.
  • Please link the skip issue before merge, so the reason the test skips has a tracked fix.

What I checked

  • Last review: round 4, f7e5055, 2026-10-26T11:25:52Z
  • New commits read: 1 — e4f834d2 fix(plugin,dash): keep the install skill at its cap; send old History links to Cleanup (4 files, +12 / −5)
  • Read in full: 9 reviews, 4 comments, 1 inline comment (from the three files)
  • New items since my last review:
    • Reviewer 2 round-4 review (11:26:47Z): read it. Its finding 1 is the same as mine. Its correction to its own round 1 (the bookmark opened the first Savings tab, not Overview) matches the resolveNav code at f7e5055.
    • Author reply (11:42:16Z): read it. I checked each claim. The line count, the header text and the REMOVED_VIEW change match the diff. CI confirms the plugin package passes. I cannot check the local Mac runs it reports.
  • resolveNav change (dash/ui/app.js:5019-5031):
    • The check runs after GROUP_OF.has(view), so a real view named history would still win. No current view has that name.
    • It runs before the one-segment FIVE_PAGE_ALIAS check and before the group fallback. So #history, #savings/history and #/savings/history all return insights. parseURL strips the leading # and / before it calls resolveNav.
    • insights is a real view. insights.js:34 mounts it in group savings with label "Cleanup".
    • REMOVED_VIEW[view] is a plain object lookup. A hash segment such as constructor would hit Object.prototype. But that was already true of FIVE_PAGE_ALIAS[seg[0]], and go() with an unknown view falls back to Overview. No new risk.
  • New JS test (dash/navhash.test.mjs:221-224): 3 cases, one per hash form. The test loads the real app.js and builds the nav from index.html and the views' mountTab calls. TestNavHashCompatibility (dash/navhash_test.go) runs it through node --test and skips loudly when node is absent. In CI the dash package passes (ok … dash 418.825s). I did not check that node is on the CI runner, so I cannot say for sure that this JS test ran there.
  • Install skill (SKILL.md:193-196): read the bullet in full. The text is the same as at f7e5055, with the line breaks moved. Nothing true became false.
  • gh pr checks 731: build-test, build, purego, trivy and DCO pass; deploy is skipped.
  • Fail open and data dependence: no change. The commit changes a UI hash alias, a JS test, skill text and a comment.
  • I did not run Go builds or tests (not approved for this review). I read the CI log only.

Review round 5 on #731 (non-blocking): the three #savings/history cases
passed even if Cleanup's view were renamed, because resolveNav returns a
REMOVED_VIEW target without checking it.

- A new assertion checks every REMOVED_VIEW target is in GROUP_OF. With
  the target renamed to a view that does not exist, it fails.
- The guard first failed on the real code: the harness never mounted
  insights.js, so Cleanup was not a known view here. insights.js is now
  mounted like the other self-mounting views, and the view count is 17
  (13 in index.html and 4 self-mounted), not 16.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Vitaly Zabershinsky <[email protected]>
@vz-ibm

vz-ibm commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator Author

Reply to review round 5

Both reviewers approve. I addressed the non-blocking notes:

navhash.test.mjs does not prove insights is a real view (reviewer 2)

Correct, and it found a gap that already existed. Fixed in ee55ff4.

  • A new assertion checks that every REMOVED_VIEW target is in GROUP_OF.
  • The guard failed on the real code first. The harness never mounted insights.js, so Cleanup was never a known view in this test (this was already so on main). insights.js is now mounted like tools.js, kvcache.js and campaigns.js.
  • The pinned view count is now 17 (13 in index.html plus 4 self-mounted), not 16. It read 16 only because Cleanup was missing.
  • I checked that the guard can fail: with the target renamed to insightsX, the node test fails. With the real code it passes 10 of 10.

Link the skip issue before merge (reviewer 1)

Changed plan, so no issue. The user decided to remove the history import completely, in a follow-up PR after this one. With the History tab gone, nothing reads imported history for the user's benefit, and the reader that would help (call counts) never worked (scopedUses drops imported sessions). That follow-up deletes TestAnImportedInvocationStopsTheRemovalAdvice together with the importer, and deletes existing imported rows on upgrade. I will link the follow-up PR here when it is open.

Old plugin with a new proxy (reviewer 2, from @OsherElhadad)

Accepted, for the release notes. An older dashboard.sh probes /api/history, which now returns 404, so /context-guru:dashboard would report "the proxy is not answering" until the plugin is updated. The plugin and proxy update together through the marketplace, so the window is short. The release note should say to update the plugin.

Mac-only plugin failures (reviewer 1)

Noted. They depend on the host (a real ~/.local/bin/context-guru-proxy, /var against /private/var). CI on Linux passes the whole package.

Checks

  • node --test dash/navhash.test.mjs: 10 of 10 pass.
  • go test ./dash/ -run 'TestNavHash|TestHistoryRouteIsGone|TestEverySelfMounted': pass.
  • Only dash/navhash.test.mjs changed in this round.

@OsherElhadad
OsherElhadad merged commit e6e7f90 into main Oct 26, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from New/ToDo to Done in Rossoctl Issue Prioritization Oct 26, 2026
@OsherElhadad
OsherElhadad deleted the feat/remove-history-tab branch October 26, 2026 13:31
@vz-ibm vz-ibm mentioned this pull request Oct 26, 2026
1 task done
vz-ibm added a commit that referenced this pull request Oct 28, 2026
Data dependence: Context Guru stores less. The dashboard no longer copies
request rows from Claude Code's session files on the user's disk; old
imported rows are deleted when the database opens. No row of
docs/data-dependence.md changes Kind or level: the import was never listed
there. The Dashboard database row now states what it still reads from disk
(the working folder, for the project picker; skill descriptions) and that
it stores neither.

With the History tab gone (#731), nothing read imported history for the
user's benefit. Every remaining reader worked around the import itself,
and the one that would have helped (call counts) never worked: scopedUses
drops sessions with tools = 0, which every imported session has. The
import cost install time, mixed transcript spend into the Overview and
Requests totals, and never expired.

Removed:
- The importer (importhistory.go), its command (importhistorycmd.go,
  cmd/cg-import-history) and the imported-invocation folder repair
  (backfilluseproject.go).
- install.sh's route_import_history step, the install skill's
  history_import bullet, and the line cap raised for it (242 -> 238).
- Cleanup's workarounds: the "Nothing measured" empty state, the
  insights Coverage field, CoverageFor, and the measured=1 picker filter
  (Filter.Source, Filter.SourceMeasured).
- The retention prune's exception for imported rows.
- TranscriptFiles, whose only callers were the importer and backfill.

Kept:
- `context-guru-proxy import-history` as a no-op that exits 0: an older
  install.sh still runs it, and the name must not fall through and start
  serving.
- The transcript reader (projectgroups uses it for the project picker),
  cg-backfill-project (fills the project of measured rows), and the
  requests.source column (old databases have it).
- The empty-timeline crash guards, re-seeded without an import, and the
  tool_uses.project migration tests, seeded through the table's key.

Added:
- purgeImportedHistory: once, recorded in meta, after additiveDDL2 on
  both open paths, so trg_tool_inventory_gc clears an imported-only
  session's declarations and uses. It never fails Open: an error is
  logged and retried on the next open (a failed Open would send the
  recorder to an in-memory dashboard), and the marker is INSERT OR IGNORE
  so two processes opening one old database do not collide. A session that began before the proxy
  keeps the import's calls, which were merged into the same tool_uses
  rows with no marker.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Vitaly Zabershinsky <[email protected]>

Signed-off-by: Vitaly Zabershinsky <[email protected]>
Signed-off-by: Vitaly Zabershinsky <[email protected]>
vz-ibm added a commit that referenced this pull request Oct 28, 2026
Data dependence: Context Guru stores less. The dashboard no longer copies
request rows from Claude Code's session files on the user's disk; old
imported rows are deleted when the database opens. No row of
docs/data-dependence.md changes Kind or level: the import was never listed
there. The Dashboard database row now states what it still reads from disk
(the working folder, for the project picker; skill descriptions) and that
it stores neither.

With the History tab gone (#731), nothing read imported history for the
user's benefit. Every remaining reader worked around the import itself,
and the one that would have helped (call counts) never worked: scopedUses
drops sessions with tools = 0, which every imported session has. The
import cost install time, mixed transcript spend into the Overview and
Requests totals, and never expired.

Removed:
- The importer (importhistory.go), its command (importhistorycmd.go,
  cmd/cg-import-history) and the imported-invocation folder repair
  (backfilluseproject.go).
- install.sh's route_import_history step, the install skill's
  history_import bullet, and the line cap raised for it (242 -> 238).
- Cleanup's workarounds: the "Nothing measured" empty state, the
  insights Coverage field, CoverageFor, and the measured=1 picker filter
  (Filter.Source, Filter.SourceMeasured).
- The retention prune's exception for imported rows.
- TranscriptFiles, whose only callers were the importer and backfill.

Kept:
- `context-guru-proxy import-history` as a no-op that exits 0: an older
  install.sh still runs it, and the name must not fall through and start
  serving.
- The transcript reader (projectgroups uses it for the project picker),
  cg-backfill-project (fills the project of measured rows), and the
  requests.source column (old databases have it).
- The empty-timeline crash guards, re-seeded without an import, and the
  tool_uses.project migration tests, seeded through the table's key.

Added:
- purgeImportedHistory: once, recorded in meta, after additiveDDL2 on
  both open paths, so trg_tool_inventory_gc clears an imported-only
  session's declarations and uses. It never fails Open: an error is
  logged and retried on the next open (a failed Open would send the
  recorder to an in-memory dashboard), and the marker is INSERT OR IGNORE
  so two processes opening one old database do not collide. A session that began before the proxy
  keeps the import's calls, which were merged into the same tool_uses
  rows with no marker.

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

Signed-off-by: Vitaly Zabershinsky <[email protected]>
Signed-off-by: Vitaly Zabershinsky <[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