Docs: per-package CLAUDE.md for IO + plumbing layers - #11
Conversation
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>
There was a problem hiding this comment.
💡 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. |
There was a problem hiding this comment.
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 👍 / 👎.
|
🎉 This PR is included in version 2.0.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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>
Summary
drivers,mqtt,modbus,arp,ha,api,forecast,configreload.Capabilitybetween drivers).Test plan
cd go && go build ./...— cleancd go && go test -timeout 120s -count=1 ./...— all greendocs/*.mdlink 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.