Skip to content

feat: implement 'requires_escalation' triggered by risk signals#9

Closed
0x8000-0000 wants to merge 3 commits into
Universal-Commerce-Protocol:mainfrom
0x8000-0000:task-ucp-3
Closed

feat: implement 'requires_escalation' triggered by risk signals#9
0x8000-0000 wants to merge 3 commits into
Universal-Commerce-Protocol:mainfrom
0x8000-0000:task-ucp-3

Conversation

@0x8000-0000

Copy link
Copy Markdown
Contributor

Description

Why:
- To enable conformance testing of the checkout escalation flow according to spec.
- Provides a deterministic way to trigger 'requires_escalation' via 'risk_signals' payload in 'complete_checkout'.

What:
- Removed hardcoded buyer name check.
- Updated 'complete_checkout' to check for 'simulation_trigger': 'escalation_required' in 'risk_signals'.
- When triggered, returns 200 OK with status 'requires_escalation', 'continue_url', and 'requires_buyer_input' message, instead of completing the order.

Type of change

Please delete options that are not relevant.

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

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules - this depends on feat: implement 'requires_escalation' triggered by risk signals samples#25 which is not merged yet.

@0x8000-0000
0x8000-0000 requested a review from a team January 17, 2026 00:12
Why:
- To verify that the server correctly implements the 'requires_escalation' status when risk checks fail during completion.
- Ensures conformance with the checkout status lifecycle.

What:
- Added 'test_escalation_flow' to 'CheckoutLifecycleTest'.
- Triggers escalation by sending 'simulation_trigger': 'escalation_required' in 'risk_signals' during 'complete_checkout'.
- Asserts that status becomes 'requires_escalation' and 'continue_url' is present.
msg="Should not be able to cancel a completed checkout.",
)

def test_escalation_flow(self):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this better fits checkout_lifecycle_test.py

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or validation test

@nearlyforget
nearlyforget requested review from a team and semenovm February 28, 2026 01:47
@damaz91 damaz91 added status:needs-triage Signal that the PR is ready for human triage status:stale Applied when PR is waiting for author response for 30 days labels Jul 7, 2026
@damaz91 damaz91 removed the status:needs-triage Signal that the PR is ready for human triage label Jul 20, 2026
@damaz91 damaz91 closed this Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:stale Applied when PR is waiting for author response for 30 days

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants