Skip to content

Commit ae9dbe1

Browse files
committed
Merge remote-tracking branch 'origin/main' into cook/generic-runtime-profile-compiler-20260619
# Conflicts: # tests/runtime-boundary-contracts.test.ts
2 parents 179e7f5 + 303efce commit ae9dbe1

59 files changed

Lines changed: 2736 additions & 203 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,204 @@
22

33
All notable changes to this project will be documented in this file. Entries are generated by homeboy from git commits.
44

5+
## [0.8.4] - 2026-06-19
6+
7+
### Changed
8+
- Add browser contained site open primitive
9+
- Add browser preview lifecycle contracts
10+
- Add RuntimeRunResult to run registry
11+
- Split neutral runtime contract shapes
12+
- Add browser contained site status primitives
13+
- Add browser recipe DTO
14+
- Support local browser runtime packages
15+
- Focus browser hydration fix
16+
- Add browser blueprint refs
17+
- Dedupe agent task extra plugins
18+
- Register provider runtime ability aliases
19+
- Defer extra plugin activation until after mount
20+
- Add Studio and Homeboy boundary contracts
21+
- Exit CLI after settled commands
22+
- Pass provider runtime contract to generic runs
23+
- Materialize workspace preload artifacts
24+
- Expose provider runtime invocation names
25+
- Enforce generic production boundary
26+
- Remove Data Machine runtime tool coupling
27+
- Propagate agent task extra plugins
28+
- Decouple WordPress browser diagnostics from generic probe
29+
- Normalize runtime failure envelopes
30+
- Expose generic ability runtime recipe preset
31+
- Add runtime preset registry
32+
- Add addressable run cancellation
33+
- Add generic ability runtime run primitive
34+
- Make agent normalizer compatibility explicit
35+
- Allow generic runtime episode payload fields
36+
- Add materialization result envelope
37+
- Allow advisory browser route drain
38+
- Resolve browser storage state refs from artifacts
39+
- Add browser storage state export command
40+
- Add runtime overlay descriptor discovery
41+
- Add source root preparation primitive
42+
- Extract structured artifact materializer
43+
- Add runtime run status transitions
44+
- Extract agent outcome classifier
45+
- Add command validation descriptors
46+
- Extract browser probe result builder
47+
- Extract browser ability descriptors
48+
- Extract recipe run result finalization
49+
- Extract agent runtime config resolver
50+
- Extract patch approval filter
51+
- Extract browser runner artifact templates
52+
- Extract host agent request preparation
53+
- Extract recipe site seed helpers
54+
- Extract agent sandbox runtime config helpers
55+
- Tighten primitive parity fixtures
56+
- Extract recipe run workflow evidence helpers
57+
- Add generic command agent runner
58+
- Add generic tool call artifact contract
59+
- Extract browser actions runner
60+
- Extract PHP agent run result builder
61+
- Deduplicate lifecycle PHP snippets
62+
- Extract recipe runtime setup helper
63+
- Extract recipe run artifact finalizers
64+
- Extract PHP agent process runner
65+
- Extract editor command runners
66+
- Extract browser probe runner
67+
- Consolidate utility primitives
68+
- Extract browser DOM snapshot primitive
69+
- Extract recipe benchmark artifact helpers
70+
- Remove duplicate parent-site seed export helpers
71+
- Expose reusable browser storage state
72+
- Extract recipe run phase executor
73+
- Expose browser waterfall artifacts
74+
- Split generic primitive contract tests
75+
- Extract browser visual compare runner
76+
- Adopt shared PHP path policy cleaners
77+
- Adopt run-plan helpers for PHP fanout
78+
- Document browser runtime primitive gap
79+
- Extract browser runner tool registration template
80+
- Adopt runtime dependency plan in materializers
81+
- Clean up brittle contract test helpers
82+
- Migrate remaining browser summaries to artifact sessions
83+
- Add generic runtime recipe resolver
84+
- Add generic browser task intent builder
85+
- Add signed browser callback contracts
86+
- Centralize prepared source package hydration
87+
- Migrate visual compare artifacts to sessions
88+
- Centralize runner runtime internals
89+
- Harden primitive contract parity guards
90+
- Extract generic run plan scheduler helpers
91+
- Extract browser runner metrics template helpers
92+
- Add generic browser provider connector bridge inheritance
93+
- Expand runtime dependency plan adoption
94+
- Refactor brittle tests around test kit helpers
95+
- Preserve runtime overlay schema library hints
96+
- Add browser materialization envelope primitive
97+
- Derive recipe policy command dependencies
98+
- Extract browser runner boot phase templates
99+
- Extract generic fanout run plan helpers
100+
- Add agent runtime invocation boundary
101+
- Migrate browser action artifacts to sessions
102+
- Align PHP tool policy descriptors
103+
- Introduce runtime dependency plan contract
104+
- Add generic recipe source package primitives
105+
- Add fixture import bootstrap primitives
106+
- Add generic runtime overlay bundle primitive
107+
- Add fixture auth storage state helper
108+
- Add generic host command runner evidence
109+
- Load tool policy normalizer in browser task test
110+
- Add generic evidence artifact envelope
111+
- Normalize sandbox tool policies from allowed tools
112+
- Add connector credential resolver registry
113+
- Add browser-local task defaults
114+
- Add executable browser DTO and persisted artifact bundle result
115+
- Centralize preview topology diagnostics
116+
- Share bench command step primitives
117+
- Trust component manifest entrypoints
118+
- Add runtime tool policy resolver
119+
- Add PHP JSON codec primitive
120+
- Add generic editor save action primitive
121+
- Add recipe run result envelope
122+
- Add MCP client config renderer
123+
- Bridge agent task status taxonomies
124+
- Add browser artifact session primitive
125+
- Add browser task builder primitive
126+
- Add browser artifact lifecycle refs
127+
- Add browser provider bridge policy primitive
128+
- Consolidate PHP host command callsites
129+
- Align PHP path policy with runtime core
130+
- Add shared redaction policy profiles
131+
- Add shared artifact and mount path primitives
132+
- Guard task input schema parity
133+
- Harden redacted artifact capture
134+
- Normalize agent task run results
135+
- Add managed host command wrapper
136+
- Extract host command executor into runtime core
137+
- Add core artifact capture policy
138+
- Clarify generic runtime contract authority
139+
- Use registry metadata for command dispatch
140+
- Clean up reviewer access auth planning
141+
- Add generic runtime primitive contracts
142+
- Add runtime backend provider recipe hooks
143+
- Tighten bootstrap component manifest boundary
144+
- Consolidate smoke test harness helpers
145+
- Extract recipe source boundary helpers
146+
- Make browser artifact persistence idempotent
147+
- Add shared runtime redaction primitive
148+
- Align browser probe command contract
149+
- Centralize artifact layout writer primitives
150+
- Share command arg parsing primitives
151+
- Centralize sandbox PHP template fragments
152+
- Add shared file tree policy helpers
153+
- Add backend package adapter registry
154+
- Add agent terminal result contract
155+
- Harden agent workload envelope boundary
156+
- Neutralize core fixture docs
157+
- Add command artifact schema contracts
158+
- Centralize artifact redaction writes
159+
- Centralize runtime env secret handling
160+
- Extract prepared source staging primitive
161+
- Add runtime overlay registry seam
162+
- Decouple agent sandbox stack flags
163+
- Add core command argument codecs
164+
- Add runtime command result envelopes
165+
- Add component plugin entrypoint contract
166+
- Add runtime backend registry
167+
- Make transfer proof private hosts configurable
168+
- Validate recipe schema during ingestion
169+
- Centralize generated PHP snippets
170+
- Add artifact bundle writer
171+
- Align task input agent bundle contract
172+
- Clean up host boundary leaks
173+
- List recipe commands from registry in help
174+
- Preserve caller cwd in source CLI entrypoint
175+
- Document the agent runtime contract
176+
- Add source checkout CLI entrypoint
177+
- Improve PHP execution failure diagnostics
178+
- Add typed recipe artifact materialization
179+
- Capture hidden Playground crash diagnostics
180+
- Improve runtime overlay validation diagnostics
181+
- Bridge runtime ability tools
182+
- Document Codex cookbook provider stack
183+
- Improve Playground crash diagnostics
184+
- Add agent runtime diagnostics summary
185+
- Add Playground bundle artifact to replay packages
186+
187+
### Fixed
188+
- Fix browser blueprint REST hydration
189+
- Fix check smoke blockers
190+
- Fix Agents API execution target registration
191+
- Fix evidence bundle identity and recipe artifacts
192+
- Fix browser runner template harness
193+
- Fix browser provider request permission
194+
- Fix safe VFS mount materialization
195+
- Fix backend registry schema validation
196+
- Fix artifact redaction for large inputs
197+
- Fix routed preview host handling
198+
- Fix artifact collection for cyclic browser errors
199+
- fix runtime ability lifecycle smoke
200+
- fix runtime component ability lifecycle replay
201+
- map package.json version targets to their artifact paths for deploy verification
202+
5203
## [0.8.3] - 2026-06-15
6204

