Add public API boundary checks

This commit is contained in:
2026-10-05 17:07:17 +00:00
parent d692607e2b
commit 22a3dfe9bc
8 changed files with 570 additions and 15 deletions

View File

@@ -481,7 +481,7 @@ guidance and documented the command contract.
## Stage 3: Protect public contracts and dependency direction
Status: Pending. Depends on Stage 2.
Status: Complete. Depends on Stage 2.
1. Add a compiled-export boundary checker for both facades using `go list` export
data and `go/types`. Inspect exported signatures, fields, callbacks, aliases,
@@ -499,6 +499,15 @@ Acceptance: actual exports pass and meaningful negative fixtures fail. Tests
inspect contracts and imports, with no fixed inventory of future internal
package names. Extend these checks as subsequent exports land.
Completion evidence: added `internal/apicheck`, which loads compiled exports
from `go list -deps -export` and inspects signatures, fields, aliases, generic
constraints, and pointer and value method sets through `go/types`. The checks
pass for both public facades and enforce internal import direction and the
runtime dependency boundary. Negative fixtures detect leaked types, aliases,
callbacks, generic constraints, and promoted implementation methods; a private
implementation field and selected standard-library contracts pass. Added the
checker command and internal package inventory to the canonical developer docs.
## Stage 4: Implement profile loading and command adaptation
Status: Pending. Depends on Stage 3.