Actually fix the two collapsed runbook snippets from #129, and guard the class - #136
Actually fix the two collapsed runbook snippets from #129, and guard the class#136jonfroehlich wants to merge 2 commits into
Conversation
…126) Review finding 14 on #129 was reported fixed and was not: the patch script that "fixed" it was written as a quoted bash heredoc, which strips one level of backslash, so the replacement text's trailing "\" + newline became a Python line continuation and the newline was removed. The result was the same collapsed line it was meant to repair -- with the --op-threshold correction applied around it, which is why the diff looked plausible. Both snippets now carry real continuations, written via chr(92) so no layer can eat them. The guard is the point: a collapsed continuation still runs, still looks fine at a glance, and its only symptom is that someone copying the wrapped form gets a broken command -- so nothing catches it. The new test walks every shell block in the runbook docs and rejects run-on spaces mid-command, excluding the two forms that legitimately use them (aligned trailing comments, and lines that still have their backslash). It found nothing else, so these two were the only ones. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Deep reviewRe-ran from the branch head (
Everything below is about how far the guard reaches, not about what it does on the lines it reaches. 1. Medium-low — the guard walks four docs; the repo has eighteen with shell blocksThe test names Running the same logic over every Fix: walk every tracked 2. Low —
|
Review findings F1-F3. F1: the guard walked four runbooks; it now walks every tracked .md via git ls-files, and blanks quoted spans before matching so padding inside a string (data/inventories/README.md:45) is not a hit and a `#` inside quotes cannot hide the rest of the line. F2: fences are detected after lstrip, so a block nested in a list item is scanned. F3: the scan is a module-level helper returning (line_no, line), pinned by three inline fixtures, and the docstring derives the three-space threshold from the four-space continuation indent. The sweep is zero on this branch and on the merge with main; run against main alone it reports exactly the two lines this PR fixes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Review fixesAll three in
Not applied: the placement question under "Decisions for Jon" — the test stays in Sweep results, with the broadened walk:
Full suite: 1240 passed, 1 skipped (one more than before, the new scanner test). 🤖 Generated with Claude Code (claude-opus-5) |
Review finding 14 on #129 was reported fixed and was not. Correcting the record along with the code.
What happened. The patch script that fixed it was a quoted bash heredoc, which strips one level of backslash — so the replacement text's trailing
\+ newline became a Python line continuation and the newline was removed. The output was the same collapsed line it was meant to repair. The--op-thresholdcorrection in the same replacement did apply, so the diff looked right.Both snippets now carry real continuations (written via
chr(92), so no layer can eat them):The guard matters more than the two lines. A collapsed continuation still executes, still reads as fine, and its only symptom is that a reader copying the wrapped form gets a broken command — so nothing catches it, including a careful review.
test_no_runbook_snippet_has_a_collapsed_line_continuationwalks every shell block in the runbook docs and rejects run-on spaces mid-command, excluding the two forms that legitimately use them: aligned trailing comments, and lines that still carry their backslash. It found nothing beyond these two.Suite 1,238 → 1,239.
🤖 Generated with Claude Code (claude-opus-5[1m], effort: high)