Skip to content

Correct documented workflow duplicate policies to the Server contract #163

Closed

Description

@rmcdaniel

Python's public Client.start_workflow docstring tells callers to use duplicate_policy="reject", "allow" or "terminate_existing". The PHP Server start route accepts "fail" and "use-existing". The SDK forwards the supplied value unchanged, so following any of the documented choices reaches a different request contract.

Exact source:

P2 documentation contract defect. A static AST/request-rule comparison confirms all three documented choices are outside the PHP route's allowed set. No live or normally installed request was sent for this finding, and native parity is unqualified.

Acceptance:

  • Correct the SDK docstring and any examples to the actual supported wire choices. Explain default, active duplicate and closed-run behavior from the named supported runtime contract.
  • Preserve current runtime behavior; do not silently add terminate_existing, import another engine's reuse policies or change lifecycle semantics to make obsolete prose true.
  • Add a focused behavior check of the SDK request shape against supported policy values and qualify ordinary installed-client requests against one named published PHP Server baseline. Include invalid legacy values and current fail/use-existing outcomes; preserve originals and side effects.
  • Explain that a resource-keyed workflow ID coordinates admission, not a global physical mutex that revokes downstream work after termination. Link any broader resource-lock recipe separately.

Metadata search found no existing owning issue for this parameter/documentation mismatch. Registration-name duplicate handling is a different boundary.

Activity

  1. added
    documentationImprovements or additions to documentation
    priority:P2Normal-priority product work
    status:readyReady for implementation
    status:in-progressApproved work is actively being implemented or validated
    and removed
    status:readyReady for implementation
    on Oct 19, 2026
  2. rmcdaniel commented on Oct 19, 2026

    @rmcdaniel
    MemberAuthor

    Taking this documentation contract correction. The qualification baseline will
    be normally installed Python SDK 2.6.0 and published PHP Server 2.9.5 / Core
    2.6.2. Runtime behavior and lifecycle policies remain unchanged.

    Source review confirms the omitted policy maps to fail, and use-existing
    returns only a Pending/Running/Waiting current run. An already closed run is
    rejected. Duplicate attempts intentionally record accepted/rejected start audit
    events, so the checks must preserve the original run, input, deadlines and
    business effects while allowing that documented audit suffix. They must not
    incorrectly require the complete history to remain byte-identical.

    Next: exercise omitted/canonical/invalid documented values through the ordinary
    installed client for active and completed originals, then correct the docstring
    and guide using those outcomes. HTTP behavior and native parity are not yet
    claimed by this source review.

  3. rmcdaniel commented on Oct 19, 2026

    @rmcdaniel
    MemberAuthor

    Candidate #165, exact f7635dec70c9620ea0988439eca7eed0c1c0d559 / whole 2180b2bcb9d93d0ca2bacdae9e49b6ba82e0ad65, now passes:

    • 257 focused error/client tests, Ruff, strict developer-portal build.
    • All six real Server policy cases from a normally built/installed candidate wheel, Python3.12.15, unchanged published PHP Server2.9.5 index f5771101fc55a3e1e8f8bd572beb1d57f593c05db5e5760f0773f75a96fe7ebb / Core2.6.2.
    • Three completed originals, one each initially omitted/fail/use-existing. Every one retains one run and one exact int64/null/Unicode business result. Active duplicate statuses are409/409/200; completed duplicate statuses409/409/409; each obsolete policy is422 in both states. The current 409 now raises WorkflowAlreadyStarted with the exact workflow ID.
    • Exact original input and microsecond deadline values remain unchanged during each state. Existing history prefixes remain intact; canonical duplicates append only their StartAccepted/StartRejected audit event. Invalid policy requests append none. Three independent fresh invalid-policy IDs remain nonexistent.

    Counterfactuals are separate: published PyPI2.6.0 passes the same lifecycle checks using its actual generic409 exception, while the typed current-reason assertion fails. The historical mapping and unrelated-conflict controls pass. The first three typed originals stopped at that mismatch; their later assertions did not execute.

    Only the duplicate-reason mapping changes runtime behavior. No aliases, termination, lifecycle changes, native qualification or Cloud adoption are introduced. Exact hosted checks, immutable2.6.1 publication/normal installation and deployed portal readback remain pending before closing #163/#164.

  4. rmcdaniel commented on Oct 19, 2026

    @rmcdaniel
    MemberAuthor

    Delivered in Python 2.6.1

    #165 merged at 150c6f6bc14e3516f75cc615b2f75f093ed84ea1, tree de9f5fdf400f45a3be25a08fd27f0cf6fb9ccd9a, identical to the qualified candidate.

    • All 15 candidate checks and 19 current-commit checks pass, including independent fresh-main CI.
    • Protected publication and immutable 2.6.1 release pass. Annotated tag 4d4ab4543813988748d949086af47d8dbb0d8392 targets the exact merge. PyPI wheel SHA256: 94f55ba59de27719ba487c648894d5231823abbe44dc65231e3b26575cc1b355.
    • A normal PyPI install passes all six live policy cases against published PHP Server 2.9.5 / Core 2.6.2. Installed client/error files match the release source. Three originals preserve their run, input, exposed deadlines and exact int64/null/Unicode result, with one completion each. Active use-existing returns the original; closed duplicates refuse. Obsolete values return 422 without admission or mutation. Canonical duplicates retain their explicit start-audit suffixes.
    • The guide, client reference and error reference are deployed and read back. Deployment audit identifies this source and SDK 2.6.1; installed help is corrected too.
    • Sonar PR gate passes with zero open/confirmed issues and 0% new duplication. Its valid assertion finding was fixed without changing settings.

    Only the duplicate-reason exception mapping changes runtime behavior. Policy values, admission, lifecycle, encoding and dependencies stay unchanged. The published-client typed failures remain their original failures. Initial local installation/setup failed before business admission; the subsequent normal public-index install and six fresh cases pass. A direct CI-log download timed out, so no full remote-log audit is claimed.

    All local test resources, databases, dependencies and raw output are retired; runtime roles exited 0 without OOM. Borrowed images and other owners are protected. The merged remote head is independently 404. Sample's qualified tuple stays separate; Cloud's owner retains adoption. Acceptance for #163 and #164 is complete.

  5. added
    status:doneDerived from the authoritative closed issue state
    and removed
    status:in-progressApproved work is actively being implemented or validated
    on Oct 19, 2026
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

    documentationImprovements or additions to documentationpriority:P2Normal-priority product workstatus:doneDerived from the authoritative closed issue state

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions