AltimateAI / AltimateAI/altimate-code

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

Đang mở
#1,034 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
811
Fork
134
Merge trung bình
3 ngày 2 giờ
Pull request đã merge (30 ngày)
50

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
typescript
Lĩnh vực
data-engineering
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
48/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.