os-aidd-lint tier1 gap: sentence-complexity misses hard-wrapped sentences #143

Closed
opened 2026-07-26 21:53:13 +00:00 by jared · 3 comments
Owner

Context

Found by /os-aidd-lint:mine-blindspots (f7c52e1) on 2026-07-26 — causal bucket (a): "rule exists, logic gap" — tier-1 cop bug, not new rule.

Summary

The sentence-complexity cop only measures sentences within a single physical line. When a logical sentence is hard-wrapped across multiple lines, each fragment is measured separately and stays under the 30-word threshold, even if the complete sentence exceeds it.

Root cause

Code: plugins/os-aidd-lint/lib/aidd_lint/cops/sentence_complexity.rb:41

check_sentence_lengths iterates document.lines.each_with_index and splits sentences WITHIN each physical line. Logical sentences spread across N hard-wrapped lines are never reassembled, so each fragment remains under threshold.

Observed missed instances

  • os-doc-hygiene/skills/check/SKILL.md lines 16-19 (~32 words)
  • os-backlog/skills/capture/SKILL.md lines 41-43 (~32 words)
  • os-backlog/skills/route/SKILL.md lines 26-30 (~46 words)
  • os-context/prompts/session-start/10-orchestration.md lines 13-17 (60+ words) and 23-29 (~47 words)
  • os-status/skills/fix/SKILL.md lines 53-56
  • os-adr/skills/find/SKILL.md lines 30-32 and 32-34

Fix direction

Join hard-wrapped continuation lines into logical sentences before measuring.

## Context Found by `/os-aidd-lint:mine-blindspots` (f7c52e1) on 2026-07-26 — causal bucket (a): "rule exists, logic gap" — tier-1 cop bug, not new rule. ## Summary The `sentence-complexity` cop only measures sentences within a single physical line. When a logical sentence is hard-wrapped across multiple lines, each fragment is measured separately and stays under the 30-word threshold, even if the complete sentence exceeds it. ## Root cause Code: `plugins/os-aidd-lint/lib/aidd_lint/cops/sentence_complexity.rb:41` `check_sentence_lengths` iterates `document.lines.each_with_index` and splits sentences WITHIN each physical line. Logical sentences spread across N hard-wrapped lines are never reassembled, so each fragment remains under threshold. ## Observed missed instances - os-doc-hygiene/skills/check/SKILL.md lines 16-19 (~32 words) - os-backlog/skills/capture/SKILL.md lines 41-43 (~32 words) - os-backlog/skills/route/SKILL.md lines 26-30 (~46 words) - os-context/prompts/session-start/10-orchestration.md lines 13-17 (60+ words) and 23-29 (~47 words) - os-status/skills/fix/SKILL.md lines 53-56 - os-adr/skills/find/SKILL.md lines 30-32 and 32-34 ## Fix direction Join hard-wrapped continuation lines into logical sentences before measuring.
Author
Owner

Caveat on the fix directions in this batch, 2026-07-26.

The code citations in #143-#147 were independently verified against source. The "fix direction" lines were NOT — they were written from reading the regexes, not from testing a fix. Treat them as starting points, not specifications. Specifically: the hard-wrap cop fires on the same wrapped paragraphs these gaps involve (49 hits in os-doc-hygiene/skills/check/SKILL.md alone). If the house style is genuinely one-logical-line-per-paragraph, then hard-wrap is the primary offense and several of #143-#147 are partly downstream of files violating it. That may change the sequencing — consider whether fixing hard-wrap compliance across the corpus reduces the surface of the other gaps before implementing per-cop joins.

Caveat on the fix directions in this batch, 2026-07-26. The code citations in #143-#147 were independently verified against source. The "fix direction" lines were NOT — they were written from reading the regexes, not from testing a fix. Treat them as starting points, not specifications. Specifically: the `hard-wrap` cop fires on the same wrapped paragraphs these gaps involve (49 hits in os-doc-hygiene/skills/check/SKILL.md alone). If the house style is genuinely one-logical-line-per-paragraph, then `hard-wrap` is the primary offense and several of #143-#147 are partly downstream of files violating it. That may change the sequencing — consider whether fixing hard-wrap compliance across the corpus reduces the surface of the other gaps before implementing per-cop joins.
Author
Owner

This was generated by AI during triage.

Verified: HardWrap cop (plugins/os-aidd-lint/lib/aidd_lint/cops/hard_wrap.rb) already exists, is Autocorrectable, and its join already merges wrapped continuation lines into one physical line, preserving list-marker starts via BLOCK_START. Confirmed live: running aidd-lint against os-backlog/skills/capture and route/SKILL.md shows HardWrap firing on the exact lines cited here (e.g. capture:21, route:12). Running the HardWrap autocorrect across the corpus first will eliminate the currently-observed instances (the corpus becomes compliant, so sentence-complexity sees whole sentences on one line). This doesn't fix the underlying sentence-complexity parser gap for any future file that transiently violates hard-wrap, but it does shrink/reshape this ticket's scope to defense-in-depth. Recommend sequencing the corpus HardWrap fix before implementing this cop's join logic.

> *This was generated by AI during triage.* Verified: HardWrap cop (plugins/os-aidd-lint/lib/aidd_lint/cops/hard_wrap.rb) already exists, is Autocorrectable, and its `join` already merges wrapped continuation lines into one physical line, preserving list-marker starts via BLOCK_START. Confirmed live: running aidd-lint against os-backlog/skills/capture and route/SKILL.md shows HardWrap firing on the exact lines cited here (e.g. capture:21, route:12). Running the HardWrap autocorrect across the corpus first will eliminate the currently-observed instances (the corpus becomes compliant, so sentence-complexity sees whole sentences on one line). This doesn't fix the underlying sentence-complexity parser gap for any future file that transiently violates hard-wrap, but it does shrink/reshape this ticket's scope to defense-in-depth. Recommend sequencing the corpus HardWrap fix before implementing this cop's join logic.
Author
Owner

This was generated by AI during triage.

Implemented via os-sdlc pipeline (test-writer -> red -> programmer -> green -> ac-lint -> lint -> reviewer APPROVE). Merged to main in 6f03749.

*This was generated by AI during triage.* Implemented via os-sdlc pipeline (test-writer -> red -> programmer -> green -> ac-lint -> lint -> reviewer APPROVE). Merged to main in 6f03749.
jared 2026-08-01 18:52:10 +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#143
No description provided.