7205
### Changed

README.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,23 +1015,21 @@ Boot a sandbox with caller-supplied runtime components mounted, then verify the
10151015

10161016
```bash
10171017
npm run wp-codebox -- agent-runtime-probe \
1018-
--component agents-api=../agents-api \
1019-
--component data-machine=../data-machine \
1020-
--component data-machine-code=../data-machine-code \
1018+
--component agent-runtime=../agent-runtime \
1019+
--component runtime-tools=../runtime-tools \
10211020
--json
10221021
```
10231022

1024-
Use `--component <slug>=<path>` for each runtime component your sandbox needs. The legacy `--agents-api`, `--data-machine`, and `--data-machine-code` flags remain accepted as compatibility aliases, but new automation should use `--component` so WP Codebox core stays portable across agent stacks.
1023+
Use `--component <slug>=<path>` for each runtime component your sandbox needs. This is the neutral replacement for component-specific aliases; new automation should use `--component` so WP Codebox core stays portable across agent stacks.
10251024

10261025
### `agent-sandbox-run`
10271026

10281027
Run one natural-language task through a sandboxed agent stack.
10291028

10301029
```bash
10311030
npm run wp-codebox -- agent-sandbox-run \
1032-
--component agents-api=../agents-api \
1033-
--component data-machine=../data-machine \
1034-
--component data-machine-code=../data-machine-code \
1031+
--component agent-runtime=../agent-runtime \
1032+
--component runtime-tools=../runtime-tools \
10351033
--agent sandbox-agent \
10361034
--task "Add a Dry Rub filter to the wing locations map" \
10371035
--provider example-ai \
@@ -1056,9 +1054,8 @@ Run several task descriptions, one isolated sandbox per task, with bounded concu
10561054

10571055
```bash
10581056
npm run wp-codebox -- agent-sandbox-batch \
1059-
--component agents-api=../agents-api \
1060-
--component data-machine=../data-machine \
1061-
--component data-machine-code=../data-machine-code \
1057+
--component agent-runtime=../agent-runtime \
1058+
--component runtime-tools=../runtime-tools \
10621059
--task "Fix issue A" \
10631060
--task "Investigate issue B" \
10641061
--concurrency 2 \
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Browser Parent-Tool Bridge Next PR
2+
3+
This PR intentionally stops at executable blueprint refs and runtime profile application.
4+
5+
The next parent-tool bridge seam should define one bounded contract for browser sandboxes to request parent-owned tools without receiving parent credentials. The contract should cover:
6+
7+
- A product-safe request envelope, for example `wp-codebox/browser-parent-tool-request/v1`, with `tool`, `operation`, opaque `input`, `sandbox_session_id`, `caller_session_id`, and authorization context.
8+
- A parent-side ability or adapter hook that executes the requested tool and returns a redacted response envelope.
9+
- A browser-side bridge descriptor that can be passed through task input without embedding secrets.
10+
- Tests proving redaction, authorization failure, and opaque product payload preservation.
11+
12+
Keep executable blueprint hydration on `wp-codebox/hydrate-browser-blueprint-ref`; do not couple parent-tool execution to blueprint storage.

