Rule
destructive-list-reset
Whole-list reset lacks a recognized same-revision count, empty-list or absent-slot acknowledgment.
Specimen 81 of 96 · Other active opt-ins / State and collections
- Severity
- low
- Confidence
- varies
- Maturity
- experimental
- Selection
- Opt-in
- Policy intent
- not required
- Release
- v0.1.1
- Engine facts used
successful-historiessuccessful-predicatesstate-writescompleted-entries
Selection and scope#
Not selected by default. Select it with --detectors or the detectors list in nightshade.json. Either one replaces profile selection, so list every rule you want.
./.nightshade/node_modules/.bin/nightshade ./contracts --detectors destructive-list-reset
./.nightshade/node_modules/.bin/nightshade detector show destructive-list-resetThe first command runs only this rule; --detectors takes a comma-separated list. The second prints the rule's metadata from your installed version.
Severity is review priority. It does not express exploitability or impact. Confidence is detector metadata, not a probability. All built-in rules are experimental.
Compiler scope: the engine supports the pinned profiles 0.28.0, 0.29.0, 0.30.0, 0.31.1, 0.33.0-rc.2, 0.34.0, 0.35.0-rc.1 and 0.35.0, with ZKIR2 by default. Support for this rule can be narrower; the rule documentation below states any narrower scope.
Corpus checks#
Synthetic corpus checks for this rule in the 0.1.1 proof run. A check counts only with compiler acceptance and complete analysis.
| Positive detected | Corrected quiet | Lookalike quiet | Other negative quiet | Incomplete |
|---|---|---|---|---|
| 2/2 | 2/2 | 2/2 | 0/0 | 0 |
No deviations were recorded for this rule.
These are behavior checks on synthetic fixtures, not a precision or recall estimate. See evaluation.
Rule documentation#
From docs/detectors/destructive-list-reset.md at v0.1.1.
Availability: opt-in review; low severity / medium confidence. A whole persistent List is replaced with an empty List on a modeled successful nonconstructor history, without a recognized acknowledgment of that exact list revision. Recognized checks are a required live length equality to a caller/witness scalar or constant, a required empty-list check, or absence of that exact Map slot before initialization.
export ledger changes: List<Field>;
export circuit clearChanges(): [] {
changes.resetToDefault();
}For count-based acknowledgment, accept the caller's expected count and require it to equal the same live list's length. A saved immutable count can be asserted later in the same atomic proof, but an intervening append makes it stale for the reset revision. Wrong-list/key checks, ignored comparisons, optional checks and self-equality do not discharge this review. Constructor setup, known empty lists and exact absent-slot initialization stay quiet.
Prefer pruning the acknowledged segment, or validate an epoch that is correctly maintained for this list. The rule does not infer arbitrary epoch/digest-to-list relationships. The corrected CFT epoch protocol and intentional purges are known review matches, so this rule stays opt-in. A count check alone is not proof of content identity, wallet durability or general concurrency safety.
The engine preserves ordered writes, immutable dynamic-key identity, list revision and invocation sites. Unknown selectors, missing full predicates and exhausted matching allowances produce rule-scoped incomplete diagnostics. Unsupported baseline effects and budgets retain their existing incomplete result.
Suppress a match#
If a match is intentional, suppress it on the line before with the exact rule ID and a reason of at least eight characters:
// nightshade-disable-next-line destructive-list-reset -- Reason this match is intentionalDiagnostics cannot be suppressed, and an unmatched directive for a selected rule makes analysis incomplete. See configuration for fingerprint suppressions and baselines.