Практический benchmark должен ответить не на вопрос «какой orchestrator моднее», а на вопрос: какой execution layer даёт ИИшке нужную надёжность, восстановление, прозрачность и resource fit, не забирая у canonical core доменную политику и не мешая Qwen 30B на server2.
Каждый кандидат получает одинаковые workflow definitions, module mocks, side-effect adapters, idempotency keys и failure injection. Сравнивается execution behaviour, а не удобство конкретного DSL.
Canonical WorkflowSpec
|- workflow_id / workflow_version
|- steps[]
|- dependencies[]
|- retry_policy
|- timeout_policy
|- human_gate
|- permission_scope
|- resource_class
|- idempotency_scope
`- audit_requirements
|
+--> Temporal adapter
+--> Prefect adapter
+--> LangGraph adapter (agent-local cases only)
`--> Kestra adapter
Shared fixture layer
|- FakeResearcher
|- FakeSkeptic
|- FakeWriter
|- FakeCurator
|- FakeExperiment
|- FakeInvestigator
|- SideEffectLedger
|- FailureInjector
`- AuditCollector
Golden workflow описывается вне движка. Adapter обязан отображать semantics без изменения domain model.
Kill worker, kill server, timeout, duplicate delivery, lost callback, stale input, poisoned event, resource starvation.
Все необратимые side effects пишутся в отдельный ledger, чтобы обнаружить replay/duplication.
Каждый run экспортирует canonical trace: step, attempt, engine event, domain decision, input/output hashes.
| Группа | Кол-во | Что проверяет |
|---|---|---|
| Linear / branching | 5 | Последовательность, fan-out/fan-in, conditional routing. |
| Retries / timeouts | 5 | Transient failure, exponential retry, timeout boundaries, retry exhaustion. |
| Human-in-the-loop | 4 | Pause, approval, rejection, late approval after workflow version changes. |
| Crash recovery | 5 | Worker crash, orchestration service restart, continuation from persisted state. |
| Idempotency / replay | 4 | Duplicate delivery, repeated callback, replay after acknowledgement loss. |
| Cross-module policy | 3 | Unauthorized route, budget gate, escalation to human. |
| Server2 pressure | 2 | Heavy Qwen workload + orchestration background pressure. |
| Version / stale state | 2 | Old run pinned to old definition; stale module output rejected or marked stale. |
G01 Researcher -> Skeptic -> Writer PASS path G02 Researcher fails once -> retry -> Skeptic transient recovery G03 Skeptic returns REVISE -> Writer -> Skeptic bounded loop G04 Curator promotion side effect -> ACK lost no duplicate promotion G05 Human approval waits 12h equivalent durable wait G06 Approval arrives after WorkflowSpec v2 published run stays pinned to v1 G07 Qwen task hangs timeout + cancel/cleanup G08 Worker killed after side effect, before checkpoint idempotent resume G09 Unauthorized Writer -> Curator write policy block G10 Researcher callback replayed twice one domain transition G11 Orchestrator DB/service restart state recovery G12 Dossier context revision changed mid-run stale-input handling G13 Budget exhausted pause/escalate, not silent continue G14 Engine unavailable canonical audit remains queryable G15 Corrupted engine event reject / quarantine G16 Module output hash mismatch integrity failure G17 Cancellation during retry backoff deterministic terminal state G18 Child task fails after parent success explicit compensation/partial state G19 Qwen high-priority request arrives under load orchestration yields resources G20 Workflow engine switched for same canonical spec domain semantics preserved
| Engine | Mandatory spikes | Key risk |
|---|---|---|
| Temporal | Long wait, signals, worker restart, activity retry, side-effect replay protection, workflow version pinning. | Operational complexity / footprint; Temporal semantics leaking into domain model. |
| Prefect | Worker outage, retry, schedule, concurrency limits, deployment restart, result/state persistence. | Whether durability is sufficient for long-lived cross-module workflows. |
| LangGraph | Checkpoint, interrupt/resume, human correction, state migration, Qwen loop recovery. | Agent graph accidentally becoming global workflow/state source of truth. |
| Kestra | Event trigger, multi-language task, retry, pause/resume, worker isolation, UI trace. | JVM/platform overhead and policy leakage into YAML/plugin surface. |
| Band | Meaning |
|---|---|
| PASS | Golden semantics preserved; no critical gate violation. |
| PASS_WITH_LIMITS | Correctness passes, but operational/resource limitations require bounded role. |
| SPIKE_MORE | Insufficient evidence; targeted rerun required. |
| REJECT_FOR_ROLE | Critical semantic, security or resource gate fails for the tested role. |
Orchestration не имеет права «победить» benchmark ценой деградации основной LLM. Поэтому ресурсные тесты идут совместно с контролируемой Qwen-нагрузкой.
Phase A — idle baseline measure: host CPU/RAM, engine idle footprint, DB footprint Phase B — orchestration only run: 1 / 5 / 20 concurrent workflows measure: queue delay, worker CPU/RAM, DB writes, recovery time Phase C — Qwen baseline fixed prompt set -> capture Qwen p50/p95 latency + throughput Phase D — co-load same Qwen prompt set + orchestration workload capture delta vs Phase C Phase E — failure under co-load worker kill / engine restart / timeout / retries while Qwen active NO NUMBERS ARE FILLED UNTIL SERVER2 RUN.
| Measurement | Record |
|---|---|
| Environment | OS, kernel, CPU, RAM, GPU, storage, container/runtime versions. |
| Engine | Name, exact version/commit, config, DB version. |
| Qwen | Model build/quantization/runtime, context, concurrency. |
| Workload | Golden case IDs, concurrency, failure seed, run count. |
| Outputs | JSON metrics, logs, canonical trace, engine trace, resource snapshots. |
duplicate irreversible domain side effect = 0 lost canonical workflow transition = 0 unauthorized cross-module execution = 0 stale input silently accepted = 0 old run silently moved to new workflow version = 0 missing audit for terminal decision = 0 recovery to semantically wrong step = 0 engine-specific ID replacing canonical ID = 0 engine outage destroying canonical readability = 0 resource policy bypass under server2 pressure = 0
Backend retries are never sufficient alone. Domain side-effect endpoint requires canonical idempotency key and ledger verification.
WorkflowRun pins WorkflowSpec version; definition update never mutates active run semantics silently.
Engine cannot invoke a module merely because graph/YAML/activity says so. Canonical permission resolver authorizes every protected transition.
Terminal state without trace, policy version, decision reason and relevant input hashes is invalid.
1. Pin engine + DB + adapter versions.
2. Build the same canonical WorkflowSpec fixtures.
3. Reset test DB / side-effect ledger.
4. Run deterministic happy-path suite.
5. Run retry/timeout suite.
6. Run kill/restart suite.
7. Run duplicate/replay suite.
8. Run permission/version/stale-input suite.
9. Run Qwen coexistence suite on server2.
10. Export artifacts:
- canonical_trace.jsonl
- engine_trace.*
- metrics.json
- resource_samples.csv
- failures.json
- environment.json
11. Compare against hard gates.
12. Produce ADR evidence table: REUSE / ADAPT / BUILD / REJECT_FOR_ROLE.
| Role | Leading hypothesis before real run | What would change decision |
|---|---|---|
| Durable cross-module workflows | Temporal | Resource/operational cost too high or canonical adapter complexity unacceptable. |
| Operational Python jobs | Prefect | Recovery semantics fail required golden cases or footprint unexpectedly high. |
| Agent-local Qwen graph | LangGraph optional | Clear reduction in custom state-machine code without domain-state lock-in. |
| Declarative/event platform | Kestra reference/optional | Operational UI/integration value materially outweighs platform footprint. |
AI_orchestration_5_workflow_policy_и_state_machine.html