feat: summary output format modes (markdown|json) - #1
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
KATO_SUMMARY_FORMAT(defaultmarkdown, orjson) to select the LLM summary output format, and asummaryFormatmarker 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
{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 — sosummaryFormatalways truthfully describessummary.Summarizer.Format→engine.SummaryOutput→Result→RunStatus.summaryFormat(CRD, optional) → both the CR status and the synchronous run response.response_format: json_objectset in json mode (best-effort; the downgrade covers endpoints that ignore it).config.summaryFormat(defaultmarkdown).Out of scope
Testing
go build ./...,go vet ./...,make test— all green.helm template --set config.summaryFormat=jsonrendersKATO_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