Финальный документ серии Experiment. Цель — собрать минимальный, но строгий экспериментальный контур вокруг canonical engine-neutral core, где дизайн эксперимента, запуск, артефакты, результаты, воспроизводимость, policy и аудит принадлежат нашей системе, а внешние движки подключаются только через адаптеры.
MVP должен работать даже без внешнего experiment tracking/orchestration backend.
Тяжёлые experiment jobs ограничиваются очередями и concurrency, чтобы не вытеснять Qwen 30B.
Каждый publishable результат должен иметь входы, окружение, seed/config, артефакты и audit trail.
Реальные p50/p95 и resource impact фиксируются только после запуска на server2.
experiment/ ├─ app/ │ ├─ domain/ │ │ ├─ experiment.py │ │ ├─ design.py │ │ ├─ run.py │ │ ├─ artifact.py │ │ ├─ result.py │ │ ├─ validity.py │ │ └─ verdict.py │ ├─ services/ │ │ ├─ design_service.py │ │ ├─ run_service.py │ │ ├─ artifact_service.py │ │ ├─ result_service.py │ │ ├─ reproducibility_service.py │ │ └─ policy_service.py │ ├─ policy/ │ │ ├─ design_freeze.py │ │ ├─ stop_rules.py │ │ ├─ validity_rules.py │ │ └─ publication_rules.py │ ├─ adapters/ │ │ ├─ tracking/ │ │ ├─ execution/ │ │ ├─ storage/ │ │ └─ statistics/ │ ├─ api/ │ │ ├─ rest/ │ │ └─ mcp/ │ ├─ workers/ │ │ ├─ execution_worker.py │ │ ├─ analysis_worker.py │ │ └─ artifact_worker.py │ └─ integrations/ │ ├─ investigator.py │ ├─ researcher.py │ ├─ skeptic.py │ └─ dossier.py ├─ migrations/ ├─ tests/ │ ├─ unit/ │ ├─ integration/ │ ├─ golden/ │ ├─ security/ │ └─ recovery/ ├─ benchmark/ │ ├─ cases/ │ ├─ harness/ │ ├─ runbooks/ │ └─ reports/ └─ docs/ ├─ adr/ ├─ api/ └─ operations/
| Migration | Объекты | Критический инвариант |
|---|---|---|
| 001_core | experiments, scopes, design_revisions | canonical IDs и revision history принадлежат core |
| 002_hypothesis | hypotheses, variables, interventions, controls | design changes versioned, no silent overwrite |
| 003_runs | runs, run_attempts, stop_events | run связан с frozen design revision |
| 004_artifacts | artifacts, checksums, manifests, provenance | checksum + immutable provenance |
| 005_results | metrics, observations, statistical_results | raw result отделён от interpretation |
| 006_validity | assumptions, threats, validity_findings | known validity issue не теряется |
| 007_audit | audit_events, permission_events, policy_decisions | closure без audit невозможен |
| 008_integrations | external_refs, dossier_links, investigator_links | external IDs metadata only |
Schema, IDs, revisions, state machine, permissions, audit.
Hypothesis, variables, controls, intervention, success/failure criteria, design freeze.
Queue, worker contract, retries, cancellation, stop rules, attempt history.
Manifest, checksums, immutable result refs, environment capture.
Typed contracts, optimistic concurrency, scoped permissions, idempotency.
Investigator requests experiments; Skeptic reviews causal/result claims; Dossier stores linked context.
Adapters only after core semantics and golden tests exist.
No automated publication or causal closure until benchmark + ADR.
| Candidate class | Что проверяем | Решение |
|---|---|---|
| Experiment tracking | self-hosted, artifact model, local storage, API quality, export, license | REUSE / ADAPT / BUILD |
| Execution/orchestration | local worker model, retry semantics, cancellation, resource controls | REUSE / ADAPT / BUILD |
| Statistical tooling | determinism, seeds, result serialization, assumptions, Python fit | adapter only |
| Qwen 30B | structured design assistance, variable extraction, critique, summary | assistant role only |
Qwen MAY: - propose experiment design candidates - extract variables and constraints - suggest confounders / validity threats - summarize run outputs - draft ExperimentRequest / ResearchRequest Qwen MUST NOT: - invent measurements - overwrite raw results - manufacture statistical significance - decide final validity/verdict alone - bypass design freeze or stop policy
ZERO-TOLERANCE GATES unauthorized design mutation = 0 unauthorized run/result mutation = 0 stale run accepted after design revision = 0 artifact provenance loss = 0 checksum mismatch silently accepted = 0 fabricated statistical confidence = 0 hidden failed attempt = 0 cross-dossier scope leakage = 0 auditless closure = 0 Qwen-generated result treated as measurement = 0
wrong control, missing confounder, impossible success criterion, version mismatch, leakage.
worker crash, timeout, partial artifact upload, duplicate retry, cancellation race.
prompt injection in inputs, forged ExperimentResult, tampered artifact, privilege escalation.
restart queue, restore DB, reconcile orphaned runs, verify artifact integrity.
На server2 нужно отдельно измерить влияние experiment workloads на основной Qwen 30B workload. До этого документация фиксирует только harness и критерии, но не реальные цифры.
MEASURE ON SERVER2 - run queue latency - worker startup latency - artifact write/read latency - analysis job duration - CPU / RAM / disk IO - peak concurrent jobs - p50 / p95 API latency under load - Qwen 30B latency impact - failure/retry amplification - artifact storage growth - recovery time after worker/process failure
NOT_MEASURED, а не оценкой «на глаз».1. Run golden benchmark 2. Run security/failure suite 3. Run server2 resource benchmark 4. Compare candidates 5. Write ADR per component: - REUSE - ADAPT - BUILD 6. Lock canonical interfaces 7. Start SHADOW mode 8. Human review all publishable outputs 9. Enable scoped production use only after gates pass
| Stage | Allowed | Forbidden |
|---|---|---|
| DEV | synthetic runs, local artifacts | production claims |
| SHADOW | real requests mirrored, human inspection | automatic causal closure |
| PILOT | scoped users, controlled run types | unreviewed external publication |
| MVP PROD | approved run classes + full audit | policy bypass |
[ ] canonical schema + migrations shipped [ ] experiment/design/run state machines covered by tests [ ] design freeze + revision invalidation enforced [ ] run queue + bounded concurrency operational [ ] immutable artifact manifests + checksums operational [ ] raw measurements separated from interpretation [ ] reproducibility metadata captured [ ] API/MCP permissions and optimistic concurrency enforced [ ] Investigator integration works through explicit ExperimentRequest [ ] Skeptic can review experiment-backed claims [ ] Dossier stores linked experiment context without becoming execution source of truth [ ] security/failure zero-tolerance gates pass [ ] real server2 benchmark completed [ ] ADR written for each reused/adapted component [ ] shadow mode completed without provenance/audit violations [ ] operations runbook + backup/restore verified [ ] no permanent-RAG bypass exists [ ] Qwen 30B remains primary workload on server2
Experiment закрывается на уровне проектирования MVP. Следующий модуль: Orchestration.Orchestration не должна заново изобретать domain policy модулей. Её задача — безопасно координировать Writer, Researcher, Curator, Skeptic, Dossier, Source Watch, Investigator и Experiment через их публичные API/MCP контракты, сохраняя ownership данных и решений внутри соответствующих модулей.
NEXT MODULE: ORCHESTRATION Core rule: Orchestration coordinates work. It does not become the canonical owner of domain truth.