Commit Graph

13 Commits

Author SHA1 Message Date
Axel Meyer
97df886e0f 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>
2026-05-16 18:45:02 +02:00
Axel Meyer
a8830c0680 chore: add Tier-1 LICENSE file
Adds the proprietary all-rights-reserved license that applies to this
library. The text is identical to the engine LICENSE — this lib is
Tier-1 official platform content, distributed under the same terms.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 18:04:14 +02:00
Axel Meyer
a169c6c74b fix(parse_readme_api): support namespace-less function names
The previous single-pattern approach used a greedy `[^.\x60]*` segment
that mis-captured H3 headers without a namespace prefix (e.g. test-lib
entrypoints documented as `### \`run_tests(ctx)\``).

Replace with a two-pass match: pattern 1 captures `### \`ns.func(...)\``
(namespaced) and pattern 2 captures `### \`func(...)\`` (no namespace).
A seen-set prevents the namespace-less pass from re-matching names
already collected by the namespaced pass.

Enables test-libs to declare a public surface in their READMEs and
satisfy --lint's missing-docs check.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 17:51:27 +02:00
Axel Meyer
78cf0eb980 fix(parse_lua_surface): strip Lua line-comments before matching
Previous implementation matched function-declaration patterns inside
Lua line-comments, causing false-positive missing_docs warnings for
commented-out forward-compat stubs (e.g. DEPRECATED-MVP placeholders
in camera and render libs, 5 each).

Pre-process source with gsub to strip "--" through end-of-line before
running the two gmatch passes. Block comments (--[[...]]) are not
handled; not used in this project's Lua sources.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 17:51:10 +02:00
Axel Meyer
2e72de2ea6 feat: parse_lua_surface accepts both explicit and sugar-form (S2 follow-up)
Per user-greenlight option (b): function M.foo(...) syntax sugar is now
recognized in addition to M.foo = function(...) explicit-assignment.

Eliminates 7 false-positive stale_docs warnings on every existing lib
README (e.g. lib-core.input). Sugar-form is dominant in Sporel-lib code
(113 occurrences across lib-core/) - sticking to explicit-only would
have required cascade-migrating all init.lua files. This approach is
pragmatic: lint tolerant of idiomatic Lua, no source-rewriting needed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 16:07:06 +02:00
Axel Meyer
f926a58c63 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**:').
2026-05-16 15:26:25 +02:00
Axel Meyer
4ab4bda0e7 feat: add validate_readme_structure (S2 Phase 1)
Validates MUST-Sections for tier=core (H1, Badges-Table, Topology-Block,
API, References) + section-order (API before References). Tier=community
returns empty (recommendation-only per spec section 3.1).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 13:37:35 +02:00
Axel Meyer
d71ea6df74 feat: add generate_topology_block (S2 Phase 1)
Builds mermaid graph-LR source from manifest.deps + engine-calls.
Asset-libs (no deps, no engine) produce self-node-only output.
Per spec section 4.2.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 13:33:34 +02:00
Axel Meyer
24bd00ad9c feat: add grep_engine_calls (S2 Phase 1)
Greps engine.<namespace>.<func> patterns from Lua source via Lua-pattern.
Returns unique sorted array per spec section 4.2.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 13:27:55 +02:00
Axel Meyer
0457d5c798 feat: add diff_surface (S2 Phase 1)
Set-difference between code-surface.public and README documented-list.
Returns { missing_docs, stale_docs } sorted, per spec section 4.2.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 13:22:57 +02:00
Axel Meyer
3eacefe18d feat: add parse_readme_api (S2 Phase 1)
Extracts H3-headers from README ## API section. Pattern handles
optional namespace-prefix (e.g. 'input.bind' -> 'bind'). Returns
{ documented = [...] } per spec section 4.2.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 13:18:19 +02:00
Axel Meyer
dfa4134106 feat: add parse_lua_surface (S2 Phase 1)
Extracts M.<name> = function(...) patterns from Lua source; classifies
underscore-prefix as private. Pure regex-based (Lua patterns); 95%
coverage for idiomatic Sporel-Lib code per spec §4.3.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 12:55:27 +02:00
Axel Meyer
bb9bee495b init: lib-core.api-discovery v0.1.0 skeleton
Empty M-table. Functions added incrementally via TDD in subsequent
S2-plan tasks.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 12:41:49 +02:00