Repository navigation
fix(tools): scan the repository, not the disk under it - #37
Conversation
|
Reviewed as part of an automated pass over open PRs/issues. This looks safe to merge on its own merits. It's tooling-only (no driver, package, or contract changes — correctly marked "not applicable" throughout the PR template), the fix itself is narrow and well-reasoned (git-ls-files instead of an rglob that doesn't respect gitignore), it ships its own regression test, and all 5 required checks ( Could not merge automatically — the merge API keeps rejecting it: despite Flagging for a maintainer to merge directly (or re-trigger/investigate branch protection) — no code concerns on my end. Generated by Claude Code |
e302156 to
fa0097b
Compare
check_public_boundary.py enumerated files with ROOT.rglob("*"), which
walks past git's ignore rules. A git worktree under .claude/worktrees/
is a second full checkout, so its copies of SOURCE_IMPORT.md,
baselines/ftw/drivers/pixii.lua and source-import-delta.json failed the
forbidden-private-reference rule. `make boundary`, and so `make check`,
reported six errors naming paths the contributor never edited. CLAUDE.md
tells contributors to run `make check` before merge; they could not
while a worktree existed. CI never saw it, because CI has no worktree.
Enumeration now asks git: `ls-files --cached --others
--exclude-standard`. Tracked files behave as before. In this checkout
the new file set is a strict subset of the old one, nothing added, and
everything dropped is a worktree copy, __pycache__, .pytest_cache or a
built lua55/luac55. Untracked files that are not ignored stay in scope,
so a secret is still caught before it is staged.
main() takes a root, which is the seam the tests need. Three tests
against a temporary repository hold that an ignored checkout is not
scanned, and that a tracked or an untracked file still fails.
Co-authored-by: Claude Opus 5 <[email protected]>
Signed-off-by: Fredrik Ahlgren <[email protected]>
dafb753 to
a379423
Compare
#37 taught the boundary check to scan the repository rather than the disk under it, so make check passes locally again with worktrees present. #38 removed sigenergy's SoH read. #39 stopped sungrow accepting a battery command on an inverter with no battery. Two real conflicts, both in drivers this branch had also touched: sigenergy main removed the SoH read at 30087 outright; this branch had bounded it. Removing a read whose result is discarded is strictly better than bounding it, so main's side stands and the bounded probe covers the remaining five reads. sungrow merged cleanly in the Lua: main's control-path guard plus this branch's bounded reads through optional_read. Zero violations, and the string-inverter refusal is intact. Both files now differ from main's bytes under main's version, so both move again -- sigenergy 1.1.1 -> 1.1.2, sungrow 1.5.1 -> 1.5.2. This is exactly what the signed channel refuses to publish otherwise, and what the SemVer gate in ftw#709 checks across a pin move. Swept the whole catalog afterwards: zero absent-register violations across every driver. make check green, 3008 tests pass. Co-Authored-By: Claude Opus 5 <[email protected]> Signed-off-by: Fredrik Ahlgren <[email protected]>
Summary
No hardware support or contract changes. This fixes the boundary check, which
made
make checkunrunnable on any machine with a git worktree.tools/check_public_boundary.pyenumerated files with
ROOT.rglob("*"), a filesystem walk that ignores git'signore rules. A git worktree under
.claude/worktrees/is a second fullcheckout, so its copies of
SOURCE_IMPORT.md,baselines/ftw/drivers/pixii.luaandsource-import-delta.jsonfailed theforbidden-private-reference rule:
Six errors, all naming paths the contributor never edited. CLAUDE.md tells
contributors to run
make checkbefore merge, and they could not. CI never sawit, because CI has no worktree.
The check now asks git what the repository contains:
.claude/worktrees/is already in.git/info/exclude, so git knows these filesare not ours.
What a reviewer should know
Why
--others --exclude-standardand not--cachedalone. The old walkalso read untracked files, so a private key in a new file was caught before
git add. Tracked-only enumeration would have dropped that.--exclude-standardhonours
.gitignore,.git/info/excludeand global excludes, which is whatshuts out the worktrees.
Tracked files behave exactly as before. Comparing both enumerations over a
checkout holding two worktrees: 1198 files → 379, nothing added. Everything
dropped is a worktree copy (759),
__pycache__(53),.pytest_cache(5) or abuilt
lua55/luac55(2). No source file lost coverage.main()now takes aroot. That is the seam the tests need; the defaultstays
ROOT, so the Makefile target is unchanged.The new test file cannot name a forbidden string — writing one would make
tests/test_public_boundary.pyfail the very check it tests. It reads one fromboundary.FORBIDDEN_TEXTinstead.Driver evidence
not applicable— no driver changes.Safety
The first three do not apply: no driver or package changes.
Package or promotion evidence
not applicable— tooling only, no package version, target or control contractchanges.
Checks
Signed-off-by.make test-driver ID=<id>—not applicablemake package-driver ID=<id> TARGET=<target>—not applicablemake check— exit 0 with two worktrees present, 2034 passed, 2251skipped. Before this change the same command failed at the first step.
🤖 Generated with Claude Code