Deferred from the v0.9.6 release review (Tech Lead persona, P1).
Context
#1090 fixed 10+ silent-empty-output bugs where CLI consumers of @altimateai/altimate-core read fields the engine no longer emits. The fix added a "legacy fallback" pattern to soften the shape transition, e.g.:
data.diffs ?? data.differences // altimate-core-compare.ts
data.findings ?? data.risks // altimate-core-migration.ts
f.suggestion ?? f.remediation // ~8 sites across altimate-core-*.ts
The concern: these fallback branches are untested dead code. A future engine bump that renames or removes the primary field (data.diffs, data.findings, f.suggestion) silently falls through to the always-undefined legacy key and reintroduces the exact silent-empty-output bug this PR spent 10 review rounds fixing. No test catches it because the fallback branch is never exercised.
What to do
- Remove every
?? legacy_field_name fallback across packages/opencode/src/altimate/tools/altimate-core-*.ts once we've soaked 0.7.0 in prod for 1-2 releases.
- Replace with an explicit shape assertion (or a loud
console.warn + telemetry event) so a future engine contract break fails loud instead of silently degrading to empty output.
- Add a "shape drift" alarm — a unit test per consumer that asserts the primary field IS present in a real engine response, so removal of it in a future engine bump breaks CI immediately.
Affected files (from the #1090 diff)
- `packages/opencode/src/altimate/tools/altimate-core-compare.ts`
- `packages/opencode/src/altimate/tools/altimate-core-migration.ts`
- `packages/opencode/src/altimate/tools/altimate-core-policy.ts`
- `packages/opencode/src/altimate/tools/altimate-core-check.ts`
- `packages/opencode/src/altimate/tools/altimate-core-query-pii.ts`
- `packages/opencode/src/altimate/tools/altimate-core-classify-pii.ts`
- `packages/opencode/src/altimate/tools/altimate-core-track-lineage.ts`
- `packages/opencode/src/altimate/tools/altimate-core-semantics.ts`
Priority
P1 — same class of bug as #1090, but latent. Address before shipping another engine bump.
Deferred from the v0.9.6 release review (Tech Lead persona, P1).
Context
#1090 fixed 10+ silent-empty-output bugs where CLI consumers of
@altimateai/altimate-coreread fields the engine no longer emits. The fix added a "legacy fallback" pattern to soften the shape transition, e.g.:The concern: these fallback branches are untested dead code. A future engine bump that renames or removes the primary field (
data.diffs,data.findings,f.suggestion) silently falls through to the always-undefinedlegacy key and reintroduces the exact silent-empty-output bug this PR spent 10 review rounds fixing. No test catches it because the fallback branch is never exercised.What to do
?? legacy_field_namefallback acrosspackages/opencode/src/altimate/tools/altimate-core-*.tsonce we've soaked 0.7.0 in prod for 1-2 releases.console.warn+ telemetry event) so a future engine contract break fails loud instead of silently degrading to empty output.Affected files (from the #1090 diff)
Priority
P1 — same class of bug as #1090, but latent. Address before shipping another engine bump.