Skip to content

Add a top-level README, verified against the source files - #34

Merged
aphelps-claude-bot merged 5 commits into
mainfrom
top-level-readme
Aug 20, 2026
Merged

aphelps-claude-bot merged 5 commits into
mainfrom
top-level-readme

Conversation

@aphelps-claude-bot

Copy link
Copy Markdown
Collaborator

There was no README.md at the repo root, so a newcomer landed on CLAUDE.md (written for agents) or skills/README.md (skills only). Neither answers "what is this and where do I start".

Your three decisions, and how two of them changed the task

  • Audience: you plus collaborators who may be remote and setting up while you are unavailable. That is the requirement that did the most work. It means the README has to stand alone — hence a "When it goes wrong" section and the traps written down, rather than just the happy path.
  • "Quick deploy on clone should be the standard." So clone → setup → build → flash → verify is the spine, not an appendix. Flashing, the WLED_IP= override, and checking /json/info matches what you just built are on the main path.
  • Reference only files in this repo. This turned out to agree with a separate problem: submodule paths are gitlinks, so a relative link into WLED/ or esp-now-router/ 404s on github.com even though the file is on disk. Both rules point the same way, so submodule docs (BACKBONE_ROUTER.md, SENSOR_SYNC.md, the rs485_bridge readme) are named as plain-text paths, never links.

It deliberately does not lean on CLAUDE.md

You said you were unsure references belonged there, and the evidence backs that. CLAUDE.md carries at least three claims that are no longer true:

  1. pio run "defaults to esp32dev" — default_envs is actually a 23-target ESP8266/ESP32 release list starting with nodemcuv2.
  2. It documents 4 make targets; the Makefile defines 8.
  3. It says "Version 0.15.3"; WLED/package.json says 16.0.1.

Sending a remote collaborator there for setup instructions would propagate those to exactly the people least able to spot them. So CLAUDE.md gets one mention — "this is what AI assistants read, parts have drifted, prefer this README" — and is never an instruction source. Fixing CLAUDE.md itself is out of scope here and worth its own task.

tools/check_readme.py — because I made this mistake myself

My first draft inherited two of those stale claims straight from CLAUDE.md. Plan review caught them. That is exactly the failure mode a setup document cannot afford, so the checks are now a script, wired in as make test-readme and part of make test:

  • every markdown link resolves to a file tracked in this repo
  • no link points into a submodule path
  • the README never instructs the reader to consult CLAUDE.md for a setup step
  • every make target and every [env:...] named exists in the file the README attributes it to
  • the submodule table matches .gitmodules exactly
  • setup.sh --no-verify, WLED_IP, and set_build_info.py really exist and work as described

So the README is verified against platformio.ini, the Makefile and .gitmodules rather than against anyone's memory, and it fails CI if it drifts.

Scope

Written for main as it is today: scripts/ and tests/ arrive with #31/#32, so nothing references them and make test is described as the four suites that exist. A short follow-up adds the fleet-scripts section once those land — I would rather ship a correct README now than one that links to files that are not there.

make test green, including the new checks.

Testing Required

One item, and it is the whole point: read it cold and say whether it answers "what is this and where do I start". I am a poor judge of that from inside the repo — particularly whether the Quick start is genuinely followable by someone who has never seen this project and cannot ask you a question.

There was no README.md at the repo root, so a newcomer landed on CLAUDE.md
(written for agents) or skills/README.md (skills only). Neither answers
"what is this and where do I start".

Adam's three decisions shaped it, and the first two changed the task:

- **Audience is him plus collaborators who may be remote and setting up
  while he is unavailable.** So it has to stand alone: a "when it goes
  wrong" section, and the traps documented rather than just the happy path.
- **"Quick deploy on clone should be the standard."** Clone -> setup ->
  build -> flash -> verify is the spine, not an appendix. Flashing and
  confirming /json/info matches what you built are part of the main path.
- **Reference only files in this repo.** That rule and the gitlink problem
  agree: submodule docs (BACKBONE_ROUTER.md, SENSOR_SYNC.md, the
  rs485_bridge readme) are named as plain-text paths, never linked — they
  are not this repo's files and they 404 on github.com because GitHub
  renders a submodule as a commit pointer.

It deliberately does not send the reader to CLAUDE.md for any setup step.
CLAUDE.md is written for agents, and it carries at least three claims that
are no longer true — the default build env, the number of make targets, and
the WLED version (it says 0.15.3; package.json says 16.0.1). Propagating
those to the people least able to spot them would be the worst outcome.

That is also why tools/check_readme.py exists, wired in as `make
test-readme` and part of `make test`. It verifies the README against
platformio.ini, the Makefile and .gitmodules rather than trusting anyone's
memory: links resolve to tracked files, no link points into a submodule,
every make target and [env:] named exists in the file it is attributed to,
the submodule table matches .gitmodules, and setup.sh/upload_wled.py really
support the flags shown. My own first draft inherited two of CLAUDE.md's
stale claims, which is the failure this guards against.

Scoped to what is on main today: scripts/ and tests/ arrive with #31/#32,
so nothing references them yet and `make test` is described as four suites.
A follow-up adds the scripts section once those land.

make test green.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

@aphelps-claude-bot aphelps-claude-bot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewed by checking every factual claim against the repo rather than against the prose. The good news first: the numbers are right (WLED/platformio.ini really has 37 [env:] blocks; default_envs really is 23 targets starting with nodemcuv2; package.json says 16.0.1; upload_port = 192.168.1.55 in [env:ampworks]), both relative links resolve to tracked files, all 8 make targets exist, all 6 named envs exist in the ini each is attributed to, the .gitmodules table is exact, and the Node claim is correct where CLAUDE.md is stale (/wled00/html_*.h is gitignored and untracked in the fork). make test-readme passes. Findings below are inline except these two.

1. The fleet-scripts pointer the task asked for is missing entirely. The task and the plan both name "where the fleet scripts live (scripts/README.md)" as required content, and the plan's layout table lists a scripts/ row ("fleet tools over the network"). Neither is in the README. The cause is understandable — scripts/ is currently untracked in this repo (git ls-files scripts is empty; promote-base-to-main.sh and wled-ap-hop.sh exist only on disk), and scripts/README.md arrives with PR #31, which has not landed — so linking it today would fail the link checker. But the effect on the reader is that the "Repo layout" table, which reads as exhaustive, silently asserts that scripts/ does not exist. The plan's own Post-Merge Verification ("the pointer table depends on scripts/README.md from PRs #31/#32, and a merge-order slip leaves a dead link") is now checking for a link that was quietly dropped instead. Either hold this PR until #31 lands and add the row + the Further-reading link, or add a follow-up task so the omission is tracked rather than forgotten — right now nothing in the repo records that it is missing.

