Skip to content

fix(cli): compact incident audit outputs#95

Merged
ysyneu merged 4 commits into
feat/ai-srefrom
audit-fix/audit-20260722T031714Z-auto-compact-projections
Jul 22, 2026
Merged

fix(cli): compact incident audit outputs#95
ysyneu merged 4 commits into
feat/ai-srefrom
audit-fix/audit-20260722T031714Z-auto-compact-projections

Conversation

@ysyneu

@ysyneu ysyneu commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Root cause

Audit run audit-20260722T031714Z-auto found eight sessions dumping broad incident and alert records before local filtering. Representative sessions emitted 70,832 and 58,304 characters; fixture baselines reproduced 132,203-byte similar-incident output and 152,733-byte alert-event output. Structured rendering bypassed curated columns, and a field projection alone still allowed an unbounded retained string.

End-state fix

  • Give incident similar and alert-event list compact structured defaults, with an explicit fields override.
  • Add fields projection to incident detail while preserving full structured output when fields is omitted.
  • Measure the actual JSON/TOON encoding and hard-limit compact lists below 16 KiB and projected detail below 8 KiB; truncate retained strings safely or fail small when metadata cannot fit.
  • Project the summary detail call to the exact analysis fields, including channel_id; use compact defaults for the other reads.
  • Update command cards and guard every hot flow against raw unbounded output.

Verification

  • Regression fixtures use oversized retained title, root_cause, ai_summary, and resolution values.
  • Both JSON and TOON caps, UTF-8 safety, irreducible metadata, projected keys, and all six summary calls are covered.
  • make GOLANGCI_LINT=/Users/ysy/go/bin/golangci-lint
  • go test -race -count=1 ./...
  • go run ./internal/cmd/skilldoc check
  • Full branch and post-PR adversarial reviews: ready, no remaining findings

The repository-cached linter was built with Go 1.24 and cannot analyze this Go 1.25.1 module; the same make target passes with the Go 1.25-built linter shown above.

@ysyneu
ysyneu merged commit 512aefe into feat/ai-sre Jul 22, 2026
12 checks passed
@ysyneu
ysyneu deleted the audit-fix/audit-20260722T031714Z-auto-compact-projections branch July 22, 2026 07:01
@ysyneu ysyneu mentioned this pull request Jul 22, 2026
2 tasks
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