UsageLedger class final

The top-level usage.json artifact: one record per sessionId, forever (I1).

Constructors

UsageLedger({required String sessionId, required List<UsageSegment> segments, required UsageLedgerTotal total, required int chainRecords, required String chainHash})
Creates a UsageLedger.
const
UsageLedger.fromJson(Map<String, dynamic> json)
Deserializes from a JSON map; unknown fields are ignored so newer writers never brick older readers (UT-1 forward-compat).
factory

Properties

chainHash → String
sha256:-prefixed fingerprint over every non-header chain line — hand-edits and crash remnants are detected, never merged into (E3).
final
chainRecords → int
Number of record lines on the session chain this fold consumed — mismatch with a fresh scan means the artifact is stale (E3).
final
hashCode → int
The hash code for this object.
no setterinherited
resumedCount → int
Number of --continue/--resume boundaries the session crossed: segments.length - 1 (I1).
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
segments → List<UsageSegment>
Per-segment folds, chain order.
final
sessionId → String
The session this ledger belongs to.
final
total → UsageLedgerTotal
The cumulative view (I2).
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Serializes to the artifact JSON map (schema order fixed for byte-determinism, I6).
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

schemaVersion → const int
usage.json schema version written by this build.