feat(reports): report timeline, acknowledge and notes (#57) #65

Merged
jfro merged 4 commits from feat/57-report-timeline into main 2026-11-14 14:49:43 +00:00
Owner

What changed

PR #65 @4889b54: F2 fixed (note box clears after Add note, C34). Re-ran my full Chromium check at 390px and desktop with two users: ack/unack, add/edit/delete own notes, no edit/delete of others' notes (even forged events), unsafe Markdown stripped, live updates, Has notes filter, no overflow. All pass.

Fixes #57

Red, then green

  • Report timeline: events recorded at each point (Triggers, Diagnosis keeping earlier runs, Notifications, people), acknowledge with auto-reopen on rise, author-only Markdown notes in AI context, report page/dashboard/History UI, and timeline + notes over REST and MCP.: export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && MIX_ENV=test mix test test/lamplighter/reports/timeline_test.exs test/lamplighter_web/live/report_timeline_live_test.exs test/lamplighter_web/api/timeline_test.exs
    • fails on the base (e07248f): exit 1
    • passes on the branch (2c658e5): exit 0

Checks

  • In real Chromium at 390px and desktop against the branch's dev server: the report page shows 12+ timeline events with both diagnoses kept (expandable full text), Unacknowledge/Acknowledge round-trips, a note can be added (Markdown renders), edited and deleted with the timeline updating live, the dashboard pill shows who acknowledged, and History's Has notes chip is pressed at ?notes=1. (Upper Wolfjaw): cd /home/peak/work/lamplighter-v1-2 && curl -s --noproxy '*' -o /dev/null -w '%{http_code}' localhost:4127/users/log-in | grep -q 200 && ~/.venvs/pw/bin/python checks/timeline_browser.py $(psql -qtA postgresql://postgres:postgres@localhost/lamplighter_dev -c "select id from reports where fingerprint like 'demo57:%' order by id desc limit 1"), exit 0
  • mix precommit passes on feat/57-report-timeline (compile with warnings as errors, format, 911 tests). (Upper Wolfjaw): cd /home/peak/work/lamplighter-v1-2/wt-57 && export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && git rev-parse --short HEAD && mix precommit 2>&1 | tail -3 && git diff --exit-code, exit 0
  • In Chromium at 390px and desktop with two users, PR #65 passes everything but F2: ack round trip and dashboard pill, own-note add/edit/delete, no edit/delete (even forged) on others' notes, sanitized Markdown, live updates for the other user, and the History "Has notes" filter, with no overflow. (Nye): cd /home/peak/work/lamplighter-v1-2 && timeout 170 python3 review57/nye_check57.py && timeout 120 python3 review57/nye_check57b.py, exit 0
  • At 4889b54, my real-Chromium checks pass: the note box is empty after Add note, and the full #57 flow (ack, notes, edit/delete, forged delete refused, Has notes filter, no overflow at 390px/desktop) still passes. (Nye): cd /home/peak/work/lamplighter-v1-2/lamplighter-57 && test "$(git rev-parse --short HEAD)" = 4889b54 && cd ../review57 && python3 nye_note_form_clears.py http://localhost:4128 && python3 nye_check57.py 2>&1 | tail -3 | grep -q 'FAILS: \[\]', exit 0
  • At 4889b54 in my own clean worktree the full suite passes (912 tests, 0 failures), and reading the code confirms only a note's author can edit or delete it, with forged events refused. Not re-run: the dev-server Chromium scripts; not tried: concurrent edits. (Prover): cd /tmp/prov57 && E=$(ls -d /home/peak/.local/share/mise/installs/elixir/*/bin|head -1); O=$(ls -d /home/peak/.local/share/mise/installs/erlang/*/bin|head -1); export PATH=$E:$O:$PATH MIX_HOME=$E/../.mix; test "$(git rev-parse --short HEAD)" = 4889b54 && MIX_ENV=test mix test 2>&1 | grep -q " 0 failures\|passed", exit 0

Found and fixed

  • F2 bug: After Add note on the report page (390px and desktop, Chromium), the note is saved but the textarea keeps its text, so a second click adds a duplicate note; the server resets the form to "" but LiveView sends no diff because the rendered value didn't change. (fixed)

Risks

Merge order D17: PR #65 must merge before PR #66 (#54), which carries #57's pre-fix commits; #66 and #67 will need a rebase or will pick up 4889b54 on merge.

Prover

Passed (Sonnet): At 4889b54 in my own clean worktree the full suite passes (912 tests, 0 failures), and reading the code confirms only a note's author can edit or delete it, with forged events refused. Not re-run: the dev-server Chromium scripts; not tried: concurrent edits.

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

## What changed PR #65 @4889b54: F2 fixed (note box clears after Add note, C34). Re-ran my full Chromium check at 390px and desktop with two users: ack/unack, add/edit/delete own notes, no edit/delete of others' notes (even forged events), unsafe Markdown stripped, live updates, Has notes filter, no overflow. All pass. Fixes #57 ## Red, then green - Report timeline: events recorded at each point (Triggers, Diagnosis keeping earlier runs, Notifications, people), acknowledge with auto-reopen on rise, author-only Markdown notes in AI context, report page/dashboard/History UI, and timeline + notes over REST and MCP.: `export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && MIX_ENV=test mix test test/lamplighter/reports/timeline_test.exs test/lamplighter_web/live/report_timeline_live_test.exs test/lamplighter_web/api/timeline_test.exs` - fails on the base (e07248f): exit 1 - passes on the branch (2c658e5): exit 0 ## Checks - In real Chromium at 390px and desktop against the branch's dev server: the report page shows 12+ timeline events with both diagnoses kept (expandable full text), Unacknowledge/Acknowledge round-trips, a note can be added (Markdown renders), edited and deleted with the timeline updating live, the dashboard pill shows who acknowledged, and History's Has notes chip is pressed at ?notes=1. (Upper Wolfjaw): `cd /home/peak/work/lamplighter-v1-2 && curl -s --noproxy '*' -o /dev/null -w '%{http_code}' localhost:4127/users/log-in | grep -q 200 && ~/.venvs/pw/bin/python checks/timeline_browser.py $(psql -qtA postgresql://postgres:postgres@localhost/lamplighter_dev -c "select id from reports where fingerprint like 'demo57:%' order by id desc limit 1")`, exit 0 - mix precommit passes on feat/57-report-timeline (compile with warnings as errors, format, 911 tests). (Upper Wolfjaw): `cd /home/peak/work/lamplighter-v1-2/wt-57 && export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && git rev-parse --short HEAD && mix precommit 2>&1 | tail -3 && git diff --exit-code`, exit 0 - In Chromium at 390px and desktop with two users, PR #65 passes everything but F2: ack round trip and dashboard pill, own-note add/edit/delete, no edit/delete (even forged) on others' notes, sanitized Markdown, live updates for the other user, and the History "Has notes" filter, with no overflow. (Nye): `cd /home/peak/work/lamplighter-v1-2 && timeout 170 python3 review57/nye_check57.py && timeout 120 python3 review57/nye_check57b.py`, exit 0 - At 4889b54, my real-Chromium checks pass: the note box is empty after Add note, and the full #57 flow (ack, notes, edit/delete, forged delete refused, Has notes filter, no overflow at 390px/desktop) still passes. (Nye): `cd /home/peak/work/lamplighter-v1-2/lamplighter-57 && test "$(git rev-parse --short HEAD)" = 4889b54 && cd ../review57 && python3 nye_note_form_clears.py http://localhost:4128 && python3 nye_check57.py 2>&1 | tail -3 | grep -q 'FAILS: \[\]'`, exit 0 - At 4889b54 in my own clean worktree the full suite passes (912 tests, 0 failures), and reading the code confirms only a note's author can edit or delete it, with forged events refused. Not re-run: the dev-server Chromium scripts; not tried: concurrent edits. (Prover): `cd /tmp/prov57 && E=$(ls -d /home/peak/.local/share/mise/installs/elixir/*/bin|head -1); O=$(ls -d /home/peak/.local/share/mise/installs/erlang/*/bin|head -1); export PATH=$E:$O:$PATH MIX_HOME=$E/../.mix; test "$(git rev-parse --short HEAD)" = 4889b54 && MIX_ENV=test mix test 2>&1 | grep -q " 0 failures\|passed"`, exit 0 ## Found and fixed - F2 bug: After Add note on the report page (390px and desktop, Chromium), the note is saved but the textarea keeps its text, so a second click adds a duplicate note; the server resets the form to "" but LiveView sends no diff because the rendered value didn't change. (fixed) ## Risks Merge order D17: PR #65 must merge before PR #66 (#54), which carries #57's pre-fix commits; #66 and #67 will need a rebase or will pick up 4889b54 on merge. ## Prover Passed (Sonnet): At 4889b54 in my own clean worktree the full suite passes (912 tests, 0 failures), and reading the code confirms only a note's author can edit or delete it, with forged events refused. Not re-run: the dev-server Chromium scripts; not tried: concurrent edits. 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 01:04:46 +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
Author
Owner

Screenshots at PR head (2c658e5), real Chromium, demo data.

desktop-report

desktop-report

390-report

390-report

desktop-dashboard

desktop-dashboard

390-dashboard

390-dashboard

desktop-history-notes

desktop-history-notes

390-history-notes

390-history-notes

Screenshots at PR head (2c658e5), real Chromium, demo data. **desktop-report** ![desktop-report](https://git.knope.dev/attachments/00426897-3732-48dd-bca7-478fd3b6c937) **390-report** ![390-report](https://git.knope.dev/attachments/bff9e831-4e8d-446e-948a-19b5a6c5b281) **desktop-dashboard** ![desktop-dashboard](https://git.knope.dev/attachments/2e8019d6-da21-4d50-a8ea-432cc997859a) **390-dashboard** ![390-dashboard](https://git.knope.dev/attachments/770fbe83-1858-4bac-a77a-e3bfe66f82b9) **desktop-history-notes** ![desktop-history-notes](https://git.knope.dev/attachments/ab296833-769c-47ad-9199-e22c094025c8) **390-history-notes** ![390-history-notes](https://git.knope.dev/attachments/70c425f1-5211-46f5-8154-5012f16c711d)
fix(reports): clear the note box after adding a note
All checks were successful
CI / test (pull_request) Successful in 1m20s
4889b540d5
Re-rendering an empty value into the same textarea sends no diff, so the
browser kept the typed text and a second click posted a duplicate. The
textarea id now changes after each add so LiveView swaps in a fresh node.
jfro force-pushed feat/57-report-timeline from 4889b540d5
All checks were successful
CI / test (pull_request) Successful in 1m20s
to a669414d50
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 a669414. 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 a669414. 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 0ef07c3834 into main 2026-11-14 14:49:43 +00:00
jfro deleted branch feat/57-report-timeline 2026-11-14 14:49:43 +00:00
Sign in to join this conversation.
No description provided.