Skip to content

S-03 Phase 1 — UEC legacy removal + platform naming migration: INVENTORY (report-only, awaiting Max approval for Phase 2) #90

Description

@MaximillianGroup

Authority: SPARXSTAR-Engineering-Standards-v1.0 §6.2 (PascalCase classes, Sparxstar prefix for platform classes, file name matches class) + Max's direction. Post-S-01 hold on S-03 is lifted.

Sequencing: the gate consolidation PR (#89) merged (9cf75d9) — the S-03 hard gate ("do not start before the gate PR merges") is satisfied. This is Phase 1 (discovery only — no code changes). Phase 2 (execute) does not start until Max approves the rename map + delete list below.

Method: git grep / ripgrep sweep over merged main (9cf75d9). Counts exclude GATE-AUDIT-PAM003.md.


0. Headline: this is two parallel plugins, not one

There are two active entrypoints:

Entrypoint Plugin Name Text Domain Bootstraps Lineage
sparxstar-sirus-context.php SPARXSTAR Sirus — Context Engine sparxstar-sirus \Starisian\Sparxstar\Sirus\SirusPlugin (getInstance/onActivation) live
sparxstar-user-environment-check.php SPARXSTAR User Environment Check sparxstar-user-environment-check Starisian\SparxstarUEC\SparxstarUserEnvironmentCheck::spx_uec_get_instance() + SparxstarUECInstaller::spx_uec_activate/deactivate legacy (UEC)

"UEC legacy removal" therefore = deciding the fate of the entire legacy entrypoint + its UEC class tree + its stored data, not just renaming classes. Decision for Max: is the legacy entrypoint retired entirely, or kept as a thin shim? (see §4).

1. Reference inventory (by category)

Identifier Files
SparxstarUEC (any) 52
Starisian\SparxstarUEC namespace 47
"Sparxstar User Environment Check" (string) 2
SirusPlugin 6
StarUserEnv (frozen facade) 22
UECCompatibilityShim 4
SirusUserEnv 0 — does not exist (see §6)

2. Legacy UEC class set (src/) — proposed classification (DRAFT, pending Max)

All in namespace Starisian\SparxstarUEC\*. Classification axis: superseded by Sirus/StarUserEnv (DELETE) vs live functionality with no Sirus equivalent (RENAME).

Class / file Proposed Rationale / flag
src/SparxstarUserEnvironmentCheck.php DELETE (with entrypoint) Legacy plugin main class; superseded by SirusPlugin. Tied to legacy entrypoint retirement.
src/core/SparxstarUECInstaller.php DELETE Owns spx_uec_activate/deactivate + table creation (sparxstar_uec_snapshots). Wire/data-adjacent — see §5.
src/core/SparxstarUECKernel.php DELETE Legacy bootstrap kernel; Sirus uses SirusPlugin.
src/core/SparxstarUECDatabase.php REVIEW Owns sparxstar_uec_db_version option + snapshot table. Data-adjacent.
src/core/SparxstarUECSnapshotRepository.php REVIEW Snapshot storage — does Sirus have an equivalent? Needs Max.
src/services/SparxstarUECGeoIPService.php RENAME? Live GeoIP; owns options sparxstar_uec_geoip_provider, _ipinfo_api_key, _maxmind_db_path. No obvious Sirus equivalent → likely RENAME, but option keys are data-adjacent (§5).
src/includes/SparxstarUECSessionManager.php REVIEW Session handling; check Sirus overlap.
src/includes/SparxstarUECCacheHelper.php REVIEW Cache helper; check ContextCache overlap.
src/core/SparxstarUECAssetManager.php REVIEW Asset enqueue; Sirus has its own enqueueAssets.
src/admin/SparxstarUECAdmin.php REVIEW Settings UI bound to the sparxstar_uec_* options + register_setting.
src/api/SparxstarUECRESTController.php REVIEW REST routes — namespace is wire-adjacent (§5).
src/cron/SparxstarUECScheduler.php REVIEW Cron; check Sirus cron hooks overlap.

docs/php/SparxstarUEC*.md (12 files) follow their classes. tests/unit/SparxstarUEC*Test.php (6) follow theirs.

3. Confirmed renames (Max-specified)

Old New Status
src/SirusPlugin.phpSparxstarSirusContext.php; class SirusPluginSparxstarSirusContext ✅ actionable SirusPlugin referenced in 6 files incl. the live entrypoint sparxstar-sirus-context.php:45-51 (activation/deactivation/getInstance) — all must update.
SirusUserEnv.phpSparxstarSirusEnv.php BLOCKED — target does not exist See §6.

4. Frozen facade / shim — needs Max's explicit call (issue's own guardrail)

  • src/StarUserEnv.php — the frozen facade, deliberately kept in the legacy namespace Starisian\SparxstarUEC;, delegating to Sirus ContextEngine.
  • src/integrations/UECCompatibilityShim.php — exists specifically to keep the old Starisian\SparxstarUEC namespace working via class aliases.
  • The only Sirus-namespace file referencing SparxstarUEC is the shim → the live engine is cleanly separated, bridged only by facade+shim.

