feat(entrypoints): schema, Neo4j projection and the level-free pass skeleton - #154
Merged
Conversation
…keleton Unit 1 of the entrypoint spec (#150): the CONTRACT, before any detector exists. The fields were de-advertised in #60 because nothing populated them; this lands their shape so they exist at every -a and a consumer can already tell "no entrypoints" from "no pass ran". `TSEntrypoint` and `TSEntrypointReport` mirror python's `PyEntrypoint` / `PyEntrypointReport` field for field. `entrypoints: []` and `is_entrypoint: false` are stamped on every callable and every CLASS by a per-run pass -- like heritage, so the cached tree stays free of them and the wire always carries them. Interfaces, enums, aliases and namespaces never carry them: python stamps PyClass, and nothing else can be an entrypoint. `entrypoint_report` sits on the application root, empty. Neo4j mirrors python's projection exactly: `is_entrypoint` / `entrypoint_frameworks` on :TSClass and :TSCallable, and on :TSApplication the report as `entrypoint_frameworks` plus `entrypoint_report_json` (sorted-key JSON, since Neo4j has no map type and python encodes it the same way). Best-effort by contract: the pass records into `report.errors` rather than throwing, so a failure here loses flags, never the analysis. Additive; SCHEMA_VERSION unmoved (#144). The root-envelope key list in schema-v2.test.ts gains the one new key.
This was referenced Sep 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #153. Unit 1 of the entrypoint spec (#150): the contract, before any detector exists.
The fields were de-advertised in #60 because nothing populated them. This lands their shape so they
exist at every
-aand a consumer can already tell "no entrypoints" from "no pass ran". Detection —the framework gate, the rules file, the matchers — is units 2-5 (#72).
What this adds
TSEntrypoint/TSEntrypointReport, mirroringPyEntrypoint/PyEntrypointReportfield for fieldentrypoints: []andis_entrypoint: falseon every callable and every class, stamped by aper-run pass — like heritage, so the cached tree stays free of them and the wire always carries them
entrypoint_reporton the application root, emptyis_entrypoint/entrypoint_frameworkson:TSClassand:TSCallable; on:TSApplication,entrypoint_frameworksplusentrypoint_report_jsonassorted-key JSON (Neo4j has no map type; python encodes it the same way, so the two diff)
Two decisions worth a look
Class only, never interface/enum/alias/namespace. Python stamps
PyClass; nothing else can be anentrypoint. The field is declared on
TSType(optional) but the pass stamps classes, and Neo4j declaresit on
:TSClassonly — so a deadis_entrypoint: falsenever appears on an interface. The test assertsthe absence, not just the presence, and a mutant that drops the guard fails it.
Per-run pass, not builder defaults. #60 noted the builders used to hard-code
entrypoints: [].Stamping in a pass instead means the cache never holds a per-run layer, and the test proves it: L1 runs
cold, then L2–L4 run against the warm cache (whose modules lack these fields) and all four are
byte-identical.
Verification
bun test— 247 pass, 0 fail (5 new). The root-envelope key list inschema-v2.test.tsgains theone new key — that additive-contract gate caught it first, as intended
schema.neo4j.jsonregenerated;SCHEMA_VERSIONunmoved (chore(schema)!: collapse the schema version back to 2.0.0 #144); typecheck cleanHonest caveat
The report is honest-but-empty until unit 2:
frameworks_detected: []here means "no gate ran", not"no frameworks present". Unit 2 is what makes that distinction real, and it is the next PR.