Class: Hecks::Fuzzing::BoundedExhaustiveExpressions::SingleFieldVO

Inherits:
Struct
  • Object
show all
Defined in:
lib/hecks/fuzzing/bounded_exhaustive_expressions.rb

Overview

state/attrs — a plain Hash satisfies BOTH (confirmed directly: Resolver#known? degrades to a bare index check when state doesn't respond_to?(:key?), and fetch only ever needs attrs.key?/attrs[].). Split ACROSS both, matching a real dispatch's own shape (some names come from the record's stored state, some from the command's own args) — not load-bearing for THIS proof (attrs wins regardless), but keeps the synthetic input closer to what Admissibility actually builds, in case anything here is reused for a future deeper check.

THE VO-VS-SCALAR UNWRAP CASE, DELIBERATELY EXERCISED — half of num_a/str_a/bool_a/one array attribute's elements are bare scalars, the other half (num_b/str_b/bool_b/the other array's elements) are wrapped {value: X} — the single-field Value Object shape Resolver#unwrap_scalar auto-collapses. resolver.rb's own most serious historical bug in this file (the "UPDATE 2026-08-18" comment: a dotted walk that landed on an un-unwrapped VO compared false against every literal, SILENTLY, never raising) lived exactly at this boundary — a generator that only ever supplied bare scalars would never exercise the code path that bug lived in at all. SingleFieldVO — NOT a plain Hash, deliberately: Resolver #unwrap_scalar's own guard is value.respond_to?(:to_h) && !value.is_a?(Hash) && !value.is_a?(Array) — it exists specifically to collapse a real hydrated Runtime::Value instance (which responds to #to_h but is never itself a bare Hash) down to its lone scalar field, and just as deliberately leaves an ACTUAL Hash alone (a genuinely un-hydrated, multi- field record has no single scalar to collapse to). A first version of this generator's own synthetic state used plain {value: X} Hashes to stand in for a single-field VO — which is_a?(Hash) is true for, so unwrap_scalar correctly left them WRAPPED, and every VO-typed synthetic attribute then failed Addition/Compare/every scalar-typed operation with "expects a number, got \"value\":5" — a bug in THIS generator's own synthetic state, not in Resolver, caught only by noticing that num_b == 5 (num_b a plain {value: 5} Hash) evaluated to false instead of true before this fix.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



146
147
148
# File 'lib/hecks/fuzzing/bounded_exhaustive_expressions.rb', line 146

def value
  @value
end

Instance Method Details

#to_hObject



147
# File 'lib/hecks/fuzzing/bounded_exhaustive_expressions.rb', line 147

def to_h = { value: value }