Quality gates
22/22
Package-local architecture checks passed.

Architecture & quality foundation
Spiralist AI now uses a single application composition root, validated release identity, typed repositories and catalogs, dependency-aware route and asset registries, centralized output services, and backward-compatible facades. The refactor is deliberately incremental: behavior stays available while ownership moves behind stable seams.
Quality gates
Package-local architecture checks passed.
Canonical PHP source
0 class-like declarations under src/.
Legacy PHP surface
Retained for compatibility and progressively strangled behind typed owners.
Tracked debt
Prioritized by runtime risk, change amplification, and migration value.
Requests enter through thin route adapters. Application services own orchestration. Domain services own business rules. Repositories own data access. Output services own headers and serialization.
includes/bootstrap.php registers the namespaced source tree and constructs one Application. Release identity is validated before legacy constants are defined.
Configuration, JSON data, personas, Starter Packs, API catalog, routes, assets, deployment contracts, and quality evidence each have one canonical owner.
Existing PHP pages and integrations keep their public function names while delegating to typed services. This separates migration risk from feature delivery.
Endpoint files translate request context to an application call and response. They no longer need to duplicate identity, routing, or catalog assembly.
HTML layouts, JSON emitters, security headers, ETags, and deployment headers are centralized so representation differences are explicit rather than accidental.
Lint, contract tests, architecture audits, regression probes, manifest verification, UAI parity, and clean extraction form a layered release decision.
The facade pattern reduces high-fan-out files while preserving stable callers. The table is generated from the immutable v100.0.28 baseline and current source.
| Facade | Baseline lines | Current lines | Reduction |
|---|
The foundation does not pretend the application is fully modernized. The highest-risk seams remain explicit and bounded.
P1 · active-reduced
P1 · ready-not-run
P1 · active-reduced
P2 · planned
P2 · planned
P2 · planned
New behavior belongs in a namespaced service, repository, value object, or registry. Compatibility files remain thin and contain no new domain logic.
Record current behavior in deterministic tests and route probes before moving responsibility. Use differential evidence for intentional output changes.
Local, fixture, provider, human-review, runtime, deployment, and live-host evidence stay separate. Passing one dimension cannot silently promote another.
The next work should first remove clock-driven persona fingerprint nondeterminism, then extract the next characterized projection seam and run the bounded PHPStan contract in a tool-enabled environment.