Canon

12 — Acceptance Tests

Acceptance tests that prove triage classification, governance boundaries, and promotion behavior.

The 10 canonical acceptance tests for the triage system. All must pass for triage to be considered active.

Test 1: AI-Generated Candidate Is Visible in Staging

Given: An AI generates a knowledge item through MCP, conversation, or agent
When: The item passes through triage
Then: The candidate is visible in triage_results with approval_status = 'pending'
And: It appears in the Triage Inbox (GET /v1/knowledge/inbox)

Test 2: Candidate Is Not Visible to Governed Org Memory Queries While Pending

Given: A triage candidate exists with approval_status = 'pending'
When: Queried through organizational memory endpoints
Then: The candidate is NOT returned
And: Only approval_status = 'approved' items appear in org memory

Test 3: Reject Leaves No Published Memory

Given: A triage candidate exists
When: A human rejects it (PATCH /v1/knowledge/triage/:id with action: "discard")
Then: approval_status changes to 'discarded'
And: No org_memory row is created
And: No AI Search index entry exists
And: The rejection is audit-logged

Test 4: Defer Leaves No Published Memory and Can Return to Review

Given: A triage candidate exists
When: A human defers it (action: "defer")
Then: approval_status changes to 'deferred'
And: No org_memory row is created
And: The item reappears in the Triage Inbox
And: It can later be approved or discarded

Test 5: Approve Records Approver Identity/Time and Triggers Exactly One Promotion

Given: A triage candidate exists with approval_status = 'pending'
When: A human approves it (action: "approve")
Then: approval_status changes to 'approved'
And: approved_by records the approver's identity
And: approved_at records the approval timestamp
And: Exactly one consolidation queue message is sent
And: The approval is audit-logged with full context

Test 6: Promotion Creates Provenance/Lineage and an Outbox Event

Given: An approved triage item is processed by the Memory Consolidator
When: The Pipeline promotion engine scores and promotes it
Then: An org_memory row is created with:

  • lineage_ref linking to the source entity
  • metadata containing source, signals, and classification
  • governance_state set to 'staging' or 'approved'
    And: A memory_promotion_audit row records the decision
    And: An outbox event is emitted for downstream consumers

Test 7: Search/Index Receives Only Published Memory

Given: Both pending and approved triage items exist
When: AI Search is queried
Then: Only governance_state = 'approved' items are returned
And: Pending items are NOT in the search index
And: Rejected items are NOT in the search index

Test 8: Twin Reads Published Memory Through Bounded Context Projection

Given: Approved organizational memory exists
When: The Twin reasons about a work item
Then: It receives memory through the AI Operational Sandbox
And: The sandbox is bounded by tenant, user, role, and task
And: The Twin never queries canonical storage directly
And: Freshness, completeness, and authority markers are present

Test 9: Canonical Direct Writes from Triage Are Impossible Through Runtime Credentials/Bindings

Given: The triage runtime is deployed
When: Attempted to write directly to org_memory from triage context
Then: The write fails or is rejected
And: Triage bindings do not include write access to canonical storage
And: The only path to org_memory is through the Pipeline promotion engine

Test 10: Reconciliation Confirms the Published Record Is Retrievable After Promotion

Given: A triage item has been approved and promoted
When: The org_memory table is queried directly
Then: The row exists with correct:

  • id, tenant_id, topic, category, content
  • governance_state = 'approved'
  • confidence score
  • lineage_ref linking to source
  • created_at and updated_at timestamps
    And: The AI Search index contains the corresponding document
    And: The memory is retrievable through search with matching metadata