fix(unifi): tolerate odd device details and reject blank lookups #70

Merged
jfro merged 1 commit from fix/55-unifi-lookups into main 2026-11-14 15:13:41 +00:00
Owner

What changed

PR #70 fixes Nye's two #55 nits: device details with interfaces/uplink as lists no longer crash the device lookup, and blank client/device lookups return a clear error instead of matching everything. Red-then-green test C50, precommit C51 (1056).

Red, then green

  • New UniFi tests (device details with interfaces/uplink as lists, blank client and device lookups) fail on feat/55-unifi and pass on fix/55-unifi-lookups.: export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && unset $(env | grep -oE '^(FORGEJO|GITHUB_ISSUES)[A-Z_]*'); MIX_TEST_PARTITION=_55b mix test test/lamplighter/sources/unifi_test.exs
    • fails on the base (9df19b7): exit 1
    • passes on the branch (88e67f9): exit 0

Checks

  • mix precommit passes on fix/55-unifi-lookups @88e67f9 (warnings as errors, format, full suite of 1056). (Upper Wolfjaw): export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && unset $(env | grep -oE '^(FORGEJO|GITHUB_ISSUES)[A-Z_]*'); git rev-parse --short HEAD && MIX_TEST_PARTITION=_55b mix precommit 2>&1 | tail -2 && git diff --exit-code, exit 0
  • Read the diff and ran the UniFi tests. List or odd interfaces/uplink/details no longer crash, and blank or whitespace lookups error before any request. I couldn't break those two fixes; a ports list with non-map entries still raises BadMapError (off-spec, left alone). Not tested: a real UniFi console. I didn't rerun full precommit. (Prover): export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && unset $(env | grep -oE '^(FORGEJO|GITHUB_ISSUES)[A-Z_]*'); MIX_TEST_PARTITION=_55b mix test test/lamplighter/sources/unifi_test.exs, exit 0

Risks

Backend only, no UI. Stacked on #69, so it merges after #69 (and the D27 stack before it). Still untested against a real UniFi console.

Prover

Passed (Sonnet): Read the diff and ran the UniFi tests. List or odd interfaces/uplink/details no longer crash, and blank or whitespace lookups error before any request. I couldn't break those two fixes; a ports list with non-map entries still raises BadMapError (off-spec, left alone). Not tested: a real UniFi console. I didn't rerun full precommit.

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

## What changed PR #70 fixes Nye's two #55 nits: device details with interfaces/uplink as lists no longer crash the device lookup, and blank client/device lookups return a clear error instead of matching everything. Red-then-green test C50, precommit C51 (1056). ## Red, then green - New UniFi tests (device details with interfaces/uplink as lists, blank client and device lookups) fail on feat/55-unifi and pass on fix/55-unifi-lookups.: `export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && unset $(env | grep -oE '^(FORGEJO|GITHUB_ISSUES)[A-Z_]*'); MIX_TEST_PARTITION=_55b mix test test/lamplighter/sources/unifi_test.exs` - fails on the base (9df19b7): exit 1 - passes on the branch (88e67f9): exit 0 ## Checks - mix precommit passes on fix/55-unifi-lookups @88e67f9 (warnings as errors, format, full suite of 1056). (Upper Wolfjaw): `export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && unset $(env | grep -oE '^(FORGEJO|GITHUB_ISSUES)[A-Z_]*'); git rev-parse --short HEAD && MIX_TEST_PARTITION=_55b mix precommit 2>&1 | tail -2 && git diff --exit-code`, exit 0 - Read the diff and ran the UniFi tests. List or odd interfaces/uplink/details no longer crash, and blank or whitespace lookups error before any request. I couldn't break those two fixes; a `ports` list with non-map entries still raises BadMapError (off-spec, left alone). Not tested: a real UniFi console. I didn't rerun full precommit. (Prover): `export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && unset $(env | grep -oE '^(FORGEJO|GITHUB_ISSUES)[A-Z_]*'); MIX_TEST_PARTITION=_55b mix test test/lamplighter/sources/unifi_test.exs`, exit 0 ## Risks Backend only, no UI. Stacked on #69, so it merges after #69 (and the D27 stack before it). Still untested against a real UniFi console. ## Prover Passed (Sonnet): Read the diff and ran the UniFi tests. List or odd interfaces/uplink/details no longer crash, and blank or whitespace lookups error before any request. I couldn't break those two fixes; a `ports` list with non-map entries still raises BadMapError (off-spec, left alone). Not tested: a real UniFi console. I didn't rerun full precommit. 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 03:10:59 +00:00
jfro added 15 commits 2026-11-14 03:10:59 +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.
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
Reads the official Network Integration API (Network 9.3+) with an API key:
offline, disconnected and isolated devices with their uplink as parent,
devices waiting for adoption, opt-in firmware updates, per-device severity
by UUID, and devices/device/client context queries.

Refs #55
fix(settings): fit per-item rules with UUID ids on small screens
All checks were successful
CI / test (pull_request) Successful in 1m17s
9df19b77ea
Hide item ids that aren't numbers, keep the label ahead of the detail, and
say an item is missing from the loaded list instead of naming Proxmox.
fix(unifi): tolerate odd device details and reject blank lookups
All checks were successful
CI / test (pull_request) Successful in 1m18s
88e67f9a4d
A console that returns interfaces or uplink as something other than an
object no longer crashes the device lookup, and a blank client or device
lookup asks for an IP, MAC or name instead of matching everything.
jfro force-pushed fix/55-unifi-lookups from 88e67f9a4d
All checks were successful
CI / test (pull_request) Successful in 1m18s
to 30d5fecfc7
All checks were successful
CI / test (pull_request) Successful in 1m38s
2026-11-14 14:32:45 +00:00
Compare
Author
Owner

Rebased onto main 1d67708 after #64 (relay agent) merged, now at 30d5fec. 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 30d5fec. 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 d865ab5f53 into main 2026-11-14 15:13:41 +00:00
jfro deleted branch fix/55-unifi-lookups 2026-11-14 15:13:41 +00:00
Sign in to join this conversation.
No description provided.