Skip to content

feat/ai-sre → main: add --fields projection to incident/alert list (v1.3.16)#59

Merged
ysyneu merged 1 commit into
mainfrom
feat/ai-sre
Jun 23, 2026
Merged

feat/ai-sre → main: add --fields projection to incident/alert list (v1.3.16)#59
ysyneu merged 1 commit into
mainfrom
feat/ai-sre

Conversation

@ysyneu

@ysyneu ysyneu commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Release v1.3.16 (patch +1 over v1.3.15).

Included: flashduty-cli #58 — additive --fields projection on incident list / alert list (json/toon mode), reflection-driven from go-flashduty struct tags; default output unchanged. Surfaced by the AI-SRE session audit (audit-2026-06-23) as the top token-waste class (oversized list dumps re-queried with jq).

Content delta vs main = exactly the 6 files of #58. CI was green on #58 (build×3 / lint / Analyze / CodeQL).

* feat(cli): add --fields projection to incident/alert list (json/toon)

In structured (json/toon) mode the curated `incident list` / `alert list`
commands ignore the compact column set and marshal the full nested SDK
record (IncidentInfo/AlertItem with responders/labels/alerts and
events/incident blobs). That makes the first list call huge — 20 incidents
~60-70KB, 66 alerts ~83KB — which spills to file and is then re-queried with
a narrower jq projection. The first dump is pure waste.

Add an additive --fields flag to both list commands: in json/toon mode it
projects each row to only the named JSON-tagged fields via one shared
reflection helper (projectFields), so the first call is already compact and
no jq round-trip is needed. Default behavior (no --fields) is byte-identical
to today; --fields is a no-op in table mode. Unknown field names fail fast
listing the valid tag names.

Out of scope by design: --count/group-by aggregation, nested/dotted paths.

* fix(skilldoc): regenerate incident/alert cards for --fields flag

The --fields projection flag added to `incident list` / `alert list`
changed the cobra command tree, leaving the generated card fences stale.
CI 'Check skill command-cards' (go run ./internal/cmd/skilldoc check)
failed on reference/{alert,incident}.md. Regenerated via make gen-cards.
@ysyneu ysyneu merged commit 93ed444 into main Jun 23, 2026
12 checks passed
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