# Code-quality debt register — v100.0.30-persona-domain-characterization-foundation-wip

Baseline: `v100.0.29-consistency-architecture-quality-foundation-wip`

Active items: **10** — P0 3, P1 5, P2 2.

v100.0.30 reduces the largest P0 persona module from 4,890 to 4,643 lines by extracting 509 lines of typed, testable domain behavior. The P0 remains open because most projection and prompt-compilation responsibilities still share the procedural facade.

| ID | Priority | Status | Area | Current concern | Next bounded step |
|---|---|---|---|---|---|
| `DEBT-PHP-001` | P0 | in-progress | persona-generation | One procedural module owns catalog interpretation, random assembly, prompt/output composition, policy defaults, and presentation-shaped arrays. | Inject a deterministic clock into realism-audit timestamps, establish exact repeated full-profile output, then characterize and extract biography/causal-identity and worldview relevance projection. |
| `DEBT-PHP-002` | P0 | open | psychosis-domain | State construction, chronology, evidence-layer language, output projection, and support/safety boundaries share one procedural owner. | Create typed epistemic-layer records and migrate the evidence ledger first because it has the clearest invariant boundary. |
| `DEBT-PHP-003` | P0 | open | espionage-domain | Career chronology, cover identity, tradecraft vocabulary, relationships, and output assembly are coupled. | Extract deterministic chronology normalization and test it across adult creator variants. |
| `DEBT-HTTP-001` | P1 | open | adult-api | Request parsing, consent enforcement, response headers, domain generation, error translation, and serialization remain interleaved. | Migrate one read-only discovery/status endpoint as a reference controller before random/batch generation. |
| `DEBT-HTTP-002` | P1 | open | response-ownership | 144 PHP files still own raw header calls and 36 own exit/die behavior. | Add a policy check that rejects new raw header()/exit usage outside an allowlisted legacy boundary. |
| `DEBT-TOOLS-001` | P1 | open | release-engineering | Historical release scripts repeat identity, hashing, Windows path, UAI, OpenAPI, and packaging logic. | Move package building, UAI synchronization, changed-file calculation, and validation onto release_core beginning with v100.0.29. |
| `DEBT-DATA-001` | P1 | open | schema-governance | Some catalog invariants are encoded in consuming functions rather than machine-readable schemas and constructors. | Add JSON Schema checks for Starter Packs, featured personas, personality types, and representation routes. |
| `DEBT-JS-001` | P1 | open | front-end-modules | The large JavaScript surface has dependency knowledge partly represented by page flags and historical bundles. | Use the new AssetRegistry as the source of truth, then migrate one page family to ES modules without changing rendered behavior. |
| `DEBT-QUALITY-001` | P2 | open | static-analysis | Custom tests and lint exist, but there is no repository-wide PHPStan/Psalm baseline, JavaScript type check, or complexity budget. | Start PHPStan on src/, config/, and tests/ at a strict level before touching legacy includes. |
| `DEBT-OBS-001` | P2 | open | observability | Trace/request identifiers exist, but structured application events and invariant failures are not emitted through one interface. | Define event names and privacy classifications before adding any sink. |

## Persona-generation progress

The completed seam owns immutable generation boundaries, deterministic selection, name semantics, identity construction, and identity invariant checks. Public function signatures are unchanged. Ten fixture families prove exact identity-byte parity, normalized canonical-profile parity, and semantic parity against the packaged v100.0.29 baseline.

The inherited full raw generator remains clock-sensitive because `realismAudit.checkedAtUtc` is inserted before the profile fingerprint is calculated. That defect is a named follow-on item, not hidden by a misleading determinism claim.

Exact UAIX update URL: `https://uaix.org/en-us/tools/ai-memory-package-wizard/?memory=docs-folder&file-handoff=1&loops=1`
