Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

tech-debt: remove legacy field-shape fallbacks in altimate-core-* tools

Aperta
#1,126 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
testing, tooling

Direzione di ricerca

Inizia esaminando le modifiche di #1090 negli otto file elencati packages/opencode/src/altimate/tools/altimate-core-*.ts e individua ogni fallback legacy. Poi esamina come ciascun consumer riceve la risposta del proprio engine e definisci il test di shape drift per quel consumer. Il lavoro è completato quando i fallback sono rimossi, i campi primari mancanti causano un errore esplicito e CI rileva i campi assenti nelle risposte reali dell’engine.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
813
Fork
134
Merge medio
2g 3h
PR unite (30g)
65

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di AltimateAI/altimate-code

Tutte le issue di AltimateAI/altimate-code

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.