How igorbnd/kept works
Kept turns merchant-authored guarantees into typed, reviewable rules, freezes approved promises into PayPal orders, monitors carrier or weather evidence, and automatically issues capped refunds when code determines a promise was broken. Merchants configure promises and review holds in the Studio; buyers shop and check out; merchants audit outcomes in the ledger. The graph includes documented suggestion, pricing, evidence review, narration, tracking, and budget capabilities. Some server internals were only sampled through the source index or README, so unsupported call details are omitted.
Main entry points: watcher.ts Rule watcher · index.ts HTTP API · suggester.ts Promise suggestions · api.ts Web API client
Components 24
Merchant and buyer UI
- App router
web/src/main.tsx - Shop and checkout
web/src/pages/Shop.tsx - Order details
web/src/pages/OrderPage.tsx - Promise Studio
web/src/pages/Studio.tsx - Order ledger
web/src/pages/Ledger.tsx - Web API client
web/src/api.ts
Promise design
- Promise compiler
server/ai/compiler.ts - Promise suggestions
server/ai/suggester.ts - Expected-cost pricing
server/pricing.ts - Moment and climate context
server/sources/context.ts
Monitoring and decisions
- Rule watcher
server/watcher.ts - Carrier evidence review
server/ai/assessor.ts - Refund explanation
server/ai/narrator.ts - Carrier tracking evidence
server/sources/carrier.ts - Weather evidence
server/sources/weather.ts
Orders and payments
- HTTP API
server/index.ts - PayPal commerce
server/paypal.ts
State and contracts
- SQLite document store
server/db.ts - Domain contracts
server/types.ts
Other components
- Merchant
- Buyer
- Open-Meteo
- Claude
- PayPal services
Connections 39
- App router → Shop and checkout: routes to
web/src/main.tsx - App router → Promise Studio: routes to
web/src/main.tsx - App router → Order ledger: routes to
web/src/main.tsx - App router → Order details: routes to
web/src/main.tsx - Merchant → Promise Studio: authors and approves
README.md - Merchant → Order ledger: reviews outcomes
README.md - Buyer → Shop and checkout: shops and buys
README.md - Shop and checkout → Web API client: requests data
web/src/pages/Shop.tsx - Promise Studio → Web API client: requests actions
web/src/pages/Studio.tsx - Order ledger → Web API client: loads ledger
web/src/pages/Ledger.tsx - Order details → Web API client: loads order
web/src/pages/OrderPage.tsx - Web API client → HTTP API: sends API requests
web/src/api.ts - HTTP API → Promise compiler: compiles promises
server/index.ts - HTTP API → Promise suggestions: requests ideas
server/index.ts - HTTP API → Expected-cost pricing: prices promises
server/index.ts - HTTP API → PayPal commerce: handles checkout
server/index.ts - HTTP API → Rule watcher: starts monitoring
server/index.ts - HTTP API → SQLite document store: reads and writes
server/index.ts - Promise suggestions → Moment and climate context: uses context
server/ai/suggester.ts - Promise suggestions → Claude: drafts ideas
README.md - Promise suggestions → Promise compiler: compiles ideas
README.md - Promise suggestions → Expected-cost pricing: prices ideas
README.md - Expected-cost pricing → Moment and climate context: uses climate history
server/pricing.ts - Moment and climate context → Open-Meteo: fetches forecast and history
server/sources/context.ts - Promise compiler → Claude: compiles with
server/ai/compiler.ts - Rule watcher → Carrier tracking evidence: reads scans
server/watcher.ts - Rule watcher → Weather evidence: reads observations
server/watcher.ts - Rule watcher → Carrier evidence review: reviews delivery evidence
server/watcher.ts - Rule watcher → Refund explanation: writes refund note
server/watcher.ts - Rule watcher → SQLite document store: logs decisions
server/watcher.ts - Rule watcher → PayPal commerce: issues refund
README.md - Rule watcher → PayPal commerce: attaches tracking
README.md - Carrier evidence review → Claude: assesses evidence
README.md - Refund explanation → Claude: drafts explanation
README.md - Weather evidence → Open-Meteo: fetches observations
server/sources/weather.ts - PayPal commerce → PayPal services: calls REST APIs
server/paypal.ts - Carrier tracking evidence → SQLite document store: stores scans
server/sources/carrier.ts - Promise compiler → Domain contracts: validates rule
server/ai/compiler.ts - HTTP API → Domain contracts: uses shared types
server/index.ts