2. Suggested test: pin the drift-prone numeric and version claims. check_readme.py's own docstring says it exists because the first draft inherited three false claims from CLAUDE.md — "the default build env, the number of make targets, the WLED version" — yet it checks none of the numbers. "a fork of WLED 16.0.1", "37 environments", "23 ESP8266 and ESP32 targets, starting with nodemcuv2", and the default 192.168.1.55 are all correct today (I verified each), and all four are exactly what an upstream bump or a platformio.ini edit falsifies — the class the tool was written to catch. They are cheap to assert: version from WLED/package.json, the two counts from len(re.findall(r'^\[env:', wled, re.M)) and the parsed default_envs list, the IP from upload_port in [env:ampworks]. Without them the checker's coverage stops just short of the claims most likely to rot.

Comment thread tools/check_readme.py Resolved
Comment thread tools/check_readme.py Resolved
Comment thread README.md Resolved
Comment thread Makefile Resolved
Comment thread README.md Resolved
The self-review found six issues; four were real and are fixed here. The
embarrassing ones are in the checker I added to prevent exactly this.

**Commands in the README did not run when pasted.** `make test-bridge# HMTL
wire format (run twice: ...)` — `#` glued to the target is not a bash
comment, so pasting it gave `No rule to make target 'test-libs#'` and a
bash syntax error on the parentheses. Both reproduced. In a document whose
whole purpose is being followable by someone who cannot ask a question,
that is the worst defect in the PR. The columns are now aligned so every
`#` is a real comment, and two checks guard it: `bash -n` per line, plus an
assertion that `#` is preceded by whitespace — because `bash -n` only
catches syntax errors, and `make test-libs# note` parses fine while
invoking a target that does not exist.

**Two assertions could never fail.**
- The submodule check used a substring test, and `aphelps/WLED` is a
  substring of the clone URL `aphelps/WLED_dev.git`, so it passed with the
  entire WLED row deleted. Strengthened to require the path and its
  upstream URL on the same line — which also fixes a second weakness found
  while mutation-testing: `| \`WLED/\`` appears in the Repo layout table
  too, so "does this path appear anywhere" was still satisfiable.
- The env and .gitmodules sections announced they were checking the README
  while testing hardcoded literals. They now parse the README's own tables,
  so a typo or a rename fails.

**`make test` broke unhelpfully on an uninitialised clone** — `test-readme`
was the only suite with no `require_submodule` guard, so it died on a
FileNotFoundError traceback instead of the deliberate "run ./setup.sh"
message. Guarded, and the script now resolves paths from its own location
rather than the cwd.

Also added the drift-prone numbers the docstring claimed to protect but did
not check: WLED version, env count, default_envs count, default device IP.
Writing that check found my own error — the first regex ran past the blank
line terminating `default_envs` and reported 36 where the answer is 23. The
README was right; the check was wrong.

Every check is now mutation-tested: 10 deliberate defects introduced, 10
caught. One apparent miss was a mis-specified mutation that changed a link
label while leaving the URL correct — passing was the right answer, and
mutating the URL itself is caught.

Not fixed, deliberately: the fleet-scripts pointer. `scripts/` is untracked
on main until #31/#32 land, so linking it would fail the link checker. A
follow-up adds it.

make test green.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

@aphelps-claude-bot aphelps-claude-bot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Re-review of 23f9c05..83809ba. I did not re-check the facts I verified last round; I checked the one thing the increment claims.

The headline claim holds: every check can now fail. I broke the artifact each assertion guards, one at a time, and confirmed a non-zero exit. 15/15 mutations were caught, and the tree restored to ALL CHECKS PASSED afterwards:

Mutation Caught by
link retargeted to an untracked path link -> skills/NOPE.md
link retargeted into WLED/ link not into a submodule (+ untracked)
unbalanced quote in a bash block pastes cleanly
make test-libs # → make test-libs# '#' is separated from the command
"see CLAUDE.md" added on the setup path README stands alone for setup
make test-libs → make test-nope make test-nope
display_only → display_onlyx in the env table has [env:display_onlyx]
HMTL row deleted from the submodule table submodule table row for HMTL
README says WLED 16.0.2 WLED version 16.0.1 as stated
README says 38 / 24 / .77 each numeric check
chmod -x setup.sh setup.sh is executable
upstream package.json bumped to 16.0.2 WLED version 16.0.2 as stated
upstream ini gains a 38th [env:] 38 environments as stated

The last two matter most: they are drift originating outside this repo, which is the failure mode the tool's docstring was written about, and both are now caught. Prior finding 2 is fully addressed, and the docstring's "prove it fails by breaking the thing it guards" is the right norm to have written down.

The README bash block is also fixed — all 16 command lines parse under bash -n, all 7 make test-* targets they name exist in the Makefile, and make/make test resolve to the real test: target (which does include test-readme). The require_submodule guard on test-readme is correct and consistent with its five siblings.

Prior finding 1 is still unresolved and still untracked. scripts/ has no row in the Repo layout table and no Further-reading pointer, and the increment does not add a follow-up task recording that. The table still reads as exhaustive while silently asserting scripts/ does not exist. The reason remains sound (scripts/ is untracked until #31 lands, so a link would fail the checker today) — but the plan's own Post-Merge Verification is now watching for a link that was dropped rather than deferred. Either hold for #31 or file the follow-up; right now nothing in the repo remembers.

Suggested test: the Makefile → README direction is unchecked. check_readme.py verifies that every target the README names exists, so a renamed target is caught. A new test-* target added to the Makefile and never added to the README is not — the list silently goes stale, which is the same drift class the numeric checks were just added for. All 8 test targets are listed today (only clean is absent, correctly), so this is cheap to lock in now: assert set(re.findall(r'^(test-[a-z]+):', makefile, re.M)) <= named_targets.

Inline: four false-positive risks in the new checks and one crash path. None of them is wrong today; all are things a legitimate future edit trips.

Comment thread tools/check_readme.py Resolved
Comment thread tools/check_readme.py Resolved
Comment thread tools/check_readme.py Resolved
Comment thread tools/check_readme.py Resolved
Comment thread tools/check_readme.py Resolved
Comment thread Makefile Resolved

@aphelps-claude-bot aphelps-claude-bot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Re-review of 83809ba..7716c7d — one file, tools/check_readme.py, addressing the five inline findings from last round. I verified each fix by mutation (10 mutations run, tree restored to ALL CHECKS PASSED after; make test-readme green at HEAD):

  • Block-level bash -n — addressed. A synthetic for ... do ... done block now passes; an unbalanced quote and an unterminated for each still fail pastes cleanly.
  • Narrowed glued-# — addressed, with one new gap the narrowing opens, noted inline. curl -s http://192.168.1.55/#/settings no longer false-positives; make test-libs# is still caught.
  • Count checks match number-near-keyword — addressed. Rewording to "37 build environments" passes; a 38th upstream [env:] still fails.
  • .group(1) crash paths — addressed. Renaming version in WLED/package.json and disabling default_envs each produce a FAIL line, exit 1, and zero bytes on stderr — no traceback.
  • upload_port scoped to [env:ampworks] — addressed and hardened beyond the finding: a decoy upload_port planted in an earlier env is ignored, and deleting ampworks' own key fails upload_port set in [env:ampworks].
  • Makefile SKIP-asymmetry thread — resolved as agreed: documented in the docstring (run via make test-readme; bare invocation is not a safe CI entry point), matching the inline discussion rather than adding code.

Still open, unchanged by this increment:

  • Prior finding 1 (scripts/ row) — still unresolved and still untracked. #31 and #32 remain open, so the hold rationale still applies, but todo.md on this branch records nothing and this is the third review noting it. One follow-up line is all it needs so the dropped row is remembered somewhere.
  • Suggested test (repeat): the Makefile → README direction is still unchecked. All 7 test-* targets are named in the README today, so set(re.findall(r'^(test-[a-z]+):', makefile, re.M)) <= set(named_targets) would pass as-is and lock the list against silently going stale.

Comment thread tools/check_readme.py Resolved

@aphelps-claude-bot aphelps-claude-bot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Re-review of 7716c7d..08c690b — a single commit closing the inline gap noted last round (env names glued to # escaped the narrowed check). Verified by mutation, tree restored to ALL CHECKS PASSED at HEAD:

  • Inline gap from last round — addressed. pio run -e ampworks# builds our firmware planted in a bash block now FAILs; make test-libs# just the libs (the original catch) still FAILs; curl -s http://192.168.1.55/#/settings (the URL-fragment false-positive the narrowing existed to avoid) still passes. The length-descending sort and re.escape carry over to the merged token set, so no prefix-shadowing regression.
  • One cosmetic note inline on the new comment — the sweep catches slightly more than "env names", benignly.

Still open, unchanged by this increment (same two as last round):

  • Prior finding 1 (scripts/ row) — still unresolved and still untracked. #31/#32 remain open so the hold rationale stands, but the README task entry in todo.md on this branch (lines 70-86) still records nothing about the dropped pointer-table row. This is the fourth review noting it; one follow-up line closes the thread.
  • Suggested test (repeat): the Makefile → README direction is still unchecked. set(re.findall(r'^(test-[a-z]+):', makefile, re.M)) <= set(named_targets) would pass as-is today (all 7 test-* targets are named in the README) and lock the list against silently going stale.

Comment thread tools/check_readme.py Resolved
Same conflict as on the apjoin branch: this branch added test-readme to .PHONY
and test's prerequisites while main added test-hmtl. Neither removes the other,
so the resolution is the union.

Both targets exist after the merge (test-hmtl:152, test-readme:191) and `make -n`
reaches each. tools/check_readme.py SKIPs here because the submodules are not
checked out in this worktree, which is its documented behaviour, not a failure.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01F4oTr1YW3z7ozksMUT1z5j
@aphelps-claude-bot

Copy link
Copy Markdown
Collaborator Author

Rebased onto main and resolved the Makefile conflict as the union of both sides — this branch's
target plus main's test-hmtl. Verified both exist after the merge and that make -n reaches each.

Heads-up for whoever merges this and #32: both branches were merged against a main carrying
test-hmtl only, and each adds its own target to the same .PHONY / test: lines. Whichever
lands first will make the other conflict again
, on the same line, with the same union resolution.
It is a two-line hand-merge, not a problem — just expect it rather than treating it as new drift.

Filed as a P4: that list is a single line every new test target has to edit, so any two such branches
conflict by construction. Accumulating into a variable (TEST_TARGETS += … beside each target's own
definition) would make it mergeable and put the registration next to the thing it registers.

@aphelps aphelps left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Verify this is still accurate and then merge.

@aphelps-claude-bot
aphelps-claude-bot merged commit f2e9378 into main Aug 20, 2026
1 check passed
aphelps pushed a commit that referenced this pull request Aug 20, 2026
The re-conflict predicted when #34 merged first. Three hunks this round, not one:
the help comment, the .PHONY/test lists, and — new — the target recipes
themselves, since test-apjoin and test-readme now sit at the same place in the
file. All three resolve as the union; neither side replaces the other.

Verified rather than assumed: both recipes dry-run, `make -n test` reaches them,
and the branch suite is 54/54.

This is the third time this line has conflicted in one session (test-hmtl,
test-readme, test-apjoin). Filed as a P4 in WLED_dev's todo: accumulating into a
TEST_TARGETS variable beside each target's own definition would make it mergeable
instead of a serialisation point every branch has to queue through.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01F4oTr1YW3z7ozksMUT1z5j
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.

2 participants