Repository navigation
feat: /savings v2: a slim pane, Snowflake, status line and a local report - #43
shreyastelkar wants to merge 84 commits into
Conversation
… not run, a local report, Snowflake - Status-line entry `savings`: the platforms altimate-code has connections for plus `/savings`, then the monthly range of the kept answer. The last answer per connection is kept in `$.store` for 7 days. The check still runs only when the person asks. - `ui.render` `ToolUse`: one line under a tool call on a warehouse with a kept finding, for `sql_execute` / `sql_explain` (MCP or `altimate tool run`) and `dbt run` / `dbt build` through the target in `profiles.yml`. It reads kept data only and never queries. - Saved since: Draft the fix keeps the resource, its daily cost and the date; a later run says unchanged, `measuring (n of 7 days)`, or the saving measured from billing. - The hosted checks that did not run, named from the catalog with counts from this run, and one button to Altimate. - Share report: one self-contained local HTML page, opened with the OS opener. - Both platforms: `/savings` runs `finops_snowflake_savings` beside the Databricks tool and draws a section for each; one failing leaves the other. - No notice while Claude is working: it waits for the end of the turn. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ar no longer waits on the kept answers - A drafted fix whose change was seen now reads "changed to X since D: observed spend A a day before, B a day now", with the note that the two weeks were billed separately; it never says "saved". The resized-warehouse line and the Share report page say the same, and lose the success colour. - The pane counts every workspace the CLI read (`workspaces_checked`), as on the base branch. - Reading the kept answers back at session end runs after the end hook returns, so a /clear never waits on the session's root or the store. - The savings and status-line version tests tell the status line's own `--version` check, which main now makes at session start, from the savings check's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d Show all The pane showed every finding with all its evidence, the what-ifs, nine-line lists of checks not run per platform and four buttons, which made it hard to take in and hard to check. Each run now opens slim: one header for the connections checked, the total, the three largest findings across both platforms (by the high end of their monthly range, then the low end, then the name), each on one title line with its first measured fact and Draft the fix, a line counting the smaller findings with their summed range, and how many more checks Altimate runs. Show all opens today's full detail, unchanged, with Run again; Show fewer goes back. Lines stay within the pane's usual width: a long fact is cut at a clause, a long name is shortened. A drafted fix's line stays under its finding. The status line, the notes under tool calls and the Share report page do not change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y run opens slim - A drafted fix's line shows under the first of the top findings on its warehouse, not once per finding, and a fix whose finding has cleared still shows its line in the slim view. - A run the tool refuses opens slim too, as an answered run and a session end do. - The pane title's comment is back above `paneTitle`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Code Review SummaryStatus: 3 Issues Found | Recommendation: Optional improvements before merge Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (16 files in incremental diff)
Notes on verification: static review only (tests were not executed). The previous round's warning about the version-gate refusal naming and filing a platform from the cached connection list is resolved by Previous Review Summaries (12 snapshots, latest commit b410fa2)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit b410fa2)Status: 3 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (16 files in incremental diff)
Notes on verification: the run-start claim, refusal and conversation logic ( Fix these issues in Kilo Cloud Previous review (commit 686d1f1)Status: No Issues Found | Recommendation: Merge Incremental pass over Files Reviewed (1 file)
Previous review (commit cd78265)Status: 2 Suggestions Found | Recommendation: Address before merge This pass covers Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (1 file)
Fix these issues in Kilo Cloud Previous review (commit 569c81a)Status: No Issues Found | Recommendation: Merge This pass covers Files Reviewed (4 files)
Previous review (commit c8adbef)Status: 1 Issue Found | Recommendation: Address before merge This pass covers One new suggestion remains: the learning writes the run's config whole, so a run that reads only one of the two fields can replace the value the draft already knew with Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (4 files)
Fix these issues in Kilo Cloud Previous review (commit 3be889f)Status: 3 Issues Found | Recommendation: Address before merge This pass covers The previous warning is fixed at this head: Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (4 files)
Previous review (commit f65834c)Status: 2 Issues Found | Recommendation: Address before merge This pass covers The previous round's issue is fixed at this head: Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (4 files)
Fix these issues in Kilo Cloud Previous review (commit df3f439)Status: 1 Issue Found | Recommendation: Address before merge This pass covers One gap remains, below: a run that reads a single workspace still looks the row up by id alone, even when the fix and the row name different workspaces. Overview
Issue Details (click to expand)SUGGESTION
Fix these issues in Kilo Cloud Files Reviewed (6 files)
Previous review (commit e1cbc86)Status: 1 Issue Found | Recommendation: Address before merge This pass covers the incremental change from The incremental code has no new defects found: the new key comparisons use the same values the producer writes, the Overview
Issue Details (click to expand)WARNING
Files Reviewed (7 files in incremental diff)
Previous review (commit 4297b94)Status: No Issues Found | Recommendation: Merge This pass covers the incremental change from The No redundant or simplifiable code was introduced: each of the three generation checks is separated from the next by an await and protects a distinct step, and reusing Files Reviewed (2 files in incremental diff)
Previous review (commit 920ac70)Status: No Issues Found | Recommendation: Merge This pass covers the incremental change from No behavior regression: the setter returns the current value when a Files Reviewed (1 file)
Previous review (commit 069d7fb)Status: No Issues Found | Recommendation: Merge This pass covers the incremental change from The previously reported WARNING (a [Snapshot truncated.] Additional previous summary content was truncated to keep this comment within platform limits. Reviewed by deepseek-v4.1-flash-1017 · Input: 443.8K · Output: 73.4K · Cached: 6.8M |
… the rest add, is the total The total counts each resource once, at its largest saving, but the slim view listed findings, so a warehouse's second finding could be one of the three shown or be summed again in the "+N smaller" line, and the lines added up to more than the total. The slim view now shows the three resources with the largest saving, each at the finding the total counts. The total says it counts each resource once, and the "+N smaller findings" line gives what the resources not shown add to the total, or "already in the total" when they are all on resources above. Snowflake capture: $342–$489 total = three shown + $26.76–$38.24 added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n be larger than a shown one A resource's second finding is hidden even when it is larger than the third resource shown, so "smaller" was not always true. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings the base branch's review fixes into the multi-platform /savings code and fixes this branch's own three review findings: - From the base: job evidence never prints NaN, "undefined", empty quotes or "(id )"; a run where no check could run says nothing was checked (pane, notice, status line and shared report); the CLI version is read as the status line reads it, and an unreadable one says so; the /savings offer fires only on a databricks command the shell runs; baselines are keyed per workspace; `runTool` sends env and `noDaemon` calls through the CLI; `roundMoney`, `savingsArgs`, the observed-spend note once (pane and report), and the `skipped` doc. `ranOn` stays: the tool-row notes read it here. - A warehouse the answer lists without a cost is remembered with no cost, and a resize where either side's cost is unknown gets no "Observed spend" line, instead of one claiming $0. - `slimTitle` stays within its width when the check's title is long: the name is shortened first, to no fewer than 8 characters, then the title. - A drafted fix replaces the change line of its own warehouse only (same id and workspace), not of another warehouse with the same name. Change lines and fix lines carry the resource and workspace ids. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings the base branch's next round into the multi-platform /savings code: evidence figures the answer lacks read "?" (the Snowflake lines here too), ids go into the fix request on one line, the /savings offer also fires on the CLI run with global flags, a binary path, env, sudo or a quoted assignment, a baseline keeps the length of its window, and a preview build is named as one. Run again already starts one run here (the pressed-run guard), so the base's version of that guard is not taken. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings the base branch's next round into the multi-platform /savings code: the skill tells Claude to ask for /savings instead of calling the savings tool itself; a count the answer lacks reads "?" (shared `count` in savings-format); an over-sized finding with no target size asks for a smaller size with no empty quotes; a source build is refused whatever stderr names; a databricks command inside quoted text offers nothing; a fitting size that costs more says "more". The band and Run again keep this branch's own pressed-run guard, so the base's version of it is not taken. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings the base branch's answer to its second bot-review round into the multi-platform /savings code: the Bash offer reads the line command by command (`runsDatabricksCompute`); the version probe reads stderr only when stdout printed nothing and takes a non-zero exit as no version; baselines are not compared across workspaces without a workspace id, and a warehouse listed twice is compared once; what-if rows or choices without their figures are left out; a missing auto-termination reads "?". Here the pressed-run guard also resets on session end, and the skipped-check counter's comment no longer says a check is listed once per workspace. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nswer, and keeps fix lines on their own resource - Session start reads the version probe the way /savings does: a source build (`local`), a probe that exits non-zero, or no version lists no connections, whatever a runtime note on stderr names. - Every answer is offered to the store: one the store refuses no longer keeps the next from being saved. - The slim view draws a fix line under a finding only for the same resource id in the same workspace, and lists on its own a fix whose resource is not among the findings shown (not flagged now, or below the top few), instead of dropping it. - Snowflake evidence and fix requests with a figure missing read "?" or ask for the value, never "undefined" (`MAX_CLUSTER_COUNT = undefined`, `WAREHOUSE_SIZE = 'UNDEFINED'`). - A baseline kept without a cost takes the first cost a later run gives while the warehouse is unchanged, so a later resize can still show its observed spend. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings the base branch's answer to its third bot-review round into the multi-platform /savings code: the shell-line reader takes every wrapper with its flags' values, assignments and the remaining keywords, ends a command at a backtick and skips heredoc bodies; an answer without a total is no report; a what-if choice without its cores or fit, or a row left with no choices, is left out; the checked line says "1 SQL warehouse" and "1 job". Also here: in one workspace a drafted fix hides its own warehouse's change line by id alone (a finding, and so its fix, can lack the workspace id its warehouse carries; across workspaces both must match), and the session-start source-build test now fails if the source-build check is removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the base branch's heredoc terminator fix and its handling of answers missing a field: an amount the answer lacks shows "?" (never "$NaN"), a total without its amounts or count is no report, a finding without its name is matched by id, a serverless choice without `fits` is not marked, a warehouse is matched by id in one workspace, and an answer without its connection's name keeps no baselines. Also here, from the multi-platform code's own review: - A finding without `evidence` no longer fails the whole run: the query count, daily cost and fact reads default to no evidence, and the type now says evidence can be missing. - A drafted fix hides only a warehouse's change line: fix lines carry the resource type, so a job's or cluster's fix with the same id leaves the warehouse's line in place. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the base branch's latest bot-review answers. A Bash line that opens a heredoc is not read for the offer. A total missing a figure keeps its report. An amount sent as a numeric string is shown as a number. A serverless choice the CLI marks `fits: false` keeps its warning. A Terraform file that is not Databricks config names no finding. Also here, from the multi-platform code's own review: - A finding the answer gives no amounts for is one with no dollar estimate, as one priced at $0 is. The combined total, the slim view's top three and the row notes then never add or compare a missing figure. Before this, one such finding made the combined headline "? a month" and took a top-three slot. - The shareable report's fit column says what the pane does: only an explicit `fits: false` is "no: queries would queue"; a serverless choice without one has no size to fit. - A drafted fix's line is drawn under a finding only for the same resource type, so a job's fix with a warehouse's id is listed on its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the base branch's handling of a finding without a title: it is drawn and asked about as
"Savings finding", here in the slim title line, the fact and the fix request too, so the slim view no
longer throws on one.
Also here: when no check could run, the shareable report's subtitle says so ("none of the checks
could run: see why below") instead of "by the checks that ran" and a note that some checks did not
run in full.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An answer whose total lacks its amounts or count now takes its total from its priced findings, each resource once at its largest saving, the way several kept answers are added up. The headline then agrees with the slim view's "+N more" line, and an answer whose findings have no dollar estimate reads "N findings, no dollar estimate" rather than "$0 a month on N resources". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the base branch's Bash reader on the shared shell reader (`simpleCommands`): comments are not commands, a heredoc body is skipped while the commands after it are read, a body fed to a shell is its script, and an arithmetic shift is not a heredoc. Also the "Savings opportunity" fallback title and what-if figures read as numbers before the pane formats them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the shared shell reader (`hooks/shell.ts`): the /savings Bash reader finds a command's program with the push check's leader scan (`nice -n 10`, `doas`, a leading redirect) and past `xargs`. Also here, from the bot review: - A figure counts as known only when it is a finite number or a non-blank numeric string, and `count` reuses that test, so a blank, an array or a boolean reads "?" rather than "$0.00". - A finding is priced only when both ends of its range are known; a half range is one with no dollar estimate, never "$0.00–$101", and adds nothing to a recomputed total. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the base branch's Bash reader fixes (`xargs` options with a value, a shell's `-c` script read as a line of its own) and `tenths` on the shared `known` test. Also here: the Draft the fix request is priced as the pane is, so a finding missing an end of its range asks with "no dollar estimate" rather than "?–$50.00 a month". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the base branch's single rule for the script a shell runs from `-c` (`shellScript` in `hooks/shell.ts`), shared by the push check, the heredoc reader and the /savings offer, and its BSD and long xargs value options. This answers this branch's review notes on `bash deploy.sh -c x`, `bash -cx` and `xargs -J %`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the base branch's merge of main (1.8.3 and its unreleased fixes), its shell option-cluster fix (`bash -euo pipefail -c ...` is read as running its script) and main's `altimate-dbt` README section, kept before this branch's savings section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the base branch's shell option fix (every `o` in a cluster takes a value; `-c` with no script word runs none) and its changelog, which lists main's unreleased fixes under 1.9.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the base branch's shell `-c` fallback: an option the reader does not know no longer hides the script after it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the base branch's `-c` fallback on the push check's own pattern, so a script's `-check` argument is not read as `-c`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the base branch's `shellScript` reading the shell's own words without redirections, with the any-`-c` fallback only past an option it does not know. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the one-read baseline and the conversation counter, and applies them here: - Baselines: a run that reads every setting and the cost the baseline knew, finds none changed and reads one more (a setting, or a cost it lacked) replaces it whole, date included. The cost a baseline lacked is no longer paired with the first run's date. - Drafted fixes keep the settings they were drafted against and never take one from a later run: the change most likely to have happened while a setting was unread is the fix itself, so a filled value made the line say "did not change" after a resize the fix asked for. `mergedConfig` goes; the line still compares only the settings known both then and now. - Share report, the sign-up button, the dbt row note and every press check the conversation counter, so a run starting no longer drops them. - The band uses `showBand`; the pane and the report read a missing window end as unknown and clean the connection name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the narrower bundle detection, the CLI's own window length and the unnamed band match. `windowDays` in `savings-format.ts` takes the window's `days` too, so every pane, report and baseline figure here uses the length the evidence is measured over; the band's cross-account grouping skips empty names the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in `isDatabricksConfig`, which reads a bundle's compute from the YAML block of its top-level `resources:` instead of a pattern; the band here uses it too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the file-first Databricks config check and the string lookback. The band here takes whether the text is about compute from its caller, and the lookback test reads the rate from Show all, where this branch draws it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uards - Two connections that read one workspace list its findings twice and the slim view shows one copy. Of two copies, the one whose own answer holds a drafted fix for it now ranks first, so its fix line sits under it and its Draft the fix button writes to the same record. A fix line of the other connection is not listed on its own as if the finding had cleared. - `trackChanges` matches a flagged warehouse with `sameWorkspace`, as `isFlagged` and `rowOf` do, in place of its own id sets. - Tests: a fix drafted from the connection listed second; both connections holding one; a /clear during the prompt fill keeps no fix record; a /clear while the record is written says nothing. Each fails with its fix removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the press-owned Run guard, the text-read CLI error and the commented Terraform skip. Here: - `pressStarting` holds the press that set it and only that press clears it. - `checkOne` reads the CLI's error with `String()` too; the base branch's object-error test found it reaching `error.startsWith` in `explain`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The workspace attribution finding is fixed at b410fa2. I checked that a drafted fix for the same warehouse ID cannot pick up the other workspace's spend, and that the what-if disclosure is scoped to its connection and workspace. Shell CI is green on this commit. Clearing my stale code-review request. GitHub still reports a conflict with the #35 base branch, and the compatible published CLI remains a release dependency.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ection's copy ranks higher; guard Show all/fewer by conversation; README names the Snowflake dbt scope Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
# Conflicts: # plugins/altimate-code/hooks/features/savings.tsx
# Conflicts: # plugins/altimate-code/hooks/features/savings.tsx
…atform before the connection list is read Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # plugins/altimate-code/hooks/features/savings.tsx
# Conflicts: # plugins/altimate-code/hooks/features/savings.tsx
# Conflicts: # plugins/altimate-code/hooks/features/savings.test.tsx # plugins/altimate-code/hooks/features/savings.tsx
…run-start claims are let go on a failed read or write - With no altimate-code, or one too old for the check, the connection list is never read: the refusal now says "savings check" and "a Databricks or Snowflake connection" instead of naming Databricks to a Snowflake user. - `/savings` and `startPressedRun` let go of their claim when the list read or the running-flag write fails, and `runCheck`'s first write is inside the `try` whose `finally` lets the claim go. - The skill tells Claude not to call `finops_snowflake_savings` itself either. - Tests: a band press while a typed /savings reads the list starts nothing; the report names the window the check read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # plugins/altimate-code/hooks/features/savings.tsx
…" names the running check; WSL opens the address with explorer.exe - `/savings <name>` with a name altimate-code's list does not hold runs no check and lists the names it has, instead of running the Databricks tool on it. With the list unreadable it still runs the Databricks tool, but a "not a Databricks one" answer says the connection's kind could not be read. - "Already running", "just finished" and "cleared while it ran" name the check that is running, from its claim, not the one just asked for. - A failure before any connection list is read names one platform only when the run covered one. - On WSL without wslview, the Altimate address goes to explorer.exe as it is. - One helper lets go of a claim, as on the base branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # plugins/altimate-code/hooks/features/savings.tsx
…nection of another kind is refused as such - A name is refused as "no connection named" only when this run read the list itself: with that read failing, the list from session start may predate a connection added since, so the check runs as before. - A listed connection that is neither Databricks nor Snowflake is refused as such, not run as Databricks and blamed on an unreadable list. - Such refusals carry no platform: the report says "The last check did not finish" for them. - "Already running" names the check that holds the claim once the pane opened. - Tests for each, and for the install message when both kinds are connected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e; "run again" is judged against the running check - The version-gate refusal and the failure branch carry no platform unless the list was read and the run covered one, so the report never says a guessed platform's check did not finish. - The "Run /savings X again" hint compares the request with the check that holds the claim once the pane opened, the same one the reply names. - PRIVACY.md's section is "The savings check": it covers Snowflake too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… in the list The version-gate and failure refusals guessed Databricks for a name the list read at session start did not hold (a connection added since): they now name no platform then, and the report files them under none. Tests for both, and PRIVACY.md's section opens with both platforms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…form The failure branch's guard had no test of its own; this one fails if the known-kind condition is dropped from it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
||
| /** The key a finding is counted once under: its resource's and its check's. Two connections that read one workspace list it twice. */ | ||
| export const findingKey = (view: Pick<SavingsView, 'platform' | 'scope'>, one: Pick<SavingsFinding, 'workspaceId' | 'resourceType' | 'resourceId' | 'checkId'>) => | ||
| `${resourceKey(view, one)}:${one.checkId}` |
There was a problem hiding this comment.
SUGGESTION: A finding with no check_id shares its key with another finding on the same resource
toView (savings.tsx:615) maps a missing check_id to '', so two findings on one resource from an answer that omits it get the same findingKey. distinctFindingCount then makes the status line and the report headline say one finding, and distinctFindings shows only one of them in the slim view, while Show all and the report's cards still list both. Use the finding's title (or another field the answer does carry) when checkId is empty.
| const line = fixProgress(fix, view) | ||
| // A /clear while the fixes were read: this run writes nothing back. | ||
| if (!live()) return [] | ||
| if (fix !== held) await $.store.set(key, fix).catch(() => undefined) |
There was a problem hiding this comment.
SUGGESTION: A fix drafted without a setting can never learn it, even when drafted again
This change removes mergedConfig, so fixesFor now only rewrites the record for changedSeen. A fix drafted from a row the CLI listed without size keeps { size: null, type: 'PRO' }; a later run that reads SMALL leaves the record as it is, so fixChanged finds no setting known on both sides and fixProgress keeps returning "its size and type were not read both then and now, so nothing is claimed yet", and a real resize after that is never reported. Pressing Draft the fix again does not heal it either: rememberFix (savings.tsx:1370-1373) treats changedSettings({ size: null, type: 'PRO' }, { size: 'SMALL', type: 'PRO' }) === [] as the same config and returns before writing. This is the learning the earlier round asked for (c8adbef); if it is meant to be gone, at least let an explicit re-draft fill what the row now reads.
Summary (for people)
Why: after a run on a Databricks workspace and a Snowflake account, the
/savingspane listed every finding (11 here) with two or three evidence lines and a button each, a what-if block, a nine-line "Not run here" list per platform, a footer paragraph and four buttons. That is too much to take in, and too much for a user to check against their own console.Before → after: each run now opens the pane slim: one header for the connections checked, the total (each resource counted once), the three resources with the largest saving across both platforms, each on one title line with one measured fact and its Draft the fix button, one line counting the other findings with what they add to the total, and one line for the checks Altimate runs beyond these. Show all opens the full detail exactly as it was, with Run again; Show fewer goes back. The status line, the notes under tool calls and the Share report page are unchanged, so the report is still where every number can be checked.
Who is affected: anyone who runs
/savingswith the plugin from this branch. It stacks on #35 and ships with it; nothing changes for anyone until both merge and a released altimate-code has the savings tools.Release order (blocks merge): the altimate-code savings tools and assessment mode are not released yet (latest tag 0.12.11).
SAVINGS_MIN_ALTIMATE_CODEis 0.12.12 as a placeholder: before this merges it must name the first altimate-code release that actually ships them. An altimate-code without assessment mode ignores the setting and still sends its one-time telemetry opt-out event when it lists connections at session start.Text renders from the test kit (Altimate's own Databricks fixture and the recorded Snowflake answer, elements in document order). The coordinator will replace these with real screenshots after the live run.
Before: the full pane (79 lines)
After (slim, 17 lines; Show all gives the 79 lines above). The three amounts shown plus the +8 line add up to the total, each resource counted once:
Details (for agents/reviewers)
What mod v2 adds on top of the base PR
/savingsalso runs altimate-code'sfinops_snowflake_savings(high idle time, downsize, underutilized clusters, frequent restarts), at the account's own credit price when the check can read it. With both kinds of connection, one/savingschecks both./savings, then the monthly range of the kept answer, with its age once it is a day old. Connections are listed with altimate-code'swarehouse_list, which reaches no warehouse.sql_execute/sql_explaincall, or adbt run/dbt build, that runs on a warehouse with a kept finding. A connection names its warehouse by id alone, so an id flagged in several workspaces gets no note.measuring (n of 7 days), that nothing changed, or the observed spend a day before and after the change. The two amounts are billed in different weeks, so the line says so and never calls the difference saved (the same rule the base PR's reviewer asked for on the resized-warehouse line). The fix line replaces the older "since first flagged" line only for its own warehouse: the same id in the same workspace, not another warehouse with the same name. With several workspaces read, the draft keeps its own workspace's cost and size, a later run reads its own workspace's warehouse (the CLI'sworkspace_idis kept on every inventory row), and the line names the workspace. A draft and a baseline keep each setting (size, type) as its value or as unknown: a later read fills an unknown setting and never overwrites a known one, only a setting read both then and now can have changed, and a line names only those ("still CLASSIC", "its type did not change"). With none read both times, the line claims nothing yet. A record an older version kept as a string loads with every setting unknown.$.store) and shows only where its connection reaches the same workspace or account. Nothing runs the check but/savingsor a button you press.The slim view
Also in this PR
hooks/shell.ts), baselines are keyed per workspace with their window length, and the observed-spend note shows once. An answer missing a field is still drawn:/savingssends no plugin usage event: the command, its pane, Show all and its buttons are not counted (hooks/usage.test.tsx)./clearnever waits on the session root or the store.main's/dbt-showgeneration test caught this.workspaces_checked), as in the base PR./savingsand the Run buttons start a check from one claim, taken with no await between the decision and the claim, and held until that run ends or a/cleardrops it. "Already running", "just finished" and "cleared while it ran" name the check holding the claim.Tests
claude plugin test .inplugins/altimate-code: 1706 of 1706 pass at c0bb47f. The dbt artifact-race test inruns.test.tsxnow waits on events instead of 20 ms pauses (base PR), so it no longer fails under load.hooks/features/savings-core.testkit.tsholds what core's compiled savings binding returned for synthetic facts on both platforms: every finding kind, Snowflake's Underutilized Cluster with no dollar estimate, core's nulls, and what-if rows for one warehouse id in two workspaces. A test finds no "?", "undefined" or "NaN" on the slim pane, Show all, the fix drafts, each what-if, the report page, the notices, the status line or the band. Underutilized Cluster reads the fields core sends (max_cluster_count,recommended_max_cluster_count): "The highest of its 2 clusters was barely needed…"./savingstyped again, opens slim;bash tests/*.sh: all 8 pass.claude plugin validate --strict .passes.claude plugin validate --strict ./plugins/altimate-codereports the same 6 type warnings asorigin/main, all in code frommain(cost.test.tsx,runs.test.tsx,lineage-graph.ts,usage.test.tsx).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), none in this PR's code.🤖 Generated with Claude Code