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
4 changes: 3 additions & 1 deletion .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ 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 immutable revision `823e68cbb180579cd9dfd7d861be7bdc4074ff91` and passes `wp_codebox_release_ref: v0.33.5` and `wp_codebox_workflow_ref: 823e68cbb180579cd9dfd7d861be7bdc4074ff91`. That revision is the commit the annotated `v0.33.5` 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.5 release assets are `wp-codebox-cli-linux-x64.tar.gz`, `wp-codebox-workspace-0.33.5.tgz`, and `wp-codebox.zip`; `tests/wp-codebox-release.fixture.json` records their published SHA-256 digests.
Docs Agent consumes the reusable WP Codebox workflow and helper implementation at immutable revision `4875fb1550a34e4f07c44cff20bad477b83115de` and passes `wp_codebox_release_ref: v0.33.6` and `wp_codebox_workflow_ref: 4875fb1550a34e4f07c44cff20bad477b83115de`. That revision is the commit the annotated `v0.33.6` 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.6 release assets are `wp-codebox-cli-linux-x64.tar.gz`, `wp-codebox-workspace-0.33.6.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 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.

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.33.6 reports why a failed agent runtime failed: every non-zero exit or unreadable native result now produces `failure` with `stage: agent`, a `code` and a `message`, and the canonical transcript plus `tool_observability` are uploaded on failure too ([WP Codebox #2590](https://github.com/Automattic/wp-codebox/pull/2590)). It also raises the native result bound from 1 MiB to 32 MiB and the tool-observability bound from 64 to 512 calls, because 40-turn runs exceeded both and lost all of their evidence.

WP Codebox v0.33.5 honors the caller's `max_turns` over an imported package's `default_max_turns` ([WP Codebox #2589](https://github.com/Automattic/wp-codebox/pull/2589)), so this workflow's `max_turns` input actually reaches the agent loop. A run that exhausts its turn budget while still calling tools now fails at `stage: agent` with `max_turns_exceeded` (`terminal_status: max_turns`, `agent_turn_limit` in the result) instead of finishing as a green no-op; partial work is not applied.

WP Codebox v0.33.4 made 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 and later:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/maintain-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Maintain Docs

env:
# Advance this revision and all package digests together when package bytes change.
DOCS_AGENT_PACKAGE_REVISION: f3d965758c6318bd900b32d7fb91ccae125c3204
DOCS_AGENT_PACKAGE_REVISION: 667a3d7e43b938cae157235131da4462b09eebb5
# Advance independently when the post-command completion validator changes.
DOCS_AGENT_COMPLETION_CONTRACT_REVISION: b136f9bc84e6f0ad9d5d0d5cdbb3df9c62e382e2

Expand Down Expand Up @@ -182,14 +182,14 @@ jobs:
user:bootstrap)
package_path="bundles/user-docs-agent/native/user-docs-bootstrap-agent.agent.json"
agent_slug="user-docs-bootstrap-agent"
package_digest="sha256-bytes-v1:526ff81a024f75445ab44fcad16910c0b9b8f8765c3cba930490469eb1af74d3"
package_digest="sha256-bytes-v1:d22cf858b4413e150226989ff8cf253e2cfa7ef88b041d8ce14360f22df9d3a4"
lane_requires_pr=true
default_prompt="Bootstrap source-grounded product documentation for onboarding, setup, common tasks, expected outcomes, permissions, compatibility, troubleshooting, and FAQs."
;;
user:maintenance)
package_path="bundles/user-docs-agent/native/user-docs-maintenance-agent.agent.json"
agent_slug="user-docs-maintenance-agent"
package_digest="sha256-bytes-v1:747de10fdb52d7c1543b404030e0e0a2604b6496e95d50143149f72c975a98fb"
package_digest="sha256-bytes-v1:c93ce43cd7e057759779d36499fd26de45f8c7d3395bbf08583bbc83121e80e6"
lane_requires_pr=false
default_prompt="Maintain source-grounded product documentation for onboarding, setup, common tasks, expected outcomes, permissions, compatibility, troubleshooting, and FAQs."
;;
Expand Down Expand Up @@ -356,10 +356,10 @@ jobs:
contents: write
pull-requests: write
issues: write
uses: Automattic/wp-codebox/.github/workflows/run-agent-task.yml@823e68cbb180579cd9dfd7d861be7bdc4074ff91
uses: Automattic/wp-codebox/.github/workflows/run-agent-task.yml@4875fb1550a34e4f07c44cff20bad477b83115de
with:
wp_codebox_release_ref: v0.33.5
wp_codebox_workflow_ref: 823e68cbb180579cd9dfd7d861be7bdc4074ff91
wp_codebox_release_ref: v0.33.6
wp_codebox_workflow_ref: 4875fb1550a34e4f07c44cff20bad477b83115de
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: 823e68cbb180579cd9dfd7d861be7bdc4074ff91
ref: 4875fb1550a34e4f07c44cff20bad477b83115de
path: .wp-codebox
- name: Validate Docs Agent
env:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ Docs Agent declares the review artifacts it expects the runner to materialize as

`maintain-docs.yml` writes `expected_artifacts` and `artifact_declarations` into a portable Docs Agent recipe and exposes the same declaration objects as `declared_artifacts_json`. The runtime declaration for `docs_agent_completion_report` remains `required: false` because WP Codebox may evaluate runtime-level required artifacts before post-command validation. The final completion drift entry is mandatory and declares `{name,type,path}`; after deterministic host validation, the validator atomically writes canonical JSON to `.codebox/agent-task-artifacts/docs-agent-completion-report.json`, and WP Codebox stages that declared command artifact for reviewers.

The reusable workflow and helper implementation are pinned to WP Codebox `v0.33.5`: `wp_codebox_release_ref: v0.33.5` and `wp_codebox_workflow_ref` both resolve to the tag commit `823e68cbb180579cd9dfd7d861be7bdc4074ff91`. This producer revision is independent of the fixed Docs Agent package revision.
The reusable workflow and helper implementation are pinned to WP Codebox `v0.33.6`: `wp_codebox_release_ref: v0.33.6` and `wp_codebox_workflow_ref` both resolve to the tag commit `4875fb1550a34e4f07c44cff20bad477b83115de`. This producer revision is independent of the fixed Docs Agent package revision.

WP Codebox v0.33.5 uploads a reviewer-safe workflow-result projection with public control, workspace-apply, and publication fields plus canonical transcript provenance. It excludes raw `runtime_result`, `outputs.engine_data`, model/provider/tool payloads, source content, private paths, secrets, Git-ignored verification artifacts such as pnpm's symlinked `node_modules` tree, and mutable `.codebox` runtime control files. Tracked or otherwise publishable symlinks remain rejected. Integrity failures retain bounded added, modified, and deleted path evidence, and non-Git workspaces retain a bounded filesystem snapshot fallback. Canonical GitHub repository identity is compared case-insensitively while pull-request URL syntax, pull number, target binding, and API resolution remain strict. The canonical `codebox-transcript` remains the bounded tool-observability surface: its pre-sanitization reviewer-evidence descriptor records the trusted artifact-relative path, schema, verified source digest, and size, which the uploader revalidates before producing the `wp-codebox/reviewer-agent-transcript/v1` projection. Since v0.33.5 that projection decodes the runtime output, so it includes tool observability and the content-free sandbox write ledger instead of a stub. Before apply-back, WP Codebox validates that the runner seed and host workspace identities match; rejected patches retain identity, patch, and changed-file evidence for review. The pre-redaction trusted apply input fixed by [WP Codebox #1842](https://github.com/Automattic/wp-codebox/pull/1842) retains machine-applicable patch bytes privately, then removes them before durable artifact sanitization.
WP Codebox v0.33.6 uploads a reviewer-safe workflow-result projection with public control, workspace-apply, and publication fields plus canonical transcript provenance. It excludes raw `runtime_result`, `outputs.engine_data`, model/provider/tool payloads, source content, private paths, secrets, Git-ignored verification artifacts such as pnpm's symlinked `node_modules` tree, and mutable `.codebox` runtime control files. Tracked or otherwise publishable symlinks remain rejected. Integrity failures retain bounded added, modified, and deleted path evidence, and non-Git workspaces retain a bounded filesystem snapshot fallback. Canonical GitHub repository identity is compared case-insensitively while pull-request URL syntax, pull number, target binding, and API resolution remain strict. The canonical `codebox-transcript` remains the bounded tool-observability surface: its pre-sanitization reviewer-evidence descriptor records the trusted artifact-relative path, schema, verified source digest, and size, which the uploader revalidates before producing the `wp-codebox/reviewer-agent-transcript/v1` projection. Since v0.33.6 that projection decodes the runtime output, so it includes tool observability and the content-free sandbox write ledger instead of a stub. Before apply-back, WP Codebox validates that the runner seed and host workspace identities match; rejected patches retain identity, patch, and changed-file evidence for review. The pre-redaction trusted apply input fixed by [WP Codebox #1842](https://github.com/Automattic/wp-codebox/pull/1842) retains machine-applicable patch bytes privately, then removes them before durable artifact sanitization.

The workflow result records the runner-workspace apply outcome as `workspace_apply` (`wp-codebox/runner-workspace-apply-outcome/v1`): applied, rejected, and unapplied paths plus write-tool call counts. Sandbox and host now share one writable-path glob matcher, so `docs/**` and `docs/**/*.md` behave the same on both sides. If the agent made successful write calls but the canonical patch declared no changes, the run fails at `stage: apply` with `writes-not-applied` instead of passing as a no-op. See [WP Codebox #2588](https://github.com/Automattic/wp-codebox/pull/2588) and [WP Codebox #2567](https://github.com/Automattic/wp-codebox/issues/2567).

Expand Down Expand Up @@ -237,7 +237,7 @@ Docs Agent has one canonical architecture: five standalone native Agents API pac
- `bundles/user-docs-agent/native/user-docs-maintenance-agent.agent.json`
- `bundles/skills-agent/native/skills-maintenance-agent.agent.json`

These five `.agent.json` files are the complete executable package surface. Each package is the sole executable instruction authority for its lane. The reusable workflow maps `audience` and `run_kind` to exactly one package and its canonical agent slug; it does not select a separate manifest, flow, pipeline, or memory envelope. Every descriptor uses the package-source revision `f3d965758c6318bd900b32d7fb91ccae125c3204`, independently of the revision that invokes the reusable workflow, and supplies a byte-level `sha256-bytes-v1` digest.
These five `.agent.json` files are the complete executable package surface. Each package is the sole executable instruction authority for its lane. The reusable workflow maps `audience` and `run_kind` to exactly one package and its canonical agent slug; it does not select a separate manifest, flow, pipeline, or memory envelope. Every descriptor uses the package-source revision `667a3d7e43b938cae157235131da4462b09eebb5`, independently of the revision that invokes the reusable workflow, and supplies a byte-level `sha256-bytes-v1` digest.

Package updates advance the package-source revision and all five declared digests atomically. The immutable-source validator reads each package blob from that Git revision, recomputes its digest and canonical slug, and rejects a descriptor that does not match those historical bytes.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"schema_version": 1,
"bundle_slug": "user-docs-bootstrap-agent",
"bundle_version": "0.1.0",
"source_ref": "Automattic/docs-agent@f3d965758c6318bd900b32d7fb91ccae125c3204",
"source_revision": "f3d965758c6318bd900b32d7fb91ccae125c3204",
"source_ref": "Automattic/docs-agent@667a3d7e43b938cae157235131da4462b09eebb5",
"source_revision": "667a3d7e43b938cae157235131da4462b09eebb5",
"agent": {
"agent_slug": "user-docs-bootstrap-agent",
"agent_name": "User Docs Bootstrap Agent",
Expand Down Expand Up @@ -150,7 +150,7 @@
"meta": {
"source_type": "runtime-agent-package",
"source_package": "user-docs-agent",
"source_version": "f3d965758c6318bd900b32d7fb91ccae125c3204",
"source_version": "667a3d7e43b938cae157235131da4462b09eebb5",
"role": "user-docs-bootstrap",
"runtime": "agents-api-native-chat",
"default_provider": "openai",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"schema_version": 1,
"bundle_slug": "user-docs-maintenance-agent",
"bundle_version": "0.1.0",
"source_ref": "Automattic/docs-agent@02e01e6d72ee158e45413185c32fcf30a5a04724",
"source_revision": "02e01e6d72ee158e45413185c32fcf30a5a04724",
"source_ref": "Automattic/docs-agent@667a3d7e43b938cae157235131da4462b09eebb5",
"source_revision": "667a3d7e43b938cae157235131da4462b09eebb5",
"agent": {
"agent_slug": "user-docs-maintenance-agent",
"agent_name": "User Docs Maintenance Agent",
Expand Down Expand Up @@ -35,7 +35,7 @@
"meta": {
"source_type": "runtime-agent-package",
"source_package": "user-docs-agent",
"source_version": "02e01e6d72ee158e45413185c32fcf30a5a04724",
"source_version": "667a3d7e43b938cae157235131da4462b09eebb5",
"role": "user-docs-maintenance",
"runtime": "agents-api-native-chat",
"default_provider": "openai",
Expand Down
2 changes: 1 addition & 1 deletion ci/docs-agent-runner-recipe.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"docsAgent": {
"externalPackageSource": {
"repository": "Automattic/docs-agent",
"revision": "f3d965758c6318bd900b32d7fb91ccae125c3204",
"revision": "667a3d7e43b938cae157235131da4462b09eebb5",
"path": "bundles/technical-docs-agent/native/technical-docs-maintenance-agent.agent.json",
"digest": "sha256-bytes-v1:975c7b0a0a7aff52897c52be5ac903a7fb110ea3c33e16227f8694c74c932519"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/runner-recipe.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"docsAgent": {
"externalPackageSource": {
"repository": "Automattic/docs-agent",
"revision": "f3d965758c6318bd900b32d7fb91ccae125c3204",
"revision": "667a3d7e43b938cae157235131da4462b09eebb5",
"path": "bundles/technical-docs-agent/native/technical-docs-maintenance-agent.agent.json",
"digest": "sha256-bytes-v1:975c7b0a0a7aff52897c52be5ac903a7fb110ea3c33e16227f8694c74c932519"
},
Expand Down
Loading
Loading