Plan 61: Required Structure Rule Hardening (WIP) - #145
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #145 +/- ##
==========================================
+ Coverage 86.35% 86.44% +0.08%
==========================================
Files 94 94
Lines 10149 10186 +37
==========================================
+ Hits 8764 8805 +41
+ Misses 903 899 -4
Partials 482 482 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Updates plan tracking to mark Plan 61 (“Required Structure Rule Hardening”) as in-progress and keeps the generated plan index in sync.
Changes:
- Set
status: 🔳inplan/61_required-structure-hardening.md. - Regenerated
PLAN.mdcatalog table so Plan 61 shows as in-progress.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| plan/61_required-structure-hardening.md | Marks Plan 61 as in-progress (🔳) in front matter. |
| PLAN.md | Updates the generated plans table entry for Plan 61 to reflect the new status. |
…ction Hardens MDS020 diagnostics so authors can locate and interpret structure failures without scanning the full document: - Level mismatch now names the offending heading: "heading level mismatch for \"Settings\": expected h2, got h3". - Unexpected-section diagnostic names the required heading the schema expected next: "unexpected section \"## Extra\" (expected \"## Settings\")". README diagnostic table updated to match. Trailing-extra behavior (past the last required heading) is unchanged and covered by a new test.
Previously, when the document contained every required heading but
in the wrong order, MDS020 reported each displaced heading as both
"unexpected section" and "missing required section" — two
contradictory diagnostics for one structural problem.
Now the inner match loop checks whether a non-matching doc heading's
text is any later unclaimed required heading; if so, it emits a
single "section X out of order: expected after Y" diagnostic and
marks that schema index as claimed so no "missing required" follows.
Level mismatches on out-of-order matches are still reported.
Text-based matching intentionally excludes wildcard (`...`),
single-`?` and `{field}`-interpolated schema headings, where
out-of-order semantics would require fuzzy or context-aware
matching.
Inner loop extracted to matchRequired to keep cognitive complexity
within the gocognit threshold. README diagnostic table gains the
new row.
Integration fixtures pin the exact diagnostic strings and line numbers for the three new/changed behaviours: - bad/out-of-order.md — doc lists ## Tasks before ## Goal; schema lists ## Goal before ## Tasks; expects a single "section \"## Tasks\" out of order: expected after \"## Goal\"". - bad/wrong-level.md — ### Goal under schema ## Goal; expects "heading level mismatch for \"Goal\": expected h2, got h3". - bad/extra-section.md — ## Extra sits between required ## Goal and ## Tasks; expects "unexpected section \"## Extra\" (expected \"## Goal\")".
|
🟢 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. |
Tracks work on plan 61 — Required Structure Rule Hardening.
Picked plan 61 because it was the only unblocked plan with no existing branch or PR: 50, 52 are large new features; 87 depends on unimplemented plan 86 (MDS034).
Changes by commit
d3a8edc): flipstatusto 🔳 inplan/61_...mdand regeneratePLAN.md.7c42b38):heading level mismatch for "Settings": expected h2, got h3.unexpected section "## Extra" (expected "## Settings").0070c88):unexpected section Xandmissing required section Xfor the same heading.section X out of order: expected after Ydiagnostic; the schema index is claimed so no follow-up "missing" fires. Level mismatches on out-of-order matches are still reported....),?, and{field}-interpolated schema headings where out-of-order semantics would need fuzzy/context-aware matching.Inner loop extracted to
matchRequiredto stay within the gocognit threshold. README diagnostic table updated with the new messages and anout of orderrow.Status
MDS020-required-structure/README.mdTest plan
go test ./...— passes (unrelatedinternal/corpusgit-signing failures only in the local sandbox; CI green).go vet ./...— clean.go tool golangci-lint run— 0 issues.go run ./cmd/mdsmith check .— 115 files checked, 0 failures.