Skip to content

ci: add markdownlint infrastructure#159

Merged
scottschreckengaust merged 15 commits intomainfrom
worktree-add-markdownlint
Apr 9, 2026
Merged

ci: add markdownlint infrastructure#159
scottschreckengaust merged 15 commits intomainfrom
worktree-add-markdownlint

Conversation

@scottschreckengaust
Copy link
Copy Markdown
Member

@scottschreckengaust scottschreckengaust commented Mar 30, 2026

Summary

Adds markdownlint-cli2 infrastructure and fixes all violations outside aidlc-rules/. Remaining violations exist only in LLM prompt files and are temporarily disabled in config for incremental remediation.

  • .markdownlint-cli2.yaml — project rule configuration with tiered exceptions
  • .github/workflows/ci.yml — CI workflow (pull_request, push to main, workflow_dispatch)
  • .pre-commit-config.yaml — optional local pre-commit hook
  • 585 violations fixed across 25 non-prompt files (zero aidlc-rules/ changes)
  • 4 rules fully re-enabled (MD041, MD049, MD034, MD028 — zero violations remain)

Why a separate ci.yml (not pull-request-lint.yml)

pull-request-lint.yml uses pull_request_target and deliberately never checks out PR code — it only inspects metadata (title, labels, body). Running markdownlint requires checking out code, which must use pull_request to avoid running untrusted PR code in a privileged base-branch context.


Violation Report

Starting point: 3,118 violations across 57 files (603,487 chars total)

What this PR resolves

Category Violations Action
Fixed outside aidlc-rules/ 585 Auto-fix + manual (MD009, MD012, MD022, MD028, MD029, MD031, MD032, MD034, MD040, MD047, MD049, MD060)
Rules fully re-enabled 4 rules MD041 (fixed), MD049, MD034, MD028 (all at zero violations)
Permanently disabled 1,674 4 rules (MD013, MD033, MD024, MD036)
Remaining (aidlc-rules/ only) 859 14 rules temporarily disabled

Rules permanently disabled (1,674 violations)

Rule Description Violations Why permanently disabled
MD013 line-length (80 chars) 1,630 Long URLs, tables, code examples, ASCII diagrams. Reflowing would touch ~60% of files.
MD033 no-inline-html 4 <img> tags for screenshots/badges in README
MD024 no-duplicate-heading 18 Platform guides reuse section names for consistency
MD036 no-emphasis-as-heading 22 Bold text functions as sub-labels inside list items

Rules fully re-enabled (0 violations)

Rule Description How resolved
MD041 first-line-heading Fixed: CODE_OF_CONDUCT.md H2→H1
MD049 emphasis-style Fixed: all _* outside aidlc-rules/; zero violations inside
MD034 no-bare-urls Fixed: URLs wrapped outside aidlc-rules/; zero violations inside
MD028 no-blanks-blockquote Fixed: WORKING-WITH-AIDLC.md blockquote continuations; zero inside

Incremental Remediation Plan — Remaining aidlc-rules/ Violations

All 859 remaining violations are exclusively inside aidlc-rules/ (LLM prompt instructions). Each follow-up PR re-enables one rule and fixes its violations, ordered by minimal prompt impact.

Tier 1: Zero prompt impact — invisible whitespace (15 violations)

PR Rule Description Violations Chars changed LLM impact
2 MD009 no-trailing-spaces 9 -9 (spaces) None — trailing spaces stripped during tokenization
3 MD012 no-multiple-blanks 2 -2 (newlines) None — consecutive newlines collapse to single token
4 MD047 single-trailing-newline 4 +4 (newlines) None — EOF newline invisible to tokenizer

Tier 2: Zero prompt impact — formatting normalization (18 violations)

PR Rule Description Violations Chars changed LLM impact
5 MD029 ol-prefix (1/1/1) 1 0 (digit swap) None — numbering style irrelevant to parsed list
6 MD026 no-trailing-punctuation 17 -17 (colons) None — heading structure from ## markers, not :

Tier 3: Zero prompt impact — blank line structure (731 violations)

PR Rule Description Violations Chars changed LLM impact
7 MD022 blanks-around-headings 274 +274 (newlines) None — LLMs parse ## regardless of whitespace
8 MD032 blanks-around-lists 426 +426 (newlines) None — list items parsed from markers, not blank lines
9 MD031 blanks-around-fences 31 +31 (newlines) None — code fences parsed from ``` markers

Tier 4: Minimal prompt impact — table formatting (34 violations)

PR Rule Description Violations Chars changed LLM impact
10 MD060 table-column-style 34 ~50 (spaces) Negligible — pipe-delimited structure unchanged

Tier 5: Low prompt impact — structural cosmetic (42 violations)

PR Rule Description Violations Chars changed LLM impact
11 MD046 code-block-style 8 ~40 Low — normalizes to fenced style; content identical
12 MD007 ul-indent 34 ~70 (spaces) Low — adjusts nesting spaces; hierarchy preserved

Tier 6: Needs review — adds content or changes structure (31 violations)

PR Rule Description Violations Chars changed LLM impact
13 MD040 fenced-code-language 18 ~90 Review — adds language specifiers; some fences may intentionally omit
14 MD025 single-title (H1) 13 varies Review — may require restructuring heading hierarchy

Permanently disabled — not planned

Rule Violations Rationale
MD013 1,630 80-char limit impractical for tables, URLs, ASCII diagrams
MD033 4 <img> tags needed for image sizing/alignment
MD024 18 Platform guides intentionally reuse section names
MD036 22 Bold sub-labels would change document structure if converted to headings

Total summary

Metric Value
Starting violations 3,118
Fixed in this PR 585 (all outside aidlc-rules/)
Rules re-enabled 4 (MD041, MD049, MD034, MD028)
Permanently suppressed 1,674 (4 rules)
Remaining (aidlc-rules/ only) 859 (14 rules)
Planned follow-up PRs 13
Total chars to change in aidlc-rules/ ~965 of 603,487 (0.16%)
Files modified in this PR 25 (zero under aidlc-rules/)

Licenses

All dependencies are MIT licensed:

Component License Repository
markdownlint MIT DavidAnson/markdownlint
markdownlint-cli2 MIT DavidAnson/markdownlint-cli2
markdownlint-cli2-action MIT DavidAnson/markdownlint-cli2-action
pre-commit MIT pre-commit/pre-commit

Test plan

  • ci.yml workflow runs successfully on this PR (0 violations expected)
  • npx markdownlint-cli2 "**/*.md" produces 0 errors locally
  • .pre-commit-config.yaml works with pre-commit run --all-files
  • Verify zero files under aidlc-rules/ were modified
  • Review permanently disabled rules rationale
  • Review tiered remediation plan ordering
  • Confirm remaining 859 violations are all inside aidlc-rules/

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.

Add .markdownlint-cli2.yaml with all current violations temporarily
disabled and tiered for incremental re-enablement by prompt impact.
Add ci.yml workflow with markdownlint-cli2-action on pull_request,
push to main, and workflow_dispatch. Add .pre-commit-config.yaml for
optional local pre-commit linting.

No markdown content changes — violation fixes planned for follow-up PRs.
@scottschreckengaust scottschreckengaust force-pushed the worktree-add-markdownlint branch from 8380b3d to b121070 Compare March 30, 2026 22:49
scottschreckengaust and others added 7 commits March 30, 2026 15:53
Change `## Code of Conduct` to `# Code of Conduct` (H2 → H1) to
satisfy MD041/first-line-heading. Only violation was outside
aidlc-rules/ — zero LLM prompt impact. Rule re-enabled in config.
Fix 585 violations across 25 non-LLM-prompt files:
- MD028: fix 4 blank lines in blockquotes (WORKING-WITH-AIDLC.md)
- MD040: add language specifiers to 84 fenced code blocks
- MD060: normalize table pipe spacing across 13 files (322 fixes)
- Auto-fix: MD009, MD012, MD022, MD029, MD031, MD032, MD047, MD049

Re-enable 3 rules now at zero violations: MD049, MD034, MD028.
Update remaining violation counts to aidlc-rules/-only totals.

No files under aidlc-rules/ were modified — zero LLM prompt impact.
Set MD060 to "aligned" style in project config — all table columns
are now width-padded with vertically aligned pipes.

Add aidlc-rules/.markdownlint-cli2.yaml to suppress MD060 in LLM
prompt files pending separate review.

Aligned tables in 14 files outside aidlc-rules/ using automated
formatter. Zero aidlc-rules/ content files modified.
Update git-cliff body template:
- Add blank line after ### group headings (MD022/MD032)
- Add postprocessor to collapse triple+ blank lines (MD012)
- Set trim = false so leading \n creates inter-body separators

Add CHANGELOG.md to markdownlint ignores since git-cliff
postprocessors run per-body and cannot control inter-body
spacing or trailing whitespace.

Regenerate CHANGELOG.md with improved template.
Move all temporarily disabled rules from the top-level config into
aidlc-rules/.markdownlint-cli2.yaml since violations exist only in
that directory. The top-level config now contains only permanently
disabled rules and global style settings.
@github-actions github-actions bot added documentation Improvements or additions to documentation github rules labels Apr 8, 2026
Four tables had misaligned trailing pipes due to rows with longer
content or multi-byte characters (em dash). Padded shorter rows
so all pipes in each column align vertically.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

A. Executive Summary

Latest release: PR #159

High-level snapshot comparing the latest release against the golden baseline (the reference evaluation used as the quality target).

