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
{{ message }}
Repository navigation
Commit 00d0a02
Browse filesBrowse the repository at this point in the historyBrowse files
fix: sync remaining engine-output consumers flagged by consensus review
Round-2 contract sync for PR #1090, fixing every Critical/Major finding from
the 4-model consensus review (all verified against the live 0.7.0 binary; all
latent since the Python-engine elimination, not 0.7.0 breakage):
Dead gates (silent false-passes):
- `check --checks validate`: gated on envelope `success`, which the handler
sets even for invalid SQL — every file passed. Now gates on `data.valid`,
maps `ValidationError` (`location.line/column`, `suggestions`) and fails
closed on engine failure.
- `check --checks semantic` + `altimate_core_semantics` tool: engine returns
`valid:true` WITH `findings` (cartesian product) — `valid` means
"plannable", not "clean". Both consumers now read `findings` and never gate
on `valid`; tool formatter/title/telemetry follow the findings list.
- `check --checks grade`: read `grade`/`score`/`recommendations`, none of
which `evaluate()` returns — no grade or finding ever surfaced. Now reads
`overall_grade`/`scores.overall`/`lint.findings` and fails closed on the
failure envelope. The check-e2e mock enshrined the fictional shape — fixed.
- `schema.detect_pii` (pii-detector): read `piiData.findings`; engine
`PiiReport` is `{ columns, pii_count, … }` — schema PII scanning returned
zero findings for every scan. Shared `piiColumnsFromReport` now filters
`classification !== "None"` on both the cache and live paths.
Wrong shapes / crashes:
- `altimate-core-compare` tool: read `differences` (engine: `identical`/
`diff_count`/`diffs`, `DiffEntry.change_type`) — different queries rendered
"Compare: IDENTICAL". Error-gated title added.
- `altimate-core-policy` tool: titled on `pass` (engine: `allowed`) — clean
SQL always rendered "VIOLATIONS FOUND"; `metadata.success` now reflects the
envelope and error output no longer contradicts the ERROR title.
- Empty-dialect coercion centralized: new `dialectHint()` in
`native/engine-coerce.ts` applied to all 7 dialect-forwarding handlers
(columnLineage, formatSql, extractMetadata, compareQueries, importDdl +
the two already fixed) — the compare/column-lineage/extract-metadata/
import-ddl tools crashed with `unknown dialect ''` whenever `dialect` was
omitted (the common invocation path).
- `{ Custom: string }` PII classifications rendered `[object Object]` in
classify-pii, the composite check renderer, and the review runner's signed
verdict — shared `classificationToString()` used everywhere; classify-pii
also no longer counts `classification: "None"` rows and error-gates its
title/output; query-pii treats engine `parse_error` as an abstention
(previously rendered CLEAN for unparseable SQL).
- Composite `altimate_core.check` now computes query PII (fail-safe) — the
tool's "=== PII ===" section previously always printed "No PII detected"
because the handler never populated it.
- `ThreatFinding.location` is `[byteOffset, byteLength]` — surfaced as a
`(chars a-b)` range in `check --checks safety` (was dropped entirely).
Tests: real-engine "consumer contract sync (round 2)" block (semantics
valid-gate, compare, policy pass/violation, classify-pii None-filter,
no-dialect tool invocations, query-pii/classify-pii/policy error gating,
composite-check PII, grade contract); CLI-shape tests for validate/semantic/
grade incl. fail-closed cases; pii-detector unit tests against the live
engine + a DuckDB-gated e2e; legacy formatter tests updated to real shapes.
Also filed upstream: stale `SafetyRule` union in the engine's index.d.ts
(altimate-core-internal#764). Codex-verified twice: all shape corrections
match the installed 0.7.0 engine; its five review findings (parse_error
abstention, grade fail-closed, byte-length location, contradictory failure
outputs, untracked files) are addressed in this commit.
Co-Authored-By: Claude Fable 5 <[email protected]>
0 commit comments