CsDeterminismCheck class
codespecs_derivation_contract.md §6 check 31.
The one check whose subject is two runs rather than one trio.
codespecs_derivation_contract.md §2.8 C5 and
codespecs_derivation_contract.md §2.1 N1 promise that regenerating over an
unchanged document reproduces the output byte-for-byte, and nothing inside a
single trio can witness that: a generator that iterates an unordered map, or
stamps a time, or numbers a name from a counter that survives between runs,
emits perfectly plausible output every time — it is only the second run
that shows the difference.
tscomp17's derivation is where this stops being hypothetical. B1 orders a 3b
body's statements by codespecs_derivation_contract.md §2.1 N8 document
order, and B4 names a guard method out of two headlines; both are
derivations over collections, and both would still compile if the collection
came back in another order. So the check diffs the two runs' file sets first
(a name that changed is a naming derivation that is not a function of its
input) and then their bytes.
The check needs a caller who ran the generator twice. When none did, it
raises nothing — see bin/validate_codespecs.dart, which says so on stdout
rather than letting a silent pass read as a verified one.
- Inheritance
-
- Object
- CodeSpecsCheck
- CsDeterminismCheck
Constructors
- CsDeterminismCheck()
-
Creates the check.
const
Properties
- definedIn → String
-
The section that defines the rule, in the same two forms
CodeSpecsViolation.definedIn takes.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- number → int
-
The
codespecs_derivation_contract.md§6 row number.no setteroverride - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- title → String
-
The rule, in one line — the
codespecs_derivation_contract.md§6 row text.no setteroverride
Methods
-
fail(
String message, [CsLocation? at, String? token, String? area]) → CodeSpecsViolation -
Builds a violation attributed to this check.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
run(
CodeSpecsValidationInput input) → List< CodeSpecsViolation> -
Runs the check, returning one violation per breach.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited