Skip to content

Declare canonical x402 ownership and remove cross-repo settlement drift #32

Description

@reprewindai-dev

Why

x402 behavior is currently implemented or described in multiple places across Veklom: cAPI ADRs, BYOS middleware/router code, CAPPO payment middleware, VCCP demo lease logic, Veklom-ID bindings, and legacy/archived PayAPI surfaces.

docs/ADR-005-X402-ESCROW.md already says cAPI does not own the escrow and that its location in cAPI is only because cAPI currently holds the cross-platform ADR registry. That ownership boundary now needs to be made operational, not just documented.

Required architecture decision

Create/update the cross-platform x402 architecture record so each responsibility has exactly one owner:

  • payment challenge/discovery
  • payment verification/facilitator integration
  • settlement persistence/replay protection
  • capability authorization after payment
  • execution
  • evidence/receipt generation
  • external verification endpoint
  • pricing manifest/source of truth
  • escrow (if/when separately authorized)

For every non-owner repo, define whether its x402 code is:

  • adapter/client,
  • compatibility layer,
  • demo,
  • deprecated/archive.

Required cleanup map

At minimum review:

  • cAPI/docs/ADR-005-X402-ESCROW.md
  • BYOS backend/core/middleware/x402.py
  • BYOS backend/apps/api/routers/x402.py
  • BYOS archived payapi_compliance.py
  • CAPPO cappo_backend/services/x402_payment.py
  • VCCP src/server/x402-engine.ts
  • Veklom-ID x402 identity bindings

Guardrails

  • Do not allow multiple hard-coded pricing manifests to present themselves as authoritative.
  • Do not let an archived/demo implementation satisfy production capability discovery.
  • Settlement success alone must not be documented as proof of successful capability execution.
  • External verification must bind payment + capability/version + governed execution + output/evidence.

Acceptance criteria

  • ADR names one canonical owner/source of truth per x402 responsibility.
  • Every duplicate implementation has an explicit keep/adapter/archive/remove disposition.
  • Runtime docs link to the canonical implementation instead of reproducing divergent flows.
  • Cross-repo contract tests cover the public challenge and evidence/receipt schema.
  • Follow-up cleanup issues are linked from this issue, including BYOS #173/#174 and VCCP Covenant — the governed connection layer (runtime + premium console) #1.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions