feat: export a report or chat as Markdown, and file it as a Forgejo or GitHub issue #66

Merged
jfro merged 3 commits from feat/54-export into main 2026-11-14 14:49:59 +00:00
Owner

What changed

PR #66 @b827a40 (Copy/Download .md for reports and chats, Issue trackers settings, Create issue modal) passed my real-Chromium check at 390px and desktop plus a security audit (C27), its tests (C28) and Upper Wolfjaw's own run on my computer (C29); no findings.

Fixes #54

Red, then green

  • Export (Markdown for reports and chats, Copy/Download), the download controller's scoping, the Trackers client and config, the Issue trackers settings page and the Create issue modal on reports and chats are covered by tests that fail without #54 and pass on the branch.: export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && mix test test/lamplighter/export_test.exs test/lamplighter_web/controllers/export_controller_test.exs test/lamplighter_web/live/export_live_test.exs test/lamplighter/trackers_test.exs test/lamplighter_web/live/tracker_settings_live_test.exs test/lamplighter_web/live/create_issue_live_test.exs
    • fails on the base (2c658e5): exit 1
    • passes on the branch (b827a40): exit 0

Checks

  • In real Chromium at 390px and desktop against a dev server and a fake Forgejo: Download .md and Copy Markdown give the same text, Create issue prefills repo and title, a 404 stays in the modal with a clear message, a good repo files the issue (POST /api/v1/repos/home/lab/issues with the comment on top) and adds a note to the report, and the chat export menu and its Create issue modal work. (Upper Wolfjaw): cd /home/peak/work/lamplighter-v1-2 && curl -s --noproxy '*' -o /dev/null localhost:4128/users/log-in && timeout 170 ~/.venvs/pw/bin/python checks/export_browser.py 3 1 | tail -1 | grep -qx ok, exit 0
  • mix precommit passes on feat/54-export (compile with warnings as errors, format, full test suite). (Upper Wolfjaw): export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && mix precommit, exit 0
  • PR #66 @b827a40 passes 34 real-Chromium checks at 390px and desktop against a fake Forgejo: export access control, token never rendered or kept after a URL change, bad repos rejected before any request, double-click files one issue, modal Escape/reopen, and no overflow. (Nye): cd /home/peak/work/lamplighter-v1-2 && timeout 170 python3 review54/nye_check54.py http://localhost:4128 13 1, exit 0
  • The #54 tests (56) pass, and the tracker tests still pass with FORGEJO_TOKEN set in the environment, so a deploy's env doesn't leak into them. (Nye): cd /home/peak/work/lamplighter-v1-2/lamplighter-57 && . ../env.sh && unset FORGEJO_TOKEN && mix test test/lamplighter/export_test.exs test/lamplighter/trackers_test.exs test/lamplighter_web/controllers/export_controller_test.exs test/lamplighter_web/live/create_issue_live_test.exs test/lamplighter_web/live/export_live_test.exs test/lamplighter_web/live/tracker_settings_live_test.exs && FORGEJO_TOKEN=x mix test test/lamplighter/trackers_test.exs test/lamplighter_web/live/tracker_settings_live_test.exs, exit 0
  • Upper Wolfjaw's own Playwright run (report and chat export, Copy equals Download, 404 repo error, Create issue, Filed-as-issue note) passes on my computer too. (Nye): cd /home/peak/work/lamplighter-v1-2 && timeout 170 python3 review54/export_browser.py 13 1, exit 0
  • At b827a40 the 56 #54 tests pass, and reading Trackers and the export controller found no problems: repo format blocks path walking, no retries or redirects, token scrubbed and dropped on URL change, chats scoped to the user. Untested: a real Forgejo or GitHub; merge #65 with its F2 fix first. (Prover): cd /home/peak/work/lamplighter-v1-2/lamplighter-57 && . ../env.sh && unset FORGEJO_TOKEN && mix test test/lamplighter/export_test.exs test/lamplighter/trackers_test.exs test/lamplighter_web/controllers/export_controller_test.exs test/lamplighter_web/live/create_issue_live_test.exs test/lamplighter_web/live/export_live_test.exs test/lamplighter_web/live/tracker_settings_live_test.exs, exit 0

Risks

Stacked on PR #65 (#57), which still has F2 (note box not cleared) being fixed: merge #65 with that fix first, then #66. Any signed-in user can file issues with the instance's tracker token (same model as notifications and sources). If FORGEJO_TOKEN is set in the environment but the URL is saved in settings, the env token is held back on purpose and filing says it isn't set up (the settings page warns). Cosmetic: in the chat, the export menu stays open behind the Create issue modal. Checked against a fake Forgejo only, not a real Forgejo or GitHub.

Prover

Passed (Sonnet): At b827a40 the 56 #54 tests pass, and reading Trackers and the export controller found no problems: repo format blocks path walking, no retries or redirects, token scrubbed and dropped on URL change, chats scoped to the user. Untested: a real Forgejo or GitHub; merge #65 with its F2 fix first.

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

## What changed PR #66 @b827a40 (Copy/Download .md for reports and chats, Issue trackers settings, Create issue modal) passed my real-Chromium check at 390px and desktop plus a security audit (C27), its tests (C28) and Upper Wolfjaw's own run on my computer (C29); no findings. Fixes #54 ## Red, then green - Export (Markdown for reports and chats, Copy/Download), the download controller's scoping, the Trackers client and config, the Issue trackers settings page and the Create issue modal on reports and chats are covered by tests that fail without #54 and pass on the branch.: `export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && mix test test/lamplighter/export_test.exs test/lamplighter_web/controllers/export_controller_test.exs test/lamplighter_web/live/export_live_test.exs test/lamplighter/trackers_test.exs test/lamplighter_web/live/tracker_settings_live_test.exs test/lamplighter_web/live/create_issue_live_test.exs` - fails on the base (2c658e5): exit 1 - passes on the branch (b827a40): exit 0 ## Checks - In real Chromium at 390px and desktop against a dev server and a fake Forgejo: Download .md and Copy Markdown give the same text, Create issue prefills repo and title, a 404 stays in the modal with a clear message, a good repo files the issue (POST /api/v1/repos/home/lab/issues with the comment on top) and adds a note to the report, and the chat export menu and its Create issue modal work. (Upper Wolfjaw): `cd /home/peak/work/lamplighter-v1-2 && curl -s --noproxy '*' -o /dev/null localhost:4128/users/log-in && timeout 170 ~/.venvs/pw/bin/python checks/export_browser.py 3 1 | tail -1 | grep -qx ok`, exit 0 - mix precommit passes on feat/54-export (compile with warnings as errors, format, full test suite). (Upper Wolfjaw): `export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && mix precommit`, exit 0 - PR #66 @b827a40 passes 34 real-Chromium checks at 390px and desktop against a fake Forgejo: export access control, token never rendered or kept after a URL change, bad repos rejected before any request, double-click files one issue, modal Escape/reopen, and no overflow. (Nye): `cd /home/peak/work/lamplighter-v1-2 && timeout 170 python3 review54/nye_check54.py http://localhost:4128 13 1`, exit 0 - The #54 tests (56) pass, and the tracker tests still pass with FORGEJO_TOKEN set in the environment, so a deploy's env doesn't leak into them. (Nye): `cd /home/peak/work/lamplighter-v1-2/lamplighter-57 && . ../env.sh && unset FORGEJO_TOKEN && mix test test/lamplighter/export_test.exs test/lamplighter/trackers_test.exs test/lamplighter_web/controllers/export_controller_test.exs test/lamplighter_web/live/create_issue_live_test.exs test/lamplighter_web/live/export_live_test.exs test/lamplighter_web/live/tracker_settings_live_test.exs && FORGEJO_TOKEN=x mix test test/lamplighter/trackers_test.exs test/lamplighter_web/live/tracker_settings_live_test.exs`, exit 0 - Upper Wolfjaw's own Playwright run (report and chat export, Copy equals Download, 404 repo error, Create issue, Filed-as-issue note) passes on my computer too. (Nye): `cd /home/peak/work/lamplighter-v1-2 && timeout 170 python3 review54/export_browser.py 13 1`, exit 0 - At b827a40 the 56 #54 tests pass, and reading Trackers and the export controller found no problems: repo format blocks path walking, no retries or redirects, token scrubbed and dropped on URL change, chats scoped to the user. Untested: a real Forgejo or GitHub; merge #65 with its F2 fix first. (Prover): `cd /home/peak/work/lamplighter-v1-2/lamplighter-57 && . ../env.sh && unset FORGEJO_TOKEN && mix test test/lamplighter/export_test.exs test/lamplighter/trackers_test.exs test/lamplighter_web/controllers/export_controller_test.exs test/lamplighter_web/live/create_issue_live_test.exs test/lamplighter_web/live/export_live_test.exs test/lamplighter_web/live/tracker_settings_live_test.exs`, exit 0 ## Risks Stacked on PR #65 (#57), which still has F2 (note box not cleared) being fixed: merge #65 with that fix first, then #66. Any signed-in user can file issues with the instance's tracker token (same model as notifications and sources). If FORGEJO_TOKEN is set in the environment but the URL is saved in settings, the env token is held back on purpose and filing says it isn't set up (the settings page warns). Cosmetic: in the chat, the export menu stays open behind the Create issue modal. Checked against a fake Forgejo only, not a real Forgejo or GitHub. ## Prover Passed (Sonnet): At b827a40 the 56 #54 tests pass, and reading Trackers and the export controller found no problems: repo format blocks path walking, no retries or redirects, token scrubbed and dropped on URL change, chats scoped to the user. Untested: a real Forgejo or GitHub; merge #65 with its F2 fix first. 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:14:35 +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
Author
Owner

Screenshots at b827a40 (real Chromium, dev server + a fake Forgejo; example data: a seeded nas-01 SMART report and a chat).

desktop-report-export

desktop-report-export

390-report-export

390-report-export

desktop-issue-modal

desktop-issue-modal

390-issue-modal

390-issue-modal

desktop-issue-error

desktop-issue-error

desktop-issue-created

desktop-issue-created

390-chat-export

390-chat-export

desktop-chat-issue

desktop-chat-issue

desktop-settings

desktop-settings

390-settings

390-settings

Screenshots at b827a40 (real Chromium, dev server + a fake Forgejo; example data: a seeded nas-01 SMART report and a chat). **desktop-report-export** ![desktop-report-export](https://git.knope.dev/attachments/b731fdbb-7211-496a-aec5-d118b94b416a) **390-report-export** ![390-report-export](https://git.knope.dev/attachments/b1ced0a6-b579-4fcd-940d-6ebb7e885b43) **desktop-issue-modal** ![desktop-issue-modal](https://git.knope.dev/attachments/82d28bee-0192-4547-9eba-2ac220997784) **390-issue-modal** ![390-issue-modal](https://git.knope.dev/attachments/b97d226a-e514-4f2b-a489-c9e15c7014ec) **desktop-issue-error** ![desktop-issue-error](https://git.knope.dev/attachments/5a1c2ab8-d006-49c7-a9b2-7fa462a529ec) **desktop-issue-created** ![desktop-issue-created](https://git.knope.dev/attachments/197047f7-db3f-44b8-9a06-0486d5721198) **390-chat-export** ![390-chat-export](https://git.knope.dev/attachments/2e75f463-4199-4fa0-9765-060732edd7d6) **desktop-chat-issue** ![desktop-chat-issue](https://git.knope.dev/attachments/3a04b722-1d03-4c15-a544-5752a07f58f7) **desktop-settings** ![desktop-settings](https://git.knope.dev/attachments/a584dbef-baa5-482f-8047-36c96a2b0cd5) **390-settings** ![390-settings](https://git.knope.dev/attachments/c641775a-dae7-48e7-900d-b8bc5ab4ba57)
jfro force-pushed feat/54-export from b827a40677
All checks were successful
CI / test (pull_request) Successful in 1m19s
to f0019e426e
All checks were successful
CI / test (pull_request) Successful in 1m27s
2026-11-14 14:32:44 +00:00
Compare
Author
Owner

Rebased onto main 1d67708 after #64 (relay agent) merged, now at f0019e4. 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 f0019e4. 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 addfbf7a0e into main 2026-11-14 14:49:59 +00:00
jfro deleted branch feat/54-export 2026-11-14 14:50:00 +00:00
Sign in to join this conversation.
No description provided.