Skip to content

Goal: SDK contracts for authenticated user portal surfaces #4

Description

@KazanderDad

Parent: Sprint: Production-ready authenticated MyPayTag user portal
Brainstorm/Architecture Task: Define SIWC user portal architecture and API contracts
Sequence: Goal 1 of 6

Objective

Add or update canonical SDK protocol and OpenAPI contracts required by the authenticated user portal, if the architecture task determines these surfaces are public or cross-repo contracts.

Execution Tasks

  • Add user preference and history protocol schemas and validators.
  • Refresh generated artifacts, fixtures, examples, OpenAPI, Postman, and conformance checks.

Sequence Context

  • Depends on: architecture/API-contract task.
  • Enables: backend and site implementation to consume stable typed contracts.
  • Run independently by: a fresh Codex thread after the architecture task is complete.

Non-Goals

  • Do not expose private backend-only operational fields in public SDK contracts.
  • Do not publish Cubid-owned grant, stamp issuance, or identity lifecycle internals as MyPayTag user portal APIs.

Guardrails

  • Public contracts must not include raw wallet graph data, provider secrets, private diagnostics, service-role concepts, or Cubid internals beyond approved identity/session references.
  • Existing NEAR 1Click MVP constraints and Phase 2 solver boundaries must remain intact.

Expected Codebase Surfaces

  • api/openapi.yaml
  • packages/protocol/schemas/*
  • packages/protocol/src/index.ts
  • packages/protocol/src/validators.ts
  • packages/protocol/src/fixtures.ts
  • packages/protocol/src/protocol.test.ts
  • packages/sdk/src/*
  • packages/provider-sdk/src/* when provider-facing history or receipt contracts require it
  • scripts/generate-postman-collection.mjs
  • Examples under examples/* when public integration flows change

Acceptance Criteria

  • Preference, quote detail, selected quote, payment intent summary, and transaction/receipt summary contracts exist where the architecture task says they belong in the SDK.
  • OpenAPI, JSON Schemas, generated TypeScript, fixtures, validators, and examples agree.
  • Unsupported/private backend details are excluded from public contracts.
  • Generated artifacts are refreshed through repo scripts, not hand-edited.

Validation Plan

  • pnpm validate
  • Source review for browser/public-boundary leakage.

Child Tasks

  • Add user preference and history protocol contracts.
  • Refresh generated artifacts and SDK validation evidence.

Risks And Mitigations

  • Risk: contracts drift from backend implementation. Mitigation: make backend implementation depend on this Goal or explicitly document backend-only surfaces.

Stop Condition

Stop when SDK contracts are either updated and validated or the architecture task documents that no SDK changes are required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions