Skip to content

harness: rules and the reader load only the files they need - #43

Merged
lneto merged 2 commits into
masterfrom
rule-paths
Nov 27, 2026
Merged

lneto merged 2 commits into
masterfrom
rule-paths

Conversation

@lneto

@lneto lneto commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Reading a skill or AGENTS.md loads the rule on the checks, 52 KB, and reading any Markdown file loads the rule on comments, though neither rule governs those files.

The rule on the checks now loads for the tools, the hooks and settings under .claude/, the CI, .agents/harness.conf, .agents/rules/, and the reader's definition and its cases under .agents/agents/, and the rule on comments for code, the pages under doc/ and a README. The reader of a pull request body reads one file, the pr-prep skill, which now holds the two rules AGENTS.md gave a title and a body; AGENTS.md keeps a line that names the skill. Nothing a script calls changes.

Editing the pr-prep skill no longer loads the rule on the checks, whose paragraph on the reader asks for the reader's cases to run again before such a change merges, so the skill says it in its own bullet on the reader; editing the reader's definition still loads the rule.

Whoever writes a body reads the pr-prep skill for its rules, which no longer arrive with AGENTS.md. In the window #6 measured, the reader wrote 11.8M of its 13.7M tokens to the cache on what its reads of AGENTS.md and of the skill loaded.
Closes #8
#6, which it does not close.

lneto and others added 2 commits November 26, 2026 20:47
A rule with `paths:` loads when a tool reads, writes or edits a file its
globs match. checks.md matched every file under `.agents/` and every
AGENTS.md, so a read of a skill, of process.md or of AGENTS.md loaded its
52 KB, and comments.md matched every Markdown file. The reader of a body
read AGENTS.md and the pr-prep skill and wrote 46k tokens for a first
request of 4.6k, 11.8M of the 13.7M it wrote in the window
#6 measured, and 98 reviewers loaded them on their
read of process.md (D177 C).

checks.md now matches what it governs: the tools, the hooks and the
settings under `.claude/`, the CI, `.agents/rules/`, the
`.agents/harness.conf` whose keys it says each check reads, and the
reader's definition and the cases it is proved on under `.agents/agents/`.
comments.md keeps the code and the documents it speaks of, the pages under
`doc/` and a README. Read over the harness's tree and Lunatik's with both
mounts, with git's glob pathspec, the files the narrower paths drop are
the skills, AGENTS.md, CLAUDE.md, for checks.md the definitions of the
other agents, of which it says nothing, and for comments.md the rules,
the agents and the cases, none of which either rule binds; no file is
added.

The reader's paragraph of checks.md has the cases run again when
`lunatik-reader.md` or the pr-prep skill changes. The first still loads
it by its own path; a path on the second would load checks.md into the
reader's one read, which D177 C takes it out of, so the pr-prep skill
names the rule in its reader's bullet, where the skill's author reads it.

Closes #8.
#6, which it does not close.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reader of a body read harness/AGENTS.md, 41 KB, for two bullets of
*Patches and commits*, 1.8 KB, beside the pr-prep skill, which restated
both in fewer words (#6, D177 C). The two bullets move
into the skill: its opening states the first, that the title is a subject
and the body says what and why with no "Test plan" and no em dash, and the
second, the four paragraphs and what each holds, with #2202's and #2527's
first bodies, takes the place of the skill's summary of it. AGENTS.md
keeps one line that names the skill, and the subject line's bullet, which
a commit reads too.

review.js hands the reader and the writer that rewrites a body it fails
the skill alone as the rules a title and a body are held to, and names it
to the reviewer that corrects the body it is handed, which no longer finds
those rules in the AGENTS.md it loads. The header of pr-body.sh and the
source of the reader's case of #2202's first body name the skill where
they named AGENTS.md.

#6, which it does not close.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lneto lneto added complexity: small One line or one file, with a trivial or existing test workflow-reviewed reviewed end to end by a review workflow labels Nov 26, 2026
@lneto

lneto commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

Note

This comment was written by an LLM, not a human.

The reader's cases, run on this head cb771b7a68380de35b6f53c958bbf4ecd3a7db85 as .agents/rules/checks.md asks of a change to the pr-prep skill: each through review.js with neither phase and reads 1, from a session started in a Lunatik worktree whose mount is at this head.

Case Expected Read
2202-first fail fail
2202-merged pass pass
2484-merged pass pass
2484-title fail fail
2527-first fail fail
2527-merged pass fail
2686-approved pass pass

2527-merged failed its read on one sentence it could not restate, "which carries this checksum() unchanged". Read four times more, twice on this head and twice on master at ff052cd, it passed all four, each naming that sentence as a remark, so the first read is the reader's variance on that sentence and not this change's (#44). A read took 38k tokens on this head and 53k on master.

@lneto
lneto merged commit 074faf1 into master Nov 27, 2026
2 checks passed
lneto added a commit to luainkernel/luaebpf that referenced this pull request Nov 27, 2026
The `harness/` mount moves to luainkernel/harness@074faf1, which carries
luainkernel/harness#43: the checks and comments rules load only for the
files they govern, and the rules of a pull request's title and body move
from the mount's AGENTS.md into the pr-prep skill, which the body's reader
reads alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lneto added a commit to luainkernel/lunatik that referenced this pull request Nov 27, 2026
`.agents/rules/lunatik-checks.md` loaded on a read of any file under
`.agents/` or of an AGENTS.md, a skill or the mount's agent definitions
among them, none of which it speaks of. Its paths now follow what it
governs, the tools, `.claude/`, the CI, `.agents/harness.conf` and the
rules, as luainkernel/harness#43 narrows the harness's `checks.md`
(D177 C on luainkernel/harness#6). Read over the tree and both mounts
with git's glob pathspec, the change drops the skills, the AGENTS.md
files, and the mount's agent definitions and reader cases, and matches no
file it did not match before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lneto
lneto deleted the rule-paths branch November 27, 2026 00:50
lneto added a commit to luainkernel/lunatik that referenced this pull request Nov 27, 2026
The `harness/` mount moves to luainkernel/harness@074faf1, which carries
luainkernel/harness#43: the checks and comments rules load only for the
files they govern, and the rules of a pull request's title and body move
from the mount's AGENTS.md into the pr-prep skill, which the body's reader
reads alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

complexity: small One line or one file, with a trivial or existing test workflow-reviewed reviewed end to end by a review workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rules: D177 B's narrower paths must keep the reader's cases rule on a change to the reader

1 participant