Skip to content

feat: summary output format modes (markdown|json) - #1

Merged
zufardhiyaulhaq merged 3 commits into
mainfrom
feat/summary-format-modes
Sep 10, 2026
Merged

feat: summary output format modes (markdown|json)#1
zufardhiyaulhaq merged 3 commits into
mainfrom
feat/summary-format-modes

Conversation

@zufardhiyaulhaq

Copy link
Copy Markdown
Member

Summary

Adds KATO_SUMMARY_FORMAT (default markdown, or json) to select the LLM summary output format, and a summaryFormat marker that travels with every summary so consumers (kato-bot) can render per channel instead of guessing — e.g. Telegram does not accept raw CommonMark.

What changed

  • markdown mode (default): unchanged behavior; prompt pinned to a GFM subset for predictability.
  • json mode: the model emits a {verdict, headline, blocks[]} document; kato validates it (fence-strip, brace-trim, shape check), extracts the verdict, and downgrades invalid JSON to markdown with a warning — so summaryFormat always truthfully describes summary.
  • Threaded end-to-end: config → Summarizer.Formatengine.SummaryOutputResultRunStatus.summaryFormat (CRD, optional) → both the CR status and the synchronous run response.
  • OpenAI response_format: json_object set in json mode (best-effort; the downgrade covers endpoints that ignore it).
  • Helm chart exposes config.summaryFormat (default markdown).

Out of scope

  • kato-bot's per-channel rendering (separate repo) — this PR only makes kato emit the neutral format.
  • Inline spans (bold/links) in json blocks; LLM retry on malformed JSON.

Testing

  • go build ./..., go vet ./..., make test — all green.
  • helm template --set config.summaryFormat=json renders KATO_SUMMARY_FORMAT: "json".

Design & plan: docs/superpowers/specs/2026-09-09-summary-format-modes-design.md, docs/superpowers/plans/2026-09-09-summary-format-modes.md.

🤖 Generated with Claude Code

zufardhiyaulhaq and others added 3 commits September 9, 2026 10:50
Adds a KATO_SUMMARY_FORMAT env var and a summaryFormat marker on Run
status so kato-bot can render summaries per channel. kato validates the
LLM output and downgrades invalid json to markdown, guaranteeing
summaryFormat truthfully describes summary.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Select the LLM summary output format via KATO_SUMMARY_FORMAT (default
markdown, or json). A summaryFormat marker travels with every summary —
on the Run CRD status and the synchronous run response — so consumers
(kato-bot) know how to render per channel instead of guessing.

- markdown mode: unchanged behavior; prompt pinned to a GFM subset
- json mode: the model emits a {verdict, headline, blocks[]} document;
  kato validates it and downgrades invalid json to markdown with a
  warning, so summaryFormat always truthfully describes summary
- threaded config -> summarizer -> engine -> store -> RunStatus/CRD and
  the sync HTTP response; OpenAI response_format=json_object in json mode
- Helm chart exposes config.summaryFormat (default markdown)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@zufardhiyaulhaq
zufardhiyaulhaq merged commit 95ac4ba into main Sep 10, 2026
3 checks passed
@zufardhiyaulhaq
zufardhiyaulhaq deleted the feat/summary-format-modes branch September 11, 2026 09:01
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