hecks 1.3.0 → 1.4.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 (355) hide show
  1. checksums.yaml +4 -4
  2. data/lib/hecks/adapters/driven/claude_code.rb +7 -7
  3. data/lib/hecks/adapters/driven/d1.rb +187 -23
  4. data/lib/hecks/adapters/driven/folder.rb +10 -10
  5. data/lib/hecks/adapters/driven/google_authentication.rb +8 -8
  6. data/lib/hecks/adapters/driven/governance_authorization.rb +31 -13
  7. data/lib/hecks/adapters/driven/heki/journal.rb +5 -4
  8. data/lib/hecks/adapters/driven/heki/saga_store.rb +5 -5
  9. data/lib/hecks/adapters/driven/heki.rb +13 -7
  10. data/lib/hecks/adapters/driven/identity_registry.rb +2 -2
  11. data/lib/hecks/adapters/driven/in_memory_ordering.rb +3 -3
  12. data/lib/hecks/adapters/driven/lambda/client.rb +34 -9
  13. data/lib/hecks/adapters/driven/lambda.rb +39 -33
  14. data/lib/hecks/adapters/driven/local_storage.rb +17 -10
  15. data/lib/hecks/adapters/driven/memory.rb +205 -9
  16. data/lib/hecks/adapters/driven/mock_stripe_adapter.rb +1 -1
  17. data/lib/hecks/adapters/driven/postgres/codec.rb +27 -11
  18. data/lib/hecks/adapters/driven/postgres/outbox.rb +40 -2
  19. data/lib/hecks/adapters/driven/postgres/reconnect.rb +23 -7
  20. data/lib/hecks/adapters/driven/postgres/schema_builder.rb +14 -14
  21. data/lib/hecks/adapters/driven/postgres.rb +175 -28
  22. data/lib/hecks/adapters/driven/prism.rb +4 -4
  23. data/lib/hecks/adapters/driven/sql_query_builder.rb +34 -22
  24. data/lib/hecks/adapters/driven/sqlite/codec.rb +38 -10
  25. data/lib/hecks/adapters/driven/sqlite/projection.rb +60 -32
  26. data/lib/hecks/adapters/driven/sqlite/schema_builder.rb +12 -12
  27. data/lib/hecks/adapters/driven/sqlite.rb +181 -21
  28. data/lib/hecks/adapters/driven.rb +4 -4
  29. data/lib/hecks/adapters/driving/github_webhook.rb +18 -18
  30. data/lib/hecks/behaviors/dsl.rb +2 -2
  31. data/lib/hecks/behaviors/expectations.rb +23 -23
  32. data/lib/hecks/behaviors/ir.rb +1 -1
  33. data/lib/hecks/behaviors/rspec.rb +1 -1
  34. data/lib/hecks/behaviors/runner.rb +2 -2
  35. data/lib/hecks/behaviors.rb +1 -1
  36. data/lib/hecks/bluebook/aggregate.rb +13 -13
  37. data/lib/hecks/bluebook/assembly/aggregate_assembly.rb +10 -10
  38. data/lib/hecks/bluebook/assembly/build.rb +1 -1
  39. data/lib/hecks/bluebook/assembly/contract.rb +39 -16
  40. data/lib/hecks/bluebook/assembly/contracts.rb +40 -38
  41. data/lib/hecks/bluebook/assembly/marks.rb +18 -18
  42. data/lib/hecks/bluebook/assembly/specializer.rb +19 -21
  43. data/lib/hecks/bluebook/assembly.rb +9 -9
  44. data/lib/hecks/bluebook/attribute.rb +9 -9
  45. data/lib/hecks/bluebook/behaviour/aggregate.rb +11 -11
  46. data/lib/hecks/bluebook/behaviour/attribute.rb +5 -5
  47. data/lib/hecks/bluebook/behaviour/chapter.rb +23 -5
  48. data/lib/hecks/bluebook/behaviour/command.rb +23 -23
  49. data/lib/hecks/bluebook/behaviour/domain_port.rb +7 -7
  50. data/lib/hecks/bluebook/behaviour/entity.rb +8 -8
  51. data/lib/hecks/bluebook/behaviour/hexagon.rb +4 -4
  52. data/lib/hecks/bluebook/behaviour/lifecycle.rb +5 -5
  53. data/lib/hecks/bluebook/behaviour/policy.rb +12 -12
  54. data/lib/hecks/bluebook/behaviour/process_manager.rb +7 -7
  55. data/lib/hecks/bluebook/behaviour/query.rb +1 -1
  56. data/lib/hecks/bluebook/behaviour/read_model.rb +8 -8
  57. data/lib/hecks/bluebook/behaviour/traits.rb +12 -12
  58. data/lib/hecks/bluebook/behaviour/value_object.rb +6 -6
  59. data/lib/hecks/bluebook/capabilities.rb +27 -0
  60. data/lib/hecks/bluebook/chapter.rb +28 -9
  61. data/lib/hecks/bluebook/command.rb +12 -12
  62. data/lib/hecks/bluebook/domain_port.rb +9 -9
  63. data/lib/hecks/bluebook/dsl/adapter_builder.rb +24 -0
  64. data/lib/hecks/bluebook/dsl/aggregate_builder/sealing.rb +49 -49
  65. data/lib/hecks/bluebook/dsl/aggregate_builder.rb +96 -96
  66. data/lib/hecks/bluebook/dsl/attribute_collector.rb +41 -41
  67. data/lib/hecks/bluebook/dsl/binding_proxy.rb +22 -2
  68. data/lib/hecks/bluebook/dsl/bluebook_builder/validation.rb +111 -74
  69. data/lib/hecks/bluebook/dsl/bluebook_builder.rb +48 -30
  70. data/lib/hecks/bluebook/dsl/bootstrap_table.rb +116 -0
  71. data/lib/hecks/bluebook/dsl/command_builder.rb +103 -103
  72. data/lib/hecks/bluebook/dsl/const_shim.rb +46 -15
  73. data/lib/hecks/bluebook/dsl/domain_port_builder.rb +90 -25
  74. data/lib/hecks/bluebook/dsl/entity_builder.rb +56 -56
  75. data/lib/hecks/bluebook/dsl/generic_dispatch.rb +148 -132
  76. data/lib/hecks/bluebook/dsl/hecksagon_builder.rb +89 -30
  77. data/lib/hecks/bluebook/dsl/identity_declaration.rb +17 -17
  78. data/lib/hecks/bluebook/dsl/lifecycle_builder.rb +27 -4
  79. data/lib/hecks/bluebook/dsl/policy_builder.rb +30 -21
  80. data/lib/hecks/bluebook/dsl/port_builder.rb +38 -7
  81. data/lib/hecks/bluebook/dsl/port_operation_builder.rb +56 -22
  82. data/lib/hecks/bluebook/dsl/process_manager_builder.rb +35 -35
  83. data/lib/hecks/bluebook/dsl/query_builder.rb +5 -5
  84. data/lib/hecks/bluebook/dsl/read_model_builder.rb +34 -34
  85. data/lib/hecks/bluebook/dsl/rule_reference.rb +41 -39
  86. data/lib/hecks/bluebook/dsl/translation_builder.rb +9 -9
  87. data/lib/hecks/bluebook/dsl/value_object_builder.rb +16 -16
  88. data/lib/hecks/bluebook/dsl/word_gate.rb +59 -53
  89. data/lib/hecks/bluebook/dsl/world_builder.rb +51 -8
  90. data/lib/hecks/bluebook/entity.rb +11 -11
  91. data/lib/hecks/bluebook/expression/ast_json.rb +20 -20
  92. data/lib/hecks/bluebook/expression/ast_reader.rb +3 -3
  93. data/lib/hecks/bluebook/expression/canonical_form.rb +9 -9
  94. data/lib/hecks/bluebook/expression/evaluator.rb +18 -18
  95. data/lib/hecks/bluebook/expression/resolver/block_predicates.rb +18 -18
  96. data/lib/hecks/bluebook/expression/resolver.rb +60 -62
  97. data/lib/hecks/bluebook/hexagon.rb +1 -1
  98. data/lib/hecks/bluebook/lifecycle.rb +1 -1
  99. data/lib/hecks/bluebook/meta_validator/adapter_judge.rb +1 -1
  100. data/lib/hecks/bluebook/meta_validator/judge.rb +101 -87
  101. data/lib/hecks/bluebook/meta_validator/plan.rb +39 -39
  102. data/lib/hecks/bluebook/meta_validator/port_judge.rb +2 -2
  103. data/lib/hecks/bluebook/meta_validator/readings.rb +43 -43
  104. data/lib/hecks/bluebook/meta_validator/reconstruction.rb +44 -37
  105. data/lib/hecks/bluebook/meta_validator/shapes.rb +25 -21
  106. data/lib/hecks/bluebook/meta_validator/syntax_boot.rb +145 -31
  107. data/lib/hecks/bluebook/meta_validator/translation_judge.rb +6 -6
  108. data/lib/hecks/bluebook/meta_validator/world_judge.rb +5 -5
  109. data/lib/hecks/bluebook/meta_validator.rb +70 -70
  110. data/lib/hecks/bluebook/model_check.rb +170 -84
  111. data/lib/hecks/bluebook/pattern_subset.rb +9 -9
  112. data/lib/hecks/bluebook/policy.rb +15 -13
  113. data/lib/hecks/bluebook/process_manager.rb +14 -14
  114. data/lib/hecks/bluebook/project_register.rb +6 -6
  115. data/lib/hecks/bluebook/query.rb +4 -4
  116. data/lib/hecks/bluebook/read_model.rb +14 -14
  117. data/lib/hecks/bluebook/reference.rb +8 -8
  118. data/lib/hecks/bluebook/smoke_test.rb +19 -19
  119. data/lib/hecks/bluebook/synthesizer.rb +12 -12
  120. data/lib/hecks/bluebook/translation.rb +4 -4
  121. data/lib/hecks/bluebook/value_object.rb +6 -6
  122. data/lib/hecks/bluebook.rb +2 -2
  123. data/lib/hecks/codemod/legacy_dispatch_args.rb +299 -0
  124. data/lib/hecks/codemod/legacy_dispatch_recorder.rb +186 -0
  125. data/lib/hecks/codemod.rb +36 -35
  126. data/lib/hecks/construct.rb +6 -6
  127. data/lib/hecks/corpus.rb +317 -0
  128. data/lib/hecks/deprecation.rb +95 -0
  129. data/lib/hecks/doc/reference.rb +19 -19
  130. data/lib/hecks/embryonaut_bluebook.rb +11 -11
  131. data/lib/hecks/facade/cli_door.rb +69 -10
  132. data/lib/hecks/facade/cli_runner.rb +105 -24
  133. data/lib/hecks/facade/command_request.rb +23 -0
  134. data/lib/hecks/facade/handle.rb +79 -32
  135. data/lib/hecks/facade/json_door.rb +106 -25
  136. data/lib/hecks/facade/surface/aggregate_door.rb +42 -27
  137. data/lib/hecks/facade/surface/chapter.rb +26 -17
  138. data/lib/hecks/facade/surface.rb +16 -3
  139. data/lib/hecks/facade.rb +15 -4
  140. data/lib/hecks/forms/app.rb +46 -30
  141. data/lib/hecks/forms/command_form_renderer.rb +70 -9
  142. data/lib/hecks/forms/field_renderer.rb +142 -6
  143. data/lib/hecks/forms/field_shape.rb +180 -19
  144. data/lib/hecks/forms/html.rb +51 -7
  145. data/lib/hecks/forms/index_renderer.rb +14 -2
  146. data/lib/hecks/forms/params.rb +120 -23
  147. data/lib/hecks/forms/port_argument.rb +2 -2
  148. data/lib/hecks/forms/query_form_renderer.rb +2 -2
  149. data/lib/hecks/forms/record_renderer.rb +2 -2
  150. data/lib/hecks/forms/record_table.rb +1 -1
  151. data/lib/hecks/forms/value_object_shape.rb +3 -3
  152. data/lib/hecks/forms.rb +24 -4
  153. data/lib/hecks/fqn.rb +1 -1
  154. data/lib/hecks/framework/bluebook/governance.bluebook +9 -0
  155. data/lib/hecks/framework.rb +48 -17
  156. data/lib/hecks/freezer.rb +11 -11
  157. data/lib/hecks/fuzzing/bounded_exhaustive_expressions.rb +90 -90
  158. data/lib/hecks/fuzzing/combination_miner.rb +119 -0
  159. data/lib/hecks/fuzzing/concurrent_dispatch.rb +140 -45
  160. data/lib/hecks/fuzzing/coverage_campaign.rb +118 -0
  161. data/lib/hecks/fuzzing/differential.rb +158 -0
  162. data/lib/hecks/fuzzing/domain_generator.rb +694 -0
  163. data/lib/hecks/fuzzing/era_boundary.rb +37 -18
  164. data/lib/hecks/fuzzing/form_census.rb +35 -20
  165. data/lib/hecks/fuzzing/generated_domain_check.rb +95 -0
  166. data/lib/hecks/fuzzing/invalid_value_generator.rb +6 -6
  167. data/lib/hecks/fuzzing/isolated_boot.rb +62 -62
  168. data/lib/hecks/fuzzing/nondeterministic.rb +67 -0
  169. data/lib/hecks/fuzzing/persistence_parity.rb +19 -21
  170. data/lib/hecks/fuzzing/properties/corrections.rb +9 -9
  171. data/lib/hecks/fuzzing/properties/dispatch_and_mutations.rb +154 -49
  172. data/lib/hecks/fuzzing/properties/guards.rb +42 -42
  173. data/lib/hecks/fuzzing/properties/invariants_and_aggregation.rb +32 -32
  174. data/lib/hecks/fuzzing/properties/lifecycle_and_replay.rb +22 -35
  175. data/lib/hecks/fuzzing/properties/outbox.rb +24 -24
  176. data/lib/hecks/fuzzing/properties/querying.rb +17 -17
  177. data/lib/hecks/fuzzing/properties.rb +64 -40
  178. data/lib/hecks/fuzzing/qa_settings.rb +152 -0
  179. data/lib/hecks/fuzzing/replay.rb +114 -114
  180. data/lib/hecks/fuzzing/rotation_priority.rb +10 -10
  181. data/lib/hecks/fuzzing/rust_gap_manifest.rb +113 -0
  182. data/lib/hecks/fuzzing/self_consistency.rb +141 -112
  183. data/lib/hecks/fuzzing/sequence_generator/adversary.rb +35 -35
  184. data/lib/hecks/fuzzing/sequence_generator/catalog.rb +18 -11
  185. data/lib/hecks/fuzzing/sequence_generator/outcome_tracker.rb +13 -12
  186. data/lib/hecks/fuzzing/sequence_generator/picker.rb +21 -12
  187. data/lib/hecks/fuzzing/sequence_generator/step_builder.rb +58 -31
  188. data/lib/hecks/fuzzing/sequence_generator.rb +111 -23
  189. data/lib/hecks/fuzzing/shrinker.rb +197 -0
  190. data/lib/hecks/fuzzing/structural_skips.rb +23 -130
  191. data/lib/hecks/fuzzing/sweep_depth.rb +4 -4
  192. data/lib/hecks/fuzzing/target_capabilities.rb +49 -18
  193. data/lib/hecks/fuzzing/value_generator.rb +14 -14
  194. data/lib/hecks/fuzzing.rb +5 -0
  195. data/lib/hecks/grammar/evolve.rb +10 -10
  196. data/lib/hecks/grammar.rb +7 -7
  197. data/lib/hecks/ir.rb +13 -13
  198. data/lib/hecks/language/bluebook/bluebook.bluebook +41 -0
  199. data/lib/hecks/language/bluebook/policy.bluebook +11 -1
  200. data/lib/hecks/language/bluebook/vocabulary.bluebook +348 -13
  201. data/lib/hecks/language/oidc.json +5 -0
  202. data/lib/hecks/literal.rb +9 -9
  203. data/lib/hecks/naming.rb +25 -25
  204. data/lib/hecks/ports/access_control.rb +58 -2
  205. data/lib/hecks/ports/agent/answers.rb +83 -6
  206. data/lib/hecks/ports/agent.rb +119 -35
  207. data/lib/hecks/ports/authentication.rb +44 -4
  208. data/lib/hecks/ports/authorization.rb +53 -11
  209. data/lib/hecks/ports/clock.rb +42 -23
  210. data/lib/hecks/ports/extraction.rb +16 -0
  211. data/lib/hecks/ports/identity_assignment.rb +24 -2
  212. data/lib/hecks/ports/identity_generation.rb +17 -3
  213. data/lib/hecks/ports/identity_resolution.rb +18 -1
  214. data/lib/hecks/ports/loading.rb +4 -0
  215. data/lib/hecks/ports/persistence/append_only.rb +172 -8
  216. data/lib/hecks/ports/persistence/binding_policy.rb +34 -0
  217. data/lib/hecks/ports/persistence/codec_boundary.rb +178 -0
  218. data/lib/hecks/ports/persistence/execution.rb +4 -0
  219. data/lib/hecks/ports/persistence/null_saga_store.rb +12 -1
  220. data/lib/hecks/ports/persistence/plugin.rb +42 -4
  221. data/lib/hecks/ports/persistence/plugins/era/era_check.rb +218 -25
  222. data/lib/hecks/ports/persistence/plugins/era/era_guard/shape_diff.rb +77 -9
  223. data/lib/hecks/ports/persistence/plugins/era/era_guard.rb +81 -24
  224. data/lib/hecks/ports/persistence/plugins/era/era_tamper.rb +29 -18
  225. data/lib/hecks/ports/persistence/plugins/era/lineage.rb +144 -60
  226. data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage/era_store.rb +103 -8
  227. data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage/field_cache.rb +98 -23
  228. data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage/head_compiler.rb +282 -109
  229. data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage/mint_transaction.rb +63 -25
  230. data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage/provisioning.rb +118 -66
  231. data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage/resumable_backfill.rb +51 -28
  232. data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage/tail_merge.rb +28 -5
  233. data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage/transform_installer.rb +25 -12
  234. data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage.rb +129 -34
  235. data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage_manager/coverage_check.rb +51 -6
  236. data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage_manager/era_resolver.rb +33 -9
  237. data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage_manager/merge_coordinator.rb +16 -0
  238. data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage_manager/minter.rb +57 -4
  239. data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage_manager.rb +25 -2
  240. data/lib/hecks/ports/persistence/plugins/era/postgres_era.rb +314 -90
  241. data/lib/hecks/ports/persistence/plugins/era/storage_shape.rb +68 -10
  242. data/lib/hecks/ports/persistence/plugins/era/translation/audit/approval_digest.rb +9 -3
  243. data/lib/hecks/ports/persistence/plugins/era/translation/audit/layer_one.rb +9 -2
  244. data/lib/hecks/ports/persistence/plugins/era/translation/audit/layer_two.rb +42 -8
  245. data/lib/hecks/ports/persistence/plugins/era/translation/audit/unfed_report.rb +16 -1
  246. data/lib/hecks/ports/persistence/plugins/era/translation/audit.rb +36 -5
  247. data/lib/hecks/ports/persistence/plugins/era/translation/reattest.rb +23 -3
  248. data/lib/hecks/ports/persistence/plugins/era/translation/rule_compiler.rb +18 -19
  249. data/lib/hecks/ports/persistence/plugins/era/translation/scaffold/differ.rb +5 -5
  250. data/lib/hecks/ports/persistence/plugins/era/translation/scaffold/writer.rb +1 -1
  251. data/lib/hecks/ports/persistence/plugins/era/translation/scaffold.rb +2 -2
  252. data/lib/hecks/ports/persistence/plugins/era.rb +12 -2
  253. data/lib/hecks/ports/persistence/remote_runtime.rb +9 -2
  254. data/lib/hecks/ports/persistence/repository_factory.rb +23 -3
  255. data/lib/hecks/ports/persistence/state_codec.rb +319 -0
  256. data/lib/hecks/ports/persistence.rb +36 -1
  257. data/lib/hecks/ports/projection.rb +61 -7
  258. data/lib/hecks/ports/query/in_memory.rb +3 -3
  259. data/lib/hecks/ports/query/ordering.rb +6 -6
  260. data/lib/hecks/ports/query.rb +35 -0
  261. data/lib/hecks/projections/bootstrap_table.rb +112 -0
  262. data/lib/hecks/projections/diagrams.rb +75 -75
  263. data/lib/hecks/projections/glossary/html.rb +3 -3
  264. data/lib/hecks/projections/glossary/markdown.rb +3 -3
  265. data/lib/hecks/projections/glossary/mermaid.rb +1 -1
  266. data/lib/hecks/projections/glossary/sections.rb +1 -1
  267. data/lib/hecks/projections/glossary/sentences.rb +5 -5
  268. data/lib/hecks/projections/glossary.rb +15 -15
  269. data/lib/hecks/projections/ir.rb +1 -1
  270. data/lib/hecks/projections/model/deviations.rb +18 -17
  271. data/lib/hecks/projections/model.rb +25 -21
  272. data/lib/hecks/projections/oidc.rb +7 -7
  273. data/lib/hecks/projections/parser_table.rb +5 -5
  274. data/lib/hecks/projections/reference.rb +3 -3
  275. data/lib/hecks/projections/rust_vocabulary.rb +443 -0
  276. data/lib/hecks/projections/shape.rb +2 -2
  277. data/lib/hecks/projections/statements.rb +11 -11
  278. data/lib/hecks/projections/vocabulary.rb +9 -9
  279. data/lib/hecks/projections.rb +5 -3
  280. data/lib/hecks/projector/cli_projector.rb +29 -29
  281. data/lib/hecks/projector/docs_projector.rb +13 -13
  282. data/lib/hecks/projector/exporter.rb +42 -21
  283. data/lib/hecks/projector/ir_projector.rb +1 -1
  284. data/lib/hecks/projector/narrate_projector.rb +11 -11
  285. data/lib/hecks/projector/target.rb +13 -13
  286. data/lib/hecks/projector.rb +15 -15
  287. data/lib/hecks/query_ir.rb +47 -47
  288. data/lib/hecks/query_specification/common/comparators.rb +19 -3
  289. data/lib/hecks/query_specification/common/comparison.rb +109 -27
  290. data/lib/hecks/query_specification/common/dsl.rb +65 -9
  291. data/lib/hecks/query_specification/common/null_policy.rb +57 -13
  292. data/lib/hecks/query_specification/common/null_semantics.rb +4 -0
  293. data/lib/hecks/query_specification/common/options.rb +25 -0
  294. data/lib/hecks/query_specification/field_path.rb +69 -15
  295. data/lib/hecks/query_specification/hop_path.rb +57 -20
  296. data/lib/hecks/query_specification/read_model/specification.rb +4 -0
  297. data/lib/hecks/rendering.rb +3 -3
  298. data/lib/hecks/router/namespace_installer.rb +3 -3
  299. data/lib/hecks/router.rb +1 -1
  300. data/lib/hecks/runtime/aggregate_lock.rb +11 -11
  301. data/lib/hecks/runtime/boot_gates.rb +3 -3
  302. data/lib/hecks/runtime/caller.rb +8 -8
  303. data/lib/hecks/runtime/capability_graph.rb +2 -2
  304. data/lib/hecks/runtime/command_interpreter/argument_gate.rb +22 -25
  305. data/lib/hecks/runtime/command_interpreter/mutation_applier.rb +42 -63
  306. data/lib/hecks/runtime/command_interpreter.rb +159 -102
  307. data/lib/hecks/runtime/command_rules/admissibility.rb +69 -69
  308. data/lib/hecks/runtime/command_rules/arithmetic.rb +137 -91
  309. data/lib/hecks/runtime/command_rules/authorization.rb +38 -17
  310. data/lib/hecks/runtime/command_rules/emission.rb +18 -1
  311. data/lib/hecks/runtime/command_rules/references.rb +35 -35
  312. data/lib/hecks/runtime/command_rules.rb +3 -0
  313. data/lib/hecks/runtime/dependency_planning.rb +11 -11
  314. data/lib/hecks/runtime/dispatcher.rb +283 -90
  315. data/lib/hecks/runtime/entity_element.rb +151 -67
  316. data/lib/hecks/runtime/entity_interpreter.rb +108 -82
  317. data/lib/hecks/runtime/errors.rb +19 -19
  318. data/lib/hecks/runtime/event.rb +6 -6
  319. data/lib/hecks/runtime/identity.rb +22 -22
  320. data/lib/hecks/runtime/instance.rb +39 -14
  321. data/lib/hecks/runtime/interpreting.rb +12 -12
  322. data/lib/hecks/runtime/invocation.rb +276 -0
  323. data/lib/hecks/runtime/loader.rb +14 -14
  324. data/lib/hecks/runtime/outbox.rb +23 -23
  325. data/lib/hecks/runtime/policy_interpreter.rb +54 -54
  326. data/lib/hecks/runtime/port_operation_interpreter.rb +22 -19
  327. data/lib/hecks/runtime/query_interpreter.rb +55 -64
  328. data/lib/hecks/runtime/reaction_invocation.rb +20 -20
  329. data/lib/hecks/runtime/read_model_interpreter.rb +40 -40
  330. data/lib/hecks/runtime/rebuild_sweep.rb +4 -4
  331. data/lib/hecks/runtime/reference_hop.rb +6 -6
  332. data/lib/hecks/runtime/refusal_wording.rb +92 -115
  333. data/lib/hecks/runtime/registry/saga_persistence.rb +21 -21
  334. data/lib/hecks/runtime/registry/verification.rb +36 -26
  335. data/lib/hecks/runtime/registry.rb +45 -28
  336. data/lib/hecks/runtime/remote_dispatcher.rb +38 -23
  337. data/lib/hecks/runtime/routing.rb +10 -153
  338. data/lib/hecks/runtime/saga_interpreter/correlation.rb +17 -17
  339. data/lib/hecks/runtime/saga_interpreter.rb +64 -64
  340. data/lib/hecks/runtime/saga_pending_dispatch.rb +12 -12
  341. data/lib/hecks/runtime/tenant_check.rb +9 -9
  342. data/lib/hecks/runtime/tenant_scope.rb +5 -5
  343. data/lib/hecks/runtime/value/admission.rb +75 -30
  344. data/lib/hecks/runtime/value/coercion.rb +318 -127
  345. data/lib/hecks/runtime/value/entity_list_coercion.rb +34 -34
  346. data/lib/hecks/runtime/value.rb +21 -21
  347. data/lib/hecks/runtime.rb +7 -7
  348. data/lib/hecks/storehouse.rb +64 -64
  349. data/lib/hecks/version.rb +3 -3
  350. data/lib/hecks/vocabulary.rb +205 -4
  351. data/lib/hecks.rb +13 -11
  352. data/lib/rubocop/cop/hecks/fallback_hash_lookup.rb +11 -11
  353. data/lib/rubocop/cop/hecks/sequential_hash_rename_in_loop.rb +14 -12
  354. data/lib/rubocop/cop/hecks/thread_shared_ivar_mutation.rb +11 -11
  355. metadata +22 -2
