From 3987a9ab4e9ec7520ef60e04512fb52154b2560e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Guti=C3=A9rrez?= <35082514+alezmad@users.noreply.github.com> Date: Sat, 24 Jan 2026 12:50:29 +0000 Subject: [PATCH] Document v3.1.2 conventions: dedup scoping and sentinel values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two micro-risk mitigations documented: 1. dedup_group_id: Format "{business_id}:{hash}" to prevent cross-tenant collision on similar reviews. 2. Sentinel conventions: 'ALL' (spatial) vs 'all' (semantic). Case matters — do not normalize. Spec frozen as v3.1.2. Co-Authored-By: Claude Opus 4.5 --- .artifacts/ReviewIQ-Architecture-v3.1.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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