feat(code-comments): add header_cap and yaml_comments_below_content dials #1143
No reviewers
Labels
No labels
burndown-2026-06
burndown-2026-08
autonomy
async-consult
autonomy
epic
autonomy
headless
autonomy
live-collab
coherence-core
priority
P0
priority
P1
priority
P2
priority
P3
priority
P4
qa-fixture
role/advocate
role/director
role/exec
role/frontend
role/gamedev
role/human
role/platform
role/qa
role/science
role/sysadmin
state
ambient
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
coilyco-flight-deck/agentic-os!1143
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/code-comments-header-cap"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two per-repo dials under
[tool.agentic-os.code-comments], both defaulting off, so no repo in the fleet changes behaviour until it opts in. The existing 27 tests all still pass unmodified.header_capApplies the existing two-line cap to the top-of-file header, for YAML and KDL only. The exemption let a header grow without bound, which is exactly where explanation accumulates once every other position is capped. Prose languages keep the exemption, since a license or teaching header is the case it was written for.
Counted across blank lines, so a blank inside the header cannot reset the streak and uncap the block. Reports once per file rather than once per surplus line.
yaml_comments_below_contentDrops the YAML-only top-block restriction, giving YAML the same capped comments every other language gets.
That restriction exists solely because
yaml-strictsorts keys and would drift a comment off its target. A repo not running that hook has no sorter, so the rule only pushes per-key rationale into one unbounded block at the top. In coilyco-bridge/deploy that is 2062 surplus header lines, and 14 of its files name this rule in their own text as the reason the prose sits where it does, in wording like "kept in this top block so a key-sorter cannot drift a comment off its target".Setting this while
yaml-strictis configured fails closed with an explanation rather than being silently obeyed, since that pair would sort the keys and then strip the comments. Detection reads the hook id textually from.pre-commit-config.yaml, because this hook ships with no dependencies.Verification against a real consumer
Ran the new scan over coilyco-bridge/deploy, which has already swept its
.mcp.kdlheaders:header_capon: 0 violations. The completed sweep already satisfies the new rule exactly, so the two halves line up.header_capon: 89 files, which is precisely the set deploy's own YAML sweep plan covers.15 new tests.
pre-commit run --all-filesgreen.pytestgreen apart fromtest_ward_specs_bundle.py, which fails identically on a clean tree here because thewardbinary is absent from this shadow.Notes
No
docs/FEATURES.mdentry: this tightens and relaxes an existing validator rather than adding a capability.docs/catalog-caps-reference.mdis regenerated throughjust gen-caps-reference, not hand-edited.Consumers still need a tag and a pin bump before any of this reaches them; deploy is still pinned at
v0.102.0, off theaos-precommit-v*train entirely.