Skip to content

Commit d1bf324

Browse files
authored
Pin verification failure evidence producer (#170)
* Pin verification failure evidence producer * Pin stable completion validator revision * Pin stable native package revision
1 parent a39d9db commit d1bf324

11 files changed

Lines changed: 16 additions & 16 deletions

.github/workflows/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The reusable workflow declares the expected typed review artifacts for Docs Agen
1616

1717
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.
1818

19-
Docs Agent consumes the reusable WP Codebox workflow at accepted immutable revision `12a5bb19a97b89d0a78b502fc71adede5b122359` 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.
19+
Docs Agent consumes the reusable WP Codebox workflow at accepted immutable revision `0227ca7551d8cd98f14242b31e142b50f78dff13` 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.
2020

2121
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.
2222

.github/workflows/maintain-docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Maintain Docs
22

33
env:
44
# Advance this revision and all package digests together when package bytes change.
5-
DOCS_AGENT_PACKAGE_REVISION: 85f0d162a7d499fdc1286891371342727d084c88
5+
DOCS_AGENT_PACKAGE_REVISION: a39d9db230eb9e0b72ed84465f4d61bd8dda1bab
66
# Advance independently when the post-command completion validator changes.
7-
DOCS_AGENT_COMPLETION_CONTRACT_REVISION: cc6ec369d1e47ffdf541e3ec2c72bce5eed5f685
7+
DOCS_AGENT_COMPLETION_CONTRACT_REVISION: a39d9db230eb9e0b72ed84465f4d61bd8dda1bab
88

99
'on':
1010
workflow_call:
@@ -344,7 +344,7 @@ jobs:
344344
contents: write
345345
pull-requests: write
346346
issues: write
347-
uses: Automattic/wp-codebox/.github/workflows/run-agent-task.yml@12a5bb19a97b89d0a78b502fc71adede5b122359
347+
uses: Automattic/wp-codebox/.github/workflows/run-agent-task.yml@0227ca7551d8cd98f14242b31e142b50f78dff13
348348
with:
349349
wp_codebox_release_ref: v0.12.29
350350
external_package_source: ${{ needs.prepare.outputs.external_package_source }}

.github/workflows/validate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
uses: actions/checkout@v4
1818
with:
1919
repository: Automattic/wp-codebox
20-
ref: 12a5bb19a97b89d0a78b502fc71adede5b122359
20+
ref: 0227ca7551d8cd98f14242b31e142b50f78dff13
2121
path: .wp-codebox
2222
- name: Validate Docs Agent
2323
env:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ Docs Agent declares the review artifacts it expects the runner to materialize as
134134

135135
`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 successful semantic 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.
136136

137-
The reusable workflow producer is pinned to accepted revision `12a5bb19a97b89d0a78b502fc71adede5b122359`; `v0.12.29` remains only the `wp_codebox_release_ref` for released packaged runtime assets at `bc982947ec33c78160125026e16d357b7ece3ea1`.
137+
The reusable workflow producer is pinned to accepted revision `0227ca7551d8cd98f14242b31e142b50f78dff13`; `v0.12.29` remains only the `wp_codebox_release_ref` for released packaged runtime assets at `bc982947ec33c78160125026e16d357b7ece3ea1`.
138138

139139
WP Codebox v0.12.29 at `bc982947ec33c78160125026e16d357b7ece3ea1` 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. Successful publication verification returns `{ valid: true }` without a failure-only `error`, while repository mismatches retain their exact diagnostic as fixed by [WP Codebox #1885](https://github.com/Automattic/wp-codebox/pull/1885). 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), [WP Codebox #1875](https://github.com/Automattic/wp-codebox/pull/1875), and [WP Codebox #1885](https://github.com/Automattic/wp-codebox/pull/1885). The published release assets are `01-wp-codebox.zip` and `02-wp-codebox-workspace-0.12.29.tgz`; its private package-recovery manifest is intentionally not a reviewer asset.
140140

@@ -230,7 +230,7 @@ Docs Agent has one canonical architecture: five standalone native Agents API pac
230230
- `bundles/user-docs-agent/native/user-docs-maintenance-agent.agent.json`
231231
- `bundles/skills-agent/native/skills-maintenance-agent.agent.json`
232232

233-
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 `85f0d162a7d499fdc1286891371342727d084c88`, independently of the revision that invokes the reusable workflow, and supplies a byte-level `sha256-bytes-v1` digest.
233+
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 `a39d9db230eb9e0b72ed84465f4d61bd8dda1bab`, independently of the revision that invokes the reusable workflow, and supplies a byte-level `sha256-bytes-v1` digest.
234234

235235
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.
236236

ci/docs-agent-runner-recipe.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"docsAgent": {
66
"externalPackageSource": {
77
"repository": "Automattic/docs-agent",
8-
"revision": "85f0d162a7d499fdc1286891371342727d084c88",
8+
"revision": "a39d9db230eb9e0b72ed84465f4d61bd8dda1bab",
99
"path": "bundles/technical-docs-agent/native/technical-docs-maintenance-agent.agent.json",
1010
"digest": "sha256-bytes-v1:975c7b0a0a7aff52897c52be5ac903a7fb110ea3c33e16227f8694c74c932519"
1111
},

examples/runner-recipe.example.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"docsAgent": {
66
"externalPackageSource": {
77
"repository": "Automattic/docs-agent",
8-
"revision": "85f0d162a7d499fdc1286891371342727d084c88",
8+
"revision": "a39d9db230eb9e0b72ed84465f4d61bd8dda1bab",
99
"path": "bundles/technical-docs-agent/native/technical-docs-maintenance-agent.agent.json",
1010
"digest": "sha256-bytes-v1:975c7b0a0a7aff52897c52be5ac903a7fb110ea3c33e16227f8694c74c932519"
1111
},

tests/reusable-workflow-empty-called-workflow-context.fixture.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"called_workflow_context": {
44
"job_workflow_sha": ""
55
},
6-
"expected_package_revision": "85f0d162a7d499fdc1286891371342727d084c88"
6+
"expected_package_revision": "a39d9db230eb9e0b72ed84465f4d61bd8dda1bab"
77
}

tests/validate-docs-agent-packages.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
$assert( 'docs-agent/runner-recipe/v1' === ( $recipe['schema'] ?? null ), 'Runner recipe must use the portable Docs Agent runner recipe schema.' );
4646
$expected_package_source = array(
4747
'repository' => 'Automattic/docs-agent',
48-
'revision' => '85f0d162a7d499fdc1286891371342727d084c88',
48+
'revision' => 'a39d9db230eb9e0b72ed84465f4d61bd8dda1bab',
4949
'path' => 'bundles/technical-docs-agent/native/technical-docs-maintenance-agent.agent.json',
5050
'digest' => 'sha256-bytes-v1:975c7b0a0a7aff52897c52be5ac903a7fb110ea3c33e16227f8694c74c932519',
5151
);
@@ -71,7 +71,7 @@
7171
$assert( str_contains( $maintain_docs_workflow, 'artifact_declarations<<EOF' ), 'maintain-docs.yml must prepare typed artifact declarations without caller-specific projections.' );
7272
$assert( str_contains( $maintain_docs_workflow, 'artifact_declarations<<EOF' ), 'maintain-docs.yml must expose artifact declarations through workflow outputs.' );
7373

74-
$wp_codebox_producer_revision = '12a5bb19a97b89d0a78b502fc71adede5b122359';
74+
$wp_codebox_producer_revision = '0227ca7551d8cd98f14242b31e142b50f78dff13';
7575
$generic_codebox_agent_task_workflow = 'uses: Automattic/wp-codebox/.github/workflows/run-agent-task.yml@' . $wp_codebox_producer_revision;
7676
$assert( str_contains( $maintain_docs_workflow, $generic_codebox_agent_task_workflow ), 'maintain-docs.yml must call the immutable generic Codebox agent-task workflow candidate.' );
7777
$assert( str_contains( $maintain_docs_workflow, 'wp_codebox_release_ref: v0.12.29' ), 'maintain-docs.yml must pass the matching WP Codebox release tag.' );
@@ -82,7 +82,7 @@
8282
$assert( str_contains( $maintain_docs_workflow, 'sourceDelta:$sourceDelta' ), 'maintain-docs.yml must retain caller-known bounded source deltas in the portable recipe.' );
8383
$assert( str_contains( $maintain_docs_workflow, 'source_delta must contain at least one caller-bounded item for maintenance.' ), 'maintain-docs.yml must reject empty maintenance source deltas before execution.' );
8484
$assert( str_contains( $maintain_docs_workflow, 'validate-docs-agent-completion.php' ), 'maintain-docs.yml must execute the Docs Agent-owned completion validator.' );
85-
$completion_contract_revision = 'cc6ec369d1e47ffdf541e3ec2c72bce5eed5f685';
85+
$completion_contract_revision = 'a39d9db230eb9e0b72ed84465f4d61bd8dda1bab';
8686
$assert( str_contains( $maintain_docs_workflow, 'DOCS_AGENT_COMPLETION_CONTRACT_REVISION: ' . $completion_contract_revision ), 'maintain-docs.yml must pin the completion validator to its immutable implementation commit.' );
8787
$assert( str_contains( $maintain_docs_workflow, 'Automattic/docs-agent/$DOCS_AGENT_COMPLETION_CONTRACT_REVISION/scripts/validate-docs-agent-completion.php' ), 'maintain-docs.yml must fetch the validator independently of native package provenance.' );
8888
$historical_validator = shell_exec( 'git -C ' . escapeshellarg( $root ) . ' show ' . escapeshellarg( $completion_contract_revision . ':scripts/validate-docs-agent-completion.php' ) );

tests/validate-external-native-package-sources.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
return $contents;
3131
};
3232

33-
$package_revision = '85f0d162a7d499fdc1286891371342727d084c88';
33+
$package_revision = 'a39d9db230eb9e0b72ed84465f4d61bd8dda1bab';
3434
$packages = array(
3535
'technical:bootstrap' => array( 'path' => 'bundles/technical-docs-agent/native/technical-docs-bootstrap-agent.agent.json', 'slug' => 'technical-docs-bootstrap-agent', 'digest' => '0230e0e3fd8a4f045a545407d3d01c22df537b05f031260e29d6b531285b7839' ),
3636
'technical:maintenance' => array( 'path' => 'bundles/technical-docs-agent/native/technical-docs-maintenance-agent.agent.json', 'slug' => 'technical-docs-maintenance-agent', 'digest' => '975c7b0a0a7aff52897c52be5ac903a7fb110ea3c33e16227f8694c74c932519' ),

tests/validate-wp-codebox-run-agent-task-contract.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@
230230

231231
$assert( isset( $caller_inputs['external_package_source'] ), 'Docs Agent must provide the required external package descriptor.' );
232232
$assert( ! isset( $caller_inputs['agent_bundle'] ), 'Docs Agent must not pass the removed agent_bundle input.' );
233-
$assert( str_contains( $workflow, 'DOCS_AGENT_PACKAGE_REVISION: 85f0d162a7d499fdc1286891371342727d084c88' ), 'Docs Agent must use the fixed native package source revision.' );
233+
$assert( str_contains( $workflow, 'DOCS_AGENT_PACKAGE_REVISION: a39d9db230eb9e0b72ed84465f4d61bd8dda1bab' ), 'Docs Agent must use the fixed native package source revision.' );
234234
$assert( ! str_contains( $workflow, 'github.job_workflow_sha' ), 'Docs Agent must not depend on unavailable called-workflow provenance.' );
235235

236236
preg_match( "/runtime_sources='(?<json>[^']+)'/", $workflow, $runtime_sources_match );

0 commit comments

Comments
 (0)