docs/generic-runtime-primitives.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ product or job system.
1010
`packages/runtime-core/src/materialization-contracts.ts`, and
1111
`packages/runtime-core/src/evidence-artifact-envelope.ts`, and
1212
`packages/runtime-core/src/runtime-overlay-bundle.ts`, and
13+
`packages/runtime-core/src/provider-runtime-contracts.ts`, and
1314
`packages/runtime-core/src/command-agent-run.ts`.
1415
- Coverage lives in `tests/generic-primitives.test.ts` and
1516
`tests/command-agent-run.test.ts`.
@@ -162,3 +163,20 @@ Example recipe step:
162163
]
163164
}
164165
```
166+
167+
## Provider Runtime Invocation Contract
168+
169+
`buildGenericAbilityRuntimeRunRecipe()` includes
170+
`runtime_invocation.provider_runtime_contract` in the ability input. The contract
171+
is the generic runtime-provider handshake introduced by PR #1205: workspace
172+
capture, workspace command execution, workspace publication, tool-call transcript
173+
recording, artifact handoff, and runtime evidence result schemas.
174+
175+
WP Codebox owns the names and schemas. Callers own policy: repository selection,
176+
authorization, retries, retention, publication approval, and how resulting refs
177+
are attached to their job records.
178+
179+
The contract intentionally uses `wp-codebox.runner-workspace.*`,
180+
`wp-codebox.tool-call-transcript.record`, and `wp-codebox.artifact-handoff`
181+
names. Downstream product names and orchestration policy stay outside the
182+
runtime invocation payload.

docs/sandbox-session-contract.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,66 @@ registers runtime-principal authorization. If the runner is copied into a normal
5252
host WordPress install, it fails with `wp_codebox_browser_runner_not_playground`
5353
instead of executing the requested sandbox invocation.
5454

55+
## Browser Contained Site Handle
56+
57+
Browser session, materializer, and task contracts include an additive durable
58+
handle for caller-owned preview recovery:
59+
60+
```json
61+
{
62+
"contained_site": {
63+
"schema": "wp-codebox/browser-contained-site/v1",
64+
"site_id": "prepared-a1b2c3d4e5f6a7b8",
65+
"preview_id": "preview-1234abcd5678ef90",
66+
"session_id": "browser-session-123",
67+
"caller_id": "studio-native",
68+
"status": "ready",
69+
"persistence": "browser-contained",
70+
"source_digest": {
71+
"algorithm": "sha256",
72+
"value": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
73+
},
74+
"recovery": {
75+
"ability": "wp-codebox/get-browser-contained-site-status",
76+
"input": {
77+
"cache_key": "prepared-a1b2c3d4e5f6a7b8",
78+
"input_hash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
79+
"source_digest": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
80+
}
81+
}
82+
}
83+
}
84+
```
85+
86+
The handle is intentionally a primitive, not a parent-product lifecycle table.
87+
`site_id` is stable for the caller plus normalized runtime/source inputs, and
88+
`preview_id` is stable for the contained site plus browser session. The
89+
`source_digest` is the prepared-runtime `input_hash` when available, or a stable
90+
hash of the browser runtime, blueprint, site blueprint artifact, and Playground
91+
version inputs.
92+
93+
Call `wp-codebox/get-browser-contained-site-status` with `cache_key` or `site_id`
94+
plus `input_hash` or `source_digest` to check whether WP Codebox can recover the
95+
prepared-runtime blueprint from its transient cache:
96+
97+
```json
98+
{
99+
"success": true,
100+
"schema": "wp-codebox/browser-contained-site-status/v1",
101+
"site_id": "prepared-a1b2c3d4e5f6a7b8",
102+
"status": "recoverable",
103+
"blueprint_ref": {
104+
"schema": "wp-codebox/browser-blueprint-ref/v1",
105+
"ref": "prepared:prepared-a1b2c3d4e5f6a7b8:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
106+
}
107+
}
108+
```
109+
110+
Status is idempotent and read-only. `recoverable` means the prepared runtime
111+
transient exists and can hydrate a blueprint ref. `miss` means the caller should
112+
create a new browser session from the same inputs. Durable ownership, UI state,
113+
and retry policy still belong to the parent control plane.
114+
55115
## Browser Provider Adapter Contract
56116

57117
Browser Playground provider calls that need parent-side connector authorization

examples/agent-runtime/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ Set local checkout paths, then run the preset:
66

77
```bash
88
AGENTS_API_PATH=/path/to/agents-api \
9-
DATA_MACHINE_PATH=/path/to/data-machine \
10-
DATA_MACHINE_CODE_PATH=/path/to/data-machine-code \
9+
RUNTIME_ENGINE_PATH=/path/to/runtime-engine \
10+
RUNTIME_TOOLS_PATH=/path/to/runtime-tools \
1111
PROVIDER_PLUGIN_PATH=/path/to/ai-provider-plugin \
1212
npm run wp-codebox -- agent-runtime-probe \
1313
--component agents-api="$AGENTS_API_PATH" \
14-
--component data-machine="$DATA_MACHINE_PATH" \
15-
--component data-machine-code="$DATA_MACHINE_CODE_PATH" \
14+
--component runtime-engine="$RUNTIME_ENGINE_PATH" \
15+
--component runtime-tools="$RUNTIME_TOOLS_PATH" \
1616
--provider-plugin "$PROVIDER_PLUGIN_PATH" \
1717
--artifacts ./artifacts \
1818
--json
1919
```
2020

21-
The preset mounts each `--component` at its declared slug, uses WordPress `7.0` by default, activates the plugins in dependency order, and returns a JSON readiness packet. It intentionally does not require provider credentials or model calls. Legacy stack-specific flags such as `--agents-api` still work as compatibility aliases; new examples should prefer generic `--component` entries.
21+
The preset mounts each `--component` at its declared slug, uses WordPress `7.0` by default, activates the plugins in dependency order, and returns a JSON readiness packet. It intentionally does not require provider credentials or model calls. Stack-specific shortcuts should be replaced with generic `--component` entries.

0 commit comments

Comments
 (0)