Skip to content

Bring AGENTS.md under the 32 KiB instruction limit so every agent sees every catalogue rule #626

Closed

Description

@devantler

🤖 Generated by the Agentic Engineer (interactive Claude Code session)

Evidence

  • AGENTS.md is 70,748 bytes and 751 lines, measured on main at 945434b on 2026-10-17. Codex reads an instruction file only up to 32 KiB; the monorepo enforces that limit on its own AGENTS.md with .claude/scripts/agent-instructions-layout-contract.test.sh. Here the cut falls at line 403, inside #### Test jobs. A Codex session in this repository therefore never sees the feature-flag-first convention, the authentication patterns, the validation commands, or the whole Maintaining the catalogue section: the blast-radius rule, every tested invariant and the task menu.
  • The file has drifted from the repository. The ### Layout block names 8 workflows as belonging to this repository; .github/workflows/ holds 15 of them. The ### Validation Commands heading is followed by paragraphs about to-do forwarding, verified publication and recovery before the commands themselves appear.
  • Many paragraphs narrate delivery history: issue numbers, "proven live" dates, superseded behaviour. The portfolio's documentation rule is to describe present behaviour and its rationale, not the journey.
  • The root README.md is 103 KB. It is the catalogue's only consumer-facing reference.

Audience and problem

Every agent and contributor who changes the shared catalogue reads this file first. The blast radius is every consumer repository. Rules an agent cannot see, or rules it cannot find among history, are rules it will break. Among those already invisible to Codex: keep the vulnerability-scan allowlist guard, never move a write credential into a fixer lane, and prefer additive, backward-compatible changes.

Hypothesis

A core AGENTS.md under 32 KiB, holding the repository's rules, with each workflow's detailed invariants moved beside the code they govern, lets every agent see every rule. It also makes the next change cheaper to review. Candidate homes for that detail are a per-workflow section in docs/ or the workflow's README section.

Success signal

AGENTS.md is at most 32,768 bytes and a test keeps it there. No rule is lost: each invariant paragraph removed from AGENTS.md exists verbatim or as a stricter statement in the file it moved to, checked by a one-time inventory recorded in the pull request. Measured at merge.

Direction

  1. Inventory every rule-bearing paragraph and classify it: a repository rule (stays), a workflow-specific invariant (moves beside its workflow, with a one-line pointer), or history (removed, because the issue or PR is its record).
  2. Fix the drift found while classifying: the Layout list and the Validation Commands section.
  3. Add a size guard to required CI in the same style as the monorepo's layout contract test.

Acceptance criteria

  • AGENTS.md is at most 32 KiB, and required CI fails above that.
  • The rule inventory is attached to the pull request and shows each paragraph's new home.
  • ### Layout matches the files in .github/workflows/, and ### Validation Commands holds only commands.
  • Moved content keeps its tests' references valid; lint-readme-parity and the README parity check stay green.

Priority rationale: every change to the catalogue depends on this file. More than half of its rules are invisible to one of the two engineering lanes today. Effort: medium, mostly careful editing, with very little CI cost. Prerequisites: none.

Rough size: M.

Activity

  1. added theissue type on Oct 17, 2026
  2. moved this to 📥 Backlog in 🌊 Project Boardon Oct 17, 2026
  3. updated Priority High and Effort Medium on Oct 17, 2026
  4. devantler commented on Oct 17, 2026

    @devantler
    ContributorAuthor

    🤖 Generated by the Agentic Engineer

    Refined for implementation: High priority, Medium effort. At current main, the 70,748-byte root exceeds the instruction read budget and hides catalogue safety rules. The source and inbound-link inventory supports an additive, rule-preserving split into ordinary linked topic guides. Root anchors for maintenance, conventions and test jobs will remain available. Every rule-bearing paragraph will be accounted for against the exact base; history cleanup is deliberately excluded from the first mechanical move to avoid changing rules during relocation.

    The required size and guide-target guard will run in the existing always-on documentation gate, without allocating another runner. Its controls must reject oversized roots, missing guide pointers/targets and incomplete workflow layout documentation. The existing validation commands, credential guards and selector/reducer gates remain mandatory. The maintainer waived WIP limits for this round; no competing claim, matching branch or PR was found at admission.

  5. moved this from 📥 Backlog to 🫴 Ready in 🌊 Project Boardon Oct 17, 2026
  6. moved this from 🫴 Ready to 🏃🏻‍♂️ In Progress in 🌊 Project Boardon Oct 17, 2026
  7. added a commit that references this issue on Oct 17, 2026
  8. self-assigned this
    on Oct 17, 2026
  9. added a commit that references this issue on Oct 17, 2026
  10. moved this from 🏃🏻‍♂️ In Progress to 👀 In Review in 🌊 Project Boardon Oct 17, 2026
  11. moved this from 👀 In Review to ✅ Done in 🌊 Project Boardon Oct 17, 2026
  12. moved this from ✅ Done to 📊 Verifying in 🌊 Project Boardon Oct 17, 2026
  13. devantler commented on Oct 17, 2026

    @devantler
    ContributorAuthor

    🤖 Generated by the Agentic Engineer

    Delivered in #632 at squash merge a0a678be70458d8325789a7e6a8b9ea2407f5e0d. Its tree 55b77429106d56aad518017e7bd48503056245ee exactly matches the reviewed head and native CI merge candidate. The ordinary protected merge preserved the evaluated source head 4de8d877a833851f4972542857e32feb00d456ab.

    Full hosted CI passed, Codex completed its authenticated current-head review with no findings, and complete review/thread/conversation reads were clear. Post-merge verification extracted the exact merged source and again passed the real layout checker and all 20 negative controls. The root remains 23,873 bytes, with the retained anchors and four discoverable guides; all 113 original paragraphs are accounted for in the preservation inventory above.

    The release workflow then succeeded at the merge commit and published v7.12.5. The published, non-prerelease tag resolves directly to that commit. #626 acceptance is complete; both clean implementation worktrees from this round have been removed. Automatic compliance by every agent runtime is not claimed by the structural guard.

  14. moved this from 📊 Verifying to ✅ Done in 🌊 Project Boardon Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

Priority

High

Effort

Medium

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions