Skip to content

Fail polyglot qualification when a worker accepts non-Avro task codecs #65

Description

@rmcdaniel

Problem

At sample-app main@111d8ff4c2ad5fd98d8d99a749dc360c9383f4ca, the public polyglot documentation says every durable envelope is Avro and the exact-tuple workflow is green, but the exercised worker boundaries do not prove that contract.

  • polyglot/qualified-artifact-tuple.json still pins Python SDK 2.0.0-rc.20. That published wheel exposes JSON_CODEC, lists JSON as supported existing-data input, and defaults untagged raw blobs to JSON.
  • polyglot/python_worker/activities.py uses task.get("payload_codec") or "avro", so missing and empty task tags are treated as Avro.
  • PHP SDK 2.0.0-rc.30 decodes workflow, activity, and query task arguments without first validating the polled task's root payload_codec. The sample's standalone PHP manual activity/query loops have the same blind spot.
  • The successful published-artifact matrix therefore proves happy-path interoperability, but not rejection of JSON, missing, empty, unknown, or malformed task codec tags.

This can let a stale prerelease or an asymmetric custom worker remain “qualified” after the product declares Avro to be the only public v2 payload codec.

Acceptance criteria

  • In sdk-php, validate the root task payload_codec as exactly avro before workflow, activity, query, or update payload decoding and before user handler execution. Reject missing, empty, JSON, unknown, wrong-case, and non-string values with the stable actionable unsupported-codec diagnostic.
  • In sample-app, apply the same exact check to every manual PHP and Python poll loop. Remove fallback substitution for missing/empty tags without rejecting codec-looking keys in customer-owned payload or metadata.
  • Add focused transport/handler spies proving rejected tasks perform no payload decode or user handler work, while valid Avro tasks continue through every affected workflow/activity/query path.
  • Extend the published-artifact polyglot qualification with deliberate task-level rejection probes for all first-party worker paths. A tuple containing an SDK that still supports JSON or silently defaults an absent task tag must fail qualification.
  • Advance the recorded tuple only to published artifacts that pass those probes, and make the emitted evidence identify the exact head SHA, workflow run, artifact versions, and rejection outcomes.

Complete when

The exact published tuple completes the full happy-path matrix and rejects JSON, missing, empty, unknown, wrong-case, and malformed task codec tags before decoding or handler execution across the PHP and Python paths, with reproducible public qualification evidence.

Required source targets

durable-workflow/sample-app@main
durable-workflow/sdk-php@main

Metadata

Metadata

Assignees

No one assigned

    Labels

    authority:githubGitHub is the authoritative lifecycle record for this workbeta:blockerMust be resolved before the first 2.0 betakind:cross-repositoryWork spans more than one public repositorypriority:P1High-priority product or release riskrepo:sample-appOwned by the sample application repositorystatus:readyReady for implementation

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions