1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
// Copyright 2024-2026 Jonathan Shook
// SPDX-License-Identifier: Apache-2.0
//! # nmbrs-runtime
//!
//! Workload execution runtime for nmbrs. Owns the async dispatch
//! loop, the adapter trait that workload backends implement, op
//! sequencing across stanzas, error-handler integration, observer
//! callbacks, and the runner that ties everything together.
//!
//! This is the integration crate — it depends on every other
//! `nb-*` library and is depended on by `nmbrs` (and by every
//! persona binary). External consumers shouldn't usually need to
//! reach into it directly; the public-facing path is `nmbrs run`
//! or [`runner::Runner`].
//!
//! ## Pieces
//!
//! - [`adapter::DriverAdapter`] — the trait every workload
//! backend implements. CQL, HTTP, stdout, testkit, plotter, and
//! user-supplied adapters all register via the inventory
//! pattern in [`adapters`].
//! - [`activity::Activity`] — one running concurrency unit. Owns
//! the cycle source, the op sequencer, the fiber pool, the
//! error router, and the metrics scope. Multiple activities
//! can run concurrently within one phase.
//! - [`runner::Runner`] — orchestrates the whole session: parse
//! workload, build component tree, route metrics, walk the
//! scenario tree, supervise activities.
//! - [`scope_tree`] / [`scene_tree`] — the canonical scenario-
//! tree shape and the runtime presentation surface (SRD 18b).
//! - [`scheduler`] — `schedule=` CLI param parses to a
//! [`scheduler::ScheduleSpec`]; the [`scheduler::TreeScheduler`]
//! walks the tree and forks concurrent siblings via
//! `tokio::JoinSet` + `Semaphore` based on per-level limits.
//! - [`observer::RunObserver`] — lifecycle callbacks (phase
//! start / progress / complete / fail). The TUI is one
//! implementor; stderr is the default.
//! - [`bindings`] / [`scope`] — workload bindings → Polydat Kernel
//! compilation, with cache-and-rebind across phase iterations.
//!
//! ## Out of scope
//!
//! - Polydat DSL parsing and compilation: see [`polydat`].
//! - Workload YAML parsing: see [`nmbrs_workload`].
//! - Component tree, instruments, cadence reporter: see
//! [`nmbrs_metrics`].
//! - Rate limiting: see [`nmbrs_rate`].
//! - Error handler primitives: see [`nmbrs_errorhandler`].
//!
//! ## See also
//!
//! - SRD 29 (`docs/SRD/29_execution_engine.md`) — the engine
//! front door: this crate's public contract surface, the
//! load-bearing axioms, and the SRD ↔ module map.
//! - SRD 01 (`docs/SRD/01_system_overview.md`) — overall
//! architecture.
//! - SRD 18b — scenario-tree, scope-tree, scheduler.
//! - SRD 22 (`docs/SRD/22_op_sequencing.md`) — op sequencing
//! and stanza model.
//! - SRD 30 (`docs/SRD/30_adapter_interface.md`) — adapter
//! trait surface.
// Polydat node registrations that need nmbrs-runtime's runtime
// services (component tree + controls + fiber context). Moved out
// of polydat itself so polydat can publish standalone — see
// `polydat_nodes/mod.rs` for the rationale.
pub
/// SRD-92 / ExecUnification Step 5a — the unified child-stream contract
/// (`ChildSource` + `Realizability`). Additive; callers land in 5b+.
pub
pub
pub
pub
pub
pub
/// Lifecycle event vocabulary: the kind-tag [`lifecycle::EventType`]
/// and its [`lifecycle::SubjectKind`], shared by the readout
/// binder and the checkpoint log.
/// SRD-86 — the optimizer service boundary: the `Optimizer`/`Objective`
/// contract + registry the phase-execution driver uses, defined here in the
/// core with no dependency on any algorithm crate. Public so algorithm crates
/// (e.g. `nmbrs-optimizers`) can register against it and the CLI can discover.
pub
/// Phase-end trigger registry — content-agnostic callbacks
/// that fire after every phase completion or failure. Used by
/// the `watch=plots` / `watch=report` CLI flags to keep an
/// external view (plot image, report html) up-to-date as the
/// run progresses.
pub
/// SRD-76 phase outcome disposition (structured
/// per-phase status + error list).
/// SRD-71 P3 phase-scoped CLI parameter overrides
/// (`<phase-pattern>.<param>=<value>`).
pub
pub
pub
/// SRD-77 refine plan — pre-computed skip set + next-execution
/// id, derived from a session's prior `phase_outcomes` rows.
/// The runner builds one when `nmbrs refine` re-attaches to an
/// existing session; the executor's phase-walk gate checks it
/// before dispatching each phase's per-cycle work.
pub
pub
pub
pub
pub
pub
pub
/// SRD-100 P2 — the per-phase status builder, re-exported for the display
/// consumer (nmbrs-tui) that now folds `active_phases` and renders each
/// phase's status line itself (the module otherwise stays crate-private).
pub use ;
/// A scratch-name suffix unique across parallel tests and processes:
/// parallel tests can read the same clock tick, so the pid and a
/// per-process sequence keep their directories apart.
pub