Tool transcripts cannot be committed again: .gitignore refuses *.log, with a lint on the tree - #796
Conversation
… with a lint on the tree Triage of PR #785 found an npm-install.log committed at the repo root. It was removed by hand, but nothing in the toolchain had objected to it: it sits outside the package files allowlist, touches no code path, and .gitignore carried no rule for tool transcripts, so git status listed it as an ordinary new file. Only a human reading the diff caught it. This closes the class from both ends. .gitignore now ignores *.log, so an install/test/typecheck transcript never reaches git add. test/core/ repo-scratch-hygiene.test.js asserts both halves: no .log is tracked, and the ignore rule actually covers the paths that showed up (root and nested). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ames the right fix
VerdictThe change is sound and the diagnosis is right: the root cause of Two findings. One was a real defect in the probe and is fixed and pushed. One is a merge-ordering hazard that this PR cannot fix by itself and that I want louder than a paragraph in the PR body. Finding 1 (Medium, fixed): the ignore probe read the index, so a tracked
|
VerdictRound 2 of 2. Round 1's The change is still the right shape and the diagnosis is still right. Approving the substance; the remaining item is a maintainer's merge decision, not a code defect. Round 1's fix: re-verified, complete
No regression, nothing half-applied. The Finding 1 (Medium, fixed): the ".gitignore refuses a tool transcript" test did not test
|
| state | before | after |
|---|---|---|
| clean branch | 3 pass | 3 pass |
| rule reverted, no global ignore | test 2 fails | tests 2+3 fail, each path tagged (no rule matches) |
rule reverted, global *.log |
3 pass (hole) | tests 2+3 fail, identical to above |
rule present, global *.log |
3 pass | 3 pass |
merged with fix/issue-783 |
1 accurate failure | 1 accurate failure, unchanged |
The result is now machine-independent, which is what the PR body already claims for it.
Finding 2 (Low, fixed): a git fatal was silently read as "not ignored"
Same line: return result.status === 0 collapsed every status other than 0/1 into false. check-ignore exits 128 on a real failure - a safe.directory / dubious-ownership refusal, or a tree with no .git (confirmed: fatal: not a git repository, exit=128). Test 2 would then fail with ".gitignore needs a rule covering them", pointing at a file that is already correct, and test 3's negative assertion would pass for the wrong reason.
This is the same class as the bug round 1 found - a probe failure disguised as a rule failure, with a misleading remedy - so it is worth closing alongside it. Status outside {0, 1} now throws with the captured stderr.
Finding 3 (Low, fixed): the anti-vacuity assertion was coupled to an unrelated rule
test/core/repo-scratch-hygiene.test.js:86 leaned on isIgnored('hypaware-9.9.9.tgz'), i.e. on *.tgz staying in .gitignore. A maintainer moving pack output under a /dist/ rule would redden a transcript-hygiene test with a message about *.tgz and no hint that the transcript rule is fine. Replaced with an assertion the test owns: the rule matching npm-install.log reports pattern *.log. Same anti-vacuity force (the probe must be able to answer "ignored"), no borrowed dependency.
Finding 4 (Medium, open, needs a maintainer): merge order against #785
Re-checked at review time and unchanged since round 1, so the disclosure is still accurate and still owed:
- PR Close the rl.question EOF-hang class: the wizard fork menu, both y/N confirms, and the OAuth paste #785 (
fix/issue-783, heada1787e0e) isOPEN,MERGEABLE, labelledneutral:approved, held for a maintainer merge. - It still tracks
x/npm-test.logandx/typecheck.log(in anx/scratch dir alongsidex/burst.mjs,x/invert.mjs,x/line_asker.{fixed,orig}.js,x/msg.txt,x/order.mjs,x/pty_prog.mjs,x/pty_variants.mjs).
If #796 lands first, #785 goes red after approval, through no change of its own. I agree with this PR's judgement that this is the gate working, not a reason to weaken it - those two files are the same class as the npm-install.log issue #786 is about - and I agree with not adding a bare x/ to .gitignore, which is too generic a claim for a reviewer to make. But neutral:approved reads as "ready to merge as-is", and nothing on #785 says otherwise.
For whoever merges:
- Merge Close the rl.question EOF-hang class: the wizard fork menu, both y/N confirms, and the OAuth paste #785 first, then Tool transcripts cannot be committed again: .gitignore refuses *.log, with a lint on the tree #796. Cheap path, needs nothing else.
- Or if Tool transcripts cannot be committed again: .gitignore refuses *.log, with a lint on the tree #796 goes first, Close the rl.question EOF-hang class: the wizard fork menu, both y/N confirms, and the OAuth paste #785 needs
git rm -r x/(or at minimumgit rm x/npm-test.log x/typecheck.log) first. Verified just now on the merged tree: the failure is a single test naming exactly those two paths with "delete it" as the remedy, so the required action is legible straight from the CI log.
I have deliberately not touched #785, per this round's scope.
Left alone, with reasons
- No exemption mechanism. The sibling
test/core/house-style-em-dash.test.jscarriesEXEMPT_PREFIXESso an exception lands as "a visible diff with an argument attached". This lint has none, so a future legitimate.logfixture would needgit add -fplus a code change here, against a message that only says "delete it". Low: no such fixture exists, every.logthe code writes goes toHYP_HOME/temp, and inventing an unused exemption list now would be speculative. Round 1 reached the same conclusion; recording it so the next person knows it was considered twice, not missed. - Case sensitivity.
f.endsWith('.log')and the*.logpattern are both case-sensitive, soNPM-INSTALL.LOGis uncovered by both halves. Consistent rather than defective, and not worth a case-folding pass. files.length > 500. 1118 tracked files today, so the sanity floor has real headroom.- Blast radius of unanchored
*.log. Re-confirmed: zero tracked.logonmasteror this branch, and thepackage.jsonfilesallowlist (bin/,src/,hypaware-core/,types/, one.d.ts) contains none, sonpm packis unaffected. - No
@refadded. Correct as argued, and worth repeating that the sibling's// @ref LLP 0001#tooling [tests]is itself dangling onmaster(llp/0001-adopting-llp.plan.mdhas notoolinganchor), so copying it would have propagated a broken ref. Pre-existing, out of scope, unchanged. - Finding 2 of issue Follow-up: deferred review findings from PR #785 #786 (LLP 0190
#eof-everywhere). Agreed and unchanged; the section only exists onfix/issue-783and 0190 is stillDraft.
House style
No semicolons, no em dash anywhere in the diff (repo-wide em-dash lint passes on the fixed tree), JSDoc types with no @typedef and no inline import() types. The new JSDoc return type is a structural literal, no type import needed. CI is ubuntu-latest only, so core.excludesFile=/dev/null is portable where it runs.
Head after fix: 599a08f587c2c353b9be2f6567ef00a077eb86ff. Only test/core/repo-scratch-hygiene.test.js changed (+43/-10); .gitignore is untouched from what this PR proposed. npm test 4219 pass / 0 fail, npm run typecheck clean.
Round 2 of a 2-round cap. Findings 1-3 are fixed here. Finding 4 is not a code defect and cannot be fixed from this branch - it is a merge-order call for a maintainer.
|
Triage at head All in-review fixes re-verified against the current tree, including the round 2 machine-independence claim: with the Every residual finding is non-blocking. They are recorded in #826, including the one that needs a human decision: merge ordering against #785, which is still OPEN, |
Issue #786 carried two deferred findings from triage of PR #785. One is fixed here, one is deliberately left alone.
Finding 1: the stray
npm-install.log(fixed, behavioural)The file itself was already removed from
fix/issue-783ina1787e0, so nothing lands onmasterwhen #785 merges. What the issue left open is the second half of its own recommendation: "consider addingnpm-install.log(or*.log) to.gitignoreso a reviewer's install transcript cannot be committed again." That was never done, and the root cause is exactly there.Nothing in the toolchain objects to a committed transcript. It is outside the
package.jsonfilesallowlist sonpm packstays clean, it touches no code path so no test moves, and.gitignorehad no rule for it sogit statuslisted it as an ordinary new file. The only check that caught it was a human reading the diff, which is the check that is not there next time.Fix.
.gitignorenow ignores*.log, so an install/test/typecheck transcript never reachesgit add -Ain the first place.test/core/repo-scratch-hygiene.test.jsgates both halves: no.logis tracked, and the ignore rule actually covers the paths that show up in practice (repo root and nested). It is a lint on a property of the repository, written in the shape of the existingtest/core/house-style-em-dash.test.js.Proof. With the
.gitignorechange reverted and the test in place:The failure names the paths:
npm-install.log,npm-test.log,typecheck.log,x/npm-test.log,src/core/cli/debug.log. With the.gitignorechange applied:Test 3 is the anti-vacuity check: it asserts the probe reports a tracked source file as not ignored and an already-covered pattern (
*.tgz) as ignored, so a probe that answered "ignored" for everything cannot pass test 2.No
@refwas added. No LLP governs repository hygiene (thehypignoredocuments cover the product's capture-exclusion feature, not.gitignore), and per the house rule a ref must tell you something the code and filename do not.Finding 2: LLP 0190
#eof-everywhereplacement (deliberately unchanged, not a defect)The issue records this as "closed as no-change", and the maintainer note repeats it: 0190's
Systems: Onboarding, CLIline is narrower than the tree-wide EOF rule appended to it, but that is a discoverability preference, not a defect, and the named future move is to flip 0190 toAcceptedwhen the wizard work settles and mint the next EOF-class change as its own LLP. That decision is a maintainer's to make and is gated on work that has not settled.It is also not actionable from
masteryet: the#eof-everywheresection exists only onfix/issue-783, so nothing onmastercurrently contains the text in question. Left untouched.Note for #785
The new lint will fail on
fix/issue-783as it stands: that branch adds anx/scratch directory containingx/npm-test.logandx/typecheck.log(alongsidex/burst.mjs,x/pty_variants.mjs,x/msg.txtand others). That is the same class as thenpm-install.logthis issue is about, so the gate is doing its job.x/itself is not added to.gitignorehere, since a bare directory name that generic is too broad to claim tree-wide without a maintainer's call.Verification
npm test: 4219 pass, 0 fail, 1 skipped.npm run typecheck: clean.One environment note, for anyone reproducing: a checkout whose
node_moduleslacks the dev dependencies fails 22 unrelated tests (parquet predicate pushdown and report rendering) and failstypecheckwithTS2688: Cannot find type definition file for 'node'. Both are artifacts of the missing install, identical on unmodifiedmaster, and both clear after a realnpm install. The numbers above are from a fully installed tree.Fixes #786