feat(resolution): resolve CFML dotted and relative component-path inheritance (#1152)#1154
Merged
Merged
Conversation
…eritance (#1152) extends="coldbox.system.web.Controller" names its supertype by dotted component path (dots = directories from webroot or a CFML mapping) and extends="../base" by relative path — the graph indexes classes under their final segment only, so these refs died at the resolver's fast pre-filter and no inheritance edge was created (~94% of ColdBox core inheritance was invisible). New early resolution step, gated to cfml/cfscript extends/implements refs only (dotted calls refs are member-access chains, never component paths): - dotted: match the final segment against class/interface nodes, corroborate right-to-left against the candidate's parent directories (case-insensitive; the mapping-root prefix may be absent from the repo). Require >=1 corroborating segment — an uncorroborated same-named class is almost always an out-of-repo library supertype. Corroboration tie -> no edge. - relative: resolve ../base against the referencing file's directory, exact case-insensitive file match. Validated: fw1 extends 14->47, ColdBox 21->242 (system/ core 3->67), CFWheels 60->201; all 394 resolver-minted edges hand/script-audited path-consistent; node counts unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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 #1152 — the follow-up from the CFML language support (#1118/#1153).
CFML names a supertype by component path, not bare class name:
extends="coldbox.system.web.Controller"(dotted — directories from the webroot or a CFML mapping) orextends="../base"(relative — the FW/1 style). The graph indexes a class under its final segment only, so both forms died at the resolver's fast pre-filter: measured on ColdBox core, 49 of 52extendsdeclarations were dotted and only 3 inheritance edges existed (~94% invisible), breaking impact/blast-radius through supertypes on exactly the framework-style apps that dominate CFML.Approach
A dedicated early resolution step in
ReferenceResolver.resolveOne, gated tocfml/cfscriptextends/implementsrefs containing.or/(a dottedcallsref is a member-access chain, never a component path — it can't reach this):coldbox.IS the repo root in the coldbox repo) — suffix scoring handles that naturally. Conservative rules: at least one corroborating directory segment required (a same-named class with zero corroboration is almost always an out-of-repo library supertype — mxunit/testbox/installed frameworks), and a corroboration tie yields no edge.../baseagainst the referencing file's directory; exact case-insensitive file match.Validation
system/corePrecision: an audit script re-read the source declaration behind all 394 resolver-minted edges and verified the declared path corresponds to the target file — 394/394 consistent (4 initial flags were audit-regex artifacts, hand-verified correct). Node counts unchanged (no explosion). External supertypes (
mxunit.framework.TestCase,testbox.system.BaseSpec) correctly stay unresolved.10 new integration tests pin the ColdBox shape, path disambiguation, case-insensitivity, the zero-corroboration and tie rules, relative paths, dotted
implements→ interface promotion, tag-based syntax, and the calls-ref gate. Full suite: 2,007 passing (the one failure is the known #662 daemon flake, green on retry).🤖 Generated with Claude Code