Spaces:
Sleeping
Sleeping
Commit History
-
Phase 5 prep: bound /api/triage spend by construction (PUBLIC_DEMO)
A public Space with a billed /api/triage is a potential spend faucet. Close it structurally rather than with after-the-fact limits. The endpoint already only triages the 18 fixed campaigns (it takes a campaign_id, never free-form text — arbitrary input can't reach the model). The one remaining leak was force=true re-running past the per-campaign cache. - New PUBLIC_DEMO config flag (src/config.py). When on, /api/triage ignores force (no cache bypass) and locks the provider to Anthropic (also neutralizes the Ollama toggle, which can't run on a Space anyway). - ENV PUBLIC_DEMO=1 baked into the Dockerfile, so the deployed image is locked with no extra Space secret. Local dev (no flag) keeps force + provider toggle. - Result: max spend = 18 Haiku triages per container restart, then cache hits. Pairs with the operator-side backstop (a hard monthly cap on a dedicated key in the Anthropic Console) — documented in STATUS as the first deploy step. Tested: scripts.test_api 9/9 (new PUB…09213ce
-
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