Skip to content

Add bounded continuation workflows for WordPress abilities #2218

Description

@chubes4

Problem

wordpress.ability executes one registered ability and returns structured JSON, but a recipe cannot use fields from that result in a subsequent invocation. Resumable production abilities therefore require callers to write a CLI loop, direct PHP harness, or manual host orchestration. Those alternate paths hide transport and identity defects and prevent Codebox from reproducing an eventual UI that repeatedly carries an opaque continuation receipt.

The immediate proof case is static-site-importer/import-url: each bounded invocation returns continuation and import_id, and the next invocation must repeat identical intent plus that opaque ID. The primitive must remain product- and ability-agnostic.

Direction

Extend the generic WordPress ability command/workflow contract with bounded continuation policy expressed through JSON Pointer mappings. WP Codebox repeatedly invokes the same ability in the same runtime, evaluates the declared continuation predicate, projects declared result fields into the next input, and records every invocation as evidence.

Acceptance criteria

  • A recipe can declare an initial ability input, a result predicate, result-to-input JSON Pointer mappings, and a maximum invocation count.
  • Every iteration executes the registered WordPress ability through wordpress.ability; no WP-CLI or direct ability-specific PHP loop is required.
  • The runner preserves the same runtime and principal across iterations.
  • Missing/malformed mapped fields, identity changes, non-terminal maximum exhaustion, and ability errors fail closed with structured diagnostics.
  • Output contains bounded per-invocation result/evidence plus the terminal result.
  • Runtime policy and recipe validation remain generic and reject undeclared or unbounded continuation behavior.
  • Integration coverage proves an opaque continuation token is carried through at least three invocations and cannot be replaced by caller-selected architecture fields.
  • The resulting primitive can drive browser/editor evidence steps in the same recipe after terminal completion.

Related runtime proof: #2212 and PR #2217.

AI assistance

OpenAI gpt-5.6-sol via OpenCode inspected the recipe and ability execution boundaries and drafted this issue. Chris Huber remains responsible for the issue and implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions