dea78f6eeb
test: pin checkout test clock and cover x402_nonces in schema test
...
Checkout fixtures are dated 2026-09-29 but expiry reads the wall clock, so
24 tests started failing once the real date passed the checkout window.
The schema test predated the x402_nonces table, which is keyed by the
claimed authorization instead of id.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 19:36:07 +03:00
ec04f3ddb5
feat(persistence): Postgres store for onchain subscriptions, charges and escrow
...
Migration 0010 adds onchain_subscriptions, onchain_charges (UNIQUE per
subscription+period) and onchain_escrow_payments. PgOnchainBillingStore
claims a period under a row lock so API and worker replicas can never
charge the same period twice. Adds shared access hooks (extend/suspend
core subscription, record payments, expire entitlements) and links
escrow payments to their checkout session.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 20:19:14 +03:00
06dea43c94
feat: enforce one payment per on-chain tx hash with a partial unique index
...
Replace payments_tx_hash_idx with a unique index on payments.tx_hash
(WHERE tx_hash IS NOT NULL) so a transaction can settle at most one
payment across processes. Migration 0009 + schema test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 14:59:08 +03:00
286ae8c8fc
feat(api): agent + job registry — full Pg persistence (Phase 2.1/2.2)
...
- database: agent_registry + agent_jobs tables, migration 0008 (verified on Postgres: tables + indexes).
- persistence: AgentRegistryStore/AgentJobStore + InMemory + Pg impls (document-projection, org-scoped).
- api: org-scoped /v1/agents (register/list/get/feedback) + /v1/jobs (create/list/get/transition) with a forward-only lifecycle guard; wired into context (pick Pg/InMemory) + mounted under the api-key guard.
- Roadmap Phase 2 complete — all 5 phases shipped. 1308 tests / 213 suites, typecheck + build green; migrations 0006–0008 verified on a throwaway Postgres.
2026-06-21 12:22:44 +03:00
9229638cea
feat(auth): wire web3 wallet login end-to-end (API + dashboard + Pg store)
...
- apps/api: POST /v1/auth/wallet/nonce + /v1/auth/wallet/login (zod-validated, sets the signed sk_session cookie like password/magic-link).
- apps/dashboard: 'Connect Wallet' SIWE sign-in (plain viem + EIP-1193 personal_sign, no heavy deps) on login + signup; lib/auth wallet helpers.
- persistence: PgAuthStore.findAccountByWallet/saveWalletNonce/consumeWalletNonce (atomic single-use consume); accounts.wallet_address projection.
- database: auth_accounts.wallet_address column + auth_wallet_nonces table, migration 0006_auth_web3 + journal; re-export gt/lt operators.
- 1302 tests / 213 suites, typecheck + full build green.
2026-06-21 00:09:44 +03:00
pextacy
71e89bdfd8
feat(lepton): attribution package (RFB 6.01) + creator-dashboard
...
Adds @settlekit/attribution — reuse-detection, weighted provenance lineage,
and HMAC-signed proofs-of-citation — wired live into the rsshub-citation-toll
sidecar (POST /attribution/{detect,proof,verify}) and persisted via
PgLineageStore/PgProofStore over new lepton_lineage_edges + lepton_citation_proofs
tables.
Adds apps/creator-dashboard — a Next.js earnings view in the Statement
greenbar-ledger design system, driven by real domain logic (createSource +
computeRoyaltyDistribution + detectReuse, not mocks). Statement / Sources /
Payouts / Reuse & proofs (interactive) / Wallet. next build green.
Also bundles in-progress settlement hardening: settlement-core idempotency
concurrency, api env validation, bundles + contracts/worker tweaks.
Verified: 943 vitest tests, 27 Foundry tests, next build all green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 01:19:22 +03:00
ff11f7754e
feat(lepton): nanopayment modules + production settlement spine
...
Lepton Agents Hackathon (Canteen × Circle × Arc): agent-native nanopayments
on Arc, built on the existing SettleKit platform.
Hackathon modules (demo-ready, RFB-aligned):
- @settlekit/agent: autonomous paying agent (Claude tool-use loop) — RFB 1/3
- @settlekit/citation-toll: per-access content + recursive royalty splits — RFB 6
- @settlekit/streaming: per-second continuous-authorization settlement — RFB 4
- @settlekit/x402-client: x402 pay-and-retry + pluggable settler (local/Circle)
- @settlekit/agent-economy: closed-loop traction harness + CLI
- apps/api /v1/lepton: public live demo surface
Production settlement spine (Phase 1):
- @settlekit/settlement-core: configurable Gateway/Circle/local providers,
idempotency, batch accumulator, on-chain reconciliation, nonce + receipt stores
- @settlekit/wallet-fleet: registry, spending caps + kill-switch, balances,
Circle provisioning
- x402-client: provider-settler adapter + Arc-indexer on-chain verifier
- lepton DB schema (12 tables) + persistence Pg stores (settlements, nonces,
sources, royalty legs, wallets, streams, payees)
- apps/worker jobs: lepton-settlement-reconcile, lepton-payout-sweep,
lepton-stream-refund (no-op until the settlement spine is wired)
First real-world traction sidecar (Phase 2):
- @settlekit/payee-registry: identity→wallet payout rule (in-memory + Pg)
- services/sidecars/rsshub-citation-toll: ingest RSS items as priced citeable
sources, x402-gated, settle per-citation royalties via settlement-core
- shared sweepPendingRoyalties used by the worker job and the sidecar
- services/sidecars/* wired as a TS workspace area (pnpm + vitest)
Docs: LEPTON.md, LEPTON_PRODUCTION_PLAN.md. All green: full typecheck + 870 tests.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 14:37:38 +03:00
32b89f0515
firstof
2026-06-16 02:51:34 +03:00
decf3ff96c
feat: full-product round 1 — auth, ui design system, closed persistence gaps
...
- packages/auth: real storage-agnostic auth (scrypt passwords, opaque sessions,
magic links, HMAC signed cookies, AuthStore + AuthService) on node:crypto.
- packages/ui: shared React 18 design system — theme.css tokens + Button/Card/
Table/Badge/StatCard/Nav/EmptyState/CopyButton/Money/etc + format helpers.
- persistence gaps closed: download_grants + agent_reputations tables, relaxed
saas_seats/agent_usage_events FKs (migration 0002, 52 tables); PgSeatStore,
PgAgentUsageStore, PgGrantStore, PgAgentReputationStore wired into context.
Verified: full build 0 TS errors; 591 tests pass; live Postgres boot + full
purchase->entitlement flow with the new context wiring.
2026-06-15 16:43:50 +03:00
f7c9cd735d
feat(escrow): Postgres persistence for the full escrow lifecycle
...
- add missing escrow_refunds + escrow_reviews tables (schema + migration 0001)
- seed a default customer (DEFAULT_CUSTOMER_ID) to satisfy buyer_customer_id FK
- PgEscrowStore: document-projection over all 7 escrow tables; deterministic
per-task ids for idempotent sub-record upserts; listTasks filters docs by org
- wire escrow to Postgres in context (in-memory fallback retained)
Verified live: create->fund->assign->submit->approve->release persists rows in
escrow_tasks/fundings/submissions/reviews/releases; documents round-trip (real
buyerCustomerId in __doc, FK-safe default projected). 50 tables; 590 tests pass.
Remaining in-memory in Postgres mode (deep FK chains / no clean table fit):
saas seats (subscription FK), agent usage (agent_buyers FK), file-download
grants + agent reputation (no backing table).
2026-06-15 12:04:32 +03:00
3fe0c88942
feat: implement all 77 SettleKit packages with real code
...
Core engine: entitlements (§14), delivery action runner (§21).
Payment rails: arc (viem USDC verify), circle (REST), x402 middleware, payments, webhooks (HMAC), notifications (Resend).
Integrations: github (Octokit App), discord (REST v10).
Commerce: saas billing, bundles, license-keys, api-keys, file-delivery (signed URLs + SigV4), usage/credits, agent-services, escrow, marketplace-core, risk.
Persistence: database (Drizzle/Postgres, 48 tables §25).
Plus supporting domain packages.
561 tests passing across 117 files; tsc -b green for every package.
2026-06-15 03:24:19 +03:00