diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 542f617..9d32490 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -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 released [WP Codebox v0.12.25](https://github.com/Automattic/wp-codebox/releases/tag/v0.12.25) workflow and passes the matching `wp_codebox_release_ref: v0.12.25` input. The release tag resolves to immutable revision `c30df7f99a03007ff9fb5e1ae14bdb5cdc68de87`, which is distinct from the fixed Docs Agent package revision. WP Codebox validates the paired tags, materializes the declared native runtime closure, executes the selected package, applies bounded workspace changes, runs verification, and publishes approved host changes. Its published assets are `wp-codebox-workspace-0.12.25.tgz` and `wp-codebox.zip`; the private package-recovery manifest is intentionally not a reviewer asset. +Docs Agent consumes the released [WP Codebox v0.12.26](https://github.com/Automattic/wp-codebox/releases/tag/v0.12.26) workflow and passes the matching `wp_codebox_release_ref: v0.12.26` input. The release tag resolves to immutable revision `2d5d000f2f43670117b373d1b26a23181ee05480`, which is distinct from the fixed Docs Agent package revision. WP Codebox validates the paired tags, materializes the declared native runtime closure, executes the selected package, applies bounded workspace changes, runs verification, and publishes approved host changes. Its published assets are `wp-codebox-workspace-0.12.26.tgz` and `wp-codebox.zip`; the private package-recovery manifest is intentionally not a reviewer asset. 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. 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). +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). + ## Docs Agent Runner Recipe Docs Agent workflow call sites prepare a portable recipe instead of calling a concrete runner. Docs Agent owns the native package, lane, artifact, prompt, and workspace mapping. Consumers depend on Docs Agent inputs and review artifacts, not runner internals. diff --git a/.github/workflows/maintain-docs.yml b/.github/workflows/maintain-docs.yml index a4e903f..73ed376 100644 --- a/.github/workflows/maintain-docs.yml +++ b/.github/workflows/maintain-docs.yml @@ -259,9 +259,9 @@ jobs: contents: write pull-requests: write issues: write - uses: Automattic/wp-codebox/.github/workflows/run-agent-task.yml@v0.12.25 + uses: Automattic/wp-codebox/.github/workflows/run-agent-task.yml@v0.12.26 with: - wp_codebox_release_ref: v0.12.25 + wp_codebox_release_ref: v0.12.26 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 }} diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 09ff32c..4ff2114 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -17,7 +17,7 @@ jobs: uses: actions/checkout@v4 with: repository: Automattic/wp-codebox - ref: v0.12.25 + ref: v0.12.26 path: .wp-codebox - name: Validate Docs Agent env: diff --git a/README.md b/README.md index f3a1616..31e23bf 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,7 @@ 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`. -WP Codebox v0.12.25 at `c30df7f99a03007ff9fb5e1ae14bdb5cdc68de87` uploads a reviewer-safe workflow-result projection with public control and publication fields plus canonical transcript provenance. This released workflow revision remains distinct from the fixed Docs Agent package revision. It excludes raw `runtime_result`, `outputs.engine_data`, model/provider/tool payloads, source content, private paths, secrets, and Git-ignored verification artifacts such as pnpm's symlinked `node_modules` tree. Tracked or otherwise publishable symlinks remain rejected. 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. Before apply-back, it 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 publication snapshot fix is tracked in [WP Codebox #1845](https://github.com/Automattic/wp-codebox/pull/1845). The published release assets are `wp-codebox-workspace-0.12.25.tgz` and `wp-codebox.zip`; its private package-recovery manifest is intentionally not a reviewer asset. +WP Codebox v0.12.26 at `2d5d000f2f43670117b373d1b26a23181ee05480` uploads a reviewer-safe workflow-result projection with public control and publication fields plus canonical transcript provenance. This released workflow revision remains distinct from the fixed Docs Agent package revision. 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. 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. Before apply-back, it 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 publication snapshot fixes are tracked in [WP Codebox #1845](https://github.com/Automattic/wp-codebox/pull/1845) and [WP Codebox #1848](https://github.com/Automattic/wp-codebox/pull/1848). The published release assets are `wp-codebox-workspace-0.12.26.tgz` and `wp-codebox.zip`; its private package-recovery manifest is intentionally not a reviewer asset. Docs Agent owns native package selection, lane, artifact, prompt, and workspace mapping. Execution, credentials, AI provider selection, sandboxing, and publication are runner-owned concerns outside this repository. diff --git a/tests/validate-docs-agent-packages.php b/tests/validate-docs-agent-packages.php index 7b1d650..d3087ce 100644 --- a/tests/validate-docs-agent-packages.php +++ b/tests/validate-docs-agent-packages.php @@ -70,9 +70,9 @@ $assert( str_contains( $maintain_docs_workflow, 'artifact_declarations< 'sha256:6ec24a3b766dad9da57df587de455cc98dc11088e4be00d2a3c990ecaeb7246b', - 'wp-codebox.zip' => 'sha256:53f5e748eb44f0d630c9c6efcfe6a10e16122ca12cbfb3e025893addec8cdb9e', -) === $published_assets, 'WP Codebox release fixture must retain the published v0.12.25 asset digests.' ); + 'wp-codebox-workspace-0.12.26.tgz' => 'sha256:f8d8e74831b9937e1d2f2e832af18d625c25179e74d9aa5801f17132aae03f08', + 'wp-codebox.zip' => 'sha256:9246ec070d108936e7cf2a6194889af0c94e2de7c6980bc6507f07667b24012e', +) === $published_assets, 'WP Codebox release fixture must retain the published v0.12.26 asset digests.' ); $run = $release['run'] ?? null; $assert( is_string( $run ) && preg_match( '/^\d+$/', $run ) === 1, 'WP Codebox release fixture must retain the regression run reference.' ); $diagnostic_regression_run = $release['diagnostic_regression_run'] ?? null; @@ -90,6 +90,7 @@ $assert( true === ( $release['rejected_apply_evidence_retained'] ?? null ), 'WP Codebox release fixture must retain rejected apply evidence.' ); $assert( true === ( $release['pre_redaction_trusted_apply_input'] ?? null ), 'WP Codebox release fixture must preserve the pre-redaction trusted apply input.' ); $assert( true === ( $release['git_ignored_workspace_artifacts_excluded'] ?? null ), 'WP Codebox release fixture must exclude Git-ignored verification artifacts from publication integrity snapshots.' ); +$assert( true === ( $release['runtime_control_files_excluded'] ?? null ), 'WP Codebox release fixture must exclude mutable .codebox runtime control files from publication integrity snapshots.' ); $native_result_path = $release['native_result_path'] ?? null; $workflow_result_path = $release['workflow_result_path'] ?? null; $assert( '.codebox/native-agent-task-result.json' === $native_result_path, 'WP Codebox release fixture must declare the controlled native result path.' ); @@ -304,7 +305,7 @@ $assert( in_array( '.codebox/agent-task-request.json', $producer_upload_regression['observed']['uploaded'] ?? array(), true ), 'WP Codebox upload regression fixture must retain the controlled request upload.' ); $assert( ! array_intersect( array( 'MODEL_PROVIDER_SECRET_1', 'MODEL_PROVIDER_SECRET_2', 'MODEL_PROVIDER_SECRET_3', 'MODEL_PROVIDER_SECRET_4', 'MODEL_PROVIDER_SECRET_5' ), array_keys( $caller_secrets ) ), 'Docs Agent must forward only the OPENAI_API_KEY provider secret name.' ); -$assert( str_contains( $workflow, 'output_projections="$(jq -cn --arg path \'metadata.runner_workspace_publication.url\' --argjson required "$success_requires_pr" \'{docs_agent_publication:{path:$path,required:$required}}\')"' ), 'Docs Agent must define the v0.12.25 publication projection descriptor.' ); +$assert( str_contains( $workflow, 'output_projections="$(jq -cn --arg path \'metadata.runner_workspace_publication.url\' --argjson required "$success_requires_pr" \'{docs_agent_publication:{path:$path,required:$required}}\')"' ), 'Docs Agent must define the v0.12.26 publication projection descriptor.' ); $docs_projections = array( 'docs_agent_publication' => array( 'path' => 'metadata.runner_workspace_publication.url', @@ -314,7 +315,7 @@ $publication_descriptor = $docs_projections['docs_agent_publication'] ?? null; $assert( is_array( $publication_descriptor ), 'Docs Agent must define the docs_agent_publication projection descriptor.' ); $publication_path = $publication_descriptor['path'] ?? null; -$assert( 'metadata.runner_workspace_publication.url' === $publication_path, 'Docs Agent publication projection must use the v0.12.25 runner workspace publication URL path.' ); +$assert( 'metadata.runner_workspace_publication.url' === $publication_path, 'Docs Agent publication projection must use the v0.12.26 runner workspace publication URL path.' ); $producer_request_fixture = $read_json( rtrim( $wp_codebox_dir, '/' ) . '/contracts/agent-task-workflow-request.fixture.json' ); $producer_projection_paths = array_values( $producer_request_fixture['outputs']['projections'] ?? array() ); diff --git a/tests/wp-codebox-release.fixture.json b/tests/wp-codebox-release.fixture.json index 947b0b2..87c22f1 100644 --- a/tests/wp-codebox-release.fixture.json +++ b/tests/wp-codebox-release.fixture.json @@ -1,10 +1,10 @@ { - "tag": "v0.12.25", - "revision": "c30df7f99a03007ff9fb5e1ae14bdb5cdc68de87", - "package_version": "0.12.25", + "tag": "v0.12.26", + "revision": "2d5d000f2f43670117b373d1b26a23181ee05480", + "package_version": "0.12.26", "published_assets": { - "wp-codebox-workspace-0.12.25.tgz": "sha256:6ec24a3b766dad9da57df587de455cc98dc11088e4be00d2a3c990ecaeb7246b", - "wp-codebox.zip": "sha256:53f5e748eb44f0d630c9c6efcfe6a10e16122ca12cbfb3e025893addec8cdb9e" + "wp-codebox-workspace-0.12.26.tgz": "sha256:f8d8e74831b9937e1d2f2e832af18d625c25179e74d9aa5801f17132aae03f08", + "wp-codebox.zip": "sha256:9246ec070d108936e7cf2a6194889af0c94e2de7c6980bc6507f07667b24012e" }, "run": "29350690551", "diagnostic_regression_run": "29307978522", @@ -34,6 +34,7 @@ "rejected_apply_evidence_retained": true, "pre_redaction_trusted_apply_input": true, "git_ignored_workspace_artifacts_excluded": true, + "runtime_control_files_excluded": true, "native_result_path": ".codebox/native-agent-task-result.json", "workflow_result_path": ".codebox/agent-task-workflow-result.json" }