hecks 2.7.0 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. checksums.yaml +4 -4
  2. data/exe/hecks +13 -0
  3. data/lib/hecks/adapters/driven/memory.rb +1 -1
  4. data/lib/hecks/adapters/driven/postgres.rb +1 -1
  5. data/lib/hecks/adapters/driven/prism.rb +1 -1
  6. data/lib/hecks/adapters/driven/sqlite/projection.rb +1 -1
  7. data/lib/hecks/adapters/driven/tenant_provisioner.rb +31 -10
  8. data/lib/hecks/behaviors/expectations.rb +2 -2
  9. data/lib/hecks/bluebook/assembly/contract.rb +1 -1
  10. data/lib/hecks/bluebook/assembly/contracts.rb +5 -5
  11. data/lib/hecks/bluebook/assembly/specializer.rb +2 -2
  12. data/lib/hecks/bluebook/assembly.rb +1 -1
  13. data/lib/hecks/bluebook/behaviour/chapter.rb +5 -2
  14. data/lib/hecks/bluebook/behaviour/read_model.rb +18 -0
  15. data/lib/hecks/bluebook/capabilities.rb +2 -2
  16. data/lib/hecks/bluebook/chapter.rb +1 -1
  17. data/lib/hecks/bluebook/dsl/aggregate_builder.rb +2 -2
  18. data/lib/hecks/bluebook/dsl/binding_proxy.rb +6 -1
  19. data/lib/hecks/bluebook/dsl/bluebook_builder.rb +2 -2
  20. data/lib/hecks/bluebook/dsl/entity_builder.rb +1 -1
  21. data/lib/hecks/bluebook/dsl/generic_dispatch.rb +1 -1
  22. data/lib/hecks/bluebook/dsl/hecksagon_builder.rb +14 -9
  23. data/lib/hecks/bluebook/dsl/rule_reference.rb +3 -3
  24. data/lib/hecks/bluebook/dsl/translation_builder.rb +1 -1
  25. data/lib/hecks/bluebook/dsl/world_builder.rb +5 -0
  26. data/lib/hecks/bluebook/meta_validator/judge.rb +3 -3
  27. data/lib/hecks/bluebook/meta_validator/plan.rb +4 -4
  28. data/lib/hecks/bluebook/meta_validator/readings.rb +1 -1
  29. data/lib/hecks/bluebook/meta_validator/reconstruction.rb +2 -2
  30. data/lib/hecks/bluebook/meta_validator/shapes.rb +1 -1
  31. data/lib/hecks/bluebook/meta_validator/syntax_boot.rb +11 -10
  32. data/lib/hecks/bluebook/meta_validator.rb +1 -1
  33. data/lib/hecks/bluebook/model_check/client_profile.rb +4 -70
  34. data/lib/hecks/bluebook/model_check.rb +12 -13
  35. data/lib/hecks/cache_dir.rb +103 -0
  36. data/lib/hecks/cli/document.rb +104 -0
  37. data/lib/hecks/cli/ir.rb +47 -0
  38. data/lib/hecks/cli/mcp.rb +32 -0
  39. data/lib/hecks/cli/mcp_door.rb +461 -0
  40. data/lib/hecks/cli/model_check.rb +270 -0
  41. data/lib/hecks/cli/project_cli.rb +123 -0
  42. data/lib/hecks/cli/project_diagrams.rb +43 -0
  43. data/lib/hecks/cli/run.rb +219 -0
  44. data/lib/hecks/cli/smoke_test.rb +59 -0
  45. data/lib/hecks/cli/stores.rb +54 -0
  46. data/lib/hecks/cli.rb +166 -0
  47. data/lib/hecks/facade/handle.rb +2 -2
  48. data/lib/hecks/facade/surface/aggregate_door.rb +1 -1
  49. data/lib/hecks/language/bluebook/vocabulary.bluebook +16 -0
  50. data/lib/hecks/mcp_door_scope.rb +176 -0
  51. data/lib/hecks/ports/persistence/append_only.rb +1 -1
  52. data/lib/hecks/ports/persistence/plugins/era/era_check.rb +1 -1
  53. data/lib/hecks/ports/persistence/plugins/era/era_guard.rb +2 -2
  54. data/lib/hecks/ports/persistence/plugins/era/era_tamper.rb +2 -2
  55. data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage/era_store.rb +2 -2
  56. data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage/head_compiler.rb +1 -1
  57. data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage_manager/minter.rb +1 -1
  58. data/lib/hecks/ports/persistence/plugins/era/translation/rule_compiler.rb +12 -6
  59. data/lib/hecks/ports/persistence/state_codec.rb +1 -1
  60. data/lib/hecks/projections/deploy/fargate.rb +1 -1
  61. data/lib/hecks/projections/deploy/lambda.rb +3 -3
  62. data/lib/hecks/projections/reference.rb +7 -1
  63. data/lib/hecks/projector/exporter.rb +4 -4
  64. data/lib/hecks/projector/target.rb +1 -1
  65. data/lib/hecks/release/runner/ci_publisher.rb +96 -0
  66. data/lib/hecks/release/runner/commands.rb +68 -0
  67. data/lib/hecks/release/runner/console.rb +52 -0
  68. data/lib/hecks/release/runner/gem_publisher.rb +44 -0
  69. data/lib/hecks/release/runner/git.rb +48 -0
  70. data/lib/hecks/release/runner/npm_publisher.rb +89 -0
  71. data/lib/hecks/release/runner/preflight.rb +119 -0
  72. data/lib/hecks/release/runner/published.rb +55 -0
  73. data/lib/hecks/release/runner/tagger.rb +87 -0
  74. data/lib/hecks/release/runner.rb +244 -0
  75. data/lib/hecks/router/namespace_installer.rb +1 -1
  76. data/lib/hecks/runtime/command_interpreter.rb +3 -3
  77. data/lib/hecks/runtime/command_rules/admissibility.rb +2 -2
  78. data/lib/hecks/runtime/entity_element.rb +1 -1
  79. data/lib/hecks/runtime/entity_interpreter.rb +1 -1
  80. data/lib/hecks/runtime/invocation.rb +1 -1
  81. data/lib/hecks/runtime/loader.rb +1 -1
  82. data/lib/hecks/runtime/outbox.rb +1 -1
  83. data/lib/hecks/runtime/reaction_invocation.rb +3 -3
  84. data/lib/hecks/runtime/read_model_interpreter.rb +37 -15
  85. data/lib/hecks/runtime/reference_hop.rb +4 -4
  86. data/lib/hecks/runtime/registry/verification.rb +11 -11
  87. data/lib/hecks/runtime/registry.rb +8 -4
  88. data/lib/hecks/runtime/saga_interpreter.rb +1 -1
  89. data/lib/hecks/runtime/value/coercion.rb +3 -3
  90. data/lib/hecks/runtime/value/entity_list_coercion.rb +1 -1
  91. data/lib/hecks/storehouse.rb +18 -12
  92. data/lib/hecks/version.rb +1 -1
  93. data/lib/hecks/vocabulary.rb +5 -0
  94. data/lib/hecks.rb +6 -1
  95. metadata +28 -58
  96. data/lib/hecks/bench/cli.rb +0 -74
  97. data/lib/hecks/bench/environment.rb +0 -100
  98. data/lib/hecks/bench/postgres_probe.rb +0 -41
  99. data/lib/hecks/bench/report.rb +0 -116
  100. data/lib/hecks/bench/ruby_runner.rb +0 -151
  101. data/lib/hecks/bench/run.rb +0 -55
  102. data/lib/hecks/bench/rust_runner.rb +0 -165
  103. data/lib/hecks/bench/stats.rb +0 -75
  104. data/lib/hecks/bench/suite.rb +0 -172
  105. data/lib/hecks/bench/workload.rb +0 -137
  106. data/lib/hecks/bench.rb +0 -28
  107. data/lib/hecks/codemod.rb +0 -443
  108. data/lib/hecks/corpus.rb +0 -479
  109. data/lib/hecks/doc/reference.rb +0 -585
  110. data/lib/hecks/fuzzing/bounded_exhaustive_expressions.rb +0 -684
  111. data/lib/hecks/fuzzing/combination_miner.rb +0 -178
  112. data/lib/hecks/fuzzing/concurrent_dispatch.rb +0 -469
  113. data/lib/hecks/fuzzing/coverage_campaign.rb +0 -161
  114. data/lib/hecks/fuzzing/differential.rb +0 -192
  115. data/lib/hecks/fuzzing/domain_generator.rb +0 -871
  116. data/lib/hecks/fuzzing/era_boundary.rb +0 -154
  117. data/lib/hecks/fuzzing/form_census.rb +0 -285
  118. data/lib/hecks/fuzzing/generated_domain_check.rb +0 -171
  119. data/lib/hecks/fuzzing/invalid_value_generator.rb +0 -125
  120. data/lib/hecks/fuzzing/isolated_boot.rb +0 -658
  121. data/lib/hecks/fuzzing/nondeterministic.rb +0 -79
  122. data/lib/hecks/fuzzing/persistence_parity.rb +0 -253
  123. data/lib/hecks/fuzzing/properties/corrections.rb +0 -125
  124. data/lib/hecks/fuzzing/properties/dispatch_and_mutations.rb +0 -688
  125. data/lib/hecks/fuzzing/properties/guards.rb +0 -398
  126. data/lib/hecks/fuzzing/properties/invariants_and_aggregation.rb +0 -399
  127. data/lib/hecks/fuzzing/properties/lifecycle_and_replay.rb +0 -137
  128. data/lib/hecks/fuzzing/properties/outbox.rb +0 -180
  129. data/lib/hecks/fuzzing/properties/querying.rb +0 -260
  130. data/lib/hecks/fuzzing/properties.rb +0 -267
  131. data/lib/hecks/fuzzing/qa_settings.rb +0 -164
  132. data/lib/hecks/fuzzing/replay.rb +0 -930
  133. data/lib/hecks/fuzzing/rotation_priority.rb +0 -114
  134. data/lib/hecks/fuzzing/rust_gap_manifest.rb +0 -139
  135. data/lib/hecks/fuzzing/self_consistency.rb +0 -825
  136. data/lib/hecks/fuzzing/sequence_generator/adversary.rb +0 -532
  137. data/lib/hecks/fuzzing/sequence_generator/catalog.rb +0 -171
  138. data/lib/hecks/fuzzing/sequence_generator/outcome_tracker.rb +0 -127
  139. data/lib/hecks/fuzzing/sequence_generator/picker.rb +0 -116
  140. data/lib/hecks/fuzzing/sequence_generator/query_binding.rb +0 -138
  141. data/lib/hecks/fuzzing/sequence_generator/step_builder.rb +0 -344
  142. data/lib/hecks/fuzzing/sequence_generator.rb +0 -311
  143. data/lib/hecks/fuzzing/shrinker.rb +0 -309
  144. data/lib/hecks/fuzzing/structural_skips.rb +0 -53
  145. data/lib/hecks/fuzzing/sweep_depth.rb +0 -61
  146. data/lib/hecks/fuzzing/target_capabilities.rb +0 -255
  147. data/lib/hecks/fuzzing/value_generator.rb +0 -340
  148. data/lib/hecks/fuzzing.rb +0 -23
  149. data/lib/hecks/grammar/evolve.rb +0 -524
  150. data/lib/hecks/query_ir.rb +0 -482
