Skip to main content

Module report

Module report 

Source
Expand description

§7.3 terminal-report payload validation (design.md §7.3).

Validates the structural shape of a node.report payload — success required; optional summary, cancelled/reason, discussion_items, spinoff_proposals, wrap_up_recommendations — before the reducer ever projects it. Lives in octl-core (not the CLI) so the supervisor can validate child reports with the same rules it would consume (design.md §7.3 step 3), rather than copying the validator or depending on the CLI crate.

Errors are domain-typed (ReportValidationError); the CLI maps them to its CliError envelope at the boundary.

§Two validation modes

  • Strict (validate_report_payload) — the whole payload passes or the first schema violation is returned. Used by node report (an agent self-submission) and merge-recovery’s synthesized report, where the caller controls the shape and a malformed field is a real bug to surface.
  • Lenient advisory (sanitize_report_advisory) — the REQUIRED and correctness-bearing fields (success, cancelled/reason) are still validated strictly, but the advisory sections (summary, discussion_items, spinoff_proposals, wrap_up_recommendations) degrade gracefully: a malformed element is dropped and reported as a machine-readable AdvisoryWarning rather than rejecting the whole payload. Used by run merge --report-file so an advisory-field typo can no longer block a clean, already-committed code merge (issue merge-report-schema-lenience).

Structs§

AdvisoryWarning
A machine-readable warning that one advisory report field (or one element of an advisory array) was dropped during lenient sanitization (issue merge-report-schema-lenience).
SanitizedReport
The result of sanitize_report_advisory: a report with malformed advisory sections removed, plus the machine-readable AdvisoryWarnings describing every drop.

Enums§

ReportOrigin
The typed provenance of a node.report — WHO authored it (issue typed-report-origin).
ReportValidationError
A §7.3 report payload failed structural validation.

Constants§

REPORT_ORIGIN_KEY
The report-payload key under which a typed ReportOrigin is serialized (issue typed-report-origin).
VIA_EXPLICIT_MERGE
The legacy via marker run merge stamps on the terminal node.report it appends after a clean merge, alongside the typed ReportOrigin::RunMerge. This is the octl-cli/octl-core contract point: the CLI (crates/octl-cli/src/run/merge.rs) writes it, and — for a legacy on-disk report carrying NO origin field — ReportOrigin::report_is_confirmed_merge reads it as the fallback merge signal. Retained for backward compatibility with pre-typed-origin runs and downgrade-reading older CLIs; the typed origin is the authority for a report that carries one (issue retire-via-string). Lives here beside REPORT_ORIGIN_KEY as a wire-protocol constant, and is re-exported at the crate root (octl_core::VIA_EXPLICIT_MERGE) for the CLI writers.

Functions§

sanitize_report_advisory
Validate a §7.3 report payload with lenient advisory handling — the merge-first posture of run merge --report-file (issue merge-report-schema-lenience).
validate_report_payload
Validate a §7.3 report payload’s structural shape.