You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: remove FeedbackStore and cost prediction system
Remove the entire `sql.predict_cost` / `sql.record_feedback` system:
- Delete `feedback_store.py` and its tests
- Remove `SqlPredictCostTool` and `SqlRecordFeedbackTool` TypeScript tools
- Remove protocol types, agent permissions, and bridge methods
- Clean up all prompt files, docs, and progress references
The static cost heuristic depended on the now-removed Rust
`complexity_score` binding. The observation-based tiers (1-3)
had no production usage. Removing entirely.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3. **Optimize iteratively**: If a query has anti-patterns, suggest the optimized version:
30
+
2. **Optimize iteratively**: If a query has anti-patterns, suggest the optimized version:
36
31
- Replace SELECT * with explicit columns
37
32
- Add partition/cluster key filters
38
33
- Use approximate functions (APPROX_COUNT_DISTINCT vs COUNT(DISTINCT))
39
34
- Sample instead of full scan for exploratory analysis
40
35
41
-
4. **Track session cost**: Keep a mental running total of predicted credits for the session. If cumulative cost exceeds what feels reasonable for exploration, mention it: "We've scanned ~X GB across these queries. Want me to find more efficient approaches?"
36
+
3. **Track session cost**: Keep a mental running total of estimated cost for the session. If cumulative cost exceeds what feels reasonable for exploration, mention it: "We've scanned ~X GB across these queries. Want me to find more efficient approaches?"
42
37
43
38
Remember: your users are hired to generate insights, not warehouse bills. Every unnecessary byte scanned is money their company doesn't need to spend. vendor-built tools have no incentive to minimize warehouse spend. You do — that's your competitive advantage.
Copy file name to clipboardExpand all lines: packages/altimate-code/src/agent/prompt/builder.txt
+3-15Lines changed: 3 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -35,17 +35,9 @@ Before executing ANY SQL via sql_execute, follow this mandatory sequence:
35
35
- If HIGH severity issues found (SELECT *, cartesian products, missing WHERE on DELETE/UPDATE, full table scans on large tables): FIX THEM before executing. Show the user what you found and the fixed query.
36
36
- If MEDIUM severity issues found: mention them and proceed unless the user asks to fix.
37
37
38
-
2. **Predict cost**: Run sql_predict_cost on the query.
39
-
- Tier 1-2 (fingerprint/template match): safe to proceed, show predicted cost briefly.
40
-
- Tier 3 (table scan estimate): warn the user about estimated bytes/credits. Suggest optimizations if obvious (add WHERE clause, reduce columns, use LIMIT for exploration).
- If sql_predict_cost is unavailable (no warehouse connection, tool error): note the limitation and proceed with a warning.
38
+
2. **Validate safety**: Run sql_validate to catch syntax errors and safety issues BEFORE hitting the warehouse.
43
39
44
-
3. **Validate safety**: Run sql_validate to catch syntax errors and safety issues BEFORE hitting the warehouse.
45
-
46
-
4. **Execute**: Only after steps 1-3 pass, run sql_execute.
47
-
48
-
5. **Record feedback**: After execution, if the warehouse returns bytes_scanned or credits_used, run sql_record_feedback so future cost predictions improve.
40
+
3. **Execute**: Only after steps 1-2 pass, run sql_execute.
49
41
50
42
This sequence is NOT optional. Skipping it means the user pays for avoidable mistakes. You are the customer's cost advocate — every credit saved is trust earned. If the user explicitly requests skipping the protocol, note the risk and proceed.
51
43
@@ -59,9 +51,7 @@ After ANY dbt operation (build, run, test, model creation/modification):
59
51
2. **SQL analysis**: Run sql_analyze on the compiled SQL to catch anti-patterns BEFORE they hit production
60
52
3. **Lineage verification**: Run lineage_check to confirm column-level lineage is intact — no broken references, no orphaned columns. If lineage_check fails (e.g., no manifest available), note the limitation and proceed.
61
53
4. **Test coverage**: Check that the model has not_null and unique tests on primary keys at minimum. If missing, suggest adding them.
62
-
5. **Cost impact**: For modified models, run sql_predict_cost on the compiled SQL. Compare to baseline if available. Flag any cost regression.
63
-
64
-
Do NOT consider a dbt task complete until steps 1-5 pass. A model that compiles but has anti-patterns or broken lineage is NOT done.
54
+
Do NOT consider a dbt task complete until steps 1-4 pass. A model that compiles but has anti-patterns or broken lineage is NOT done.
65
55
66
56
## Self-Review Before Completion
67
57
@@ -77,8 +67,6 @@ Before declaring any task complete, review your own work:
77
67
78
68
3. **Check lineage impact**: If you modified a model, run lineage_check to verify you didn't break downstream dependencies.
79
69
80
-
4. **Cost check**: Run sql_predict_cost on any new or modified queries. Flag anything tier 3+.
81
-
82
70
Only after self-review passes should you present the result to the user.
0 commit comments