Skip to content

fix(workflow): run agent tasks on WP Codebox v0.33.4 - #185

Merged
chubes4 merged 1 commit into
mainfrom
chore/wp-codebox-v0.33.4
Nov 15, 2026
Merged

chubes4 merged 1 commit into
mainfrom
chore/wp-codebox-v0.33.4

Conversation

@chubes4

@chubes4 chubes4 commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Refs Automattic/wp-codebox#2567

Summary

maintain-docs.yml called WP Codebox run-agent-task.yml at a6fe2d208e990a8d04104aa74aacbb8d1539fbc1 (release v0.12.29). On that revision, agent workspace writes could fail to reach the host workspace without any trace, and the uploaded transcript was a 248-byte stub (wp-codebox#2567). This PR moves Docs Agent to v0.33.4, which includes wp-codebox#2588 (merge commit ded3cbc08a810b34fc7912824e30598b1efa7b5d).

  • refs/tags/v0.33.4 points to annotated tag 678b7773f9ce781f14af3158a5361f3f97171f6a, which dereferences to commit 126f85b2a8b887ae8e2457d1cb71b15ebdb712cd ("release: v0.33.4", the direct child of ded3cbc0).
  • uses:, wp_codebox_workflow_ref, and the validate.yml producer checkout all pin 126f85b2…. wp_codebox_release_ref is v0.33.4.

Changes

  • .github/workflows/maintain-docs.yml and validate.yml: new pins.
  • tests/wp-codebox-release.fixture.json: new tag, revision, producer revision, and package version. Published asset digests now cover all three v0.33.4 assets: wp-codebox-cli-linux-x64.tar.gz, wp-codebox-workspace-0.33.4.tgz, and wp-codebox.zip. I took them from the release API's digest field and checked them against sha256sum of the downloaded files; all three matched. I also added three coverage flags for the v0.33.4 behaviour (see below).
  • tests/validate-wp-codebox-run-agent-task-contract.php:
    • Updated the digest expectation.
    • Added an assertion that the release tag commit equals the producer revision.
    • The old negative test for "mismatched producer revision" swapped the producer SHA for the tag SHA. Those SHAs are now identical, so the test passed vacuously. It now swaps in ded3cbc0…, a plausible but non-release SHA, and a second case checks for a helper ref that diverges from uses:.
    • Added producer assertions for workspace_apply (wp-codebox/runner-workspace-apply-outcome/v1), writes-not-applied failing closed at stage: apply, verification being skipped after an apply failure, the rejected_paths list, the decoded transcript with the write ledger, workspace_apply in the reviewer-safe projection, metadata.runner_workspace_publication with pull_request.url, and callback_data.
    • Dropped version-specific wording from messages.
  • tests/validate-docs-agent-packages.php: new pins. The README assertion for the "private package-recovery manifest" now checks that the apply outcome is documented instead. That manifest no longer appears anywhere in WP Codebox source or in the v0.33.4 release.
  • README.md and .github/workflows/README.md: rewrote the WP Codebox sections to describe v0.33.4. I condensed the v0.12.25–v0.12.29 changelog paragraphs into one paragraph of inherited behaviour, removed the obsolete split between the release tag and the producer revision, and documented the new apply outcome, glob semantics, transcript, and publisher behaviour. I also corrected the README claim that "a write-tool call that leaves no byte diff produces no_changes", which v0.33.4 changes.

Compatibility review (a6fe2d2 → 126f85b)

  • Interface: run-agent-task.yml and contracts/run-agent-task-reusable-workflow-interface.v1.json are byte-identical between the two revisions, so inputs, secrets, and outputs are unchanged. All of the producer-side change is in .github/scripts/run-agent-task/*.
  • Helper version check: the helper checkout's package.json reports 0.33.4, which matches wp_codebox_release_ref: v0.33.4. The executor now imports scripts/process-marker.mjs. The workflow does a full checkout of the helper ref, so that file is available.
  • Still present: metadata.runner_workspace_publication.pull_request.url, output_projections (optional-projection skip still in place), callback_data, typed artifact_declarations and required-only-when-required: true, and the declared-artifact upload allowlist. No Docs Agent workflow logic needed to change.
  • Behaviour changes Docs Agent inherits (now documented):
    1. If the sandbox accepted write calls but the canonical patch declared no changes, the run fails at stage: apply with writes-not-applied. In that case verification, drift, and the completion check do not run. A maintenance pass that rewrites a file with identical bytes therefore fails, where it used to produce no_changes. Runs with no write calls are unaffected.
    2. Sandbox and host now share one writable-path glob matcher. ** spans directories, and *, ?, and [...] stay within one segment. Patterns like docs/**/*.md and plugins/*/docs/user/** now match on the host too.
    3. The publisher reuses the existing branch only if it has an exact open PR that descends from the current base. If the branch exists without an open PR, it publishes to a fresh <branch>-<base-sha-12> branch. If the open PR's branch is behind the base, publication fails and asks for a rebase.
    4. Failed native executions keep stdout and stderr tails in the internal result. The reviewer-safe projection still exposes only the truncation flags.
  • Not changed here: the publication head is still branch_prefix + run_id. With branch_prefix set to docs_branch, that yields <docs_branch><workload_id>. This is the same on both revisions and out of scope.

wp-codebox#2588 is a Refs, not a Fixes. It makes lost writes fail loudly with path evidence and fixes the glob mismatch, but the issue stays open until a real run confirms the fix.

Verification

Run locally on PHP 8.4, with WP_CODEBOX_DIR pointing at a wp-codebox checkout of 126f85b2…:

  • php tests/validate-docs-agent-packages.php: passed
  • php tests/validate-docs-agent-completion-contract.php: passed
  • php tests/validate-external-native-package-sources.php: passed
  • php tests/validate-wp-codebox-run-agent-task-contract.php: passed. Run against the old a6fe2d2 checkout, it fails as expected (package version mismatch), and the new producer strings are absent there.
  • php tests/repair-docs-links-smoke.php: passed
  • AGENTS_API_DIR=<agents-api@78e2dd4> php tests/native-agent-import.php: all 42 assertions passed
  • actionlint 1.7.12: clean
  • Baseline: all of the above passed on main against a6fe2d2 before the change.

I have not done a live agent run against v0.33.4.

AI assistance: Extra Chill Bot (Claude), via a Roadie subagent.

Pin run-agent-task.yml, its helpers, and the release ref to the v0.33.4 tag commit 126f85b2a8b887ae8e2457d1cb71b15ebdb712cd. Refs Automattic/wp-codebox#2567.

AI assistance: Extra Chill Bot (Claude), via a Roadie subagent.
@chubes4
chubes4 merged commit 07f990b into main Nov 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant