diff --git a/.artifacts/ReviewIQ-Architecture-v3.1.md b/.artifacts/ReviewIQ-Architecture-v3.1.md index 1cb9e6c..14e6231 100644 --- a/.artifacts/ReviewIQ-Architecture-v3.1.md +++ b/.artifacts/ReviewIQ-Architecture-v3.1.md @@ -233,7 +233,7 @@ CREATE TABLE reviews_enriched ( -- Quality control trust_score FLOAT DEFAULT 1.0, -- 0.0 to 1.0 - dedup_group_id TEXT, -- Groups duplicate/near-duplicate reviews + dedup_group_id TEXT, -- Tenant-scoped: format "{business_id}:{hash}" is_suspicious BOOLEAN DEFAULT FALSE, -- Processing metadata @@ -405,7 +405,11 @@ CREATE INDEX idx_events_review ON issue_events(source, review_id, review_version ### 2.4 Unified Analytics Spine -**Design Decision**: `place_id = 'ALL'` is the sentinel for "all locations" rollups. This avoids NULL handling complexity while keeping the schema simple. +**Design Decision**: Sentinel value conventions (do not normalize): +- `place_id = 'ALL'` — spatial rollup (all locations) +- `subject_id = 'all'` — semantic rollup (all subjects within type) + +Case matters: `'ALL'` ≠ `'all'`. This avoids NULL handling while keeping the schema simple. ```sql -- Fact table: pre-aggregated time-series metrics