Skip to content

Commit 0dfe225

Browse files
authored
Use WP Codebox v0.12.6 release (#127)
1 parent 56910aa commit 0dfe225

6 files changed

Lines changed: 30 additions & 13 deletions

File tree

.github/workflows/README.md

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

1313
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 that authorizes only the selected public standalone Docs Agent package. Both secrets are forwarded to WP Codebox without serialization into the task descriptor.
1414

15-
Docs Agent consumes the released [WP Codebox v0.12.5](https://github.com/Automattic/wp-codebox/releases/tag/v0.12.5) workflow and passes the matching `wp_codebox_release_ref: v0.12.5` input. WP Codebox validates that the paired tags match, resolves the release tag, and verifies its package version before running the task. See [WP Codebox #1759](https://github.com/Automattic/wp-codebox/issues/1759). Regression reference: failed run `29295530010`.
15+
Docs Agent consumes the released [WP Codebox v0.12.6](https://github.com/Automattic/wp-codebox/releases/tag/v0.12.6) workflow and passes the matching `wp_codebox_release_ref: v0.12.6` input. WP Codebox validates that the paired tags match, resolves the release tag, verifies its package version, and transports the native task result through controlled `.codebox` result files before publishing the workflow result. See [WP Codebox #1759](https://github.com/Automattic/wp-codebox/issues/1759). Regression reference: [run `29296787203`](https://github.com/Automattic/wp-codebox/actions/runs/29296787203).
1616

1717
## Docs Agent Runner Recipe
1818

.github/workflows/maintain-docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,9 @@ jobs:
235235
contents: write
236236
pull-requests: write
237237
issues: write
238-
uses: Automattic/wp-codebox/.github/workflows/run-agent-task.yml@v0.12.5
238+
uses: Automattic/wp-codebox/.github/workflows/run-agent-task.yml@v0.12.6
239239
with:
240-
wp_codebox_release_ref: v0.12.5
240+
wp_codebox_release_ref: v0.12.6
241241
external_package_source: ${{ needs.prepare.outputs.external_package_source }}
242242
workload_id: docs-agent-${{ inputs.audience }}-${{ inputs.run_kind }}
243243
workload_label: Run Docs Agent

.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: v0.12.5
20+
ref: v0.12.6
2121
path: .wp-codebox
2222
- name: Validate Docs Agent
2323
env:

tests/validate-docs-agent-bundle.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,11 @@
196196

197197
$transitional_homeboy_extensions_workflow = 'uses: Extra-Chill/homeboy-extensions/.github/workflows/runtime-agent-full-run.yml@main';
198198
$forbidden_docs_agent_codebox_workflow = 'uses: Automattic/wp-codebox/.github/workflows/docs-agent-runner.yml@main';
199-
$generic_codebox_agent_task_workflow = 'uses: Automattic/wp-codebox/.github/workflows/run-agent-task.yml@v0.12.5';
199+
$generic_codebox_agent_task_workflow = 'uses: Automattic/wp-codebox/.github/workflows/run-agent-task.yml@v0.12.6';
200200
$assert( ! str_contains( $maintain_docs_workflow, $transitional_homeboy_extensions_workflow ), 'maintain-docs.yml must not call Homeboy Extensions directly.' );
201201
$assert( ! str_contains( $maintain_docs_workflow, $forbidden_docs_agent_codebox_workflow ), 'maintain-docs.yml must not call a Codebox-owned Docs Agent wrapper.' );
202202
$assert( str_contains( $maintain_docs_workflow, $generic_codebox_agent_task_workflow ), 'maintain-docs.yml must call the generic Codebox agent-task workflow.' );
203-
$assert( str_contains( $maintain_docs_workflow, 'wp_codebox_release_ref: v0.12.5' ), 'maintain-docs.yml must pass the matching WP Codebox release tag.' );
203+
$assert( str_contains( $maintain_docs_workflow, 'wp_codebox_release_ref: v0.12.6' ), 'maintain-docs.yml must pass the matching WP Codebox release tag.' );
204204

205205
$workflow_blocked_runtime_fragments = array_values( array_diff( $blocked_runtime_fragments, array( 'wp-codebox', 'Automattic/wp-codebox', 'OPENAI_API_KEY' ) ) );
206206
$workflow_internal_fragments = array_merge( $workflow_blocked_runtime_fragments, array( 'homeboy_extensions_ref:', 'runtime_ref:', 'runtime_ref }}', 'runtime_provider:', 'runtime_provider }}', 'runtime_profile:', 'runtime_profile }}', 'runtime_profiles:', 'runtime_profiles }}', 'runtime_execution:', 'runtime_execution }}', 'runtime_config:', 'runtime_config }}', 'component_contracts:', 'component_contracts }}', 'ability_requirements:', 'ability_requirements }}', 'runtime_components:', 'runtime_components }}', 'runtime_mounts:', 'runtime_mounts }}', 'required_abilities:', 'required_abilities }}', 'extra_wp_config_defines:' ) );
@@ -236,7 +236,7 @@
236236
foreach ( array( 'Docs Agent Runner Recipe', 'portable recipe', 'Docs Agent owns the native package' ) as $migration_note_text ) {
237237
$assert( str_contains( $workflow_readme, $migration_note_text ), "Workflow README missing agent runtime note: {$migration_note_text}" );
238238
}
239-
$assert( str_contains( $workflow_readme, 'v0.12.5' ), 'Workflow README must record the WP Codebox release tag.' );
239+
$assert( str_contains( $workflow_readme, 'v0.12.6' ), 'Workflow README must record the WP Codebox release tag.' );
240240
$assert( str_contains( $workflow_readme, 'https://github.com/Automattic/wp-codebox/issues/1759' ), 'Workflow README must link the WP Codebox release contract issue.' );
241241
$assert( str_contains( $workflow_readme, 'blocks concrete runner workflow calls' ), 'Workflow README must document blocked concrete runner calls.' );
242242
$assert( str_contains( $workflow_readme, 'runtime ability names, component paths, mount directives, provider defaults, and define directives' ), 'Workflow README must document blocked runtime substrate surfaces.' );

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

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,30 @@
5151
$release_tag = $release['tag'] ?? null;
5252
$assert( is_string( $release_tag ) && preg_match( '/^v\d+\.\d+\.\d+$/', $release_tag ) === 1, 'WP Codebox release fixture must declare an exact release tag.' );
5353
$assert( substr( $release_tag, 1 ) === ( $release['package_version'] ?? null ), 'WP Codebox release fixture package version must match its tag.' );
54-
$failed_run = $release['failed_run'] ?? null;
55-
$assert( is_string( $failed_run ) && preg_match( '/^\d+$/', $failed_run ) === 1, 'WP Codebox release fixture must retain the failed-run regression reference.' );
54+
$run = $release['run'] ?? null;
55+
$assert( is_string( $run ) && preg_match( '/^\d+$/', $run ) === 1, 'WP Codebox release fixture must retain the regression run reference.' );
56+
$native_result_path = $release['native_result_path'] ?? null;
57+
$workflow_result_path = $release['workflow_result_path'] ?? null;
58+
$assert( '.codebox/native-agent-task-result.json' === $native_result_path, 'WP Codebox release fixture must declare the controlled native result path.' );
59+
$assert( '.codebox/agent-task-workflow-result.json' === $workflow_result_path, 'WP Codebox release fixture must declare the workflow result path.' );
5660
$producer_package = $read_json( rtrim( $wp_codebox_dir, '/' ) . '/package.json' );
5761
$assert( ( $release['package_version'] ?? null ) === ( $producer_package['version'] ?? null ), 'Checked-out WP Codebox package version must match the release fixture.' );
5862

5963
$workflow = (string) file_get_contents( $root . '/.github/workflows/maintain-docs.yml' );
6064
$assert( preg_match( '/^\s*uses: Automattic\/wp-codebox\/\.github\/workflows\/run-agent-task\.yml@' . preg_quote( $release_tag, '/' ) . '$/m', $workflow ) === 1, 'Docs Agent must call the released WP Codebox workflow tag.' );
6165
$workflow_readme = (string) file_get_contents( $root . '/.github/workflows/README.md' );
62-
$assert( str_contains( $workflow_readme, 'failed run `' . $failed_run . '`' ), 'Workflow documentation must retain the failed-run regression reference.' );
66+
$assert( str_contains( $workflow_readme, 'run `' . $run . '`' ), 'Workflow documentation must retain the regression run reference.' );
67+
68+
$producer_workflow = (string) file_get_contents( rtrim( $wp_codebox_dir, '/' ) . '/.github/workflows/run-agent-task.yml' );
69+
$producer_execute = (string) file_get_contents( rtrim( $wp_codebox_dir, '/' ) . '/.github/scripts/run-agent-task/execute-native-agent-task.mjs' );
70+
$producer_result = $read_json( rtrim( $wp_codebox_dir, '/' ) . '/contracts/agent-task-workflow-result.fixture.json' );
71+
$assert( str_contains( $producer_workflow, $workflow_result_path ), 'WP Codebox producer workflow must upload the workflow result file.' );
72+
$assert( str_contains( $producer_execute, '"--result-file", nativeResultPath' ), 'WP Codebox producer must pass the native result-file argument.' );
73+
$assert( str_contains( $producer_execute, 'const nativeResultPath = join(controlledCodeboxPath, "native-agent-task-result.json")' ), 'WP Codebox producer must constrain the native result path to .codebox.' );
74+
$assert( str_contains( $producer_execute, 'const resultPath = join(workspace, ".codebox", "agent-task-workflow-result.json")' ), 'WP Codebox producer must write the workflow result at the declared path.' );
75+
$assert( 'wp-codebox/agent-task-workflow-result/v1' === ( $producer_result['schema'] ?? null ), 'WP Codebox workflow-result fixture schema mismatch.' );
76+
$assert( 'skipped' === ( $producer_result['status'] ?? null ), 'WP Codebox workflow-result fixture must model the skipped contract.' );
77+
$assert( '.codebox/agent-task-request.json' === ( $producer_result['request_path'] ?? null ), 'WP Codebox workflow-result fixture request path mismatch.' );
6378

6479
preg_match( '/uses: Automattic\/wp-codebox\/\.github\/workflows\/run-agent-task\.yml@[^\n]+\n with:\n(?<inputs>.*?)\n secrets:\n(?<secrets>(?: [^\n]*\n?)*)/s', $workflow, $caller );
6580
$assert( isset( $caller['inputs'], $caller['secrets'] ), 'Docs Agent must declare producer inputs and secrets.' );
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
2-
"tag": "v0.12.5",
3-
"package_version": "0.12.5",
4-
"failed_run": "29295530010"
2+
"tag": "v0.12.6",
3+
"package_version": "0.12.6",
4+
"run": "29296787203",
5+
"native_result_path": ".codebox/native-agent-task-result.json",
6+
"workflow_result_path": ".codebox/agent-task-workflow-result.json"
57
}

0 commit comments

Comments
 (0)