AI SKEPTIC / 10 / MVP IMPLEMENTATION PLAN / 2026

План реализации Skeptic MVP.

Финальный документ mini-серии Skeptic. Он переводит architecture, policy, claim/evidence model, adapters, API, security и golden tests в конкретный coding roadmap для server2.

Главное правило: сначала реализовать engine-neutral Skeptic core и fake adapters, затем подключать DeepEval/Ragas/HHEM. Нельзя строить бизнес-логику внутри framework callbacks.

1. Repository layout

ai-skeptic/
├── pyproject.toml
├── README.md
├── config/
│   ├── skeptic.yaml
│   ├── thresholds.yaml
│   └── models.yaml
├── migrations/
├── src/ai_skeptic/
│   ├── api/
│   │   ├── submit.py
│   │   ├── reports.py
│   │   ├── findings.py
│   │   ├── rerun.py
│   │   └── admin.py
│   ├── domain/
│   │   ├── claim.py
│   │   ├── evidence.py
│   │   ├── citation.py
│   │   ├── caveat.py
│   │   ├── contradiction.py
│   │   └── report.py
│   ├── checkers/
│   │   ├── version.py
│   │   ├── numeric.py
│   │   ├── citation.py
│   │   ├── independence.py
│   │   ├── causality.py
│   │   ├── caveat.py
│   │   └── contradiction.py
│   ├── scorers/
│   │   ├── base.py
│   │   ├── hhem.py
│   │   └── alignscore.py
│   ├── eval/
│   │   ├── base.py
│   │   ├── deepeval_adapter.py
│   │   └── ragas_adapter.py
│   ├── judge/
│   │   └── qwen.py
│   ├── policy/
│   │   ├── severity.py
│   │   ├── verdicts.py
│   │   ├── routing.py
│   │   └── block_rules.py
│   ├── workflow/
│   │   ├── research_request.py
│   │   ├── corrections.py
│   │   └── rerun.py
│   ├── audit/
│   ├── security/
│   └── cli.py
└── tests/
    ├── unit/
    ├── golden/
    ├── integration/
    ├── security/
    └── failure/

2. Последовательность разработки

PHASE 0
Domain + persistence
      ↓
PHASE 1
Deterministic checkers
      ↓
PHASE 2
Policy / verdict / routing
      ↓
PHASE 3
HHEM + Qwen adapters
      ↓
PHASE 4
DeepEval/Ragas adapter
      ↓
PHASE 5
API + workflow + audit
      ↓
PHASE 6
Golden/security/failure tests
      ↓
SHADOW MODE
      ↓
LIMITED PIPELINE INTEGRATION

3. Phase 0 — Domain + DB

Models

Claim
EvidenceSpan
CitationLink
SourceIndependenceGroup
VersionScope
NumericContext
Caveat
ContradictionEdge
CheckerResult
SkepticFinding
SkepticReport
ResearchRequest
CorrectionAttachment
ResearchResponse
AuditEvent

Tables

skeptic_runs
skeptic_reports
claims
evidence_spans
citation_links
independence_groups
caveats
contradiction_edges
checker_results
findings
research_requests
corrections
research_responses
audit_events

DoD

[ ] migrations clean
[ ] revision IDs mandatory
[ ] schemas round-trip JSON
[ ] evidence traceable
[ ] previous reports immutable
[ ] rerun creates new verification state

4. Phase 1 — Deterministic checkers

Сначала без LLM

citation existence
source/evidence trace
version compatibility
model compatibility
units
numeric range/conditions
source independence
duplicate lineage
explicit caveat presence
basic contradiction edges

Checker contract

{
  "checker": "version",
  "status": "PASS|FAIL|UNKNOWN",
  "reason_codes": [...],
  "evidence_refs": [...],
  "confidence": 1.0
}
UNKNOWN — валидный результат. Не превращать неизвестность в PASS.

5. Phase 2 — Policy engine

Implement

finding taxonomy
severity resolver
claim verdict precedence
document aggregation
BLOCK rules
routing
confidence-language mapping

Pure function goal

checker_results
+ claim metadata
+ risk profile
→ SkepticFinding[]
→ SkepticReport

Policy layer должен быть максимально тестируемым без Qwen.

6. Phase 3 — HHEM + Qwen

HHEM

Qwen judge

judge_claim
judge_causality
judge_missing_caveat
judge_contradiction
explain_finding

Structured schema

{
  "verdict": "...",
  "reason_codes": [...],
  "severity_hint": "...",
  "evidence_refs": [...],
  "required_action": "...",
  "confidence": 0.0
}

Retry

Bounded only. Schema failure after retry → explicit FAILED/REVIEW, never implicit PASS.

7. Phase 4 — DeepEval / Ragas adapter

До benchmark winner неизвестен

EvaluationFrameworkAdapter:
  evaluate_claim()
  evaluate_faithfulness()
  run_custom_metric()
  health()
  version()

Rules

8. Phase 5 — API / workflow

Implement endpoints/tools

submit_draft
submit_claimset
get_report
get_finding
get_claim_trace
request_research
attach_correction
attach_research_response
rerun
close_report

Incremental rerun

changed claim
→ dependency graph
→ affected checkers only
→ new finding state
→ aggregate new report verdict

Permissions

Writer     submit/fix/read
Researcher submit/evidence/read
Skeptic    evaluate/route
Human      review/override
Admin      maintenance

9. Rollout на server2

STEP 1
local fake adapters

STEP 2
golden tests

STEP 3
HHEM local CPU

STEP 4
Qwen judge integration

STEP 5
DeepEval/Ragas benchmark

STEP 6
shadow mode:
Skeptic checks drafts
but does not block publication

STEP 7
compare with human editor decisions

STEP 8
enable REVISE routing

STEP 9
enable BLOCK only for
predefined critical rules

STEP 10
expand BLOCK after acceptance metrics
BLOCK rollout должен быть постепенным. Сначала только safety/citation fabrication/version-critical правила.

10. Test pyramid

LayerCoverage
Unitmodels, deterministic checkers, severity, routing
Golden365+ labeled cases
AdapterHHEM/Qwen/DeepEval/Ragas contracts
Integrationsubmit→report→fix→rerun
Securityprompt injection, permissions, override
FailureQwen/scorer outage, crash recovery
Regressionafter model/framework/prompt changes

Release blockers

critical unsafe PASS = 0
fabricated citation accepted = 0
prompt injection bypass = 0
unauthorized BLOCK override = 0
incomplete run marked PASS = 0
lost audit/revision history = 0

11. Definition of Skeptic MVP Done

[ ] DraftPack accepted
[ ] ClaimSet accepted
[ ] claims normalized
[ ] evidence linked
[ ] citations verified
[ ] version checks work
[ ] numeric checks work
[ ] source independence works
[ ] HHEM/local scorer integrated
[ ] Qwen judge integrated
[ ] framework adapter integrated
[ ] finding taxonomy implemented
[ ] severity implemented
[ ] PASS/WARN/REVISE/BLOCK implemented
[ ] Writer routing works
[ ] Researcher routing works
[ ] research request works
[ ] corrections work
[ ] incremental rerun works
[ ] prompt injection tests pass
[ ] permission tests pass
[ ] crash/outage handling explicit
[ ] audit complete
[ ] golden thresholds met
[ ] critical unsafe PASS = 0
[ ] shadow run completed on real drafts
[ ] no direct RAG write
[ ] no direct publication path

После MVP можно отложить

multilingual scorer fleet
cross-article contradiction mining
multi-judge voting
automatic causal graph discovery
continuous source monitoring
full visual UI
Mini-серия Skeptic завершена. Следующий модуль по исходной очереди Additional — Dossier. Его нужно начинать отдельной серией с reuse-first master plan, не смешивая разработку со Skeptic.