Архитектура
Core State
CAP runtime state-machine core after the breaking rewrite.
Core State
The Rust core models a deterministic CAP machine:
State + Input + Capability + GuardSet -> State' + Output + CommitmentCurrent implementation:
crates/protocol-core:MachineContract, capability checks, guarded transitions and deterministic hashes;crates/cap-cli: local runtime, HTTP runner, SQLite store and trace projection;proto/cap/v1: compiled machine, scenario and trace contracts.
Trace
Runtime persists ordered TraceCommitment rows:
CapabilityCommitted
InputCommitted
GuardEvaluated
TransitionCommitted
OutputCommittedEvery row includes:
commitment_id
commitment_hash
commitment_type
trace_id
machine_id
sequence
principal_id
state_before
state_after
input_type
guard_id
output_type
payload_hash
payload_ref
previous_commitment_hash
schema_versionProjection
trace_projection materializes the latest status per trace:
input_committed
guard_evaluated
transition_committed
output_committedThe projection is a read model. Protocol truth remains the ordered trace.