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

AGENTS.md is generated at install and every Start, not tracked

Closed v14.0.0/archive-v14-0-0-chunk-1 enhancementaibuildmodel-experienceagent-os
neo-opus-grace
neo-opus-grace commented on Nov 11, 2026, 3:46 AM

Context

neomjs/neo-agent-skills#335 decided (shape C, its first two comments) that a consumer's maintainer AGENTS.md is a projection of its installed skills package, generated rather than hand-kept. This leaf is the Engine half: #335's AC-1 to AC-5, plus the Engine's part of AC-6. The Brain's link and devindex (AC-7) land as their own leaves.

Amended 2026-11-11 (operator input): directories and studies look for a root AGENTS.md, and an agent in a fork that never installed should learn that its rules are missing. So git keeps a pointer in AGENTS.md, and the working copy holds the generated rules: the pattern Git LFS uses for its pointer files.

The Problem

The tracked AGENTS.md changes only when someone commits it. Dependabot moved the skills pin on 11-06, 11-08 and 11-10 without it, and #20739 caught it up by hand. The next section release drifts it again: the rule ships, gets pinned and installed, and no session loads it.

The Architectural Reality

Design authority: "Generated copies (AGENTS.md sections, .claude/CLAUDE.md) are never hand-edited; they regenerate from the package." (neomjs/neo-agent-skills#140, the authority #335 cites)

  • The set: package.json:45 declares "generate-agents-md": "neo-agent-skills-agents-md --repo neo,neo-agent-brain --out AGENTS.md" (since #20739).
  • buildScripts/util/prepare.mjs runs the stages husky and materialize, each a bin resolved from its package's manifest and run through node, never through a PATH shim, so the lifecycle stays portable to cmd.exe. Both run behind the lock-only guard and isDependencyBuild.
  • buildScripts/helpers/seatStart.mjs runs on every Fleet Start, including one whose lockfile digest matches: READY includes present (neomjs/neo-agent-brain ai/services/fleet/installAgentRepoDependencies.mjs:33). A non-zero exit lands on the start row as seatStart: {state: 'failed'} (:385).
  • Harness entries: .claude/CLAUDE.md is a tracked symlink to ../AGENTS.md, .agents/ANTIGRAVITY_RULES.md:3 links it, and Codex reads the root file. Claude Code reads AGENTS.md itself from v2.1.277 when no CLAUDE.md exists. No script, workflow or hook reads AGENTS.md.
  • Git filters: a clean filter named in .gitattributes decides what git stores for a path. Git trusts a changed file size without reading the file, so a filter-backed path needs git update-index --refresh after the working copy is rewritten.

The Fix

  1. prepare.mjs: a third stage, agents-md, runs the neo-agent-skills-agents-md bin with the arguments of the checkout's own generate-agents-md script, read from package.json (AC-2). Before it writes, the stage registers the neo-agents-md clean filter, and afterwards it refreshes git's stat cache. A checkout that declares no script skips the stage, and a script that is not a plain call of the bin fails it.
  2. seatStart.mjs: runs the same stage on every Start, ahead of the theme check. A failed generation exits non-zero (AC-5), and the theme check still runs.
  3. The pointer: AGENTS.md stays tracked, holding a short pointer whose single source is buildScripts/util/agentsMdPointer.mjs. .gitattributes routes the file through the neo-agents-md clean filter, which that module answers.
  4. Links (AC-6): both blog links point to agents-md in neomjs/neo-agent-skills. CONTRIBUTING.md:165 says npm install generates the root file from there.
  5. Specs: the stage order and its script arguments; a missing script skips and a non-plain one is refused; a fixture bump moves the file (AC-3); seatStart restores a deleted file (AC-4) and exits 1 on a failed generation (AC-5); a real-git round trip keeps git status clean; and the committed file equals the pointer.

Contract Ledger

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
root AGENTS.md neomjs/neo-agent-skills#335 (shape C), #140, and the operator's 11-11 input git holds the pointer; the working copy holds the rules written by prepare and every seat:start a clone that never installed shows the pointer; a failed generation keeps the previous rules and fails seat:start CONTRIBUTING.md:165, agentsMdPointer.mjs AC-1, AC-4, the round-trip spec
npm run prepare (buildScripts/util/prepare.mjs) its module JSDoc a third stage, agents-md, after materialize, behind the same two guards a failed stage fails the install, as its neighbours do module JSDoc prepare.spec.mjs
npm run seat:start (buildScripts/helpers/seatStart.mjs) neomjs/neo-agent-brain#1480 regenerates on every Start; exits 1 on a failed generation, after the theme check the Fleet row reads seatStart: failed module JSDoc seatStart.spec.mjs
.gitattributes + the neo-agents-md filter Git LFS's pointer pattern the clean filter answers AGENTS.md with the pointer; registered per clone by the stage an unregistered clone shows the generated file as changed until the next install agentsMdPointer.mjs agentsMdPointer.spec.mjs
generate-agents-md script #20739 unchanged; the single declaration both callers read none package.json the AC-2 spec

Decision Record impact

none. ADR 0007 governs what AGENTS.md says; the loaded content and size do not change.

Acceptance Criteria

  • AC-1: after npm install and after npm run seat:start, AGENTS.md equals npm run generate-agents-md's output, and git status shows no change to it.
  • AC-2: both callers take the repository set from the generate-agents-md script; no second copy of it exists.
  • AC-3: a fixture install of an older package version, then of a newer one, moves the file.
  • AC-4: a deleted AGENTS.md is back after seat:start, with nothing reinstalled.
  • AC-5: a failed generation exits seat:start non-zero with a named reason, and the theme check still runs.
  • AC-6 (Engine half): the committed AGENTS.md is the pointer; the blog links and CONTRIBUTING.md name the sections in neomjs/neo-agent-skills as the source of the rules.

Out of Scope

  • The Brain's learn/agentos/IdentityFirewall.md link and devindex (#335's AC-6 and AC-7): their own leaves.
  • The Fleet's home projection (neomjs/neo-agent-brain#644): counting AGENTS.md as Claude's project file, before .claude/CLAUDE.md can go, and reading the pointer as "not supplied". These are its own leaf.
  • The content of AGENTS.md.

Avoided Traps

  • Untracking the file. Scanners and an uninstalled fork find nothing, and CI's substrate guard reads the dangling .claude/CLAUDE.md as a seat without rules.
  • Spawning npm run generate-agents-md. That brings back the PATH shim prepare.mjs exists to avoid, and a nested npm inside the lifecycle.
  • A second copy of the repository set (a constant in prepare.mjs). Two declarations drift; the script is the one #20739 placed.
  • Generating only at install. A Start with a matching lockfile digest installs nothing.

Related

  • neomjs/neo-agent-skills#335 (source), neomjs/neo-agent-skills#140, neomjs/neo-agent-skills#342 (withdrawn guard exception)
  • #20739, neomjs/neo-agent-brain#1480, neomjs/neo-agent-brain#644

Live latest-open + closed sweep: checked the latest 20 open and a closed search ("AGENTS.md generated untracked": #5086 and #17783, neither on this surface) at 2026-11-11T02:43Z, plus open PRs searched for AGENTS.md (none); no equivalent found. Backlog band: 25 open (orange); the owning ticket is neomjs/neo-agent-skills#335, and this leaf is its Engine half. A2A in-flight claim sweep: the last 30 messages (all read states) carry no claim on AGENTS.md, prepare or seat:start. Memory Core rationale sweep: #335's design thread (6784477727, 6784580742) and its handover plan (6784985838) hold the decision; the operator's 11-11 input amends delivery, not the decision. Own-assignment sweep: nothing in neomjs/neo was assigned to me. Structure map: N/A. The Engine is not Brain-hosted; the owners are buildScripts/util/prepare.mjs and buildScripts/helpers/seatStart.mjs, and the pointer's module sits beside them in buildScripts/util/.

Ownership: self-assigned (Grace); #335's implementer, per its handoff line.

Retrieval Hint: "Engine AGENTS.md pointer clean filter generated at prepare and seat:start"

Origin Session ID: 40a9201b-5e9e-4845-ab9f-dee27312077d

tobiu referenced in commit 4c246e1 - "feat(agentos): AGENTS.md is a pointer in git, the generated rules in the checkout (#20748) (#20749) on Nov 11, 2026, 3:04 PM
tobiu closed this issue on Nov 11, 2026, 3:04 PM