From f926a58c63eb442633fe50cd7cdecc7262260a8e Mon Sep 17 00:00:00 2001 From: Axel Meyer Date: Sat, 16 May 2026 15:26:25 +0200 Subject: [PATCH] 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**:'). --- init.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 13914a4..2930f0c 100644 --- a/init.lua +++ b/init.lua @@ -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 = "