Repository navigation
fix: bump @altimateai/altimate-core to 0.9.0 and fail closed on skipped policy/semantic analysis - #1555
Conversation
- pin `@altimateai/altimate-core` to `0.9.0` in `packages/opencode/package.json` - update `bun.lock` for the core package and its five platform bindings - no source changes needed: nothing in altimate-code reads the new `plan_status`, `POLICY_SKIPPED` or `plan_unavailable` outputs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 3cbb3c7a-83fd-4351-82c7-768778a49b84) |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (9 files)
Previous Review Summary (commit 86c56fe)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 86c56fe)Status: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Reviewed by gemini-4-argon · Input: 182.9K · Output: 4.5K · Cached: 1.6M Review guidance: REVIEW.md from base branch |
…tic analysis
altimate-core 0.9.0 validates statements that 0.8.0 rejected as invalid
(table-valued functions such as `TABLE(fn())`, `LATERAL FLATTEN`,
`read_csv('x')`), but it has no logical plan for them. `checkPolicy` then
returns `allowed: true` with a `plan_unavailable` warning and
`policies_evaluated: 0`, and `checkSemantics` returns no findings with a
"plan-based analysis was skipped" note. Both read as clean.
- `altimate_core.policy` handler: treat a `plan_unavailable` / `POLICY_SKIPPED`
warning as not evaluated: `allowed: false`, `policy_skipped: true`, plus a
`policy_not_evaluated` error violation. CLI `check`, the agent policy tool
and every other consumer inherit this.
- `altimate_core.semantics` handler: set `skipped` and `skip_reason` when the
engine skipped analysis; `check --checks semantic` reports a finding (error
with a schema, warning without) and the semantics tool reports `SKIPPED`
instead of VALID.
- add tests pinning the 0.9.0 behavior for three TVF shapes and an unaffected
normal query
- update the pin in `docs/internal/deterministic-checks-engine-split.md`
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: d33be78e-e817-44d1-b00a-8f5965128907) |
…t as evaluated `sql.analyze` called `core.checkSemantics` directly, so a table-valued-function statement (no plan, analysis skipped by altimate-core 0.9.0) still returned confidence `high` with `semantics` listed as evaluated and "no issues". - apply the same skip guard as `altimate_core.semantics` - add a semantic warning issue, drop `semantics` from `confidence_factors` and lower confidence to `medium` when skipped - add tests for a TVF statement and an unaffected normal query Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 4451fca3-0417-4b47-a890-2fc81372e0f7) |
Issue for this PR
Closes #1554
Type of change
What does this PR do?
Bumps
@altimateai/altimate-corefrom 0.8.0 to 0.9.0 and makes the policy and semantic consumers fail closed on the one 0.9.0 output change that would otherwise loosen them.Why: 0.9.0 removes validator false positives that make the SQL tools flag valid queries: DuckDB and SQLite identifier case folding, boolean
SUM, PostgreSQLLIKE ANY, and table-valued functions (TVFs) inFROM/JOIN.Behavior delta (verified by calling the 0.9.0 binding on
SELECT * FROM TABLE(my_fn()),... LATERAL FLATTEN(...)andSELECT * FROM read_csv('x')):validatevalid: true,plan_status: unavailable_table_valued_function,PLAN_UNAVAILABLEwarningpolicy(check --checks policy, agent policy tool)allowed: true,policies_evaluated: 0,plan_unavailablewarning, i.e. passed uncheckedallowed: false,policy_skipped: true,policy_not_evaluatederror violation ("policy could not be evaluated for this statement (table-valued function, no plan available); treated as blocked")semantics(check --checks semantic, agent semantics tool,sql.analyze)skipped: true;checkreports a finding (error with a schema, warning without), the tool reportsSemantics: SKIPPED;sql.analyzeadds a warning, dropssemanticsfromconfidence_factorsand lowers confidence tomediumFix location: the
altimate_core.policyandaltimate_core.semanticsnative handlers (src/altimate/native/altimate-core.ts), so the CLI, the agent tools and any other dispatcher consumer inherit it.altimate-core-semantics.ts,check.tsandsql/register.ts(sql.analyzecalled core directly) surface the skip. Queries with a plan are unchanged.Other 0.9.0 output changes: nothing in
packages/opencode/srcconsumesPOLICY_SKIPPEDorplan_status;explainreturningexplanation: nullhas no consumer either.Tenant/user impact: SQL that uses table-valued functions now validates instead of being rejected. Policy gating on such SQL stays blocked, as in 0.8.0, but with an accurate reason. Semantic checks on such SQL now say they were skipped.
bun.lockcovers the core package and its five platform bindings, with integrity hashes from the npm registry;bun install --frozen-lockfileinstalls the 0.9.0 darwin-arm64 binding. Also updates the pin mentioned indocs/internal/deterministic-checks-engine-split.md.How did you verify your code works?
From
packages/opencode:main91cdf94b, then the published npm package): 5156 pass / 0 fail. The existing suites did not catch the policy change, which is why the new tests exist.test/altimate/core-plan-skip-fail-closed.test.tsand the policy/semantics tool tests): 5168 pass / 111 skip / 0 failallowed: falsefor policy andskipped: truefor semantics, and a normal query is unaffected.check-e2egains a policy-skipped and a semantic-skipped case.sql.analyzecrediting skipped semantics), fixed in the head below.bun run typecheckpasses;script/upstream/analyze.ts --markers --base main --strictis clean.Screenshots / recordings
Not a UI change.
Cost side effects
None. No new LLM calls, automatic queries, warehouse spend or background work.
Checklist
🤖 Generated with Claude Code
Note
Medium Risk
Changes enforcement semantics for policy and semantic checks on unplannable SQL; behavior is intentional fail-closed but affects CI gates and agent tooling that relied on 0.9.0’s permissive skip signals.
Overview
Upgrades
@altimateai/altimate-corefrom 0.8.0 to 0.9.0 (lockfile,packages/opencode/package.json, internal docs pin).Core 0.9.0 can return policy allowed / semantics valid with no findings when plan-based analysis is skipped (e.g. table-valued functions). This PR treats that as not evaluated, not clean: native handlers add
applyPolicySkipGuardandapplySemanticsSkipGuardonaltimate_core.policyandaltimate_core.semantics, blocking policy with apolicy_not_evaluatedviolation and marking semantics withskipped/skip_reason.sql.analyze, thecheckCLI semantic path, and the semantics agent tool surface skips (lower confidence, explicit issues/titles) so TVF SQL no longer passes policy or looks semantically clean by accident. Integration and e2e tests cover TVF shapes and unchanged normal queries.Reviewed by Cursor Bugbot for commit fb1d6f9. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit