Skip to content

Docs: per-package CLAUDE.md for IO + plumbing layers - #11

Merged
frahlg merged 1 commit into
masterfrom
docs/per-pkg-io-plumbing
Apr 15, 2026
Merged

Docs: per-package CLAUDE.md for IO + plumbing layers#11
frahlg merged 1 commit into
masterfrom
docs/per-pkg-io-plumbing

Conversation

@frahlg

@frahlg frahlg commented Apr 15, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds a CLAUDE.md orientation brief to each of the eight IO / plumbing packages: drivers, mqtt, modbus, arp, ha, api, forecast, configreload.
  • Each file follows the shared template: what it does / key types / public API surface / how it talks to neighbors / what to read first / what NOT to do — with file:line citations to the actual code.
  • Cites the guard-rails that aren't obvious from reading one file (e.g. don't reuse MQTT clientIDs across drivers, don't watch the config file directly, don't call ARP lookup on a hot path, don't share a Capability between drivers).

Test plan

  • cd go && go build ./... — clean
  • cd go && go test -timeout 120s -count=1 ./... — all green
  • Every type / function / file:line citation verified via Grep against the actual source
  • Every docs/*.md link in the new files resolves (api.md reference removed since that doc no longer exists on this branch)

Co-authored-by the harness; see commit trailer.

Adds orientation docs for drivers, mqtt, modbus, arp, ha, api, forecast,
and configreload — each package gets a concise "what it does / key types
/ public surface / how it talks to neighbors / what to read first / what
NOT to do" brief so future edits pick up the invariants without having
to re-read the whole package.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0995b5c09d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

## Public API surface

- `New(path, cfgMu, cfg, ctrlMu, ctrl, applier) (*Watcher, error)` — returns `nil, err` if fsnotify setup or directory registration fails.
- `(*Watcher).Start()` — spawns the watch goroutine; idempotent against restarts.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Correct non-idempotent watcher start semantics

Start() is documented as “idempotent against restarts,” but watcher.go currently does go w.loop() on every call without a guard, so repeated calls create multiple watcher goroutines on the same Watcher. In the same lifecycle, Stop() closes w.stop unconditionally, so consumers who trust the idempotent claim and restart/stop repeatedly can hit duplicate reload behavior and eventually a close of closed channel panic.

Useful? React with 👍 / 👎.

@frahlg
frahlg merged commit 7932806 into master Apr 15, 2026
@frahlg
frahlg deleted the docs/per-pkg-io-plumbing branch April 15, 2026 06:46
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 2.0.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

erikarenhill added a commit that referenced this pull request Apr 17, 2026
Three items in the 11-comment review are still outstanding after the
earlier rebase — the rest were already addressed in b6a5c78 / 4f3ad01:

- #3 EV card keyboard accessibility (web/index.html + web/app.js):
  add role="button", tabindex="0", aria-label, and Enter/Space key
  handler so the summary card can be activated without a mouse and is
  announced correctly by assistive tech.

- #9 Hardcoded "easee" provider (web/settings.js): Connect button now
  derives the provider name from the driver's lua path (strip dirs,
  trailing "_cloud", ".lua"), falling back to "easee" when the driver
  config is missing or oddly named. Lets a second cloud driver slot in
  without touching the button.

- #5 Missing tests for path normalization (config_test.go): cover
  stripLeadingDotDot, ResolveDriverPaths (relative / absolute-in-tree /
  absolute-out-of-tree / leading-"../"), and the full Resolve →
  Unresolve → Resolve round-trip. The round-trip test is the one that
  pins down Copilot #11 — absolute paths outside baseDir must stay
  absolute so the next Resolve doesn't strip a "../" from filepath.Rel
  and silently re-anchor the driver under baseDir.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant