Skip to content

Commit b823ea6

Browse files
sahrizviclaude
andcommitted
release: v0.9.6 review round 5 — CHANGELOG + test-isolation fixes
Addresses three cubic P2 findings on release/v0.9.6: - **CHANGELOG L10 + bullet (e)/(f)**: my theme + bullets listed `migration` and `compare` as valid `check --checks` lanes. They are not — `VALID_CHECKS` in `check-helpers.ts` only accepts {lint, validate, safety, policy, pii, semantic, grade}. The migration and compare correctness fixes belong to the `altimate-core-migration` and `altimate-core-compare` TOOLS (agent tools, not check lanes). Moved them to their own bullets and dropped them from the check-lane list in the theme. - **Test env-var teardown**: `afterAll` unconditionally deleted `ALTIMATE_TELEMETRY_DISABLED`, wiping any pre-existing value an outer suite may have set. Now captures the prior value in `beforeAll` and restores it (or deletes if none was set). - **Concurrent-failure test coverage**: added a companion to the concurrent-success test that fires 20 concurrent calls against a rejecting hook and asserts every one rejects with the SAME error instance (proving dedup held across the failure path) with the hook body having run exactly once. 15/15 dispatcher tests pass (14 prior + 1 new). Co-Authored-By: Claude Opus 4.7 <[email protected]>
1 parent be3b9e8 commit b823ea6

2 files changed

Lines changed: 43 additions & 3 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [0.9.6] - 2026-08-23
99

10-
Correctness release: `check --checks {validate,semantic,grade,pii,migration,safety,policy,compare}` and the PII/lineage/migration tools now tell you the truth. Several previously returned false-clean or wrong output — teams gating CI on `check --fail-on error|warning` may see new failures on unchanged SQL. **These are real findings the tool previously missed, not regressions in your code.** Also fixes a data-hygiene bug where truncated tool-output files were being deleted the moment they were written.
10+
Correctness release: `check --checks {validate,semantic,grade,pii,safety,policy}` and the `altimate-core-*` tools (`migration`, `compare`, `track-lineage`, `query-pii`, `classify-pii`) now tell you the truth. Several previously returned false-clean or wrong output — teams gating CI on `check --fail-on error|warning` may see new failures on unchanged SQL. **These are real findings the tool previously missed, not regressions in your code.** Also fixes a data-hygiene bug where truncated tool-output files were being deleted the moment they were written.
1111

1212
### Changed
1313

