Complete Plan 61: Required Structure Rule Hardening - #168
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #168 +/- ##
==========================================
+ Coverage 89.65% 89.69% +0.03%
==========================================
Files 113 113
Lines 12163 12163
==========================================
+ Hits 10905 10909 +4
+ Misses 798 796 -2
+ Partials 460 458 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Completes Plan 61 by hardening the MDS020 (required-structure) rule via additional edge-case coverage and clearer body-sync diagnostics (including the expected value in the message).
Changes:
- Added targeted unit tests for required-structure edge cases (wildcard level enforcement, soft-wrapped body sync, integer front matter sync, missing-heading sync suppression, multi-missing sections, combined ordering+level errors).
- Improved body-sync diagnostic messaging to include the expected value, and updated rule documentation accordingly.
- Added new MDS020 fixture files for wildcard-level mismatch and multiple missing required sections; marked Plan 61 complete in plan tracking docs.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| plan/61_required-structure-hardening.md | Marks Plan 61 tasks/acceptance criteria as completed. |
| internal/rules/requiredstructure/rule_test.go | Adds Plan 61 edge-case unit tests for MDS020 behavior. |
| internal/rules/requiredstructure/rule.go | Enhances body-sync diagnostic to include the expected value. |
| internal/rules/MDS020-required-structure/bad/wildcard-level.md | Adds fixture asserting wildcard heading level mismatch diagnostic. |
| internal/rules/MDS020-required-structure/bad/multi-missing.md | Adds fixture asserting multiple missing required sections diagnostics. |
| internal/rules/MDS020-required-structure/bad/data/wildcard-tmpl.md | Adds schema template fixture for wildcard heading tests. |
| internal/rules/MDS020-required-structure/README.md | Updates documented body-sync diagnostic format with expected value. |
| PLAN.md | Updates Plan 61 status to complete in the main plan index. |
80322fc to
8e7a36e
Compare
8e7a36e to
81cb3ca
Compare
|
🟢 Merge Queue — picked up This PR is in the queue and will be batched with other Next: No action needed — you'll get another comment when CI starts on the batch. View merge queue run. |
|
⏳ Merge Queue — requeued The merge queue hit an error while processing this PR:
Next: No action needed — the queue will retry on the next tick. |
|
🟢 Merge Queue — picked up This PR is in the queue and will be batched with other Next: No action needed — you'll get another comment when CI starts on the batch. View merge queue run. |
|
⏳ Merge Queue — requeued The merge queue hit an error while processing this PR:
Next: No action needed — the queue will retry on the next tick. |
|
🟢 Merge Queue — picked up This PR is in the queue and will be batched with other Next: No action needed — you'll get another comment when CI starts on the batch. View merge queue run. |
|
⏳ Merge Queue — requeued The merge queue hit an error while processing this PR:
Next: No action needed — the queue will retry on the next tick. |
|
🟢 Merge Queue — picked up This PR is in the queue and will be batched with other Next: No action needed — you'll get another comment when CI starts on the batch. View merge queue run. |
|
⏳ Merge Queue — requeued The merge queue hit an error while processing this PR:
Next: No action needed — the queue will retry on the next tick. |
81cb3ca to
1f0fdde
Compare
- checkBodySync now includes the expected value in its message so authors know immediately what text the body must contain - Add 7 unit tests covering wildcard heading level mismatch, soft-wrapped body sync, integer front matter values, sync not fired for absent headings, multiple simultaneously missing sections, and out-of-order sections that also carry a level mismatch - Add fixture tests: bad/wildcard-level.md (h2 where h1 required) and bad/multi-missing.md (two required sections both absent) - Update README Diagnostics table to show the improved body-sync format - Mark plan 61 complete https://claude.ai/code/session_01Lt7t1NZecqrysXAAp63LYa
1f0fdde to
d5548ae
Compare
|
🟢 Merge Queue — picked up This PR is in the queue and will be batched with other Next: No action needed — you'll get another comment when CI starts on the batch. View merge queue run. |
|
🔵 Merge Queue — CI running Merged into batch branch Next: No action needed — you'll be notified when CI completes. |
|
✅ Merge Queue — merged This PR landed on Next: Done — nothing more to do here. |
- Fix misleading "Skip images" comment in scanFullRefs (Copilot #203) - Fix inaccurate shortcutRE comment (Copilot #270) - Handle image shortcuts ![label] in scanShortcutRefs: bypass heuristic since '!' makes intent unambiguous, adjust column to '!' position (Copilot #315) - Add tests for image shortcuts (collapsed and shortcut forms, Copilot #168) - Add tests covering previously uncovered paths: PI block content, collapsed-ref footnote/placeholder/image/code-block exclusions, shortcut starting with digit, ApplySettings error branches, toStringSlice variants https://claude.ai/code/session_01KTesZkrq3uXhbR36d8SdCH
- Fix misleading "Skip images" comment in scanFullRefs (Copilot #203) - Fix inaccurate shortcutRE comment (Copilot #270) - Handle image shortcuts ![label] in scanShortcutRefs: bypass heuristic since '!' makes intent unambiguous, adjust column to '!' position (Copilot #315) - Add tests for image shortcuts (collapsed and shortcut forms, Copilot #168) - Add tests covering previously uncovered paths: PI block content, collapsed-ref footnote/placeholder/image/code-block exclusions, shortcut starting with digit, ApplySettings error branches, toStringSlice variants https://claude.ai/code/session_01KTesZkrq3uXhbR36d8SdCH
- Fix misleading "Skip images" comment in scanFullRefs (Copilot #203) - Fix inaccurate shortcutRE comment (Copilot #270) - Handle image shortcuts ![label] in scanShortcutRefs: bypass heuristic since '!' makes intent unambiguous, adjust column to '!' position (Copilot #315) - Add tests for image shortcuts (collapsed and shortcut forms, Copilot #168) - Add tests covering previously uncovered paths: PI block content, collapsed-ref footnote/placeholder/image/code-block exclusions, shortcut starting with digit, ApplySettings error branches, toStringSlice variants https://claude.ai/code/session_01KTesZkrq3uXhbR36d8SdCH
Summary
This PR completes Plan 61 by adding comprehensive edge-case tests for the MDS020 required structure rule and improving diagnostic messages to include expected values. All acceptance criteria have been met and the plan is marked complete.
Key Changes
Test Coverage Enhancements
# ?) still enforce correct heading levelsDiagnostic Message Improvements
checkBodySync()to include the expected value in error messagesbody does not match frontmatter field "description"body does not match frontmatter field "description": expected "..."Test Fixtures
wildcard-level.md: Tests wildcard heading with incorrect levelmulti-missing.md: Tests multiple missing required sectionswildcard-tmpl.md: Template file for wildcard heading testsPlan Completion
Implementation Details
writeSchema(),newTestFile(), and assertion helpershttps://claude.ai/code/session_01Lt7t1NZecqrysXAAp63LYa