Skip to content

Replace legacy pending-action resolved hook payload with canonical Agents API action #2222

@chubes4

Description

@chubes4

Problem

WordPressActionDispatchObserver receives canonical Agents API pending-action objects, but on_resolved() still builds and emits a legacy Data Machine payload shape.

Code references on origin/main (008878b6):

  • inc/Engine/AI/Actions/WordPressActionDispatchObserver.php:25 — builds $payload = $this->legacy_payload( $action ).
  • inc/Engine/AI/Actions/WordPressActionDispatchObserver.php:45legacy_payload() maps Agents API action data into old DM field names.

Related closed issue: #1928.

Why this matters

The observer interface is already object-shaped. Keeping the old hook argument contract alive duplicates pending-action shapes and makes extension consumers pick between old arrays and canonical objects.

Acceptance criteria

  • Audit current consumers of datamachine_pending_action_resolved.
  • Decide the 1.0 hook signature: canonical WP_Agent_Pending_Action / decision object, or legacy array retained intentionally.
  • Remove legacy_payload() if no longer needed, or move legacy details under metadata.datamachine with clear docs.
  • Update docs/tests for the final hook signature.

AI assistance

  • AI assistance: Yes
  • Tool(s): OpenCode (GPT-5.5)
  • Used for: 1.0 technical-debt audit and issue drafting; Chris requested tracking issues for the findings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    1.0-blockerBlocks the Data Machine core 1.0 releasearchitectureFoundational architecture changes

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions