Skip to content

test: check ready_for_complete carries no Action instead of requiring it - #134

Open
div-cowboy wants to merge 1 commit into
Universal-Commerce-Protocol:mainfrom
div-cowboy:test/ready-for-complete-no-outstanding-action
Open

div-cowboy wants to merge 1 commit into
Universal-Commerce-Protocol:mainfrom
div-cowboy:test/ready-for-complete-no-outstanding-action

Conversation

@div-cowboy

@div-cowboy div-cowboy commented Nov 17, 2026 •

Copy link
Copy Markdown

Description

#117 added test_ready_for_complete_when_nothing_is_outstanding, which fails a
server that completes a checkout without first reporting ready_for_complete.
The spec doesn't require that. In the review of
Universal-Commerce-Protocol/ucp#1083, the maintainers pointed out that a
Business may stay incomplete or raise requires_escalation for reasons
outside the protocol, such as risk assessment or policy. The spec says when a
Business cannot report ready_for_complete, but it never says when it must.
I said in that review that I'd follow up here.

This change replaces that test with
test_ready_for_complete_has_no_outstanding_action, which checks the rule the
spec does state. The status definition in the checkout spec says
ready_for_complete means "No Action remains outstanding." The test builds the
same checkout as before (buyer, selected fulfillment option) and reads it with
Get Checkout:

  • If the status is ready_for_complete, actions must be empty.
  • If the status is anything else, the test skips. It makes no claim about which
    status the Business should have chosen.

test_complete_checkout already covers completing this checkout, so the old
test's completion step is removed rather than duplicated.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • My code follows the style guidelines of this project (ruff format,
    ruff check, codespell pass)
  • I have performed a self-review of my own code
  • New and existing tests pass locally with my changes

Run against the Python sample server (samples main, python-sdk
v2026-04-08-6, flower_shop fixtures, as in conformance-tests.yml):

Suite Result
shopping.checkout.lifecycle_test.CheckoutLifecycleTest 12 of 12 passed, 0 skipped
--suite=all 83 run: 81 passed, 2 skipped, 0 failed

The Python sample server reports ready_for_complete for this checkout, so
the new assertion runs on it rather than skipping. I haven't run it against
the Node sample server. A server that stays incomplete will now skip this
test instead of failing it.

🤖 Generated with Claude Code

The spec defines ready_for_complete as a state with no outstanding
Action, but it does not require a business to reach that status: a
business may stay incomplete or escalate for risk, policy or other
reasons. Assert the direction the spec states and skip when the
business reports another status.
@div-cowboy
div-cowboy marked this pull request as ready for review November 17, 2026 19:45
@damaz91 damaz91 added the status:needs-triage Signal that the PR is ready for human triage label Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:needs-triage Signal that the PR is ready for human triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants