Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ The reusable workflow declares the expected typed review artifacts for Docs Agen

The target repository grants `contents: write`, `pull-requests: write`, and `issues: write`. Docs Agent forwards the caller-scoped `${{ github.token }}` to WP Codebox for same-repository publication, so consumers do not configure `ACCESS_TOKEN`. `OPENAI_API_KEY` is an optional workflow secret and is required only for a live OpenAI run; skipped and dry-run calls do not require it. `EXTERNAL_PACKAGE_SOURCE_POLICY` remains a separate required v1 JSON secret. Migrate its value to the exact one-line JSON in the root README: it authorizes the selected Docs Agent package, the pinned Agents API component, the pinned PHP AI Client overlay, and the checksum-pinned OpenAI provider artifact. Both secrets are forwarded to WP Codebox without serialization into the task descriptor.

Docs Agent consumes the reusable WP Codebox workflow and helper implementation at accepted immutable revision `a6fe2d208e990a8d04104aa74aacbb8d1539fbc1` and passes `wp_codebox_release_ref: v0.12.29` only for released packaged runtime assets. The release tag resolves to immutable revision `bc982947ec33c78160125026e16d357b7ece3ea1`, distinct from both the workflow producer revision and the fixed Docs Agent package revision. WP Codebox materializes the declared native runtime closure, executes the selected package, applies bounded workspace changes, runs verification, and publishes approved host changes. The released assets are `01-wp-codebox.zip` and `02-wp-codebox-workspace-0.12.29.tgz`; the private package-recovery manifest is intentionally not a reviewer asset.
Docs Agent consumes the reusable WP Codebox workflow and helper implementation at immutable revision `126f85b2a8b887ae8e2457d1cb71b15ebdb712cd` and passes `wp_codebox_release_ref: v0.33.4` and `wp_codebox_workflow_ref: 126f85b2a8b887ae8e2457d1cb71b15ebdb712cd`. That revision is the commit the annotated `v0.33.4` tag resolves to, so the reusable workflow, its helper scripts, and the release tag all name the same producer code; the fixed Docs Agent package revision stays separate. WP Codebox checks that the helper checkout matches `wp_codebox_workflow_ref` and that its `package.json` version equals the release tag, then installs its runtime from that checkout. WP Codebox materializes the declared native runtime closure, executes the selected package, applies bounded workspace changes, runs verification, and publishes approved host changes. The v0.33.4 release assets are `wp-codebox-cli-linux-x64.tar.gz`, `wp-codebox-workspace-0.33.4.tgz`, and `wp-codebox.zip`; `tests/wp-codebox-release.fixture.json` records their published SHA-256 digests.

