| id | 169 | |
|---|---|---|
| title | Enforce terminal Meta-Information and render it from frontmatter | |
| status | ✅ | |
| model | opus | |
| depends-on |
|
|
| summary | The rule-readme schema allows sections after Meta-Information and its bullets are hand-typed. Make the schema reject any later section and sync the bullets from frontmatter via {field}. |
Every rule README must end with its
## Meta-Information section. That section's
bullets must come from the README front matter, not
hand-typed values. The rule-readme schema enforces
both. A section after Meta-Information fails
mdsmith check. A bullet that disagrees with front
matter is flagged and fixed.
The rule-readme kind loads its required-structure
schema from
internal/rules/proto.md.
That schema ends with a trailing ## ... wildcard
after ## Meta-Information. So a README may add
sections after it and still pass. The schema does
not enforce Meta-Information as the last section.
The Meta-Information body is hand-authored. Its
ID, Name, Status, and Category bullets
restate the id, name, status, and category
front-matter keys. Nothing checks that they agree.
docs/guides/schemas.md
notes that MDS020's file-schema check still uses
its legacy parser. A {field} token in a
proto.md body is treated as a wildcard, not
resolved against front matter. Frontmatter-body
{field} sync is listed there as an unwired
follow-up. This plan wires it for the
Meta-Information case.
-
Drop the trailing
## ...wildcard in internal/rules/proto.md. The parsed schema then treats Meta-Information as the last scope. Add a test that a later section reportsgot <present>, expected not declared in schema. -
Wire MDS020's file-schema path so a
{field}token in the Meta-Information body resolves the document front-matter value. Reuse thefmvar(...)resolution the heading matcher already uses.mdsmith fixrewrites a stale bullet to the front-matter value. -
Update internal/rules/proto.md so the bullets use
{id},{name},{status},{category}. Drop the hand-keptCATEGORYliteral. -
Revalidate every
internal/rules/MDS*/README.md. Move any content after Meta-Information ahead of it. Reconcile bullet values with front matter somdsmith check .passes. -
Update docs/guides/schemas.md and the section-schema reference. Record that frontmatter-body
{field}sync is now wired for file schemas.
- A rule README with any section after
## Meta-Informationfailsmdsmith check. - A stale
ID,Name,Status, orCategorybullet is flagged andmdsmith fixrewrites it from front matter. - internal/rules/proto.md
has no trailing wildcard after Meta-Information
and no
CATEGORYliteral. - All
internal/rules/MDS*/README.mdpassmdsmith check .. - All tests pass:
go test ./.... -
go tool golangci-lint runreports no issues.