Repository navigation
feat: /profile-ctes times each CTE of a dbt model, slowest first - #31
Conversation
Lists the model's CTEs through altimate-code's dbt_cte_profile, then times them one call at a time so the pane fills live and Stop works between queries. Marginal times and hot/warm/cool tiers are worked out in the mod. Runs only on request, and the finished profile reaches Claude with its next tool result. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…laude a bounded, quoted summary Stop pressed while the list loads ends the run before any query; a run ends with its session (a /clear or reload) and hands nothing to the next one; a second command while one runs starts nothing; a refusal ends the run at the first CTE; a failed CTE leaves the next one with its total but no own part; and the note for Claude is quoted data under a size cap, delivered once with the main conversation's next tool result (a read too, never a subagent's). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…he profile to Claude only once Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ight before each query, and ignores a subagent's reads A call with no usable answer ends the run instead of starting the next prefix query while the last may still be running. Finishing is bound to the run's session, a failed CTE costs only the next row its own part, and the Tell Claude button waits for the run to stop. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Review of this PR by two independent reviewers (Claude and Codex), then a fix gate (also both) on the fixes. Every finding and what happened to it (fixes are in c31bf14): Fixed
Left as is
|
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Final-gate round. Claude: the two "Ended early" message writes could land after the session ended or a new run started, overwriting the clean-up state. Fixed in 21dd352: each write now checks the live run inside the state update. Its |
|
review-loop: APPROVED at 21dd352 |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Notes: incremental review of the PR as it now stands against Previous Review Summaries (6 snapshots, latest commit c79111f)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit c79111f)Status: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (8 files)
Notes: incremental review of Previous review (commit 5cd97c3)Status: 3 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (6 files)
Notes: incremental review of Fix these issues in Kilo Cloud Previous review (commit 1565683)Status: 3 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (3 files)
Notes: incremental review of Fix these issues in Kilo Cloud Previous review (commit 93ee73a)Status: 3 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)CRITICAL
SUGGESTION
Files Reviewed (27 files)
Notes: incremental review of Fix these issues in Kilo Cloud Previous review (commit 84f8a64)Status: No Issues Found | Recommendation: Merge Verification of previous findings
Files Reviewed (2 files)
Notes: incremental review of Previous review (commit 21dd352)Status: 4 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (21 files)
Notes: the current diff still contains the Reviewed by deepseek-v4.1-flash-1017 · Input: 118.1K · Output: 33.9K · Cached: 1.5M |
…ailed CTEs in a long note, and drops the note only after it is sent Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ate the CTE profile reads
…s and its write grant
|
review-loop: APPROVED at 5cd97c3 (reviewers: gpt-6-astra high, gpt-6.1-sol high) |
saravmajestic
left a comment
There was a problem hiding this comment.
Approving (reviewed as the delta over #30). The plugin reads exactly the metadata dbt_cte_profile returns, and passing both name and position works with the tool's matching. Stop is checked again right before each query. A refusal, a timeout or an unusable answer ends the run, so nothing piles onto a query still running, and the session generation keeps a stale run's result out after /clear. The summary for Claude is quoted data, capped and handed over once. One small note inline.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
review-loop: APPROVED at c79111f (reviewers: gpt-6-astra high, gpt-6.1-sol high) |
# Conflicts: # plugins/altimate-code/hooks/integrations.tsx
|
review-loop: APPROVED at b2798b9 (reviewers: gpt-6-astra high, gpt-6.1-sol high) |
… main The CteTier, CteRow and CteProfileState declarations were lost when the foundation's empty block was kept, so the feature's imports from types did not resolve and strict plugin validation failed. Only the feature's own block is restored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
review-loop: APPROVED at 9b24733 (reviewers: gpt-6-astra high, gpt-6.1-sol high) |
|
Fixed in 9b24733: the merge with main had kept the foundation's empty block, so CteTier, CteRow and CteProfileState were no longer declared and strict plugin validation failed; the feature's own block in types/index.d.ts is restored (nothing else in that file changes). |
saravmajestic
left a comment
There was a problem hiding this comment.
Re-approving after the conflict fix. The only change since my last approval is in the shared types, which came in from main with #29.
What this does
/profile-ctes [model]lists a dbt model's CTEs with altimate-code'sdbt_cte_profiletool, then times them one tool call at a time, so the pane fills live. Each CTE is one warehouse query that holds the CTEs before it (a warehouse may skip those the CTE does not use); nothing runs on edit.altimate-cte-profile: rows slowest first, each with its own added time (marginal), total query time, row count and a hot/warm/cool tier. Hot is half the largest marginal time or more, warm a fifth, as in dbt Power User./profile-ctesprofiles the.sqlmodel last read or edited by the main conversation (not a subagent's read, not a file undertarget/ordbt_packages/).--allow-write(it starts the dbt adapter), so it never uses the read-only MCP server.dbt_cost_estimateis still a placeholder on this base.types/index.d.ts:CteProfileStatefilled in (cteProfilewas already declared by the foundation).This needs the altimate-code PR for
dbt_cte_profile(AltimateAI/altimate-code#1731) merged and released first. The branch contains the foundation commit, which drops out of the diff when the foundation merges.Checks
claude plugin test ./plugins/altimate-code: 233 pass (new: tiers, marginal times, summary, live progress, Stop, a timed-out query, missing tool, no model, a subagent's read).bash tests/*.shpass.claude plugin validate --stricton the marketplace passes; on the plugin it reports warnings fromhooks/lineage.test.tsx(not touched here) and none fromcte-profile.Review: two independent reviewers (Claude and Codex). Fixed after review: a timed-out query kept the run going, Stop or a
/cleararriving just before a query still let it start, a finishing run could write its result back after a/clear, a subagent's.sqlread changed the bare-command target, one failed CTE hid the own times of all later ones, Tell Claude shown while stopping. Left as is: the result reaches Claude with the next main-conversation tool result (also offered by the Tell Claude button); a window of one clock read insiderunTool, a shared file, between the last Stop check and the process start; a project that sits inside a folder namedtargetis not remembered for the bare command.Changelog
/profile-ctescommand: times each CTE of a dbt model and lists them slowest first.Demo video (hosted)
P-03.mp4 — watch on Notion (Altimate workspace; recorded from the approved head of this PR).
🤖 Generated with Claude Code