tech-debt: remove legacy field-shape fallbacks in altimate-core-* tools
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
Research direction
Start by reviewing the #1090 changes in the eight listed packages/opencode/src/altimate/tools/altimate-core-*.ts files and locate each legacy fallback. Then inspect how each consumer receives its engine response and define the shape-drift test for that consumer. Done means the fallbacks are removed, missing primary fields fail loudly, and CI catches absent fields in real engine responses.
Written by the indexing model from the issue text.
Description
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_namefallback acrosspackages/opencode/src/altimate/tools/altimate-core-*.tsonce 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.
- Dominant language
- TypeScript
- Stars
- 813
- Forks
- 134
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 65
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AltimateAI/altimate-code
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
AltimateAI/altimate-code#1359 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
AltimateAI/altimate-code#1323 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
AltimateAI/altimate-code#1288 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
AltimateAI/altimate-code#1285 ·
-
privacy: Altimate Base consent dialog no longer discloses persistent per-installation identifier Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
AltimateAI/altimate-code#1284 ·
All issues in AltimateAI/altimate-code
Similar issues
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Crush Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
ElementsProject/cln-application#167 · 1 comment · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Quantco/pnpm-licenses#17 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100