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:
5
init.lua
5
init.lua
@@ -99,7 +99,7 @@ function M.generate_topology_block(manifest, engine_calls)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Validates README structure against MUST-sections for the given tier.
|
-- 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).
|
-- Tier "community" enforces nothing (returns empty result).
|
||||||
-- Returns: { missing_sections = [...], section_order_ok = bool }
|
-- Returns: { missing_sections = [...], section_order_ok = bool }
|
||||||
function M.validate_readme_structure(markdown_string, tier)
|
function M.validate_readme_structure(markdown_string, tier)
|
||||||
@@ -110,7 +110,8 @@ function M.validate_readme_structure(markdown_string, tier)
|
|||||||
local missing = {}
|
local missing = {}
|
||||||
local checks = {
|
local checks = {
|
||||||
{ name = "H1", pattern = "^#%s+%S" },
|
{ 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 = "Topology-Block", pattern = "<!%-%-%s*topology:start" },
|
||||||
{ name = "API", pattern = "\n##%s+API[%s\n]" },
|
{ name = "API", pattern = "\n##%s+API[%s\n]" },
|
||||||
{ name = "References", pattern = "\n##%s+References[%s\n]" },
|
{ name = "References", pattern = "\n##%s+References[%s\n]" },
|
||||||
|
|||||||
Reference in New Issue
Block a user