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 bynode 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-readableAdvisoryWarningrather than rejecting the whole payload. Used byrun merge --report-fileso an advisory-field typo can no longer block a clean, already-committed code merge (issuemerge-report-schema-lenience).
Structs§
- Advisory
Warning - 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). - Sanitized
Report - The result of
sanitize_report_advisory: a report with malformed advisory sections removed, plus the machine-readableAdvisoryWarnings describing every drop.
Enums§
- Report
Origin - The typed provenance of a
node.report— WHO authored it (issuetyped-report-origin). - Report
Validation Error - A §7.3 report payload failed structural validation.
Constants§
- REPORT_
ORIGIN_ KEY - The report-payload key under which a typed
ReportOriginis serialized (issuetyped-report-origin). - VIA_
EXPLICIT_ MERGE - The legacy
viamarkerrun mergestamps on the terminalnode.reportit appends after a clean merge, alongside the typedReportOrigin::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 NOoriginfield —ReportOrigin::report_is_confirmed_mergereads 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 (issueretire-via-string). Lives here besideREPORT_ORIGIN_KEYas 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(issuemerge-report-schema-lenience). - validate_
report_ payload - Validate a §7.3 report payload’s structural shape.