You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ca51ff4
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(stack-encrypt): read a record plan from its frame with serde, not FfiValue
record::plan and plan_with took an FfiValue tree and walked it by hand:
the object, each field spec's keys, the outputs list, each index's wire
form and a match index's options. They now take the plan's frame bytes
and read them with serde (vitaminc_aead_frame::serde). One small visitor
reads the top-level map, to tell the reserved "context_field" key from a
field's name; everything below it is derived:
- a field spec is a deny_unknown_fields struct, with exactly one of
"outputs" and "target" checked in TryFrom, and a present key that is
null refused through a three-line `present` helper;
- an output is an externally tagged enum, so "match", {"match": null} and
{"match": {...}} are one variant, Match(Option<MatchWire>);
- match options default field by field and are checked against the
scheme's bounds in TryFrom;
- a "type" is a try_from newtype over ValueKind's names;
- a field's context is the context visitor's.
Every Reason a plan was refused with is kept: plan_refusal reads the field
from the error's path and the reason from where in the field it happened,
or from the reason a field's own rule gave. Two changes, both from the
frame: a key, field or match option given twice is refused by the frame
before the plan is read, as NotAnObject naming no field (RepeatedKey and
DuplicateField before); and a missing index payload and a null one mean
the same, so {"eq": null} is a bare "eq".
IndexSpec::from_frame replaces IndexSpec::from_value, and
Output::from_value is gone. The Go guest checks a plan is a frame, then
hands its bytes over. Unit tests build plans from FfiValue through the
shared test helper, and integration tests write them as JSON serialised
straight to frame bytes; the fuzz target sends each plan as its frame.
Refs #1252.
Copy file name to clipboardExpand all lines: .cargo/mutants.toml
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -96,6 +96,13 @@ exclude_re = [
96
96
# `true` there refuses the same values with the same error. The guard stays
97
97
# so the model says what it holds without leaning on the writer behind it.
98
98
'stack-encrypt/src/dynamic/value_frame\.rs:\d+:\d+: replace match guard logical\.admits\(&value\) with true in model$',
99
+
# A serde visitor's `expecting` writes only the "expected ..." half of a
100
+
# serde error's message, and no caller of these three reads that message:
101
+
# a context, statistics and a plan's root are each refused with one fixed
102
+
# `Reason` (`ContextKind`, `NotStats`, `NotAnObject`), and the plan's
103
+
# field-level reasons are read from the error's path, so writing nothing
104
+
# refuses the same input with the same error.
105
+
'stack-encrypt/src/dynamic/(context|query|record)\.rs:\d+:\d+: replace <impl (Visitor<\x27de> for ContextVisitor|serde::Deserialize<\x27de> for Confidence>::deserialize::<impl serde::de::Visitor<\x27_> for V|Deserialize<\x27de> for PlanWire>::deserialize::<impl Visitor<\x27de> for V)>::expecting -> fmt::Result with Ok\(Default::default\(\)\)$',
99
106
]
100
107
101
108
# Headroom over the measured baseline before a slow-but-correct mutant is
0 commit comments