code-comments: make YAML scan block-scalar-aware (stop over-reading bash comments in run: | blocks) #181
Labels
No labels
burndown-2026-06
coherence-core
consult
headless
interactive
P0
P1
P2
P3
P4
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#181
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Problem
check_code_comments.pyis line-based: it flags any line whose first non-whitespace token is a comment prefix. For YAML that prefix is#. But a#line inside a block scalar (run: |,script: |, any|/>literal/folded block) is string content, not a YAML comment. The checker over-reads those lines as YAML comments.This was tolerable under the old "two contiguous lines anywhere" rule but surfaces now that YAML is restricted to one top-of-file comment (#160): every
# ...bash line inside a composite action'srun: |step trips the rule.Current workaround
pyproject.toml[tool.agentic-os.code-comments].excludesgrandfathersactions/**and.coily/coily.yaml. That is a blunt exclude. It also silences genuine net-new YAML comments in those files, which is the opposite of what the rule wants.Fix
Make the YAML scan block-scalar-aware: when a key's value is a block scalar (
|,|-,|+,>,>-,>+, with optional indentation indicator), skip every line indented deeper than the key until the block ends.#lines inside that span are content, not comments, and must not be flagged. Only then canactions/**come back off the exclude list.A real YAML parse (ruamel/pyyaml round-trip with comment tokens) would be more correct but heavier; a line-based block-scalar tracker is enough for this checker's scope and keeps it dependency-free.
Acceptance
# ...lines inside arun: |/ any block scalar are not flagged.actions/**removed from the code-comments exclude list, hook still green on--all-files.