Skip to main content

Module report_anchor

Module report_anchor 

Source
Expand description

Anchor resolution for nmbrs report --add (SRD-64 §6.1).

Decides where in the workload YAML a promoted report item should live: workload root, a named scenario / phase / op-template, or — when --contextual <mode> is used — a scope derived from the session’s emitted data.

§Inputs

  • The active session’s metrics.db (label vocabularies + session_metadata rows).
  • The nmbrs_workload::report::ReportItem the user is promoting, with its where / by filter clauses parsed out.
  • The CLI anchor flag — none / --at / --contextual.

§Output

A nmbrs_workload::edit::Anchor plus a human-readable diagnostic string the dispatcher prints before the YAML write.

§Levels supported today

LevelSourcePhase D status
rootalways availableshipped
scenariosession_metadata.scenarioshipped
phaselabel_key.key='phase'shipped
oprequires schema extensionhard error

Op-template anchoring needs an op_template label key that the runtime doesn’t currently emit. When it does, adding it here is one match arm + one query.

Structs§

AnchorResolution
Resolved anchor + a diagnostic line describing how the resolver decided.

Enums§

AnchorFlag
CLI anchor flag, pre-parsed from the --at / --contextual command-line surface. Mirrors the SRD-64 §6.1 grammar.

Functions§

resolve
Resolve an anchor for item in db_path’s session, honouring flag. Returns the chosen anchor + a one-line diagnostic the dispatcher prints before writing.