Repository navigation
AGENTS.md size budget (agents-md.maxBytes) - #66
Merged
Merged
Conversation
Adds core and CLI tests for the agents-md.maxBytes budget feature. All tests fail as expected — the feature is not yet implemented.
Adds Plan.agentsMd field with bytes, maxBytes, explicit flag, and per-rule sizes. The emitter reports each always-on rule's byte size through a new callback.
…plicit AGENTS.md budget Adds budgetRefusalBlock helper and uses it in status, sync --check, and diff. Updates command descriptions to mention the budget.
Reports ok when within budget or budget is off, warn when over default budget, and error when over explicit budget.
Adds documentation for the AGENTS.md size budget feature in the Targets section.
Fixes regression where 'workspace in sync' was printed even when refusals were present.
Split agentsMdRefusal into message and fix parts shared with doctor. Exact messages for ok (within/off), warn (default exceeded), error (explicit).
Remove misleading comment about leading zeros and dead n < 0 check. Compute agentsMdOverBudget once in diff command.
- agents-md paragraph: where to set it, byte counting, 5 rules max - sync --check: also exits 1 for explicit budget - status: also exits 1 for explicit budget - diff --exit-code: also exits 1 for explicit budget - doctor: agents-md-size check with levels - Upgrading 'to the next release' entry
Two distinct warning formats for default vs explicit budget. The plan check is ok when agents-md-size reports the budget.
A scoped rule no target writes is embedded whole and counts toward the size; it is now listed as "(scoped, N bytes)" and the fix text names both ways to shrink the file.
…on --exit-code Same shape as the unset-params refusal: diff <path> --exit-code no longer hides the block. The budget is measured on the deduplicated plan, and the CLI tests now prove the budget alone fails.
Reserved beside kiro.banner; the key now lives with the agents-md emitter so extract.ts reads it without importing sync.ts.
The two warning forms, embedded scoped rules counted, the invalid value, diff's block in every form, doctor's one check, and the Upgrading lines for status --json and doctor --strict.
…rding One builder per message (default and set), the emitter's report is required on its context, the rule list sorts without the locale, and a file with no rule body ends the warning at the budget.
…eholder The heading follows the placeholder /open-pr renames; status's row says the listing prints before the budget block; diff's --help names the budget.
…unset parameter No block on stderr under --json: the reason is the budget line in warnings. Pins the warning with no rule body, and the test EmitBase gains the agents-md report.
Only craftar mcp's status tool and the ui's status view carry the warning; workspaces, forge impact and next sync: describe a writing sync, which still succeeds.
…nging the row The previous wording said it did not show it; the row lists every plan warning, only an unset declared parameter makes it an error.
llima
force-pushed
the
feat/agents-md-budget
branch
from
October 18, 2026 12:32
df61993 to
82ef5a7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mainafter Import reads a Claude rule's paths: as its scope #65 (0.31.0) merged. Merging publishescraftar@0.32.0to npm after approval in thenpmenvironment.AGENTS.md: the paramagents-md.maxBytes(a recipe default, the profile'sparams, oroverrides.paramsincraftar.yaml/craftar.local.yaml), default 32768 (Codex'sproject_doc_max_bytes),0turns it off; an invalid value is a warning and the default applies.AGENTS.mdembeds because no target writes them), never their content.sync --check,status(text and--json— keys unchanged, reason inwarnings) anddiff --exit-codewith no[path]exit 1, witherror: AGENTS.md is N bytes, over the budget of M set by agents-md.maxBytesand its fix. A writingsyncstill writes.doctorgains the check idagents-md-size(ok/warnover the default /errorover a set budget), reporting the cause once.agents-md.maxBytesis reserved fromforge unifyextraction and import inference, likekiro.banner.Upgrading
AGENTS.mdis above 32768 bytes now gets a warning on every plan, anddoctor --strictexits 1 for it (the newwarn); setagents-md.maxBytes(or0) to decide it.sync --check's out-of-sync exit is now throughprocess.exitCode(a piped listing is no longer cut).Test plan
npm run typecheck— passnpm run build— passnpx vitest run --exclude test/ci.test.ts— 3006 passed, 8 skipped; oracle skipped (no fixture on the machine that ran it)test/agents-md-budget.test.ts(measure, both warning forms, layers incl. recipe default andcraftar.local.yaml, invalid value, top-5 with embedded scoped rules, reserved key) andtest/agents-md-budget-cli.test.ts(sync --check,status,status --json,diffin every form, writingsync,doctorlevels and one-cause)AGENTS.md(only the agents-md emitter writes it today)main; full suite 3047 passed, 8 skipped; confirmation review clean