Juggle several tasks
A task on every board, agents working on all of them, and one key to whatever needs you next.
Agent
How does a refund get from Stripe to the database?
Four hops. Nothing locks between the read and the insert, so a retried webhook can refund twice.
Stripewebhook
handleWebhookwebhooks.ts:17
findOneno lockrefund.ts:40
refunds.insertrefund.ts:44
nvim
36import { db } from '../db'
37
38export async function refund(evt) {
39 const key = evt.idempotencyKey
40 const prior = await db.refunds
41 .findOne({ key })
42 if (prior) return prior
43 const r = await stripe.refund(evt)
44 await db.refunds.insert({ key, ...r })
45 return r
46}
~
~
~
NORMALpayments/refund.ts42:3
test
✓ refund · returns prior refund
✓ refund · rejects unpaid order
✕ refund · concurrent webhooks refund once
✓ webhook · verifies signature
AssertionError: expected 1 refund, received 2
❯ refund.spec.ts:58:24
Tests 1 failed | 14 passed (15)
Duration 2.1s
waiting for file changes...
The board
Agent One per task: the refund status in a worktree of its own, and the docs on a board of their own.
nvim The code, stacked with the tests to make room.
Processes The tests in watch mode.
Step by step
- 01 Start a task from anywhere The rail's +, oragent
Cmd+P(Ctrl+Pelsewhere), opens Start. Turn on Worktree and name the branch refund-status, then write the task and press Enter: an agent starts on a branch of its own. - 02 Give the next one a board In Start, Board makes a new one: name it docs. Start again there, for the docs task.agent
- 03 Jump to what needs you The refund agent stops to ask before it runs a command. The rail's board chip, oragent
Cmd+J, lists it first, whichever board it's on; pick it to go there. Set its Access to Auto, then Allow once: it carries on by itself. - 04 Make room In Processes' menu, Stack with left: it stacks with nvim, one on top of the other.processes
UpandDownswitch between them. - 05 Check on the other board The board chip again, and docs: its agent has written docs/refunds.md.agent