Autotune¶
The autotune subsystem provides tools for identifying unknown system parameters and discovering governing dynamics from raw data.
Why this subsystem is review-oriented¶
Autotune is designed as an evidence generator before controller changes, not as a direct production control channel. It turns observed traces into candidate hypotheses that humans can review against domain constraints and safety policy.
In practical usage, teams typically use it to:
- discover coupling hypotheses in previously unmapped domains,
- validate model-form assumptions before full policy activation,
- and generate bounded transfer proposals that can be replayed and compared.
The review-only boundary is intentional: it preserves explainability and prevents autonomous, opaque changes from entering live control surfaces without policy inspection.
Phase-SINDy Symbolic Discovery¶
The PhaseSINDy module implements Sparse Identification of Nonlinear
Dynamics tailored for phase oscillator networks. It allows the
orchestrator to act as an "Autonomous Physicist," reverse-engineering
the differential equations of a system from observed time-series data.
Theoretical Basis¶
SINDy assumes that the dynamics \(\dot{\theta}\) can be represented as a sparse linear combination of terms from a library \(\Theta\):
For SPO, the library \(\Theta\) includes: 1. Constant terms: Representing natural frequencies \(\omega_i\). 2. Coupling terms: \(\sin(\theta_j - \theta_i)\) representing Kuramoto-style interactions.
The model uses Sequentially Thresholded Least Squares (STLSQ) to discover the sparsest set of coefficients that explain the data, effectively filtering out noise and revealing the underlying topology.
Use Cases¶
- System Identification: Discovering the coupling strength \(K_{nm}\) in a biological network where the wiring is unknown.
- Topological Verification: Verifying that a physical system actually follows the assumed Kuramoto model before engageing control logic.
- Anomaly Detection: Detecting shifts in the governing equations (e.g., a component failure that changes the interaction physics).
sindy ¶
Sparse symbolic discovery of phase-dynamics equations from trajectories.
PhaseSINDy builds per-node trigonometric libraries, fits sparse regression
coefficients, and formats discovered equations after a successful fit. Threshold
and iteration counts are validated at construction, and the optional Rust path
is remapped into the same Python coefficient layout. The class mutates only its
own coefficients and feature-name history; it does not update live coupling
state.
Classes¶
PhaseSINDy ¶
Symbolic Discovery of Phase Dynamics using SINDy.
Discovers the governing equations of a coupled oscillator network by performing sparse regression on a library of trigonometric interaction terms.
Create a SINDy estimator with validated sparsity controls.
Source code in src/scpn_phase_orchestrator/autotune/sindy.py
Methods:¶
fit ¶
Discover equations node-by-node to handle independent coupling.
Parameters¶
phases : FloatArray
Oscillator phases in radians, shape (N,).
dt : float
Integration step size.
Returns¶
list[FloatArray] Equations node-by-node to handle independent coupling.
Raises¶
ValueError If the inputs are invalid or inconsistent.
Source code in src/scpn_phase_orchestrator/autotune/sindy.py
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 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 | |
get_equations ¶
Format fitted sparse coefficients as per-node phase equations.
Returns¶
list[str] Format fitted sparse coefficients as per-node phase equations.
Raises¶
RuntimeError If the operation fails.
Source code in src/scpn_phase_orchestrator/autotune/sindy.py
Frequency Identification¶
Identifies natural frequencies \(\omega_i\) from phase time-series.
The dedicated frequency-identification reference page owns the full
mkdocstrings inventory for scpn_phase_orchestrator.autotune.freq_id. This
aggregate page links to that surface instead of declaring a second primary
mkdocstrings target for the same dataclasses.
Coupling Estimation¶
Estimates the coupling matrix \(K_{nm}\) assuming a fixed interaction model.
coupling_est ¶
Least-squares coupling estimators for observed phase trajectories.
The primary estimator fits pairwise sinusoidal Kuramoto coupling from phase-history derivatives and natural frequencies, returning a dense matrix with zero diagonal. The harmonics variant expands the regression library with higher Fourier sine and cosine terms. Both routines are offline inference helpers: they estimate parameters from caller-provided arrays and perform no runtime actuation or binding updates.
Functions:¶
estimate_coupling ¶
Estimate K_ij coupling matrix from observed phase trajectories.
Least-squares fit of dθ_i/dt - ω_i = Σ_j K_ij sin(θ_j - θ_i). Constructs the regression matrix from pairwise sin(Δθ) and solves for K_ij via pseudoinverse.
Parameters¶
phases : FloatArray (n_oscillators, n_timesteps) phase trajectories. omegas : FloatArray (n_oscillators,) natural frequencies. dt : float timestep between samples.
Returns¶
FloatArray (n_oscillators, n_oscillators) estimated coupling matrix K_ij.
Raises¶
ValueError If the inputs are invalid or inconsistent.
Source code in src/scpn_phase_orchestrator/autotune/coupling_est.py
estimate_coupling_harmonics ¶
estimate_coupling_harmonics(
phases: FloatArray,
omegas: FloatArray,
dt: float,
n_harmonics: int = 2,
) -> dict[str, FloatArray]
Estimate coupling with higher Fourier harmonics.
Fits: dθ_i/dt - ω_i = Σ_j Σ_k [a_jk sin(k·Δθ) + b_jk cos(k·Δθ)] for k = 1..n_harmonics.
Real biological oscillators have non-sinusoidal coupling (Stankovski 2017, Rev. Mod. Phys.).
Returns dict with keys 'sin_1', 'cos_1', 'sin_2', 'cos_2', ... each an (n, n) matrix of coefficients.
Parameters¶
phases : FloatArray
Oscillator phases in radians, shape (N,).
omegas : FloatArray
Natural frequencies in rad/s, shape (N,).
dt : float
Integration step size.
n_harmonics : int
Number of harmonics to fit.
Returns¶
dict[str, FloatArray] Coupling with higher Fourier harmonics.
Raises¶
ValueError If the inputs are invalid or inconsistent.
Source code in src/scpn_phase_orchestrator/autotune/coupling_est.py
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 | |
End-to-End Pipeline¶
The pipeline module composes phase extraction, frequency identification, SINDy-style discovery, and coupling estimation into reviewable auto-binding candidate records.
pipeline ¶
Offline auto-tune pipeline from raw channels to inferred coupling settings.
identify_binding_spec extracts per-channel phases and dominant frequencies,
estimates a non-negative coupling matrix, initializes zero phase lags, and asks
the universal prior for a critical-coupling estimate. The result is an
AutoTuneResult for review or downstream proposal generation; the function
does not write a binding file, change runtime configuration, or activate the
inferred parameters.
Classes¶
AutoTuneResult
dataclass
¶
AutoTuneResult(
omegas: list[float],
knm: FloatArray,
alpha: FloatArray,
n_layers: int,
dominant_freqs: list[float],
K_c_estimate: float,
)
Output of the auto-tune pipeline: inferred frequencies and coupling.
Functions:¶
identify_binding_spec ¶
identify_binding_spec(
time_series: FloatArray,
fs: float,
n_layers: int | None = None,
) -> AutoTuneResult
Full auto-tune pipeline: raw multichannel data → coupling parameters.
- Phase extraction (Hilbert) per channel → ω_i
- Coupling estimation (least squares) → K_ij
- K_c estimate from universal prior
Parameters¶
time_series : FloatArray (n_channels, n_samples) raw data. fs : float sampling frequency in Hz. n_layers : int | None override number of layers (default: n_channels).
Returns¶
AutoTuneResult The result.
Raises¶
ValueError If the inputs are invalid or inconsistent. TypeError If an argument has the wrong type.
Source code in src/scpn_phase_orchestrator/autotune/pipeline.py
Reviewable Binding Proposals¶
The binding-proposal module converts time-series CSV, event-log JSON, and graph
JSON payloads into StudioProjectState records containing reviewable
binding_spec.yaml text, confidence factors, provenance, and binding-validator
diagnostics.
binding_proposal ¶
Review-only binding proposal builders for CSV, event-log, and graph inputs.
The module converts imported source text into StudioProjectState proposals
with provenance, confidence factors, validator output, and inferred channel
assignments. CSV samples are checked for numeric finite channels, event logs for
event structure, and graph payloads for node/edge integrity before YAML is
generated. The functions never activate bindings or mutate runtime state; they
prepare operator-review artifacts.
Classes¶
Functions:¶
propose_binding_from_time_series_csv ¶
propose_binding_from_time_series_csv(
csv_text: str,
*,
sample_rate_hz: float | None,
project_name: str,
sindy_options: SindyOptions | None = None,
) -> StudioProjectState
Propose a review-only binding for a tabular time-series replay.
Parameters¶
csv_text : str Raw CSV text. sample_rate_hz : float | None Sampling rate in Hz. project_name : str Name of the project. sindy_options : SindyOptions | None Operator options for phase-SINDy discovery — the sparsity threshold and the confidence policy. Defaults to the conservative shared options.
Returns¶
StudioProjectState A review-only binding for a tabular time-series replay.
Raises¶
ValueError If the inputs are invalid or inconsistent.
Source code in src/scpn_phase_orchestrator/autotune/binding_proposal.py
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 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | |
propose_binding_from_event_log ¶
Propose a review-only binding for a JSON event log.
Parameters¶
json_text : str Raw JSON text. project_name : str Name of the project.
Returns¶
StudioProjectState A review-only binding for a JSON event log.
Source code in src/scpn_phase_orchestrator/autotune/binding_proposal.py
propose_binding_from_graph ¶
Propose a review-only binding for a graph JSON payload.
Parameters¶
json_text : str Raw JSON text. project_name : str Name of the project.
Returns¶
StudioProjectState A review-only binding for a graph JSON payload.
Raises¶
ValueError If the inputs are invalid or inconsistent.
Source code in src/scpn_phase_orchestrator/autotune/binding_proposal.py
Time-Series Discovery Evidence¶
The discovery module extracts deterministic review evidence from raw time-series tables: sparse derivative regressions, phase-aware Kuramoto SINDy fits for phase-like columns, residual-scored SINDy library selection, correlation graph edges, lagged directed graph inference, connected-component clusters, and regular time-column sample-rate inference. Non-phase data carries an explicit phase-SINDy skipped status. The reports are JSON-ready provenance for binding review and do not promote actuation.
discovery ¶
Deterministic evidence extraction for review-only auto-binding proposals.
Classes¶
TimeSeriesDiscoveryConfig
dataclass
¶
TimeSeriesDiscoveryConfig(
correlation_threshold: float = 0.75,
sindy_threshold: float = 0.05,
phase_sindy_threshold: float = 0.05,
learned_graph_threshold: float = 0.2,
)
Configuration for deterministic review evidence extraction.
Methods:¶
__post_init__ ¶
Validate and canonicalise scalar discovery thresholds.
Source code in src/scpn_phase_orchestrator/autotune/discovery.py
TimeSeriesDiscoveryReport
dataclass
¶
TimeSeriesDiscoveryReport(
sample_period_s: float,
sample_count: int,
columns: tuple[str, ...],
sindy: Mapping[str, JsonValue],
phase_sindy: Mapping[str, JsonValue],
sindy_model_selection: Mapping[str, JsonValue],
learned_graph: Mapping[str, JsonValue],
correlation_graph: Mapping[str, JsonValue],
clustering: Mapping[str, JsonValue],
)
JSON-ready discovery report for an imported time-series table.
Attributes¶
sindy_sparsity
property
¶
Sparse-regression support fraction reported by the SINDy evidence.
Returns¶
float Sparse-regression support fraction reported by the SINDy evidence.
correlation_graph_density
property
¶
Density of the thresholded correlation graph evidence.
Returns¶
float Density of the thresholded correlation graph evidence.
cluster_coverage
property
¶
Fraction of channels covered by the largest discovered cluster.
Returns¶
float Fraction of channels covered by the largest discovered cluster.
confidence_evidence
property
¶
Confidence factors derived from fitted discovery evidence blocks.
Returns¶
dict[str, float] Confidence factors derived from fitted discovery evidence blocks.
phase_sindy_confidence
property
¶
Honest tier and discovery posture for the phase-SINDy fit.
Returns¶
SindyConfidence
The confidence verdict; a self-fit is capped at the partial
tier and can never be externally_validated.
Methods:¶
discovered_dynamics ¶
discovered_dynamics(
*,
policy: SindyConfidencePolicy = DEFAULT_SINDY_CONFIDENCE_POLICY,
) -> DiscoveredDynamics
Return the operator-facing discovered-dynamics record.
Parameters¶
policy : SindyConfidencePolicy, optional Thresholds separating a credible discovery from weak evidence.
Returns¶
DiscoveredDynamics The recovered equations and coupling edges paired with the honest confidence verdict and a provenance hash.
Source code in src/scpn_phase_orchestrator/autotune/discovery.py
to_audit_record ¶
Return the complete JSON-safe discovery evidence record.
Returns¶
dict[str, JsonValue] The complete JSON-safe discovery evidence record.
Source code in src/scpn_phase_orchestrator/autotune/discovery.py
Functions:¶
infer_sample_rate_from_time_column ¶
infer_sample_rate_from_time_column(
rows: Sequence[Mapping[str, str]],
fieldnames: Sequence[str],
) -> tuple[float, str]
Infer a sampling rate from a regular finite time column.
Parameters¶
rows : Sequence[Mapping[str, str]] Data rows. fieldnames : Sequence[str] CSV field names.
Returns¶
tuple[float, str] A sampling rate from a regular finite time column.
Raises¶
ValueError If the inputs are invalid or inconsistent.
Source code in src/scpn_phase_orchestrator/autotune/discovery.py
discover_time_series_structure ¶
discover_time_series_structure(
samples: FloatArray,
*,
columns: Sequence[str],
sample_period_s: float,
config: TimeSeriesDiscoveryConfig | None = None,
) -> TimeSeriesDiscoveryReport
Extract sparse-derivative, graph, and cluster evidence from a table.
Parameters¶
samples : FloatArray Sample array. columns : Sequence[str] Column names. sample_period_s : float Sample period in seconds. config : TimeSeriesDiscoveryConfig | None The configuration object.
Returns¶
TimeSeriesDiscoveryReport Sparse-derivative, graph, and cluster evidence from a table.
Raises¶
ValueError If the inputs are invalid or inconsistent.
Source code in src/scpn_phase_orchestrator/autotune/discovery.py
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 | |
Phase-SINDy Discovery Confidence¶
The confidence module classifies a phase-SINDy fit into an honest validation
tier and a discovery posture. A fit on the operator's own data is
self-consistency, not independent validation, so the classifier cannot award
the externally_validated tier: its ceiling is partial and its default is
scaffold. The posture is discovered only for a well-determined fit that
explains the derivative variance, and otherwise insufficient_evidence or
refused, each with human-readable reasons.
sindy_confidence ¶
Honest confidence classification for phase-SINDy discovery.
A phase-SINDy fit recovers a Kuramoto-style coupling structure from the
operator's own time series. Fitting a model to the same data it was learnt
from is self-consistency, not independent validation, so this classifier is
built so that it cannot award the externally_validated tier — that tier
is reserved for clearing an independent-reference test on real data, which a
self-fit can never do. The ceiling here is partial; the honest default is
scaffold.
The classifier is pure: it reads the numeric summary of a fit (its status, R², sample and node counts, and term counts) and returns a tier plus a discovery posture with human-readable reasons. It performs no I/O, no fitting, and no mutation, so it is trivially testable and deterministic.
Postures¶
discovered
A fit was performed, explains the data well (R² at or above the policy
threshold), is well determined (enough derivative samples per parameter),
and selected at least one active term. Tier partial.
insufficient_evidence
A fit was performed but the evidence is too weak to stand behind the
recovered structure (poor R², under-determined, or no active terms). Tier
scaffold.
refused
No fit was performed at all (the discovery step skipped this library).
Tier scaffold.
Classes¶
SindyConfidencePolicy
dataclass
¶
Thresholds that separate a credible discovery from weak evidence.
Parameters¶
min_r_squared : float
Smallest coefficient of determination a fit must reach before its
recovered structure may be called discovered. The default of
0.9 demands the model explain the large majority of the derivative
variance.
min_samples_per_parameter : float
Smallest ratio of regressed derivative samples to per-node parameters a
fit must reach before it is considered well determined. The default of
5.0 keeps the per-node regression comfortably over-determined.
SindyConfidence
dataclass
¶
SindyConfidence(
tier: str,
posture: str,
r_squared: float | None,
samples_per_parameter: float | None,
reasons: tuple[str, ...] = tuple(),
)
The honest confidence verdict for a single phase-SINDy fit.
Parameters¶
tier : str
Validation tier, drawn from the canonical vocabulary. Never
externally_validated — a self-fit cannot earn it.
posture : str
Discovery posture: discovered, insufficient_evidence or
refused.
r_squared : float or None
The scale-free fit quality the verdict was based on, or None when
no fit was performed.
samples_per_parameter : float or None
Regressed derivative samples per per-node parameter, or None when
no fit was performed or the parameter count was unknown.
reasons : tuple of str
Human-readable justifications for the verdict, in evaluation order.
Methods:¶
to_audit_record ¶
Return the JSON-safe confidence record.
Returns¶
dict A JSON-serialisable mapping of the verdict fields.
Source code in src/scpn_phase_orchestrator/autotune/sindy_confidence.py
Functions:¶
classify_phase_sindy_confidence ¶
classify_phase_sindy_confidence(
*,
status: str,
r_squared: float | None,
sample_count: int,
node_count: int,
active_terms: int,
total_terms: int,
sparsity: float,
policy: SindyConfidencePolicy = DEFAULT_SINDY_CONFIDENCE_POLICY,
) -> SindyConfidence
Classify a phase-SINDy fit into an honest tier and discovery posture.
Parameters¶
status : str
The fit status from the discovery block. Any value other than
"fitted" is a skip and yields the refused posture.
r_squared : float or None
The scale-free coefficient of determination of the fit, or None
when no fit was performed.
sample_count : int
Number of derivative samples actually regressed.
node_count : int
Number of oscillator nodes; equal to the per-node parameter count of
the Kuramoto sine-difference library.
active_terms : int
Number of coefficients selected above the sparsity threshold.
total_terms : int
Total number of coefficients in the library.
sparsity : float
Support-sparsity fraction of the fit; carried through for the record
but not itself a gate.
policy : SindyConfidencePolicy, optional
Thresholds separating a credible discovery from weak evidence.
Returns¶
SindyConfidence The tier, posture, the quantities the verdict rested on, and the ordered reasons.
Source code in src/scpn_phase_orchestrator/autotune/sindy_confidence.py
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 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | |
classify_phase_sindy_block ¶
classify_phase_sindy_block(
block: Mapping[str, Any],
*,
policy: SindyConfidencePolicy = DEFAULT_SINDY_CONFIDENCE_POLICY,
) -> SindyConfidence
Classify a phase-SINDy evidence block mapping.
A thin, pure adapter over :func:classify_phase_sindy_confidence that
reads the fields emitted by the discovery report's phase_sindy block.
Parameters¶
block : Mapping
A phase_sindy evidence block carrying at least status; fitted
blocks additionally carry r_squared, sample_count,
node_count, active_terms, total_terms and sparsity.
policy : SindyConfidencePolicy, optional
Thresholds separating a credible discovery from weak evidence.
Returns¶
SindyConfidence The honest confidence verdict for the block.
Source code in src/scpn_phase_orchestrator/autotune/sindy_confidence.py
Operator SINDy Options¶
The options module bundles the two knobs an operator turns when running
phase-SINDy discovery through a binding proposal or the CLI: the sparsity
threshold that decides which coupling coefficients survive, and the confidence
policy that decides how strong a fit must be before it is called discovered.
sindy_options ¶
Operator-facing options for the phase-SINDy discovery honesty surface.
A single bundle carries the two knobs an operator turns when running phase-SINDy
discovery through a binding proposal or the CLI: the sparsity threshold that
decides which coupling coefficients survive, and the confidence policy that
decides how strong a fit must be before its recovered structure is called
discovered. Keeping them together means the binding proposal and the CLI
configure discovery the same way without duplicating the mapping.
Classes¶
SindyOptions
dataclass
¶
SindyOptions(
phase_sindy_threshold: float = 0.05,
confidence_policy: SindyConfidencePolicy = DEFAULT_SINDY_CONFIDENCE_POLICY,
)
Operator configuration for phase-SINDy discovery and its confidence.
Parameters¶
phase_sindy_threshold : float
Sparsity threshold below which a coupling coefficient is dropped from
the phase-SINDy fit. Must be finite and non-negative; defaults to the
discovery default of 0.05.
confidence_policy : SindyConfidencePolicy
Thresholds separating a credible discovery from weak evidence. Defaults
to the conservative shared policy.
Methods:¶
__post_init__ ¶
Validate the threshold is finite and non-negative.
Source code in src/scpn_phase_orchestrator/autotune/sindy_options.py
to_discovery_config ¶
Return the discovery config carrying the phase-SINDy threshold.
Only the phase-SINDy threshold is overridden; the other discovery thresholds keep their defaults.
Returns¶
TimeSeriesDiscoveryConfig
A config with phase_sindy_threshold set from these options.
Source code in src/scpn_phase_orchestrator/autotune/sindy_options.py
Discovered-Dynamics Record¶
The discovered-dynamics module presents the recovered equations and per-node coupling edges paired — inseparably — with the confidence verdict, so a skipped or weak fit still produces a record but is never mistaken for a validated model. Every record carries a canonical-JSON SHA-256 content hash for a tamper-evident provenance trail.
discovered_dynamics ¶
Operator-facing record of dynamics discovered by phase-SINDy.
Where :mod:scpn_phase_orchestrator.autotune.discovery emits the raw evidence
blocks and :mod:scpn_phase_orchestrator.autotune.sindy_confidence judges how
far to trust a fit, this module presents the result the way an operator reads
it: the recovered equations, the per-node coupling edges, and — inseparably —
the honest confidence verdict that says how much weight the structure carries.
The recovered equations are never shown without their posture. A skipped or
weak fit still produces a record, but its confidence marks it refused or
insufficient_evidence so the equations cannot be mistaken for a validated
model. Every record carries a canonical-JSON SHA-256 content hash for a
tamper-evident provenance trail.
Classes¶
DiscoveredDynamics
dataclass
¶
DiscoveredDynamics(
library: str,
status: str,
equations: tuple[str, ...],
coupling_edges: tuple[Mapping[str, Any], ...],
confidence: SindyConfidence,
)
A discovered phase-dynamics model paired with its honest confidence.
Parameters¶
library : str
The feature library the fit used, e.g. the Kuramoto sine-difference
library.
status : str
The fit status from the discovery block ("fitted" or a skip
reason).
equations : tuple of str
Human-readable recovered equations, one per node; empty when no fit was
performed.
coupling_edges : tuple of Mapping
Per-node coupling edges (source, target, coefficient,
abs_coefficient); empty when no fit was performed.
confidence : SindyConfidence
The honest tier and discovery posture for the fit.
Attributes¶
content_hash
property
¶
Canonical-JSON SHA-256 digest of the record content.
Returns¶
str Lowercase hexadecimal SHA-256 digest of the canonical payload.
Methods:¶
to_audit_record ¶
Return the complete JSON-safe record, including the content hash.
Returns¶
dict
The canonical payload with the content_hash provenance field
appended.
Source code in src/scpn_phase_orchestrator/autotune/discovered_dynamics.py
Functions:¶
discovered_dynamics_from_block ¶
discovered_dynamics_from_block(
block: Mapping[str, Any],
*,
policy: SindyConfidencePolicy = DEFAULT_SINDY_CONFIDENCE_POLICY,
) -> DiscoveredDynamics
Build an operator-facing record from a phase-SINDy evidence block.
Parameters¶
block : Mapping
A phase_sindy evidence block as emitted by the discovery report.
policy : SindyConfidencePolicy, optional
Thresholds separating a credible discovery from weak evidence.
Returns¶
DiscoveredDynamics The recovered equations and coupling edges paired with the honest confidence verdict.
Source code in src/scpn_phase_orchestrator/autotune/discovered_dynamics.py
Replay-Only Learners¶
The learner module exposes PPO-like, SAC-like, and hybrid-physics proposal
generators behind the existing replay gates. These helpers emit audit records
and keep actuation_permitted false.
learners ¶
Learner-shaped replay-only autotune proposal generators.
Classes¶
LearnerPolicyProposal
dataclass
¶
LearnerPolicyProposal(
learner_kind: str,
policy_search: ReplayPolicySearchResult,
actuation_permitted: bool = False,
learner_parameters: AuditMapping = dict(),
physics_prior: AuditMapping = dict(),
)
Replay-trained learner proposal record for audit review only.
Methods:¶
__post_init__ ¶
Validate the replay-only learner proposal envelope.
Source code in src/scpn_phase_orchestrator/autotune/learners.py
to_audit_record ¶
Return an audit-serialisable learner proposal record.
Returns¶
dict[str, object] An audit-serialisable learner proposal record.
Source code in src/scpn_phase_orchestrator/autotune/learners.py
Functions:¶
generate_ppo_like_proposal ¶
generate_ppo_like_proposal(
seed: KnobPolicyCandidate,
evaluator: ReplayPolicyEvaluator,
*,
seed_value: int | None = None,
reward_config: RewardConfig | None = None,
proposal_config: PolicyProposalConfig | None = None,
) -> LearnerPolicyProposal
Generate a deterministic PPO-shaped proposal from replay evaluations.
Parameters¶
seed : KnobPolicyCandidate Seed for the deterministic RNG. evaluator : ReplayPolicyEvaluator The objective evaluator. seed_value : int | None Seed value for the deterministic RNG. reward_config : RewardConfig | None The reward configuration. proposal_config : PolicyProposalConfig | None The proposal configuration.
Returns¶
LearnerPolicyProposal A deterministic PPO-shaped proposal from replay evaluations.
Source code in src/scpn_phase_orchestrator/autotune/learners.py
generate_sac_like_proposal ¶
generate_sac_like_proposal(
seed: KnobPolicyCandidate,
evaluator: ReplayPolicyEvaluator,
*,
seed_value: int | None = None,
reward_config: RewardConfig | None = None,
proposal_config: PolicyProposalConfig | None = None,
) -> LearnerPolicyProposal
Generate a deterministic SAC-shaped proposal from replay evaluations.
Parameters¶
seed : KnobPolicyCandidate Seed for the deterministic RNG. evaluator : ReplayPolicyEvaluator The objective evaluator. seed_value : int | None Seed value for the deterministic RNG. reward_config : RewardConfig | None The reward configuration. proposal_config : PolicyProposalConfig | None The proposal configuration.
Returns¶
LearnerPolicyProposal A deterministic SAC-shaped proposal from replay evaluations.
Source code in src/scpn_phase_orchestrator/autotune/learners.py
generate_hybrid_physics_proposal ¶
generate_hybrid_physics_proposal(
seed: KnobPolicyCandidate,
evaluator: ReplayPolicyEvaluator,
*,
critical_coupling_estimate: float,
seed_value: int | None = None,
reward_config: RewardConfig | None = None,
proposal_config: PolicyProposalConfig | None = None,
) -> LearnerPolicyProposal
Generate a replay proposal shaped by a critical-coupling prior.
Parameters¶
seed : KnobPolicyCandidate
Seed for the deterministic RNG.
evaluator : ReplayPolicyEvaluator
The objective evaluator.
critical_coupling_estimate : float
Estimated critical coupling K_c.
seed_value : int | None
Seed value for the deterministic RNG.
reward_config : RewardConfig | None
The reward configuration.
proposal_config : PolicyProposalConfig | None
The proposal configuration.
Returns¶
LearnerPolicyProposal A replay proposal shaped by a critical-coupling prior.
Source code in src/scpn_phase_orchestrator/autotune/learners.py
Operator use model¶
Autotune in this system is intended as a discovery and review surface first. Its outputs should be understood as candidate proposals with evidence, not as immediate production actions.
That separation is reflected by the actuation_permitted=false audit flag and
the existing replay-only flow: operators can inspect candidate dynamics, compare
against domain constraints, and explicitly promote a policy only through normal
supervision gates.
In practical terms, autotune is most valuable in three moments: - preflight analysis on unknown domains, - topological recovery after a major drift event, - and proposal generation for domain-specific handoff when new systems are onboarded.
The same evidence record model used here is what allows these candidate policies to be replayed and compared across time windows and boundary profiles.