alexpaynex 031ca5a5c3 task(#24): Bootstrap route + cost-ledger testkit coverage — 29/29 PASS
Task: Add T23 (bootstrap stub flow) and T24 (cost-ledger completeness) to the
testkit, bringing total from 27/27 to 29/29 PASS with 0 FAIL, 0 SKIP.

## What was changed
- `artifacts/api-server/src/routes/testkit.ts`:
  - Updated audit-log comment block to document T23 + T24 additions.
  - Inserted Test 23 after T22 (line ~654):
      POST /api/bootstrap → assert 201 + bootstrapJobId present.
      Guard on stubMode=true; SKIP if real DO mode (prevents hanging).
      Stub-pay the paymentHash via /api/dev/stub/pay/:hash.
      Poll GET /api/bootstrap/:id every 2s (20s timeout) until
      state=provisioning or state=ready; assert message field present.
  - Inserted Test 24 after T23:
      Guarded on STATE_T6=complete (reuses completed job from T6).
      GET /api/jobs/:id, extract costLedger.
      Assert all 8 fields non-null: actualInputTokens, actualOutputTokens,
        totalTokens, actualCostUsd, actualAmountSats, workAmountSats,
        refundAmountSats, refundState.
      Honest-accounting invariant: actualAmountSats <= workAmountSats.
      refundAmountSats >= 0.
      refundState must match ^(not_applicable|pending|paid)$.

## No deviations from task spec
- T23 guard logic matches spec exactly (stubMode check before poll).
- T24 fields match the 8 specified in task-24.md plus the invariants.
- No changes to bootstrap.ts or jobs.ts — existing routes already correct.

## Test run result
29/29 PASS, 0 FAIL, 0 SKIP (fresh server restart, rate-limit slots clean).
T23: state=provisioning in 1s. T24: actualAmountSats(179)<=workAmountSats(182),
refundAmountSats=3, refundState=pending.
2026-03-19 04:04:49 +00:00
2026-03-13 23:21:55 +00:00
2026-03-18 17:19:38 +00:00
2026-03-13 23:21:55 +00:00
2026-03-13 23:21:55 +00:00
2026-03-13 23:21:55 +00:00
Description
Timmy Tower World — sovereign AI agent economy
226 MiB
Languages
TypeScript 68.9%
JavaScript 15.5%
Shell 10.6%
HTML 4.5%
CSS 0.4%