← 返回
未分类 中文

a2a-Market-Order-State-Machine

Define order lifecycle states, transition guards, and recovery paths for A2A transactions. Use when implementing order orchestration from quote acceptance th...
定义A2A交易的订单生命周期状态、转换守卫及恢复路径,适用于从报价接受到履约完成的订单编排实现。
luoqianchenguni-max
未分类 clawhub v0.2.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 558
下载
💾 0
安装
1
版本
#latest

概述

a2a-Market Order State Machine

Define the canonical order lifecycle and transition guard framework.

Current status: first-release scaffold for early protocol compatibility.

Scope

  • Model order states from creation to completion/cancelation.
  • Enforce legal transitions with guard checks and side effects.
  • Integrate payment and reputation triggers into state changes.

Suggested Project Layout

  • app/domain/order/order_state.py
  • app/domain/order/order_aggregate.py
  • app/application/usecases/transition_order.py
  • app/application/services/order_event_publisher.py

Minimum Contracts (MVP P0)

  1. create_order(intent_id, accepted_quote_id) initializes order in CREATED.
  2. transition(order_id, action, actor, payload) validates and applies state move.
  3. get_order_timeline(order_id) returns ordered transition history.
  4. recover_pending_orders(now_ts) handles timeout and stuck states.

Base States

  • CREATED
  • NEGOTIATING
  • PAYMENT_PENDING
  • PAID
  • FULFILLING
  • COMPLETED
  • CANCELED
  • FAILED

Events

  • Emit ORDER_CREATED at initialization.
  • Emit ORDER_COMPLETED when terminal success is reached.
  • Emit reputation update trigger after completion/cancel resolution.

Implementation Backlog

  • Add compensation transitions for partial fulfillment failures.
  • Add deterministic replay from event store snapshots.

Runtime Implementation

  • Status: implemented in local runtime package.
  • Primary code paths:
  • runtime/src/domain/order-state-machine.js
  • Validation: covered by runtime/tests and npm test in runtime/.

版本历史

共 1 个版本

  • v0.2.0 当前
    2026-03-30 11:23 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

a2a-Market-Stripe-Payment

luoqianchenguni-max
集成 Stripe 支付意图、捕获流程和 webhook 对账,适用于 A2A 订单的支付授权、捕获及退款流程实现。
★ 0 📥 883

a2a-Market-ACP-Lite-Negotiation

luoqianchenguni-max
仅网关ACP协商技能,支持可选OpenClaw模型驱动轮次决策
★ 0 📥 649

a2a supermarket

luoqianchenguni-max
RealMarket A2A 商业工作流的统一入口技能,支持卖家发布商品、买家通过 UCP 市场连通发现商品,并提供更多功能。
★ 0 📥 630