Skip to content

docs: fix three drifted claims in ARCHITECTURE.md - #141

Merged
LarsLaskowski merged 1 commit into
mainfrom
claude/issue-115-0fycv7
Aug 27, 2026
Merged

LarsLaskowski merged 1 commit into
mainfrom
claude/issue-115-0fycv7

Conversation

@LarsLaskowski

@LarsLaskowski LarsLaskowski commented Aug 27, 2026 •

Copy link
Copy Markdown
Owner

Pull Request

📖 Description

docs/ARCHITECTURE.md had drifted from the code in three places, all corrected in this PR:

  1. False claim that the dashboard polls /api/v1/alerts. Verified via grep -n "api/v1" internal/web/assets/app.js on the current main — no such reference exists. The alert engine (GET /api/v1/alerts) is fully implemented server-side but has no dashboard surface at all yet; that gap is tracked separately by C3: Surface alert status in the dashboard UI #11. Rewrote the "Web dashboard" section to state this explicitly and to stop conflating alert-state with the (real, >=-based) threshold coloring of metric cards.
  2. withGzip missing from the "HTTP layer" section entirely, even though it sits on every /api/v1/... request path (added in Compress /api/v1 responses with gzip #95, documented in docs/API.md#compression). The section previously showed only the global withLogging(withSecurityHeaders(mux)) chain. I re-verified the current code (internal/httpapi/server.go, apiRoute) and found the per-route chain has grown since the issue was filed — it's now withNoStore(withMaxInFlight(withGzip(withAPIKey(handler)))), not just withGzip(withAPIKey(handler)). Updated the doc to show both the global and per-route chains explicitly and added a dedicated withGzip bullet (gzip negotiation, sync.Pool writer reuse, Vary header interaction with withNoStore, backwards compatibility for non-negotiating clients).
  3. "exactly four collaborators" followed by five numbered items (config.Load, alert.NewNotifier, collector.New, web.Handler, httpapi.New). Dropped the count rather than correcting it to "five", per the issue's own suggestion — a count that must be kept in sync with the list is a trap that will just break again on the next change.

Per the issue's own caveat, I re-verified all three claims against the current main (not just trusting the issue body) before editing, since the issue was drafted by an AI review and the code may have moved since. Point 2 in particular had drifted further than the issue described (two more middlewares — withMaxInFlight, withNoStore — were added after the issue was filed), so the fix reflects the current chain, not the issue's literal suggested diff.

This is a documentation-only change — no source files were touched.

🎫 Issues

Closes #115

👩‍💻 Reviewer Notes

Nothing to smoke-test; this is prose-only. Worth double-checking:

📑 Test Plan

Documentation-only change; per docs/TESTS.md no new Go tests are required or applicable. Ran the full existing suite to confirm nothing regressed:

  • go build ./... — passes
  • go vet ./... — passes
  • go test ./... -race -cover — passes (all packages green)
  • golangci-lint run — could not run in this environment (golangci-lint binary was built against an older Go toolchain than the repo's go.mod targets); no Go source was changed by this PR.

✅ Checklist

General

  • I have added/updated tests for my changes (go test ./... -race -cover passes locally). (N/A — docs-only, no behavior changed)
  • go vet ./... and golangci-lint run are clean. (go vet clean; golangci-lint could not run in this environment due to a toolchain version mismatch — no Go source changed)
  • I have tested my changes. (read-through verification against current source, see Description)
  • I have read the CONTRIBUTING documentation and followed the project's code style guidelines.
  • I have updated ARCHITECTURE.md if this changes a documented design decision. (this PR's entire purpose)

REST API / configuration / packaging

Not applicable — no API, config, or packaging changes.

⏭ Next Steps

None. The issue notes several other open issues touch the same ARCHITECTURE.md sections (API cache-header, request-throttling, asset-ETag, async-persistence); those are separate work and out of scope here.

- The dashboard never polls /api/v1/alerts (grep of app.js confirms
  it); the alert engine has no dashboard surface yet, tracked
  separately as issue #11. Clarify that the card coloring is
  threshold-based, not alert-state-based, so the two aren't conflated.
- The HTTP layer section omitted withGzip entirely, even though it
  sits on every /api/v1 request path (added in #95). Show the global
  vs. per-route (apiRoute) middleware chains explicitly, and add a
  dedicated withGzip bullet.
- "exactly four collaborators" was followed by five numbered items;
  drop the count rather than keep it in sync with the list.

Docs-only change; no source touched, no new tests needed per
docs/TESTS.md.
@sonarqubecloud

Copy link
Copy Markdown

@LarsLaskowski
LarsLaskowski merged commit 39424a1 into main Aug 27, 2026
8 checks passed
@LarsLaskowski
LarsLaskowski deleted the claude/issue-115-0fycv7 branch August 27, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ARCHITECTURE.md describes behaviour that does not exist and omits the gzip middleware

2 participants