Provider artifacts retain only allowlisted review artifacts, controlled workflow envelopes, and canonical runtime-source and seed provenance. WP Codebox v0.12.24 uploads a reviewer-safe workflow-result projection: public control, verification, publication, output-projection, access, failure, artifact-declaration, and canonical transcript-provenance fields remain, while raw `runtime_result`, `outputs.engine_data`, model/provider/tool payloads, source content, private paths, and secrets are excluded. Before persistence or upload, it sanitizes private runtime paths from nested values, object keys, diagnostics, and command arguments. WP Codebox captures one trusted canonical `codebox-transcript` through a pre-sanitization reviewer-evidence descriptor, validates its artifact-root containment, schema, digest, and size, then emits the compact reviewer transcript as a `wp-codebox/reviewer-agent-transcript/v1` projection. Before apply-back, it compares the seed identity with the host workspace identity; rejected patches preserve the expected and actual identities plus patch and changed-file evidence for upload. Its pre-redaction trusted apply input preserves machine-applicable patch bytes in a private channel that is removed before durable artifact sanitization, as fixed in [WP Codebox #1842](https://github.com/Automattic/wp-codebox/pull/1842). The canonical transcript remains the bounded tool-observability surface. Lifecycle and downstream failures retain runtime evidence in their internal normalized failed result even when artifact preparation cannot complete. Diagnostic messages that name runtime classes remain reviewable, while PHP-shaped runtime source remains blocked. See [WP Codebox #1767](https://github.com/Automattic/wp-codebox/issues/1767), [WP Codebox #1814](https://github.com/Automattic/wp-codebox/issues/1814), [WP Codebox #1815](https://github.com/Automattic/wp-codebox/pull/1815), and [WP Codebox #1823](https://github.com/Automattic/wp-codebox/pull/1823). Successful canonical reviewer-evidence reference: [run `29350690551`](https://github.com/Automattic/build-with-wordpress/actions/runs/29350690551). The [hosted failure `29468956857`](https://github.com/Automattic/agents-api/actions/runs/29468956857) executed WP Codebox v0.12.20, published [Agents API #430](https://github.com/Automattic/agents-api/pull/430), then failed during upload preparation; it motivated #1814/#1815 and is not a successful v0.12.24 reviewer-safe workflow-result run.
Provider artifacts retain only allowlisted review artifacts, controlled workflow envelopes, and canonical runtime-source and seed provenance. WP Codebox uploads a reviewer-safe workflow-result projection: public control, verification, workspace-apply, publication, output-projection, access, failure, artifact-declaration, and canonical transcript-provenance fields remain, while raw `runtime_result`, `outputs.engine_data`, model/provider/tool payloads, source content, private paths, and secrets are excluded. Before persistence or upload, it sanitizes private runtime paths from nested values, object keys, diagnostics, and command arguments. WP Codebox captures one trusted canonical `codebox-transcript` through a pre-sanitization reviewer-evidence descriptor, validates its artifact-root containment, schema, digest, and size, then emits the compact reviewer transcript as a `wp-codebox/reviewer-agent-transcript/v1` projection. Before apply-back, it compares the seed identity with the host workspace identity; rejected patches preserve the expected and actual identities plus patch and changed-file evidence for upload. Its pre-redaction trusted apply input preserves machine-applicable patch bytes in a private channel that is removed before durable artifact sanitization, as fixed in [WP Codebox #1842](https://github.com/Automattic/wp-codebox/pull/1842). Lifecycle and downstream failures retain runtime evidence in their internal normalized failed result even when artifact preparation cannot complete. Diagnostic messages that name runtime classes remain reviewable, while PHP-shaped runtime source remains blocked. See [WP Codebox #1767](https://github.com/Automattic/wp-codebox/issues/1767), [WP Codebox #1814](https://github.com/Automattic/wp-codebox/issues/1814), [WP Codebox #1815](https://github.com/Automattic/wp-codebox/pull/1815), and [WP Codebox #1823](https://github.com/Automattic/wp-codebox/pull/1823). Successful canonical reviewer-evidence reference: [run `29350690551`](https://github.com/Automattic/build-with-wordpress/actions/runs/29350690551). The [hosted failure `29468956857`](https://github.com/Automattic/agents-api/actions/runs/29468956857) executed WP Codebox v0.12.20, published [Agents API #430](https://github.com/Automattic/agents-api/pull/430), then failed during upload preparation; it motivated #1814/#1815.

WP Codebox v0.12.25 excludes Git-ignored verification artifacts such as pnpm's symlinked `node_modules` tree from publication integrity snapshots while continuing to reject tracked or otherwise publishable symlinks. This allows dependency installation during verification without weakening the bounded workspace publication contract; see [WP Codebox #1845](https://github.com/Automattic/wp-codebox/pull/1845).
Publication integrity snapshots exclude Git-ignored verification artifacts, such as pnpm's symlinked `node_modules` tree, and mutable `.codebox` runtime control files, while tracked or otherwise publishable symlinks stay rejected. Integrity failures report bounded added, modified, and deleted paths, and non-Git workspaces keep a bounded filesystem snapshot fallback. Canonical GitHub repository identity is compared case-insensitively, while pull-request URL, pull number, target binding, and API resolution checks stay strict. Successful pull-request verification returns `{ valid: true }` without a failure-only `error`. These came from [WP Codebox #1845](https://github.com/Automattic/wp-codebox/pull/1845), [#1848](https://github.com/Automattic/wp-codebox/pull/1848), [#1852](https://github.com/Automattic/wp-codebox/pull/1852), [#1875](https://github.com/Automattic/wp-codebox/pull/1875), and [#1885](https://github.com/Automattic/wp-codebox/pull/1885).

WP Codebox v0.12.26 restores the unconditional exclusion for mutable `.codebox` runtime control files, preventing task request and result state from invalidating an approved workspace snapshot. Publishable workspace files remain governed by Git tracking and ignore semantics; see [WP Codebox #1848](https://github.com/Automattic/wp-codebox/pull/1848).
WP Codebox v0.33.4 makes the runner-workspace apply step observable; see [WP Codebox #2588](https://github.com/Automattic/wp-codebox/pull/2588) and [WP Codebox #2567](https://github.com/Automattic/wp-codebox/issues/2567). Earlier revisions could finish a run with agent writes that never reached the host workspace, and the uploaded transcript could be a stub. In v0.33.4:

WP Codebox v0.12.27 reports bounded added, modified, and deleted paths when post-verification integrity changes and preserves that evidence in normalized publication failures. It also restores bounded filesystem snapshots for non-Git workspaces; see [WP Codebox #1852](https://github.com/Automattic/wp-codebox/pull/1852).

WP Codebox v0.12.28 validates canonical GitHub repository identity case-insensitively while preserving strict pull-request URL, pull number, target binding, and API resolution checks; see [WP Codebox #1875](https://github.com/Automattic/wp-codebox/pull/1875).

WP Codebox v0.12.29 returns `{ valid: true }` without a failure-only `error` when canonical pull-request verification succeeds, while repository mismatches retain their exact diagnostic; see [WP Codebox #1885](https://github.com/Automattic/wp-codebox/pull/1885).
- The workflow result and its reviewer-safe projection carry `workspace_apply` (`wp-codebox/runner-workspace-apply-outcome/v1`). It records `status` (`applied`, `no-op`, `writes-not-applied`, `rejected`, `failed`, or `skipped`), `applied_paths`, every rejected path with its reason, `unapplied_paths`, `declared_changes`, and content-free `write_tool_calls` counts and paths taken from the sandbox write ledger.
- If the sandbox accepted `workspace_write`, `workspace_edit`, or `workspace_apply_patch` calls but the canonical patch declared no changes, the run fails at `stage: apply` with `writes-not-applied` and lists the lost paths. Verification, drift checks, and the Docs Agent completion check do not run in that case. A run with no write calls still reaches them.
- The sandbox and the host use the same writable-path glob matcher: `**` spans directories, and `*`, `?`, and `[...]` stay within one path segment. Patterns such as `docs/**/*.md` or `plugins/*/docs/user/**` are no longer accepted in the sandbox and then rejected on the host.
- The uploader decodes the JSON-encoded `wordpress.run-php` output, so the compact reviewer transcript includes tool observability and the write ledger (tool names and workspace paths, never file contents).
- Publication reuses the branch derived from `docs_branch` only while it has an exact open pull request that descends from the current base. If the branch exists without an open pull request, WP Codebox publishes to a fresh `<branch>-<base-sha-12>` branch instead of appending to the stale one. If the open pull request's branch does not descend from the current base, publication fails and asks for a rebase.

## Docs Agent Runner Recipe

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/maintain-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,10 @@ jobs:
contents: write
pull-requests: write
issues: write
uses: Automattic/wp-codebox/.github/workflows/run-agent-task.yml@a6fe2d208e990a8d04104aa74aacbb8d1539fbc1
uses: Automattic/wp-codebox/.github/workflows/run-agent-task.yml@126f85b2a8b887ae8e2457d1cb71b15ebdb712cd
with:
wp_codebox_release_ref: v0.12.29
wp_codebox_workflow_ref: a6fe2d208e990a8d04104aa74aacbb8d1539fbc1
wp_codebox_release_ref: v0.33.4
wp_codebox_workflow_ref: 126f85b2a8b887ae8e2457d1cb71b15ebdb712cd
external_package_source: ${{ needs.prepare.outputs.external_package_source }}
runtime_sources: ${{ needs.prepare.outputs.runtime_sources }}
workload_id: docs-agent-${{ inputs.audience }}-${{ inputs.run_kind }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: Automattic/wp-codebox
ref: a6fe2d208e990a8d04104aa74aacbb8d1539fbc1
ref: 126f85b2a8b887ae8e2457d1cb71b15ebdb712cd
path: .wp-codebox
- name: Validate Docs Agent
env:
Expand Down
Loading
Loading