Skip to content

Reduce WP Codebox to one contained runtime execution boundary #2429

Description

@chubes4

Problem

WP Codebox has a clear architectural boundary: materialize a contained WordPress runtime, execute controlled work, and return verifiable artifacts. Its implementation surface now also includes multiple workload systems, overlapping execution envelopes, cross-language contract copies, host orchestration, and runtime-specific deployment machinery.

Measured on main at v0.26.1:

  • runtime-core: 141 source files / 40,990 lines
  • runtime-playground: 95 source files / 44,571 lines
  • CLI: 61 source files / 26,787 lines
  • WordPress adapter: 81 PHP source files / 34,856 lines
  • 68 registered runtime commands
  • 654 distinct versioned wp-codebox/*/vN schema identifiers across TypeScript, PHP, and docs
  • 82 root package scripts and 190 root dependencies

The durable boundary in docs/architecture.md says Codebox is a runtime and artifact substrate, not a product, queue, evaluation harness, site generator, deploy service, or agent framework. The code should converge on that boundary.

Desired shape

One canonical typed execution request enters Codebox. Codebox selects one independently built runtime backend, enforces policy, materializes inputs, executes, captures a minimal verifiable artifact bundle, and returns one canonical typed result. Parent systems own jobs, retries, review, apply, promotion, publication, and product policy.

Host / Homeboy
  -> canonical execution request
    -> Codebox runtime boundary
      -> independently built runtime backend
    <- canonical result + artifact references + workspace delta
  -> review / verify / apply / publish

Runtime implementations may stay in this monorepo. Each runtime must have its own dependency graph, build, tests, package artifact, and release readiness gate. The main CLI should depend only on the runtime or runtimes it actually embeds.

Workstreams

Existing trackers

Acceptance criteria

  • The architecture map names one canonical request/result path and package ownership is mechanically enforced.
  • Each runtime can install, build, test, and package without installing unrelated runtime dependencies.
  • The main CLI artifact does not contain Cloudflare runtime code or dependencies.
  • Host adapters translate transports but do not independently orchestrate execution lifecycle.
  • Optional workload systems consume core contracts without expanding the mandatory core/CLI surface.
  • Known consumers use canonical contracts and obsolete aliases/paths are deleted.
  • Repository metrics show a material reduction in core, CLI, and WordPress-adapter maintenance surface.

AI assistance

  • Model: OpenAI gpt-5.6-sol
  • Tool: OpenCode
  • Used for: Inspected repository boundaries and measured source, contract, command, dependency, and test surfaces; searched existing issues; and drafted the consolidation tracker under Chris Huber's direction.

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