Skip to content

[feat] Tell a driver which payload fields next and report ignored #1164

Closed

Description

@SaulMoro

Parent: #818

Goal

A driver learns from the response when the CLI did not use part of what it sent.

Problem

parseReport and driverFrom (src/workflow/engine.ts) copy only the fields they know, and drop the rest without notice. Two cases lose data without any signal:

Contract

The success envelope of next and report gets an ignored list. It names each top-level payload field, and each driver.<field>, that this CLI does not read:

{ "data": { "accepted": true, "revision": 4, "step": { "id": "build", "status": "succeeded", "outcome": "success" },
  "ignored": ["tokenz", "driver.region"] } }
  • Names only, never values, because an unknown field may hold anything.
  • Left out when empty, so the envelope of today's drivers does not change.
  • An error envelope stays as it is.
  • The local driver prints ignored to stderr. It should never have any, so a non-empty list there is a bug.

Acceptance criteria

  1. A report with "tokenz": {} is accepted and returns ignored: ["tokenz"]. The run state has no tokenz.
  2. A next whose driver carries "region": "eu" returns ignored: ["driver.region"], and the lease still matches that driver.
  3. A report with only known fields returns an envelope with no ignored key.
  4. teamai workflow report <run> --json '<payload with an unknown field>' from the real CLI prints the field name in the envelope.

Test plan

  • Unit tests on parseReport and parseDriverPayload.
  • A conformance scenario in src/workflow/conformance.ts, because drivers see it (docs/dev/workflow-engine.md). Conformance compares with toMatchObject, so the other scenarios are unaffected.
  • One real-CLI run for the PR body.

Watch out for

  • The e2e tests workflow-inline and workflow-subworkflow compare whole done envelopes with toEqual. done must not gain the key when it is empty.
  • Document ignored next to the outcome paragraph in docs/guide/workflow.md and its zh-CN page.

Dependencies

None.

Activity

  1. hongchuwudi commented on Oct 16, 2026

    @hongchuwudi
    Contributor

    Hi — if this is still open, I'd like to take it. The ticket reads like a complete spec, so I'd implement exactly it: parseReport / parseDriverPayload compute the unread top-level fields and driver.<field> names; the success envelope of next / report gains ignored (names only, omitted when empty, error envelope untouched); and the local driver prints a non-empty list to stderr.

    Plan follows your test plan: unit tests, one conformance scenario, the workflow report --json real-CLI run in the PR, and docs/guide/workflow.md + zh-CN. I'll keep an eye on #1120's engine changes to avoid conflicts.

    @SaulMoro if you're already on it, just say so — otherwise I'll start now.

  2. added 2 commits that reference this issue on Oct 16, 2026
    8e372bd
    8ba82c6
  3. added a commit that references this issue on Oct 16, 2026
    41efe92
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions