The Treble needs all three stacks simultaneously: a trustless table (Pear), self-custody for every player including a machine (WDK), and an opponent that reasons with no cloud (QVAC). Below: every load-bearing API, where it is used in this codebase, and what replacing it would cost.
- Autobase 7 β
new Autobase(store, bootstrap, { open, apply }),host.addWriter,base.append/update/viewβsrc/p2p/pot.js. The multi-writer pot with no server; the AI is just another writer core. Without it: a coordination server + a CRDT you'd have to write and prove. - Hypercore (via Corestore) β per-writer signed append-only logs β authority in
reduce(state, op, { from: node.from.key })(src/p2p/pot.jsβsrc/core/reducer.js). Picks become tamper-evident by construction. Without it: a trusted timestamp server and signature plumbing. - Hyperbee β the deterministic materialized view (
state,event/<seq>) withvalueEncoding: jsonβsrc/p2p/pot.js. Without it: hand-rolled snapshot/undo logic that Autobase reordering would break. - Hyperswarm β
swarm.join(discoveryKey); thetreble1β¦invite IS the room βsrc/p2p/pot.js,src/p2p/invite.js. Noise-encrypted transport for free. Without it: signaling servers + TLS + NAT pain. - Protomux + compact-encoding β the
treble/1/helloseat-request channel riding the replication stream βsrc/p2p/pot.js. Without it: a second connection layer just to ask "may I sit down?".
new WDK(seed).registerWallet(name, Manager, config)β the modular manager pipeline βsrc/wallet/index.js. Our sim engine is a custom chain module built on@tetherto/wdk-wallet'sWalletManager/IWalletAccountbase classes (src/wallet/sim-wallet.js) β exactly the extension point WDK advertises β and@tetherto/wdk-wallet-solanadrops in for devnet with the same call sites.- Transaction Policies β
wdk.registerPolicy({ scope: 'project', wallet, rules }), default-deny on governed accounts,PolicyViolationError,account.simulate.transfer(...)βsrc/wallet/index.js,src/agent/seat.js,test/wallet.test.js. This is the whole "bounded autonomy" story: the agent pre-flights its own allowance, declines pots above its cap, and cannot evensign()outside its ALLOW rule. Without it: home-made limits the judges would have to trust. account.transfer({ token, recipient, amount })/getAddress/getBalanceβ stake bonding and every settlement leg with per-transfer receipts βsrc/wallet/index.js(stakeBond,executeSettlementLegs). Without it: raw chain SDKs per network, one custody bug away from disaster.- BIP-39 utilities β
WDK.getRandomSeedPhrase()for fresh self-custodial identities per participant βsrc/wallet/index.js. Without it: key-management code nobody should improvise.
completion({ modelId, history, stream, tools })with tool-calling β the pundit must commit via thesubmit_picktool (type:'function', JSON-schema params); we drainrun.tokenStreamfor narration and consume the dedicatedrun.toolCallStream(falling back torun.toolCalls) for the parsed call βsrc/agent/brains/qvac.js. The pick is a decision, not parsed prose. Without it: brittle regex over free text, or a cloud API that breaks the entire premise.loadModel({ modelSrc })/unloadModelβ Qwen3 1.7B on-device (default chosen for empirically-verified tool-calling; Llama 1B-class models tended to narrate instead of calling);TREBLE_QVAC_MODELaccepts a local GGUF or a pear:// link βsrc/agent/brains/qvac.js.npm run verify:offlineproves the reasoning path needs zero network. Without it: "AI opponent" = someone else's datacenter.
Take any one stack out and The Treble is impossible: without Pear you need a server (no longer trustless); without WDK the "AI with its own wallet" is a custodian in a trench coat; without QVAC the opponent is a cloud API (neither private nor yours, and against the QVAC track rule).
@tetherto/wdkis beta β pinned to1.0.0-beta.12. A policy DENY that merely fails to match an ALLOW reportsgoverned-but-unmatchedwithout policy metadata; we add an explicit DENY rule so blocked stakes carrypolicyId/ruleName. Chain modules (e.g. Solana) install separately; devnet funding is on the operator.@qvac/sdkmodel weight β the default LLM is a multi-hundred-MB first-run download with platform-specific native backends, so CI and the 20-second demo use a disclosed deterministic fallback brain; the SDK surface itself (tool schema, event stream) is exercised in tests without loading weights. On Bare, plugins must be registered explicitly (@qvac/bare-sdk) β our desktop UI keeps the LLM brain on the Node path for now.- Autobase concurrency semantics are powerful but subtle: causally concurrent ops linearize deterministically yet not always intuitively (see AUDIT_REPORT "pick/lock window"), and replication acks need both peers to
update(). The reducer is designed so every such ordering stays safe.
Full threat model and residual risk: docs/AUDIT_REPORT.md.