Skip to content

feat(resolution): resolve CFML dotted and relative component-path inheritance (#1152)#1154

Merged
colbymchenry merged 1 commit into
mainfrom
cfml-dotted-inheritance-1152
Jul 2, 2026
Merged

feat(resolution): resolve CFML dotted and relative component-path inheritance (#1152)#1154
colbymchenry merged 1 commit into
mainfrom
cfml-dotted-inheritance-1152

Conversation

@colbymchenry

Copy link
Copy Markdown
Owner

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) or extends="../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 52 extends declarations 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 to cfml/cfscript extends/implements refs containing . or / (a dotted calls ref is a member-access chain, never a component path — it can't reach this):

  • Dotted: match the final segment against class/interface nodes, then corroborate right-to-left against the candidate's parent directories, case-insensitively. The mapping-root prefix may be absent from the repo (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.
  • Relative: normalize ../base against the referencing file's directory; exact case-insensitive file match.
  • No fallthrough on miss — the path string can only mis-match downstream strategies; silent beats wrong.

Validation

Repo extends/implements edges ColdBox system/ core
FW/1 14 → 47
ColdBox 21 → 242 3 → 67
CFWheels 60 → 201

Precision: 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

…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>
@colbymchenry colbymchenry merged commit 5f22da3 into main Jul 2, 2026
1 check passed
@colbymchenry colbymchenry deleted the cfml-dotted-inheritance-1152 branch July 2, 2026 23:42
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.

CFML: resolve dotted-path extends/implements (extends="coldbox.system.web.Controller")

1 participant