Closed-loop verification

The bug that compiles
clean and still loses
your money.

Simulated ledger · no wallet, no login, no backend

Pactora is a multi-role escrow marketplace. Its correctness doesn't live in any single component - it lives between two parties. That's a bug class types and unit tests cannot see.

The invariant Kane verifies

buyer + escrow + seller === $2,000

Always. Across every deposit, delivery, release and dispute. No single component owns this rule - which is why no single-component test can defend it.

Break it, catch it,
heal it. No human
opens a browser.

01Break

A regression lands.

An agentic edit makes a $500 deposit debit the buyer $1,000. TypeScript compiles. The production build passes. A unit test of the reducer in isolation still goes green.

node kane_guard.js --inject
02Catch

Kane opens a real browser.

Three plain-English objectives drive Chrome across both portals. Kane sees the ledger banner flip, and returns a confirmed product-bug verdict with root cause and UI evidence.

node kane_test.js
03Heal

The agent reads the verdict.

kane-guard hands Kane's NDJSON verdict to Claude Code. The agent patches the source itself, and Kane re-runs every objective to a 100% green pass.

node kane_guard.js --heal

Tests written
in English.

No selectors. No page objects. Kane takes an objective in plain language and drives a real browser across both portals at once. Every run persists an NDJSON trace to kane-traces/ - the evidence the agent patches against.

Verdict returned

assertion_error.confirmed_product_bug

severity major · confidence 0.95

01

Buyer deposit locks escrow

Pass

Click the "Deposit $500" button. Verify the Buyer Portal available balance now reads $1,500, verify the Seller Portal escrow status reads "Escrow Locked", and verify the held in escrow amount reads $500.

02

Cross-party ledger invariant holds

Pass

Click the "Deposit $500" button. Verify the page shows the text "Ledger Balanced" and verify the ledger total reads $2,000.

03

Seller delivery releases funds

Pass

Click "Deposit $500", then click "Mark Delivered", then click "Release Funds". Verify the Seller Portal paid out amount reads $500 and the escrow status reads "Funds Released".

Reproduce it

Four commands.

# terminal 1
› npm run dev

# terminal 2
› node kane_guard.js --inject   break it
› node kane_test.js             Kane catches it
› node kane_guard.js --heal     agent patches → green

See both portals.

Deposit, deliver, release, dispute - and watch the ledger invariant hold across every transition.

Launch App