aidd-lint rule: hard-wrap #104

Closed
opened 2026-07-23 11:31:13 +00:00 by jared · 3 comments
Owner

Problem

Hard-wrapped prose in AiDD files. Verbatim, plugins/os-sdlc/skills/mine-lints/SKILL.md:21-22 (current -- still present after c6a4177):

1. **Blind critique.** Dispatch a subagent to critique `TARGETS` the way Sandi Metz would --
   *before* running any linter, so it isn't anchored to what cops already catch. Rank findings.

Costs: (a) editors soft-wrap on top of the hard wrap, producing the double-wrapped mess seen in review; (b) grep -- human or AI -- cannot match a phrase broken across a line boundary (grep "the way Sandi Metz would -- before" misses this line). Markdown rendering is identical either way; the only real cost of unwrapping is coarser git diffs (accepted).

Decision this rule encodes: AiDD prose is one logical line per bullet/paragraph -- no wrap column.

Detection

  • Inputs: a markdown file.
  • Algorithm:
    1. Skip code fences, tables, frontmatter.
    2. A prose line is a continuation if it is non-empty and does not start a new block (bullet -/*, numbered item, heading, blockquote, fence).
    3. Any continuation line -> offense on the paragraph.
  • Failure message (verbatim contract): "<file>:<lines N-M>: paragraph is hard-wrapped. AiDD prose is one logical line per bullet/paragraph (autocorrectable)."
  • Autofix: join continuation lines with a single space, preserving list-marker indentation.

Correction

-1. **Blind critique.** Dispatch a subagent to critique `TARGETS` the way Sandi Metz would --
-   *before* running any linter, so it isn't anchored to what cops already catch. Rank findings.
+1. **Blind critique.** Dispatch a subagent to critique `TARGETS` the way Sandi Metz would -- *before* running any linter, so it isn't anchored to what cops already catch. Rank findings.

Pass/fail examples

  • Must fail: the two-line step above; any multi-line paragraph outside a code fence.
  • Must pass: a hard-wrapped block inside a code fence; a table; one-line bullets of any length.

Provenance

mine-lints simplification 2026-07-23; user review of editor rendering. Part of the aidd-lint system (see mapping ticket).

Implementation plan

AUDIT DEFAULTS FIRST (standing convention): mdformat --wrap=no and prettier --prose-wrap never already implement this autofix -- the cop should wrap/enforce one of them rather than reimplement joining logic. Only hand-roll if neither respects the skip-list (fences/tables/frontmatter) correctly. TDD either way.

## Problem Hard-wrapped prose in AiDD files. Verbatim, `plugins/os-sdlc/skills/mine-lints/SKILL.md:21-22` (current -- still present after c6a4177): ``` 1. **Blind critique.** Dispatch a subagent to critique `TARGETS` the way Sandi Metz would -- *before* running any linter, so it isn't anchored to what cops already catch. Rank findings. ``` Costs: (a) editors soft-wrap on top of the hard wrap, producing the double-wrapped mess seen in review; (b) grep -- human or AI -- cannot match a phrase broken across a line boundary (`grep "the way Sandi Metz would -- before"` misses this line). Markdown rendering is identical either way; the only real cost of unwrapping is coarser git diffs (accepted). Decision this rule encodes: AiDD prose is one logical line per bullet/paragraph -- no wrap column. ## Detection - **Inputs:** a markdown file. - **Algorithm:** 1. Skip code fences, tables, frontmatter. 2. A prose line is a continuation if it is non-empty and does not start a new block (bullet `-`/`*`, numbered item, heading, blockquote, fence). 3. Any continuation line -> offense on the paragraph. - **Failure message (verbatim contract):** `"<file>:<lines N-M>: paragraph is hard-wrapped. AiDD prose is one logical line per bullet/paragraph (autocorrectable)."` - **Autofix:** join continuation lines with a single space, preserving list-marker indentation. ## Correction ```diff -1. **Blind critique.** Dispatch a subagent to critique `TARGETS` the way Sandi Metz would -- - *before* running any linter, so it isn't anchored to what cops already catch. Rank findings. +1. **Blind critique.** Dispatch a subagent to critique `TARGETS` the way Sandi Metz would -- *before* running any linter, so it isn't anchored to what cops already catch. Rank findings. ``` ## Pass/fail examples - **Must fail:** the two-line step above; any multi-line paragraph outside a code fence. - **Must pass:** a hard-wrapped block inside a code fence; a table; one-line bullets of any length. ## Provenance mine-lints simplification 2026-07-23; user review of editor rendering. Part of the aidd-lint system (see mapping ticket). ## Implementation plan AUDIT DEFAULTS FIRST (standing convention): `mdformat --wrap=no` and `prettier --prose-wrap never` already implement this autofix -- the cop should wrap/enforce one of them rather than reimplement joining logic. Only hand-roll if neither respects the skip-list (fences/tables/frontmatter) correctly. TDD either way.
Author
Owner

Implemented on branch aidd-lint/tier-1 (plugins/os-aidd-lint, cop: hard_wrap.rb). 55-test suite green; report-only corpus scan run. Awaiting human review — open items noted on #109.

Implemented on branch aidd-lint/tier-1 (plugins/os-aidd-lint, cop: hard_wrap.rb). 55-test suite green; report-only corpus scan run. Awaiting human review — open items noted on #109.
Author
Owner

Implemented on branch aidd-lint/tier-1 (plugins/os-aidd-lint, cop: hard_wrap.rb). 55-test suite green; report-only corpus scan run. Awaiting human review — open items noted on #109.

Implemented on branch aidd-lint/tier-1 (plugins/os-aidd-lint, cop: hard_wrap.rb). 55-test suite green; report-only corpus scan run. Awaiting human review — open items noted on #109.
Author
Owner

This was generated by AI during triage.

Implemented on main: lib/aidd_lint/cops/hard_wrap.rb, registered in registry.rb (HardWrap), tests at tests/cops/hard_wrap_test.rb (8 runs, 14 assertions, 0 failures). Closing.

> *This was generated by AI during triage.* Implemented on main: `lib/aidd_lint/cops/hard_wrap.rb`, registered in `registry.rb` (HardWrap), tests at `tests/cops/hard_wrap_test.rb` (8 runs, 14 assertions, 0 failures). Closing.
jared closed this issue 2026-08-01 16:43:48 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#104
No description provided.