You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if(Object.keys(repositories).length===0&&Object.keys(runtime_sources).length===0)thrownewError("EXTERNAL_PACKAGE_SOURCE_POLICY must authorize at least one repository.")
if(!value||typeofvalue!=="object"||Array.isArray(value))thrownewError("EXTERNAL_PACKAGE_SOURCE_POLICY runtime_sources must be a repositories mapping.")
if(scheme!=="sha256-git-archive-v1"||!DIGEST.test(digest))thrownewError(`${label}.digest must use sha256-git-archive-v1:<64 lowercase hexadecimal characters>.`)
if(!SLUG.test(slug)||!["plugin","mu-plugin"].includes(metadata.loadAs))thrownewError(`${label}.metadata must declare a slug and loadAs plugin or mu-plugin for a component.`)
157
+
if(pluginFile&&!normalizePath(pluginFile))thrownewError(`${label}.metadata.pluginFile must be a safe relative path.`)
158
+
if(activate!==undefined&&typeofactivate!=="boolean")thrownewError(`${label}.metadata.activate must be boolean when provided.`)
if(!SLUG.test(string(metadata.library))||!SLUG.test(string(metadata.strategy)))thrownewError(`${label}.metadata must declare library and strategy for a bundled library.`)
168
+
consttarget=string(metadata.target)
169
+
if(target&&(!target.startsWith("/")||target.split("/").includes("..")))thrownewError(`${label}.metadata.target must be an absolute path without traversal.`)
if(entries.length===0||entries.some((entry)=>!/^100(?:644|755)\s+blob\s+[0-9a-f]{40}\t/.test(entry)))thrownewError("Runtime source must contain only regular files; symlinks and special files are rejected.")
if(descriptor.digest&&sha256GitArchiveV1(archive)!==descriptor.digest)thrownewError("Runtime source archive digest does not match the trusted descriptor.")
Copy file name to clipboardExpand all lines: docs/agent-task-reusable-workflow.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,8 @@ This release-coherence contract fixes [#1759](https://github.com/Automattic/wp-c
55
55
- `wp_codebox_release_ref`: required exact immutable WP Codebox release tag in `vX.Y.Z` form.
56
56
- `external_package_source`: immutable descriptor with `repository`, full commit `revision`, one package-relative `.agent.json` `path`, and `digest`. Packages are supported only from publicly accessible GitHub repositories, fetched from canonical `https://github.com/OWNER/REPOSITORY.git` without credentials. `digest` is exactly `sha256-bytes-v1:<lowercase-sha256>` over the raw file bytes; filenames and JSON content are UTF-8-safe and are not normalized before hashing.
57
57
- `EXTERNAL_PACKAGE_SOURCE_POLICY`: required reusable-workflow secret, supplied by the caller's operator-controlled secret configuration. Its strict version 1 JSON shape is `{"version":1,"repositories":{"owner/repository":["agents/example.agent.json"]}}`. Every entry is an exact standalone `.agent.json` path. The policy is validated in runner memory, is never part of task input, and is not uploaded.
58
+
59
+
`runtime_sources` is an optional versioned JSON array for immutable public runtime dependencies. Each descriptor declares `version: 1`, `role` (`component`, `provider_plugin`, or `bundled_library`), `repository`, a full 40-character `revision`, exact directory `path`, optional `sha256-git-archive-v1` digest, and role metadata. The operator-controlled policy extends the same secret with `runtime_sources`, for example `{"version":1,"repositories":{},"runtime_sources":{"owner/repository":["plugins/example"]}}`. The runner uses unauthenticated Git transport, verifies the commit, tree type, regular-file-only contents, and optional digest, stages outside the target workspace, and removes the staging root after execution. Runtime source descriptors lower into existing component, provider plugin, and runtime overlay inputs; artifacts retain provenance only.
0 commit comments