@@ -3,20 +3,20 @@ require "json"
3
3
 
4
4
  module Hecks
5
5
  module Bluebook
6
- # Judges a bluebook by DISPATCHING it into the language declared in itself.
6
+ # Judges a bluebook by dispatching it into the language declared in itself.
7
7
  #
8
- # `lib/hecks/language/bluebook/` declares what a bluebook IS
8
+ # `lib/hecks/language/bluebook/` declares what a bluebook is
9
9
  # Chapter, Root, Verb, Shape, Ask, Piece, and the rest, split across files
10
10
  # by domain concept and merged into one chapter at load time (see
11
11
  # GRAMMAR_FILES below). This replays a built IR into that domain and turns
12
12
  # any refusal into a Malformed, so the meta-domain is what actually judges
13
13
  # rather than a description sitting beside the code — for whatever rules
14
14
  # it carries. `spec/meta_rules_spec.rb`'s own header names the plan: port
15
- # the language's rules OUT of builder `raise Malformed` calls and INTO
15
+ # the language's rules out of builder `raise Malformed` calls and into
16
16
  # `given`/`invariant` here, where they are declarations any reader of the
17
17
  # meta-domain can consume instead of behavior buried in a builder.
18
18
  #
19
- # THIS MIGRATION IS PARTIAL, NOT DONE. As of this writing the meta-domain
19
+ # **This migration is partial, not done**. As of this writing the meta-domain
20
20
  # declares 62 given/invariant/ensures rules (`Hecks::QueryIR.collect_rules`
21
21
  # against `grammar_registry.bluebook("Bluebook")` enumerates them) —
22
22
  # `spec/meta_rule_reachability_spec.rb` is what proves, per declaration,
@@ -40,12 +40,12 @@ module Hecks
40
40
  # keeping : a self-description that only describes is indistinguishable
41
41
  # from enforcement, and the first version of this file was deleted for
42
42
  # exactly that reason. What is not yet real is that self-hosting being
43
- # the WHOLE of validation.
43
+ # the whole of validation.
44
44
  #
45
- # The meta-domain is loaded ONCE and its registry reused ; each bluebook is
45
+ # The meta-domain is loaded once and its registry reused ; each bluebook is
46
46
  # judged in a fresh in-memory store so no domain can see another's records.
47
47
  module MetaValidator
48
- # THE FOLDER IS THE CHAPTER. Files are grouped by the domain concept they
48
+ # **The folder is the chapter**. Files are grouped by the domain concept they
49
49
  # describe and every one reopens the same `Hecks.bluebook "Bluebook"`.
50
50
  # `BluebookBuilder.build` keeps one builder open per chapter name across
51
51
  # calls, so the sorted folder accumulates one domain. Adding or renaming a
@@ -67,25 +67,25 @@ module Hecks
67
67
  # TranslationJudge.
68
68
  TRANSLATION_GRAMMAR = Dir.glob(File.expand_path("../language/translation/*.bluebook", __dir__)).freeze
69
69
 
70
- # ADR 0026's OWN SEAM: THE CORE DOES NOT NAME ITS EXTENSION POINTS.
70
+ # ADR 0026's own seam: the core does not name its extension points.
71
71
  #
72
- # A sub-language chapter (Paging, so far the only one) is an ORDINARY
72
+ # A sub-language chapter (Paging, so far the only one) is an ordinary
73
73
  # bluebook — declared with the same `aggregate`/`value_object`/
74
74
  # `attaches_to` words every domain has, judged through the language
75
75
  # the normal way, not bootstrapped raw the way GRAMMAR_FILES is. What
76
- # makes it special is only where it LIVES: any file in this directory
76
+ # makes it special is only where it lives: any file in this directory
77
77
  # is discovered and loaded here, by the directory's own existence,
78
78
  # never by a name this file would have to know. Add a chapter here
79
79
  # and it is attached ; nothing in this file changes.
80
80
  ATTACHED_GRAMMAR_DIR = File.expand_path("../language/bluebook/attaches", __dir__).freeze
81
81
 
82
- # The chapters that ARE the language — loaded raw during bootstrap, then
82
+ # The chapters that are the language — loaded raw during bootstrap, then
83
83
  # judged through themselves and replaced by their own assembled graphs
84
84
  # (see grammar_registry). Each is named after its file : Bluebook describes
85
85
  # bluebooks (language/bluebook/) ; World describes worlds (world.bluebook),
86
86
  # and backs the WorldJudge door ; Hecksagon describes hecksagons
87
87
  # (hecksagon.bluebook) — declared for the same self-description reasons as
88
- # World, but WITHOUT a judge door of its own : nothing dispatches a real
88
+ # World, but without a judge door of its own : nothing dispatches a real
89
89
  # .hecksagon file through it yet, so HecksagonBuilder's own behavior is
90
90
  # unchanged. What this buys is what syntax.bluebook needed — a real shape
91
91
  # `subscribe`'s `fills: "subscriptions"` can point at — not new validation
@@ -94,18 +94,18 @@ module Hecks
94
94
 
95
95
  # The meta-domain is itself a bluebook. Judging it while loading it would
96
96
  # recurse, so the load path marks the bootstrap and skips — but the skip
97
- # is only the FIRST pass. Once every grammar file is loaded and merged,
97
+ # is only the first pass. Once every grammar file is loaded and merged,
98
98
  # grammar_registry judges the language through itself and keeps the
99
99
  # assembled result (the fixpoint, made load-bearing).
100
100
  def self.bootstrapping? = @bootstrapping
101
101
 
102
- # A CHAPTER MAY BE SPLIT ACROSS FILES, so it cannot be judged until
102
+ # A chapter may be split across files, so it cannot be judged until
103
103
  # every file has been read.
104
104
  #
105
- # `BluebookBuilder.build` already MERGES — `registry.bluebook_builder
105
+ # `BluebookBuilder.build` already merges — `registry.bluebook_builder
106
106
  # (name)` memoises one builder per chapter name, so nine files each
107
107
  # saying `Hecks.bluebook "Bluebook"` accumulate into one. What it
108
- # also does is call `MetaValidator.call` once PER FILE, judging a
108
+ # also does is call `MetaValidator.call` once per file, judging a
109
109
  # chapter that is still eight files short: `Aggregate`'s reference
110
110
  # to `Bluebook` dangles because `Bluebook` has not been declared
111
111
  # yet, and the load dies.
@@ -119,7 +119,7 @@ module Hecks
119
119
  # once, before hecksagons and worlds load (DOMAIN_ORDER already
120
120
  # puts every chapter ahead of those).
121
121
  #
122
- # Only chapters DECLARED INSIDE the window are judged afterwards.
122
+ # Only chapters declared inside the window are judged afterwards.
123
123
  # Re-judging one already assembled — a framework member pulled in
124
124
  # earlier by `uses_framework`, say — would re-run Assembly and hand
125
125
  # out a second set of classes for a graph something already holds.
@@ -144,18 +144,18 @@ module Hecks
144
144
  chapter = registry.bluebook(name)
145
145
  next unless chapter
146
146
 
147
- # A bare chapter-given left PENDING by any file of this
147
+ # A bare chapter-given left pending by any file of this
148
148
  # chapter (`AggregateBuilder#pending_chapter_given`) resolves
149
149
  # first — before anything below reads a `Given`'s fields.
150
- # `registry.bluebook_builder(name)` is the SAME instance every
150
+ # `registry.bluebook_builder(name)` is the same instance every
151
151
  # one of this chapter's own files built onto (`#self.build`'s
152
152
  # own comment); it is guaranteed already open here, since it
153
153
  # is what produced `chapter` in the first place — the block is
154
154
  # dead code, never actually invoked.
155
155
  builder = registry.bluebook_builder(name) { raise "internal: no open builder for #{name}" }
156
156
  builder.resolve_pending_chapter_givens!
157
- # THE ENTITY-SCOPED ANALOGUE, one level down — same reason,
158
- # same timing: a bare entity-level given left PENDING by any
157
+ # The entity-scoped analogue, one level down — same reason,
158
+ # same timing: a bare entity-level given left pending by any
159
159
  # file of this chapter (`EntityBuilder#pending_chapter_entity_
160
160
  # given`) must resolve before anything below reads a piece's
161
161
  # own `Given` fields too.
@@ -163,11 +163,11 @@ module Hecks
163
163
 
164
164
  # `BluebookBuilder#build` skipped its own whole-chapter battery
165
165
  # (hops, projected fields, correlation keys, event shapes,
166
- # `with:` projections) for every file of THIS chapter while
166
+ # `with:` projections) for every file of this chapter while
167
167
  # `deferring?` was true, the same reason `call` below queued
168
168
  # instead of judging — each of those checks needs every file
169
169
  # loaded first (see `BluebookBuilder.validate_assembled!`'s own
170
- # comment). `chapter` here is exactly that: whatever the LAST
170
+ # comment). `chapter` here is exactly that: whatever the last
171
171
  # file's own `add_bluebook` left in the registry, which by now
172
172
  # holds every aggregate/policy/process_manager the whole
173
173
  # chapter declares. Run once, here, instead of once per file.
@@ -178,25 +178,25 @@ module Hecks
178
178
 
179
179
  # `&& !@forcing_fixpoint` — see `while_forcing_fixpoint` below, whose own
180
180
  # window must win even while a growth spec's `while_disabled` is open,
181
- # for the reason recorded there. Otherwise the SAME stack-restore shape
181
+ # for the reason recorded there. Otherwise the same stack-restore shape
182
182
  # `while_shadow_parsing`/`while_forcing_fixpoint` use, not a bare env
183
183
  # toggle any more — it used to be exactly that (`ENV["HECKS_META_
184
184
  # VALIDATION"] == "off"`, read directly, with no `previous`/`ensure` of
185
185
  # its own), and the gap between "bare toggle" and "stack-restore" was
186
186
  # not cosmetic: a test's temporary window could reach code it was never
187
- # meant to touch. If `grammar_registry`'s ONE-TIME lazy build (below)
188
- # happened to land inside that window, EVERY language chapter got
187
+ # meant to touch. If `grammar_registry`'s one-time lazy build (below)
188
+ # happened to land inside that window, every language chapter got
189
189
  # cached in its raw, never-judged form for the rest of the process —
190
190
  # `unmark_scalar`'s String->Integer/Boolean fix (assembly/marks.rb)
191
191
  # never ran, so a `Command`'s own `required: true` stayed
192
192
  # `required: "true"` forever after, permanently memoized. Found live:
193
193
  # an intermittent, parallel_rspec-only ir_golden_spec.rb failure,
194
194
  # order-dependent on whether identifier_numeric_coercion_growth_spec.rb's
195
- # disabled-validation window raced the ONE lazy build in its own worker
195
+ # disabled-validation window raced the one lazy build in its own worker
196
196
  # process — reproduced in isolation by disabling validation before the
197
197
  # first `grammar_registry` call. `&& !@forcing_fixpoint` was the first
198
198
  # fix and is kept ; converting `@disabled` itself to this shape closes
199
- # the gap for every OTHER caller of `while_disabled`, not just the one
199
+ # the gap for every other caller of `while_disabled`, not just the one
200
200
  # race that was actually observed — nothing outside this file reads
201
201
  # `ENV["HECKS_META_VALIDATION"]` any more (confirmed: every one of the
202
202
  # dozen growth specs that used to hand-roll `previous = ENV[...] ;
@@ -204,8 +204,8 @@ module Hecks
204
204
  # `while_disabled` instead), so there is no bare global left to race.
205
205
  def self.disabled? = @disabled && !@forcing_fixpoint
206
206
 
207
- # THE SAME STACK-RESTORE SHAPE `while_shadow_parsing`/`while_forcing_
208
- # fixpoint` USE. This toggle's real, intended use is a growth spec
207
+ # The same stack-restore shape `while_shadow_parsing`/`while_forcing_
208
+ # fixpoint` use. This toggle's real, intended use is a growth spec
209
209
  # that boots a scratch bluebook from a tempfile and wants the runtime
210
210
  # behaviour without the validation overhead ; that is always a single
211
211
  # bounded window around one boot, never a flag meant to survive past
@@ -220,13 +220,13 @@ module Hecks
220
220
  end
221
221
 
222
222
  # ADR 0025's own prerequisite (docs/dsl-work-slices.md, S0a): a word
223
- # a later slice removes from the LIVE grammar must still parse
224
- # FROZEN ERA TEXT — `EraGuard.shadow_parse` (runtime/era_guard.rb)
223
+ # a later slice removes from the live grammar must still parse
224
+ # frozen era text — `EraGuard.shadow_parse` (runtime/era_guard.rb)
225
225
  # is a plain `Kernel.eval` of stored source, run at boot, at mint,
226
226
  # and during tamper detection, against whatever grammar is live
227
- # TODAY, not whatever grammar was live when that text was written.
227
+ # today, not whatever grammar was live when that text was written.
228
228
  # Judging it again here would refuse history the day a spelling it
229
- # used is removed — proved with a rule that already lives ONLY in
229
+ # used is removed — proved with a rule that already lives only in
230
230
  # the meta-domain, never duplicated as a builder's own `raise