@@ -1,125 +0,0 @@
1
- module Hecks
2
- module Fuzzing
3
- # A value that is deliberately the wrong shape for the attribute it is handed
4
- # to — the sibling of ValueGenerator, which only ever builds values that satisfy
5
- # a declared type.
6
- #
7
- # That limit is why the fuzzer could not reach the space a hand-written
8
- # adversarial corpus covers. spec/corpus/banking.json got there one step at a
9
- # time, by hand : a value object where an Integer is declared, a Float where an
10
- # Integer is declared, a numeral wearing quotes, an attribute missing entirely,
11
- # an attribute the command never declared. One of those — a hash reaching a
12
- # refusal message — is the exact shape that exposed refusal wording drift
13
- # (a composite rendered with `inspect` at one site and JSON at another —
14
- # Rendering's whole story), and no generated value
15
- # could ever have produced it.
16
- #
17
- # These are expected to be refused, and that is the point : a refusal is an
18
- # answer, and its wording is pinned byte-for-byte. The bugs live in
19
- # the sentence, not in the happy path.
20
- module InvalidValueGenerator
21
- module_function
22
-
23
- # Each kind names a real confusion, not random noise. Ordered roughly by how
24
- # often this codebase has actually been bitten by it.
25
- KINDS = %i[
26
- object_for_scalar
27
- scalar_for_object
28
- float_for_integer
29
- numeral_string
30
- array_for_scalar
31
- boolean_for_string
32
- null
33
- ].freeze
34
-
35
- # Builds one value of the wrong shape for `attribute`, chosen from the
36
- # confusions that are actually meaningful for its declared type.
37
- #
38
- # @param attribute [Bluebook::Attribute] the attribute the corrupted value is
39
- # handed to
40
- # @param aggregate [Bluebook::Aggregate] the aggregate that declares
41
- # `attribute` (and any value objects it references)
42
- # @param random [Random] the seeded RNG to draw the kind and value from
43
- # @return [Object] a value of the wrong shape for `attribute` — an Integer,
44
- # Float, String, Array, Hash, or boolean, depending on the kind drawn
45
- def corrupt(attribute, aggregate, random:)
46
- kind = kinds_for(attribute, aggregate).sample(random: random)
47
- build(kind, attribute, aggregate, random: random)
48
- end
49
-
50
- # Only the confusions that mean anything for this attribute. Offering
51
- # `scalar_for_object` for a plain Integer would just be a second spelling of
52
- # `numeral_string`, and a kind that cannot be wrong for the attribute it is
53
- # handed teaches the corpus nothing.
54
- #
55
- # @param attribute [Bluebook::Attribute] the attribute to find applicable
56
- # confusions for
57
- # @param aggregate [Bluebook::Aggregate] the aggregate that declares
58
- # `attribute` (and any value objects it references)
59
- # @return [Array<Symbol>] the subset of `KINDS` that are a real confusion for
60
- # `attribute`'s declared type
61
- def kinds_for(attribute, aggregate)
62
- value_object = aggregate.value_object(attribute.type.to_s)
63
- return %i[scalar_for_object array_for_scalar null] if value_object
64
- return %i[object_for_scalar float_for_integer numeral_string array_for_scalar null] if attribute.type.to_s == "Integer"
65
-
66
- %i[object_for_scalar array_for_scalar boolean_for_string null]
67
- end
68
-
69
- # Builds the actual corrupted value for one already-chosen `kind`.
70
- #
71
- # @param kind [Symbol] one of `KINDS`
72
- # @param attribute [Bluebook::Attribute] the attribute the value will be
73
- # handed to
74
- # @param aggregate [Bluebook::Aggregate] the aggregate that declares
75
- # `attribute` (and any value objects it references)
76
- # @param random [Random] the seeded RNG to draw the value from
77
- # @return [Object, nil] the corrupted value for `kind`; `nil` if `kind` is not
78
- # one `KINDS` declares
79
- def build(kind, attribute, aggregate, random:)
80
- case kind
81
- when :object_for_scalar then { "cents" => random.rand(1..1000) }
82
- when :scalar_for_object then scalar_for(attribute, aggregate, random: random)
83
- when :float_for_integer then random.rand(1.0..100.0).round(2)
84
- when :numeral_string then random.rand(1..1000).to_s
85
- when :array_for_scalar then [random.rand(1..10), random.rand(1..10)]
86
- when :boolean_for_string then random.rand(2).zero?
87
- end
88
- end
89
-
90
- # A bare scalar where a value object is declared. A single-field value object
91
- # legitimately accepts one (that is the standing-in rule every domain relies
92
- # on), so the interesting case is a value object with several fields, where a
93
- # scalar cannot stand for anything and the refusal has to say so.
94
- # @param attribute [Bluebook::Attribute] the value-object-typed attribute to
95
- # build a bare scalar for
96
- # @param aggregate [Bluebook::Aggregate] the aggregate that declares
97
- # `attribute`'s value object
98
- # @param random [Random] accepted for a uniform call signature with `#build`;
99
- # this method draws nothing from it
100
- # @return [String, Hash] `"a bare scalar"` when a scalar would legitimately be
101
- # accepted (a single-field value object); otherwise a Hash corrupting the
102
- # sole field's own type instead
103
- def scalar_for(attribute, aggregate, random:)
104
- value_object = aggregate.value_object(attribute.type.to_s)
105
- sole = value_object&.sole_attribute
106
- return "a bare scalar" unless sole
107
-
108
- # One field, so a scalar is legal — corrupt the field's own type instead,
109
- # which is still a shape the attribute cannot accept.
110
- { sole.name.to_s => ["nested", "array"] }
111
- end
112
-
113
- # An attribute the command never declared. `refuse_unknown_arguments` is a
114
- # real dispatch step (Vocabulary::AggregateDispatchOrder), and nothing
115
- # generated had ever exercised it.
116
- # @param random [Random] the seeded RNG to draw the name and value from
117
- # @return [Array(String, String)] a `[name, value]` pair naming an argument
118
- # no command declares
119
- def undeclared_argument(random:)
120
- name = %w[colour flavour rank note].sample(random: random)
121
- [name, %w[red loud third scribbled].sample(random: random)]
122
- end
123
- end
124
- end
125
- end