{"slug":"triage/10-ACTIVATION_CONTRACT","title":"10 — Activation Contract","section":"triage","sectionLabel":"Triage","status":"canon","type":"document","path":"triage/10-ACTIVATION_CONTRACT.mdx","bytes":3908,"description":"The activation contract that governs when and how triage becomes active for a tenant.","updated":"2026-08-24","source":"integratewise/Integratewise-docs-wiki","content":"\n\nTriage is considered **active** only when ALL of the following conditions are true:\n\n## 10 Activation Requirements\n\n### 1. Triage Runtime Deployed\n\nThe TriageAgent Durable Object in `iw-agent-runtime` is deployed and healthy.\n\n**Verification:** `GET /health` on iw-agent-runtime returns triage agent status.\n\n### 2. Intake Trigger Wired to Flow C Ingress\n\nThe intake trigger is connected to the intended Flow C ingress point:\n\n- MCP Connector → `/v1/triage/session`\n- Conversation Archive → `/conversations/:id/archive` → triage-bot\n- Runtime TriageAgent → `triage()` → `emitTriageInput()`\n\n**Verification:** An incoming event from any source reaches the triage boundary.\n\n### 3. Staging Writes Are Tenant-Scoped\n\nAll triage writes are scoped to the tenant that produced the evidence:\n\n- `triage_items` has `tenant_id`\n- `triage_results.metadata` contains `tenant_id`\n- No cross-tenant data leakage\n\n**Verification:** Query `triage_results` filtered by `metadata->>'tenant_id'` returns only that tenant's items.\n\n### 4. Approval Endpoint Updates Review State\n\nThe `PATCH /v1/knowledge/triage/:id` endpoint correctly updates `approval_status`:\n\n- `pending` → `approved` (triggers consolidation)\n- `pending` → `discarded` (terminal)\n- `pending` → `deferred` (resumable)\n\n**Verification:** PATCH with `action: \"approve\"` changes status to `approved` and records `approved_by` and `approved_at`.\n\n### 5. Approval Triggers Canonical Promotion\n\nWhen a triage item is approved:\n\n1. Status changes to `approved`\n2. Consolidation queue is triggered (if `TASKS_QUEUE` available)\n3. Memory Consolidator picks up approved items\n4. Pipeline promotion engine writes to `org_memory`\n\n**Verification:** Approve a triage item → wait for consolidation → verify `org_memory` row exists with `governance_state = 'approved'`.\n\n### 6. Direct Canonical Writes from Triage Are Impossible\n\nTriage runtime credentials and bindings cannot write to:\n\n- `org_memory` directly\n- Canonical Neon tables\n- R2 as canonical storage\n- Vectorize as truth source\n\n**Verification:** Attempt to call Pipeline memory-write from triage context → should fail or be rejected.\n\n### 7. Rejection/Defer/Repair Are Terminal or Resumable\n\n| Action | State | Audit |\n|---|---|---|\n| reject | terminal | Full audit trail |\n| defer | resumable | Returns to pending on re-trigger |\n| repair | resumable | Fix and re-triage |\n\n**Verification:** Reject an item → verify no `org_memory` row. Defer → verify it returns to inbox.\n\n### 8. Approved Memory Appears in Canonical Retrieval\n\nAfter promotion:\n\n- Approved memory is in `org_memory` with `governance_state = 'approved'`\n- AI Search index contains the memory\n- Twin can retrieve it through bounded context projection\n\n**Verification:** Approve → promote → search for the memory → verify it's retrievable.\n\n### 9. Rejected Memory Does Not Appear\n\nAfter rejection:\n\n- No `org_memory` row\n- No AI Search index entry\n- No Twin context projection\n\n**Verification:** Reject an item → search for it → verify it's not found.\n\n### 10. End-to-End Path Proven in Customer Zero\n\nThe complete path is proven in Customer Zero before external tenants:\n\n- Intake → Triage → Staging → Governance → Promotion → Indexing → Consumption\n- All 10 requirements verified in production-like environment\n\n## Observability Requirements\n\nWhen active, triage must expose:\n\n- **Throughput** — items/minute processed\n- **Pending queue** — items awaiting review\n- **Approval latency** — time from staging to decision\n- **Promotion success** — items successfully promoted\n- **Promotion failure** — items that failed promotion\n- **Rejection rate** — percentage of items rejected\n"}