fix: validate_readme_structure for new Badges/Topology convention (S2 iter)

User-feedback iteration on S2 PoC template:
- Replace Badges-Table check ('| Field |' pattern) with bold key:value-list
  check matching '**Lib-ID:** lib-...' line. This is the most-distinctive
  marker for the new convention.
- Add new MUST-Section 'Topology' (H2 heading directly above topology-block).
  Pattern: '\n## Topology'.
- Keep Topology-Block (comment-marker) as separate MUST-Section.

Tier-core MUST-Sections now: H1, Badges, Topology, Topology-Block, API,
References. Pattern fix: colon belongs INSIDE the bold span ('**Lib-ID:**'
not '**Lib-ID**:').
This commit is contained in:
Axel Meyer
2026-05-16 15:26:25 +02:00
parent 4ab4bda0e7
commit f926a58c63

View File

@@ -99,7 +99,7 @@ function M.generate_topology_block(manifest, engine_calls)
end
-- Validates README structure against MUST-sections for the given tier.
-- Tier "core" enforces: H1, Abstract, Badges-Table, Topology-Block, API, References.
-- Tier "core" enforces: H1, Abstract, Badges, Topology, Topology-Block, API, References.
-- Tier "community" enforces nothing (returns empty result).
-- Returns: { missing_sections = [...], section_order_ok = bool }
function M.validate_readme_structure(markdown_string, tier)
@@ -110,7 +110,8 @@ function M.validate_readme_structure(markdown_string, tier)
local missing = {}
local checks = {
{ name = "H1", pattern = "^#%s+%S" },
{ name = "Badges-Table", pattern = "\n|%s*Field%s*|" },
{ name = "Badges", pattern = "\n%*%*Lib%-ID:%*%*%s*lib%-" },
{ name = "Topology", pattern = "\n##%s+Topology[%s\n]" },
{ name = "Topology-Block", pattern = "<!%-%-%s*topology:start" },
{ name = "API", pattern = "\n##%s+API[%s\n]" },
{ name = "References", pattern = "\n##%s+References[%s\n]" },