smart-byte: the cluster state machine, the state hash it commits at, and its vectors #130

Merged
dcharlot merged 4 commits from smart-byte-cluster-state into main 2026-10-01 07:48:14 -04:00
Owner

The cluster state machine. The post-frame state hash, which every node agrees on before a frame commits, was a stand-in: the lockstep crate hashed a rolling chain over each frame's transitions. Treatise §9.4 commits a frame at the BLAKE3 of the canonical whole state. That state now exists, is specified, and is pinned by vectors that two independent implementations reproduce.

Spec: spec/cluster_state.md (new)

  • The state: the frame number, the issuer registry, each controller's key state, and each byte's owner and history, as canonical CBOR. Its BLAKE3 is the state hash, and its encoding is the checkpoint.
  • Inputs: key events, mints and transfers, each a one-member map naming its class.
  • A frame:
    • identical inputs are one input;
    • inputs apply by class (key events, mints, transfers), then by ascending digest;
    • every check is named, with its error class;
    • a failed input is dropped and changes nothing.
  • Key rotation: key events apply first, so a rotation retires the old keys for everything in the frame it lands in. A thief holding a rotated-away key can't move a byte.
  • Departures from the treatise, with reasons:
    • A byte's identity carries no mint frame. With the frame folded in (treatise §15.2), a mint replayed in a later frame issues a second byte; §19.3 concedes "a distinct (and possibly duplicate) byte". A replay is now refused in every frame.
    • Issuers are AIDs, so they rotate keys through their logs. That closes §15.5's deferred issuer key rotation.
    • Joule cost stays out of the hashed state. Measured energy differs node by node.

Code

  • smart-byte-state (new):
    • the state and its hash;
    • inputs;
    • the frame transition;
    • checkpoint and log persistence, with atomic checkpoints and replay that refuses a gap or a wrong hash;
    • a deterministic demo workload.
  • smart-byte-lockstep: the cluster runs these state machines in place of the rolling hash.
  • smart-byte-keri-witness: exposes a controller's state and resumes a replay from it, which is how the cluster extends a log one event at a time.
  • CLI: smart-byte cluster simulate runs real mints and transfers through the supermajority commit.

Conformance

  • state_vectors.json: 12 vectors. Each is a genesis state and frames of inputs, with every input's result and every frame's state and hash.
  • The founding frame uses the kel-001 to kel-003 inceptions and env-001's mint, so the files still describe one world.
  • verify_v1.py runs the state machine independently, written from the spec text, standard library only.

Falsified

  • Rust checker: 34 planted defects, each caught on its own vector.
  • Python checker: 12 state-vector plants caught the same way, plain and -O. A frame deleted from the only vector exercising a class is caught by the completeness gate.
  • Python rules: 18 state-machine rule mutations, each caught by a state vector.
  • Rust rules: 16 state-machine rule mutations. Each compiles and fails named tests: the state crate's own, and the pack's, since generation refuses to emit a vector the reference no longer computes.

cargo test --workspace passes, as does verify_v1.py (106 vectors, pack complete).

Not yet specified

  • registry changes after genesis;
  • burning or redeeming bytes;
  • transfers between clusters.

🤖 Generated with Claude Code

The cluster state machine. The post-frame state hash, which every node agrees on before a frame commits, was a stand-in: the lockstep crate hashed a rolling chain over each frame's transitions. Treatise §9.4 commits a frame at the BLAKE3 of the canonical whole state. That state now exists, is specified, and is pinned by vectors that two independent implementations reproduce. ## Spec: `spec/cluster_state.md` (new) - **The state:** the frame number, the issuer registry, each controller's key state, and each byte's owner and history, as canonical CBOR. Its BLAKE3 is the state hash, and its encoding is the checkpoint. - **Inputs:** key events, mints and transfers, each a one-member map naming its class. - **A frame:** - identical inputs are one input; - inputs apply by class (key events, mints, transfers), then by ascending digest; - every check is named, with its error class; - a failed input is dropped and changes nothing. - **Key rotation:** key events apply first, so a rotation retires the old keys for everything in the frame it lands in. A thief holding a rotated-away key can't move a byte. - **Departures from the treatise, with reasons:** - **A byte's identity carries no mint frame.** With the frame folded in (treatise §15.2), a mint replayed in a later frame issues a second byte; §19.3 concedes "a distinct (and possibly duplicate) byte". A replay is now refused in every frame. - **Issuers are AIDs**, so they rotate keys through their logs. That closes §15.5's deferred issuer key rotation. - **Joule cost stays out of the hashed state.** Measured energy differs node by node. ## Code - **`smart-byte-state` (new):** - the state and its hash; - inputs; - the frame transition; - checkpoint and log persistence, with atomic checkpoints and replay that refuses a gap or a wrong hash; - a deterministic demo workload. - **`smart-byte-lockstep`:** the cluster runs these state machines in place of the rolling hash. - **`smart-byte-keri-witness`:** exposes a controller's state and resumes a replay from it, which is how the cluster extends a log one event at a time. - **CLI:** `smart-byte cluster simulate` runs real mints and transfers through the supermajority commit. ## Conformance - **`state_vectors.json`:** 12 vectors. Each is a genesis state and frames of inputs, with every input's result and every frame's state and hash. - **The founding frame** uses the kel-001 to kel-003 inceptions and env-001's mint, so the files still describe one world. - **`verify_v1.py`** runs the state machine independently, written from the spec text, standard library only. ## Falsified - **Rust checker:** 34 planted defects, each caught on its own vector. - **Python checker:** 12 state-vector plants caught the same way, plain and `-O`. A frame deleted from the only vector exercising a class is caught by the completeness gate. - **Python rules:** 18 state-machine rule mutations, each caught by a state vector. - **Rust rules:** 16 state-machine rule mutations. Each compiles and fails named tests: the state crate's own, and the pack's, since generation refuses to emit a vector the reference no longer computes. `cargo test --workspace` passes, as does `verify_v1.py` (106 vectors, pack complete). ## Not yet specified - registry changes after genesis; - burning or redeeming bytes; - transfers between clusters. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
cluster_state.md is new. It fixes what treatise §9.4, §15 and §16 leave
open:
- The state: frame number, issuer registry, controllers' key states, and
  each byte's owner and history. Its canonical encoding is the checkpoint,
  and its BLAKE3 is the state hash a frame commits at.
- Inputs: key events, mints and transfers.
- A frame: identical inputs are one input; inputs apply by class, then by
  ascending digest; every check is named, with its error class.
- Key events apply first, so a rotation retires the old keys for everything
  in the frame it lands in.

Departures from the treatise:
- A byte's identity carries no mint frame. With the frame folded in
  (§15.2), a mint replayed in a later frame issues a second byte; §19.3
  concedes "a distinct (and possibly duplicate) byte".
- Issuers are AIDs and rotate through their key-event logs.
- Joule cost stays out of the hashed state: measured energy differs node
  by node.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
smart-byte-state (new):
- the state and its hash;
- inputs;
- the frame transition;
- checkpoint-and-log persistence. Checkpoints are written atomically, and
  replay refuses a gap or a wrong hash.
- a deterministic demo workload.

smart-byte-lockstep: the cluster runs these state machines in place of the
rolling hash that stood in for the state.

smart-byte-keri-witness: exposes a controller's state and resumes a replay
from it, so the cluster extends a log one event at a time.

The CLI's `cluster simulate` runs real mints and transfers through the
supermajority commit.

smart-byte-conformance: state_vectors.json, 12 vectors. Each is a genesis
state and frames of inputs, with every input's result and every frame's
state and state hash. The founding frame uses kel-001 to kel-003 and
env-001's mint. Planted defects in the state vectors are caught on their
own vectors.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
smart-byte conformance: the second implementation runs the state machine
Some checks failed
smart-byte conformance gate / Validate conformance JSON files (pull_request) Successful in 4s
smart-byte conformance gate / Second implementation reproduces every vector (pull_request) Successful in 4s
smart-byte conformance gate / Spec changes require vector-pack updates (pull_request) Successful in 3s
smart-byte conformance gate / VERSIONS.md and README.md must exist (pull_request) Successful in 3s
no-vanity-metrics / Scan committed Markdown for vanity metrics (pull_request) Successful in 3s
standards workspaces build + test / eoc-rs (pull_request) Successful in 1m47s
standards workspaces build + test / aac-rs (pull_request) Has been cancelled
standards workspaces build + test / joule-code-rs (pull_request) Has been cancelled
standards workspaces build + test / joule-ui-rs (pull_request) Has been cancelled
standards workspaces build + test / joulecontract-rs (pull_request) Has been cancelled
standards workspaces build + test / jouledesk-rs (pull_request) Has been cancelled
standards workspaces build + test / joulehook-rs (pull_request) Has been cancelled
standards workspaces build + test / map-rs (pull_request) Has been cancelled
standards workspaces build + test / mesh-rs (pull_request) Has been cancelled
standards workspaces build + test / openpay (pull_request) Has been cancelled
standards workspaces build + test / proof-rs (pull_request) Has been cancelled
standards workspaces build + test / sandbox-rs (pull_request) Has been cancelled
standards workspaces build + test / sense-rs (pull_request) Has been cancelled
standards workspaces build + test / smart-byte-rs (pull_request) Has been cancelled
standards workspaces build + test / macOS energy backend (jcp-energy) (pull_request) Has been cancelled
standards workspaces build + test / arl-rs (pull_request) Has been cancelled
standards workspaces build + test / jcp-rs (pull_request) Has been cancelled
standards workspaces build + test / jouleclaw-rs (pull_request) Has been cancelled
ce1a371f8d
verify_v1.py now applies state vectors' frames as the cluster state spec
describes. It is written from the spec text, standard library only, and
reproduces all 106 vectors.

Falsified:
- 12 planted defects caught on their own vectors, with and without -O.
- 18 state-machine rule mutations, each caught by a state vector.

regeneration.md records the state machine; VERSIONS.md names its spec.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merge main into smart-byte-cluster-state
All checks were successful
standards workspaces build + test / jouleclaw-rs (pull_request) Successful in 2m18s
standards workspaces build + test / aac-rs (pull_request) Successful in 1m17s
smart-byte conformance gate / Validate conformance JSON files (pull_request) Successful in 4s
smart-byte conformance gate / Second implementation reproduces every vector (pull_request) Successful in 4s
smart-byte conformance gate / Spec changes require vector-pack updates (pull_request) Successful in 3s
smart-byte conformance gate / VERSIONS.md and README.md must exist (pull_request) Successful in 3s
standards workspaces build + test / joule-code-rs (pull_request) Successful in 45s
standards workspaces build + test / joulecontract-rs (pull_request) Successful in 33s
standards workspaces build + test / map-rs (pull_request) Successful in 34s
joule-code conformance gate / Build + round-trip C1-C4 vectors (pull_request) Successful in 1m27s
standards workspaces build + test / mesh-rs (pull_request) Successful in 30s
jouleclaw public surface must stay documented / Public-surface audit (jouleclaw-rs) (pull_request) Successful in 57s
no-vanity-metrics / Scan committed Markdown for vanity metrics (pull_request) Successful in 3s
standards workspaces build + test / openpay (pull_request) Successful in 1m43s
standards workspaces build + test / eoc-rs (pull_request) Successful in 1m49s
standards workspaces build + test / jcp-rs (pull_request) Successful in 1m20s
standards workspaces build + test / proof-rs (pull_request) Successful in 1m12s
standards workspaces build + test / sandbox-rs (pull_request) Successful in 2m8s
standards workspaces build + test / smart-byte-rs (pull_request) Successful in 3m4s
standards workspaces build + test / arl-rs (pull_request) Successful in 5m10s
standards workspaces build + test / joule-ui-rs (pull_request) Successful in 14m41s
standards workspaces build + test / jouledesk-rs (pull_request) Successful in 3m35s
standards workspaces build + test / joulehook-rs (pull_request) Successful in 3m57s
standards workspaces build + test / sense-rs (pull_request) Successful in 9m51s
standards workspaces build + test / macOS energy backend (jcp-energy) (pull_request) Successful in 17m0s
268171ffd5
# Conflicts:
#	smart-byte/conformance/v1/regeneration.md
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Transaction-Science/open-standards!130
No description provided.