Skip to content

generator: emitted JSON output HTML-escapes & < > (SetEscapeHTML not disabled) #3552

Description

@rvdlaar

Filed by /printing-press-retro from a run of GitHub Contents (scorecard 89/100, 94% verify pass, full live dogfood 99/99, printed with cli-printing-press v4.28.0).

Summary

Emitted JSON output helpers use Go's default encoder HTML-escaping, so &, <, > render as \u0026 etc. Valid JSON, but URL-bearing payloads (e.g. download_url fields with query params) become confusing for humans and break naive string-matching by agents. Output goes to a terminal or pipe, never an HTML context.

Where to look

  • Component: generator
  • Likely area: output-helper templates (the emitted JSON writers behind --json/printJSONFiltered)
  • Triggered when: any payload containing &/</> — most APIs with URLs

What we observed

  • plan/endpoint outputs on this print render & in GitHub URLs as \u0026 (flagged by the run's agentic output review; classified generator-side because the helpers are emitted DO NOT EDIT).
  • Same helpers present in huggingface, plaud, openrouter prints.

Suggested direction

enc.SetEscapeHTML(false) on the emitted JSON encoders (terminal/file writers only — there is no HTML embedding context in a printed CLI).

Acceptance criteria

  • positive: a value a&b<c> round-trips verbatim in --json output
  • negative: none identified (no HTML sink exists)

Frequency

every API

Complexity

small

Related issues

None.

Artifacts

Upload to catbox.moe failed ("Invalid uploader"). Scrubbed zips preserved locally in the printer's run proofs: manuscripts/github-contents/20260710-125244-1a986992/proofs/github-contents-{manuscripts,cli-source}.zip. Retro doc: same directory, 20260711-021500-retro-github-contents-pp-cli.md.


Generated by /printing-press-retro · CLI Printing Press

Metadata

Metadata

Assignees

No one assigned

    Labels

    comp:generatorpriority:P3retroResults from a Printing Press retrospective session which identifies improvements or fixes

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions