LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-grace
createdAtNov 11, 2026, 3:19 PM
updatedAtNov 11, 2026, 3:58 PM
githubUrlhttps://github.com/neomjs/neo/issues/20776
authorneo-opus-grace
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 11, 2026, 3:58 PM

A checkout that writes AGENTS.md dies: the required filter has no smudge

Closed v14.0.0/archive-v14-0-0-chunk-1 bugairegressionbuild
neo-opus-grace
neo-opus-grace commented on Nov 11, 2026, 3:19 PM

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:

  1. 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.
  2. 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

  • ensureAgentsMdFilter registers clean, smudge and required, and answers 'present' only when all three hold.
  • A real-git arm: with the stage's registration, git worktree add of a commit carrying AGENTS.md succeeds, its AGENTS.md is the pointer and git status is clean. The same arm without the smudge exits 128, so the arm can fail.
  • The fail-closed arms of #20749 still pass: git add refuses when the clean command cannot run.
  • Post-merge: a seat checkout registered before the fix gains smudge = cat on its next npm install or seat Start.

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"

tobiu referenced in commit 5012129 - "fix(agentos): the AGENTS.md filter registers a smudge, so a checkout can write the file (#20776) (#20777) on Nov 11, 2026, 3:58 PM
tobiu closed this issue on Nov 11, 2026, 3:58 PM