AI CURATOR / 14 / GOLDEN TESTS + FAILURE INJECTION / 2026

Golden tests Curator: policy, storage, lifecycle и security.

Полный engine-neutral набор проверок для Curator. Эти tests должны валидировать не конкретный Cognee/RAGFlow adapter, а нашу уникальную логику: promotion decisions, provenance, version scope, conflict preservation, supersede, rollback, permissions и audit.

Главное правило: false promotion опаснее false reject. Acceptance thresholds должны быть настроены так, чтобы система скорее оставила знание RUN_ONLY/HUMAN_REVIEW, чем молча записала слабый или неправильно scoped claim в permanent Technical RAG.

1. Golden policy tests

IDCaseExpected
POL-001Official datasheet, stable specification, recurring topicPROMOTE
POL-002Forum symptom, no proven causeRUN_ONLY symptom-only
POL-003SEO blog copies official manualREJECT duplicate/no added value
POL-004Authoritative source but storage rights unclearHUMAN_REVIEW or RUN_ONLY
POL-005Primary-primary conflictHUMAN_REVIEW
POL-006Firmware-sensitive fact with unknown firmwareRUN_ONLY / HUMAN_REVIEW
POL-007Safety procedure only supported by forum postREJECT / HUMAN_REVIEW
POL-008Stable definition from official standardPROMOTE
POL-009Current outage/status pageRUN_ONLY
POL-010New manual changes only model BPROMOTE update for B; preserve A

2. Provenance tests

PROV-001
KnowledgeItem → Passage → Document → Source
must resolve fully.

PROV-002
Page reference must match golden page.

PROV-003
Re-chunking creates lineage,
does not silently reuse incompatible passage_id.

PROV-004
Multiple supporting sources remain independently traceable.

PROV-005
Deleting one support source does not erase
other surviving provenance.

Critical fail

Если promoted KnowledgeItem нельзя довести до конкретного evidence passage/source, promotion считается недействительным.

3. Dedup / independence tests

IDInputExpected
DEDUP-001same bytes, same URIsame identity
DEDUP-002same bytes, different URImirror/duplicate relation
DEDUP-003same text, different wrappernormalized duplicate
DEDUP-004translation of same primary sourcenot independent evidence
DEDUP-005SEO rewrite of official sourcederived_from relation
DEDUP-006two independent official sources same factone KnowledgeItem, two supports
DEDUP-007similar model namesno false entity merge

4. Version / applicability tests

VER-001
firmware 3.1 fact
+
firmware 3.2 changed fact
→ both retained with scopes

VER-002
new manual with unknown affected model
→ no global supersede

VER-003
same product family, different hardware revision
→ separate scopes

VER-004
old fact still valid for old revision
→ status remains retrievable in historical/version query

VER-005
UNKNOWN version
→ stays UNKNOWN, never coerced to latest

5. Conflict tests

IDConflictExpected
CONF-001A1 primary vs B2 forumstronger primary may win; limitation preserved
CONF-002A1 vs A1, same scope/versionHUMAN_REVIEW
CONF-003same claim, different firmwareVERSION_CONFLICT resolved by scope
CONF-004different model scopesSCOPE_CONFLICT resolved by applicability
CONF-005insufficient evidence to resolveUNDECIDABLE / RUN_ONLY

6. Rights tests

RIGHTS-001
ALLOW_STORE_FULL
→ full canonical storage permitted

RIGHTS-002
ALLOW_STORE_EXCERPT
→ only approved passages stored

RIGHTS-003
ALLOW_METADATA_ONLY
→ source metadata + external reference only

RIGHTS-004
ALLOW_RUN_ONLY
→ no permanent indexing

RIGHTS-005
REQUIRES_REVIEW
→ HUMAN_REVIEW

RIGHTS-006
DENY
→ REJECT permanent storage

7. Lifecycle tests

IDActionExpected
LIFE-001PROMOTEINDEXED → verification → CURRENT
LIFE-002verification failsrollback / FAILED_VERIFICATION
LIFE-003mark staleretrieval policy changes, provenance remains
LIFE-004partial supersedeold scope preserved
LIFE-005full supersedeold history retained but not current
LIFE-006rollback promotionprevious state restored
LIFE-007duplicate promotion requestidempotent result

8. Security tests

SEC-001 Writer direct write → DENY
SEC-002 Researcher direct write → DENY
SEC-003 Researcher vendor API bypass → DENY
SEC-004 document prompt injection → treated as data
SEC-005 Curator basic destructive delete → restricted
SEC-006 human review required but bypass attempted → DENY
SEC-007 same idempotency key different payload → conflict
SEC-008 unauthorized rollback → DENY
SEC-009 secret-like value in logs → redacted/controlled
SEC-010 SSRF-like fetch target → blocked upstream
SEC-003 — blocker. Если vendor credentials позволяют Researcher писать в storage напрямую, architecture FAIL.

9. Failure injection

FailureExpected behavior
Storage unavailableno partial silent commit
Index unavailablepromotion remains uncommitted/rollback
Qwen malformed JSONbounded retry; no bad decision commit
Process crash mid-promotionidempotent recovery
Audit write failspromotion must not silently commit without audit
Retrieval verifier timeoutpromotion stays pending/failed verification
Human review service unavailablecase remains blocked
Version resolver unavailableversion-sensitive promotion blocked

10. Acceptance thresholds

Critical

false unsafe promotion rate = 0 on critical golden set
direct-write bypass = 0
lost provenance on promoted items = 0
false full supersede on critical version cases = 0
silent destructive data loss = 0

Quality

policy decision accuracy >= 0.95
provenance completeness >= 0.99
version assignment accuracy >= 0.98
conflict detection recall >= 0.95
exact duplicate detection >= 0.99
idempotency tests = 100% pass

Human review philosophy

Высокий human-review rate на раннем MVP допустим. Unsafe auto-promotion — нет.

11. Test artifact schema

{
  "test_id": "POL-001",
  "category": "POLICY",
  "input_fixture": "...",
  "expected": {...},
  "actual": {...},
  "status": "PASS|FAIL",
  "severity": "CRITICAL|HIGH|NORMAL",
  "trace_id": "...",
  "notes": [...]
}

Definition of Tests Done

Следующий документ: `AI_curator_15_MVP_архитектура_engine_neutral.html` — собрать policy, storage model, MCP/API и tests в единую архитектуру Curator, пока storage engine остаётся pluggable до benchmark ADR.