14-
- **`check --checks *` now surfaces the findings it was missing — expect newly-failing CI runs.** `altimate-core` upgrade `0.5.1 → 0.7.0` plus a consumer-contract sync catches a class of latent shape-mismatch bugs where the CLI was reading fields the engine no longer emits and rendering false-clean output as a result. Concretely: (a) `check --checks validate` gated on the wrong field and passed every file, now maps `ValidationError.location` and fails closed on engine failure; (b) `check --checks semantic` treated `valid:true` as clean, but `valid` means "plannable" — cartesian products came back "OK" for months, now reads `findings` and never gates on `valid`; (c) `check --checks grade` read fields `evaluate()` doesn't return, so no grade or finding ever surfaced, now reads `overall_grade`/`scores.overall`/`lint.findings` (with nested findings from `validation.errors` + `safety.threats`); (d) `check --checks pii` mapped the column name to the numeric column-position field and printed `[object Object]` for `{ Custom: string }` classifications, now reports the exposing alias and stringifies properly; (e) `check --checks migration` rendered "SAFE" for every migration including `DROP COLUMN`, now reads `findings`/`safe`/`overall_risk`; (f) `check --checks compare` rendered "IDENTICAL" for different queries, now reads `differences`; (g) `check --checks policy` titled on `pass` (engine returns `allowed`), so clean SQL always rendered "VIOLATIONS FOUND", now inverted; (h) `check --checks safety` maps engine `high → error` and `medium → warning` (previously both degraded to `info`), so `--fail-on error|warning` no longer silently passes high-risk SQL injection threats; a new `unbalanced_quote` safety rule ships from the engine. Findings' `rule` field (when set — `lint` findings may omit it if the engine didn't attach one) names the rule in `--format json` output — that's how the safety and policy catalog is discovered in practice. (#1090)
14+
- **`check --checks *` now surfaces the findings it was missing — expect newly-failing CI runs.** `altimate-core` upgrade `0.5.1 → 0.7.0` plus a consumer-contract sync catches a class of latent shape-mismatch bugs where the CLI was reading fields the engine no longer emits and rendering false-clean output as a result. Concretely: (a) `check --checks validate` gated on the wrong field and passed every file, now maps `ValidationError.location` and fails closed on engine failure; (b) `check --checks semantic` treated `valid:true` as clean, but `valid` means "plannable" — cartesian products came back "OK" for months, now reads `findings` and never gates on `valid`; (c) `check --checks grade` read fields `evaluate()` doesn't return, so no grade or finding ever surfaced, now reads `overall_grade`/`scores.overall`/`lint.findings` (with nested findings from `validation.errors` + `safety.threats`); (d) `check --checks pii` mapped the column name to the numeric column-position field and printed `[object Object]` for `{ Custom: string }` classifications, now reports the exposing alias and stringifies properly; (e) `check --checks policy` titled on `pass` (engine returns `allowed`), so clean SQL always rendered "VIOLATIONS FOUND", now inverted; (f) `check --checks safety` maps engine `high → error` and `medium → warning` (previously both degraded to `info`), so `--fail-on error|warning` no longer silently passes high-risk SQL injection threats; a new `unbalanced_quote` safety rule ships from the engine. Findings' `rule` field (when set — `lint` findings may omit it if the engine didn't attach one) names the rule in `--format json` output — that's how the safety and policy catalog is discovered in practice. (#1090)
15+
- **`altimate-core-migration` tool no longer renders "SAFE" for destructive migrations.** Previously read a non-existent `risks` field; every migration including `DROP COLUMN` came back safe. Now reads `findings`/`safe`/`overall_risk` (engine `MigrationResult`); never renders SAFE on engine error; counts only non-"safe" findings as risks. (#1090)
16+
- **`altimate-core-compare` tool no longer says "IDENTICAL" for different queries.** Read a non-existent `differences` field; different SQL always compared equal. Now reads the engine's `identical`/`diff_count`/`diffs` shape with an error-gated title. (#1090)
1517
- **`altimate-core-track-lineage` no longer returns "0 edges" for everything.** The tool read `edges` off the top-level result; the engine has always emitted them at `queries[].edges`, so lineage tracking silently produced nothing. Now collects correctly, renders `impact_map`, formats `{table, column}` refs, and renders ERROR instead of "0 edges" when the engine call itself fails. (#1090)
1618
- **`schema.detect_pii` returned zero findings for every scan.** Same shape-mismatch class: the detector read `piiData.findings`, but the engine's `PiiReport` is `{ columns, pii_count, … }`. Both cache and live paths now filter `classification !== "None"` through the shared `piiColumnsFromReport` helper. Malformed `PiiReport` shapes now throw rather than silently yield zero findings. Failed per-column classifications flip `success` to `false` — the schema-detect-pii tool renders "PII Scan: ERROR" with any partial findings attached, instead of a clean "no findings" verdict. (#1090)
1719
- **`altimate-core-{compare,column-lineage,extract-metadata,import-ddl}` no longer crash on the default invocation.** Empty-string dialects now coerce to `undefined` before hitting `Schema.fromDdl`, centralized as `dialectHint()` in `native/engine-coerce.ts` and applied across all 7 dialect-forwarding handlers. (#1090)

‎packages/opencode/test/skill/release-v0.9.6-adversarial.test.ts‎

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,20 @@ import { afterEach, beforeAll, afterAll, beforeEach, describe, expect, test } fr
3333

3434
import * as Dispatcher from "../../src/altimate/native/dispatcher"
3535

36+
let _priorTelemetryDisabled: string | undefined
3637
beforeAll(() => {
38+
_priorTelemetryDisabled = process.env.ALTIMATE_TELEMETRY_DISABLED
3739
process.env.ALTIMATE_TELEMETRY_DISABLED = "true"
3840
})
3941
afterAll(() => {
40-
delete process.env.ALTIMATE_TELEMETRY_DISABLED
42+
// Restore any pre-existing value rather than unconditionally deleting —
43+
// an outer suite may have set it and expects to see its own value after
44+
// this file runs. (cubic P2 round 3.)
45+
if (_priorTelemetryDisabled === undefined) {
46+
delete process.env.ALTIMATE_TELEMETRY_DISABLED
47+
} else {
48+
process.env.ALTIMATE_TELEMETRY_DISABLED = _priorTelemetryDisabled
49+
}
4150
})
4251

4352
describe("v0.9.6 release: Dispatcher registration retry", () => {
@@ -102,6 +111,35 @@ describe("v0.9.6 release: Dispatcher registration retry", () => {
102111
expect(attempts).toBe(1)
103112
})
104113

114+
test("concurrent calls share ONE registration attempt on failure — all reject with the SAME error", async () => {
115+
// Companion to the success case: assert dedup also holds when the
116+
// hook fails. All N concurrent callers must reject with the same
117+
// error object (proving they awaited the same in-flight promise),
118+
// and the hook body must have run exactly once. (cubic P2 round 3.)
119+
let attempts = 0
120+
let rejectGate: (err: Error) => void = () => {}
121+
const gate = new Promise<void>((_, rej) => (rejectGate = rej))
122+
Dispatcher.setRegistrationHook(async () => {
123+
attempts += 1
124+
await gate
125+
})
126+
127+
const calls = Array.from({ length: 20 }, () => Dispatcher.call("ping", {} as any))
128+
const failure = new Error("shared-failure")
129+
rejectGate(failure)
130+
131+
const results = await Promise.allSettled(calls)
132+
expect(results.length).toBe(20)
133+
for (const r of results) {
134+
expect(r.status).toBe("rejected")
135+
if (r.status === "rejected") {
136+
// Same error instance = same underlying promise = dedup held.
137+
expect(r.reason).toBe(failure)
138+
}
139+
}
140+
expect(attempts).toBe(1)
141+
})
142+
105143
test("successful registration is memoized — a later call does NOT re-run the hook", async () => {
106144
// Guard against overcorrection: once the current-generation hook has
107145
// completed, the resolved _registrationPromise memoizes success so

0 commit comments

Comments
 (0)