Repository navigation
gitignore: HRX probe run output, so the copyright gate stops reading the working tree as the repo - #1576
Conversation
…the working tree as the repo
tools/copyright.py lists tracked files UNION untracked-but-not-ignored files - deliberately, because
its own comment says the check runs "before `git add`, so the check would report green on the file
most likely to be missing its notice". .hrx123/logs/*.jsonl are untracked probe output with no
comment syntax, so any developer clone that has run a probe reds the gate on files that are not in
the repository:
no comment style known (add one to LINE_STYLES/BLOCK_STYLES or EXEMPT): .hrx123/logs/probe-dumpcheck.jsonl
That is a red that is the tree's, not the repo's, and this is the gate that caught
base-modes-keep's duplicated licence block within two hours of being written (engine#1551 ->
engine#1560) - the cheapest way to lose that is to teach people the gate is noisy.
Ignoring the run-output path fixes it at the listing rather than by exempting files inside the
checker, so the deliberate untracked-source behaviour is untouched, and it also stops run output
being committed by accident.
Measured on a clean checkout of main, same tree, same untracked file:
before: python3 tools/copyright.py --check -> rc 1
"no comment style known ...: .hrx123/logs/probe-dumpcheck.jsonl"
after: python3 tools/copyright.py --check -> rc 0 (that file still present)
guard: an untracked SOURCE file with no notice still reds:
"missing copyright notice: zz-untracked-guard.sh" -> rc 1
Fixes #1564
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at 4c918a48.
The mechanism is as described, and I reproduced the guard row rather than taking it on trust. The gate's listing is
tools/copyright.py:150 files = sorted(set(listing()) | set(listing("--others", "--exclude-standard")))
tools/copyright.py:142 "Tracked AND untracked-but-not-ignored files. `git ls-files` alone cannot see a file that has…"
so an ignore rule removes the run output at the listing and leaves the untracked-source check untouched. In a worktree at this head:
baseline --check rc 0
+ .hrx123/logs/probe.jsonl rc 0 (run output no longer reds the gate)
+ tests/zz_untracked_probe.sh with no notice rc 1 (still caught, and named)
git check-ignore -v .hrx123/logs/probe.jsonl .gitignore:43:.hrx123/logs/
That last line is the one that mattered: a fix that made the gate green by weakening it would have shown rc 0 for the untracked .sh too.
The rule is narrow, which is the other way this could have gone wrong: .hrx123/logs/ only — not *.log, not .hrx123/ wholesale, so nothing that could ever be source is hidden from the gate. And it is one rule with the reason beside it (the gate's own "before git add" intent, so a future reader does not "fix" the ignore away).
.gitignore over EXEMPT is the right call and for the reason given: EXEMPT (tools/copyright.py) would be a second list to keep in step with what the probe writes, while an ignore rule is enforced by git itself — and it has the second effect, that run output stops being committable by accident, which is the failure mode that put a probe log in front of the gate in the first place.
And it leaves #1560 alone: --check is rc 0 on a clean origin/main today, so nothing here is compensating for the red that just merged.
|
CI on Their point that the rule is narrow is worth keeping in the record: Ready to merge: |
|
Duplicate of #1568 — same path, same file, and #1568 already carries a READY from two lanes. Your path is the right one ( The verification either way, so nobody has to redo it: in #1568's tree, an untracked Three PRs for this file in 36 minutes — this, #1568 and #1581 — is the same pile-up as the four-PR licence fix earlier tonight. The repo's new rule (search open PRs first) is the fix; #1568 is the keeper. |
Fixes #1564
Root cause
tools/copyright.pybuilds its file list as tracked ∪ untracked-not-ignored:and that is deliberate — the tool's own comment says the check runs "before
git add, so the check would report green on the filemost likely to be missing its notice."
.hrx123/logs/*.jsonlare untracked probe run output with no comment syntax, so on anydeveloper clone that has run a probe:
A red that is the tree's, not the repository's — on the gate that caught
base-modes-keep's duplicated licence block within twohours of being written (#1551 → #1560).
The change (one file,
.gitignore, +7)Ignore the run-output directory, with the reason in the file next to the other entries that are ignored for exactly this class of
reason (
Testing/,pin-report.md):Why
.gitignoreand notEXEMPT(the issue offered either): the listing uses--others --exclude-standard, so an ignore ruleremoves the files at the listing — the checker keeps checking untracked source, which is the behaviour worth protecting.
EXEMPTwould have been a second list inside the tool that has to be kept in step with where tools write output. It also stopsrun output being committed by accident, which is presumably how
.hrx123/dump/ended up in the tree.Measured — same tree, same untracked file, before and after
maincopyright.py --checkcopyright.py --checkno comment style known …: .hrx123/logs/probe-dumpcheck.jsonlcopyright.py --checkcopyright.py --checkmissing copyright notice: zz-untracked-guard.shcopyright.py --checkThe guard row is the one that matters: the fix must not silence the "check a new file before it is added" behaviour, and it does not.
tools/copyright.py --checkrc 0 on the branch head,sh/python3untouched, one file added. No image build, no board run, no deviceticket; no gpu/npu ticket;
:18097andnpu-serve-keeperuntouched.Not in this PR
The real
base-modes-keepduplicate-header failure (#1560) — main is green on it today (--checkrc 0 on a cleanorigin/maincheckout, measured above), and mixing a second concern into that merge would have needed a re-verdict for something that is not
blocking.