Repository navigation
feat: /savings, a Databricks savings check beside the chat (1.9.0) - #35
shreyastelkar wants to merge 104 commits into
Conversation
- `hooks/features/savings.tsx`: `/savings [connection]` runs altimate-code's `finops_databricks_savings` tool through `runTool` with `ALTIMATE_TELEMETRY_DISABLED=true` and draws the findings, evidence and monthly ranges in a pane beside the chat; nothing enters the conversation - the plugin holds no detector logic: altimate-code measures the facts and altimate-core decides the savings - refusals are explained with the step that fixes them: no altimate-code, an altimate-code without the tool, no Databricks connection, a connection that is not a SQL warehouse, a refused system-table query - `runTool`/`runAltimate` take an optional environment for one CLI run - registered in `features/index.ts` like the other features; README, PRIVACY, SKILL tool table, CHANGELOG, version 1.8.0 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…iew fixes - each finding gets "Draft the fix": it fills the prompt box with the change to make (serverless, or the smaller `cluster_size`) for Claude to draft against the repo's bundle or Terraform, or as `databricks warehouses edit` JSON; nothing is sent until the person presses Enter - editing a bundle, `resources/*.yml` or Terraform file, or running a `databricks` warehouses/clusters/bundle/jobs command, shows a band: the flagged warehouse's saving when the file names it, else a once-a-session offer of /savings; Run /savings and Hide buttons; nothing runs by itself - the savings run uses `--no-daemon`: a reused tool daemon keeps the environment it started with, so the telemetry opt-out could be lost - a non-Databricks connection and a warehouse not yet in `system.compute.warehouses` get their own recovery steps - PRIVACY: change-log entry and revision date Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… saved - reads altimate-code's combined report: idle all-purpose clusters and jobs on all-purpose compute beside the two warehouse checks, each with its own evidence lines and Draft the fix request (auto-termination, a job cluster), and names any check the connection could not read - what if: each flagged warehouse gets a row of buttons (serverless and every smaller size, marked when too small); pressing one says what it would cost a month and whether its cores cover what its queries need - saved since: the first run that flags a warehouse keeps its size, type and weekly cost in the local plugin store; a later run that finds it resized says what it cost a month then and now - README, CHANGELOG and PRIVACY describe the four checks and the local store Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rite Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ength - No findings with a check skipped says which checks ran, in the pane and the toast. - Draft the fix with no prompt box says what to ask Claude, instead of pointing at text the pane does not show. - The band offers /savings for any `databricks` warehouses/clusters/bundle/jobs command, also after `cd … &&` or an environment assignment; its Run button never starts a second run. - A finding is named in a file only as a whole word (`dev` is not in `devices`). - Days come from the report's window, not a fixed seven; the refused-query advice names `system.lakeflow`; a query cut at 10,000 rows is named in the pane (view shape bumped). - Tests for each, including that a second run keeps the first baseline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fers - A what-if choice that costs more than now says how much more, in the warning colour. - The band offers the check for Terraform only when it names a `databricks_` resource, and names a flagged job by its name, not its numeric id. - The running pane says Databricks starts the SQL warehouse if it is stopped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The pane counts the workspaces it read, names each finding's workspace when there are several, and the fix request names it. - A failed run also comes as a notice, for a terminal too narrow for the pane. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…no answer" - `runTool` hands back the CLI's raw output as `raw` when it is not the answer object. - /savings reads an old CLI's usage banner as "this altimate-code has no Databricks savings check". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Incremental review of Files Reviewed (1 file)
Tests were not executed in this read-only review. Previous Review Summaries (11 snapshots, latest commit 6894cb3)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 6894cb3)Status: No Issues Found | Recommendation: Merge Incremental review of Files Reviewed (1 file)
Tests were not executed in this read-only review. Previous review (commit f2f9802)Status: 1 Issue Found | Recommendation: Address before merge Incremental review of Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (2 files)
Tests were not executed in this read-only review. Fix these issues in Kilo Cloud Previous review (commit de3e39b)Status: 1 Issue Found | Recommendation: Address before merge Incremental review of Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (2 files)
Tests were not executed in this read-only review. Fix these issues in Kilo Cloud Previous review (commit bf27d26)Status: 2 Issues Found | Recommendation: Address before merge Incremental review of Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (2 files)
Tests were not executed in this read-only review. Previous review (commit 6be4309)Status: 2 Issues Found | Recommendation: Address before merge Incremental review of Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (3 files)
Tests were not executed in this read-only review. Fix these issues in Kilo Cloud Previous review (commit 138a666)Status: 3 Issues Found | Recommendation: Address before merge Incremental review of Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (3 files)
Tests were not executed in this read-only review. Fix these issues in Kilo Cloud Previous review (commit 65b868b)Status: 3 Issues Found | Recommendation: Address before merge Incremental review of Three suggestions remain, all in the new reader or its tests. The one that can lose a real file: the string scan ends at the first unescaped Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (2 files)
Tests were not executed in this read-only review. Fix these issues in Kilo Cloud Previous review (commit 2f1e9c1)Status: 3 Issues Found | Recommendation: Address before merge Incremental review of One new WARNING: the de-duplicated Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (4 files)
Tests were not executed in this read-only review. Fix these issues in Kilo Cloud Previous review (commit 56647c7)Status: 5 Issues Found | Recommendation: Address before merge Incremental review of The five suggestions are maintainability and test-coverage points: the duplicated path match, the repeated baseline literal, a stacked type doc, the /clear guard sitting outside the awaited band/what-if writes, and the new "everywhere" test not asserting the evidence lines. Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (7 files)
Tests were not executed in this read-only review. Fix these issues in Kilo Cloud Previous review (commit a474758)Status: No Issues Found | Recommendation: Merge Incremental review of Checked the new guard's edges against Tests were not executed in this read-only review. Files Reviewed (2 files)
Previous review (commit ab0faec)Status: 1 Issue Found | Recommendation: Address before merge Incremental review of One consistency gap remains in that new guard: it accepts only a number, while every other figure helper in the module (and the tested numeric-string handling) accepts a numeric string. Tests were not executed in this read-only review. Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (5 files)
Fix these issues in Kilo Cloud Additional previous summary content was truncated to keep this comment within platform limits. Reviewed by deepseek-v4.1-flash-1017 · Input: 54.2K · Output: 5.2K · Cached: 339.2K |
`/savings` set only `ALTIMATE_TELEMETRY_DISABLED`, which still lets the CLI send its one-time telemetry opt-out event and fetch the model catalog and ripgrep. The run now also sets `ALTIMATE_ASSESSMENT_MODE=true`, so the Databricks warehouse is the only host it reaches. An altimate-code without assessment mode ignores the variable. PRIVACY.md and the changelog state this, the window the cost covers, and what is not assessed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…they show Each amount was rounded on its own: whole dollars from $100, cents below. A line comparing $125.50 with $19.05 read "$19.05 a month instead of $126, $106 less". `compared()` formats both amounts and their gap at one precision, to the cent when either is under $100, and takes the gap from the amounts it shows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lagged setting The cluster request named `databricks clusters edit <id> --json`, which the CLI rejects (cluster_id and spark_version go in the JSON) and which replaces the whole configuration. The job request named `databricks jobs reset <id> --json`: `reset` takes no id and overwrites every job setting. They now name `clusters update --json` with an update mask, and `jobs update --json` with job_id and the whole tasks list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…wording `compared()` used whole dollars whenever both amounts were $100 or more, so $300.40 against $300.20 read "$300 instead of $300, $0 less". It now keeps cents when the gap itself is under $100. The jobs draft no longer says `jobs update` replaces each field it names: it changes only the settings it is given. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nged task whole A task given to `jobs update` replaces that whole task, so a draft holding only the new cluster would drop the task's notebook, libraries and retries. The draft now asks Claude to start from `databricks jobs get <id>` and give each changed task whole, with only its cluster changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`runTool` keeps main's first-line text for a failure with no answer object and this branch's `raw` (the whole output); main's test now expects `raw` too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…first line Since `runTool` returns only the first line of a failure's output as text, an altimate-code too old for `tool run` (exit 1, its banner and usage on stderr) read as a generic failure. The pane now checks the whole output (`raw`) for the usage and shows "has no Databricks savings check". The test feeds the old CLI's real output through the CLI helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ichandann
left a comment
There was a problem hiding this comment.
Reviewed bbe331096e24fc79e672fa39a91bf1722bdd95ca. Requesting changes for the unmet assessment-mode compatibility boundary below, which is also identified as a pre-merge dependency in the PR body.
The new savings flow correctly passes both environment switches, uses the CLI directly with --no-daemon, rejects connection-name flag injection, keeps findings in the pane, and fills rather than submits Draft the fix. I read the full changed source and tests, the integration wiring, privacy text and prior review responses. The documented CLI commands preserve fields for cluster/job changes; the cosmetic/unused-field and band-matching suggestions are non-blocking. Cross-workspace baseline-key scoping remains a follow-up.
Validation: the complete plugin test run finished with 506 passes and one failure in the unchanged 500-node lineage timing assertion (368 ms against a 300 ms limit), 70.55 s wall. An isolated actual-base run of that unchanged file passed all 30 tests, with that case at 75 ms; this is not evidence that the full base suite passes or that no regression exists. Both strict plugin validators and both shell suites pass. A separate focused copy passed all 39 existing savings tests and two new controls, with one expected negative failure: an unsupported CLI is invoked before the compatibility refusal (11.98 s wall on repeat). The probe mocks process creation; the old release's opt-out path was confirmed by source inspection, not a live telemetry request. The engine also logs missing ui.status implementations in the reused test helper; the negative assertion itself is the observed invocation count (expected 0, actual 1).
Current GitHub shell/security/review checks report success; no required contexts are reported. I did not connect to Databricks, replay the private recording, install/run an old CLI, validate production savings, send telemetry, or test a live Claude model turn. The dependency on code #1762/core #785 and a compatible released CLI remains material. No author source edit, commit, push, merge or deployment was performed.
Reviewed by Codex on behalf of @ichandann.
…altimate-code Up to 0.12.11 altimate-code has neither the savings tool nor assessment mode, so its `tool run` sent the one-time telemetry opt-out event before failing, while the pane says nothing is sent. `/savings` now runs `altimate --version` first (measured on 0.12.11 against a local telemetry listener: `--version` sends nothing; `tool run` sends the opt-out event) and starts the check only on 0.12.12 or later, or a source build (`local`). A version it cannot read is refused. README, CHANGELOG and PRIVACY.md say so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@ichandann Thanks for the review. The compatibility boundary is now enforced before launch, in 38066b2 (details on the inline thread):
The remaining dependency is unchanged. The minimum gets set to the published altimate-code release that carries the tool and assessment mode before this merges, and the PR is held until then. I did not change the cross-workspace baseline key or the non-blocking suggestions in this round. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ichandann
left a comment
There was a problem hiding this comment.
Re-reviewed 5f52bdb2ac70bfb3dd46e7303406d7c40efd5efa against the previous reviewed head bbe331096e24fc79e672fa39a91bf1722bdd95ca. The numbered-release preflight now addresses the original normal-install launch path: 0.12.11 is refused before tool run, with both environment switches on the version probe. The serverless scope wording also now matches the implementation. Requesting changes for the remaining unknown-source-build bypass below.
Independent validation: all 509 plugin tests passed (37.72 s wall), and both strict validators passed. An isolated exact-head overlay ran the 41 savings tests plus three independent controls: 43 passed, one expected negative failed because local launches the unsupported tool (9.61 s). A separate copy changing only the unknown-local guard passed all three independent controls (1.00 s). Earlier tests' ui.status-helper logs are retained; the negative result is the observed process count, not a UI-helper exception. The old source's version fallback and opt-out path were inspected; no actual old CLI or telemetry sink was run by this review.
All current GitHub checks are successful; no required contexts are reported. The published assessment-compatible CLI dependency and minimum-version pin remain an explicit owner hold. This review does not clear code #1762's missing-core-export/cost-gate findings, core #785's owner/spec gate, actual savings accuracy, a private recording, model turns or live Databricks/telemetry. No author source edits, commits, pushes, merges or deployments were made.
Reviewed by Codex on behalf of @ichandann.
…t mode A source build prints `local` for `--version` whatever its age, so an old checkout without assessment mode passed the check and its `tool run` could still send the one-time telemetry opt-out event. `local` is now refused like an unreadable version, with a message to use a released altimate-code; a build made with the release script carries its version. README, CHANGELOG and PRIVACY.md say so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The older compatibility and spend-label findings are fixed at 56647c7. The version gate stops unsupported, preview and unknown source builds before tool run. The tracker calls the comparison observed spend, and the what-if selection passed a repeated-ID workspace check. Shell CI is green on this commit. Clearing my stale requests. The author's release hold remains until the compatible CLI ships and the minimum is pinned to it.
…on; README states when the offer shows Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ffer Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ode, not by a comment pattern Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…the Terraform comment tests discriminate Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…mpute words and names Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…m test discriminate Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ar test reach its guard Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… matches the line check Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…aches; README wording Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… during its write `update` reads the line above the prompt, applies the change, and writes with a version check that retries on a miss. A `/clear` landing during that read made the retry blank the new conversation's offer, which then never came back that session. The updater checks the conversation again, as every other press in this file does, and a new test holds the press's read while the `/clear` and the new offer land: it fails without that check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… going, not that the conversation was cleared The command told a /clear from any run start by the check's generation, which also moves when a press starts a run. Typed while the band's Run /savings was starting, it answered "The conversation was cleared" with no /clear and a check running. It now tells the two apart by the conversation, and names the run in progress (or the one that just ended). The run in flight is kept in a module variable: the command's own read of the running flag can answer as it was when the command started. The Hide test waits on the clock instead of a promise that resolved on the /clear's write. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s the check just ran Pins the answer for a run that started and ended while the command read the running flag, and the reset of the run-in-flight marker when a run ends: without that reset the command says "already running" with nothing running. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ane in the new conversation The command took a "running" answer as it was, so one read before a /clear opened the pane in the new conversation and said the check was running there. That answer now goes through the same conversation and run checks as the generation-moved path. The Terraform rule's doc says a declaration line in a block comment or heredoc still counts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rom the running flag Starting a run was decided from the running flag in `$.state`, which a hook can read as it was when the hook started. Three review rounds each found a race from that: "the conversation was cleared" with no /clear, "already running" after the run ended, and a typed `/savings <connection>` dropped when a press's run started first. A module-level claim now decides it, set with no await between the check and the claim, and held until the run ends or a /clear drops it; the flag only draws the pane. A typed connection that a running check is not reading is told to run again when it finishes. The run clears the flag inside its write before it lets the claim go, so it never clears a newer run's flag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ing a run on another connection is told to ask again - `sessionStart` drops the claim as well as the running flag: a run from the last session can never finish, so neither may block this one. - `/savings` with no connection, while a check reads a named one, is told to run again when it finishes, as a typed connection already was. - A test presses the band's Run /savings while a typed check holds the claim, with no press queued: it fails if the press does not check the claim. - The press's run token is named apart from the press guard. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he new conversation's check Fails if a run lets go of whatever claim is held when it ends, instead of only its own: the old run would free the new conversation's claim and let a second check start on the same warehouse. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ts afresh only on its own reload `session.start` also comes when the plugin is enabled or another module reloads, while this module's check may still be running; letting go of its claim there would let a second check start on the same warehouse. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ns; a session start keeps a running check's flag - The "already running" answer is checked again once the pane has opened: a /clear meanwhile says the conversation was cleared, and a check that ended meanwhile says it just finished. - `sessionStart` clears the running flag only when no claim is held: a claim still held is a run that is still going, so the pane keeps showing it. - Tests for both, and for a session start mid-run with no /clear before it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nished" only when no check holds the claim - `runCheck` lets go of its claim in a `finally` around its running-flag write, and `/savings` lets go of its claim when that write fails before any run was scheduled: a failed write no longer leaves every later /savings answering "already running". - The already-running answer says "just finished" only when no check holds the claim once the pane has opened; one that started meanwhile is still running. - Its /clear answer says the conversation was cleared while the check ran. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… /savings does Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…step that fails before it starts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…instead of a fixed 20 ms pause The two 20 ms pauses stopped being enough once the suite grew: the test failed in most full runs while passing alone. It now goes on when each call's artifact read has begun, so the order it tests no longer depends on load. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary (for people)
Why: this gives a Databricks user a reason to try Altimate from inside Claude Code. It shows what their workspace could save, on their own machine, with nothing sent to Altimate.
Before → after:
main):/savingsis not a command. Claude Code answers "No commands match /savings"./savings [connection]runs altimate-code'sfinops_databricks_savingstool and opens a pane beside the chat with each finding, its evidence, a monthly range at list price and a Draft the fix button.Who is affected: only people who type
/savings. It needs an altimate-code release that has the tool and assessment mode (see Depends on). With an older CLI the pane says to update, and nothing runs on the warehouse.Also changed for everyone with the plugin: the shell reader the
git pushcheck uses moves unchanged to its own module,hooks/shell.ts, so/savingscan share it. The push check still reads a shell's-cscript exactly as onmain.Not tracked:
mainnow sends anonymous plugin usage events, one per session start and one each time a panel or command opens./savingssends none: neither the command, its buttons nor its pane is counted, so its "Nothing was sent to Altimate" line stays exactly true. README and PRIVACY say so.Details (for agents/reviewers)
What the pane does
workspaces_checkedfield: a workspace with only clusters or jobs and no finding counts too. It names each finding's workspace when there are several. With a CLI that does not report the count, it counts the workspaces of the warehouses and findings.cluster_size, auto-termination, or a job cluster. The request asks Claude to edit the repository's bundle or Terraform. If there is none, Claude writes the JSON for a CLI command that changes only that setting:warehouses edit,clusters updatewith an update mask, orjobs update. Nothing is sent until the user presses Enter, and nothing is applied.$.store, keyed by connection, workspace and warehouse id, with the length of the window its cost covers. A later run that finds it resized shows its observed spend a month before and after the change. The two amounts are billed in different weeks, so one note under the lines says a change in workload moves them too, and the pane never calls the difference saved. Across several workspaces, each line names its workspace, and a warehouse without a workspace id is not compared. The baseline is one run's read of each setting the CLI lists (size, type), each known or unknown, with that run's cost and date. A later run that reads every setting it knew, finds none changed and reads one more replaces it whole, so a setting is never paired with another week's spend. Only a setting read both times can have changed, and the line names only those. A warehouse row without a cost draws no line.databrickswarehouses, clusters, bundle or jobs command. The Bash line is read with the shell reader the push check uses (hooks/shell.ts). Quoted text, comments and heredoc bodies are data, a shell's-cscript is read, and the program is found past the same leaders (sudo -u x,nice -n 10, assignments) and pastxargswith its options. So a line that only names the CLI (echo databricks bundle deploy, a commit message, a heredoc that writes a script) offers nothing. A Terraform file that is not Databricks config offers nothing either. It names the flagged resource's saving if the file mentions it, with its workspace when several were read. A name flagged in several workspaces is not pinned on one of them (the file does not say which it deploys to), and after a run that failed the line quotes no finding. Otherwise it offers/savingsonce a session.Cost
/savingsruns three queries on the connection's SQL warehouse, which Databricks starts if it is stopped and bills while it runs. The command says so. The tool refuses to run withoutconfirm: true, and the plugin passes it only when the person ran the command. A plugin, the SDK or a schedule gets a refusal and no run. The CLI stops its own check after nine minutes and cancels any query still on the warehouse.Privacy
The tool runs with
ALTIMATE_TELEMETRY_DISABLED=true,ALTIMATE_ASSESSMENT_MODE=trueand--no-daemon, always through the CLI (the MCP server would drop both). Assessment mode (AltimateAI/altimate-code#1762) also stops the CLI's own startup contacts: the one-time telemetry opt-out event, the model catalog and the ripgrep download. The warehouse is then the only host the run reaches. A reused tool daemon would not see the opt-out, which is why the run uses--no-daemon. The plugin adds no usage event for/savings, and its skill tells Claude to ask the user to type/savingsrather than call the tool itself, so the tool is not run through a path without these switches. The findings stay in the pane until the user sends a Draft the fix request.PRIVACY.mdhas a section for the check, a line under Plugin usage events saying/savingssends none, and a change-log entry.Merge with
mainmainis merged in up to 1.8.3 and its unreleased fixes, keeping its content and versions: the dbt helpers, the plugin usage events and the/clearand health fixes./savingsships as 1.9.0 on top, and the changelog keepsmain's Unreleased section above it. The savings feature runs before the dbt helpers in every phase, each in its owntry.The shell reader (
simpleCommands,leaderEndand their helpers) moves fromhooks/features/health.tsxtohooks/shell.ts, taken frommain's latest version.health.tsxnow differs frommainonly by importing it from there, so the push check and its written-files reader keepmain's-crule (any-cafter the shell). One new helper,shellScript, serves only the/savingsoffer. It reads the script from the shell's own options (bash -cx,-o pipefail -c,-euo pipefail -c), and any word it does not take for one of them ends the scan, so the line shows no note. That covers a redirection, an option it does not know, and-oc pipefail. A missed note is the safe outcome, and each wider reading drew new mismatches.health.test.tsxpasses, with a new case showing the push check still holdsbash 2>/dev/null -c 'git push'andzsh --emulate sh -c 'git push'.Validation (at 31b536a)
claude plugin test .inplugins/altimate-code: 1470 of 1470 pass at 31b536a, in two runs in a row.main's dbt artifact-race test inruns.test.tsxnow waits for each call's read to begin instead of two 20 ms pauses, which stopped being enough once the suite grew.hooks/features/savings-core.testkit.tsholds what core's compiled savings binding returned for synthetic facts: every Databricks finding kind, a cluster with no auto-termination setting and a warehouse with no size (core sends null for both), and what-if rows for one warehouse id in two workspaces. A test draws it and finds no "?", "undefined" or "NaN" in the pane, the fix drafts, each what-if, the notices or the band. Every evidence and report field the plugin reads matches core's types./savingstests use the real--jsonoutput of a full run, with ids replaced. They cover the pane, each kind of evidence and fix request, what-if (including one id in two workspaces), the observed spend after a resize (both directions, never "saved", one-sided sizes), the workspace count, the skipped-check note, the band (a name in two workspaces, after a failed run) and the failure messages.hooks/usage.test.tsxasserts/savingssends no usage event. Tests also cover the version probe, the shell-line reader, answers missing a field, per-workspace baselines,/clearat each await point of a run, and a press, a prompt-box fill or a band line that straddles a/clear(none writes into the new conversation; a run starting does not drop them). Each new test was checked to fail with its fix removed. The conversation check inside a write is tested by holding the plugin's state read while a/clearand the new conversation's offer land.bash tests/*.sh: all 8 pass./savingsand the Run buttons start a check from one claim held in the plugin, taken with no await between the decision and the claim, and held until that run ends or a/cleardrops it. It used to be decided from the running flag in$.state, which a hook can read as it was when the hook started; three review rounds each found a race from that ("the conversation was cleared" with no/clear, "already running" after the run had ended, and a typed/savings <connection>dropped when a press's run started first). Tests hold the plugin's state reads and writes to land a press, a typed/savings, a run's end and a/clearbetween each step; each fails with its guard removed.main) after each round of fixes. The last, at 6894cb3, found nothing above P3; every earlier P1 and P2 is fixed. Left as they are: a check dropped by/clearkeeps querying its warehouse until it ends (up to 9 minutes), because its CLI process is not stopped; a state write that fails is not reachable in the test kit, so the claim release on that path is checked by reading; and bundle YAML written in flow style or with anchors gets no band line (the band stays quiet rather than guess).claude plugin validate --strict .passes.tsc --noEmitagainst the generated plugin types shows 5 errors, all in code frommain(cost.test.tsx,health.test.tsx,lineage-graph.ts,usage.test.tsx), and none in this PR's code.Depends on
The tool and assessment mode from AltimateAI/altimate-code#1762, in a released altimate-code. That PR also adds the
workspaces_checkedcount./savingsrunsaltimate --versionfirst, which starts no telemetry. It does not start a CLI older thanSAVINGS_MIN_ALTIMATE_CODE(hooks/features/savings.tsx) for the check, and says to update instead. Measured on 0.12.11 against a local telemetry listener:--versionsent nothing, whiletool runsent the one-time opt-out event.The constant is
0.12.12for now, the first version after the latest release. It is a provisional placeholder. Before this PR merges, it is set to the published release that carries the tool and assessment mode, so no release without them passes the check. Until then the PR is held.🤖 Generated with Claude Code