Skip to content

Materialize immutable native runtime sources - #1768

Merged
chubes4 merged 4 commits into
mainfrom
feat/immutable-runtime-sources
Jul 14, 2026
Merged

Materialize immutable native runtime sources#1768
chubes4 merged 4 commits into
mainfrom
feat/immutable-runtime-sources

Conversation

@chubes4

@chubes4 chubes4 commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Closes #1767

Summary

  • Materialize policy-authorized immutable public runtime source trees under a private OS temp root, outside the target workspace and artifacts directory.
  • Support Git-pinned component, provider-plugin, and bundled-library sources plus HTTPS ZIP artifacts for component/provider roles.
  • Authorize exact ZIP URLs independently in EXTERNAL_PACKAGE_SOURCE_POLICY; policy entries can pin the expected SHA-256 separately from caller descriptors.
  • Verify HTTPS transport, exact allowlisting, same-host allowlisted redirects, bounded transfer/extraction, digest-before-extract, one archive root, and ZIP traversal/symlink/special-file/encryption/ZIP64/bomb defenses.
  • Lower sources through existing component/provider/overlay primitives and preserve only compact provenance in uploaded artifacts.
  • Remove private sources after execution, validation failure, process exit, and termination signals.

Compatibility

  • Adds optional runtime_sources HTTPS ZIP descriptors; existing reusable-workflow callers and Git source descriptors remain unchanged.
  • Extends the operator-controlled EXTERNAL_PACKAGE_SOURCE_POLICY v1 schema with optional runtime_artifacts; callers cannot self-authorize artifact URLs or expected digests.

Verified Playground Integration

The CI integration uses only a dummy OPENAI_API_KEY and makes no provider request:

  • Agents API: automattic/agents-api@59d1e6b473f22498e40e279130bbb4f9bcde3b73
  • OpenAI provider: https://downloads.wordpress.org/plugin/ai-provider-for-openai.1.0.3.zip with SHA-256 48f3c0c714b3164cda79d320829830d5a0ea1116e0b19653da8af898a22d3bb6 and archive root ai-provider-for-openai
  • PHP AI Client: wordpress/php-ai-client@631704201d15ffeff7091ad3bc7156db74054956
  • Confirmed WordPress boot, canonical flat agent import using exact slug flat-runtime-agent, Agents API registry, active and registered OpenAI provider, and initialized PHP AI Client.
  • Confirmed private materialization cleanup and upload staging strips private paths while retaining source provenance.

How to test

  1. Run npm run build.
  2. Run npm run test:runtime-sources-materialization.
  3. Run WP_CODEBOX_RUN_NETWORK_INTEGRATION=1 npm run test:runtime-sources-playground-integration.
  4. Run npm run test:agent-task-contracts.
  5. Run npm run test:production-boundary-enforcement.
  6. Run npm run test:runtime-tool-policy.
  7. Run actionlint .github/workflows/run-agent-task.yml .github/workflows/agent-task-contracts.yml.

AI assistance

  • AI assistance: Yes
  • Tool(s): OpenAI gpt-5.6-terra and OpenCode
  • Used for: Implemented and verified immutable runtime-source ZIP materialization, security controls, upload provenance handling, and the real Playground integration with Chris Huber.

@chubes4
chubes4 merged commit 06a4f55 into main Jul 14, 2026
4 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.

Materialize immutable runtime plugin sources for native tasks

1 participant