3 Commits

Author SHA1 Message Date
97bb36c631 docs(demo-script): judge-facing demo walkthrough was stuck describing a 4-service stack; real stack is 8
docs/DEMO-SCRIPT.md (the one doc a judge actually runs commands from) still
said `make build` produces 4 Go binaries and `scripts/run-demo.sh` starts
audit-log/ledger-core/gateway/agent only — stale since the section-1 split
added auth/tenant-registry/card-issuance/webhook-ingestion, same staleness
class README.md had before today's earlier pass fixed it there. Verified
live: `make build` produces 10 Go binaries, `scripts/run-demo.sh` starts 8
services. Also added a step showing `ration tenant`/`card`/`apikey` — 3
operator command groups built across many rounds today that this doc never
mentioned at all, verified live against the real running stack.
2026-10-29 15:14:01 +03:00
f909885563 fix(audit-log): mirror deposit-received credits into the audit chain
MarkDepositReceived's ledger credit — the only path by which a deposit's
money becomes spendable headroom — was never mirrored into audit-log,
unlike ApplyEntry's credits and RecordAgentDecision. The claim that
"every money move is mirrored" (README, docs/SUBMISSION.md) didn't
actually hold for it.

Ledger::mark_deposit_received_with_entry now returns the credit
LedgerEntryRecord it produces (mark_deposit_received keeps its original
signature, delegating to the new method and dropping the entry, so
existing callers/tests are unchanged); grpc.rs's MarkDepositReceived
handler mirrors it into audit-log exactly like ApplyEntry's handler
already does.

Also wires audit-log into scripts/run-demo.sh (the bare-metal demo path
every judge following README's Quickstart/docs/DEMO-SCRIPT.md actually
runs) — it was only ever started via docker-compose, so the headline
"audit trail is the point" claim and the standalone verify-chain tool
were never exercised end to end by the documented demo flow. Verified
live: after a seed + simulate-deposit + agent-decision run, verify-chain
now reports real records (6, matching the 6 live Append RPCs audit-log's
own metrics counted) and correctly flags a single flipped byte as a
broken chain at the right sequence.
2026-10-22 02:19:21 +03:00
2b686594a3 feat: Ration phase 1 — full polyglot build for Airwallex Starter Kit 5
Six services, independently built then integrated:
- services/wal (C): crash-safe write-ahead log, CRC32-checksummed
  frames, torn-write recovery via truncate-to-last-valid-frame.
- services/ledger-core (Rust): double-entry ledger over the C WAL via
  FFI, reserve-floor enforcement BEFORE any WAL write, idempotent
  ApplyEntry, full LedgerCore gRPC service.
- services/gateway (Go): Airwallex Issuing/Global-Accounts client
  (mock mode default, live mode ready), the actual rationing math
  (reserve floor, 60% bridge cap, 24h velocity cap, partial-over-decline).
- services/agent (Go): deterministic hard-rule policy envelope computed
  BEFORE any LLM call; Claude only decides within that pre-approved
  envelope; every decision audit-logged even when the LLM call fails.
- services/tui (Go, Bubble Tea) + services/cli (Go, cobra): the only
  UI — no web frontend, per explicit direction.

Integration found and fixed three real bugs, not just compile errors:
- proto regen collision shadowing checked-in pkg/pb packages
- ledger-core/gateway address-variable mismatch (stack would never
  actually connect on default config)
- the big one: MarkDepositReceived never credited the ledger, so every
  tenant's balance was permanently stuck at 0 and bridge-funding could
  only ever decline — the core agentic-rationing feature could never
  produce a real grant. Fixed at the ledger level with idempotent
  mark-and-credit in one WAL frame, covered by 3 new tests.

End-to-end verified live, reproducibly: seed -> simulate a late deposit
-> agent grants a partial bridge with a computed rationale -> second
grant correctly declines once the 24h velocity cap engages. Verified
independently by the orchestrator too: 'make build' and 'make test'
both clean (Rust: 29 tests; Go: all packages; C: WAL test suite).

Airwallex sandbox credentials still pending organizer approval —
tracked as an owner blocker in docs/AIRWALLEX-SETUP.md, not a code gap.
2026-10-19 03:04:13 +03:00