Skip to main content

Module report_synth

Module report_synth 

Source
Expand description

SRD-109 — report synthesis: the workload’s structure IS the report definition.

When a workload carries no explicit report: block, this module synthesizes one from the structural fixtures — key_metrics designations on phases and anchor cues on scenario sweeps — and the result is a serde_json mapping fed through the SAME crate::report::parse_report entry the YAML path uses. That is the affine contract made literal: everything synthesized is expressible by hand in the SRD-46 grammar, and nmbrs report synth dumps exactly what would be hand-written.

Well-formedness is enforced here, at synthesis (= report) time: a designated family that no op emits, and a designated phase whose activations multiply through a NON-anchored sweep (a silent flatten), are hard errors carrying the fix in the message. There are no implied aggregates anywhere: designations carry their aggregate by grammar (enforced at workload parse), the SRD-91 spine columns carry contract-level defaults declared in this module, and everything else is an error.

MVP scope decisions (documented, revisitable):

  • The spine table rows are phases with activation cardinality 1 (not under any sweep). View-attached phases live in their view’s table; un-anchored looped phases WITHOUT designations are listed in a text note instead of silently aggregated.
  • View tables carry designation columns only (no auto spine columns), keyed by the anchor sweep’s coordinate label(s).
  • The rollup window is a fixed generous lookback ([WINDOW]); the execution selection narrows actual sample ranges.

Functions§

synthesize
Synthesize the report mapping for a workload with no explicit report: block. Ok(None) when the workload has an explicit block (synthesis suppressed). Errors are the SRD-109 well-formedness contract.
synthesize_forced
synthesize without the explicit-block suppression: the section synthesized from the structural fixtures IRRESPECTIVE of any report: block. This is what nmbrs report synth dumps and what --synthesized renders — the affine mirror is always inspectable, even (especially) when a hand-tuned block has diverged from it.
synthesize_forced_for
synthesize_forced scoped to ONE scenario when the caller knows which ran (a session records it): the walk visits only that scenario, so views carry only phases reachable in the execution — no structurally-empty column groups from sibling scenarios. None, or a name the workload doesn’t declare, falls back to the all-scenarios union.
synthesize_yaml
Dump the synthesized section as a report: YAML block — the affine round-trip surface (nmbrs report synth): copy, paste into the workload, edit, and synthesis is suppressed in favor of the hand-tuned version.