From 0329d5f588d61631d22a18975239ca2866c03040 Mon Sep 17 00:00:00 2001 From: kiskaadee Date: Tue, 13 Oct 2026 07:34:49 -0500 Subject: [PATCH] docs(architecture): define Jev-powered Cascade Triage for crowdsourced reports - Add Cascade Triage flow to Crowdsourcing & Ticket Service in docs/02_architecture.md. - Codify ADR for non-autoregressive decision model (Jev) via pluggable TriageProvider. - Update ADR-004 in docs/04_image_recognition_pipeline.md for fast-path device fallback triage. --- docs/02_architecture.md | 14 +++++++++++--- docs/04_image_recognition_pipeline.md | 4 ++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/docs/02_architecture.md b/docs/02_architecture.md index 4057b76..4ba65b9 100644 --- a/docs/02_architecture.md +++ b/docs/02_architecture.md @@ -49,10 +49,16 @@ Validates "Check-ins" using client-side edge embeddings (MobileNetV2 1280-dimens ### 4. Interaction & Collection Service Manages the many-to-many relationship between users and sculptures (unlocked achievements, captured photo galleries, and cultural audio/insights). -### 5. Crowdsourcing & Ticket Service +### 5. Crowdsourcing & Ticket Service (Cascade Triage) Manages citizen reports for moved, missing, or altered sculptures: -- Accepts coordinates, observed status, verification photo, and optional commentary. -- Groups overlapping submissions into spatial clusters ($\le 20\text{ m}$ radius) over a 48-hour window. +- Accepts coordinates, observed status, verification photo, and optional free-form commentary. +- **Cascade Triage Architecture**: + 1. **Tier 1 (Deterministic Math)**: Rejects physical impossibilities via spatio-temporal velocity checks ($v \le 120\text{ km/h}$). + 2. **Tier 2 (System One Decision Engine - Jev)**: Free-form commentary and report metadata are processed via a pluggable `TriageProvider` adapter (backed by TypeSafe AI's non-autoregressive **Jev** model): + - `is_spam` (`noul`): Fast boolean probability filter to eliminate noise before human review. + - `category` (`choice`): Categorizes reports into municipal work, temporary festival relocation, vandalism, theft, or empty pedestal. + - `credibility` (`score`): Calibrated plausibility scoring used to scale reporter vote weight. + 3. **Tier 3 (Spatial Clustering & Consensus)**: Groups verified submissions into spatial clusters ($\le 20\text{ m}$ radius) over a 48-hour window. ### 6. Location Tracker Service (The Oracle) & Hybrid Consensus Engine Computes the single source of truth (SSOT) location and status of each sculpture: @@ -67,4 +73,6 @@ Computes the single source of truth (SSOT) location and status of each sculpture * **PWA Priority:** Chosen for immediate access (QR/URL) over the friction of app store downloads, especially for tourists. * **SSO Adapter Pattern:** Isolates authentication provider logic behind a clean contract, allowing local offline testing and easy migration to alternative auth providers (e.g. Authelia) without touching business logic. * **Hybrid Consensus Threshold:** Combines automated confidence scoring ($\ge 3.0$) with human-in-the-loop moderator verification for ambiguous edge cases, balancing real-time responsiveness with catalog integrity. +* **Cascade Triage & Non-Autoregressive Decision Engine (Jev):** Free-form crowdsourced reports and device fallback queues are pre-triaged using TypeSafe AI's Jev model via a pluggable `TriageProvider` adapter. By choosing a non-autoregressive decision model over generative LLMs, the system achieves sub-200ms latency, calibrated probabilities, and guaranteed typed responses without heavy server-side GPU/RAM requirements. Code-level velocity math and client-side MobileNetV2 feature embeddings remain untouched. + diff --git a/docs/04_image_recognition_pipeline.md b/docs/04_image_recognition_pipeline.md index 98e5164..202608b 100644 --- a/docs/04_image_recognition_pipeline.md +++ b/docs/04_image_recognition_pipeline.md @@ -45,8 +45,8 @@ graph TD ### ADR-004: Asynchronous Moderation Queue for Device Failures * **Context:** Some older or budget smartphones may throw exceptions when attempting WebAssembly compilation or WebGL initialization, preventing local vector generation. -* **Decision:** If the PWA catches an ONNX initialization error, it degrades gracefully by falling back to an **Asynchronous Moderation Queue**. It uploads the raw GPS coordinates and the compressed photo to the `/reports` endpoint. The check-in is set to "Pending" until an admin manually approves it. -* **Rationale:** Protects the server from loading resource-heavy inference engines (like PyTorch or full onnxruntime) on the backend, maintaining strict memory limits while still ensuring all users can complete check-ins. +* **Decision:** If the PWA catches an ONNX initialization error, it degrades gracefully by falling back to an **Asynchronous Moderation Queue**. It uploads the raw GPS coordinates and the compressed photo to the `/reports` endpoint. The check-in is set to "Pending" until an admin manually approves it or the pluggable Jev triage engine verifies the report's credibility. +* **Rationale:** Protects the server from loading resource-heavy inference engines (like PyTorch or full onnxruntime) on the backend, maintaining strict memory limits while still ensuring all users can complete check-ins. Combined with non-autoregressive decision models (Jev), fallback tickets can be pre-scored for credibility without human bottlenecking. ### ADR-005: Progressive Dataset Rollout via Admin Seeding Tool * **Context:** Collecting, photographing, and seeding reference vectors for all 38 cats on day one is a bottleneck that delays MVP deployment.