tech-debt: remove legacy field-shape fallbacks in altimate-core-* tools
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 重构
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
首先检查列出的八个文件 packages/opencode/src/altimate/tools/altimate-core-*.ts 中 #1090 的更改,并找到每个 legacy fallback。然后检查每个 consumer 如何接收其 engine 响应,并为该 consumer 定义 shape-drift 测试。完成的标准是移除这些 fallback、缺少 primary 字段时明确失败,并且 CI 能捕获真实 engine 响应中缺失的字段。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- TypeScript
- 星标
- 813
- 派生
- 134
- 平均合并
- 2 天 3 小时
- 30 天内合并 PR
- 65
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
AltimateAI/altimate-code 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
AltimateAI/altimate-code#1359 ·
-
难度 2/5 1-3 小时 新手友好度 84/100
AltimateAI/altimate-code#1323 ·
-
难度 2/5 1-3 小时 新手友好度 86/100
AltimateAI/altimate-code#1288 ·
-
难度 1/5 1 小时以内 新手友好度 92/100
AltimateAI/altimate-code#1285 ·
-
privacy: Altimate Base consent dialog no longer discloses persistent per-installation identifier 未关闭
难度 1/5 1 小时以内 新手友好度 88/100
AltimateAI/altimate-code#1284 ·
查看 AltimateAI/altimate-code 的全部 Issue
相似的 Issue
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs 未关闭
难度 2/5 1-3 小时 新手友好度 70/100
-
Crush 未关闭
难度 1/5 1 小时以内 新手友好度 85/100
catppuccin/catppuccin#3125 ·
-
难度 1/5 1 小时以内 新手友好度 90/100
ElementsProject/cln-application#167 · 1 条评论 · 1 个 reaction ·
-
难度 2/5 1-3 小时 新手友好度 75/100
Quantco/pnpm-licenses#17 ·
-
难度 2/5 1-3 小时 新手友好度 75/100