feat(incidents): root-cause grouping into incidents (#58) #68

Merged
jfro merged 4 commits from feat/58-incidents into main 2026-11-14 15:08:07 +00:00
Owner

What changed

PR #68 at a9694a4: root-cause grouping with F4 (effects of a resolved root count) and F5 (ignoring a root hides its whole incident, including effects further down the chain) fixed with regression tests; mix precommit passes with 1035 tests; Nye's Chromium grouping check passed at 390px and desktop on the previous head (C43).

Fixes #58

Red, then green

  • Incident tests cover the issue's done-when cases (parent opening first and second, root resolving with an effect still failing, silencing a parent), plus cross-source links, suggestions, dashboard/history grouping and the Dependencies page; they fail on #56's branch and pass on feat/58-incidents.: bash -c 'export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && unset $(env | grep -oE "^(FORGEJO|GITHUB_ISSUES)[A-Z_]*"); MIX_TEST_PARTITION=_58 MIX_ENV=test mix test test/lamplighter/incidents_test.exs test/lamplighter_web/live/incidents_live_test.exs test/lamplighter_web/live/dependency_settings_live_test.exs'
    • fails on the base (0c7eab5): exit 1
    • passes on the branch (89f2781): exit 0

Checks

  • mix precommit passes on feat/58-incidents @89f2781 (compile with warnings as errors, format check, full suite). (Upper Wolfjaw): bash -c 'export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && unset $(env | grep -oE "^(FORGEJO|GITHUB_ISSUES)[A-Z_]*"); MIX_TEST_PARTITION=_58 mix precommit', exit 0
  • In real Chromium at 390px and 1280px, effects collapse under their root on the dashboard (+ 5 affected, expandable), the root's page lists them plus a report that opened alongside, the effect's page links back via Caused by, and Settings → Dependencies lists links and finds a host-match suggestion; nothing overflows. (Upper Wolfjaw): bash -c 'cd /home/peak/work/lamplighter-v1-2/wt-58 && export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && unset $(env | grep -oE "^(FORGEJO|GITHUB_ISSUES)[A-Z_]*"); ids=$(mix run /tmp/seed58.exs 2>/dev/null | grep -o "ROOT=[0-9]* EFFECT=[0-9]*"); r=${ids#ROOT=}; r=${r%% *}; e=${ids##*EFFECT=}; cd ../checks && ~/.venvs/pw/bin/python incidents_browser.py $r $e', exit 0
  • In Chromium at 390px and desktop, a node with 3 guests plus a linked cross-source Kuma check groups under one root (+ 4 affected), the root page lists the effects and an unlinked "opened around the same time" report, the effect page shows Caused by, and Settings → Dependencies lists the link and finds suggestions, with no overflow or JS errors. (Nye): python3 /home/peak/work/lamplighter-v1-2/review58/incidents_browser.py, exit 0
  • At 4c4a400 my F4 test, the incidents tests, the full suite (1037) and the Chromium grouping check at 390px and desktop all pass. (Nye): cd /home/peak/work/lamplighter-v1-2/lamplighter-58 && test "$(git rev-parse --short HEAD)" = 4c4a400 && source ../env.sh 2>/dev/null; E=$(ls -d ~/.local/share/mise/installs/elixir/*/ | head -1); O=$(ls -d ~/.local/share/mise/installs/erlang/*/ | head -1); export PATH=$E/bin:$O/bin:$PATH MIX_HOME=$E/.mix MIX_TEST_PARTITION=58; mix test 2>&1 | tail -3 | grep -q " 0 failures\|passed" && cd .. && python3 review58/incidents_browser.py | tail -1 | grep -qx ok, exit 0
  • At a9694a4, mix precommit passes (1038 tests) and the recursive ignore query is cycle-safe and used in both list and status counts. Untested: browser after F5, API ignored flag for effects, performance on large tables. (Prover): bash -c 'cd /tmp/pv58 && export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)"; unset $(env | grep -oE "^(FORGEJO|GITHUB_ISSUES)[A-Z_]*"); MIX_TEST_PARTITION=_pv MIX_ENV=test mix test test/lamplighter/incidents_test.exs test/lamplighter/nye_incident_status_test.exs', exit 0

Found and fixed

  • F4 bug: When a node's report resolves but a guest attached to it is still down, the dashboard status counts 0 open for up to 5 minutes (until split-off), because summarize_by_kind drops every report with a parent_report_id even when that parent has resolved. (fixed)
  • F5 bug: Ignoring a root report hides only the root: list_reports filters on each report's own fingerprint, so its attached effects (guests, checks) still show on the dashboard as separate top-level open reports, ungrouped. (fixed)

Risks

The F5 fix is a query change only (recursive check up parent_report_id); not re-run in a browser since C43. The ignored list page still lists only the root, not its hidden effects. Merges after #65, #66, #67 (D27).

Prover

Passed (Sonnet): At a9694a4, mix precommit passes (1038 tests) and the recursive ignore query is cycle-safe and used in both list and status counts. Untested: browser after F5, API ignored flag for effects, performance on large tables.

Every command above was run by Fortysix's Basecamp itself, on the branch named.

## What changed PR #68 at a9694a4: root-cause grouping with F4 (effects of a resolved root count) and F5 (ignoring a root hides its whole incident, including effects further down the chain) fixed with regression tests; mix precommit passes with 1035 tests; Nye's Chromium grouping check passed at 390px and desktop on the previous head (C43). Fixes #58 ## Red, then green - Incident tests cover the issue's done-when cases (parent opening first and second, root resolving with an effect still failing, silencing a parent), plus cross-source links, suggestions, dashboard/history grouping and the Dependencies page; they fail on #56's branch and pass on feat/58-incidents.: `bash -c 'export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && unset $(env | grep -oE "^(FORGEJO|GITHUB_ISSUES)[A-Z_]*"); MIX_TEST_PARTITION=_58 MIX_ENV=test mix test test/lamplighter/incidents_test.exs test/lamplighter_web/live/incidents_live_test.exs test/lamplighter_web/live/dependency_settings_live_test.exs'` - fails on the base (0c7eab5): exit 1 - passes on the branch (89f2781): exit 0 ## Checks - mix precommit passes on feat/58-incidents @89f2781 (compile with warnings as errors, format check, full suite). (Upper Wolfjaw): `bash -c 'export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && unset $(env | grep -oE "^(FORGEJO|GITHUB_ISSUES)[A-Z_]*"); MIX_TEST_PARTITION=_58 mix precommit'`, exit 0 - In real Chromium at 390px and 1280px, effects collapse under their root on the dashboard (+ 5 affected, expandable), the root's page lists them plus a report that opened alongside, the effect's page links back via Caused by, and Settings → Dependencies lists links and finds a host-match suggestion; nothing overflows. (Upper Wolfjaw): `bash -c 'cd /home/peak/work/lamplighter-v1-2/wt-58 && export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && unset $(env | grep -oE "^(FORGEJO|GITHUB_ISSUES)[A-Z_]*"); ids=$(mix run /tmp/seed58.exs 2>/dev/null | grep -o "ROOT=[0-9]* EFFECT=[0-9]*"); r=${ids#ROOT=}; r=${r%% *}; e=${ids##*EFFECT=}; cd ../checks && ~/.venvs/pw/bin/python incidents_browser.py $r $e'`, exit 0 - In Chromium at 390px and desktop, a node with 3 guests plus a linked cross-source Kuma check groups under one root (+ 4 affected), the root page lists the effects and an unlinked "opened around the same time" report, the effect page shows Caused by, and Settings → Dependencies lists the link and finds suggestions, with no overflow or JS errors. (Nye): `python3 /home/peak/work/lamplighter-v1-2/review58/incidents_browser.py`, exit 0 - At 4c4a400 my F4 test, the incidents tests, the full suite (1037) and the Chromium grouping check at 390px and desktop all pass. (Nye): `cd /home/peak/work/lamplighter-v1-2/lamplighter-58 && test "$(git rev-parse --short HEAD)" = 4c4a400 && source ../env.sh 2>/dev/null; E=$(ls -d ~/.local/share/mise/installs/elixir/*/ | head -1); O=$(ls -d ~/.local/share/mise/installs/erlang/*/ | head -1); export PATH=$E/bin:$O/bin:$PATH MIX_HOME=$E/.mix MIX_TEST_PARTITION=58; mix test 2>&1 | tail -3 | grep -q " 0 failures\|passed" && cd .. && python3 review58/incidents_browser.py | tail -1 | grep -qx ok`, exit 0 - At a9694a4, mix precommit passes (1038 tests) and the recursive ignore query is cycle-safe and used in both list and status counts. Untested: browser after F5, API ignored flag for effects, performance on large tables. (Prover): `bash -c 'cd /tmp/pv58 && export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)"; unset $(env | grep -oE "^(FORGEJO|GITHUB_ISSUES)[A-Z_]*"); MIX_TEST_PARTITION=_pv MIX_ENV=test mix test test/lamplighter/incidents_test.exs test/lamplighter/nye_incident_status_test.exs'`, exit 0 ## Found and fixed - F4 bug: When a node's report resolves but a guest attached to it is still down, the dashboard status counts 0 open for up to 5 minutes (until split-off), because summarize_by_kind drops every report with a parent_report_id even when that parent has resolved. (fixed) - F5 bug: Ignoring a root report hides only the root: list_reports filters on each report's own fingerprint, so its attached effects (guests, checks) still show on the dashboard as separate top-level open reports, ungrouped. (fixed) ## Risks The F5 fix is a query change only (recursive check up parent_report_id); not re-run in a browser since C43. The ignored list page still lists only the root, not its hidden effects. Merges after #65, #66, #67 (D27). ## Prover Passed (Sonnet): At a9694a4, mix precommit passes (1038 tests) and the recursive ignore query is cycle-safe and used in both list and status counts. Untested: browser after F5, API ignored flag for effects, performance on large tables. Every command above was run by Fortysix's Basecamp itself, on the branch named.
jfro added this to the v1.2 milestone 2026-11-14 02:37:30 +00:00
jfro added 11 commits 2026-11-14 02:37:30 +00:00
Adds report_events, filled where things happen: Triggers (opened,
escalated, de-escalated, recovering, flapped, resolved), Diagnosis
(queued, started, completed with its text, failed), Notifications (sent
or failed per channel) and people (acknowledged, ignored, notes).
Re-running a diagnosis keeps the earlier ones on the timeline.

People can acknowledge a report; a rise above the acknowledged severity
reopens it. Notes are Markdown, edited or deleted only by their author,
and go into the AI's context for diagnosis and chat. Existing reports get
opened, diagnosis and resolved events backfilled.

Refs #57
The report page gets a Timeline (each diagnosis kept, with its full
text), an Acknowledge button, and Notes that their authors can edit or
delete. The dashboard shows who acknowledged a report, and History can
filter to reports with notes.

Refs #57
feat(api): read a report's timeline and add notes over the API and MCP
All checks were successful
CI / test (pull_request) Successful in 1m15s
2c658e5f47
GET /api/v1/reports/:id/timeline and the get_report_timeline tool return
the events and notes. A new notes token scope allows
POST /api/v1/reports/:id/notes and the add_report_note tool, writing as
the token's user, so an AI agent can record what it found or did.

Closes #57
Lamplighter.Export builds the Markdown (facts, diagnosis, notes and
timeline for a report; each turn for a chat). Reports get Copy Markdown
and Download .md next to the diagnosis; an open chat gets an export menu.
Downloads come from ExportController, scoped to the user's own chats.

Refs #54
feat(trackers): create Forgejo and GitHub issues
Some checks failed
CI / test (pull_request) Failing after 1m6s
17e3911279
Lamplighter.Trackers keeps one config per kind (env wins over settings,
token in an EncryptedMap), tests the connection, and files an issue with
a title and body, with errors that say what to check and never the token.

Refs #54
feat(trackers): Issue trackers settings and a Create issue modal
All checks were successful
CI / test (pull_request) Successful in 1m19s
b827a40677
Settings → Issue trackers sets up Forgejo and GitHub (env wins, Test
checks the token). Reports and chats get Create issue: a modal with the
tracker, repository (last used, default, or a GitHub report's repo),
title, an optional comment and a preview of what's sent. A filed report
gets a note linking the issue. With no tracker, the button links to setup.

Fixes #54
Active silences hold back notifications and automatic diagnosis for the
problems they cover and leave them out of the dashboard's status; reports
still open and resolve. When a silence ends, what it held back and is still
open sends one "still open after maintenance" notification and is
diagnosed. Refs #56
feat(silences): Settings → Silences, Silence on reports, banner, API and MCP
All checks were successful
CI / test (pull_request) Successful in 1m17s
2cd1f1042e
Settings → Silences starts a silence for a source or items picked by
search (now or later, for 1h, 4h, until tomorrow 8:00 or a custom end) and
lists active, upcoming and recently ended ones with End now, Cancel and
+1 hour. A report's Silence menu silences its problem. Covered reports show
"Silenced until …" and the dashboard shows a banner. Times are read and
shown in the browser's time zone.

POST /api/v1/silences, GET /api/v1/silences and
POST /api/v1/silences/:id/end, with list_silences, create_silence and
end_silence MCP tools; writing needs the new silences token scope.
Refs #56
fix(silences): catch up hold-backs from before the ending silence began
All checks were successful
CI / test (pull_request) Successful in 1m30s
0c7eab5928
A problem held back by a whole-source silence and then silenced again from
its report never got its still-open notice: catch-up only counted hold-backs
at or after the ending silence's own start. Count every hold-back not yet
caught up instead.
Signals can name the keys they depend on (parent), and links you set tie an
item of one source to an item of another. While a parent's report is open,
its effects attach to it: they send no notification and aren't diagnosed on
their own; the root's notification lists them, its diagnosis gets their
facts, and an update goes out when more join within five minutes. Effects
that open first attach when their parent opens; ones still failing five
minutes after their parent resolves are split off. Silencing or ignoring a
parent covers its effects. Proxmox guests, ZFS pools, disks and a node's own
storage name their node.
Effects show collapsed under their root on the dashboard and in history
("+ N affected"). A root's report page lists what it affects, an effect's
says what caused it, and reports that opened within a minute without a link
are shown as probably related. Settings → Dependencies adds links between
sources with the item picker, and lists suggested links to confirm or
dismiss: Find suggestions matches hosts across sources, and a diagnosis can
suggest links with "Link: report X depends on report Y" lines, which are
kept out of its text.
Author
Owner

Screenshots at 89f2781 (Chromium, 390px and 1280px; seed: pve2 offline with 4 guests, a Kuma check linked to guest 105, and an unlinked report that opened alongside).

desktop-dashboard-collapsed
desktop-dashboard-collapsed

desktop-dashboard-open
desktop-dashboard-open

390-dashboard-open
390-dashboard-open

desktop-root-incident
desktop-root-incident

390-root-incident
390-root-incident

desktop-effect
desktop-effect

390-effect
390-effect

desktop-settings
desktop-settings

390-settings
390-settings

Screenshots at 89f2781 (Chromium, 390px and 1280px; seed: pve2 offline with 4 guests, a Kuma check linked to guest 105, and an unlinked report that opened alongside). **desktop-dashboard-collapsed** ![desktop-dashboard-collapsed](https://git.knope.dev/attachments/7681225d-4c9c-4c72-b8c9-af28b05a4a0d) **desktop-dashboard-open** ![desktop-dashboard-open](https://git.knope.dev/attachments/099e15e6-1ccb-455f-979e-5f1165831eba) **390-dashboard-open** ![390-dashboard-open](https://git.knope.dev/attachments/cc582155-de3b-495a-bcc4-49c496fe5a7c) **desktop-root-incident** ![desktop-root-incident](https://git.knope.dev/attachments/eb419395-a4c2-4844-ae52-38230c9ad05b) **390-root-incident** ![390-root-incident](https://git.knope.dev/attachments/3a3a9d0f-e522-4afa-8980-483019d6f973) **desktop-effect** ![desktop-effect](https://git.knope.dev/attachments/f6e23762-27d3-4543-8c88-d22ec4e5947c) **390-effect** ![390-effect](https://git.knope.dev/attachments/401896e4-91f2-4cb6-b3aa-18a12f57e8fc) **desktop-settings** ![desktop-settings](https://git.knope.dev/attachments/04dba127-1fb1-4d3c-9e43-fe9ed4aa1a84) **390-settings** ![390-settings](https://git.knope.dev/attachments/2172ace3-072b-4749-aebb-cf7f56593b35)
fix(incidents): count an effect whose root has resolved in the dashboard status
All checks were successful
CI / test (pull_request) Successful in 1m18s
4c4a40042b
fix(incidents): ignoring a root hides its effects from the dashboard
All checks were successful
CI / test (pull_request) Successful in 1m34s
a9694a4641
jfro force-pushed feat/58-incidents from a9694a4641
All checks were successful
CI / test (pull_request) Successful in 1m34s
to ae54f1032a
All checks were successful
CI / test (pull_request) Successful in 1m37s
2026-11-14 14:32:45 +00:00
Compare
Author
Owner

Rebased onto main 1d67708 after #64 (relay agent) merged, now at ae54f10. The only conflicts were where both added to the same list: the Settings tabs (Agents now sits after Sources), the settings routes, the server's supervision tree (silence sweeper added to server_children), and the API auth test's route check. No feature code changed. mix precommit passes on every branch in the stack and CI is green.

Rebased onto main 1d67708 after #64 (relay agent) merged, now at ae54f10. The only conflicts were where both added to the same list: the Settings tabs (Agents now sits after Sources), the settings routes, the server's supervision tree (silence sweeper added to server_children), and the API auth test's route check. No feature code changed. `mix precommit` passes on every branch in the stack and CI is green.
jfro merged commit 06053f2968 into main 2026-11-14 15:08:07 +00:00
jfro deleted branch feat/58-incidents 2026-11-14 15:08:07 +00:00
Sign in to join this conversation.
No description provided.