mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-04 12:07:09 +00:00
fix(trace): an action names the generator that produced it
The setup exclusion landed for the model arm only, because only a model pick stamped a source. A seeded run returned setup's action through the same entry with no marker, so its denominator still counted the login while the model arm's did not, and the two are compared. serializeAction names setup and seeded on the wire, so both arms are counted by one rule. An already-recorded trace names nothing and keeps exactly the count it was reported with; unattributed_actions counts those steps so the old denominator cannot pass as the new one. TraceVersion is deliberately unbumped: oracle-reduction refuses a differing version, and a bump would make all 169 recorded runs unreplayable.
This commit is contained in:
1 parent
66fd5bce5d
commit
454988fbc8
19 files changed
+377
-82
No files matched your search
@@ -611,6 +611,10 @@ type wireAction struct {
|
||||
ToX int `json:"toX"`
|
||||
ToY int `json:"toY"`
|
||||
DurationMillis int `json:"durationMillis"`
|
||||
// Source names the generator that produced the action: the spec's setup or
|
||||
// the action root. Empty from the candidate enumeration, which serializes
|
||||
// actions nothing has chosen yet.
|
||||
Source string `json:"source"`
|
||||
}
|
||||
|
||||
// DecodeAction turns one serialized action (the flat camelCase wire contract)
|
||||
@@ -623,6 +627,15 @@ func DecodeAction(raw json.RawMessage) (Action, error) {
|
||||
if err := json.Unmarshal(raw, &wire); err != nil {
|
||||
return Action{}, fmt.Errorf("decode action: %w", err)
|
||||
}
|
||||
action, err := actionFromWire(wire)
|
||||
if err != nil {
|
||||
return Action{}, err
|
||||
}
|
||||
action.Source = wire.Source
|
||||
return action, nil
|
||||
}
|
||||
|
||||
func actionFromWire(wire wireAction) (Action, error) {
|
||||
switch wire.Kind {
|
||||
case "Tap":
|
||||
return Action{Kind: ActionKindTap, On: wire.Selector, X: wire.X, Y: wire.Y}, nil
|
||||
|
||||
Reference in new issue
Block a user