Skip to content

Add workflow result artifacts/logs fields#405

Merged
chubes4 merged 1 commit into
mainfrom
feat-workflow-result-artifacts
Jul 3, 2026
Merged

Add workflow result artifacts/logs fields#405
chubes4 merged 1 commit into
mainfrom
feat-workflow-result-artifacts

Conversation

@chubes4

@chubes4 chubes4 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #403.

Adds first-class artifacts and logs arrays to WP_Agent_Workflow_Run_Result so workflow consumers no longer need to smuggle those values through free-form metadata.

Motivation

Downstream Data Machine workflow recording currently copies artifacts and logs out of metadata because the Agents API workflow result contract has no dedicated fields:

This PR makes the contract explicit while keeping the persistence model storage-neutral and table-free.

Design

  • Adds normalized list fields artifacts and logs to WP_Agent_Workflow_Run_Result.
  • Preserves those fields through construction, from_array(), to_array(), with(), runner options, and recorder payloads.
  • Maps workflow artifacts into canonical run result envelope artifact_refs.
  • Adds first-class logs support to the canonical run result envelope so logs do not get re-buried in metadata at that boundary.
  • Updates the agents/run-workflow input/output schemas to document and expose the new fields.

Back compatibility

This is additive only:

  • Existing constructor argument order is preserved; new arguments are appended.
  • Existing serialized results without artifacts or logs default both fields to empty arrays.
  • Existing metadata passthrough remains untouched, including metadata keys named artifacts or logs.
  • Existing evidence_refs behavior remains unchanged.

Test evidence

  • php tests/workflow-runner-smoke.php passed: 67 passed, 0 failed.
  • php tests/agents-workflow-ability-smoke.php passed: 27 passed, 0 failed.
  • php tests/run-result-envelope-smoke.php passed: 23 assertions passed.
  • composer test passed.
  • composer phpstan passed: No errors.

AI assistance

  • AI assistance: Yes
  • Tool(s): opencode — Claude Fable 5 (Anthropic) orchestrator, GPT 5.5 (OpenAI) implementation subagent
  • Used for: Implemented the additive workflow result contract fields, tests, verification, and PR preparation.

@chubes4 chubes4 merged commit 80c3540 into main Jul 3, 2026
2 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.

WP_Agent_Workflow_Run_Result lacks first-class artifacts/logs fields — consumers smuggle them through metadata

1 participant