Metric What it measures
Unit tests passed Number of generated unit tests that pass. Higher means the rules produce broader, more complete test suites.
Contract tests API compliance checks against the OpenAPI spec (passed/total). 88/88 = full compliance.
Lint findings Static analysis warnings in generated code. Lower is better — 0 means clean code.
Qualitative score AI-graded quality of generated documentation on a 0–1 scale (higher is better).
Execution time Wall-clock time for the full evaluation run. Lower means faster generation.
Total tokens Total LLM tokens consumed (input + output). Lower means more cost-efficient.
Metric Golden Latest (PR #159) vs Golden Trend
Unit tests passed 180 131 -49 █▄▄▁▂▃▃▁▁
Contract tests 88/88 88/88 = ███▁█████
Lint findings 0 0 ▅▅▅▅▅▅▅▅▅
Qualitative score 0.854 0.793 -0.062 ▅▇▇▆▇█▁▁▁
Execution time 23.8m 20.8m -3.1m ▁▅▁▅▂▄▇▅█
Total tokens 18.39M 7.76M -10.64M ▃▇▃▆▆█▃▁▂

Full trend report available in the workflow artifacts.

Copy link
Copy Markdown

@MichaelWalker-git MichaelWalker-git left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Contributor

@scoropeza scoropeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — Non-blocking suggestions

Nice work on the incremental approach here — the tiered remediation plan ordered by LLM prompt impact is really well thought out, and keeping aidlc-rules/ untouched in this first PR is the right call.

Two minor things that can be addressed in a follow-up:

1. Concurrency group consistency

The new ci.yml uses {workflow}-{ref} for the concurrency group, while security-scanners.yml (from #161) recently added {event_name} to the group key to prevent push events from cancelling scheduled runs. Not an issue today since ci.yml has no schedule trigger, but worth aligning for consistency — and to avoid a subtle bug if a schedule trigger is ever added.

2. Pre-commit vs CI version mismatch

.pre-commit-config.yaml pins markdownlint-cli2 at v0.22.0, but the CI action uses v23.0.0. Different major versions could produce different results locally vs CI, which would be confusing for contributors. Aligning these would help ensure local and CI linting agree.


Tracking both as a follow-up issue. Everything else looks great — the permissions model, SHA pinning, per-directory config override, and the mechanical markdown fixes are all solid.

Merge main (including #161 security scanners) into the markdownlint
branch. Resolve conflicts in docs/ADMINISTRATIVE_GUIDE.md by keeping
#161's updated content (security scanner references, "all six
workflows" language) and applying #159's MD060 aligned table formatting.
…nner section

Add blank lines around fenced code blocks (MD031), align table pipes
(MD060), and remove double blank line (MD012) in the security scanner
documentation added by #161.
Aligns ci.yml concurrency group with the {workflow}-{event_name}-{ref}
pattern used across all other workflows.
@scottschreckengaust
Copy link
Copy Markdown
Member Author

1. Concurrency group consistency

added the event name to the concurrency group to future proof.

Aligns codebuild.yml and pull-request-lint.yml concurrency groups with
the {workflow}-{event_name}-{ref} pattern for consistency and to prevent
schedule triggers from cancelling push events if added later.
@scottschreckengaust
Copy link
Copy Markdown
Member Author

2. Pre-commit vs CI version mismatch

.pre-commit-config.yaml pins markdownlint-cli2 at v0.22.0, but the CI action uses v23.0.0. Different major versions could produce different results locally vs CI, which would be confusing for contributors. Aligning these would help ensure local and CI linting agree.

┌─────────────────────────┬──────────────────────────────────┬─────────────────────────────┐
│        Component        │             Version              │            Notes            │
├─────────────────────────┼──────────────────────────────────┼─────────────────────────────┤
│ .pre-commit-config.yaml │ markdownlint-cli2 v0.22.0        │ The CLI tool                │
├─────────────────────────┼──────────────────────────────────┼─────────────────────────────┤
│ ci.yml action v23.0.0   │ Bundles markdownlint-cli2 0.22.0 │ Same CLI tool, same version │
└─────────────────────────┴──────────────────────────────────┴─────────────────────────────┘

The v23.0.0 is the action wrapper version, not the CLI tool version. The action's package.json declares "markdownlint-cli2": "0.22.0" as its dependency. Both local pre-commit and CI are running the exact same linter

harmjeff
harmjeff previously approved these changes Apr 9, 2026
Copy link
Copy Markdown
Contributor

@harmjeff harmjeff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disagee and commit

Copy link
Copy Markdown

@dreamorosi dreamorosi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a comment to simplify the permission group in the GH workflow

Uses the documented shorthand `permissions: {}` which is functionally
equivalent and future-proof against new permission scopes. Job-level
permissions that grant specific access are preserved.
@scottschreckengaust
Copy link
Copy Markdown
Member Author

Left a comment to simplify the permission group in the GH workflow

done

Copy link
Copy Markdown
Contributor

@harmjeff harmjeff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

Copy link
Copy Markdown
Contributor

@Kalindi-Dev Kalindi-Dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@scottschreckengaust
Minor/Nits

  • The ci.yml workflow name is very generic ("CI"). If we add more CI jobs added (tests, build, validation), the name is fine. But if it stays markdownlint-only, something more specific like "Lint" might be clearer in the GitHub Actions UI.

The PR adds an [Unreleased] section and moves the 0.1.6 block, creating a structural change to an auto-generated file. Since CHANGELOG.md is generated by git-cliff (cliff.toml), and the PR itself adds CHANGELOG.md to the markdownlint ignores list, these manual edits will likely be overwritten by the next release PR. The CHANGELOG changes and the ignore entry contradict each other -- if it's ignored from linting, there's no need to fix its formatting in this PR.

Approving as this can be tracked in a later issues and looks for good for the current PR PR

@scottschreckengaust scottschreckengaust added this pull request to the merge queue Apr 9, 2026
Merged via the queue into main with commit 182b6e9 Apr 9, 2026
23 of 24 checks passed
@scottschreckengaust scottschreckengaust deleted the worktree-add-markdownlint branch April 9, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation github rules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants