AltimateAI / AltimateAI/altimate-code

feat(review): expand grain-key not_null detector to fire on any contracted-model column change

未關閉
#1,034 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
TypeScript
星號
811
分支
134
平均合併
3 天 2 小時
30 天內合併 PR
50

描述

Deferred from the v0.9.3 pre-release review.

### Current behavior

`extractGrainKeyGaps` in `packages/opencode/src/altimate/review/dbt-patterns.ts` fires only when the grain declaration itself changes, filtered by `grainDeclChangedEntities` — which iterates `newMap` and compares against `oldMap` for additions.

### Gap

A PR that adds a new column to an existing contracted model without touching `unique_combination_of_columns` will not surface uncovered grain columns, even when new columns increase the exposure surface. The scoping is conservative and correct for the initial ship, but leaves recall on the table.

### Proposal

Extend the change-scoping filter to also fire when any column added/modified in a contracted model's schema.yml overlaps with existing grain-key coverage. Keep the current "grain declaration changed" path as one of two entry conditions.

### Why deferred

Scope expansion touches filter semantics and could shift the false-positive rate; the initial detector is intentionally conservative and documented, so a follow-up release is the right cadence for widening.

貢獻指南

開啟貢獻指南

研究方向

Start in packages/opencode/src/altimate/review/dbt-patterns.ts at extractGrainKeyGaps and the grainDeclChangedEntities filter. Trace how newMap and oldMap identify additions, then inspect how contracted-model schema.yml column changes are represented. Done means the detector preserves the existing grain-declaration path and also evaluates added or modified columns that overlap existing grain-key coverage without unnecessarily broadening unrelated changes.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
typescript
領域
data-engineering
Issue 類型
功能
難度
4/5
預估耗時
3-5 天
活躍度
冷清
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。