231
231
  # Malformed` (`vision`'s own comment: "moved to the language").
232
232
  #
@@ -245,7 +245,7 @@ module Hecks
245
245
  @shadow_parsing = previous
246
246
  end
247
247
 
248
- # THE SAME STACK-RESTORE SHAPE `while_shadow_parsing` USES, for the
248
+ # The same stack-restore shape `while_shadow_parsing` uses, for the
249
249
  # same reason: whatever this wraps must never see `disabled?` answer
250
250
  # true, however a test elsewhere has the env toggle set at that
251
251
  # exact moment. Only `grammar_registry`'s own one-time build (below)
@@ -262,7 +262,7 @@ module Hecks
262
262
 
263
263
  # The same bluebook judged twice gets the same verdict, and a suite reloads
264
264
  # its fixtures constantly — banking alone is ~200 dispatches per build.
265
- # Keyed on the IR itself, so a CHANGED bluebook is always re-judged.
265
+ # Keyed on the IR itself, so a changed bluebook is always re-judged.
266
266
  def self.verdicts = @verdicts ||= {}
267
267
 
268
268
  # A world is not a bluebook, so it gets its own door. Same judge, same
@@ -309,12 +309,12 @@ module Hecks
309
309
  # A translation is not a bluebook either — same door shape, one more
310
310
  # artifact over (a `translations/*.bluebook` edge — `data_translation`'s
311
311
  # own real, established convention; there is no separate extension).
312
- # TranslationJudge walks the WHOLE built translation (every nested
312
+ # TranslationJudge walks the whole built translation (every nested
313
313
  # aggregate's own rule table) in one pass — only
314
314
  # TranslationBuilder's own top-level `build` calls this;
315
315
  # TranslationAggregateBuilder#build stays a plain struct constructor,
316
316
  # the same way `WorldJudge` judges every `Wiring` a `.world` declares
317
- # in ONE pass over `World::World.Declare`'s own caller, not from a
317
+ # in one pass over `World::World.Declare`'s own caller, not from a
318
318
  # separate door per binding. Whole-project table-unification survey,
319
319
  # item #13's remaining builders.
320
320
  def self.call_translation(translation)
@@ -337,12 +337,12 @@ module Hecks
337
337
  "#{translation.domain}'s translation is not well formed; #{refusals.join('; ')}"
338
338
  end
339
339
 
340
- # THE LANGUAGE HANDS THE GRAPH BACK.
340
+ # The language hands the graph back.
341
341
  #
342
342
  # This used to return the bluebook it was given — dispatch every declaration
343
- # in, collect refusals, throw the records away — which is all JUDGING needs
343
+ # in, collect refusals, throw the records away — which is all judging needs
344
344
  # and exactly why the language could only validate. It returns what the
345
- # meta-domain HOLDS instead, assembled into the graph the runtime runs. The
345
+ # meta-domain holds instead, assembled into the graph the runtime runs. The
346
346
  # builder's own object graph now exists only to be dispatched; nothing keeps
347
347
  # it.
348
348
  #
@@ -350,15 +350,15 @@ module Hecks
350
350
  # is the difference between a language that checks a domain and a language
351
351
  # that is the source of one.
352
352
  #
353
- # What is CACHED is the declarations, not the graph. A hash carries no Ruby
353
+ # What is cached is the declarations, not the graph. A hash carries no Ruby
354
354
  # classes, so a second load of the same chapter re-assembles fresh ones —
355
355
  # which is the behaviour `Namespace.install` and `spec/construct_spec` both
356
356
  # expect. Caching the graph would hand two boots the same classes.
357
- # THE LANGUAGE IS THE SOURCE. This is the line that makes it one.
357
+ # The language is the source. This is the line that makes it one.
358
358
  #
359
359
  # `Hecks.bluebook` registers whatever comes back from here, so returning the
360
360
  # assembled graph rather than the bluebook it was handed is the whole swap: the
361
- # runtime runs what the meta-domain HOLDS. The builder's own graph exists only
361
+ # runtime runs what the meta-domain holds. The builder's own graph exists only
362
362
  # to be dispatched in ; nothing keeps it.
363
363
  #
364
364
  # It stayed unlanded for one wrong belief, worth naming because it looked so
@@ -366,23 +366,23 @@ module Hecks
366
366
  # `ReadModel#to_h` omitted a read model's filters until 2026-08-11, so
367
367
  # read-model filtering seemed impossible to read back —
368
368
  # and hoisted policies lost which head declared them for the same reason.
369
- # But `to_h` is a PROJECTION and the language is the
370
- # SOURCE. They must agree about everything to_h spells ; they need not be the
369
+ # But `to_h` is a projection and the language is the
370
+ # source. They must agree about everything to_h spells ; they need not be the
371
371
  # same size. Both were held even before the wire format carried them, as
372
372
  # declarations the wire format didn't yet see.
373
373
  #
374
- # UPDATE, 2026-08-11: the wire format DID move, on purpose, for a reason
374
+ # Update, 2026-08-11: the wire format did move, on purpose, for a reason
375
375
  # unrelated to this file — a Rust-codegen task needed `wheres`/
376
376
  # `order_by`/`limit` on the wire to compile a read model's real declared
377
377
  # filtering, and the boundary described above was never load-bearing for
378
- # THIS mechanism (`option_rows`/`filter_options` in meta_validator/
378
+ # this mechanism (`option_rows`/`filter_options` in meta_validator/
379
379
  # readings.rb read `node.wheres`/`node.order_by`/`node.limit` off the
380
380
  # live object directly, never off `to_h`), so extending `to_h` changed
381
381
  # nothing here. `ReadModel#to_h` now spells all three explicitly, the
382
382
  # same mechanism `Query#to_h` already used — purely additive, still
383
383
  # agreeing with the language about everything it spells.
384
384
  #
385
- # What is CACHED is the declarations, not the graph. A hash carries no Ruby
385
+ # What is cached is the declarations, not the graph. A hash carries no Ruby
386
386
  # classes, so a second load of the same chapter assembles fresh ones — which is
387
387
  # what `Namespace.install` and `spec/construct_spec` both expect. Caching the
388
388
  # graph would hand two boots the same classes.
@@ -405,7 +405,7 @@ module Hecks
405
405
  Assembly.call(held[:declaration])
406
406
  end
407
407
 
408
- # Dispatch it in and READ IT BACK. A refused chapter has no declarations to
408
+ # Dispatch it in and read it back. A refused chapter has no declarations to
409
409
  # read — the records are half-written by definition — so it carries refusals
410
410
  # and nothing else.
411
411
  def self.hold(bluebook)
@@ -418,49 +418,49 @@ module Hecks
418
418
  def self.grammar_registry
419
419
  @grammar_registry ||= begin
