diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 876396a..c81b0cb 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -16,7 +16,7 @@ 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.27](https://github.com/Automattic/wp-codebox/releases/tag/v0.12.27) workflow and passes the matching `wp_codebox_release_ref: v0.12.27` input. The release tag resolves to immutable revision `65cc5fb4699cb7c2df13d04b4715c97097ac7565`, 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 `01-wp-codebox.zip` and `02-wp-codebox-workspace-0.12.27.tgz`; the private package-recovery manifest is intentionally not a reviewer asset. +Docs Agent consumes the released [WP Codebox v0.12.28](https://github.com/Automattic/wp-codebox/releases/tag/v0.12.28) workflow and passes the matching `wp_codebox_release_ref: v0.12.28` input. The release tag resolves to immutable revision `6457dcae4cb8cf8e76cd174377de8cbee3ee12cb`, 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 `01-wp-codebox.zip` and `02-wp-codebox-workspace-0.12.28.tgz`; 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. @@ -26,6 +26,8 @@ WP Codebox v0.12.26 restores the unconditional exclusion for mutable `.codebox` 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). + ## 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 fcfb685..c665031 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.27 + uses: Automattic/wp-codebox/.github/workflows/run-agent-task.yml@v0.12.28 with: - wp_codebox_release_ref: v0.12.27 + wp_codebox_release_ref: v0.12.28 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 7455ee3..4c61566 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.27 + ref: v0.12.28 path: .wp-codebox - name: Validate Docs Agent env: diff --git a/README.md b/README.md index 1da2bf4..89c780a 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.27 at `65cc5fb4699cb7c2df13d04b4715c97097ac7565` 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. Integrity failures retain bounded added, modified, and deleted path evidence, and non-Git workspaces retain a bounded filesystem snapshot fallback. 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), [WP Codebox #1848](https://github.com/Automattic/wp-codebox/pull/1848), and [WP Codebox #1852](https://github.com/Automattic/wp-codebox/pull/1852). The published release assets are `01-wp-codebox.zip` and `02-wp-codebox-workspace-0.12.27.tgz`; its private package-recovery manifest is intentionally not a reviewer asset. +WP Codebox v0.12.28 at `6457dcae4cb8cf8e76cd174377de8cbee3ee12cb` 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. 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. 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), [WP Codebox #1848](https://github.com/Automattic/wp-codebox/pull/1848), [WP Codebox #1852](https://github.com/Automattic/wp-codebox/pull/1852), and [WP Codebox #1875](https://github.com/Automattic/wp-codebox/pull/1875). The published release assets are `01-wp-codebox.zip` and `02-wp-codebox-workspace-0.12.28.tgz`; 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 642cbd9..4a951fb 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:1c03a35cf0f31e8b2fbbacaae5867f205ea8ae7b8c2017d0e3e297ed6298ff72', - '02-wp-codebox-workspace-0.12.27.tgz' => 'sha256:be6ec64bd0dc667629ee019d6a79d505927ef2854c8db21fd23d656d0e7d3e6d', -) === $published_assets, 'WP Codebox release fixture must retain the published v0.12.27 asset digests.' ); + '01-wp-codebox.zip' => 'sha256:9a77c7f0117c29cf1c0a98859608013a70afada8a1314c278e0d5e25eb7a00e8', + '02-wp-codebox-workspace-0.12.28.tgz' => 'sha256:98117c40bb42b3d6790af38a2104259b12a6ca820f21df881024c7711bf9569e', +) === $published_assets, 'WP Codebox release fixture must retain the published v0.12.28 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; @@ -93,6 +93,7 @@ $assert( true === ( $release['runtime_control_files_excluded'] ?? null ), 'WP Codebox release fixture must exclude mutable .codebox runtime control files from publication integrity snapshots.' ); $assert( true === ( $release['workspace_integrity_change_evidence'] ?? null ), 'WP Codebox release fixture must preserve bounded workspace integrity change evidence.' ); $assert( true === ( $release['non_git_workspace_snapshot_fallback'] ?? null ), 'WP Codebox release fixture must retain bounded snapshots for non-Git workspaces.' ); +$assert( true === ( $release['canonical_repository_casing'] ?? null ), 'WP Codebox release fixture must retain canonical repository casing coverage.' ); $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.' ); @@ -307,7 +308,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.pull_request.url\' --argjson required "$success_requires_pr" \'{docs_agent_publication:{path:$path,required:$required}}\')"' ), 'Docs Agent must define the v0.12.27 publication projection descriptor.' ); +$assert( str_contains( $workflow, 'output_projections="$(jq -cn --arg path \'metadata.runner_workspace_publication.pull_request.url\' --argjson required "$success_requires_pr" \'{docs_agent_publication:{path:$path,required:$required}}\')"' ), 'Docs Agent must define the v0.12.28 publication projection descriptor.' ); $docs_projections = array( 'docs_agent_publication' => array( 'path' => 'metadata.runner_workspace_publication.pull_request.url', @@ -317,7 +318,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.pull_request.url' === $publication_path, 'Docs Agent publication projection must use the v0.12.27 runner workspace publication pull request URL path.' ); +$assert( 'metadata.runner_workspace_publication.pull_request.url' === $publication_path, 'Docs Agent publication projection must use the v0.12.28 runner workspace publication pull request URL path.' ); $assert( 'string' === ( $contract['inputs']['output_projections']['type'] ?? null ), 'WP Codebox must accept Docs Agent custom output projections.' ); diff --git a/tests/wp-codebox-release.fixture.json b/tests/wp-codebox-release.fixture.json index aa315ea..3144d8b 100644 --- a/tests/wp-codebox-release.fixture.json +++ b/tests/wp-codebox-release.fixture.json @@ -1,10 +1,10 @@ { - "tag": "v0.12.27", - "revision": "65cc5fb4699cb7c2df13d04b4715c97097ac7565", - "package_version": "0.12.27", + "tag": "v0.12.28", + "revision": "6457dcae4cb8cf8e76cd174377de8cbee3ee12cb", + "package_version": "0.12.28", "published_assets": { - "01-wp-codebox.zip": "sha256:1c03a35cf0f31e8b2fbbacaae5867f205ea8ae7b8c2017d0e3e297ed6298ff72", - "02-wp-codebox-workspace-0.12.27.tgz": "sha256:be6ec64bd0dc667629ee019d6a79d505927ef2854c8db21fd23d656d0e7d3e6d" + "01-wp-codebox.zip": "sha256:9a77c7f0117c29cf1c0a98859608013a70afada8a1314c278e0d5e25eb7a00e8", + "02-wp-codebox-workspace-0.12.28.tgz": "sha256:98117c40bb42b3d6790af38a2104259b12a6ca820f21df881024c7711bf9569e" }, "run": "29350690551", "diagnostic_regression_run": "29307978522", @@ -37,6 +37,7 @@ "runtime_control_files_excluded": true, "workspace_integrity_change_evidence": true, "non_git_workspace_snapshot_fallback": true, + "canonical_repository_casing": true, "native_result_path": ".codebox/native-agent-task-result.json", "workflow_result_path": ".codebox/agent-task-workflow-result.json" }