StateStore class

Read/write .dialect/state.json — the soft-mode acknowledgement store specified in dialect/spec/state.md.

The file records per-issue acknowledgements keyed by <rule>:<locale>:<key>, each fingerprinted with the source/translation value at ack-time. When the value later changes the fingerprint mismatches and the warning re-surfaces. .dialect/ is gitignored by the canonical dialect init, so these acks are workspace-local by design.

The store is forward-compatible: unknown top-level fields and unknown fields inside an ack record are preserved verbatim on write.

Constructors

StateStore({int version = 1, Map<String, AckRecord>? checks, Map<String, Object?>? extras})

Properties

checks Map<String, AckRecord>
Acknowledgements keyed by <rule>:<locale>:<key>.
final
extras Map<String, Object?>
Unknown top-level fields, preserved verbatim for forward-compat.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
version int
Wire version. 1 in v1.0; bumps only on a breaking shape change.
getter/setter pair

Methods

encode() String
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
save(String root) → void
Write the store under root/.dialect/state.json, creating the directory if needed. Canonical form: version first, then remaining top-level keys sorted, checks keys sorted, 2-space indent, trailing newline.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

load(String root) StateStore
Load the store for the project at root. A missing file yields an empty store (not an error). Throws FormatException if the file is present but malformed.
parse(String content) StateStore