tech-debt: remove legacy field-shape fallbacks in altimate-core-* tools
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
Hướng nghiên cứu
Bắt đầu bằng cách xem xét các thay đổi của #1090 trong tám tệp được liệt kê packages/opencode/src/altimate/tools/altimate-core-*.ts và xác định từng fallback legacy. Sau đó, kiểm tra cách mỗi consumer nhận phản hồi từ engine của nó và xác định bài kiểm tra shape drift cho consumer đó. Hoàn tất khi các fallback đã được loại bỏ, các trường primary bị thiếu sẽ gây lỗi rõ ràng và CI phát hiện các trường bị thiếu trong phản hồi thực tế từ engine.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 813
- Fork
- 134
- Merge trung bình
- 2 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 65
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của AltimateAI/altimate-code
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
AltimateAI/altimate-code#1359 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
AltimateAI/altimate-code#1323 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
AltimateAI/altimate-code#1288 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
AltimateAI/altimate-code#1285 ·
-
privacy: Altimate Base consent dialog no longer discloses persistent per-installation identifier Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
AltimateAI/altimate-code#1284 ·
Tất cả issue của AltimateAI/altimate-code
Issue tương tự
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Crush Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
ElementsProject/cln-application#167 · 1 bình luận · 1 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Quantco/pnpm-licenses#17 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100