Context
#20749 (merged as 4c246e19bc, resolving #20748) keeps AGENTS.md in git as a 328-byte pointer and generates the rules into the working copy. .gitattributes:2 routes /AGENTS.md through filter=neo-agents-md. The stage in buildScripts/util/prepare.mjs registers that filter with a clean command and required = true. It runs on npm install and npm ci (the prepare script), and on every Fleet seat Start, since buildScripts/helpers/seatStart.mjs runs the same stage.
required was review round 1's ask (review 5854038052, RA-2). It makes git refuse to store the raw rules when the clean command cannot run, and that part works. But required holds in both directions, and no smudge command is registered.
The Problem
Measured on Nov 11 in a checkout where the stage had registered the filter:
git worktree add --detach <path> 4c246e19bc exits with fatal: AGENTS.md: smudge filter neo-agents-md failed, and the new worktree has no AGENTS.md. With -c filter.neo-agents-md.smudge=cat, the same command succeeds: AGENTS.md is the 328 B pointer and git status is clean.
git pull --ff-only origin dev from 5f407d6956 (before the merge) to 4c246e19bc died the same way and left a half-applied tree. The ref did not move and the index stayed old, but four workflow files and .gitattributes were already written with the new content and AGENTS.md was deleted.
So in every checkout where npm install, npm ci or a seat Start ran on a tree carrying #20749, a git operation that writes AGENTS.md into the working tree dies. That covers a review worktree, a switch between branches based before and after the merge, a pull or rebase across it, git stash pop, and git checkout -- AGENTS.md. Review worktrees make this a daily path for every Engine seat.
A checkout that never ran the stage has no filter registered and is unaffected, and so is a fresh clone. No step under .github/workflows runs git worktree add, checkout, switch, stash or reset --hard. publish.mjs only runs git switch -c on the current tree, which writes no file.
The real-git arms of #20749 cover staging and the refresh (healthy, no filter, config.lock, a clean command that cannot run). None checks out a commit that writes AGENTS.md with the filter registered.
The Architectural Reality
buildScripts/util/prepare.mjs:115 ensureAgentsMdFilter: wanted holds filter.neo-agents-md.clean and filter.neo-agents-md.required. It registers what is missing and throws when a key cannot be set.
buildScripts/util/agentsMdPointer.mjs:32,44: AGENTS_MD_FILTER and AGENTS_MD_CLEAN_COMMAND.
- Measured git behaviour: a driver registered as
required with no smudge fails every write of the file into the working tree.
The Fix
- Register
filter.neo-agents-md.smudge = cat beside clean and required in ensureAgentsMdFilter, with the command as AGENTS_MD_SMUDGE_COMMAND in agentsMdPointer.mjs. A checkout writes the pointer byte for byte, and the stage (the next npm install or seat Start) regenerates the rules as it does today.
missing() compares every wanted key, so a checkout already registered with clean and required gains the smudge on its next stage run, with no migration step.
- The JSDoc of
ensureAgentsMdFilter says why the smudge exists.
test/playwright/unit/buildScripts/prepare.spec.mjs: the registration arms expect three keys. A real-git arm registers the filter the way the stage does and runs git worktree add of a commit carrying the pointer. That exits 128 without the smudge and, with it, leaves the pointer and a clean status.
Acceptance Criteria
Out of Scope
- Generating the rules inside the smudge. Checkout stays a byte copy, and generation stays in the stage.
- Brain #1594, devindex #135 and Brain #1593, the other halves of neo-agent-skills#335.
Avoided Traps
- Dropping
required. That reopens what RA-2 of review 5854038052 closed: a failing clean command would let git add store the raw rules.
- A node smudge. Every checkout would then depend on node, and on an engine tree that is itself mid-checkout.
cat runs wherever git runs filters through sh, and Git for Windows bundles it.
Recovery until this merges
In an affected checkout, run git config filter.neo-agents-md.smudge cat and repeat the command that died. After a half-applied pull, run git stash push -u first: the stashed files equal the target. Then pull again.
Related
#20748, #20749, neo-agent-skills#335; Brain #1594, devindex #135, Brain #1593.
Decision Record impact: none.
Live latest-open + closed sweep: latest 20 open (30 open, orange; the owning #20748 was closed by its merged PR, so the fix is a new ticket) + closed search ("AGENTS.md filter smudge checkout") at 2026-11-11T14:17Z; no equivalent or prior exclusion. A2A in-flight claim sweep (all read states, last 30 at 14:19Z): no claim on this scope beyond my own defect-note. MC sweep ("git checkout dies smudge filter failed AGENTS.md required filter worktree add"): #20749's review cycle covered fail-closed staging, not checkout. Own-assignment sweep: no open neo issue assigned to me.
Origin Session ID: c18ee0e6-21e0-45c2-8458-595620c7908d
Retrieval Hint: "AGENTS.md pointer filter required smudge checkout worktree dies prepare ensureAgentsMdFilter"
Context
#20749 (merged as
4c246e19bc, resolving #20748) keepsAGENTS.mdin git as a 328-byte pointer and generates the rules into the working copy..gitattributes:2routes/AGENTS.mdthroughfilter=neo-agents-md. The stage inbuildScripts/util/prepare.mjsregisters that filter with a clean command andrequired = true. It runs onnpm installandnpm ci(thepreparescript), and on every Fleet seat Start, sincebuildScripts/helpers/seatStart.mjsruns the same stage.requiredwas review round 1's ask (review 5854038052, RA-2). It makes git refuse to store the raw rules when the clean command cannot run, and that part works. Butrequiredholds in both directions, and no smudge command is registered.The Problem
Measured on Nov 11 in a checkout where the stage had registered the filter:
git worktree add --detach <path> 4c246e19bcexits withfatal: AGENTS.md: smudge filter neo-agents-md failed, and the new worktree has noAGENTS.md. With-c filter.neo-agents-md.smudge=cat, the same command succeeds:AGENTS.mdis the 328 B pointer andgit statusis clean.git pull --ff-only origin devfrom5f407d6956(before the merge) to4c246e19bcdied the same way and left a half-applied tree. The ref did not move and the index stayed old, but four workflow files and.gitattributeswere already written with the new content andAGENTS.mdwas deleted.So in every checkout where
npm install,npm cior a seat Start ran on a tree carrying #20749, a git operation that writesAGENTS.mdinto the working tree dies. That covers a review worktree, a switch between branches based before and after the merge, a pull or rebase across it,git stash pop, andgit checkout -- AGENTS.md. Review worktrees make this a daily path for every Engine seat.A checkout that never ran the stage has no filter registered and is unaffected, and so is a fresh clone. No step under
.github/workflowsrunsgit worktree add,checkout,switch,stashorreset --hard.publish.mjsonly runsgit switch -con the current tree, which writes no file.The real-git arms of #20749 cover staging and the refresh (healthy, no filter,
config.lock, a clean command that cannot run). None checks out a commit that writesAGENTS.mdwith the filter registered.The Architectural Reality
buildScripts/util/prepare.mjs:115ensureAgentsMdFilter:wantedholdsfilter.neo-agents-md.cleanandfilter.neo-agents-md.required. It registers what is missing and throws when a key cannot be set.buildScripts/util/agentsMdPointer.mjs:32,44:AGENTS_MD_FILTERandAGENTS_MD_CLEAN_COMMAND.requiredwith nosmudgefails every write of the file into the working tree.The Fix
filter.neo-agents-md.smudge = catbesidecleanandrequiredinensureAgentsMdFilter, with the command asAGENTS_MD_SMUDGE_COMMANDinagentsMdPointer.mjs. A checkout writes the pointer byte for byte, and the stage (the nextnpm installor seat Start) regenerates the rules as it does today.missing()compares every wanted key, so a checkout already registered with clean and required gains the smudge on its next stage run, with no migration step.ensureAgentsMdFiltersays why the smudge exists.test/playwright/unit/buildScripts/prepare.spec.mjs: the registration arms expect three keys. A real-git arm registers the filter the way the stage does and runsgit worktree addof a commit carrying the pointer. That exits 128 without the smudge and, with it, leaves the pointer and a clean status.Acceptance Criteria
ensureAgentsMdFilterregistersclean,smudgeandrequired, and answers'present'only when all three hold.git worktree addof a commit carryingAGENTS.mdsucceeds, itsAGENTS.mdis the pointer andgit statusis clean. The same arm without the smudge exits 128, so the arm can fail.git addrefuses when the clean command cannot run.smudge = caton its nextnpm installor seat Start.Out of Scope
Avoided Traps
required. That reopens what RA-2 ofreview 5854038052closed: a failing clean command would letgit addstore the raw rules.catruns wherever git runs filters throughsh, and Git for Windows bundles it.Recovery until this merges
In an affected checkout, run
git config filter.neo-agents-md.smudge catand repeat the command that died. After a half-applied pull, rungit stash push -ufirst: the stashed files equal the target. Then pull again.Related
#20748, #20749, neo-agent-skills#335; Brain #1594, devindex #135, Brain #1593.
Decision Record impact: none.
Live latest-open + closed sweep: latest 20 open (30 open, orange; the owning #20748 was closed by its merged PR, so the fix is a new ticket) + closed search ("AGENTS.md filter smudge checkout") at 2026-11-11T14:17Z; no equivalent or prior exclusion. A2A in-flight claim sweep (all read states, last 30 at 14:19Z): no claim on this scope beyond my own defect-note. MC sweep ("git checkout dies smudge filter failed AGENTS.md required filter worktree add"): #20749's review cycle covered fail-closed staging, not checkout. Own-assignment sweep: no open neo issue assigned to me.
Origin Session ID: c18ee0e6-21e0-45c2-8458-595620c7908d
Retrieval Hint: "AGENTS.md pointer filter required smudge checkout worktree dies prepare ensureAgentsMdFilter"