Spaces:
Sleeping
Sleeping
Commit History
-
fix: hide inert provider toggle on public demo; report real model name in telemetry
On the public Space (PUBLIC_DEMO=1) the provider is forced to Anthropic, so the Anthropic/Ollama toggle was inert — now hidden on the public demo, kept for local dev. Also fixes a telemetry label bug: the run footer always showed the Claude model id even on Ollama runs; triage() now reads the real model's .model_name. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>d641c27
-
feat(ui): first-run welcome modal + Light/Auto/Dark theme
WelcomeModal: explains the concept, foregrounds the AI-recommends/human-decides boundary, a 3-step how-it-works, and clickable showcase chips (camp-017/005/015) that select the campaign. Shown once (localStorage), reopenable via a "How it works" header button. Esc/backdrop/button close; reduced-motion respected. Dark theme: CSS-variable theming under a `.dark` class (semantic tokens surface/panel/line/heading/body/muted/faint + var-backed accent/gold) so the whole UI flips without dark: sprawl. Warm green-black palette. Light/Auto/Dark segmented toggle in the header (Auto follows the OS live via matchMedia), persisted; inline FOUC script in index.html sets the theme before first paint. Decision colors gain dark variants centrally in lib.ts. Frontend-only; no backend/gate/eval changes. SPA builds clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>61cdd31 -
Deploy-readiness: Neon persistence, moderator identity, run telemetry, warm redesign
Port the key infra gaps from the sibling supportops project so Amana is a durable, accountable, polished live demo (HF Spaces + Neon + keepalive). Backend: - Persistence: new src/db.py writes the moderator audit log to Neon Postgres (JSONB) behind the existing src/audit.py interface; JSONL fallback when DATABASE_URL is unset. api.py untouched. (psycopg added to requirements.) - Moderator identity: /api/decisions now requires a `moderator` name (server-enforced) and records it on every decision. - Run telemetry: agent.triage captures input/output tokens + wall-clock latency and the model name as optional GatedDecision fields. - test_api: force DATABASE_URL off for offline runs; cover the moderator rule. Frontend (warm, mission-branded redesign): - Tailwind tokens: parchment/surface/ink + pine (deep green) + gold (antique), warm stone neutrals; Fraunces/Inter/IBM Plex Mono. - Signature: verdict rendered as a stamped seal; policy-gate intervention shown as a bronze "counters…8e98f03
-
Linkify rule IDs in risk-signal details
The clickable-citations pass wired PolicyText into the rationale, questions, gate-reason, and manipulation note, but skipped the Risk signals section, so a rule ID surfaced by a risk signal (e.g. ELIG-4 in large_goal_no_breakdown_check) rendered as dead text. Run risk-signal detail through PolicyText so those IDs become drawer-linked chips that highlight-track focusRule like everywhere else. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>82482ee
-
Add policy reference drawer + clickable citations; fix check_sanctions retry loop
Two changes that surfaced during the live moderator-console click-through: Policy reference drawer (the acronym glossary moderators asked for): - src/policy.py: SECTION_META (prefix -> plain-English name + blurb) and policy_sections(), grouping parse_policy_rules() by rule-ID prefix. - api.py: new GET /api/policy route. - frontend: new PolicyReference.tsx side drawer (mirrors the audit-history drawer), opened by a Policy button in the header; lists all 26 rules grouped by the 5 sections, each with name + description. Cited rule IDs in the decision card and gate banner are now clickable RuleIdChips that open the drawer scrolled to + highlighting that rule. No AI/triage/gate code touched. check_sanctions retry-loop fix: - src/agent.py: the zero-arg check_sanctions tool now declares optional, ignored names/countries params so Haiku hallucinating those args validates instead of burning retries (was UnexpectedModelBehavior: exceeded max retries). Values still sourced from …063bf3a -
Pivot YouTube RAG scaffold into Amana — T&S triage copilot (Phases 1–3.6)
Repurposes the YouTube-transcript RAG app into a Trust & Safety campaign-review triage copilot: an AI agent screens a fundraising campaign against policy and recommends APPROVE / REJECT / ESCALATE with cited rule IDs; a human moderator decides. The AI never auto-decides. Data layer: - data/policy.md (26 citable rule IDs: ELIG/PROH/COMP/CONT/DEC) - data/campaigns/*.json (18 synthetic cases w/ private _design_note/_expected, stripped before the agent sees them), data/sanctions.json, data/past_cases.json Agent + tools (Pydantic AI, Claude; Ollama toggle for free local dev): - src/schemas.py, src/campaigns.py, src/policy.py, src/tools.py, src/agent.py - four tools: policy_search, similar_cases, check_sanctions (mock), scan_risk_signals - retired src/ingest.py, src/chunk.py, src/rag.py Deterministic policy gate (the "not-a-wrapper" layer): - src/gate.py reconciles the model's decision against policy invariants in code; may only route toward the human (-> ESCALATE), never auto-approve…250666a