420
420
  registry = load_grammar_into(Runtime::Registry.new)
421
- # Assigned BEFORE the fixpoint judge below: judging re-enters
421
+ # Assigned before the fixpoint judge below: judging re-enters
422
422
  # grammar_registry through fresh_runtime (judge.rb) and Plan.for
423
423
  # (judge.rb, reconstruction.rb) — a bare ||= would still be nil
424
424
  # while its right-hand side evaluates, and recurse forever. That
425
- # reentrancy window is real: a caller landing here BEFORE the
426
- # fixpoint/attach below have run sees the SAME registry object,
425
+ # reentrancy window is real: a caller landing here before the
426
+ # fixpoint/attach below have run sees the same registry object,
427
427
  # correctly, but one still missing the attached chapters (Paging's
428
428
  # `attaches_to` among them) — see grammar_registry_ready? below.
429
429
  @grammar_registry = registry
430
- # THE FIXPOINT MADE LOAD-BEARING. The bootstrap loaded the language
430
+ # **The fixpoint made load-bearing**. The bootstrap loaded the language
431
431
  # raw ; now the language judges itself, its records are read back,
432
- # and the ASSEMBLED graph replaces the raw one — so every bluebook
432
+ # and the assembled graph replaces the raw one — so every bluebook
433
433
  # judged from here on is judged by the language the language itself
434
434
  # produced. Outside load_grammar_into on purpose : its ensure clears
435
435
  # @bootstrapping, and call() must see bootstrapping? == false to do
436
436
  # anything at all. `while_forcing_fixpoint`-wrapped so a growth
437
437
  # spec's own `while_disabled` window can never leave this
438
- # ONE-TIME build cached in its raw, never-judged form — see
438
+ # one-time build cached in its raw, never-judged form — see
439
439
  # `disabled?`'s own comment.
440
440
  while_forcing_fixpoint do
441
441
  LANGUAGE_CHAPTERS.each { |name| registry.add_bluebook(call(registry.bluebook(name))) }
442
442
  load_attached_grammar_into(registry)
443
443
  end
444
- # Stamped LAST, keyed by this registry's own identity rather than
444
+ # Stamped last, keyed by this registry's own identity rather than
445
445
  # a bare boolean — a manual reset (fixpoint_spec.rb's own
446
446
  # `@grammar_registry = nil`) makes @grammar_registry not equal
447
447
  # this object_id again until a fresh build finishes, so a stale
448
- # "ready" from the PREVIOUS cycle can never leak into the next.
448
+ # "ready" from the previous cycle can never leak into the next.
449
449
  @grammar_ready_for = registry.object_id
450
450
  registry
451
451
  end
452
452
  end
453
453
 
454
- # A REENTRANT CALL DURING THE FIXPOINT/ATTACH WINDOW ABOVE gets a
454
+ # A reentrant call during the fixpoint/attach window above gets a
455
455
  # real, correctly-mutating registry object back — no infinite loop,
456
- # no wrong data for THAT caller's own purposes. But anything that
457
- # MEMOIZES a snapshot derived from it must not lock that snapshot
456
+ # no wrong data for that caller's own purposes. But anything that
457
+ # memoizes a snapshot derived from it must not lock that snapshot
458
458
  # in forever : this is one signal such a cache can check. Found
459
459
  # live — SyntaxBoot.call had cached a Query keyword list missing
460
460
  # every Paging-attached word (limit/offset/cursor/nulls) because
461
461
  # something called it inside this exact window.
462
462
  #
463
- # SyntaxBoot.call NO LONGER USES THIS. Gating its cache on "the
463
+ # SyntaxBoot.call no longer uses this. Gating its cache on "the
464
464
  # whole registry is finished" meant nothing was cached for the
465
465
  # entire window, and the window is not narrow — every word routed
466
466
  # through `word_gate_dispatch` while the language judged itself
@@ -474,8 +474,8 @@ module Hecks
474
474
  @grammar_registry && @grammar_ready_for == @grammar_registry.object_id
475
475
  end
476
476
 
477
- # ATTACHED CHAPTERS LOAD AFTER THE FIXPOINT, NOT DURING BOOTSTRAP
478
- # they are declared IN the language the language just finished
477
+ # Attached chapters load after the fixpoint, not during bootstrap
478
+ # they are declared in the language the language just finished
479
479
  # judging itself through, so they are ordinary bluebooks, judged the
480
480
  # ordinary way (`Hecks.bluebook` → `BluebookBuilder#build` →
481
481
  # `MetaValidator.call`, `bootstrapping?` already false). A directory
@@ -487,20 +487,20 @@ module Hecks
487
487
  end
488
488
  end
489
489
 
490
- # THE ONE PLACE THE GRAMMAR'S OWN BOOT SEQUENCE IS SPELLED — ports, the
490
+ # The one place the grammar's own boot sequence is spelled — ports, the
491
491
  # memory/prism adapters, the (now nine-file) chapter itself, then the
492
492
  # sibling world grammar. `grammar_registry` uses this for its memoised
493
- # singleton ; anything that needs an ISOLATED registry (a spec wanting a
493
+ # singleton ; anything that needs an isolated registry (a spec wanting a
494
494
  # fresh store per example, say) calls this directly instead of hand-
495
495
  # copying the sequence.
496
496
  #
497
- # THE BOOTSTRAP GUARD LIVES HERE, not just around the singleton. Splitting
497
+ # The bootstrap guard lives here, not just around the singleton. Splitting
498
498
  # the chapter into several files means each file's own `Hecks.bluebook
499
499
  # "Bluebook"` call now runs `BluebookBuilder#build` once per file — and
500
500
  # `MetaValidator.call` judges whatever it is handed unless `bootstrapping?`
501
501
  # is true. A caller that loaded the grammar files by hand into its own
502
- # registry, without this guard, would get each file DISPATCHED AND JUDGED
503
- # ALONE the moment it loaded — and a lone file like `aggregate.bluebook`
502
+ # registry, without this guard, would get each file dispatched and judged
503
+ # alone the moment it loaded — and a lone file like `aggregate.bluebook`
504
504
  # refuses immediately, since `Aggregate.Attribute` references `ValueObject`
505
505
  # and `Aggregate.Holds` references `Entity`, both declared in later files.
506
506
  # Every caller of the grammar must go through here for exactly that reason.
@@ -523,7 +523,7 @@ module Hecks
523
523
  @bootstrapping = false
524
524
  end
525
525
 
526
- # A FRESH STORE per bluebook. The registry memoises repositories, so
526
+ # A fresh store per bluebook. The registry memoises repositories, so
527
527
  # reusing it let every bluebook see the records of every bluebook judged
528
528
  # before it. The parsed grammar is reused ; only the records are cleared.
529
529
  # (During grammar_registry's own fixpoint judge this clear runs on the