Skip to content

refactor: decompose Global.cfc (DC7, split from #2897) #3241

Description

@bpamiri

Problem

vendor/wheels/Global.cfc is ~4,651 lines with ~127 public functions spanning roughly a dozen responsibilities (mixin promotion, caching, model/controller lookup, double-checked locking, invocation helpers, plugin bootstrap, etc.). It is the parent of every Global-derived component on the framework's hottest paths.

This was finding DC7 in the internal multi-agent framework review (2026-06-09) and was tracked under the performance umbrella issue #2897 ("Per-request / per-row mixin re-integration and reflective dispatch tax"). It was explicitly sequenced to land after the Stage 1–4 + DC15 performance work so the hot-path files churned only once.

That performance work is now complete and merged (#2914, #3236, #3160, #3161, #2943, #3165), so DC7 is unblocked and is split out here as its own dedicated issue. It is a structural refactor, not a performance fix — separating it keeps #2897 closeable.

Scope

Decompose Global.cfc into cohesive units (the ~12 responsibility clusters identified in the review), reducing the single-file surface while keeping behavior byte-identical.

Hard constraints (cross-engine — do not drift)

  • Invariant 7 — the $-prefixed public mixin surface must stay byte-identical. $integrateComponents only mixes in public methods; any method that moves must remain public with the same name, or model/controller integration breaks on Lucee/Adobe while BoxLang silently passes. (Precedent: 8f35045a0 made $subscribe* public for exactly this reason.)
  • Invariant 2 — never call a function member off application scope; the integration caches added by the perf work store refs as data and copy-then-call. Preserve that.
  • No inline closures as constructor named args (Invariant 5 — catastrophic on Adobe / takes down TestBox bundles); no reserved-scope parameter names (New master #11).
  • The mixin-integration plan cache (application.wheels.integrationPlans), $cachedModelLookup/$cachedControllerLookup, the shared PluginObj, and the DC15 promotedGlobalKeys cache must all keep working unchanged, including ?reload=true invalidation.

Acceptance criteria

  • Global.cfc decomposed; the public $-prefixed mixin surface is verifiably unchanged (diff the getMetaData().functions public-name set before/after).
  • Full matrix green: tools/test-matrix.sh --all (targeted Adobe 2023 + Lucee 7 MySQL during development).
  • No behavior change to mixin integration, warm model()/controller() lookups, plugin bootstrap, or reload semantics.

Source

Internal multi-agent framework review, 2026-06-09 — finding DC7. Split out of #2897 after its Stage 1–4 + DC15 performance work completed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorInternal refactor; no user-facing behavior change intended

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions