chore: remove cost estimation and complexity scoring bindings#31
chore: remove cost estimation and complexity scoring bindings#31anandgupta42 merged 8 commits intomainfrom
Conversation
- Remove both functions from guard.py (bindings removed in altimate-core-internal) - Remove complexity_score and estimate_cost endpoints from server.py - Replace `guard_complexity_score` call in feedback_store.py with length heuristic - Remove associated tests from test_guard_new.py Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| result = SqlGuardResult( | ||
| success=raw.get("pass", True), data=raw, error=raw.get("error") | ||
| ) | ||
| elif method == "sqlguard.complexity": | ||
| p = SqlGuardComplexityParams(**params) | ||
| raw = guard_complexity_score(p.sql, p.schema_path, p.schema_context) | ||
| result = SqlGuardResult(success=True, data=raw, error=raw.get("error")) | ||
| elif method == "sqlguard.semantics": | ||
| p = SqlGuardSemanticsParams(**params) | ||
| raw = guard_check_semantics(p.sql, p.schema_path, p.schema_context) |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Remove `_static_heuristic` method and dialect-specific cost profiles that depended on the now-removed `guard_complexity_score`. Tier 4 now returns a `no_data` response instead of fabricating estimates. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| result = SqlGuardResult( | ||
| success=raw.get("pass", True), data=raw, error=raw.get("error") | ||
| ) | ||
| elif method == "sqlguard.complexity": | ||
| p = SqlGuardComplexityParams(**params) | ||
| raw = guard_complexity_score(p.sql, p.schema_path, p.schema_context) | ||
| result = SqlGuardResult(success=True, data=raw, error=raw.get("error")) | ||
| elif method == "sqlguard.semantics": | ||
| p = SqlGuardSemanticsParams(**params) | ||
| raw = guard_check_semantics(p.sql, p.schema_path, p.schema_context) |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
- Remove `TestSqlGuardComplexityDispatch` (2 tests for removed endpoint) - Remove `TestSqlGuardCostDispatch` (2 tests for removed endpoint) - Fix tier3 test to handle no_data fallback when table extraction fails Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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>
| "sql.analyze": {} as { params: SqlAnalyzeParams; result: SqlAnalyzeResult }, | ||
| "sql.optimize": {} as { params: SqlOptimizeParams; result: SqlOptimizeResult }, | ||
| "sql.translate": {} as { params: SqlTranslateParams; result: SqlTranslateResult }, | ||
| "sql.record_feedback": {} as { params: SqlRecordFeedbackParams; result: SqlRecordFeedbackResult }, | ||
| "sql.predict_cost": {} as { params: SqlPredictCostParams; result: SqlPredictCostResult }, | ||
| "sql.explain": {} as { params: SqlExplainParams; result: SqlExplainResult }, | ||
| "sql.format": {} as { params: SqlFormatParams; result: SqlFormatResult }, | ||
| "sql.fix": {} as { params: SqlFixParams; result: SqlFixResult }, |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
…st_gate` tools These tools called bridge methods whose server-side handlers were already removed (they depended on the Rust `estimate_cost` and `complexity_score` bindings). - Delete 3 TypeScript tools and their registry entries - Delete `ci/cost_gate.py` module and tests - Remove protocol types and Pydantic models - Clean up docs references Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Rename 33 TypeScript tool files: `sqlguard-*.ts` → `altimate-core-*.ts` - Update class names: `SqlGuard*Tool` → `AltimateCore*Tool` - Update tool IDs: `sqlguard_*` → `altimate_core_*` - Update bridge methods: `"sqlguard.*"` → `"altimate_core.*"` - Update protocol interfaces: `SqlGuard*Params` → `AltimateCore*Params` - Update agent permissions in all 4 agent configs - Update Python constant: `SQLGUARD_AVAILABLE` → `ALTIMATE_CORE_AVAILABLE` - Update Python models and server dispatch method names - Update all test files (test_guard, test_guard_new, test_server_guard, test_server_guard_new) - Update prompt files, docs, and dbt lineage module comments 51 files changed, 654 substitutions (zero remaining `sqlguard` references) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…d `ProjectScanTool` Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jontsai
left a comment
There was a problem hiding this comment.
LGTM
Clean companion to altimate-core-internal PR #38. Verified:
✓ All cost/complexity/feedback features removed (tools, endpoints, models, tests)
✓ sqlguard_* → altimate_core_* rename applied consistently across tools, protocol, agent configs, and prompts
✓ Deleted tool files: ci-cost-gate, sql-predict-cost, sql-record-feedback, sqlguard-complexity, sqlguard-cost
✓ Server endpoints, models, and guard functions cleaned up
✓ Test files updated/removed accordingly
✓ Registry imports updated to match new naming
Minor note: PR description mentions a length-based heuristic replacement in feedback_store.py, but the entire file was deleted (which is the right call since the feature is being removed entirely).
Ship it! 🚢
…predict/feedback tools Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore: remove `guard_complexity_score` and `guard_estimate_cost` - Remove both functions from guard.py (bindings removed in altimate-core-internal) - Remove complexity_score and estimate_cost endpoints from server.py - Replace `guard_complexity_score` call in feedback_store.py with length heuristic - Remove associated tests from test_guard_new.py Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: remove static cost heuristic from feedback store Remove `_static_heuristic` method and dialect-specific cost profiles that depended on the now-removed `guard_complexity_score`. Tier 4 now returns a `no_data` response instead of fabricating estimates. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: remove complexity/cost dispatch tests, fix tier3 assertion - Remove `TestSqlGuardComplexityDispatch` (2 tests for removed endpoint) - Remove `TestSqlGuardCostDispatch` (2 tests for removed endpoint) - Fix tier3 test to handle no_data fallback when table extraction fails Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * 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> * chore: remove dead `sqlguard_cost`, `sqlguard_complexity`, and `ci_cost_gate` tools These tools called bridge methods whose server-side handlers were already removed (they depended on the Rust `estimate_cost` and `complexity_score` bindings). - Delete 3 TypeScript tools and their registry entries - Delete `ci/cost_gate.py` module and tests - Remove protocol types and Pydantic models - Clean up docs references Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: rename `sqlguard` to `altimate-core` across entire codebase - Rename 33 TypeScript tool files: `sqlguard-*.ts` → `altimate-core-*.ts` - Update class names: `SqlGuard*Tool` → `AltimateCore*Tool` - Update tool IDs: `sqlguard_*` → `altimate_core_*` - Update bridge methods: `"sqlguard.*"` → `"altimate_core.*"` - Update protocol interfaces: `SqlGuard*Params` → `AltimateCore*Params` - Update agent permissions in all 4 agent configs - Update Python constant: `SQLGUARD_AVAILABLE` → `ALTIMATE_CORE_AVAILABLE` - Update Python models and server dispatch method names - Update all test files (test_guard, test_guard_new, test_server_guard, test_server_guard_new) - Update prompt files, docs, and dbt lineage module comments 51 files changed, 654 substitutions (zero remaining `sqlguard` references) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: update cost-report skill to use finops tools instead of removed predict/feedback tools Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: anandgupta42 <anand@altimate.ai>
Summary
guard_complexity_scoreandguard_estimate_costfromguard.py(Rust bindings removed in internal PR)complexity_scoreandestimate_costendpoints fromserver.pyguard_complexity_scorecall infeedback_store.pywith simple length-based heuristicmax(1.0, len(sql) / 100.0)test_guard_new.py4 files changed, 3 insertions, 113 deletions
Companion to: https://github.com/AltimateAI/altimate-core-internal/pull/38
Test plan
🤖 Generated with Claude Code