Skip to content

feat(entrypoints): schema, Neo4j projection and the level-free pass skeleton - #154

Merged
rahlk merged 1 commit into
mainfrom
feat/issue-153-entrypoint-contract
Sep 6, 2026
Merged

feat(entrypoints): schema, Neo4j projection and the level-free pass skeleton#154
rahlk merged 1 commit into
mainfrom
feat/issue-153-entrypoint-contract

Conversation

@rahlk

@rahlk rahlk commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

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 -a and 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, mirroring PyEntrypoint / PyEntrypointReport field for field
  • entrypoints: [] and is_entrypoint: false on every callable and every class, stamped by a
    per-run pass — like heritage, so the cached tree stays free of them and the wire always carries them
  • entrypoint_report on the application root, empty
  • Neo4j, exactly as python projects it: is_entrypoint / entrypoint_frameworks on :TSClass and
    :TSCallable; on :TSApplication, entrypoint_frameworks plus entrypoint_report_json as
    sorted-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 an
entrypoint. The field is declared on TSType (optional) but the pass stamps classes, and Neo4j declares
it on :TSClass only — so a dead is_entrypoint: false never appears on an interface. The test asserts
the 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 in schema-v2.test.ts gains the
    one new key — that additive-contract gate caught it first, as intended
  • Mutation-checked — removing the class-only guard fails the interface-absence test
  • Container tests run — 4 pass against live Neo4j
  • schema.neo4j.json regenerated; SCHEMA_VERSION unmoved (chore(schema)!: collapse the schema version back to 2.0.0 #144); typecheck clean

Honest 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.

…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.
@rahlk
rahlk merged commit 70ec00c into main Sep 6, 2026
1 check passed
@rahlk
rahlk deleted the feat/issue-153-entrypoint-contract branch September 6, 2026 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(entrypoints): schema, Neo4j projection and the level-free pass skeleton (unit 1)

1 participant