feat(entrypoints): base-class matcher over resolved heritage, with dispatch and via - #160
Merged
Merged
Conversation
This was referenced Sep 6, 2026
rahlk
force-pushed
the
feat/issue-157-entrypoint-rules
branch
from
September 6, 2026 12:53
593d311 to
58f8adc
Compare
rahlk
force-pushed
the
feat/issue-159-entrypoint-bases
branch
from
September 6, 2026 12:56
5a58e0e to
9f6932f
Compare
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 #159. Unit 4 of the entrypoint spec (#150); plan
docs/design/plans/2026-09-03-entrypoints-units-2-5.md, Task 6. Stacked on #158 (unit 3) — this PR targets that branch, notmain.Class-declared entrypoints: a framework whose contract is "subclass this and define these methods". Python's
entrypoints_from_bases, ported.What this adds
entrypointsFromBases: abases:rule matches when ANY base of the class — resolved through the import table, else as written — matchesrule.match. Withtransitive: true, the bases of every in-project ancestor reachable throughextends_idsare checked too (external ancestors have no node, so the walk stops at the project boundary; aseenset guards cycles). The class gets one record per matching rule; eachdispatch:name the class actually DEFINES gets a record withrule: "<id>.dispatch",via: <class id>, andhttp_methods: [VERB]only when the name is one of the seven HTTP verbs — so aListViewwith onlygetgains no phantompost, andlistyields[].Runs under the stage-0 gate, inside the per-framework loop, before the heuristic tiers — so a base-rule claim counts as framework-claimed for never-doubles.
No new shipped rule. NestJS and Angular are decorator-only, so the matcher is exercised through a user rules file in the test. A shipped
bases:rule arrives when a real TypeScript framework needs one.Verification
bun test— 278 pass, 0 fail (3 new): direct base via the import table with dispatch only for defined methods; transitive through an in-project ancestor; the gate (no import, no dependency → nothing)transitive: falseor an emptydispatch; the per-type resolver map could be per-moduleOne plan defect, fixed in the open
The plan's
resolve: (written) => string— one closure built from the leaf class's module — cannot resolve an ancestor's written base spelling, because that ancestor'simport { View } from "viewfw"lives in a different module. The transitive test is only satisfiable ifresolvetakes the owning type and dispatches to that type's own module's import table. That is what shipped:resolve(written, owner), with one import table per module built up front. Internal signature only; no wire effect.