Renaming the SparxstarUEC namespace or StarUserEnv breaks the exact contract the shim preserves. Per the issue, these need Max's explicit decision: keep the facade+shim frozen (recommended — that's their purpose), or retire the back-compat surface and accept the break.

5. Wire-adjacent items — one decision per line (renaming silently orphans data/integrations)

Item Value Type Implication if renamed
Option sparxstar_uec_geoip_provider wp_options Orphans stored GeoIP provider setting
Option sparxstar_uec_ipinfo_api_key wp_options Orphans stored API key
Option sparxstar_uec_maxmind_db_path wp_options Orphans stored DB path
Option sparxstar_uec_db_version wp_options Schema-version tracking; rename needs migration
Table sparxstar_uec_snapshots (SPX_ENV_CHECK_DB_TABLE_NAME) DB table Renaming orphans stored snapshot rows
Constants SPX_UEC_LOADED, SPX_ENV_CHECK_* (dual-defined) PHP constants Internal; safe but note dual SPX_UEC_*/SPX_ENV_CHECK_*
Text domain sparxstar-user-environment-check / sparxstar_user_environment_check i18n Translations keyed to it; differs from Sirus sparxstar-sirus
REST SparxstarUECRESTController routes HTTP namespace Wire contract — any client/integration breaks; enumerate routes before deciding
Hooks spx_uec_activate / spx_uec_deactivate (+ cron hooks) registered hooks Activation callbacks; safe if entrypoint retired together

None of §5 is find-and-replace. Each is a Max decision: migrate-with-shim, dbDelta rename + data migration, or leave as-is.

6. ⛔ Discrepancy: SirusUserEnv.php does not exist

The Max-specified rename #2 (SirusUserEnv.php → SparxstarSirusEnv.php) has no matching file (0 references). Nearest candidates:

  • src/StarUserEnv.php — the frozen facade (§4). Renaming it is exactly what §4 says needs Max's call.
  • src/SparxstarUserEnvironmentCheck.php — legacy main class (proposed DELETE).

Need Max to confirm the intended target of rename #2 (likely StarUserEnvSparxstarSirusEnv?), noting it is the frozen facade.

7. DRAFT rename map + delete list (for Max's approval — Phase 2 gate)

Renames (confident):

  • Starisian\Sparxstar\Sirus\SirusPlugin…\SparxstarSirusContext (src/SirusPlugin.phpsrc/SparxstarSirusContext.php); update sparxstar-sirus-context.php + 5 other refs.

Renames (pending Max — facade/wire):

Delete list (pending Max — legacy entrypoint retirement):

  • sparxstar-user-environment-check.php + src/SparxstarUserEnvironmentCheck.php + the superseded SparxstarUEC* core classes (§2) + their docs/php/*.md + tests/unit/SparxstarUEC*Test.php, only for classes confirmed superseded and whose data (§5) is migrated or discarded by decision.

8. Open decisions for Max (blocking Phase 2)

  1. Retire the legacy UEC entrypoint entirely, or keep a thin compat entrypoint?
  2. Keep StarUserEnv + UECCompatibilityShim frozen (recommended), or retire the back-compat surface?
  3. Confirm rename Add Sirus Observability Layer: events table, REST ingest, admin dashboard, multisite access control, JS capture, adaptive mitigation rules, security hardening, compiled aggregation, stabilized directive engine, nonce-protected event ingest, and product... #2's real target (§6).
  4. Per §5: for each option key / the snapshot table / REST namespace — migrate (with data migration), or leave under legacy names?
  5. Which §2 "REVIEW" classes are superseded by Sirus (DELETE) vs live (RENAME)?

Cross-platform note: the same sweep almost certainly applies to Helios (StarUserEnv shares the S-00 lineage). This inventory doubles as the template for the Helios audit.

Phase 2 will be one PR — renames + deletions only, no behavior changes; composer.json PSR-4 updated; composer dump-autoload clean; tests updated; grep SparxstarUEC / old class names returns nothing except CHANGELOG — once this map is approved.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions