aien-sovereign-core-mv
AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination.
Brought by drakestapleton
aien-sovereign-core-mv / evidence / aienet0-tur-ledger-20261027 / capacity-v2-notes.txt
| 1 | CAPACITY-DISCHARGE CORRECTION: HOST_TESTED ON THE DGX SPARK |
| 2 | |
| 3 | Finding and cause |
| 4 | The shared wcmd append precheck required SKEYS + 4 <= KCAP for every new |
| 5 | mutation, including settle/refund. Those operations touch only the reserved job |
| 6 | and its existing account IDs; they allocate no keys. Near capacity, legitimate |
| 7 | escrow could therefore become impossible to discharge. The defect is present in |
| 8 | the authenticated source at Core #794's initial commit |
| 9 | 6a0bfc0bb0b08d6fa08bc8109536218f50dd8b2c, not just merged #792. |
| 10 | |
| 11 | Fix |
| 12 | Remove the blanket append guard. vpre counts its new PID plus a missing requester; |
| 13 | vres counts its new job plus missing distinct provider/verifier accounts, with |
| 14 | an existing requester required. Refuse 14 before append if the exact slots do |
| 15 | not fit. Settlement/refund remain allocation-free, including at a full table. |
| 16 | No signature, ownership, conservation, single-writer or fsync gate is weakened. |
| 17 | No journal-format or authorization-message change from the earlier v2 commit. |
| 18 | |
| 19 | Pins |
| 20 | - Pre-fix source SHA-256: |
| 21 | b188d4c8324eb1d99f9d5e0d08549c54358afca369171974433b456f59ae4ca6 |
| 22 | - Pre-fix native binary /tmp/ledger-auth-bin-final: |
| 23 | d12d05cda56604410b8716602a7e3988a0e90901d28294f04f6ea7d8081f435c |
| 24 | - Fixed source SHA-256: |
| 25 | f47d8c6374f5e8a49068cc5372e97582e3eb81e87c5e53a661ea62ebb4279713 |
| 26 | - Fixed production binary /tmp/ledger-auth-capacity-bin and the independently |
| 27 | gate-built /tmp/ledger-auth-capacity-gate-bin: |
| 28 | afd2fbe7b68a9f5fe44ff67b28830ab2499a482b1a922b237bc1877716a3ef93 |
| 29 | - Compiler omega-mv 6999fa9e6dae4847c155ef4eacaece74f491d3ca seed/out/omc: |
| 30 | d6290c7663c2b4bafb59eb3fdf812476e977f4c144def71095c6248ef9b96b84 |
| 31 | - Final check.sh SHA-256: |
| 32 | 2bb20abca2e6757ee30763644f87d8ec13df8bb9cdcf255168ec6f18970d0647 |
| 33 | |
| 34 | Fast reproducible before/after regression |
| 35 | Actual pre-fix command: |
| 36 | OMC=/tmp/ledger-auth-omega/seed/out/omc \ |
| 37 | TUR_LEDGER_CAPACITY_SOURCE=/tmp/ledger-auth-capacity-before.om \ |
| 38 | bash om/tur-ledger/check.sh |
| 39 | Exit 1; capacity-v2-before.out. The overridden input source is the frozen |
| 40 | pre-fix b188d4c8 above. The top-level `src` line describes the repository's |
| 41 | current source, not this override. The current harness also prints the explicit |
| 42 | capacity-source pin to avoid that ambiguity. The assertions are unchanged. |
| 43 | Both capacity.settle and capacity.refund returned 14; escrow remained open. |
| 44 | |
| 45 | The fixed ten-slot fixture fills all slots through actual signed CLI commands, |
| 46 | refuses new prefund/reserve without journal changes, settles one reservation, |
| 47 | refunds the other and accepts unchanged once-only retries. A second case has |
| 48 | one slot left but needs a new job and two account slots: reserve refuses before |
| 49 | append and a one-slot prefund can still use the last slot. The full gate below |
| 50 | runs this exact regression and records every PASS. |
| 51 | |
| 52 | Production-size fill-to-capacity fixture |
| 53 | - Raw snapshot: 65,534 correctly chained records; 3 accounts, 2 jobs and 65,531 |
| 54 | distinct prefund IDs, occupying all 65,536 keys. Two jobs remain reserved. |
| 55 | - Raw snapshot SHA-256: |
| 56 | f37746ce5790659d49ae32f423dd109921c59b46c779561e41dce907f46aafd7 |
| 57 | - capacity-v2-full.journal.gz is 8,306,185 bytes; SHA-256: |
| 58 | 3cdc3f31b62d1395d5266701252747f1342bfde375deacd289038d336f0c1ae8 |
| 59 | - Public authority config: capacity-v2-full.authority, no trailing LF. |
| 60 | - Exact pre-signed argument vectors: capacity-v2-full.commands. |
| 61 | - Actual outcomes: capacity-v2-full.results.tsv. journal_unchanged is a measured |
| 62 | SHA-256 equality before/after each command, not an inferred phase label. |
| 63 | |
| 64 | A one-off fixture oracle generated native P-256 keys in memory, signed every |
| 65 | canonical prefund/reserve record and the two final authorizations, and built the |
| 66 | SHA-256 chain. Oracle: installed Python cryptography 41.0.7, OpenSSL 3.0.13; |
| 67 | private key objects were dropped after signing and never written to the repository. |
| 68 | The oracle is verification-only, not ledger implementation or a production |
| 69 | runtime dependency; no Python source is added. Native Omega verified every |
| 70 | signature and replayed the actual production-size table. This is a bulk-built |
| 71 | signed test history, not a claim that the old live writer accepted every fill: |
| 72 | the old blanket guard stops admitting earlier, which the CLI regression also |
| 73 | catches. Synthetic job/evidence IDs intentionally test capacity, not real work. |
| 74 | |
| 75 | Actual invocations were [BINARY, --journal, DIR, *ARGS] for each argument vector: |
| 76 | - Before, same full snapshot: settle -> exit 14, refused 14 capacity, unchanged; |
| 77 | refund -> exit 14, refused 14 capacity, unchanged. |
| 78 | - After, same full snapshot: prefund -> 14, unchanged; reserve -> 14, unchanged; |
| 79 | settle -> 0, settled JOB7 RECEIPT_A 27 3 10; refund -> 0, refunded JOB8. |
| 80 | - Final native audit -> exit 0: |
| 81 | audit ok records 65536 head 26ebc6a04f4f8ace9a78669e4fdb013508dde61deddb99b5df31a7731aee68be accounts 3 jobs 2 open 0 settled 1 refunded 1 prefunded 65630 balances 65630 escrow 0 |
| 82 | Raw output is capacity-v2-full-audit.out. |
| 83 | |
| 84 | To replay against a built ledger, from this evidence directory, in Bash without |
| 85 | set -e (the first two exit-14 results are expected): |
| 86 | D=$(mktemp -d) |
| 87 | gzip -dc capacity-v2-full.journal.gz > "$D/journal" |
| 88 | cp capacity-v2-full.authority "$D/authority" |
| 89 | while read -r -a args; do |
| 90 | before=$(sha256sum "$D/journal") |
| 91 | "$LEDGER" --journal "$D" "${args[@]}"; rc=$? |
| 92 | case "${args[0]}" in prefund|reserve) expected=14;; *) expected=0;; esac |
| 93 | test "$rc" = "$expected" || exit 1 |
| 94 | if test "$expected" = 14; then |
| 95 | test "$(sha256sum "$D/journal")" = "$before" || exit 1 |
| 96 | fi |
| 97 | done < capacity-v2-full.commands |
| 98 | "$LEDGER" --journal "$D" audit |
| 99 | The old binary fails the settlement assertion; the fixed binary gives the audit |
| 100 | above. The journal fixture and public signatures are replayable without any |
| 101 | private key. Reconstructing this test context is not provisioning a real ledger. |
| 102 | |
| 103 | Full final gate and mutants |
| 104 | Actual command: |
| 105 | OMC=/tmp/ledger-auth-omega/seed/out/omc CRASH_N=200 MUTANT_CRASH_N=0 \ |
| 106 | TUR_LEDGER_OUT=/tmp/ledger-auth-capacity-gate-bin \ |
| 107 | bash om/tur-ledger/check.sh |
| 108 | Exit 0; SUITE PASS; TUR_LEDGER gate: PASS. Raw stdout: capacity-v2-check.out. |
| 109 | All twelve mutants were killed. capacity-lockup restores the exact blanket |
| 110 | append guard and fails thirteen capacity assertions. no-slot-preflight deletes |
| 111 | the allocating-operation checks and fails ten assertions, including unchanged |
| 112 | journal and partial-reserve refusal. The other ten existing authentication, |
| 113 | exactly-once, integrity, conservation, durability and recovery mutants still die. |
| 114 | All 200 random-delay SIGKILL attempts preceded a new durable write; each was |
| 115 | audited/retried and final balances matched control. The separate strace injection |
| 116 | proved the post-fsync/pre-ack SIGKILL and once-only retry. Do not describe the |
| 117 | random-delay trials as 200 post-fsync kills or as interrupted RPC qualification. |
| 118 | |
| 119 | Required Core preflight |
| 120 | TINYLLAMA_MODEL_PATH=/home/drakestapleton/.cache/huggingface/hub/models--TinyLlama--TinyLlama-1.1B-Chat-v1.0/blobs/6e6001da2106d4757498752a021df6c2bdc332c650aae4bae6b0c004dcf14933 \ |
| 121 | bash scripts/agent-preflight.sh |
| 122 | Exit 0, PREFLIGHT VERIFICATION COMPLETE; branch/secrets/style/workspace/advisory |
| 123 | checks pass. aien-proof reported 58 stamped passes and 0 newly run crates; these |
| 124 | are reused valid Rust results, not a fresh execution claim. Six pre-existing |
| 125 | allowed advisory warnings remain. The changed native ledger path above was |
| 126 | actually compiled/exercised independently of those stamps. The physical model |
| 127 | blob path is the supported test override; no symlink/advisory gate was relaxed. |
| 128 | |
| 129 | Scope |
| 130 | Local native host evidence only; no GPU, live 18091, deployment, real economic |
| 131 | authority, malicious filesystem rollback resistance or Core RPC is qualified. |
| 132 | The actual signed-artifact caller is separately migrated/tested in protocols #67. |
| 133 | No compiler/language/host primitive/shared harness example changes here; the |
| 134 | application README and evidence are updated, and no Omega harness guide is stale |
| 135 | because of this application-specific capacity correction. |