fix(code-comments): a glob inside a Go raw string opened a phantom block comment #1335
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!1335
Loading…
Reference in a new issue
No description provided.
Delete branch "ops/raw-string-block-comments"
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?
One glob, 313 false violations
block_state_afterskips double-quoted strings before looking for/*, and never knew about backtick raw strings. Those run across lines and hold arbitrary text, so a/*inside one opened a block comment that stayed open until an unrelated*/, and every line after it was scanned as a comment.umbra's
examples/treebuilders/treebuilders.goreported 313 violations against 12 actual comment lines. The opener was a help string documenting where audit rows land:The
/*in that glob is the whole bug.The fix
The scanner tracks raw-string state alongside block state, for the languages whose backtick strings span lines (
.go,.js,.jsx,.mjs,.ts,.tsx). Raw state is checked first, so://or/*inside a raw string opens nothing,/* ... */after a closed raw string still counts.All three are tests, including the 313-violation shape itself. The existing 50 comment tests are unchanged and still pass.
Why it mattered here
umbra goes from 331 code-comment violations to 18 with no edit to that repo. Before this, its count read as unmigratable comment debt and was the main reason inbox#457 called it "the largest of the five". Almost all of it was one parsing defect.
753 tests pass and
pre-commit run --all-filesexits 0.