Skip to content

chore: remove a scratch test transcript that reached main in #1951 - #1975

Merged
justinchuby merged 1 commit into
mainfrom
squad/pris-remove-stray-log
Aug 24, 2026
Merged

justinchuby merged 1 commit into
mainfrom
squad/pris-remove-stray-log

Conversation

@justinchuby

Copy link
Copy Markdown
Owner

What this removes

.pris_v4.log — 1364 lines of cargo test transcript — reached main in #1951 (589d48ffd). It is mine. It is inert, but it is junk in the tree and it should come out before anyone branches off it.

How it happened, stated plainly

I amended a commit with git add -A in a worktree that had a teed test log sitting in it, and I pushed without reading the commit's file list. The file was named outside every pattern in .gitignore, so nothing stopped it.

I did catch it — running git diff --name-only origin/main...HEAD showed exactly three paths where there should have been two, and I amended it out. By then auto-merge had already taken the earlier head, which is correct behaviour on its part: the required checks were green and nothing in this repo's CI has an opinion about a stray file. The check that would have caught it is the one I ran second instead of first.

The generalisable bit, since it is not specific to me: git add -A in a worktree you have been running builds in stages whatever is lying around, and the only thing between that and main is a file-list check you have to remember to run. Reading git show --stat before pushing costs nothing. It is the same class as the fixture blast-radius traps @resch and @Gaff hit today — the command's scope was wider than the change I had in mind, and nothing about the command said so.

Why the .gitignore line

.gitignore already carries a block for precisely this:

# Belt and braces: the convention above is easy to forget, and a stray commit-
# message file has reached a PR before.
CM*.txt
PR*.md
# Issue and review bodies staged the same way, for gh issue create --body-file.
.issue-*.md

That block exists because a stray commit-message body reached a PR once. This is the same failure with a different extension, so it belongs in the same list rather than in a habit I promise to keep.

Scoped to /*.log — root only — so a crate or fixture that legitimately tracks a .log is unaffected. Falsified in both directions rather than assumed:

scratch.log                                   IGNORED
.pris_probe.log                               IGNORED
crates/onnx-genai-engine/nested_probe.log     NOT ignored

The third line is the one that matters: a rule that ignored every .log anywhere would hide a tracked fixture log from git status, which is a worse failure than the one it prevents.

Validation

No behavioural change — the deletion is an untracked-by-anything text file and the .gitignore edit cannot affect a build. No test, lint, or build result is a function of either change, so I am not going to dress this up with a green matrix that would be true of an empty commit.

Normal auto-merge, required checks only. No admin bypass.

Refs #1951.

`.pris_v4.log` is 1364 lines of `cargo test` output. It is mine and it
should never have left my worktree.

How it got in: I amended a commit with `git add -A` in a worktree that
had a teed test log sitting in it. The file was named outside every
pattern in .gitignore, so nothing stopped it, and I did not read the
commit's file list before pushing. I caught it in the same check that
should have run first -- `git diff --name-only origin/main...HEAD` --
but by then auto-merge had already taken the earlier head.

No behavioural change; the file is inert.

The .gitignore line is the same belt-and-braces reasoning the file
already documents for CM*.txt / PR*.md / .issue-*.md, which exist
because a stray commit-message body reached a PR once before. This is
the same failure with a different extension, so it belongs in the same
list. Scoped to `/*.log` -- root only -- so a crate or fixture that
legitimately tracks a .log is unaffected.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@codecov

codecov Bot commented Aug 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.40%. Comparing base (011fbb2) to head (3fd3bbd).
⚠️ Report is 13 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1975      +/-   ##
==========================================
+ Coverage   80.21%   80.40%   +0.18%     
==========================================
  Files         421      423       +2     
  Lines      203480   207429    +3949     
  Branches   203480   207429    +3949     
==========================================
+ Hits       163231   166773    +3542     
- Misses      34675    35016     +341     
- Partials     5574     5640      +66     
Flag Coverage Δ
cli-ort-linux 72.51% <ø> (?)
cli-ort-windows 72.01% <ø> (ø)
mlas 85.20% <ø> (?)
offline 80.53% <ø> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 22 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@justinchuby
justinchuby merged commit 7a6482c into main Aug 24, 2026
17 checks passed
@justinchuby
justinchuby deleted the squad/pris-remove-stray-log branch August 24, 2026 11:54
justinchuby added a commit that referenced this pull request Aug 24, 2026
## What

`.body.md` — the PR body for #2026 — is tracked on `main` right now.
This removes it and adds a `Diff guard` job that makes the root an
enumerated set rather than a pattern-matching problem.

## Why not another .gitignore pattern

It is the **fourth** file of this class, and it landed *after* the two
most recent fixes for it:

| file | arrived | removed by |
|---|---|---|
| `.commitmsg/` | — | `490b846c3` |
| `.commitmsg` | #1881 | #1999 |
| `.pris_v4.log` (1364-line cargo transcript) | #1951 | #1975 |
| **`.body.md`** | **#2026, today** | **this PR** |

Every repair added one more pattern. The block's own comments predict
the failure twice — *"the name matching none of the patterns above and
nothing stopped the next one"* and *"the file was named outside every
pattern above"* — and then it happened again, hours later, to a file
whose intended name (`.pr-body.md`) **is** already listed. Someone typed
a shorter one.

Three non-converging iterations is enough evidence. A pattern list has
to predict the next filename; an allowlist does not.

## The check

Asserts the repository root is exactly
`.github/root-file-allowlist.txt`. It lives beside `deletion-ratio`
because it guards the same blind spot from the other end: that job
catches a change too large for anyone to read, this one catches a single
added line invisible in a diff of hundreds. Both are cases where *the
shape of the change*, not its content, is the signal.

Adding a legitimate root file = add a line to the list in the same PR.
That is deliberately not a label: a label is ephemeral, a line in a
tracked file is a permanent record of the decision, which is the
property the existing `.gitignore` comments were reaching for.

## Validation

Six arms, driving the script **extracted from the workflow YAML** rather
than a copy — a seam that reimplements the check passes whether or not
CI runs the same thing (per #1897):

| arm | expect | result |
|---|---|---|
| clean root | accept | `rc=0`, "Root is exactly the 16 allowlisted
file(s)" |
| stray root file (`.body.md`) | reject | `rc=1`, names the file |
| **nested** `crates/…/.body.md` | accept | `rc=0` — not over-broad |
| stale allowlist entry | reject | `rc=1` — the list cannot rot into a
rubber stamp |
| allowlist file **missing** | reject | `rc=1` — fails closed, no
vacuous pass |
| new root file, allowlisted in-PR | accept | `rc=0` — escape hatch
works |

Two of those are the ones I would have skipped if I were not being
careful. **Missing-allowlist** matters because the natural
implementation returns success when it cannot find its own input — the
guard would go permanently green the moment someone moved the file.
**Stale-entry** matters because an entry that outlives its file silently
pre-approves that exact filename, so a rotting list is worse than none.

`.gitignore` also gets `/.body.md`, verified both directions (root
ignored, nested not, shadows zero tracked files). That line is
explicitly the *trailing* half of the repair — it is the layer that has
failed four times, kept because it stops the local `git add -A`, not
because it is the fix.

## Not claimed

This does not stop a stray file in a **subdirectory**; the root is where
the evidence is (4/4), and a repo-wide version would need a scratch-file
heuristic, which is the guessing game this PR is trying to end.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
justinchuby added a commit that referenced this pull request Aug 25, 2026
…2052)

Follow-up to #2036, merged earlier today. **The guard it shipped cannot
see a stray *directory* at the root — and two of the seven historical
instances are directories, one of them cited in #2036's own header.**

## The gap

#2036 compares tracked files whose path contains no separator:

```bash
git ls-files | grep -v '/'
```

A stray directory has no such path. `.commitmsg/m.txt` contains a
separator, so it is discarded as "not at the root" — and the thing that
*is* at the root, `.commitmsg`, never appears in `ls-files` output at
all. The guard doesn't fail to complain; it affirmatively reports a
clean root.

Not hypothetical: `.commitmsg/` reached `main` as `faedea4d1`, removed
three minutes later by `490b846c3` *"Remove accidentally tracked PR
artifacts"*. #2036's header lists it, with the trailing slash. **I
enumerated the instance and then validated against six arms that all
used a file.** Naming an instance is not testing its shape.

## The fix

Compare **first path segments** — a root file contributes itself, a
nested file contributes its top-level directory:

```bash
git -c core.quotePath=false ls-files | sed 's#/.*##' | LC_ALL=C sort -u
```

The allowlist gains the 20 tracked root directories (36 entries), and
unlisted entries are labelled `(directory)` or `(symlink)` where they
are one, because the remedy differs.

## The inventory, corrected by review

I claimed six instances "found by walking every root path ever added,
not by collecting what people reported". **The walk had the same blind
spot as the guard** — it filtered to paths without a separator, so it
could not see a stray directory either. Redone on first segments:

| entry | added → removed | on `main` |
|---|---|---|
| `.msg.txt` | `39675330b` → `bbc193117` | 1.6h |
| **`.commitmsg/`** | `faedea4d1` → `490b846c3` | 3m |
| **`.goldens/`** | `faedea4d1` → `490b846c3` | 3m |
| `.wa64.log` | `83a51bfa6` → `c07acaa78` | 17.2h |
| `.commitmsg` | `e42fa9470` (#1881) → `398cff8e5` (#1999) | 19.8h |
| `.pris_v4.log` | `589d48ffd` (#1951) → `7a6482c83` (#1975) | 1.3h |
| `.body.md` | `79196f89d` (#2026) → `54625db9d` (#2036) | 2.7h |

**Seven entries, six incidents** — `.commitmsg/` and `.goldens/` arrived
and left together. `.goldens/` is the most on-point instance available
(a directory removed as a "PR artifact") and my method could not see it.

Excluded, with reasons recorded in the file rather than silently: `site`
(moved to onnx-genai-wiki, #1488), `third_party` (oneDNN removal), and
`abresults` — 131h on `main`, the longest of any, but added by a
`docs(benchmarks): record the … result` commit that says it is recording
a result. Intentional-when-added is the line; `.wa64.log` rode in on a
`test(cpu):` commit that never mentions it.

`.wa64.log` still matters beyond the count: it predates `.pris_v4.log`
by two days, so `/*.log` in #1975 was reactive to the *second* log
incident.

No authorship attributed — squash-merge rewrites `%an` to the merging
account, so it reads identically for all seven and says nothing about
who staged the file.

## Validation — 15/15

Driving the script **extracted from the workflow YAML**, never a copy.

| arm | rc |
|---|---|
| clean root | 0 — `Root is exactly the 36 allowlisted entr(ies).` |
| **stray root directory → new guard** | **1**, labelled `(directory)` |
| **same stray → #2036 guard + #2036 allowlist** | **0** — `Root is
exactly the 16 allowlisted file(s).` |
| `.goldens/`, the second directory instance | 1 |
| duplicate allowlist entry → not reported stale | 0, warning names it |
| root symlink | 1, labelled `(symlink)` |
| stray root file / stale entry / comments-only / missing list | 1 / 1 /
1 / 1 |
| nested file under an allowlisted dir | 0 |
| non-ASCII root file, allowlisted | 0 |
| new root directory allowlisted in-PR / not | 0 / 1 |
| CRLF allowlist | 0 |

Row 3 is the control and must pair **both** of #2036's halves. My first
attempt paired the old guard with the *new* allowlist: it returned 1 and
looked like coverage, but the 1 came from 20 directory entries reading
as stale.

## Two instrument bugs in my own battery

1. **Wrong control**, above — a control that changes two things measures
neither.
2. **The staging check had the defect the guard was fixed for.** Each
arm asserts its input reached the index before believing the output, but
that check used bare `git diff --cached --name-only`, which renders
non-ASCII as `"caf\303\251.txt"` while the guard uses
`core.quotePath=false`. It reported the non-ASCII arm VACUOUS against a
setup that had worked. Opus caught exactly this in #2036's guard; it
reappeared in the thing measuring the guard.

## Also fixed, from review

- An entry listed twice left one copy unpaired in `comm` and was
reported as "not present at the root" for a name that is. Deduped both
sides; duplicates now raise a `::warning::` naming them.
- `[ -d ]` follows symlinks, so a root symlink to a directory was
labelled a directory and advised `git rm -r --cached`. `-L` tested
first.
- Recorded the cost of first-segment comparison: the guard sees **root
children only**. Scratch under an already-blessed directory is invisible
to it.

## Scope

CI-config only — `.github/workflows/diff-guard.yml` and
`.github/root-file-allowlist.txt`. No Rust, no runtime behaviour, no
test changes. Adding a root entry, file or directory, means adding it to
the allowlist in the same PR; the error message says so.

---------

Co-authored-by: holden <holden@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant