- Use a hard cutover approach. Do not preserve dead compatibility layers.
- Do not add feature flags, dual-write paths, or temporary fallback code unless explicitly requested.
- If an interface or wire shape changes, remove the old path in the same change unless a live dependency is explicitly named.
- This is a Node 20+ TypeScript npm workspace.
- Main packages:
apps/api: Express gatewayapps/worker: async job poller and refund workerpackages/shared: shared types, route registry, docs, auth, payment helpers, and storespackages/cli: buyer CLI
- Public marketplace scope is Fast-only for v1.
- Paid trigger routes are
POST /api/:provider/:operation. - Free retrieval is
GET /api/jobs/:jobTokenwith wallet-bound auth. - Auth is a temporary wallet challenge/session flow, not a permanent API key system.
- Refunds are treasury-based. There is no buyer marketplace balance.
- Prefer making cross-cutting changes in
packages/sharedfirst, then wire API, worker, and CLI to the shared contract. - Keep the route registry, OpenAPI output,
llms.txt, and.well-known/marketplace.jsongenerated from the same source of truth. - If pricing changes, update payout split handling and related tests in the same change.
- Persist payout split data at charge time; do not defer that calculation to payout time.
- Keep Postgres and the in-memory test store behavior aligned.
- Pin
@fastxyz/*dependencies to exact versions inpackage.jsonfiles; do not use caret ranges for the Fast package set.
- Production deployment is expected to run separate services for:
- API
- worker
- PostgreSQL
- x402 facilitator
- The CLI is not deployed server-side.
- API runtime depends on:
DATABASE_URLMARKETPLACE_TREASURY_ADDRESSMARKETPLACE_FACILITATOR_URLMARKETPLACE_SESSION_SECRET- optional
MARKETPLACE_BASE_URL
- Worker runtime depends on:
DATABASE_URL- optional
FAST_RPC_URL MARKETPLACE_TREASURY_PRIVATE_KEYorMARKETPLACE_TREASURY_KEYFILE- optional
WORKER_POLL_INTERVAL_MS
- Run
npm run buildafter code changes. - Run
npm testafter behavior changes. - Do not mark work complete if build or tests are broken unless you explicitly call that out.