Skip to content

Add browser task contract ability#551

Merged
chubes4 merged 1 commit into
mainfrom
fix/issue-546-browser-session-phases
Jun 3, 2026
Merged

Add browser task contract ability#551
chubes4 merged 1 commit into
mainfrom
fix/issue-546-browser-session-phases

Conversation

@chubes4
Copy link
Copy Markdown
Collaborator

@chubes4 chubes4 commented Jun 3, 2026

Summary

  • Adds wp-codebox/create-browser-task-contract as a product-facing browser Playground contract that composes a primary browser session plus optional named phases.
  • Supports generic materializer phases by reusing the existing browser materializer contract, sharing the parent session id by default, and preserving the disposable Playground/sandbox-bypass boundary.
  • Extends plugin smoke coverage for registration, authorization, phase composition, session sharing, and unsupported phase rejection.

Refs #546.

Proposed API shape

{
  "goal": "Generate or transform a browser Playground artifact.",
  "authorization": {
    "schema": "wp-codebox/trusted-orchestrator-authorization/v1",
    "caller": "product-id",
    "scope": "browser-session:create"
  },
  "sandbox_session_id": "product-session-id",
  "runtime": {},
  "browser_runner": {},
  "phases": [
    {
      "name": "static-site-materializer",
      "kind": "materializer",
      "input": {
        "goal": "Materialize the generated artifact bundle.",
        "runtime": {},
        "browser_runner": {}
      }
    }
  ]
}

Returns wp-codebox/browser-task-contract/v1:

  • primary: the normal wp-codebox/browser-playground-session/v1 response.
  • phases[]: named phase envelopes; materializer phases contain the existing wp-codebox/browser-materializer-contract/v1 under contract.
  • session: the primary session envelope for external orchestrator correlation.

Verification

  • php -l packages/wordpress-plugin/src/trait-wp-codebox-abilities-execution.php
  • php -l packages/wordpress-plugin/src/trait-wp-codebox-abilities-schemas.php
  • php -l packages/wordpress-plugin/src/class-wp-codebox-abilities.php
  • npm run build
  • npm run wordpress-plugin-smoke (OK (369 assertions))

AI assistance

  • AI assistance: Yes
  • Tool(s): OpenCode (GPT-5.5)
  • Used for: Drafted the browser task contract ability, schema, smoke coverage, and verification steps for Chris to review.

@chubes4 chubes4 merged commit 99d47a4 into main Jun 3, 2026
@chubes4 chubes4 deleted the fix/issue-546-browser-session-phases branch June 4, 2026 20:59
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