Skip to main content

Module render

Module render 

Source
Expand description

Rendering: IR answers → the jev-1 wire answer shapes.

Raw distributions come from the mock; everything else on the wire is derived through hyprstream-decision’s normative functions — argmax label (D6 tie-break), expected score (Σ i·pᵢ), confidence-from-peakedness (S6a formulas), the legend echo. The stub never hand-computes a derived statistic, so the facade cannot drift from the profile.

Abstention on the facade (a superset concept — upstream has no abstain value) renders the value positions as JSON null: {"type": "noul", "noul": null} etc. Stock SDKs validate those fields as non-nullable and will reject an abstained answer — that is honest: abstention is only contract-stable on the Arrow surface in v1.

Functions§

entry_to_json
Convert an IR entry back to JSON (insertion order → sorted, matching serde_json’s canonical map order; duplicate keys, already rejected at validation, collapse last-wins).
render_answers
Render the full answers map for one facade request, keyed by question id.