Skip to content

Migrate model layer to b8 models (release/2.3.5) #525

Description

@sultann

Goal

Migrate the model layer from pluginever/framework-model to byteever/models (b8) as an isolated release ahead of the framework swap. The model migration is the highest-risk change in the b8 transition (silent query-result regressions), so it ships first, alone, on stable master with the public contract frozen — single suspect, clean rollback target. This also de-risks the later framework release, which will then touch zero model files.

Version

release/2.3.5 off master (2.3.4). Contract-frozen, user-invisible internal change.

Sequencing context

  1. 2.3.5 (this) — framework-model → b8 models, bytekit-plugin still booting, namespace frozen.
  2. 2.4.0 (next) — framework swap to b8 plugin, built on top of this (stacked, not rebased).
  3. @next — namespace rename + REST + reorg.

In scope

  • src/ → includes/ consolidation (pure move; namespace unchanged; drop src/ from composer autoload). Aligns layout with the framework release so it inherits the layout conflict-free.
  • Port the baseline test suite (from tests/phpunit-baseline, bytekit-native harness) + the ContractTest from release/2.4.0. Establishes "where we are" before migrating.
  • Add byteever/models (dev-trunk for now) + Strauss config; convert Model/Key/Activation from Lib\Model to b8 Model.
  • Preserve the contract: wcsn_* public functions and Key::query() callable with the same args (incl. paged, now honored by the package). No schema change — same tables, columns, cache groups.
  • Minimal esbuild + sass build swap, same output paths (no flatten), autoprefixer via postcss-cli --use autoprefixer (browserslist in package.json, no extra config file).
  • Models-specific tests: result-equivalence (old vs new Key, identical results) and pagination (Key::query(['paged'=>N]) advances).

Out of scope (kept for later releases)

  • Framework swap (stays bytekit-plugin) · namespace rename · REST API · deprecated.php consolidation.

Release gate

  • Baseline + Contract + equivalence + pagination tests green.
  • Built-zip admin smoke test (the build swap's failure surface).
  • 4-way matrix with shipped pro zips (1.4.6, 1.5.0); specifically exercise the key export tool (the one direct Key::query consumer, the paged path).
  • Before tagging: cut byteever/models 1.0.0, pin it (drop dev-trunk).

Commit order

  1. src/ → includes/ move + autoload
  2. test harness + baseline suite + ContractTest (green on framework-model)
  3. composer: byteever/models + Strauss
  4. model migration (Model/Key/Activation)
  5. equivalence + pagination tests (green on b8 models)
  6. build swap (esbuild/sass/autoprefixer)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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