Skip to content

fix: escape report machine-status JSON - #185

Open
randlee wants to merge 1 commit into
codex/render-json-list-varsfrom
codex/report-json-escaping
Open

randlee wants to merge 1 commit into
codex/render-json-list-varsfrom
codex/report-json-escaping

Conversation

@randlee

@randlee randlee commented Sep 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • render dynamic machine-status JSON values with MiniJinja's tojson filter
  • preserve native JSON types instead of forcing every value through a quoted string
  • add adversarial round-trip coverage for quotes, backslashes, newlines, markup-like text, numbers, and nested finding counts

Why this is a separate stack layer

This is the second independently reviewable harmonization change after #184. It changes only JSON serialization in the two report templates and the focused regression test. Report schema alignment (for example, blocking_ids/deliverable contract differences) is intentionally out of scope.

The change follows the sc-compose/MiniJinja boundary: structured values are serialized with the formatter's JSON encoder instead of hand-quoting template substitutions. That produces valid fenced JSON without HTML entity workarounds or permissive rendering flags.

Validation

  • fresh Luna validation against adversarial values
  • focused TemplateContractTests.test_quality_report_machine_json_round_trips_strings
  • just lint
  • just test
  • git diff --check

Stack

@randlee
randlee added this pull request to stack #186 September 20, 2026 21:13

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant