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
| ID | Case | Expected |
|---|---|---|
| POL-001 | Official datasheet, stable specification, recurring topic | PROMOTE |
| POL-002 | Forum symptom, no proven cause | RUN_ONLY symptom-only |
| POL-003 | SEO blog copies official manual | REJECT duplicate/no added value |
| POL-004 | Authoritative source but storage rights unclear | HUMAN_REVIEW or RUN_ONLY |
| POL-005 | Primary-primary conflict | HUMAN_REVIEW |
| POL-006 | Firmware-sensitive fact with unknown firmware | RUN_ONLY / HUMAN_REVIEW |
| POL-007 | Safety procedure only supported by forum post | REJECT / HUMAN_REVIEW |
| POL-008 | Stable definition from official standard | PROMOTE |
| POL-009 | Current outage/status page | RUN_ONLY |
| POL-010 | New manual changes only model B | PROMOTE 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
| ID | Input | Expected |
|---|---|---|
| DEDUP-001 | same bytes, same URI | same identity |
| DEDUP-002 | same bytes, different URI | mirror/duplicate relation |
| DEDUP-003 | same text, different wrapper | normalized duplicate |
| DEDUP-004 | translation of same primary source | not independent evidence |
| DEDUP-005 | SEO rewrite of official source | derived_from relation |
| DEDUP-006 | two independent official sources same fact | one KnowledgeItem, two supports |
| DEDUP-007 | similar model names | no 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
| ID | Conflict | Expected |
|---|---|---|
| CONF-001 | A1 primary vs B2 forum | stronger primary may win; limitation preserved |
| CONF-002 | A1 vs A1, same scope/version | HUMAN_REVIEW |
| CONF-003 | same claim, different firmware | VERSION_CONFLICT resolved by scope |
| CONF-004 | different model scopes | SCOPE_CONFLICT resolved by applicability |
| CONF-005 | insufficient evidence to resolve | UNDECIDABLE / 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
| ID | Action | Expected |
|---|---|---|
| LIFE-001 | PROMOTE | INDEXED → verification → CURRENT |
| LIFE-002 | verification fails | rollback / FAILED_VERIFICATION |
| LIFE-003 | mark stale | retrieval policy changes, provenance remains |
| LIFE-004 | partial supersede | old scope preserved |
| LIFE-005 | full supersede | old history retained but not current |
| LIFE-006 | rollback promotion | previous state restored |
| LIFE-007 | duplicate promotion request | idempotent 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
| Failure | Expected behavior |
|---|---|
| Storage unavailable | no partial silent commit |
| Index unavailable | promotion remains uncommitted/rollback |
| Qwen malformed JSON | bounded retry; no bad decision commit |
| Process crash mid-promotion | idempotent recovery |
| Audit write fails | promotion must not silently commit without audit |
| Retrieval verifier timeout | promotion stays pending/failed verification |
| Human review service unavailable | case remains blocked |
| Version resolver unavailable | version-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
- policy golden set есть;
- provenance tests есть;
- dedup tests есть;
- version/scope tests есть;
- conflict tests есть;
- rights tests есть;
- lifecycle tests есть;
- security tests есть;
- failure injection есть;
- thresholds зафиксированы до implementation tuning;
- critical unsafe promotion threshold = zero;
- tests можно запускать поверх любого engine adapter.
Следующий документ: `AI_curator_15_MVP_архитектура_engine_neutral.html` — собрать policy, storage model, MCP/API и tests в единую архитектуру Curator, пока storage engine остаётся pluggable до benchmark ADR.