AutoClaw has no points ledger upstream (wallets.v2 is a balance only), so usage() now reports the balance as a prepaid wallet window, {name: "积分余额", balance, unit: "积分"} (magpie >= v0.1.1790, #3950), which routing reads as what is left; an empty wallet counts as used up. A display-only "本轮消耗" window (aside) is worked out from local balance deltas: any rise, from 0 too, opens a new cycle, and the Beijing day keeps its spent/gained sums. The ledger is keyed by signinAccountKey (#254), lives in $XDG_CONFIG_HOME/magpie/autoclaw-usage.json (temp file + rename, 30-day expiry), and a null/""/non-numeric total_balance is unknown and never recorded. The unsigned fallback reward reads 200 (was 400). Version 0.2.11, on top of main's 0.2.10 (#466, d8cfee3, whose FLAGGED rewrites are kept).
The reviewer pushed 6418906 on top of fb334b8: main merged in (no conflicts), version 0.2.10 -> 0.2.11, the README paragraph rewritten to match the code (it still described state in the package folder and a routing spend window), and an aside assertion on the spend window test.
Run at 6418906cb7387c5e6892f326c9a2d913cc252881, on mote (mote-run, HOME=$(mktemp -d)):
- bun test packages/autoclaw: 44 pass, 0 fail; nothing left in packages/autoclaw or $HOME/.config.
- bun scripts/check.mjs autoclaw: ok. Full bun test: 3050 pass, 8 skip, 0 fail (257 files).
- The merged tree's packages/autoclaw diff against main is exactly the PR's own diff plus the version line; FLAGGED's "CodeBuddy Code" entries are there.
- Broken by hand, one at a time, each red then restored: `last > 0` back in balanceObserve (balanceObserve test), the old key uid ?? accountId (same-name accounts test), the null guard dropped (unreadable balance test), `if (false)` for the spend window (two-reads test), aside removed (two-reads test, with the new assertion; it passed without it), the balance window removed (4 tests).
- npm pack 0.2.11 and imported the packed index.mjs (AutoclawAuthPlugin, AutoclawCnAuthPlugin, _internal).
Not tried: a real AutoClaw account (none here); the balance shapes and the routing order rest on the author's run with magpie v0.1.1876. Not known: whether an account at 0 积分 is still served (e.g. a member's GLM-5.3 allowance); magpie now benches it at 0.