Skip to content

chore: ignore the local-only working directories every agent creates - #2244

Merged
justinchuby merged 1 commit into
mainfrom
pris/ignore-local-worktrees
Aug 27, 2026
Merged

justinchuby merged 1 commit into
mainfrom
pris/ignore-local-worktrees

Conversation

@justinchuby

Copy link
Copy Markdown
Owner

One line of context each for three directories, measured rather than assumed.

What I found

Five entries sit at the repository root that are untracked and matched by no ignore rule:

.ort_upstream/   .squad/   .validation-worktrees/   .worktrees/   hogpids.txt

git add -A in a primary checkout stages 69 files from .validation-worktrees alone. hogpids.txt is the one I'd flag to a human reader: it has no leading dot, so in git status it reads as ordinary repository content rather than as scratch.

This is the untracked precursor to the class that has now arrived four times (.commitmsg/, .commitmsg, .pris_v4.log, .body.md). Those were all files someone created and forgot. These three are directories every agent creates by convention — throwaway worktrees for validating a PR against latest main, and a vendored upstream checkout — so unlike a filename, they are enumerable and don't require predicting anything.

This does not replace the allowlist job — verified, not assumed

@holden's Root file allowlist is the backstop and it works. I extracted the script structurally (yaml.safe_load → jobs['root-files'], asserting exactly one run: step, per the lesson from #2052) and drove it:

arm rc
clean tree 0 Root is exactly the 36 allowlisted entr(ies).
scratch file staged, before this change 1 .validation-worktrees/ (directory)
git add -f past the new ignore rules 1 still refused, same message
only .gitignore staged (control) 0 passes

The third row is the one that matters: an ignore rule that hid a force-added file from the guard would be worse than the problem. It doesn't — ls-files reports the root segment of a tracked path regardless of ignore state. So this is a layer in front of the backstop, not a replacement for it.

Each staging arm asserts git diff --cached --name-only before believing any rc, because an acceptance arm can otherwise be satisfied by its own setup silently failing — which is exactly how a git add refused by an ignore rule produced a misleading rc=0 in #2036.

Deliberately not included

  • hogpids.txt — another agent's run artifact. It should be deleted by its owner, not permanently ignored; writing a rule for it would be predicting filenames again, which is the approach chore: enumerate what belongs at the repository root #2036 retired.
  • .squad/ — whether the team root is meant to be committed is a policy question, not a chore. Flagging it rather than deciding it: right now it is one git add -A away from being committed, and I don't think that's intended either way by accident. @justinchuby, worth a decision.

Root-anchored (/.worktrees/, not .worktrees/) because a crate could legitimately hold a nested fixture directory of any of these names; only the repository root is scratch.

Measured in a primary checkout: `git add -A` stages 69 files from
.validation-worktrees alone. Five entries at the repository root are
untracked and matched by no ignore rule; three of them are directories
created by convention rather than by accident -- throwaway worktrees used to
validate a PR against latest main, and a vendored upstream checkout.

This is the layer that stops them reaching a commit. It is not a substitute
for the root-file allowlist job, which remains the backstop: verified that a
`git add -f` past these new rules is still refused by that job, naming
`.validation-worktrees/` as a directory, and that the job still passes with
only this change staged.

Root-anchored, because a crate could legitimately hold a nested fixture
directory of any of these names; only the repository root is scratch.

Two further root entries are deliberately left alone: `hogpids.txt` belongs
to another agent's run and should simply be deleted by its owner, and
`.squad/` is a policy question about whether the team root is meant to be
committed, which is not mine to answer in a chore commit.

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

codecov Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.21%. Comparing base (bb08c5a) to head (18a17fe).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2244      +/-   ##
==========================================
+ Coverage   80.64%   81.21%   +0.56%     
==========================================
  Files         432      432              
  Lines      220114   220126      +12     
  Branches   220114   220126      +12     
==========================================
+ Hits       177512   178766    +1254     
+ Misses      36717    35476    -1241     
+ Partials     5885     5884       -1     
Flag Coverage Δ
cli-ort-linux 72.51% <ø> (ø)
cli-ort-windows 72.10% <ø> (+0.09%) ⬆️
mlas 86.02% <ø> (+0.12%) ⬆️
offline 81.35% <ø> (+0.58%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 12 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 e22fe21 into main Aug 27, 2026
19 checks passed
@justinchuby
justinchuby deleted the pris/ignore-local-worktrees branch August 27, 2026 00:09
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