Skip to content

feat(skills): add concurrent-incidents section to incident-summary.sh - #196

Open
ysyneu wants to merge 2 commits into
mainfrom
feat/incident-summary-concurrent
Open

ysyneu wants to merge 2 commits into
mainfrom
feat/incident-summary-concurrent

Conversation

@ysyneu

@ysyneu ysyneu commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

What

The bundled fault-analysis script (skills/flashduty/scripts/incident-summary.sh) fetched six aspects of the given incident and never looked sideways at its neighbours. Alert grouping runs per channel, so one root cause spanning several services or channels arrives as several incidents opened within minutes of each other.

This adds a seventh section that lists every incident in the account started within ±15 min of the given one (any channel, any progress), projected to incident_id,num,title,incident_severity,progress,start_time,channel_id in toon output.

How

  • start_time is read from incident detail <id> --json (works on current and older CLI builds); GNU and BSD date are both handled when converting it to a unix timestamp.
  • If start_time cannot be read, the section prints a SKIPPED marker with the manual command instead of failing the whole fetch.
  • reference/incident.md gains the ⑦ line in the manual list and a "Reading ⑦" paragraph: a shared factor is a hypothesis to test against alerts and changes, not a conclusion; a list cut at --limit means a storm; incident merge remains a human decision.
  • SKILL.md router line updated to "seven reads".

Checks

  • bash -n on the script.
  • Script run end to end against a test account: section ⑦ lists the sibling incidents in the window.
  • go run ./internal/cmd/skilldoc check → cards OK.

Alert grouping runs per channel, so one root cause that spans several
services or channels arrives as several incidents opened within minutes
of each other. The bundled fault-analysis script fetched six aspects of
the given incident and never looked sideways at its neighbours.

Add a seventh section: read start_time from `incident detail --json`,
then list every incident in the account (any channel, any progress)
that started within +/-15 minutes of it, projected to the fields needed
to spot a shared factor. Both GNU and BSD date are handled; when
start_time cannot be read the section prints a SKIPPED marker with the
manual command instead of failing the whole fetch.

Update the incident card and the SKILL.md router line to describe the
seventh read and how to interpret it: a shared factor is a hypothesis
to test against alerts and changes, not a conclusion; a list cut at
--limit means a storm; merging stays a human decision.
The fake fduty now answers `--json` calls with a fixed start_time so the
seventh section runs: assert the eight invocations, the exact ±15 min
window passed to `incident list`, and that the other reads still use
their compact defaults. A second case drops start_time and checks the
section prints its SKIPPED marker with the manual command instead.
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