Skip to content

fix: stop the browser runtime from hardcoding consumer component names (#633)#636

Merged
chubes4 merged 1 commit into
mainfrom
fix-layer-purity-runtime-bridge
Jun 5, 2026
Merged

fix: stop the browser runtime from hardcoding consumer component names (#633)#636
chubes4 merged 1 commit into
mainfrom
fix-layer-purity-runtime-bridge

Conversation

@chubes4
Copy link
Copy Markdown
Collaborator

@chubes4 chubes4 commented Jun 4, 2026

Summary

Closes the layer-purity leak in #633's primary location: the browser runtime hardcoded the names of downstream consumers (agents-api, data-machine, data-machine-code) — including pinned Extra-Chill/ GitHub release-zip URLs — and hardcoded the required-component set to the same trio. A generic sandbox substrate must not name the plugins that consume it, nor where to fetch them.

The fix (config, not code)

trait-wp-codebox-abilities-browser-runtime.php:

  • browser_runtime_component_registry() now defaults to an empty map. The registry is supplied entirely via the existing wp_codebox_browser_runtime_component_registry filter.
  • The required-component set is now supplied via a new wp_codebox_browser_runtime_required_components filter (default empty), replacing the hardcoded array( 'agents-api', 'data-machine', 'data-machine-code' ).

Consumers register their own agent-stack components + release sources through these filters — the integration layer owns those names. (For the Extra Chill platform, that registration lives in the integration plugin; a companion PR wires it there.)

After this change:

grep -riE 'data-machine|extra-chill' packages/wordpress-plugin/src/trait-wp-codebox-abilities-browser-runtime.php
→ (no matches)

Tests

Updated tests/smoke-wordpress-plugin.php to register the canonical components via the two filters at setup — mirroring real consumer wiring rather than relying on hardcoded substrate defaults. The full WordPress plugin smoke passes:

OK (419 assertions)

Scope note (honest)

This PR fixes the registry + required-slugs seam — the cleanest, most clearly config-able part of #633. The remaining data-machine references in the agent-runner / execution / pending-actions paths (trait-wp-codebox-abilities-browser-runner.php, trait-wp-codebox-abilities-execution.php, class-wp-codebox-agent-sandbox-runner.php, class-wp-codebox-data-machine-pending-actions.php — notably the \DataMachine\Engine\AI\LoopEventSinkInterface coupling and data_machine result-metadata keys) are more entangled and are left as tracked follow-ups under #633 rather than bundled here.

Refs #633.

The browser runtime component registry shipped agents-api / data-machine /
data-machine-code as built-in defaults — including pinned Extra-Chill release
zip URLs — and the required-component set was hardcoded to the same trio. A
generic sandbox substrate must not name the downstream plugins that consume it
nor where to fetch them; doing so means adding a runtime consumer requires
editing the substrate.

Make both seams config-driven:

- browser_runtime_component_registry() now defaults to an empty map and is
  populated solely via the existing wp_codebox_browser_runtime_component_registry
  filter.
- The required-component set is now supplied via a new
  wp_codebox_browser_runtime_required_components filter, defaulting to empty,
  instead of a hardcoded array.

Consumers register their own agent-stack components + release sources through
these filters (the integration layer owns those names). Update the WordPress
plugin smoke to register the canonical components via the filters at setup,
mirroring real consumer wiring; full suite passes (419 assertions).

Refs the layer-purity audit: trait-wp-codebox-abilities-browser-runtime.php is
now clean of consumer names; the remaining data-machine references in the
agent-runner / execution / pending-actions paths are tracked separately.
@chubes4 chubes4 merged commit 955c868 into main Jun 5, 2026
chubes4 added a commit to Extra-Chill/extrachill-roadie that referenced this pull request Jun 5, 2026
…ime (#45)

WP Codebox is dropping its hardcoded browser-runtime component defaults
(Automattic/wp-codebox#636) so the generic substrate stops naming the plugins
that consume it. Roadie is the integration layer that legitimately knows both
the Extra Chill agent stack and wp-codebox — its recipe builder already mounts
that stack — so it is the correct place to declare the runtime's required
components and their release sources.

Register agents-api / data-machine / data-machine-code via the new
wp_codebox_browser_runtime_required_components and
wp_codebox_browser_runtime_component_registry filters. These mirror the on-disk
stack roadie mounts via wp_codebox_component_paths; the registry provides the
release-zip fallback wp-codebox uses when a component is not already on disk.

Refs Automattic/wp-codebox#633.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant