Files
nmon/docs/DEVIATIONS.md
jleung f85c3ef781
Some checks failed
ci / lint (push) Has been cancelled
ci / test (ubuntu-24.04-arm) (push) Has been cancelled
ci / test (ubuntu-latest) (push) Has been cancelled
ci / postgres (push) Has been cancelled
ci / openapi (push) Has been cancelled
M3: Go API per UI contract, embedded UI, openapi compat check, nmon-devtools, live gate + screenshots; M4 WP1 reachability and dependency suppression
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lx9FNLG2CqeBbVGGd9bFsP
2026-10-22 20:34:14 +00:00

6.1 KiB
Raw Permalink Blame History

Deviations from the spec

Every place the build departs from docs/spec/, with the reason. The spec is the contract; a line here is a conscious, reviewed exception.

# Spec says Build does Why Milestone
1 Fixtures run on snmpsim (Python) via compose internal/simagent, a Go agent that serves standard .snmprec files (v1/v2c/v3, dynamic counters, slow/flaky/toobig). deploy/snmpsim-compose.yml is kept for anyone using the reference simulator. 2,000 agents for the loadtest in one process; no Python in CI; same file format, so real snmpsim recordings still work. M1
2 "Two VictoriaMetrics executables are embedded" One VictoriaMetrics single-node executable per architecture is embedded and run as two processes (hot and long) with different -retentionPeriod. Both stores are the same program; embedding it twice would double the binary size for no gain. M1
3 Libraries: huma, gosnmp, gnmic, go-oidc, bun; standard library elsewhere Also: oklog/ulid (ULIDs), gopkg.in/yaml.v3 (profiles, config), golang.org/x/net (unprivileged ICMP), golang.org/x/crypto (bcrypt, ACME), bun's SQLite (modernc.org/sqlite) and Postgres (pgdriver) drivers, golang/snappy + protobuf (remote write). Each one fills a gap the standard library doesn't cover; each is small and widely used. M1+
4 Integration tests use a VictoriaMetrics container Integration tests run the VictoriaMetrics binary that make fetch-vm downloaded (the same pinned, checksummed one that is embedded). Faster, and it tests the exact binary that ships. M1
5 (not specified) M1 has no auth Until M6, nmon serve requires --insecure-http and has no auth. Auth is M6 in the build order. M1–M5
6 "No MIB file is ever shipped in the repo or the binary"; vendor MIBs are the operator's to fetch MIBs are bundled as a sidecar (user decision, 2026-10-22). All 4,865 LibreNMS MIBs are vendored under mibs/ and shipped in the release tarball (installed to /usr/share/nmon/mibs). None is embedded in the binary, not even the IETF/IANA set. They are read via --mibs-dir (default <data-dir>/mibs, then /usr/share/nmon/mibs). The poller never reads a MIB. Operators get nmon profile new --mib working out of the box while the binary stays small. Each MIB keeps its publisher's terms (see mibs/README.md). M2
7 import-librenms reads includes/definitions/*.yaml and includes/definitions/discovery/*.yaml Reads resources/definitions/os_detection/*.yaml and resources/definitions/os_discovery/*.yaml, with the old paths as a fallback. LibreNMS moved them; the spec's paths no longer exist upstream. M2
8 Real recordings replace synthetic fixtures when available LibreNMS's tests/snmpsim/*.snmprec (2,054 real device recordings) are used by optional tests when NMON_LIBRENMS_DIR points at a checkout. They are never copied into this repo. Real-device coverage without vendoring GPL test data into an Apache-2.0 repo. M2
9 nmon profile import-librenms <repo-path> is an nmon subcommand A separate binary, nmon-librenms-import (cmd/nmon-librenms-import), run offline before nmon. It writes draft profiles that the operator reviews and copies into <data-dir>/profiles/. nmon neither links nor exposes it. User decision (2026-10-22). It keeps the importer out of the product binary and makes "the converter never runs at serve time" structural. M2
10 scripts/openapi-diff fails on an incompatible change (M3 milestone) The differ is the Go package internal/openapidiff (unit-tested, run with go run ./internal/openapidiff/cmd/openapidiff), driven by scripts/openapi-check.sh, which make gate-m3 and the CI openapi job call. A Go package is testable and linted like the rest of the code; the script only fetches the spec at the last m*/v* tag. No new dependency. M3
11 Built assets are embedded from web/dist into internal/webui make web copies web/dist to internal/webui/dist (git-ignored, .gitkeep tracked); a committed internal/webui/placeholder/index.html ("UI not built") is served when dist has no index.html. A tracked dist/index.html would be overwritten by every build and dirty the tree, and a built UI must never be committed. go build still works without node. M3
12 (not specified) Developer tools (backfill, seed-demo) are a separate executable, cmd/nmon-devtools (make devtools builds nmon-devtools), never shipped. It talks to a running nmon over its HTTP API and to the hot store via --hot-url. nmon has no devtools command; a depguard rule keeps cmd/nmon from importing internal/simagent or internal/fixturegen beyond profile_record.go, which already used them for nmon profile record in M2. The gate needs 30 days of history without waiting 30 days, and live screenshots need a simulated network. See docs/dev.md. M3
13 (not specified) /docs API reference /docs serves a vendored, pinned swagger-ui-dist 5.17.14 (Apache-2.0, about 1.6 MB) through embed.FS. huma's built-in renderers load their assets from a CDN, which an offline monitor cannot rely on. M3
14 M2 defined provisional poller/health and identity-reviews responses Both were reshaped in M3 to the reviewed UI contract, before any openapi.json existed, so the route freeze starts at m3, the first tag with a checked-in spec. The M2 shapes had no consumer. scripts/openapi-check.sh passes against m2 with a note and diffs for real from m3. M3
15 A single-signal failure (ICMP only or SNMP only) is a warning The warning is held as pending for 5 min before it notifies, and is closed silently if the device goes down meanwhile. Otherwise a real outage whose second signal fails seconds later sends a spurious warning first. M4
16 An unsupported probe is unknown, never failed When ICMP is unsupported (host can't open unprivileged ICMP, or per device), SNMP alone decides down, as with icmp_blocked, and a one-time icmp_unsupported device warning is raised. Otherwise nmon could never declare a device down on such a host, and nobody would notice. M4