feat(api-discovery): add tier=engine for engine-repo lints

The engine repo has neither init.lua nor manifest.lib — it's a C
codebase, not a Lua lib. Previously running --lint on it would fail
with read errors.

Add tier=engine: skips parse_lua_surface, parse_readme_api, and
topology generation, runs only validate_readme_structure for
structural compliance. Tier accepts a more flexible Badges pattern
since engine uses fields like Version/License instead of Lib-ID.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Axel Meyer
2026-05-16 18:45:02 +02:00
parent a8830c0680
commit 97df886e0f

View File

@@ -142,13 +142,17 @@ end
-- Validates README structure against MUST-sections for the given tier.
-- Tier "core" enforces: H1, Abstract, Badges, Topology, Topology-Block, API, References.
-- Tier "engine" enforces the same MUST-sections, but the Badges check accepts
-- any bold key:value line (engine README has no Lib-ID; instead Version/License).
-- Tier "community" enforces nothing (returns empty result).
-- Returns: { missing_sections = [...], section_order_ok = bool }
function M.validate_readme_structure(markdown_string, tier)
if tier ~= "core" then
if tier == "community" then
return { missing_sections = {}, section_order_ok = true }
end
-- Both "core" and "engine" tiers use the same MUST-sections list.
-- Difference is handled upstream (engine tier skips parse_lua_surface etc.).
local missing = {}
local checks = {
{ name = "H1", pattern = "^#%s+%S" },
@@ -158,6 +162,13 @@ function M.validate_readme_structure(markdown_string, tier)
{ name = "API", pattern = "\n##%s+API[%s\n]" },
{ name = "References", pattern = "\n##%s+References[%s\n]" },
}
-- Engine-tier: relax the Badges check (engine uses "Version", "License" etc.
-- instead of a "Lib-ID:" prefix — engine is not a lib).
if tier == "engine" then
checks[2] = { name = "Badges", pattern = "\n%*%*[%w%-]+:%*%*" }
end
for _, c in ipairs(checks) do
if not string.find(markdown_string, c.pattern) then
table.insert(missing, c.name)