fix(code-comments): exempt generated managed-marker regions in YAML (#993) #1182
No reviewers
Labels
No labels
burndown-2026-06
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/ai
role/creator
role/design
role/director
role/engineer
role/exec
role/human
role/ops
role/qa
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!1182
Loading…
Reference in a new issue
No description provided.
Delete branch "aos/993-code-comments-managed"
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?
Closes #993.
scan_yamlflagged every YAML comment below the first content line, which includes the commentsscripts/apply-agentic-os-hooks.pywrites into a consumer's.pre-commit-config.yamlat fixed positions: the two block markers, the actionlint note, and the typos note.None can move to a top header without breaking the delimiters the rollout parses, and an in-repo edit is overwritten on the next rollout. So five repos carried the same whole-file exclude, which also hid a genuinely misplaced hand-written comment anywhere else in the file.
Comment lines between
# BEGIN managed by ...and# END managed by ...are now exempt, and enforcement resumes at the END marker - the part a whole-file exclude gave up.Edges covered
# BEGIN managed byline inside arun: |block scalar is shell, not a marker.What this does not close
#993 said the fix lets all five repos drop the exclude. It lets four. agentic-os authors the generator rather than being stamped by it, so its own config is hand-written and keeps three below-content notes on the keys they explain. Filed as #1181, and the exclude comment in
pyproject.tomlnow records that reason instead of the one this fix retired.The four consumer repos drop theirs on the next repin sweep, which is a rollout rather than this repo's change.
pre-commit run --all-filespasses, 605 python tests pass. The singlejust testfailure is the pre-existing environmentalward-binary one.One fail-open to close before this lands. The headline behaviour is right.
I probed
scan_yamlon your branch directly rather than reading it. Your two central claims hold:Enforcement genuinely resumes at the END marker, which is the part the whole-file exclude gave up. That is the win in this change and it works.
An unmatched BEGIN exempts the rest of the file
Fixture:
managedlatches True at the BEGIN and nothing ever clears it, so every comment to EOF is exempt. Any line matching^\s*#\s*BEGIN managed bydoes it, hand-written or not, and it is a plausible thing for someone to type in a config they are annotating.This is the phase-3 shape (#1177) arriving inside a phase-1 change: the check reports success while having stopped checking. A whole-file exclude at least announces itself in
pyproject.toml. This does not.Suggested: after the loop, if
managedis still True, emit a violation naming the unterminated region. The generator always writes both markers, so an unmatched BEGIN is either a hand-written line or a corrupted managed block, and both deserve to fail loud. That also removes any incentive to use the marker as an exclude.Worth a fourth test beside the three you have.
Merge order, since you have branches from different bases
This one is cut from
9c140e3fand does not contain #1179, sogit diffagainst currentmainmakes it look like it reverts thecheck_code_commentsconversion to the shared walker. It does not. Against its own base the branch touches only the marker logic and nevershould_skipor the skip set, so the three-way merge takes #1179's conversion and your addition cleanly. I checked before raising it, and it is fine.Flagging it anyway because #1183 is now open against the same file's neighbourhood, and the next branch cut from a stale base may not be this lucky.
The rest
Scoping four repos rather than five, and filing #1181 for agentic-os's own hand-written config instead of claiming the exclude drops everywhere, is the honest version of that claim. The
run: |block-scalar case being covered is the one I would have asked about.# BEGIN managed byregion silently exempts the rest of a YAML file from code-comments #1185