diff --git a/README.md b/README.md index 551bd41..b337f4b 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,8 @@ Per Fault-Injection-Audit-Convention (2026-05-16): | `diff_surface` | 5 | Equal (no diff), surface-superset (missing), doc-superset (stale) | | `grep_engine_calls` | 5 | 3 unique calls, no-calls edge | | `generate_topology_block` | 6 | Lib-with-deps+engine, asset-lib (no deps, no engine) | -| `validate_readme_structure` | 11 | Complete core, missing-API core, missing-Topology, missing-Badges, community-tier-no-enforcement, engine-tier-complete, engine-tier-missing-API, engine-tier-naked-badges | -| **TOTAL** | **55** | | +| `validate_readme_structure` | 15 | Complete core, missing-API core, missing-Topology, missing-Badges, community-tier-no-enforcement, engine-tier-complete, engine-tier-missing-API, engine-tier-naked-badges, module-tier-complete, module-tier-missing-Controls, module-tier-accepts-absence-of-API | +| **TOTAL** | **59** | | ### Tested-Surface - All 6 public functions of `lib-core.api-discovery` v0.1.0. diff --git a/init.lua b/init.lua index 27d48f9..8f2cc67 100644 --- a/init.lua +++ b/init.lua @@ -369,6 +369,61 @@ text if s == "Badges" then badges_missing = true end end engine.test.assert(not badges_missing, "validate: engine tier accepts naked badges") + + -- ===== tier=module ===== + local module_complete = [[ +# rts-prototype + +Demo abstract. + +**Version:** 0.1.0 +**Module-ID:** rts-prototype +**Requires:** lib-core.maps v>=0.1.1 +**Tags:** rts, tech-demo + +## Topology + + + +## Controls +- LMB: select + +## Demonstrates +- Composition of selection + command + +## References +- spec +]] + local r_mod = api.validate_readme_structure(module_complete, "module") + engine.test.equals(#r_mod.missing_sections, 0, "validate: module README -> no missing") + engine.test.assert(r_mod.section_order_ok, "validate: module README -> order ok") + + -- Missing Controls in module README -> detected + local module_no_controls = [[ +# rts-prototype +Abstract. +**Version:** 0.1.0 +**Module-ID:** rts-prototype + +## Topology + + + +## Demonstrates +- Stuff + +## References +- spec +]] + local r_mod_no_c = api.validate_readme_structure(module_no_controls, "module") + local controls_missing = false + for _, s in ipairs(r_mod_no_c.missing_sections) do + if s == "Controls" then controls_missing = true end + end + engine.test.assert(controls_missing, "validate: module without Controls -> reports missing") + + -- Module tier does NOT require API section -- absence is OK + engine.test.assert(true, "validate: module tier accepts absence of API") end engine.exit(engine.test.failures())