hecks 5.0.0 → 7.0.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 (1687) hide show
  1. checksums.yaml +4 -4
  2. data/examples/pizzas/bluebook/pizzas.bluebook +1 -0
  3. data/exe/hecks +31 -12
  4. data/lib/hecks/adapters/driven/claude_code.rb +3 -3
  5. data/lib/hecks/adapters/driven/d1.rb +2 -1
  6. data/lib/hecks/adapters/driven/folder.rb +44 -28
  7. data/lib/hecks/adapters/driven/folder_overlay.rb +66 -0
  8. data/lib/hecks/adapters/driven/google_authentication.adapter +3 -0
  9. data/lib/hecks/adapters/driven/google_authentication.rb +99 -0
  10. data/lib/hecks/adapters/driven/governance_authorization.rb +32 -36
  11. data/lib/hecks/adapters/driven/heki/journal.rb +45 -0
  12. data/lib/hecks/adapters/driven/heki.rb +1 -1
  13. data/lib/hecks/adapters/driven/identity_registry.rb +1 -1
  14. data/lib/hecks/adapters/driven/in_memory_ordering.rb +3 -2
  15. data/lib/hecks/adapters/driven/in_process_key_vault.rb +1 -1
  16. data/lib/hecks/adapters/driven/key_keeper.rb +42 -0
  17. data/lib/hecks/adapters/driven/lambda/client.rb +8 -2
  18. data/lib/hecks/adapters/driven/lambda/remote_dispatcher.rb +185 -0
  19. data/lib/hecks/adapters/driven/lambda.rb +14 -2
  20. data/lib/hecks/adapters/driven/memory/dispatch_claims.rb +25 -0
  21. data/lib/hecks/adapters/driven/memory/outbox_rows.rb +2 -2
  22. data/lib/hecks/adapters/driven/memory.rb +15 -4
  23. data/lib/hecks/adapters/driven/postgres/codec.rb +1 -1
  24. data/lib/hecks/adapters/driven/postgres/journal.rb +46 -0
  25. data/lib/hecks/adapters/driven/postgres/name_guard.rb +25 -0
  26. data/lib/hecks/adapters/driven/postgres/outbox.rb +33 -7
  27. data/lib/hecks/adapters/driven/postgres/projection.rb +43 -0
  28. data/lib/hecks/adapters/driven/postgres/repository.rb +2 -2
  29. data/lib/hecks/adapters/driven/postgres/schema_builder.rb +2 -1
  30. data/lib/hecks/adapters/driven/postgres/set_dialect.rb +44 -0
  31. data/lib/hecks/adapters/driven/postgres/shared_connection.rb +1 -1
  32. data/lib/hecks/adapters/driven/postgres.adapter +8 -0
  33. data/lib/hecks/adapters/driven/postgres.rb +11 -3
  34. data/lib/hecks/adapters/driven/postgres_dump/connection.rb +57 -0
  35. data/lib/hecks/adapters/driven/postgres_dump.rb +117 -0
  36. data/lib/hecks/adapters/driven/postgres_era/boot.rb +58 -0
  37. data/lib/hecks/{ports/persistence/plugins/era → adapters/driven}/postgres_era/class_methods.rb +28 -8
  38. data/lib/hecks/{ports/persistence/plugins/era → adapters/driven}/postgres_era/dialect.rb +11 -6
  39. data/lib/hecks/adapters/driven/postgres_era/field_cache_provisioner.rb +39 -0
  40. data/lib/hecks/{ports/persistence/plugins/era → adapters/driven}/postgres_era/journal.rb +52 -13
  41. data/lib/hecks/{ports/persistence/plugins/era → adapters/driven}/postgres_era/lineage/chain_sql.rb +37 -53
  42. data/lib/hecks/adapters/driven/postgres_era/lineage/direct_sql.rb +73 -0
  43. data/lib/hecks/adapters/driven/postgres_era/lineage/direct_verified.json +10 -0
  44. data/lib/hecks/adapters/driven/postgres_era/lineage/direct_verified.rb +65 -0
  45. data/lib/hecks/adapters/driven/postgres_era/lineage/domain_rename.rb +143 -0
  46. data/lib/hecks/adapters/driven/postgres_era/lineage/domain_rename_state.rb +108 -0
  47. data/lib/hecks/{ports/persistence/plugins/era → adapters/driven}/postgres_era/lineage/era_integrity.rb +13 -8
  48. data/lib/hecks/adapters/driven/postgres_era/lineage/era_store.rb +125 -0
  49. data/lib/hecks/adapters/driven/postgres_era/lineage/layered_sql.rb +64 -0
  50. data/lib/hecks/adapters/driven/postgres_era/lineage/ledger_reset.rb +150 -0
  51. data/lib/hecks/adapters/driven/postgres_era/lineage/mint_provisioning.rb +85 -0
  52. data/lib/hecks/{ports/persistence/plugins/era → adapters/driven}/postgres_era/lineage/mint_transaction.rb +13 -9
  53. data/lib/hecks/{ports/persistence/plugins/era → adapters/driven}/postgres_era/lineage/provisioning.rb +11 -5
  54. data/lib/hecks/adapters/driven/postgres_era/lineage/split_sql.rb +76 -0
  55. data/lib/hecks/{ports/persistence/plugins/era → adapters/driven}/postgres_era/lineage/sql_templates.rb +15 -2
  56. data/lib/hecks/{ports/persistence/plugins/era → adapters/driven}/postgres_era/lineage/tail_merge.rb +1 -1
  57. data/lib/hecks/{ports/persistence/plugins/era → adapters/driven}/postgres_era/lineage.rb +11 -3
  58. data/lib/hecks/adapters/driven/postgres_era/lineage_manager/context.rb +68 -0
  59. data/lib/hecks/{ports/persistence/plugins/era → adapters/driven}/postgres_era/lineage_manager/coverage_check.rb +16 -12
  60. data/lib/hecks/adapters/driven/postgres_era/lineage_manager/disposable_ledger.rb +119 -0
  61. data/lib/hecks/adapters/driven/postgres_era/lineage_manager/era_resolution.rb +219 -0
  62. data/lib/hecks/adapters/driven/postgres_era/lineage_manager/era_resolver.rb +114 -0
  63. data/lib/hecks/adapters/driven/postgres_era/lineage_manager/held_era.rb +68 -0
  64. data/lib/hecks/adapters/driven/postgres_era/lineage_manager/ledger_change.rb +63 -0
  65. data/lib/hecks/{ports/persistence/plugins/era → adapters/driven}/postgres_era/lineage_manager/merge_coordinator.rb +3 -3
  66. data/lib/hecks/adapters/driven/postgres_era/lineage_manager/mint_decision.rb +163 -0
  67. data/lib/hecks/adapters/driven/postgres_era/lineage_manager/mint_request.rb +24 -0
  68. data/lib/hecks/adapters/driven/postgres_era/lineage_manager/minter.rb +143 -0
  69. data/lib/hecks/adapters/driven/postgres_era/lineage_manager/refusals.rb +76 -0
  70. data/lib/hecks/{ports/persistence/plugins/era → adapters/driven}/postgres_era/lineage_manager.rb +46 -12
  71. data/lib/hecks/{ports/persistence/plugins/era → adapters/driven}/postgres_era/query_phases.rb +8 -2
  72. data/lib/hecks/adapters/driven/postgres_era/shared_tables.rb +32 -0
  73. data/lib/hecks/adapters/driven/postgres_era.adapter +19 -1
  74. data/lib/hecks/{ports/persistence/plugins/era → adapters/driven}/postgres_era.rb +39 -23
  75. data/lib/hecks/adapters/driven/prism.rb +4 -4
  76. data/lib/hecks/adapters/driven/projection/read_model_walk.rb +126 -0
  77. data/lib/hecks/adapters/driven/projection/row_decoding.rb +57 -0
  78. data/lib/hecks/adapters/driven/set_transform/assignments.rb +101 -0
  79. data/lib/hecks/adapters/driven/set_transform/expressions.rb +138 -0
  80. data/lib/hecks/adapters/driven/set_transform.rb +81 -0
  81. data/lib/hecks/adapters/driven/sql_keyset.rb +61 -0
  82. data/lib/hecks/adapters/driven/sql_query_builder.rb +29 -9
  83. data/lib/hecks/adapters/driven/sqlite/codec.rb +1 -1
  84. data/lib/hecks/adapters/driven/sqlite/ddl.rb +7 -0
  85. data/lib/hecks/adapters/driven/sqlite/dialect.rb +2 -1
  86. data/lib/hecks/adapters/driven/sqlite/dispatch_claims.rb +28 -0
  87. data/lib/hecks/adapters/driven/sqlite/journal.rb +46 -0
  88. data/lib/hecks/adapters/driven/sqlite/name_guard.rb +25 -0
  89. data/lib/hecks/adapters/driven/sqlite/outbox.rb +5 -4
  90. data/lib/hecks/adapters/driven/sqlite/projection.rb +9 -135
  91. data/lib/hecks/adapters/driven/sqlite/repository.rb +2 -2
  92. data/lib/hecks/adapters/driven/sqlite/schema_builder.rb +36 -4
  93. data/lib/hecks/adapters/driven/sqlite/set_dialect.rb +39 -0
  94. data/lib/hecks/adapters/driven/sqlite.adapter +2 -0
  95. data/lib/hecks/adapters/driven/sqlite.rb +20 -3
  96. data/lib/hecks/adapters/driven/tenant_provisioner.rb +1 -1
  97. data/lib/hecks/adapters/driven/worktree_overlay.rb +117 -0
  98. data/lib/hecks/adapters/driven.rb +8 -3
  99. data/lib/hecks/adapters/driving/cli/shorthand.rb +5 -1
  100. data/lib/hecks/adapters/driving/cli.rb +2 -2
  101. data/lib/hecks/adapters/driving/cli_runner/answers.rb +96 -34
  102. data/lib/hecks/adapters/driving/cli_runner/bang_rule.rb +35 -0
  103. data/lib/hecks/adapters/driving/cli_runner/completion_words.rb +36 -0
  104. data/lib/hecks/adapters/driving/cli_runner/json_words.rb +55 -0
  105. data/lib/hecks/adapters/driving/cli_runner/name_index.rb +63 -0
  106. data/lib/hecks/adapters/driving/cli_runner/read_context.rb +32 -0
  107. data/lib/hecks/adapters/driving/cli_runner/renamed_names.rb +49 -0
  108. data/lib/hecks/adapters/driving/cli_runner/resolution.rb +66 -39
  109. data/lib/hecks/adapters/driving/cli_runner/resume_words.rb +63 -0
  110. data/lib/hecks/adapters/driving/cli_runner/run_reference.rb +66 -0
  111. data/lib/hecks/adapters/driving/cli_runner/run_replay.rb +118 -0
  112. data/lib/hecks/adapters/driving/cli_runner/search_words.rb +35 -0
  113. data/lib/hecks/adapters/driving/cli_runner/settling.rb +14 -9
  114. data/lib/hecks/adapters/driving/cli_runner/streaming.rb +12 -11
  115. data/lib/hecks/adapters/driving/cli_runner/suggestions.rb +16 -8
  116. data/lib/hecks/adapters/driving/cli_runner/tour_words.rb +77 -0
  117. data/lib/hecks/adapters/driving/cli_runner/verb_names.rb +81 -0
  118. data/lib/hecks/adapters/driving/cli_runner/verbosity.rb +75 -0
  119. data/lib/hecks/adapters/driving/cli_runner.rb +110 -9
  120. data/lib/hecks/adapters/driving/context_line.rb +85 -0
  121. data/lib/hecks/adapters/driving/exit_status.rb +31 -0
  122. data/lib/hecks/adapters/driving/github_webhook.rb +2 -1
  123. data/lib/hecks/adapters/driving/handle/verb_methods.rb +46 -0
  124. data/lib/hecks/adapters/driving/handle.rb +9 -17
  125. data/lib/hecks/adapters/driving/json.rb +11 -8
  126. data/lib/hecks/adapters/driving/launcher_options.rb +41 -34
  127. data/lib/hecks/adapters/driving/mcp/progress_sink.rb +45 -0
  128. data/lib/hecks/adapters/driving/mcp/tool_calls.rb +7 -5
  129. data/lib/hecks/adapters/driving/mcp.rb +25 -5
  130. data/lib/hecks/adapters/driving/mcp_scope/argument_policy.rb +40 -7
  131. data/lib/hecks/adapters/driving/mcp_scope/env_problems.rb +3 -1
  132. data/lib/hecks/adapters/driving/mcp_scope.rb +11 -9
  133. data/lib/hecks/adapters/driving/newcomer.rb +6 -5
  134. data/lib/hecks/adapters/driving/ruby/aggregate_module/hooks.rb +154 -0
  135. data/lib/hecks/adapters/driving/ruby/aggregate_module.rb +73 -101
  136. data/lib/hecks/adapters/driving/ruby/bulk_verbs.rb +127 -0
  137. data/lib/hecks/adapters/driving/ruby/{chapter.rb → declaration.rb} +27 -27
  138. data/lib/hecks/adapters/driving/ruby/query_rows.rb +27 -0
  139. data/lib/hecks/adapters/driving/ruby.rb +25 -24
  140. data/lib/hecks/adapters/driving/usage_cache.rb +14 -3
  141. data/lib/hecks/adapters/driving/usage_log.rb +146 -0
  142. data/lib/hecks/adapters/driving/write_guard.rb +55 -0
  143. data/lib/hecks/adapters/driving.rb +0 -1
  144. data/lib/hecks/assembly.rb +101 -0
  145. data/lib/hecks/behaviors/dsl.rb +18 -4
  146. data/lib/hecks/behaviors/expectations/boot.rb +7 -7
  147. data/lib/hecks/behaviors/expectations/checks.rb +1 -1
  148. data/lib/hecks/behaviors/expectations/dispatching.rb +10 -9
  149. data/lib/hecks/behaviors/expectations/qualify.rb +9 -9
  150. data/lib/hecks/behaviors/expectations.rb +24 -10
  151. data/lib/hecks/behaviors/ir.rb +4 -2
  152. data/lib/hecks/behaviors/rspec.rb +1 -1
  153. data/lib/hecks/behaviors/runner.rb +31 -4
  154. data/lib/hecks/bench/environment.rb +6 -2
  155. data/lib/hecks/bench/postgres_probe.rb +3 -1
  156. data/lib/hecks/bench/report.rb +4 -1
  157. data/lib/hecks/bench/suite.rb +9 -3
  158. data/lib/hecks/bluebook/acknowledgements.rb +81 -0
  159. data/lib/hecks/bluebook/aggregate.rb +29 -17
  160. data/lib/hecks/bluebook/ask_resolution.rb +17 -17
  161. data/lib/hecks/bluebook/assembly/aggregate_assembly.rb +8 -5
  162. data/lib/hecks/bluebook/assembly/contracts/sagas.rb +2 -0
  163. data/lib/hecks/bluebook/assembly/contracts/structure.rb +24 -15
  164. data/lib/hecks/bluebook/assembly/marks.rb +10 -1
  165. data/lib/hecks/bluebook/assembly/scalars.rb +8 -2
  166. data/lib/hecks/bluebook/assembly/specializer.rb +2 -2
  167. data/lib/hecks/bluebook/assembly.rb +10 -10
  168. data/lib/hecks/bluebook/behaviour/aggregate.rb +29 -4
  169. data/lib/hecks/bluebook/behaviour/attribute.rb +12 -0
  170. data/lib/hecks/bluebook/behaviour/command.rb +1 -1
  171. data/lib/hecks/bluebook/behaviour/{chapter.rb → declaration.rb} +17 -17
  172. data/lib/hecks/bluebook/behaviour/domain_port.rb +1 -1
  173. data/lib/hecks/bluebook/behaviour/entity.rb +1 -0
  174. data/lib/hecks/bluebook/behaviour/hecksagon.rb +8 -1
  175. data/lib/hecks/bluebook/behaviour/process_manager.rb +4 -1
  176. data/lib/hecks/bluebook/behaviour/query.rb +5 -0
  177. data/lib/hecks/bluebook/behaviour/read_model.rb +4 -1
  178. data/lib/hecks/bluebook/behaviour/traits.rb +13 -0
  179. data/lib/hecks/bluebook/capabilities/attribute_values.rb +17 -16
  180. data/lib/hecks/bluebook/capabilities/package_declared.rb +65 -0
  181. data/lib/hecks/bluebook/capabilities.rb +32 -132
  182. data/lib/hecks/bluebook/command.rb +33 -7
  183. data/lib/hecks/bluebook/context_map.rb +104 -0
  184. data/lib/hecks/bluebook/{chapter.rb → declaration.rb} +45 -17
  185. data/lib/hecks/bluebook/domain_port.rb +7 -3
  186. data/lib/hecks/bluebook/dsl/adapter_builder.rb +28 -4
  187. data/lib/hecks/bluebook/dsl/aggregate_builder/draining.rb +2 -2
  188. data/lib/hecks/bluebook/dsl/aggregate_builder/one_of_reference.rb +54 -0
  189. data/lib/hecks/bluebook/dsl/aggregate_builder/query_field_sealing.rb +11 -2
  190. data/lib/hecks/bluebook/dsl/aggregate_builder/query_sealing.rb +15 -5
  191. data/lib/hecks/bluebook/dsl/aggregate_builder/relationships.rb +21 -5
  192. data/lib/hecks/bluebook/dsl/aggregate_builder/renaming.rb +25 -0
  193. data/lib/hecks/bluebook/dsl/aggregate_builder/rules.rb +22 -22
  194. data/lib/hecks/bluebook/dsl/aggregate_builder/sealing.rb +2 -2
  195. data/lib/hecks/bluebook/dsl/aggregate_builder.rb +30 -22
  196. data/lib/hecks/bluebook/dsl/attribute_collector.rb +0 -1
  197. data/lib/hecks/bluebook/dsl/audience_word.rb +40 -0
  198. data/lib/hecks/bluebook/dsl/bluebook_builder/metadata.rb +56 -0
  199. data/lib/hecks/bluebook/dsl/bluebook_builder/modules.rb +80 -0
  200. data/lib/hecks/bluebook/dsl/bluebook_builder/pending_givens.rb +22 -22
  201. data/lib/hecks/bluebook/dsl/bluebook_builder/validation/computed_sources.rb +27 -21
  202. data/lib/hecks/bluebook/dsl/bluebook_builder/validation/correlation_keys.rb +54 -5
  203. data/lib/hecks/bluebook/dsl/bluebook_builder/validation/event_shapes.rb +5 -4
  204. data/lib/hecks/bluebook/dsl/bluebook_builder/validation/fan_out_rows.rb +3 -3
  205. data/lib/hecks/bluebook/dsl/bluebook_builder/validation/hop_tails.rb +13 -5
  206. data/lib/hecks/bluebook/dsl/bluebook_builder/validation/projected_fields.rb +4 -4
  207. data/lib/hecks/bluebook/dsl/bluebook_builder/validation/provisions.rb +38 -84
  208. data/lib/hecks/bluebook/dsl/bluebook_builder/validation/query_hops.rb +5 -5
  209. data/lib/hecks/bluebook/dsl/bluebook_builder/validation/references.rb +6 -6
  210. data/lib/hecks/bluebook/dsl/bluebook_builder/validation/with_projections.rb +6 -6
  211. data/lib/hecks/bluebook/dsl/bluebook_builder/validation.rb +4 -3
  212. data/lib/hecks/bluebook/dsl/bluebook_builder.rb +75 -92
  213. data/lib/hecks/bluebook/dsl/bootstrap_table.rb +10 -0
  214. data/lib/hecks/bluebook/dsl/command_builder/folded_sets.rb +48 -0
  215. data/lib/hecks/bluebook/dsl/command_builder.rb +39 -16
  216. data/lib/hecks/bluebook/dsl/context_map_builder.rb +73 -0
  217. data/lib/hecks/bluebook/dsl/entity_builder/rules.rb +17 -17
  218. data/lib/hecks/bluebook/dsl/entity_builder/scope.rb +3 -3
  219. data/lib/hecks/bluebook/dsl/entity_builder/sealing.rb +2 -2
  220. data/lib/hecks/bluebook/dsl/entity_builder.rb +3 -5
  221. data/lib/hecks/bluebook/dsl/generic_dispatch.rb +6 -4
  222. data/lib/hecks/bluebook/dsl/hecksagon_builder/{chapter_scope.rb → bluebook_scope.rb} +14 -14
  223. data/lib/hecks/bluebook/dsl/hecksagon_builder.rb +33 -27
  224. data/lib/hecks/bluebook/dsl/identity_declaration.rb +6 -2
  225. data/lib/hecks/bluebook/dsl/kinds.rb +53 -0
  226. data/lib/hecks/bluebook/dsl/lifecycle_builder.rb +4 -1
  227. data/lib/hecks/bluebook/dsl/port_operation_builder.rb +9 -2
  228. data/lib/hecks/bluebook/dsl/process_manager_builder.rb +25 -15
  229. data/lib/hecks/bluebook/dsl/query_builder.rb +14 -8
  230. data/lib/hecks/bluebook/dsl/read_model_builder/sealing.rb +6 -11
  231. data/lib/hecks/bluebook/dsl/read_model_builder.rb +1 -2
  232. data/lib/hecks/bluebook/dsl/translation_builder.rb +16 -1
  233. data/lib/hecks/bluebook/dsl/word_gate.rb +3 -2
  234. data/lib/hecks/bluebook/dsl/world_builder.rb +2 -2
  235. data/lib/hecks/bluebook/dsl.rb +4 -2
  236. data/lib/hecks/bluebook/expression/ast_json/emitters.rb +4 -0
  237. data/lib/hecks/bluebook/expression/ast_json.rb +5 -3
  238. data/lib/hecks/bluebook/expression/ast_reader/blocks.rb +41 -0
  239. data/lib/hecks/bluebook/expression/ast_reader.rb +2 -10
  240. data/lib/hecks/bluebook/expression/canonical_form.rb +9 -4
  241. data/lib/hecks/bluebook/expression/evaluator/parser.rb +4 -1
  242. data/lib/hecks/bluebook/expression/evaluator.rb +13 -9
  243. data/lib/hecks/bluebook/expression/projection.json +6 -0
  244. data/lib/hecks/bluebook/expression/resolver/block_predicates.rb +50 -2
  245. data/lib/hecks/bluebook/expression/resolver/lookups.rb +2 -1
  246. data/lib/hecks/bluebook/expression/resolver/operations.rb +1 -0
  247. data/lib/hecks/bluebook/expression/resolver/parsing.rb +21 -15
  248. data/lib/hecks/bluebook/expression/resolver/scanning.rb +4 -1
  249. data/lib/hecks/bluebook/expression.rb +1 -1
  250. data/lib/hecks/bluebook/hecksagon.rb +48 -23
  251. data/lib/hecks/bluebook/meta_validator/adapter_judge.rb +4 -1
  252. data/lib/hecks/bluebook/meta_validator/judge/cells.rb +1 -1
  253. data/lib/hecks/bluebook/meta_validator/judge/identity.rb +11 -5
  254. data/lib/hecks/bluebook/meta_validator/modes.rb +27 -27
  255. data/lib/hecks/bluebook/meta_validator/plan/category.rb +10 -2
  256. data/lib/hecks/bluebook/meta_validator/plan/verbs.rb +9 -0
  257. data/lib/hecks/bluebook/meta_validator/plan.rb +7 -6
  258. data/lib/hecks/bluebook/meta_validator/readings/fields.rb +3 -3
  259. data/lib/hecks/bluebook/meta_validator/reconstruction/heads.rb +14 -4
  260. data/lib/hecks/bluebook/meta_validator/reconstruction/reading.rb +8 -1
  261. data/lib/hecks/bluebook/meta_validator/reconstruction.rb +24 -19
  262. data/lib/hecks/bluebook/meta_validator/shapes.rb +9 -1
  263. data/lib/hecks/bluebook/meta_validator/syntax_boot/disk_cache.rb +19 -16
  264. data/lib/hecks/bluebook/meta_validator/syntax_boot.rb +21 -15
  265. data/lib/hecks/bluebook/meta_validator/verdict_cache/prebuilt.rb +4 -1
  266. data/lib/hecks/bluebook/meta_validator/verdict_cache.rb +11 -10
  267. data/lib/hecks/bluebook/meta_validator.rb +25 -22
  268. data/lib/hecks/bluebook/model_check/aggregate_checks.rb +95 -0
  269. data/lib/hecks/bluebook/model_check/ask_checks.rb +31 -5
  270. data/lib/hecks/bluebook/model_check/client_profile.rb +8 -42
  271. data/lib/hecks/bluebook/model_check/context_checks.rb +97 -0
  272. data/lib/hecks/bluebook/model_check/context_map_checks.rb +158 -0
  273. data/lib/hecks/bluebook/model_check/lifecycle_checks.rb +27 -5
  274. data/lib/hecks/bluebook/model_check/one_of_checks.rb +106 -0
  275. data/lib/hecks/bluebook/model_check/orphan_checks.rb +129 -0
  276. data/lib/hecks/bluebook/model_check/reaction_chains.rb +114 -0
  277. data/lib/hecks/bluebook/model_check/reaction_cycles.rb +53 -0
  278. data/lib/hecks/bluebook/model_check/reaction_depth_checks.rb +58 -0
  279. data/lib/hecks/bluebook/model_check/reaction_walk.rb +62 -0
  280. data/lib/hecks/bluebook/model_check/redundant_relationships.rb +38 -0
  281. data/lib/hecks/bluebook/model_check/reference_checks.rb +11 -1
  282. data/lib/hecks/bluebook/model_check/saga_checks.rb +8 -3
  283. data/lib/hecks/bluebook/model_check/verbs.rb +4 -4
  284. data/lib/hecks/bluebook/model_check.rb +33 -35
  285. data/lib/hecks/bluebook/named_pattern.rb +12 -1
  286. data/lib/hecks/bluebook/one_of_union.rb +35 -0
  287. data/lib/hecks/bluebook/pattern_subset.rb +12 -3
  288. data/lib/hecks/bluebook/process_manager.rb +20 -3
  289. data/lib/hecks/bluebook/project_loader.rb +3 -2
  290. data/lib/hecks/bluebook/project_register.rb +21 -5
  291. data/lib/hecks/bluebook/query.rb +4 -1
  292. data/lib/hecks/bluebook/read_model.rb +5 -5
  293. data/lib/hecks/bluebook/reference.rb +3 -3
  294. data/lib/hecks/bluebook/smoke_test.rb +15 -13
  295. data/lib/hecks/bluebook/synthesizer.rb +48 -13
  296. data/lib/hecks/bluebook/translation.rb +5 -3
  297. data/lib/hecks/bluebook/translation_expression/parser.rb +14 -5
  298. data/lib/hecks/bluebook/translation_plan.rb +9 -2
  299. data/lib/hecks/bluebook.rb +6 -3
  300. data/lib/hecks/bulk/bluebook/adapters/row_sweeper.adapter +7 -0
  301. data/lib/hecks/bulk/bluebook/bulk.behaviors +18 -0
  302. data/lib/hecks/bulk/bluebook/bulk.bluebook +126 -0
  303. data/lib/hecks/bulk/bluebook/bulk.hecksagon +11 -0
  304. data/lib/hecks/bulk/bluebook/bulk.ports.hecksagon +13 -0
  305. data/lib/hecks/bulk/plan.rb +60 -0
  306. data/lib/hecks/bulk/row_sweeper.rb +34 -0
  307. data/lib/hecks/bulk/set_arguments.rb +68 -0
  308. data/lib/hecks/bulk/set_eligibility.rb +50 -0
  309. data/lib/hecks/bulk/set_planner.rb +100 -0
  310. data/lib/hecks/bulk/set_sweep.rb +78 -0
  311. data/lib/hecks/bulk/sweep.rb +67 -0
  312. data/lib/hecks/ci_pipeline/adapters/ci_cache.adapter +7 -0
  313. data/lib/hecks/ci_pipeline/adapters/ci_cache.rb +39 -0
  314. data/lib/hecks/ci_pipeline/adapters/ci_runner.adapter +7 -0
  315. data/lib/hecks/ci_pipeline/adapters/ci_runner.rb +55 -0
  316. data/lib/hecks/ci_pipeline/ci_pipeline.behaviors +322 -0
  317. data/lib/hecks/ci_pipeline/ci_pipeline.bluebook +938 -0
  318. data/lib/hecks/ci_pipeline/ci_pipeline.hecksagon +12 -0
  319. data/lib/hecks/ci_pipeline/ci_pipeline.ports.hecksagon +16 -0
  320. data/lib/hecks/ci_speed/adapters/ci_reader.adapter +7 -0
  321. data/lib/hecks/ci_speed/adapters/ci_reader.rb +141 -0
  322. data/lib/hecks/ci_speed/adapters/local_runner/answer.rb +41 -0
  323. data/lib/hecks/ci_speed/adapters/local_runner/catalog.rb +89 -0
  324. data/lib/hecks/ci_speed/adapters/local_runner/checkouts.rb +89 -0
  325. data/lib/hecks/ci_speed/adapters/local_runner/launcher.rb +69 -0
  326. data/lib/hecks/ci_speed/adapters/local_runner/load_average.rb +38 -0
  327. data/lib/hecks/ci_speed/adapters/local_runner/refs.rb +39 -0
  328. data/lib/hecks/ci_speed/adapters/local_runner/refused.rb +11 -0
  329. data/lib/hecks/ci_speed/adapters/local_runner/verdict.rb +71 -0
  330. data/lib/hecks/ci_speed/adapters/local_runner.adapter +7 -0
  331. data/lib/hecks/ci_speed/adapters/local_runner.rb +168 -0
  332. data/lib/hecks/ci_speed/adapters/replayed_runner.rb +39 -0
  333. data/lib/hecks/ci_speed/ci_speed.behaviors +341 -0
  334. data/lib/hecks/ci_speed/ci_speed.bluebook +1073 -0
  335. data/lib/hecks/ci_speed/ci_speed.hecksagon +11 -0
  336. data/lib/hecks/ci_speed/ci_speed.ports.hecksagon +21 -0
  337. data/lib/hecks/ci_workflows/ci_workflows.behaviors +13 -0
  338. data/lib/hecks/ci_workflows/ci_workflows.bluebook +173 -0
  339. data/lib/hecks/ci_workflows/ci_workflows.hecksagon +15 -0
  340. data/lib/hecks/codemod.rb +3 -3
  341. data/lib/hecks/coder/coder.bluebook +385 -0
  342. data/lib/hecks/coder/coder.hecksagon +12 -0
  343. data/lib/hecks/command_names/check.rb +39 -0
  344. data/lib/hecks/command_names/extractor.rb +67 -0
  345. data/lib/hecks/command_names/index.rb +40 -0
  346. data/lib/hecks/command_names/resolution.rb +81 -0
  347. data/lib/hecks/command_names/scan.rb +54 -0
  348. data/lib/hecks/command_names/sources.rb +73 -0
  349. data/lib/hecks/command_names.rb +26 -0
  350. data/lib/hecks/composer/adapters/claude_composer.rb +3 -2
  351. data/lib/hecks/composer/agent.rb +1 -1
  352. data/lib/hecks/composer/assistant.rb +2 -2
  353. data/lib/hecks/composer/behavior_run.rb +7 -1
  354. data/lib/hecks/composer/bluebook/composer.bluebook +18 -25
  355. data/lib/hecks/composer/bluebook/composer.hecksagon +1 -1
  356. data/lib/hecks/composer/board.rb +6 -6
  357. data/lib/hecks/composer/board_edit/command_text.rb +4 -1
  358. data/lib/hecks/composer/board_edit/source.rb +18 -9
  359. data/lib/hecks/composer/board_edit.rb +2 -2
  360. data/lib/hecks/composer/check.rb +22 -22
  361. data/lib/hecks/composer/domains.rb +1 -1
  362. data/lib/hecks/composer/jobs.rb +1 -1
  363. data/lib/hecks/composer/live.rb +19 -13
  364. data/lib/hecks/composer/outline.rb +4 -1
  365. data/lib/hecks/composer/page.html +1 -1
  366. data/lib/hecks/composer/panels.rb +6 -3
  367. data/lib/hecks/composer/parse.rb +53 -36
  368. data/lib/hecks/composer/session.rb +22 -16
  369. data/lib/hecks/composer/toolbox.rb +17 -7
  370. data/lib/hecks/composer/web.rb +3 -2
  371. data/lib/hecks/composer/workbench.rb +12 -9
  372. data/lib/hecks/composer.rb +1 -1
  373. data/lib/hecks/construct.rb +7 -7
  374. data/lib/hecks/corpus/adapters.rb +2 -1
  375. data/lib/hecks/corpus/generated_key.rb +205 -0
  376. data/lib/hecks/corpus/listing.rb +34 -0
  377. data/lib/hecks/corpus/routes.rb +25 -5
  378. data/lib/hecks/corpus/rust.rb +86 -35
  379. data/lib/hecks/corpus/sources.rb +14 -12
  380. data/lib/hecks/corpus/worlds.rb +2 -1
  381. data/lib/hecks/corpus.rb +57 -54
  382. data/lib/hecks/deploy/bluebook/deploy.bluebook +304 -518
  383. data/lib/hecks/deprecation.rb +23 -0
  384. data/lib/hecks/doc/reference/harvester.rb +4 -1
  385. data/lib/hecks/doc/reference/readme.rb +11 -6
  386. data/lib/hecks/doc/reference/rendering.rb +12 -6
  387. data/lib/hecks/doc/reference.rb +8 -6
  388. data/lib/hecks/embryonaut_bluebook/lock.rb +5 -1
  389. data/lib/hecks/embryonaut_bluebook/manifest.rb +8 -2
  390. data/lib/hecks/embryonaut_bluebook/registry/changelog.rb +4 -1
  391. data/lib/hecks/embryonaut_bluebook/registry/versions.rb +13 -2
  392. data/lib/hecks/embryonaut_bluebook/registry.rb +5 -2
  393. data/lib/hecks/embryonaut_bluebook/shape.rb +1 -1
  394. data/lib/hecks/embryonaut_bluebook/vendor.rb +5 -2
  395. data/lib/hecks/embryonaut_bluebook/vendor_cli.rb +15 -1
  396. data/lib/hecks/embryonaut_bluebook.rb +26 -12
  397. data/lib/hecks/engine_agreement.rb +4 -1
  398. data/lib/hecks/fixer/fixer.bluebook +240 -0
  399. data/lib/hecks/fixer/fixer.hecksagon +17 -0
  400. data/lib/hecks/forms/app/commands.rb +35 -2
  401. data/lib/hecks/forms/app/records.rb +12 -12
  402. data/lib/hecks/forms/app/responses.rb +1 -1
  403. data/lib/hecks/forms/app.rb +22 -19
  404. data/lib/hecks/forms/command_form_renderer.rb +2 -2
  405. data/lib/hecks/forms/field_controls.rb +6 -1
  406. data/lib/hecks/forms/field_shape.rb +14 -6
  407. data/lib/hecks/forms/html.rb +8 -7
  408. data/lib/hecks/forms/html_pattern.rb +80 -0
  409. data/lib/hecks/forms/index_renderer.rb +11 -11
  410. data/lib/hecks/forms/params.rb +2 -1
  411. data/lib/hecks/forms/port_argument.rb +4 -1
  412. data/lib/hecks/forms/query_form_renderer.rb +1 -1
  413. data/lib/hecks/forms/record_renderer.rb +2 -2
  414. data/lib/hecks/forms/record_table.rb +1 -1
  415. data/lib/hecks/forms/reference_options.rb +2 -1
  416. data/lib/hecks/forms/text_shape.rb +4 -1
  417. data/lib/hecks/forms/value_object_shape.rb +1 -1
  418. data/lib/hecks/forms.rb +7 -7
  419. data/lib/hecks/fqn.rb +8 -2
  420. data/lib/hecks/framework/bluebook/change.bluebook +10 -15
  421. data/lib/hecks/framework/bluebook/change.hecksagon +1 -1
  422. data/lib/hecks/framework/bluebook/compliance.bluebook +27 -126
  423. data/lib/hecks/framework/bluebook/console_settings.bluebook +199 -114
  424. data/lib/hecks/framework/bluebook/framework.hecksagon +7 -0
  425. data/lib/hecks/framework/bluebook/governance.bluebook +36 -14
  426. data/lib/hecks/framework/bluebook/identity.bluebook +1 -1
  427. data/lib/hecks/framework/bluebook/privacy.bluebook +123 -19
  428. data/lib/hecks/framework/bluebook/privacy.key_keeper.adapter +7 -0
  429. data/lib/hecks/framework/bluebook/privacy.ports.hecksagon +19 -0
  430. data/lib/hecks/framework/compliance.oidc.json +6 -36
  431. data/lib/hecks/framework/console_settings.oidc.json +39 -24
  432. data/lib/hecks/framework/privacy.oidc.json +25 -0
  433. data/lib/hecks/framework.rb +24 -8
  434. data/lib/hecks/framework_bluebooks.rb +181 -0
  435. data/lib/hecks/freezer.rb +7 -1
  436. data/lib/hecks/fuzzing/combination_miner.rb +9 -6
  437. data/lib/hecks/fuzzing/concurrent_dispatch/world_copy.rb +4 -1
  438. data/lib/hecks/fuzzing/concurrent_dispatch.rb +2 -2
  439. data/lib/hecks/fuzzing/domain_generator.rb +8 -3
  440. data/lib/hecks/fuzzing/era_boundary.rb +1 -1
  441. data/lib/hecks/fuzzing/failure_triage.rb +13 -6
  442. data/lib/hecks/fuzzing/form_census/{chapter_forms.rb → bluebook_forms.rb} +12 -12
  443. data/lib/hecks/fuzzing/form_census.rb +14 -12
  444. data/lib/hecks/fuzzing/generated_domain_check.rb +2 -1
  445. data/lib/hecks/fuzzing/isolated_boot/postgres_scratch.rb +14 -15
  446. data/lib/hecks/fuzzing/isolated_boot/scratch_schema.rb +19 -9
  447. data/lib/hecks/fuzzing/isolated_boot/worlds.rb +36 -13
  448. data/lib/hecks/fuzzing/isolated_boot.rb +5 -6
  449. data/lib/hecks/fuzzing/mutation/checks.rb +5 -4
  450. data/lib/hecks/fuzzing/mutation/finders.rb +25 -8
  451. data/lib/hecks/fuzzing/mutation/observation.rb +3 -1
  452. data/lib/hecks/fuzzing/mutation/source_map.rb +3 -1
  453. data/lib/hecks/fuzzing/nondeterministic.rb +10 -4
  454. data/lib/hecks/fuzzing/outside_world.rb +1 -1
  455. data/lib/hecks/fuzzing/projection_agreement/binding.rb +63 -0
  456. data/lib/hecks/fuzzing/projection_agreement/comparison.rb +104 -0
  457. data/lib/hecks/fuzzing/projection_agreement.rb +68 -0
  458. data/lib/hecks/fuzzing/properties/aggregation_recompute.rb +1 -1
  459. data/lib/hecks/fuzzing/properties/bulk_parity.rb +118 -0
  460. data/lib/hecks/fuzzing/properties/catalog.rb +7 -0
  461. data/lib/hecks/fuzzing/properties/cursor_walks.rb +56 -0
  462. data/lib/hecks/fuzzing/properties/dispatch_and_mutations.rb +39 -1
  463. data/lib/hecks/fuzzing/properties/group_by_recompute.rb +6 -2
  464. data/lib/hecks/fuzzing/properties/grouped_reduction_recompute.rb +88 -0
  465. data/lib/hecks/fuzzing/properties/guards.rb +4 -1
  466. data/lib/hecks/fuzzing/properties/invariants_and_aggregation.rb +12 -2
  467. data/lib/hecks/fuzzing/properties/lifecycle_and_replay.rb +2 -1
  468. data/lib/hecks/fuzzing/properties/mutation_recompute.rb +3 -2
  469. data/lib/hecks/fuzzing/properties/piece_invariants.rb +3 -2
  470. data/lib/hecks/fuzzing/properties/query_rows.rb +5 -3
  471. data/lib/hecks/fuzzing/properties/querying.rb +6 -3
  472. data/lib/hecks/fuzzing/properties/read_model_names.rb +8 -2
  473. data/lib/hecks/fuzzing/properties/read_models.rb +2 -1
  474. data/lib/hecks/fuzzing/properties/refusals.rb +35 -0
  475. data/lib/hecks/fuzzing/properties/role_checks.rb +3 -2
  476. data/lib/hecks/fuzzing/properties/set_transform_parity.rb +73 -0
  477. data/lib/hecks/fuzzing/properties/tenant_scope.rb +3 -2
  478. data/lib/hecks/fuzzing/properties.rb +6 -0
  479. data/lib/hecks/fuzzing/qa_settings.rb +4 -4
  480. data/lib/hecks/fuzzing/replay/fan_out.rb +4 -3
  481. data/lib/hecks/fuzzing/replay/filters.rb +2 -2
  482. data/lib/hecks/fuzzing/replay/guard_check.rb +2 -2
  483. data/lib/hecks/fuzzing/replay/mutation_trace.rb +23 -10
  484. data/lib/hecks/fuzzing/replay/observation.rb +11 -7
  485. data/lib/hecks/fuzzing/replay/read_only_steps.rb +40 -3
  486. data/lib/hecks/fuzzing/replay/refusal_trace.rb +44 -0
  487. data/lib/hecks/fuzzing/replay/role_check.rb +2 -2
  488. data/lib/hecks/fuzzing/replay/session.rb +38 -18
  489. data/lib/hecks/fuzzing/replay/validation_reports.rb +61 -0
  490. data/lib/hecks/fuzzing/replay.rb +2 -2
  491. data/lib/hecks/fuzzing/rust_gap_manifest.rb +3 -3
  492. data/lib/hecks/fuzzing/self_consistency/saga_redelivery.rb +18 -8
  493. data/lib/hecks/fuzzing/self_consistency/sagas.rb +2 -2
  494. data/lib/hecks/fuzzing/self_consistency/value_objects.rb +9 -2
  495. data/lib/hecks/fuzzing/self_consistency.rb +4 -8
  496. data/lib/hecks/fuzzing/sequence_generator/adversary/argument_mutations.rb +15 -5
  497. data/lib/hecks/fuzzing/sequence_generator/adversary/caller_draw.rb +14 -10
  498. data/lib/hecks/fuzzing/sequence_generator/adversary/precedence_mutations.rb +1 -1
  499. data/lib/hecks/fuzzing/sequence_generator/argument_drawing.rb +2 -1
  500. data/lib/hecks/fuzzing/sequence_generator/catalog.rb +21 -13
  501. data/lib/hecks/fuzzing/sequence_generator/picker.rb +1 -1
  502. data/lib/hecks/fuzzing/sequence_generator/query_binding.rb +3 -3
  503. data/lib/hecks/fuzzing/sequence_generator/step_builder.rb +2 -2
  504. data/lib/hecks/fuzzing/sequence_generator.rb +1 -2
  505. data/lib/hecks/fuzzing/shrinker.rb +4 -1
  506. data/lib/hecks/fuzzing/value_generator.rb +14 -8
  507. data/lib/hecks/fuzzing.rb +1 -0
  508. data/lib/hecks/grammar/dialects.rb +56 -0
  509. data/lib/hecks/grammar/evolve/arguments.rb +1 -1
  510. data/lib/hecks/grammar/evolve/keywords.rb +1 -1
  511. data/lib/hecks/grammar/evolve/seeds.rb +34 -8
  512. data/lib/hecks/grammar/expression.bluebook +3 -0
  513. data/lib/hecks/grammar/expression_operators.json +1071 -1
  514. data/lib/hecks/grammar/operators.rb +45 -22
  515. data/lib/hecks/grammar/translation.bluebook +3 -1
  516. data/lib/hecks/grammar/translation_ledger.rb +45 -0
  517. data/lib/hecks/grammar/translation_rules.json +710 -0
  518. data/lib/hecks/grammar.rb +27 -23
  519. data/lib/hecks/hecks/adapter_words.json +7 -0
  520. data/lib/hecks/hecks/adapters/area_overlap.rb +156 -0
  521. data/lib/hecks/hecks/adapters/claude_agents.adapter +7 -0
  522. data/lib/hecks/hecks/adapters/claude_agents.rb +124 -0
  523. data/lib/hecks/hecks/adapters/claude_transcript.rb +71 -0
  524. data/lib/hecks/hecks/adapters/codebase/batch_runs.rb +60 -0
  525. data/lib/hecks/hecks/adapters/codebase/cache_clearing.rb +32 -0
  526. data/lib/hecks/hecks/adapters/codebase/cargo_tests.rb +50 -0
  527. data/lib/hecks/hecks/adapters/codebase/changed_specs.rb +52 -0
  528. data/lib/hecks/hecks/adapters/codebase/codemods.rb +3 -2
  529. data/lib/hecks/hecks/adapters/codebase/composing.rb +3 -2
  530. data/lib/hecks/hecks/adapters/codebase/conformance.rb +30 -1
  531. data/lib/hecks/hecks/adapters/codebase/corpus_queries.rb +53 -0
  532. data/lib/hecks/hecks/adapters/codebase/corpus_tasks.rb +1 -1
  533. data/lib/hecks/hecks/adapters/codebase/declarations.rb +144 -0
  534. data/lib/hecks/hecks/adapters/codebase/generated_keys.rb +31 -0
  535. data/lib/hecks/hecks/adapters/codebase/impacted_specs.rb +110 -0
  536. data/lib/hecks/hecks/adapters/codebase/inspection.rb +5 -4
  537. data/lib/hecks/hecks/adapters/codebase/language.rb +3 -2
  538. data/lib/hecks/hecks/adapters/codebase/launcher_text.rb +39 -0
  539. data/lib/hecks/hecks/adapters/codebase/minitest_runs.rb +52 -0
  540. data/lib/hecks/hecks/adapters/codebase/npm_registry.rb +7 -1
  541. data/lib/hecks/hecks/adapters/codebase/previewing.rb +62 -0
  542. data/lib/hecks/hecks/adapters/codebase/promotion/gate.rb +1 -1
  543. data/lib/hecks/hecks/adapters/codebase/reading.rb +94 -0
  544. data/lib/hecks/hecks/adapters/codebase/regeneration.rb +57 -10
  545. data/lib/hecks/hecks/adapters/codebase/release_facts.rb +1 -1
  546. data/lib/hecks/hecks/adapters/codebase/ruby_child.rb +5 -2
  547. data/lib/hecks/hecks/adapters/codebase/run_options.rb +35 -0
  548. data/lib/hecks/hecks/adapters/codebase/scripting.rb +39 -0
  549. data/lib/hecks/hecks/adapters/codebase/search.rb +91 -0
  550. data/lib/hecks/hecks/adapters/codebase/source_tree.rb +114 -51
  551. data/lib/hecks/hecks/adapters/codebase/spec_files/report.rb +71 -0
  552. data/lib/hecks/hecks/adapters/codebase/spec_files/shared_run.rb +73 -0
  553. data/lib/hecks/hecks/adapters/codebase/spec_files.rb +95 -0
  554. data/lib/hecks/hecks/adapters/codebase/static_directory.rb +59 -0
  555. data/lib/hecks/hecks/adapters/codebase/style.rb +2 -2
  556. data/lib/hecks/hecks/adapters/codebase/test_runner.rb +82 -14
  557. data/lib/hecks/hecks/adapters/codebase/test_scope.rb +105 -0
  558. data/lib/hecks/hecks/adapters/codebase/test_suite.rb +73 -21
  559. data/lib/hecks/hecks/adapters/console_capture.rb +28 -1
  560. data/lib/hecks/hecks/adapters/cost_explorer.rb +9 -1
  561. data/lib/hecks/hecks/adapters/deploy_plans.rb +12 -3
  562. data/lib/hecks/hecks/adapters/deploy_toolchain/answers.rb +14 -5
  563. data/lib/hecks/hecks/adapters/deploy_toolchain/scripts.rb +6 -3
  564. data/lib/hecks/hecks/adapters/deploy_toolchain.rb +3 -3
  565. data/lib/hecks/hecks/adapters/desktop_alert/alert.rb +50 -0
  566. data/lib/hecks/hecks/adapters/desktop_alert.adapter +7 -0
  567. data/lib/hecks/hecks/adapters/desktop_alert.rb +99 -0
  568. data/lib/hecks/hecks/adapters/dispatching/brief_text.rb +51 -0
  569. data/lib/hecks/hecks/adapters/dispatching/launcher.rb +97 -0
  570. data/lib/hecks/hecks/adapters/dispatching/plan.rb +82 -0
  571. data/lib/hecks/hecks/adapters/dispatching/rows.rb +66 -0
  572. data/lib/hecks/hecks/adapters/dispatching/settings.rb +81 -0
  573. data/lib/hecks/hecks/adapters/dispatching/settler.rb +40 -0
  574. data/lib/hecks/hecks/adapters/dispatching.adapter +7 -0
  575. data/lib/hecks/hecks/adapters/dispatching.rb +93 -0
  576. data/lib/hecks/hecks/adapters/doctor_reading/report.rb +27 -0
  577. data/lib/hecks/hecks/adapters/doctor_reading.adapter +7 -0
  578. data/lib/hecks/hecks/adapters/doctor_reading.rb +161 -0
  579. data/lib/hecks/hecks/adapters/finding_github.rb +4 -1
  580. data/lib/hecks/hecks/adapters/first_admin.rb +16 -9
  581. data/lib/hecks/hecks/adapters/git.rb +5 -5
  582. data/lib/hecks/hecks/adapters/git_checkout.adapter +7 -0
  583. data/lib/hecks/hecks/adapters/git_checkout.rb +99 -0
  584. data/lib/hecks/hecks/adapters/git_commit.adapter +7 -0
  585. data/lib/hecks/hecks/adapters/git_commit.rb +61 -0
  586. data/lib/hecks/hecks/adapters/git_landing/finisher.rb +82 -0
  587. data/lib/hecks/hecks/adapters/git_landing/foreign_hold.rb +111 -0
  588. data/lib/hecks/hecks/adapters/git_landing/line.rb +171 -0
  589. data/lib/hecks/hecks/adapters/git_landing/lineup.rb +98 -0
  590. data/lib/hecks/hecks/adapters/git_landing/merger.rb +85 -0
  591. data/lib/hecks/hecks/adapters/git_landing/numbering.rb +54 -0
  592. data/lib/hecks/hecks/adapters/git_landing/rivals.rb +59 -0
  593. data/lib/hecks/hecks/adapters/git_landing/ticket.rb +156 -0
  594. data/lib/hecks/hecks/adapters/git_landing/tidy.rb +147 -0
  595. data/lib/hecks/hecks/adapters/git_landing/train.rb +104 -0
  596. data/lib/hecks/hecks/adapters/git_landing/verdict.rb +64 -0
  597. data/lib/hecks/hecks/adapters/git_landing/waiting.rb +120 -0
  598. data/lib/hecks/hecks/adapters/git_landing.adapter +7 -0
  599. data/lib/hecks/hecks/adapters/git_landing.rb +189 -0
  600. data/lib/hecks/hecks/adapters/git_launcher.adapter +7 -0
  601. data/lib/hecks/hecks/adapters/git_launcher.rb +82 -0
  602. data/lib/hecks/hecks/adapters/git_main_pull.rb +99 -0
  603. data/lib/hecks/hecks/adapters/git_refs.rb +8 -4
  604. data/lib/hecks/hecks/adapters/git_rehearsal/bench.rb +82 -0
  605. data/lib/hecks/hecks/adapters/git_rehearsal/due.rb +84 -0
  606. data/lib/hecks/hecks/adapters/git_rehearsal/impacted/skips.rb +47 -0
  607. data/lib/hecks/hecks/adapters/git_rehearsal/impacted/spec_run.rb +75 -0
  608. data/lib/hecks/hecks/adapters/git_rehearsal/impacted.rb +181 -0
  609. data/lib/hecks/hecks/adapters/git_rehearsal/line.rb +76 -0
  610. data/lib/hecks/hecks/adapters/git_rehearsal/reading.rb +24 -0
  611. data/lib/hecks/hecks/adapters/git_rehearsal/record.rb +146 -0
  612. data/lib/hecks/hecks/adapters/git_rehearsal/spec_map/corpus.rb +25 -0
  613. data/lib/hecks/hecks/adapters/git_rehearsal/spec_map/needles.rb +61 -0
  614. data/lib/hecks/hecks/adapters/git_rehearsal/spec_map.rb +105 -0
  615. data/lib/hecks/hecks/adapters/git_rehearsal/stages.rb +118 -0
  616. data/lib/hecks/hecks/adapters/git_rehearsal.adapter +7 -0
  617. data/lib/hecks/hecks/adapters/git_rehearsal.rb +141 -0
  618. data/lib/hecks/hecks/adapters/git_train/bench.rb +76 -0
  619. data/lib/hecks/hecks/adapters/git_train/branch_guard.rb +62 -0
  620. data/lib/hecks/hecks/adapters/git_train/carriage.rb +115 -0
  621. data/lib/hecks/hecks/adapters/git_train/launcher_shape.rb +75 -0
  622. data/lib/hecks/hecks/adapters/git_train/local_branch.rb +69 -0
  623. data/lib/hecks/hecks/adapters/git_train/mint_step.rb +47 -0
  624. data/lib/hecks/hecks/adapters/git_train/reading.rb +26 -0
  625. data/lib/hecks/hecks/adapters/git_train/settlement.rb +167 -0
  626. data/lib/hecks/hecks/adapters/git_train/survey.rb +60 -0
  627. data/lib/hecks/hecks/adapters/git_train.adapter +7 -0
  628. data/lib/hecks/hecks/adapters/git_train.rb +146 -0
  629. data/lib/hecks/hecks/adapters/git_worktree_add.adapter +7 -0
  630. data/lib/hecks/hecks/adapters/git_worktree_add.rb +68 -0
  631. data/lib/hecks/hecks/adapters/git_worktrees.rb +81 -0
  632. data/lib/hecks/hecks/adapters/github_pull_requests.adapter +7 -0
  633. data/lib/hecks/hecks/adapters/github_pull_requests.rb +109 -0
  634. data/lib/hecks/hecks/adapters/host_http.rb +9 -8
  635. data/lib/hecks/hecks/adapters/in_process_access.rb +3 -2
  636. data/lib/hecks/hecks/adapters/in_process_boot.rb +68 -39
  637. data/lib/hecks/hecks/adapters/in_process_operations.rb +40 -20
  638. data/lib/hecks/hecks/adapters/in_process_undo.rb +17 -0
  639. data/lib/hecks/hecks/adapters/journal_store/changes.rb +18 -9
  640. data/lib/hecks/hecks/adapters/journal_store/compaction.rb +14 -7
  641. data/lib/hecks/hecks/adapters/journal_store/edge_audit.rb +35 -20
  642. data/lib/hecks/hecks/adapters/journal_store/examination.rb +20 -4
  643. data/lib/hecks/hecks/adapters/journal_store/held_domain/renaming.rb +45 -0
  644. data/lib/hecks/hecks/adapters/journal_store/held_domain.rb +47 -9
  645. data/lib/hecks/hecks/adapters/journal_store/held_mint.rb +128 -0
  646. data/lib/hecks/hecks/adapters/journal_store/readings/attestation.rb +3 -3
  647. data/lib/hecks/hecks/adapters/journal_store/readings/boot_status.rb +58 -0
  648. data/lib/hecks/hecks/adapters/journal_store/readings/composition.rb +39 -0
  649. data/lib/hecks/hecks/adapters/journal_store/readings/event_trace/outcomes.rb +76 -0
  650. data/lib/hecks/hecks/adapters/journal_store/readings/event_trace/postgres_reader.rb +44 -0
  651. data/lib/hecks/hecks/adapters/journal_store/readings/event_trace/reader.rb +64 -0
  652. data/lib/hecks/hecks/adapters/journal_store/readings/event_trace/report.rb +102 -0
  653. data/lib/hecks/hecks/adapters/journal_store/readings/event_trace/sqlite_reader.rb +43 -0
  654. data/lib/hecks/hecks/adapters/journal_store/readings/event_trace/stores.rb +80 -0
  655. data/lib/hecks/hecks/adapters/journal_store/readings/event_trace/subscribers.rb +72 -0
  656. data/lib/hecks/hecks/adapters/journal_store/readings/event_trace/summary.rb +39 -0
  657. data/lib/hecks/hecks/adapters/journal_store/readings/event_trace.rb +39 -0
  658. data/lib/hecks/hecks/adapters/journal_store/readings/mint_plan/command_line.rb +57 -0
  659. data/lib/hecks/hecks/adapters/journal_store/readings/mint_plan/edge_guards.rb +107 -0
  660. data/lib/hecks/hecks/adapters/journal_store/readings/mint_plan/inspection.rb +94 -0
  661. data/lib/hecks/hecks/adapters/journal_store/readings/mint_plan/plan.rb +66 -0
  662. data/lib/hecks/hecks/adapters/journal_store/readings/mint_plan/report.rb +72 -0
  663. data/lib/hecks/hecks/adapters/journal_store/readings/mint_plan/store.rb +34 -0
  664. data/lib/hecks/hecks/adapters/journal_store/readings/mint_plan/watermark_guards.rb +86 -0
  665. data/lib/hecks/hecks/adapters/journal_store/readings/mint_plan/world.rb +66 -0
  666. data/lib/hecks/hecks/adapters/journal_store/readings/mint_plan.rb +36 -0
  667. data/lib/hecks/hecks/adapters/journal_store/readings/projection_audit.rb +64 -0
  668. data/lib/hecks/hecks/adapters/journal_store/readings/scaffolding.rb +10 -7
  669. data/lib/hecks/hecks/adapters/journal_store/readings/sqlite_status/database_reading.rb +113 -0
  670. data/lib/hecks/hecks/adapters/journal_store/readings/sqlite_status/read_only.rb +33 -0
  671. data/lib/hecks/hecks/adapters/journal_store/readings/sqlite_status.rb +32 -0
  672. data/lib/hecks/hecks/adapters/journal_store/readings.rb +15 -3
  673. data/lib/hecks/hecks/adapters/journal_store/reconcile_report.rb +60 -0
  674. data/lib/hecks/hecks/adapters/journal_store/reconciliation.rb +121 -0
  675. data/lib/hecks/hecks/adapters/journal_store/translation_write/shape_edge.rb +59 -0
  676. data/lib/hecks/hecks/adapters/journal_store/translation_write.rb +123 -0
  677. data/lib/hecks/hecks/adapters/journal_store.rb +18 -2
  678. data/lib/hecks/hecks/adapters/landed_work.adapter +7 -0
  679. data/lib/hecks/hecks/adapters/landed_work.rb +52 -0
  680. data/lib/hecks/hecks/adapters/ledger/chain.rb +63 -0
  681. data/lib/hecks/hecks/adapters/ledger/journal.rb +105 -0
  682. data/lib/hecks/hecks/adapters/ledger.adapter +7 -0
  683. data/lib/hecks/hecks/adapters/ledger.rb +89 -0
  684. data/lib/hecks/hecks/adapters/local_files.rb +21 -7
  685. data/lib/hecks/hecks/adapters/pg_admin.rb +7 -1
  686. data/lib/hecks/hecks/adapters/process_pool.rb +3 -2
  687. data/lib/hecks/hecks/adapters/push_size.rb +57 -0
  688. data/lib/hecks/hecks/adapters/qa_quiescing.adapter +7 -0
  689. data/lib/hecks/hecks/adapters/qa_quiescing.rb +57 -0
  690. data/lib/hecks/hecks/adapters/rails_app_files.rb +64 -0
  691. data/lib/hecks/hecks/adapters/rehearsal/audit_report.rb +4 -1
  692. data/lib/hecks/hecks/adapters/rehearsal/inquiry.rb +39 -12
  693. data/lib/hecks/hecks/adapters/rehearsal/memory_store.rb +65 -5
  694. data/lib/hecks/hecks/adapters/rehearsal/postgres_census.rb +4 -4
  695. data/lib/hecks/hecks/adapters/rehearsal/postgres_reading.rb +30 -7
  696. data/lib/hecks/hecks/adapters/rehearsal/postgres_store.rb +4 -1
  697. data/lib/hecks/hecks/adapters/rehearsal/rust_audit.rb +1 -1
  698. data/lib/hecks/hecks/adapters/rehearsal/subject.rb +44 -9
  699. data/lib/hecks/hecks/adapters/rust_toolchain.rb +15 -4
  700. data/lib/hecks/hecks/adapters/rust_workspace.rb +1 -1
  701. data/lib/hecks/hecks/adapters/settings_reading/disposable_ledger.rb +32 -0
  702. data/lib/hecks/hecks/adapters/settings_reading/push_nudge.rb +26 -0
  703. data/lib/hecks/hecks/adapters/settings_reading/stores.rb +76 -0
  704. data/lib/hecks/hecks/adapters/settings_reading/test_scope.rb +28 -0
  705. data/lib/hecks/hecks/adapters/settings_reading.adapter +7 -0
  706. data/lib/hecks/hecks/adapters/settings_reading.rb +168 -0
  707. data/lib/hecks/hecks/adapters/shell.rb +3 -0
  708. data/lib/hecks/hecks/adapters/site_toolchain.rb +8 -8
  709. data/lib/hecks/hecks/adapters/started_work.rb +42 -0
  710. data/lib/hecks/hecks/adapters/terminal.rb +12 -10
  711. data/lib/hecks/hecks/adapters/where_reading.adapter +7 -0
  712. data/lib/hecks/hecks/adapters/where_reading.rb +64 -0
  713. data/lib/hecks/hecks/adapters/work_areas.rb +57 -0
  714. data/lib/hecks/hecks/adapters/work_limits.rb +57 -0
  715. data/lib/hecks/hecks/adapters/world_clearing.rb +2 -1
  716. data/lib/hecks/hecks/build/build.bluebook +576 -0
  717. data/lib/hecks/hecks/check/check.bluebook +966 -0
  718. data/lib/hecks/hecks/codebase.behaviors +72 -4
  719. data/lib/hecks/hecks/composer.behaviors +10 -10
  720. data/lib/hecks/hecks/context_map.hecksagon +7 -6
  721. data/lib/hecks/hecks/custodian.behaviors +124 -3
  722. data/lib/hecks/hecks/delegate/delegate.bluebook +355 -0
  723. data/lib/hecks/hecks/deliver/deliver.bluebook +945 -0
  724. data/lib/hecks/hecks/deploy.behaviors +1 -1
  725. data/lib/hecks/hecks/deploy.world +3 -4
  726. data/lib/hecks/hecks/evolve/evolve.bluebook +788 -0
  727. data/lib/hecks/hecks/find/find.bluebook +81 -0
  728. data/lib/hecks/hecks/hecks.behaviors +2 -2
  729. data/lib/hecks/hecks/hecks.bluebook +0 -138
  730. data/lib/hecks/hecks/hecks.contextmap +27 -0
  731. data/lib/hecks/hecks/hecks.hecksagon +312 -23
  732. data/lib/hecks/hecks/hecks.world +54 -27
  733. data/lib/hecks/hecks/implicit_moves.json +24 -0
  734. data/lib/hecks/hecks/migrate/migrate.bluebook +1066 -0
  735. data/lib/hecks/hecks/operate/operate.bluebook +695 -0
  736. data/lib/hecks/hecks/quiesce/quiesce.bluebook +117 -0
  737. data/lib/hecks/hecks/rehearse/rehearse.bluebook +133 -0
  738. data/lib/hecks/hecks/release/release.bluebook +916 -0
  739. data/lib/hecks/hecks/serve/serve.bluebook +134 -0
  740. data/lib/hecks/hecks/shapes.json +3 -0
  741. data/lib/hecks/hecks/site.behaviors +1 -1
  742. data/lib/hecks/hecks/site.world +3 -3
  743. data/lib/hecks/hecks/start/start.bluebook +194 -0
  744. data/lib/hecks/hecks/test/test.bluebook +638 -0
  745. data/lib/hecks/hecks/tickets.world +14 -0
  746. data/lib/hecks/ir.rb +8 -1
  747. data/lib/hecks/kernel_capabilities/templates.rb +4 -3
  748. data/lib/hecks/kernel_capabilities.rb +6 -6
  749. data/lib/hecks/language/adapter.bluebook +61 -0
  750. data/lib/hecks/language/bluebook/aggregate.bluebook +58 -6
  751. data/lib/hecks/language/bluebook/attaches/paging.bluebook +1 -1
  752. data/lib/hecks/language/bluebook/bluebook.behaviors +6 -6
  753. data/lib/hecks/language/bluebook/bluebook.bluebook +62 -51
  754. data/lib/hecks/language/bluebook/bluebook.hecksagon +1 -1
  755. data/lib/hecks/language/bluebook/command.bluebook +69 -2
  756. data/lib/hecks/language/bluebook/entity.bluebook +2 -2
  757. data/lib/hecks/language/bluebook/policy.behaviors +2 -2
  758. data/lib/hecks/language/bluebook/policy.bluebook +3 -3
  759. data/lib/hecks/language/bluebook/process_manager.bluebook +17 -4
  760. data/lib/hecks/language/bluebook/projection.bluebook +11 -10
  761. data/lib/hecks/language/bluebook/query.bluebook +1 -0
  762. data/lib/hecks/language/bluebook/shape.bluebook +1 -1
  763. data/lib/hecks/language/bluebook/syntax.bluebook +3 -1
  764. data/lib/hecks/language/bluebook/vocabulary.bluebook +417 -16
  765. data/lib/hecks/language/context_map/context_map.bluebook +90 -0
  766. data/lib/hecks/language/hecksagon/domain_port.bluebook +3 -2
  767. data/lib/hecks/language/hecksagon/hecksagon.bluebook +8 -8
  768. data/lib/hecks/language/hecksagon/port_operation.bluebook +14 -0
  769. data/lib/hecks/language/kinds/run.kind +120 -0
  770. data/lib/hecks/language/oidc.json +20 -0
  771. data/lib/hecks/language/port.bluebook +1 -1
  772. data/lib/hecks/language/sentence/sentence.bluebook +210 -0
  773. data/lib/hecks/language/translation/translation_aggregate.bluebook +24 -0
  774. data/lib/hecks/language/world/world.bluebook +6 -6
  775. data/lib/hecks/literal.rb +8 -2
  776. data/lib/hecks/module_folders.rb +31 -0
  777. data/lib/hecks/naming.rb +44 -14
  778. data/lib/hecks/persistence_legacy_fixture/postgres_stores.rb +7 -6
  779. data/lib/hecks/persistence_legacy_fixture/regenerate.rb +6 -2
  780. data/lib/hecks/ports/access_control.rb +2 -2
  781. data/lib/hecks/ports/agent/answers.rb +2 -2
  782. data/lib/hecks/ports/agent.rb +2 -2
  783. data/lib/hecks/ports/authentication.port +6 -0
  784. data/lib/hecks/ports/authentication.rb +67 -0
  785. data/lib/hecks/ports/authorization.rb +3 -3
  786. data/lib/hecks/ports/dispatch.port +5 -0
  787. data/lib/hecks/ports/dispatch.rb +28 -0
  788. data/lib/hecks/ports/key_vault.rb +10 -7
  789. data/lib/hecks/ports/loading.rb +23 -7
  790. data/lib/hecks/ports/persistence/append_only.rb +44 -9
  791. data/lib/hecks/ports/persistence/binding_policy.rb +73 -12
  792. data/lib/hecks/ports/persistence/codec_boundary.rb +4 -3
  793. data/lib/hecks/ports/persistence/mint_door.rb +74 -0
  794. data/lib/hecks/ports/persistence/plugins/era/era_check.rb +16 -15
  795. data/lib/hecks/ports/persistence/plugins/era/era_guard/shape_diff.rb +9 -6
  796. data/lib/hecks/ports/persistence/plugins/era/era_guard.rb +11 -11
  797. data/lib/hecks/ports/persistence/plugins/era/era_status.rb +48 -0
  798. data/lib/hecks/ports/persistence/plugins/era/era_tamper.rb +1 -1
  799. data/lib/hecks/ports/persistence/plugins/era/projected_bluebook.rb +127 -0
  800. data/lib/hecks/ports/persistence/plugins/era/storage_shape.rb +6 -6
  801. data/lib/hecks/ports/persistence/plugins/era/translation/additive_shape.rb +107 -0
  802. data/lib/hecks/ports/persistence/plugins/era/translation/audit.rb +9 -3
  803. data/lib/hecks/ports/persistence/plugins/era/translation/compose.rb +155 -0
  804. data/lib/hecks/ports/persistence/plugins/era/translation/compose_render.rb +79 -0
  805. data/lib/hecks/ports/persistence/plugins/era/translation/edge_files.rb +49 -0
  806. data/lib/hecks/ports/persistence/plugins/era/translation/edge_route.rb +61 -0
  807. data/lib/hecks/ports/persistence/plugins/era/translation/implicit_edge.rb +67 -0
  808. data/lib/hecks/ports/persistence/plugins/era/translation/reattest.rb +1 -1
  809. data/lib/hecks/ports/persistence/plugins/era/translation/reconcile.rb +130 -0
  810. data/lib/hecks/ports/persistence/plugins/era/translation/reconcile_files.rb +35 -0
  811. data/lib/hecks/ports/persistence/plugins/era/translation/rule_compiler.rb +32 -19
  812. data/lib/hecks/ports/persistence/plugins/era/translation/scaffold/differ.rb +13 -5
  813. data/lib/hecks/ports/persistence/plugins/era/translation.rb +5 -0
  814. data/lib/hecks/ports/persistence/plugins/era.rb +1 -1
  815. data/lib/hecks/ports/persistence/remote_runtime.rb +3 -2
  816. data/lib/hecks/ports/persistence/repository_factory.rb +11 -3
  817. data/lib/hecks/ports/persistence/set_statement.rb +29 -0
  818. data/lib/hecks/ports/persistence/set_transforming.rb +30 -0
  819. data/lib/hecks/ports/persistence/state_codec.rb +3 -3
  820. data/lib/hecks/ports/persistence/stored_name_guard.rb +36 -0
  821. data/lib/hecks/ports/persistence.rb +2 -4
  822. data/lib/hecks/ports/projection.rb +4 -1
  823. data/lib/hecks/ports/query/cursor.rb +131 -0
  824. data/lib/hecks/ports/query/in_memory.rb +17 -10
  825. data/lib/hecks/ports/query.rb +4 -2
  826. data/lib/hecks/ports.rb +1 -0
  827. data/lib/hecks/projection_files/expression_tables.rb +3 -3
  828. data/lib/hecks/projection_files/sentence_table.rb +17 -0
  829. data/lib/hecks/projection_files.rb +16 -13
  830. data/lib/hecks/projections/bootstrap_table.rb +3 -3
  831. data/lib/hecks/projections/ci_pipeline/table/checks.rb +137 -0
  832. data/lib/hecks/projections/ci_pipeline/table/lookup.rb +59 -0
  833. data/lib/hecks/projections/ci_pipeline/table/refusals.rb +58 -0
  834. data/lib/hecks/projections/ci_pipeline/table/rows.rb +119 -0
  835. data/lib/hecks/projections/ci_pipeline/table/tree.rb +30 -0
  836. data/lib/hecks/projections/ci_pipeline/table/typing.rb +92 -0
  837. data/lib/hecks/projections/ci_pipeline/table.rb +112 -0
  838. data/lib/hecks/projections/ci_pipeline/workflows.rb +162 -0
  839. data/lib/hecks/projections/ci_pipeline/yaml_text.rb +104 -0
  840. data/lib/hecks/projections/command_schema/shape.rb +95 -0
  841. data/lib/hecks/projections/command_schema.rb +74 -0
  842. data/lib/hecks/projections/context_map_diagram.rb +135 -0
  843. data/lib/hecks/projections/context_relationships.rb +125 -0
  844. data/lib/hecks/projections/deploy/box/access.rb +7 -4
  845. data/lib/hecks/projections/deploy/box/caddy.rb +2 -1
  846. data/lib/hecks/projections/deploy/box/compose.rb +4 -8
  847. data/lib/hecks/projections/deploy/box/edge.rb +2 -1
  848. data/lib/hecks/projections/deploy/box/hosting.rb +5 -3
  849. data/lib/hecks/projections/deploy/box/hosting_parts.rb +27 -12
  850. data/lib/hecks/projections/deploy/box/logging.rb +2 -3
  851. data/lib/hecks/projections/deploy/box/roll_recipe.rb +2 -4
  852. data/lib/hecks/projections/deploy/box/roll_scripts.rb +2 -17
  853. data/lib/hecks/projections/deploy/box/settings/containers.rb +29 -15
  854. data/lib/hecks/projections/deploy/box/settings/patterns.rb +5 -6
  855. data/lib/hecks/projections/deploy/box/settings/types.rb +5 -10
  856. data/lib/hecks/projections/deploy/box/settings.rb +9 -8
  857. data/lib/hecks/projections/deploy/box/stack_yaml.rb +10 -14
  858. data/lib/hecks/projections/deploy/box/templates/box.yaml.tmpl +0 -1
  859. data/lib/hecks/projections/deploy/box/templates/deploy-service.sh.tmpl +16 -3
  860. data/lib/hecks/projections/deploy/box/templates/hosting.mk.tmpl +7 -6
  861. data/lib/hecks/projections/deploy/box/templates/render-compose-taskdef.sh.tmpl +2 -6
  862. data/lib/hecks/projections/deploy/box/templates/render-compose.sh.tmpl +2 -6
  863. data/lib/hecks/projections/deploy/box.rb +17 -10
  864. data/lib/hecks/projections/deploy/fargate/assembly.rb +7 -2
  865. data/lib/hecks/projections/deploy/fargate/cdn/options.rb +4 -1
  866. data/lib/hecks/projections/deploy/fargate/check.rb +3 -1
  867. data/lib/hecks/projections/deploy/fargate/containers/rendering.rb +8 -5
  868. data/lib/hecks/projections/deploy/fargate/containers/routing.rb +2 -1
  869. data/lib/hecks/projections/deploy/fargate/monitoring/reading.rb +4 -1
  870. data/lib/hecks/projections/deploy/fargate/sections.rb +7 -4
  871. data/lib/hecks/projections/deploy/fargate/settings/ids.rb +4 -1
  872. data/lib/hecks/projections/deploy/fargate/settings/tuning.rb +13 -4
  873. data/lib/hecks/projections/deploy/fargate/stack/blocks.rb +6 -1
  874. data/lib/hecks/projections/deploy/fargate/stack/readers.rb +2 -1
  875. data/lib/hecks/projections/deploy/fargate/stack.rb +11 -6
  876. data/lib/hecks/projections/deploy/fargate/yaml.rb +10 -3
  877. data/lib/hecks/projections/deploy/fargate.rb +8 -3
  878. data/lib/hecks/projections/deploy/lambda/stack/blocks.rb +4 -2
  879. data/lib/hecks/projections/deploy/lambda/stack/deploy_chain.rb +2 -1
  880. data/lib/hecks/projections/deploy/lambda/stack/reading.rb +12 -9
  881. data/lib/hecks/projections/deploy/lambda/stack/reading_web.rb +7 -2
  882. data/lib/hecks/projections/deploy/lambda/stack/web.rb +2 -1
  883. data/lib/hecks/projections/deploy/lambda.rb +8 -3
  884. data/lib/hecks/projections/deploy/preview/containers.rb +14 -1
  885. data/lib/hecks/projections/deploy/preview/preview.sh.erb +2 -2
  886. data/lib/hecks/projections/deploy/preview/routing_yaml.rb +8 -6
  887. data/lib/hecks/projections/deploy/preview/settings.rb +23 -5
  888. data/lib/hecks/projections/deploy/preview/task_yaml.rb +1 -1
  889. data/lib/hecks/projections/deploy/preview/yaml_text.rb +2 -1
  890. data/lib/hecks/projections/deploy/scripts/settings.rb +5 -2
  891. data/lib/hecks/projections/deploy/shared.rb +12 -1
  892. data/lib/hecks/projections/deploy/shared_database_instance.rb +1 -1
  893. data/lib/hecks/projections/deploy/smoke.rb +3 -1
  894. data/lib/hecks/projections/deploy/template_diff/normalizer.rb +4 -1
  895. data/lib/hecks/projections/deploy/templates/fargate/Makefile.tmpl +1 -1
  896. data/lib/hecks/projections/deploy/templates/lambda/Makefile.tmpl +3 -3
  897. data/lib/hecks/projections/deploy/templates/lambda/mint_era_shared.tmpl +2 -2
  898. data/lib/hecks/projections/deploy/templates/lambda/nat_comment_oauth.tmpl +1 -1
  899. data/lib/hecks/projections/deploy/vercel.rb +1 -1
  900. data/lib/hecks/projections/diagrams/dispatch.rb +5 -3
  901. data/lib/hecks/projections/diagrams/statecharts.rb +8 -3
  902. data/lib/hecks/projections/diagrams/structure.rb +9 -6
  903. data/lib/hecks/projections/diagrams.rb +9 -7
  904. data/lib/hecks/projections/glossary/entries.rb +4 -4
  905. data/lib/hecks/projections/glossary/html/page.rb +4 -1
  906. data/lib/hecks/projections/glossary/html/parser.rb +13 -4
  907. data/lib/hecks/projections/glossary/html/sections.rb +4 -1
  908. data/lib/hecks/projections/glossary/html.rb +10 -3
  909. data/lib/hecks/projections/glossary/markdown.rb +4 -3
  910. data/lib/hecks/projections/glossary/mermaid.rb +8 -5
  911. data/lib/hecks/projections/glossary/sections.rb +1 -1
  912. data/lib/hecks/projections/glossary/sensitivity.rb +11 -4
  913. data/lib/hecks/projections/glossary/sentences/actions.rb +5 -2
  914. data/lib/hecks/projections/glossary/sentences/queries.rb +2 -1
  915. data/lib/hecks/projections/glossary/sentences/value_objects.rb +15 -6
  916. data/lib/hecks/projections/glossary/sentences.rb +6 -3
  917. data/lib/hecks/projections/glossary/slugs.rb +8 -1
  918. data/lib/hecks/projections/glossary.rb +3 -3
  919. data/lib/hecks/projections/model.rb +10 -6
  920. data/lib/hecks/projections/oidc.rb +19 -7
  921. data/lib/hecks/projections/parser_table.rb +10 -10
  922. data/lib/hecks/projections/phrase_table.rb +105 -0
  923. data/lib/hecks/projections/plain_english.rb +14 -4
  924. data/lib/hecks/projections/rails_app.rb +77 -0
  925. data/lib/hecks/projections/reference.rb +2 -2
  926. data/lib/hecks/projections/rust_vocabulary/arguments.rb +1 -1
  927. data/lib/hecks/projections/rust_vocabulary/tables.rb +20 -0
  928. data/lib/hecks/projections/rust_vocabulary.rb +14 -17
  929. data/lib/hecks/projections/site/admin.rb +7 -7
  930. data/lib/hecks/projections/site/admin_cms.rb +1 -1
  931. data/lib/hecks/projections/site/cms_editor/blocks.rb +5 -2
  932. data/lib/hecks/projections/site/cms_editor/checks.rb +9 -6
  933. data/lib/hecks/projections/site/cms_editor/color.rb +4 -1
  934. data/lib/hecks/projections/site/cms_editor/composition.rb +20 -18
  935. data/lib/hecks/projections/site/cms_editor/destructive.rb +4 -1
  936. data/lib/hecks/projections/site/cms_editor/drafts.rb +6 -2
  937. data/lib/hecks/projections/site/cms_editor/key_kinds.rb +4 -1
  938. data/lib/hecks/projections/site/cms_editor/limits.rb +1 -1
  939. data/lib/hecks/projections/site/cms_editor/media.rb +1 -1
  940. data/lib/hecks/projections/site/cms_editor/moment.rb +3 -1
  941. data/lib/hecks/projections/site/cms_editor/pickers.rb +1 -1
  942. data/lib/hecks/projections/site/cms_editor/preview.rb +10 -4
  943. data/lib/hecks/projections/site/cms_editor/relations.rb +3 -2
  944. data/lib/hecks/projections/site/cms_editor/scale_checks.rb +32 -25
  945. data/lib/hecks/projections/site/cms_editor/scheduling.rb +1 -1
  946. data/lib/hecks/projections/site/cms_editor/schema.rb +31 -29
  947. data/lib/hecks/projections/site/cms_editor/setting.rb +34 -27
  948. data/lib/hecks/projections/site/cms_editor/targets.rb +9 -6
  949. data/lib/hecks/projections/site/cms_editor/templates/src/app.ts.tmpl +3 -3
  950. data/lib/hecks/projections/site/cms_editor/templates/src/commands.ts.tmpl +2 -2
  951. data/lib/hecks/projections/site/cms_editor/templates/src/host.ts.tmpl +1 -1
  952. data/lib/hecks/projections/site/cms_editor/templates/src/media/handler.ts.tmpl +4 -4
  953. data/lib/hecks/projections/site/cms_editor/templates/src/names.ts.tmpl +14 -14
  954. data/lib/hecks/projections/site/cms_editor/templates/src/schema.ts.tmpl +12 -12
  955. data/lib/hecks/projections/site/cms_editor/templates/src/ui/pages.ts.tmpl +12 -12
  956. data/lib/hecks/projections/site/cms_editor/templates/src/ui/pickers.ts.tmpl +1 -1
  957. data/lib/hecks/projections/site/cms_editor/templates/src/ui/schedule.ts.tmpl +2 -2
  958. data/lib/hecks/projections/site/cms_editor/templates/src/ui/shell.ts.tmpl +11 -11
  959. data/lib/hecks/projections/site/cms_editor/templates/src/ui/world.ts.tmpl +3 -3
  960. data/lib/hecks/projections/site/cms_editor/theme_checks.rb +8 -2
  961. data/lib/hecks/projections/site/cms_editor.rb +19 -16
  962. data/lib/hecks/projections/site/edge/checks.rb +1 -1
  963. data/lib/hecks/projections/site/edge/function_checks.rb +1 -1
  964. data/lib/hecks/projections/site/edge/function_code.rb +4 -1
  965. data/lib/hecks/projections/site/edge/pattern.rb +4 -1
  966. data/lib/hecks/projections/site/edge/route_checks.rb +2 -2
  967. data/lib/hecks/projections/site/edge/rules.rb +1 -1
  968. data/lib/hecks/projections/site/edge.rb +14 -8
  969. data/lib/hecks/projections/site/live_edge.rb +2 -2
  970. data/lib/hecks/projections/site/payload/fields/definitions.rb +1 -1
  971. data/lib/hecks/projections/site/payload/lifecycle/text.rb +1 -1
  972. data/lib/hecks/projections/site/payload/model.rb +16 -12
  973. data/lib/hecks/projections/site/payload/specs.rb +4 -2
  974. data/lib/hecks/projections/site/payload_driver.rb +9 -8
  975. data/lib/hecks/projections/site/probe.rb +12 -3
  976. data/lib/hecks/projections/site/regions.rb +9 -1
  977. data/lib/hecks/projections/site/role_probe.rb +7 -7
  978. data/lib/hecks/projections/site/root_rows.rb +4 -4
  979. data/lib/hecks/projections/site/routes_ts/listings.rb +13 -6
  980. data/lib/hecks/projections/site/routes_ts.rb +6 -3
  981. data/lib/hecks/projections/site/site_admin.rb +1 -1
  982. data/lib/hecks/projections/site/site_cdn.rb +3 -2
  983. data/lib/hecks/projections/site/site_host.rb +1 -1
  984. data/lib/hecks/projections/site/site_root.rb +4 -4
  985. data/lib/hecks/projections/site/table/checks.rb +4 -1
  986. data/lib/hecks/projections/site/table/navigation_checks.rb +2 -2
  987. data/lib/hecks/projections/site/table/row_builder.rb +7 -7
  988. data/lib/hecks/projections/site/table/row_defaults.rb +1 -1
  989. data/lib/hecks/projections/site/table.rb +32 -26
  990. data/lib/hecks/projections/statements/actions.rb +4 -1
  991. data/lib/hecks/projections/statements/relationships.rb +15 -2
  992. data/lib/hecks/projections/statements.rb +2 -2
  993. data/lib/hecks/projections/undo.rb +46 -0
  994. data/lib/hecks/projections/vocabulary.rb +6 -6
  995. data/lib/hecks/projections/world_skeleton.rb +68 -0
  996. data/lib/hecks/projections.rb +7 -0
  997. data/lib/hecks/projector/cli_audience.rb +12 -9
  998. data/lib/hecks/projector/cli_projector/claims.rb +19 -8
  999. data/lib/hecks/projector/cli_projector/command_help.rb +6 -1
  1000. data/lib/hecks/projector/cli_projector/command_specs.rb +20 -6
  1001. data/lib/hecks/projector/cli_projector/completion.rb +87 -0
  1002. data/lib/hecks/projector/cli_projector/everyday.rb +40 -0
  1003. data/lib/hecks/projector/cli_projector/json_listing.rb +77 -0
  1004. data/lib/hecks/projector/cli_projector/listing.rb +20 -8
  1005. data/lib/hecks/projector/cli_projector/modules.rb +39 -0
  1006. data/lib/hecks/projector/cli_projector/option_specs.rb +1 -1
  1007. data/lib/hecks/projector/cli_projector/query_specs.rb +2 -1
  1008. data/lib/hecks/projector/cli_projector/renames.rb +58 -0
  1009. data/lib/hecks/projector/cli_projector/search.rb +74 -0
  1010. data/lib/hecks/projector/cli_projector/usage.rb +33 -12
  1011. data/lib/hecks/projector/cli_projector.rb +26 -3
  1012. data/lib/hecks/projector/docs_projector/behaviour.rb +5 -4
  1013. data/lib/hecks/projector/docs_projector/closing.rb +3 -3
  1014. data/lib/hecks/projector/docs_projector.rb +12 -7
  1015. data/lib/hecks/projector/exporter/adapters.rb +15 -2
  1016. data/lib/hecks/projector/exporter/bindings.rb +39 -134
  1017. data/lib/hecks/projector/exporter/plugins.rb +55 -0
  1018. data/lib/hecks/projector/exporter.rb +2 -0
  1019. data/lib/hecks/projector/narrate_projector/commands.rb +4 -3
  1020. data/lib/hecks/projector/narrate_projector/reactions.rb +2 -2
  1021. data/lib/hecks/projector/narrate_projector.rb +9 -8
  1022. data/lib/hecks/projector/target.rb +8 -8
  1023. data/lib/hecks/projector.rb +9 -9
  1024. data/lib/hecks/quality_control/adapters/agent.rb +2 -1
  1025. data/lib/hecks/quality_control/adapters/ci_head.adapter +8 -0
  1026. data/lib/hecks/quality_control/adapters/github_checks.adapter +1 -1
  1027. data/lib/hecks/quality_control/adapters/github_issues.adapter +1 -1
  1028. data/lib/hecks/quality_control/adapters/github_issues.rb +6 -2
  1029. data/lib/hecks/quality_control/adapters/image_roll.adapter +9 -0
  1030. data/lib/hecks/quality_control/adapters/image_roll.rb +158 -0
  1031. data/lib/hecks/quality_control/adapters/main_maintenance.adapter +8 -0
  1032. data/lib/hecks/quality_control/adapters/main_maintenance.rb +275 -0
  1033. data/lib/hecks/quality_control/adapters/pump_tools.adapter +7 -0
  1034. data/lib/hecks/quality_control/adapters/pump_tools.rb +18 -0
  1035. data/lib/hecks/quality_control/adapters/push_due_reader.adapter +8 -0
  1036. data/lib/hecks/quality_control/adapters/push_due_reader.rb +99 -0
  1037. data/lib/hecks/quality_control/adapters/qa_auto_mint.rb +183 -0
  1038. data/lib/hecks/quality_control/adapters/qa_era_mint.rb +94 -0
  1039. data/lib/hecks/quality_control/adapters/qa_quiesce_marker.rb +126 -0
  1040. data/lib/hecks/quality_control/adapters/run_keys.rb +36 -0
  1041. data/lib/hecks/quality_control/adapters/run_reader.adapter +7 -0
  1042. data/lib/hecks/quality_control/adapters/run_reader.rb +188 -0
  1043. data/lib/hecks/quality_control/adapters/target_tools.rb +9 -3
  1044. data/lib/hecks/quality_control/cli/child.rb +2 -0
  1045. data/lib/hecks/quality_control/cli/qa_discover_external_domains/scanning.rb +1 -1
  1046. data/lib/hecks/quality_control/cli/qa_domain_novelty/verdict.rb +1 -1
  1047. data/lib/hecks/quality_control/cli/qa_domain_novelty.rb +3 -3
  1048. data/lib/hecks/quality_control/cli/qa_event_pump/attached.rb +67 -0
  1049. data/lib/hecks/quality_control/cli/qa_event_pump/consumer.rb +103 -0
  1050. data/lib/hecks/quality_control/cli/qa_event_pump/cursors.rb +60 -0
  1051. data/lib/hecks/quality_control/cli/qa_event_pump/reactions.rb +46 -0
  1052. data/lib/hecks/quality_control/cli/qa_event_pump/reader.rb +30 -0
  1053. data/lib/hecks/quality_control/cli/qa_event_pump.rb +76 -0
  1054. data/lib/hecks/quality_control/cli/qa_fix_main_bug/publishing.rb +79 -0
  1055. data/lib/hecks/quality_control/cli/qa_fix_main_bug.rb +167 -0
  1056. data/lib/hecks/quality_control/cli/qa_generated_domains/evaluation.rb +13 -3
  1057. data/lib/hecks/quality_control/cli/qa_generated_domains/promotion.rb +7 -4
  1058. data/lib/hecks/quality_control/cli/qa_generated_domains.rb +4 -1
  1059. data/lib/hecks/quality_control/cli/qa_log_bug/proof.rb +16 -3
  1060. data/lib/hecks/quality_control/cli/qa_main_gate/gate_run.rb +52 -0
  1061. data/lib/hecks/quality_control/cli/qa_main_gate/logging.rb +70 -0
  1062. data/lib/hecks/quality_control/cli/qa_main_gate/shell.rb +47 -0
  1063. data/lib/hecks/quality_control/cli/qa_main_gate/sweeping.rb +59 -0
  1064. data/lib/hecks/quality_control/cli/qa_main_gate/worktree.rb +62 -0
  1065. data/lib/hecks/quality_control/cli/qa_main_gate.rb +135 -0
  1066. data/lib/hecks/quality_control/cli/qa_mine_combinations/booting.rb +4 -2
  1067. data/lib/hecks/quality_control/cli/qa_mutate.rb +161 -0
  1068. data/lib/hecks/quality_control/cli/qa_postgres_role.rb +1 -1
  1069. data/lib/hecks/quality_control/cli/qa_pr_check/checking.rb +2 -3
  1070. data/lib/hecks/quality_control/cli/qa_push_nudge.rb +48 -0
  1071. data/lib/hecks/quality_control/cli/qa_seed_angles/seed.rb +1 -1
  1072. data/lib/hecks/quality_control/cli/qa_sweep/all_mode/report.rb +4 -1
  1073. data/lib/hecks/quality_control/cli/qa_sweep/parsing.rb +2 -1
  1074. data/lib/hecks/quality_control/cli/qa_sweep/seat.rb +1 -1
  1075. data/lib/hecks/quality_control/cli/qa_sweep.rb +4 -1
  1076. data/lib/hecks/quality_control/cli/qa_tick/event_pump_step.rb +34 -0
  1077. data/lib/hecks/quality_control/cli/qa_tick/output.rb +43 -26
  1078. data/lib/hecks/quality_control/cli/qa_tick/preflight.rb +12 -3
  1079. data/lib/hecks/quality_control/cli/qa_tick/push_nudge_step.rb +28 -0
  1080. data/lib/hecks/quality_control/cli/qa_tick/quiesce_guard.rb +51 -0
  1081. data/lib/hecks/quality_control/cli/qa_tick.rb +52 -8
  1082. data/lib/hecks/quality_control/quality_control.behaviors +65 -0
  1083. data/lib/hecks/quality_control/quality_control.bluebook +1224 -103
  1084. data/lib/hecks/quality_control/quality_control.hecksagon +14 -3
  1085. data/lib/hecks/quality_control/quality_control.ports.hecksagon +141 -2
  1086. data/lib/hecks/query_ir/rules.rb +9 -9
  1087. data/lib/hecks/query_ir/touchpoints.rb +10 -9
  1088. data/lib/hecks/query_ir.rb +3 -3
  1089. data/lib/hecks/query_specification/common/comparison.rb +1 -1
  1090. data/lib/hecks/query_specification/common/dsl.rb +3 -4
  1091. data/lib/hecks/query_specification/hop_path.rb +7 -4
  1092. data/lib/hecks/rails_app/bluebook/rails_app.bluebook +60 -0
  1093. data/lib/hecks/rails_app/bluebook/rails_app.hecksagon +4 -0
  1094. data/lib/hecks/refused.rb +125 -0
  1095. data/lib/hecks/release/approval.rb +15 -5
  1096. data/lib/hecks/release/conditions.rb +46 -0
  1097. data/lib/hecks/release/gem_pin.rb +7 -3
  1098. data/lib/hecks/release/lane.rb +1 -1
  1099. data/lib/hecks/release/runner/clean_tree.rb +4 -1
  1100. data/lib/hecks/release/runner/console.rb +2 -1
  1101. data/lib/hecks/release/runner/gem_publisher.rb +4 -4
  1102. data/lib/hecks/release/version_commit.rb +48 -0
  1103. data/lib/hecks/router/aggregate_reader.rb +3 -4
  1104. data/lib/hecks/router/namespace_installer.rb +31 -17
  1105. data/lib/hecks/router.rb +2 -10
  1106. data/lib/hecks/runtime/adapter_lookup.rb +30 -7
  1107. data/lib/hecks/runtime/adapter_namespace.rb +21 -0
  1108. data/lib/hecks/runtime/asking.rb +30 -0
  1109. data/lib/hecks/runtime/caller.rb +22 -0
  1110. data/lib/hecks/runtime/capability_graph.rb +2 -1
  1111. data/lib/hecks/runtime/collecting.rb +86 -0
  1112. data/lib/hecks/runtime/command_interpreter/argument_gate.rb +13 -8
  1113. data/lib/hecks/runtime/command_interpreter/delegation.rb +46 -17
  1114. data/lib/hecks/runtime/command_interpreter/hydration.rb +22 -25
  1115. data/lib/hecks/runtime/command_interpreter/list_mutations.rb +2 -1
  1116. data/lib/hecks/runtime/command_interpreter/persisting.rb +23 -14
  1117. data/lib/hecks/runtime/command_interpreter.rb +19 -12
  1118. data/lib/hecks/runtime/command_rules/admissibility.rb +17 -12
  1119. data/lib/hecks/runtime/command_rules/authorization.rb +8 -6
  1120. data/lib/hecks/runtime/command_rules/emission.rb +0 -1
  1121. data/lib/hecks/runtime/command_rules/guard_state.rb +10 -10
  1122. data/lib/hecks/runtime/command_rules/invariants.rb +3 -1
  1123. data/lib/hecks/runtime/command_rules/missing_reference.rb +25 -0
  1124. data/lib/hecks/runtime/command_rules/one_of_references.rb +44 -0
  1125. data/lib/hecks/runtime/command_rules/references.rb +14 -14
  1126. data/lib/hecks/runtime/command_rules.rb +2 -0
  1127. data/lib/hecks/runtime/declarations.rb +66 -0
  1128. data/lib/hecks/runtime/dependency_planning/analyzer.rb +2 -1
  1129. data/lib/hecks/runtime/dependency_planning/expression_reads.rb +3 -3
  1130. data/lib/hecks/runtime/dependency_planning/mutation_analysis.rb +2 -1
  1131. data/lib/hecks/runtime/dispatch_claim.rb +72 -0
  1132. data/lib/hecks/runtime/dispatch_context.rb +41 -0
  1133. data/lib/hecks/runtime/dispatcher/planning.rb +24 -0
  1134. data/lib/hecks/runtime/dispatcher/queries.rb +17 -0
  1135. data/lib/hecks/runtime/dispatcher/routing.rb +40 -12
  1136. data/lib/hecks/runtime/dispatcher/validating.rb +73 -0
  1137. data/lib/hecks/runtime/dispatcher/value_routing.rb +54 -0
  1138. data/lib/hecks/runtime/dispatcher.rb +46 -24
  1139. data/lib/hecks/runtime/dry_run_plan.rb +60 -0
  1140. data/lib/hecks/runtime/entity_element/location.rb +15 -8
  1141. data/lib/hecks/runtime/entity_element/mutations.rb +4 -2
  1142. data/lib/hecks/runtime/entity_interpreter/enforcement.rb +1 -1
  1143. data/lib/hecks/runtime/entity_interpreter/locating.rb +6 -1
  1144. data/lib/hecks/runtime/entity_interpreter/saving.rb +5 -5
  1145. data/lib/hecks/runtime/entity_interpreter.rb +11 -5
  1146. data/lib/hecks/runtime/errors.rb +56 -17
  1147. data/lib/hecks/runtime/identity.rb +9 -0
  1148. data/lib/hecks/runtime/instance.rb +3 -3
  1149. data/lib/hecks/runtime/interpreting.rb +63 -6
  1150. data/lib/hecks/runtime/invocation_builder.rb +7 -5
  1151. data/lib/hecks/runtime/invocation_facts.rb +13 -8
  1152. data/lib/hecks/runtime/loader/boot_steps.rb +3 -2
  1153. data/lib/hecks/runtime/loader/described.rb +4 -0
  1154. data/lib/hecks/runtime/loader.rb +52 -62
  1155. data/lib/hecks/runtime/outbox/consumer_runner.rb +9 -1
  1156. data/lib/hecks/runtime/outbox/redrive.rb +105 -0
  1157. data/lib/hecks/runtime/outbox/relay.rb +36 -43
  1158. data/lib/hecks/runtime/outbox/runnable.rb +62 -0
  1159. data/lib/hecks/runtime/outbox.rb +21 -3
  1160. data/lib/hecks/runtime/policy_interpreter/arguments.rb +7 -1
  1161. data/lib/hecks/runtime/policy_interpreter/fan_out.rb +26 -37
  1162. data/lib/hecks/runtime/policy_interpreter.rb +25 -9
  1163. data/lib/hecks/runtime/port_operation_interpreter.rb +47 -19
  1164. data/lib/hecks/runtime/query_interpreter/arguments.rb +6 -5
  1165. data/lib/hecks/runtime/query_interpreter/outside_answer.rb +1 -1
  1166. data/lib/hecks/runtime/query_interpreter/paging.rb +42 -0
  1167. data/lib/hecks/runtime/query_interpreter/plugin_answer.rb +54 -0
  1168. data/lib/hecks/runtime/query_interpreter/store_specification.rb +32 -0
  1169. data/lib/hecks/runtime/query_interpreter.rb +16 -9
  1170. data/lib/hecks/runtime/reaction_invocation/target_resolution.rb +10 -4
  1171. data/lib/hecks/runtime/reaction_invocation.rb +5 -3
  1172. data/lib/hecks/runtime/read_model_interpreter/head_ordering.rb +1 -1
  1173. data/lib/hecks/runtime/read_model_interpreter/reductions.rb +23 -15
  1174. data/lib/hecks/runtime/read_model_interpreter/shaping.rb +18 -7
  1175. data/lib/hecks/runtime/read_model_interpreter.rb +5 -2
  1176. data/lib/hecks/runtime/reference_hop.rb +3 -2
  1177. data/lib/hecks/runtime/refusal_wording.rb +27 -7
  1178. data/lib/hecks/runtime/registry/adapter_capabilities.rb +43 -0
  1179. data/lib/hecks/runtime/registry/ask_verification.rb +15 -4
  1180. data/lib/hecks/runtime/registry/{chapter_verification.rb → bluebook_verification.rb} +23 -23
  1181. data/lib/hecks/runtime/registry/context_maps.rb +26 -0
  1182. data/lib/hecks/runtime/registry/declarations.rb +38 -6
  1183. data/lib/hecks/runtime/registry/durability_warnings.rb +18 -2
  1184. data/lib/hecks/runtime/registry/hecksagon_rules.rb +42 -25
  1185. data/lib/hecks/runtime/registry/plugin_query_verification.rb +45 -0
  1186. data/lib/hecks/runtime/registry/providers.rb +34 -99
  1187. data/lib/hecks/runtime/registry/query_verification.rb +30 -21
  1188. data/lib/hecks/runtime/registry/runtime_state.rb +14 -3
  1189. data/lib/hecks/runtime/registry/saga_persistence.rb +7 -16
  1190. data/lib/hecks/runtime/registry/verification.rb +9 -5
  1191. data/lib/hecks/runtime/registry/world_defaults.rb +31 -6
  1192. data/lib/hecks/runtime/registry/world_names.rb +99 -0
  1193. data/lib/hecks/runtime/registry.rb +84 -53
  1194. data/lib/hecks/runtime/row_sweep.rb +104 -0
  1195. data/lib/hecks/runtime/saga_interpreter/compensation.rb +15 -4
  1196. data/lib/hecks/runtime/saga_interpreter/correlation.rb +29 -3
  1197. data/lib/hecks/runtime/saga_interpreter/delivery.rb +13 -11
  1198. data/lib/hecks/runtime/saga_interpreter/lifecycle.rb +1 -1
  1199. data/lib/hecks/runtime/saga_interpreter/redrive.rb +141 -0
  1200. data/lib/hecks/runtime/saga_interpreter/transitions.rb +35 -6
  1201. data/lib/hecks/runtime/saga_interpreter.rb +82 -6
  1202. data/lib/hecks/runtime/saga_pending_dispatch.rb +4 -2
  1203. data/lib/hecks/runtime/scalar_field.rb +73 -0
  1204. data/lib/hecks/runtime/tenant_scope.rb +2 -1
  1205. data/lib/hecks/runtime/validation.rb +24 -0
  1206. data/lib/hecks/runtime/value/admission.rb +11 -11
  1207. data/lib/hecks/runtime/value/coercion.rb +43 -15
  1208. data/lib/hecks/runtime/value/field_checks.rb +13 -13
  1209. data/lib/hecks/runtime/value/invariant_violation.rb +4 -1
  1210. data/lib/hecks/runtime/value/references.rb +7 -4
  1211. data/lib/hecks/runtime/value/validation.rb +7 -4
  1212. data/lib/hecks/runtime/wasm_plugin.rb +98 -0
  1213. data/lib/hecks/runtime.rb +14 -14
  1214. data/lib/hecks/rust_build/command_schemas.rb +27 -0
  1215. data/lib/hecks/rust_build/conformance/surface.rb +50 -7
  1216. data/lib/hecks/rust_build/conformance.rb +41 -8
  1217. data/lib/hecks/rust_build/conformance_fuzz.rb +2 -2
  1218. data/lib/hecks/rust_build/domain_name.rb +4 -1
  1219. data/lib/hecks/rust_build/host.rb +15 -9
  1220. data/lib/hecks/rust_build/native_build.rb +2 -1
  1221. data/lib/hecks/rust_build/parser.rb +25 -0
  1222. data/lib/hecks/rust_build/prebuilt_binary.rb +25 -5
  1223. data/lib/hecks/rust_build/project_rust/codegen_run.rb +51 -17
  1224. data/lib/hecks/rust_build/project_rust/declared.rb +80 -0
  1225. data/lib/hecks/rust_build/project_rust/domain_loader.rb +15 -2
  1226. data/lib/hecks/rust_build/project_rust/features_header.rb +22 -0
  1227. data/lib/hecks/rust_build/project_rust/manifest.rb +96 -0
  1228. data/lib/hecks/rust_build/project_rust/meta.rb +36 -0
  1229. data/lib/hecks/rust_build/project_rust/root_mod/notes.rb +1 -1
  1230. data/lib/hecks/rust_build/project_rust/target_ir.rb +12 -3
  1231. data/lib/hecks/rust_build/project_rust.rb +31 -73
  1232. data/lib/hecks/rust_build/target_dir.rb +40 -0
  1233. data/lib/hecks/rust_build/wasm.rb +46 -17
  1234. data/lib/hecks/rust_build/wasm_browser.rb +8 -2
  1235. data/lib/hecks/rust_build/write_if_changed.rb +19 -4
  1236. data/lib/hecks/rust_build.rb +31 -3
  1237. data/lib/hecks/rust_format.rb +32 -2
  1238. data/lib/hecks/secrets.rb +111 -0
  1239. data/lib/hecks/sentence_form.rb +212 -0
  1240. data/lib/hecks/served_options.rb +2 -1
  1241. data/lib/hecks/shape_ledger/edge_hygiene.rb +170 -0
  1242. data/lib/hecks/shape_ledger/scope.rb +51 -0
  1243. data/lib/hecks/shape_ledger/status.rb +89 -0
  1244. data/lib/hecks/shape_ledger.rb +194 -0
  1245. data/lib/hecks/site/bluebook/site.bluebook +40 -62
  1246. data/lib/hecks/site/bluebook/site.ports.hecksagon +1 -1
  1247. data/lib/hecks/sme/bluebook/sme.bluebook +7 -1
  1248. data/lib/hecks/storehouse/audit.rb +38 -5
  1249. data/lib/hecks/storehouse/bluebook_words.rb +35 -0
  1250. data/lib/hecks/storehouse/callers.rb +8 -0
  1251. data/lib/hecks/storehouse/dispatching.rb +20 -6
  1252. data/lib/hecks/storehouse/identity.rb +41 -0
  1253. data/lib/hecks/storehouse/introspection.rb +4 -4
  1254. data/lib/hecks/storehouse/querying.rb +9 -9
  1255. data/lib/hecks/storehouse.rb +38 -10
  1256. data/lib/hecks/switches.rb +21 -0
  1257. data/lib/hecks/tenancy/bluebook/tenancy.bluebook +5 -9
  1258. data/lib/hecks/text.rb +57 -0
  1259. data/lib/hecks/tickets/bluebook/adapters/work_areas.adapter +7 -0
  1260. data/lib/hecks/tickets/bluebook/adapters/work_limits.adapter +7 -0
  1261. data/lib/hecks/tickets/bluebook/tickets.behaviors +70 -0
  1262. data/lib/hecks/tickets/bluebook/tickets.bluebook +350 -76
  1263. data/lib/hecks/tickets/bluebook/tickets.hecksagon +8 -1
  1264. data/lib/hecks/tickets/bluebook/tickets.ports.hecksagon +18 -1
  1265. data/lib/hecks/tools/argument_gate_matrix/dispatching.rb +1 -1
  1266. data/lib/hecks/tools/argument_gate_matrix/rows.rb +7 -7
  1267. data/lib/hecks/tools/argument_gate_matrix/violations.rb +1 -1
  1268. data/lib/hecks/tools/argument_gate_matrix.rb +3 -3
  1269. data/lib/hecks/{cli → tools}/behaviors.rb +1 -1
  1270. data/lib/hecks/{cli → tools}/canonicalise.rb +1 -1
  1271. data/lib/hecks/{cli → tools}/check_engine_agreement.rb +1 -1
  1272. data/lib/hecks/{cli → tools}/check_era.rb +7 -7
  1273. data/lib/hecks/tools/ci_gate_decision.rb +5 -2
  1274. data/lib/hecks/tools/ci_gates.rb +9 -3
  1275. data/lib/hecks/tools/ci_workflows.rb +98 -0
  1276. data/lib/hecks/tools/comment_style/caps_words.rb +11 -8
  1277. data/lib/hecks/tools/comment_style/dictionary.rb +7 -2
  1278. data/lib/hecks/tools/comment_style/fixing.rb +10 -5
  1279. data/lib/hecks/tools/comment_style/long_blocks.rb +1 -1
  1280. data/lib/hecks/tools/comment_style/masking.rb +5 -5
  1281. data/lib/hecks/tools/comment_style/run.rb +4 -1
  1282. data/lib/hecks/tools/comment_style/source_file.rb +10 -3
  1283. data/lib/hecks/tools/comment_style/structure_checks.rb +13 -4
  1284. data/lib/hecks/tools/comment_style/text_checks.rb +1 -1
  1285. data/lib/hecks/tools/comment_style.rb +25 -2
  1286. data/lib/hecks/{cli → tools}/console.rb +12 -7
  1287. data/lib/hecks/tools/deploy_recipe/generation.rb +1 -1
  1288. data/lib/hecks/tools/deploy_recipe/targets.rb +1 -1
  1289. data/lib/hecks/tools/deploy_recipe/worlds.rb +15 -9
  1290. data/lib/hecks/tools/deploy_recipe.rb +17 -10
  1291. data/lib/hecks/tools/deploy_recipe_lint/fixtures.rb +1 -1
  1292. data/lib/hecks/tools/deploy_recipe_lint/makefile.rb +7 -1
  1293. data/lib/hecks/{cli → tools}/deploy_template_diff.rb +1 -1
  1294. data/lib/hecks/{cli → tools}/doc_coverage.rb +2 -2
  1295. data/lib/hecks/{cli → tools}/document.rb +15 -10
  1296. data/lib/hecks/{cli → tools}/domain_stub.rb +1 -1
  1297. data/lib/hecks/{cli → tools}/domain_writer.rb +5 -2
  1298. data/lib/hecks/tools/downstream_model_check.rb +122 -0
  1299. data/lib/hecks/tools/drop_implicit_append_fields.rb +4 -1
  1300. data/lib/hecks/tools/era_projection_backfill.rb +11 -6
  1301. data/lib/hecks/tools/era_reattest.rb +11 -6
  1302. data/lib/hecks/tools/evolve_run.rb +2 -2
  1303. data/lib/hecks/tools/expected_era.rb +139 -0
  1304. data/lib/hecks/{cli → tools}/expression_projection.rb +3 -3
  1305. data/lib/hecks/{cli → tools}/follow.rb +4 -4
  1306. data/lib/hecks/tools/fuzz_sweep/findings.rb +18 -2
  1307. data/lib/hecks/tools/fuzz_sweep/options.rb +45 -6
  1308. data/lib/hecks/tools/fuzz_sweep/pool.rb +12 -1
  1309. data/lib/hecks/tools/fuzz_sweep/shards.rb +155 -0
  1310. data/lib/hecks/tools/fuzz_sweep.rb +28 -10
  1311. data/lib/hecks/tools/gate.rb +65 -34
  1312. data/lib/hecks/tools/gate_memo/local_files.rb +33 -0
  1313. data/lib/hecks/tools/gate_memo/rehearsal.rb +54 -0
  1314. data/lib/hecks/tools/gate_memo/ruby_files.rb +152 -0
  1315. data/lib/hecks/tools/gate_memo/session.rb +114 -0
  1316. data/lib/hecks/tools/gate_memo/standalone.rb +67 -0
  1317. data/lib/hecks/tools/gate_memo.rb +196 -0
  1318. data/lib/hecks/tools/gate_report.rb +56 -0
  1319. data/lib/hecks/{cli → tools}/history.rb +5 -2
  1320. data/lib/hecks/tools/hoist_local_givens/rewriting.rb +3 -2
  1321. data/lib/hecks/tools/hoist_local_givens.rb +2 -4
  1322. data/lib/hecks/{cli → tools}/interview_agent.rb +1 -1
  1323. data/lib/hecks/{cli → tools}/interview_aggregate.rb +1 -1
  1324. data/lib/hecks/{cli → tools}/interview_draft.rb +9 -2
  1325. data/lib/hecks/{cli → tools}/interview_record.rb +8 -4
  1326. data/lib/hecks/{cli → tools}/interview_run.rb +9 -7
  1327. data/lib/hecks/{cli → tools}/interview_session/agent_state.rb +1 -1
  1328. data/lib/hecks/{cli → tools}/interview_session/catalog.rb +1 -1
  1329. data/lib/hecks/{cli → tools}/interview_session/manual_findings.rb +1 -1
  1330. data/lib/hecks/{cli → tools}/interview_session/proposals.rb +6 -3
  1331. data/lib/hecks/{cli → tools}/interview_session.rb +5 -4
  1332. data/lib/hecks/tools/interview_shape/lifecycle.rb +92 -0
  1333. data/lib/hecks/{cli → tools}/interview_shape.rb +20 -74
  1334. data/lib/hecks/{cli → tools}/ir.rb +1 -1
  1335. data/lib/hecks/tools/lanes/files.rb +1 -1
  1336. data/lib/hecks/tools/lanes/prebuilt_workflow.rb +1 -1
  1337. data/lib/hecks/tools/lanes/rows.rb +9 -3
  1338. data/lib/hecks/tools/lanes/ruleset.rb +1 -1
  1339. data/lib/hecks/tools/lanes/watch_workflow.rb +7 -9
  1340. data/lib/hecks/tools/lanes/workflow.rb +2 -2
  1341. data/lib/hecks/tools/lanes.rb +2 -2
  1342. data/lib/hecks/{cli → tools}/mcp.rb +1 -1
  1343. data/lib/hecks/tools/model_check/examination.rb +142 -0
  1344. data/lib/hecks/{cli → tools}/model_check/sources.rb +5 -3
  1345. data/lib/hecks/{cli → tools}/model_check.rb +2 -2
  1346. data/lib/hecks/tools/move_disables/reasons.rb +35 -0
  1347. data/lib/hecks/tools/move_disables.rb +211 -0
  1348. data/lib/hecks/tools/move_former_name.rb +105 -0
  1349. data/lib/hecks/tools/oidc_manifests.rb +16 -19
  1350. data/lib/hecks/{cli → tools}/pattern_cases.rb +1 -1
  1351. data/lib/hecks/tools/persistence_notice.rb +45 -0
  1352. data/lib/hecks/{cli → tools}/present.rb +2 -2
  1353. data/lib/hecks/{cli → tools}/project_cli/launcher_source.rb +39 -27
  1354. data/lib/hecks/{cli → tools}/project_cli/templates.rb +42 -14
  1355. data/lib/hecks/{cli → tools}/project_cli.rb +22 -20
  1356. data/lib/hecks/tools/project_diagrams.rb +59 -0
  1357. data/lib/hecks/{cli → tools}/project_glossary.rb +16 -16
  1358. data/lib/hecks/{cli → tools}/reference.rb +3 -3
  1359. data/lib/hecks/{cli → tools}/refresh_projections.rb +17 -12
  1360. data/lib/hecks/{cli → tools}/refresh_rspec_runtime_baseline.rb +1 -1
  1361. data/lib/hecks/tools/regeneration_run/pool.rb +148 -0
  1362. data/lib/hecks/tools/regeneration_run/scratch.rb +76 -0
  1363. data/lib/hecks/tools/regeneration_run.rb +134 -107
  1364. data/lib/hecks/{cli → tools}/release.rb +1 -1
  1365. data/lib/hecks/{cli → tools}/release_gem.rb +1 -1
  1366. data/lib/hecks/tools/release_only.rb +5 -2
  1367. data/lib/hecks/{cli → tools}/rspec_io_parallel_files.rb +1 -1
  1368. data/lib/hecks/{cli → tools}/rspec_shard_files.rb +1 -1
  1369. data/lib/hecks/{cli → tools}/run.rb +36 -7
  1370. data/lib/hecks/{cli → tools}/run_expectations.rb +1 -1
  1371. data/lib/hecks/tools/rust_comment_style/caps_words.rb +5 -5
  1372. data/lib/hecks/tools/rust_comment_style/fixing.rb +1 -1
  1373. data/lib/hecks/tools/rust_comment_style/masking.rb +7 -4
  1374. data/lib/hecks/tools/rust_comment_style/source_file.rb +7 -2
  1375. data/lib/hecks/tools/rust_comment_style/text_checks.rb +1 -1
  1376. data/lib/hecks/tools/rust_comment_style/tokenizer.rb +4 -1
  1377. data/lib/hecks/{cli → tools}/seed_semantics_corpus.rb +18 -8
  1378. data/lib/hecks/{cli → tools}/serve_query_ir_mcp.rb +1 -1
  1379. data/lib/hecks/{cli → tools}/shape.rb +6 -6
  1380. data/lib/hecks/tools/site_routes/editor_files.rb +16 -13
  1381. data/lib/hecks/tools/site_routes/root_files.rb +14 -13
  1382. data/lib/hecks/tools/site_routes/templates.rb +5 -4
  1383. data/lib/hecks/tools/site_routes.rb +18 -15
  1384. data/lib/hecks/{cli → tools}/smoke_http/checks.rb +1 -1
  1385. data/lib/hecks/{cli → tools}/smoke_http/settings.rb +1 -1
  1386. data/lib/hecks/{cli → tools}/smoke_http/transport.rb +4 -3
  1387. data/lib/hecks/{cli → tools}/smoke_http.rb +1 -1
  1388. data/lib/hecks/{cli → tools}/smoke_test.rb +1 -1
  1389. data/lib/hecks/{cli → tools}/spec_example.rb +1 -1
  1390. data/lib/hecks/tools/stage_progress.rb +54 -0
  1391. data/lib/hecks/{cli → tools}/statements.rb +8 -8
  1392. data/lib/hecks/tools/stores.rb +123 -0
  1393. data/lib/hecks/{cli → tools}/stress_concurrency_specs/reporting.rb +5 -2
  1394. data/lib/hecks/{cli → tools}/stress_concurrency_specs/usage.rb +4 -4
  1395. data/lib/hecks/{cli → tools}/stress_concurrency_specs.rb +3 -3
  1396. data/lib/hecks/tools/tail_merge.rb +3 -3
  1397. data/lib/hecks/tools/tenant_provisioning.rb +29 -6
  1398. data/lib/hecks/tools/tools_doc.rb +22 -20
  1399. data/lib/hecks/tools/translation_audit/domain_loading.rb +3 -3
  1400. data/lib/hecks/tools/translation_audit/edges.rb +21 -16
  1401. data/lib/hecks/tools/translation_audit/verdicts.rb +1 -1
  1402. data/lib/hecks/tools/translation_audit.rb +16 -5
  1403. data/lib/hecks/tools/translation_scaffold/reporting.rb +4 -1
  1404. data/lib/hecks/tools/translation_scaffold.rb +5 -15
  1405. data/lib/hecks/tools.rb +4 -1
  1406. data/lib/hecks/vendoring/git_source.rb +7 -4
  1407. data/lib/hecks/version.rb +1 -1
  1408. data/lib/hecks/vocabulary.rb +147 -10
  1409. data/lib/hecks/workflow_pagination/judge.rb +48 -0
  1410. data/lib/hecks/workflow_pagination/statement.rb +50 -0
  1411. data/lib/hecks/workflow_pagination.rb +58 -0
  1412. data/lib/hecks.rb +39 -18
  1413. data/lib/rubocop/cop/hecks/bare_event_and_query_names.rb +58 -0
  1414. data/lib/rubocop/cop/hecks/correlates_by_aggregate.rb +39 -0
  1415. data/lib/rubocop/cop/hecks/creating_command_sets.rb +75 -0
  1416. data/lib/rubocop/cop/hecks/inline_regexp.rb +29 -0
  1417. data/lib/rubocop/cop/hecks/invariant_expression_language.rb +47 -0
  1418. data/lib/rubocop/cop/hecks/lifecycle_needs_attribute.rb +58 -0
  1419. data/lib/rubocop/cop/hecks/no_id_string_attribute.rb +49 -0
  1420. data/lib/rubocop/cop/hecks/no_transport_in_runtime.rb +78 -0
  1421. data/lib/rubocop/cop/hecks/one_terminal_mark_per_lifecycle.rb +47 -0
  1422. data/lib/rubocop/cop/hecks/rails_model_rules.rb +46 -0
  1423. data/lib/rubocop/cop/hecks/thread_shared_ivar_mutation.rb +1 -1
  1424. data/lib/rubocop/cop/hecks/train_wreck.rb +69 -0
  1425. data/lib/rubocop/cop/hecks/unnamed_pipeline.rb +51 -0
  1426. data/lib/rubocop/cop/hecks/value_object_shorthand.rb +56 -0
  1427. data/prebuilt/13c04bdc5970295b310f0a980d397ba722232c8da99cc1a0cdb383249921e871.marshal +0 -0
  1428. data/prebuilt/e3857b77f47d9ecc1787b2e1f5136364f3cb3444ef4aea5479f3b98167affea2.marshal +0 -0
  1429. data/qa/settings.yml +32 -0
  1430. data/rust/.gitignore +0 -6
  1431. data/rust/Cargo.lock +8 -1
  1432. data/rust/Cargo.toml +8 -8
  1433. data/rust/build/Cargo.toml +1 -1
  1434. data/rust/build/src/binding_pass.rs +68 -19
  1435. data/rust/build/src/cargo_sync.rs +1 -1
  1436. data/rust/build/src/lineage_pass.rs +4 -71
  1437. data/rust/build/src/pipeline.rs +104 -73
  1438. data/rust/build/src/resolve.rs +86 -29
  1439. data/rust/build/src/seams_pass.rs +117 -99
  1440. data/rust/build/src/world_pass.rs +21 -12
  1441. data/rust/codegen/Cargo.toml +1 -1
  1442. data/rust/codegen/src/domain_generator.rs +27 -2
  1443. data/rust/codegen/src/expr_emitter.rs +6 -0
  1444. data/rust/codegen/src/json_codec.rs +230 -33
  1445. data/rust/codegen/src/main.rs +35 -34
  1446. data/rust/codegen/src/manifest.rs +1 -1
  1447. data/rust/codegen/src/naming.rs +5 -5
  1448. data/rust/codegen/src/one_of_references.rs +125 -0
  1449. data/rust/codegen/src/presenters.rs +3 -3
  1450. data/rust/codegen/src/queries.rs +76 -9
  1451. data/rust/codegen/src/reactions.rs +19 -14
  1452. data/rust/codegen/src/read_models.rs +19 -14
  1453. data/rust/codegen/src/registry.rs +110 -20
  1454. data/rust/codegen/src/sidecars.rs +1 -1
  1455. data/rust/expr/Cargo.lock +54 -0
  1456. data/rust/expr/Cargo.toml +52 -0
  1457. data/rust/{src/kernel → expr/src}/attribute_shapes/composite.rs +45 -14
  1458. data/rust/{src/kernel → expr/src}/attribute_shapes/list.rs +1 -1
  1459. data/rust/{src/kernel → expr/src}/attribute_shapes/mod.rs +2 -2
  1460. data/rust/{src/kernel → expr/src}/attribute_shapes/optional.rs +1 -1
  1461. data/rust/{src/kernel → expr/src}/attribute_shapes/scalar.rs +3 -3
  1462. data/rust/{src/kernel → expr/src}/expr.rs +30 -8
  1463. data/rust/{src/kernel → expr/src}/expression_operators/arithmetic.rs +41 -18
  1464. data/rust/{src/kernel → expr/src}/expression_operators/comparison.rs +54 -8
  1465. data/rust/{src/kernel → expr/src}/expression_operators/enumeration.rs +73 -6
  1466. data/rust/{src/kernel → expr/src}/expression_operators/logical.rs +2 -2
  1467. data/rust/expr/src/expression_operators/membership.rs +33 -0
  1468. data/rust/{src/kernel → expr/src}/expression_operators/mod.rs +2 -2
  1469. data/rust/expr/src/expression_operators/pattern_match.rs +179 -0
  1470. data/rust/{src/kernel → expr/src}/expression_operators/positional.rs +8 -6
  1471. data/rust/{src/kernel → expr/src}/expression_operators/presence.rs +7 -6
  1472. data/rust/{src/kernel → expr/src}/expression_operators/sign_test.rs +14 -4
  1473. data/rust/{src/kernel → expr/src}/expression_operators/sized.rs +16 -9
  1474. data/rust/{src/kernel → expr/src}/expression_operators/text.rs +30 -17
  1475. data/rust/{src/kernel → expr/src}/expression_operators/to_string.rs +8 -6
  1476. data/rust/expr/src/lib.rs +17 -0
  1477. data/rust/expr/src/refusal.rs +62 -0
  1478. data/rust/expr/src/rendering.rs +135 -0
  1479. data/rust/{src/kernel → expr/src}/ruby_float.rs +7 -6
  1480. data/rust/host/Cargo.lock +137 -123
  1481. data/rust/host/Cargo.toml +8 -4
  1482. data/rust/host/HECKS_RELEASE +1 -1
  1483. data/rust/host/core/Cargo.toml +64 -0
  1484. data/rust/host/core/clippy.toml +4 -0
  1485. data/rust/host/core/src/arg_limits.rs +48 -0
  1486. data/rust/host/core/src/clock.rs +146 -0
  1487. data/rust/host/core/src/dispatch.rs +920 -0
  1488. data/rust/host/core/src/expr_json.rs +1137 -0
  1489. data/rust/host/{src → core/src}/host.rs +13 -14
  1490. data/rust/host/{src → core/src}/ir.rs +227 -18
  1491. data/rust/host/core/src/journal.rs +126 -0
  1492. data/rust/host/{src → core/src}/lambda_client.rs +27 -96
  1493. data/rust/host/core/src/lib.rs +37 -0
  1494. data/rust/host/{src → core/src}/needs.rs +66 -20
  1495. data/rust/host/core/src/plugins.rs +269 -0
  1496. data/rust/host/core/src/presentation.rs +471 -0
  1497. data/rust/host/{src → core/src}/presentation_write.rs +75 -43
  1498. data/rust/host/{src → core/src}/query_step.rs +54 -16
  1499. data/rust/host/{src → core/src}/reference_validate.rs +6 -6
  1500. data/rust/host/{src → core/src}/storage_shape.rs +2 -2
  1501. data/rust/host/core/src/store/memory.rs +635 -0
  1502. data/rust/host/core/src/store.rs +418 -0
  1503. data/rust/host/{src → core/src}/ui_schema.rs +8 -8
  1504. data/rust/host/core/src/validation.rs +129 -0
  1505. data/rust/host/core/src/wasm_runner.rs +410 -0
  1506. data/rust/host/fuzz/.gitignore +4 -0
  1507. data/rust/host/fuzz/Cargo.lock +4479 -0
  1508. data/rust/host/fuzz/Cargo.toml +42 -0
  1509. data/rust/host/fuzz/README.md +55 -0
  1510. data/rust/host/fuzz/fuzz_targets/postgres_equivalence.rs +24 -0
  1511. data/rust/host/fuzz/src/backend.rs +273 -0
  1512. data/rust/host/fuzz/src/equivalence.rs +195 -0
  1513. data/rust/host/fuzz/src/footprint.rs +182 -0
  1514. data/rust/host/fuzz/src/lib.rs +17 -0
  1515. data/rust/host/fuzz/src/ops.rs +345 -0
  1516. data/rust/host/fuzz/tests/smoke.rs +50 -0
  1517. data/rust/host/src/api.rs +316 -105
  1518. data/rust/host/src/auth/google_signin.rs +183 -0
  1519. data/rust/host/src/auth.rs +527 -370
  1520. data/rust/host/src/aws_lambda_invoker.rs +61 -0
  1521. data/rust/host/src/bin/expr_harness.rs +9 -4
  1522. data/rust/host/src/bin/ledger.rs +84 -0
  1523. data/rust/host/src/bin/lineage_harness.rs +17 -21
  1524. data/rust/host/src/bin/mint_harness.rs +12 -36
  1525. data/rust/host/src/bin/validate_harness.rs +1 -6
  1526. data/rust/host/src/boot.rs +466 -174
  1527. data/rust/host/src/boundary_fuzz/ir.rs +10 -5
  1528. data/rust/host/src/boundary_fuzz/server.rs +6 -5
  1529. data/rust/host/src/checkout.rs +4 -1
  1530. data/rust/host/src/commerce_ir.rs +126 -105
  1531. data/rust/host/src/{dispatch.rs → dispatch_tests.rs} +367 -847
  1532. data/rust/host/src/extension.rs +3 -4
  1533. data/rust/host/src/hecksagon_boundary_tests.rs +149 -0
  1534. data/rust/host/src/ledger.rs +683 -0
  1535. data/rust/host/src/lib.rs +21 -28
  1536. data/rust/host/src/payments/tests.rs +136 -38
  1537. data/rust/host/src/payments.rs +36 -32
  1538. data/rust/host/src/platform_signin/extension.rs +1 -1
  1539. data/rust/host/src/platform_signin/mapping_tests.rs +12 -9
  1540. data/rust/host/src/platform_signin/session.rs +7 -14
  1541. data/rust/host/src/platform_signin/verify.rs +0 -2
  1542. data/rust/host/src/presentation_tests.rs +382 -0
  1543. data/rust/host/src/rate_limit.rs +18 -2
  1544. data/rust/host/src/server.rs +222 -43
  1545. data/rust/host/src/{journal.rs → store/journal_sql.rs} +21 -127
  1546. data/rust/host/src/{mint.rs → store/mint.rs} +52 -18
  1547. data/rust/host/src/store/postgres.rs +493 -0
  1548. data/rust/host/src/store.rs +97 -0
  1549. data/rust/host/src/store_conformance.rs +1265 -0
  1550. data/rust/host/src/web/commerce.rs +10 -18
  1551. data/rust/host/src/web/newsletter/cooldown.rs +107 -22
  1552. data/rust/host/src/web/newsletter/naming.rs +104 -0
  1553. data/rust/host/src/web/newsletter/tests.rs +53 -0
  1554. data/rust/host/src/web/newsletter.rs +73 -50
  1555. data/rust/host/src/web/newsletter_send.rs +12 -13
  1556. data/rust/host/src/web/registration_receipt.rs +2 -2
  1557. data/rust/host/src/web/registrations.rs +754 -375
  1558. data/rust/host/src/web/resend_webhook.rs +3 -3
  1559. data/rust/host/src/web/signin_tests.rs +131 -0
  1560. data/rust/host/src/web.rs +1479 -149
  1561. data/rust/lsp/Cargo.toml +1 -1
  1562. data/rust/lsp/README.md +27 -27
  1563. data/rust/lsp/src/diagnostics.rs +75 -15
  1564. data/rust/lsp/src/main.rs +101 -5
  1565. data/rust/parser/Cargo.toml +1 -1
  1566. data/rust/parser/fuzz/Cargo.toml +2 -2
  1567. data/rust/parser/fuzz/README.md +3 -3
  1568. data/rust/parser/fuzz/fuzz_targets/{chapter.rs → bluebook.rs} +4 -4
  1569. data/rust/parser/fuzz/fuzz_targets/resolve.rs +2 -2
  1570. data/rust/parser/src/build/correlation_keys.rs +125 -0
  1571. data/rust/parser/src/build/mod.rs +1 -0
  1572. data/rust/parser/src/build/named_pattern.rs +22 -0
  1573. data/rust/parser/src/build/references.rs +52 -0
  1574. data/rust/parser/src/diag.rs +22 -1
  1575. data/rust/parser/src/emit.rs +122 -6
  1576. data/rust/parser/src/expr/ast_json.rs +10 -0
  1577. data/rust/parser/src/expr/resolver.rs +49 -9
  1578. data/rust/parser/src/ir.rs +66 -7
  1579. data/rust/parser/src/keywords.rs +704 -419
  1580. data/rust/parser/src/lex.rs +115 -87
  1581. data/rust/parser/src/main.rs +182 -32
  1582. data/rust/parser/src/parse/adapter.rs +28 -0
  1583. data/rust/parser/src/parse/aggregate.rs +64 -35
  1584. data/rust/parser/src/parse/audience.rs +65 -0
  1585. data/rust/parser/src/parse/command.rs +114 -15
  1586. data/rust/parser/src/parse/{chapter.rs → declaration.rs} +182 -54
  1587. data/rust/parser/src/parse/domain_port.rs +66 -9
  1588. data/rust/parser/src/parse/entity.rs +35 -32
  1589. data/rust/parser/src/parse/file.rs +1 -1
  1590. data/rust/parser/src/parse/hecksagon.rs +15 -5
  1591. data/rust/parser/src/parse/mod.rs +85 -2
  1592. data/rust/parser/src/parse/process_manager.rs +18 -11
  1593. data/rust/parser/src/parse/query.rs +13 -3
  1594. data/rust/parser/src/parse/read_model.rs +2 -1
  1595. data/rust/parser/src/parse/world.rs +12 -8
  1596. data/rust/parser/src/phrases.rs +1258 -0
  1597. data/rust/parser/src/render_ruby.rs +549 -0
  1598. data/rust/parser/src/sentence/changes.rs +437 -0
  1599. data/rust/parser/src/sentence/command_step.rs +206 -0
  1600. data/rust/parser/src/sentence/complete.rs +276 -0
  1601. data/rust/parser/src/sentence/entity.rs +41 -0
  1602. data/rust/parser/src/sentence/examples.rs +1012 -0
  1603. data/rust/parser/src/sentence/format.rs +885 -0
  1604. data/rust/parser/src/sentence/lower.rs +1366 -0
  1605. data/rust/parser/src/sentence/mod.rs +444 -0
  1606. data/rust/parser/src/sentence/names.rs +69 -0
  1607. data/rust/parser/src/sentence/options.rs +154 -0
  1608. data/rust/parser/src/sentence/pattern.rs +433 -0
  1609. data/rust/parser/src/sentence/process.rs +200 -0
  1610. data/rust/parser/src/sentence/queries.rs +431 -0
  1611. data/rust/parser/src/sentence/report.rs +283 -0
  1612. data/rust/parser/src/sentence/token.rs +106 -0
  1613. data/rust/parser/src/sentence/values.rs +498 -0
  1614. data/rust/src/exemplar/json.rs +17 -0
  1615. data/rust/src/exemplar/queries.rs +1 -0
  1616. data/rust/src/exemplar/reactions.rs +1 -1
  1617. data/rust/src/exemplar/registry.rs +30 -0
  1618. data/rust/src/kernel/cli.rs +239 -15
  1619. data/rust/src/kernel/collecting.rs +174 -0
  1620. data/rust/src/kernel/dispatch.rs +59 -29
  1621. data/rust/src/kernel/json.rs +62 -0
  1622. data/rust/src/kernel/mod.rs +7 -67
  1623. data/rust/src/kernel/named_query.rs +225 -11
  1624. data/rust/src/kernel/orchestrate.rs +241 -28
  1625. data/rust/src/kernel/orchestrate_guard_tests.rs +15 -12
  1626. data/rust/src/kernel/query_cursor.rs +251 -0
  1627. data/rust/src/kernel/query_ordering.rs +6 -6
  1628. data/rust/src/kernel/read_model.rs +162 -17
  1629. data/rust/src/kernel/repository.rs +107 -17
  1630. data/rust/src/kernel/vocab/mod.rs +4 -0
  1631. data/rust/src/kernel/vocab/reducer.rs +109 -0
  1632. data/rust/src/kernel/vocab/refusal_class.rs +124 -0
  1633. data/rust/src/kernel/vocab/refusal_template.rs +2 -2
  1634. data/rust/src/lib.rs +1 -1
  1635. data/rust/web/Cargo.lock +47 -0
  1636. data/rust/web/Cargo.toml +1 -1
  1637. metadata +689 -161
  1638. data/lib/hecks/chapters.rb +0 -147
  1639. data/lib/hecks/cli/command_table.rb +0 -72
  1640. data/lib/hecks/cli/launcher_words.rb +0 -168
  1641. data/lib/hecks/cli/model_check/examination.rb +0 -93
  1642. data/lib/hecks/cli/project_diagrams.rb +0 -59
  1643. data/lib/hecks/cli/stores.rb +0 -55
  1644. data/lib/hecks/cli.rb +0 -133
  1645. data/lib/hecks/gate/stages.yml +0 -234
  1646. data/lib/hecks/hecks/codebase.bluebook +0 -3241
  1647. data/lib/hecks/hecks/custodian.bluebook +0 -904
  1648. data/lib/hecks/hecks/governance.world +0 -7
  1649. data/lib/hecks/hecks/rehearsal.bluebook +0 -471
  1650. data/lib/hecks/hecks/tooling.bluebook +0 -1238
  1651. data/lib/hecks/ports/persistence/plugins/era/expected_era.rb +0 -137
  1652. data/lib/hecks/ports/persistence/plugins/era/postgres_era/boot.rb +0 -43
  1653. data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage/domain_rename.rb +0 -91
  1654. data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage/era_store.rb +0 -67
  1655. data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage_manager/context.rb +0 -38
  1656. data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage_manager/era_resolver.rb +0 -100
  1657. data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage_manager/minter.rb +0 -102
  1658. data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage_manager/refusals.rb +0 -51
  1659. data/lib/hecks/ports/persistence/postgres_dump/connection.rb +0 -59
  1660. data/lib/hecks/ports/persistence/postgres_dump.rb +0 -100
  1661. data/lib/hecks/projections/deploy/box/templates/tunnel-egress.yaml.tmpl +0 -11
  1662. data/lib/hecks/projector/exporter/capability_values.rb +0 -55
  1663. data/lib/hecks/quality_control/adapters/clearance_recorder.rb +0 -36
  1664. data/lib/hecks/quality_control/adapters/github_ci_webhook.rb +0 -56
  1665. data/lib/hecks/runtime/remote_dispatcher.rb +0 -176
  1666. data/prebuilt/ad68f9e06c8068c2a4176b57abf3083d591d5d8980c2b3e897b97331f965b643.marshal +0 -0
  1667. data/prebuilt/ee22ec8642c4006717ba2b80f46e5efb81de459eef9dfec043e838c0ad4fd720.marshal +0 -0
  1668. data/prebuilt/verdicts-b69f5dcbba79c20daa0493476fa7c317004a30aa2bc3d3dc6a722ea70ae2b43b.json +0 -1
  1669. data/rust/host/src/clock.rs +0 -8
  1670. data/rust/host/src/expr_json.rs +0 -1983
  1671. data/rust/host/src/presentation.rs +0 -842
  1672. data/rust/host/src/wasm_runner.rs +0 -206
  1673. data/rust/src/kernel/expression_operators/membership.rs +0 -20
  1674. data/rust/src/kernel/expression_operators/pattern_match.rs +0 -108
  1675. /data/lib/hecks/{ports/persistence/plugins/era → adapters/driven}/postgres_era/events.rb +0 -0
  1676. /data/lib/hecks/{ports/persistence/plugins/era → adapters/driven}/postgres_era/head_writes.rb +0 -0
  1677. /data/lib/hecks/{ports/persistence/plugins/era → adapters/driven}/postgres_era/lineage/base_sql.rb +0 -0
  1678. /data/lib/hecks/{ports/persistence/plugins/era → adapters/driven}/postgres_era/lineage/field_cache.rb +0 -0
  1679. /data/lib/hecks/{ports/persistence/plugins/era → adapters/driven}/postgres_era/lineage/head_compiler.rb +0 -0
  1680. /data/lib/hecks/{ports/persistence/plugins/era → adapters/driven}/postgres_era/lineage/merge_writes.rb +0 -0
  1681. /data/lib/hecks/{ports/persistence/plugins/era → adapters/driven}/postgres_era/lineage/resumable_backfill.rb +0 -0
  1682. /data/lib/hecks/{ports/persistence/plugins/era → adapters/driven}/postgres_era/lineage/transform_installer.rb +0 -0
  1683. /data/lib/hecks/{ports/persistence/plugins/era → adapters/driven}/postgres_era/lineage/transform_sql.rb +0 -0
  1684. /data/lib/hecks/{ports/persistence/plugins/era → adapters/driven}/postgres_era/sagas.rb +0 -0
  1685. /data/rust/host/{src → core/src}/field_hints.rs +0 -0
  1686. /data/rust/host/{src → core/src}/log.rs +0 -0
  1687. /data/rust/host/{src → core/src}/reference_transform.rs +0 -0
@@ -2,7 +2,7 @@
2
2
  # A bug is logged with the failing test that proves it, or it is not logged.
3
3
 
4
4
  # Tunable dials for the QA loop: values in qa/settings.yml, what each is in the `QaDial` rows of the
5
- # Vocabulary chapter.
5
+ # Vocabulary bluebook.
6
6
  # `require`, not `require_relative`: isolated fuzz boots load a copy of this file from a tmpdir.
7
7
  require "hecks/fuzzing/qa_settings"
8
8
 
@@ -13,7 +13,7 @@ unless defined?(QualityControlDials)
13
13
  settings = Hecks::Fuzzing::QaSettings.load(ENV.fetch("HECKS_QA_SETTINGS_PATH", Hecks::Fuzzing::QaSettings::DEFAULT_PATH))
14
14
 
15
15
  # Each dial of qa/settings.yml as a constant named for it: `PR_CAP_PER_DAY` is `pr_cap_per_day`.
16
- # What each is and takes is declared once, as its `QaDial` row in the Vocabulary chapter.
16
+ # What each is and takes is declared once, as its `QaDial` row in the Vocabulary bluebook.
17
17
  Hecks::Vocabulary.rows("QaDial").each do |dial|
18
18
  const_set(dial.fetch("name").upcase, settings.public_send(dial.fetch("name")))
19
19
  end
@@ -29,10 +29,10 @@ Hecks.bluebook "QualityControl" do
29
29
 
30
30
  core
31
31
 
32
- # The rotation and its lock: `Claim` is a lifecycle edge, so when two agents race for a chapter
32
+ # The rotation and its lock: `Claim` is a lifecycle edge, so when two agents race for a bluebook
33
33
  # one transition wins and the other is refused.
34
34
  aggregate "Target" do
35
- description "A chapter that can be pressure-tested, and whose turn it is — the rotation, and the claim that stops two agents doing the same work twice."
35
+ description "A bluebook that can be pressure-tested, and whose turn it is — the rotation, and the claim that stops two agents doing the same work twice."
36
36
 
37
37
  identified_by :reference
38
38
 
@@ -43,7 +43,7 @@ Hecks.bluebook "QualityControl" do
43
43
  attribute :claimed_at, Instant
44
44
  attribute :window, StaleAfter
45
45
  attribute :last_swept, SweptIn
46
- # Recency-decayed count of how often this chapter was worth sweeping; see `YieldScore`.
46
+ # Recency-decayed count of how often this bluebook was worth sweeping; see `YieldScore`.
47
47
  attribute :yield_score, YieldScore
48
48
  # Consecutive `Release`s that came back clean; `hecks quality_control query sweep.run` reads it to choose sweep depth.
49
49
  # Zero means no streak yet, shared on purpose by a never-swept target and a just-surprised one.
@@ -51,7 +51,7 @@ Hecks.bluebook "QualityControl" do
51
51
  # Comma-joined mode names recorded at release from what the runner inferred. Stored so
52
52
  # `EligibleFor` can answer why a mode never ran; inference at sweep time still decides.
53
53
  attribute :capabilities, Capabilities
54
- attribute :reason, TargetReason
54
+ attribute :reason, TargetReason, optional: true
55
55
 
56
56
  value_object "TargetReference" do
57
57
  attribute :value, String, matches: :present
@@ -111,7 +111,7 @@ Hecks.bluebook "QualityControl" do
111
111
  end
112
112
 
113
113
  # `suspended` is "surprised, waiting for a person": stale-claim arithmetic never reaches it, so
114
- # a chapter with an unresolved surprise is not re-fuzzed until a `Release` puts it back.
114
+ # a bluebook with an unresolved surprise is not re-fuzzed until a `Release` puts it back.
115
115
  lifecycle :status, default: "waiting" do
116
116
  transition "Claim" => "held", from: ["waiting", "held"]
117
117
  transition "Release" => "waiting", from: ["held", "suspended"]
@@ -122,7 +122,7 @@ Hecks.bluebook "QualityControl" do
122
122
 
123
123
  command "Identify" do
124
124
  role "QA engineer"
125
- goal "Write down that a chapter exists which nobody has swept"
125
+ goal "Write down that a bluebook exists which nobody has swept"
126
126
 
127
127
  attribute :reference, TargetReference
128
128
  attribute :path, TargetPath
@@ -136,12 +136,12 @@ Hecks.bluebook "QualityControl" do
136
136
  # read the time.
137
137
  command "Claim" do
138
138
  role "QA engineer"
139
- goal "Take the next chapter in the rotation, or one whose holder has gone quiet"
139
+ goal "Take the next bluebook in the rotation, or one whose holder has gone quiet"
140
140
 
141
141
  # The window lives on the record, not in an argument: a caller-supplied window would let any
142
142
  # agent take a live claim by asking with a window of one second.
143
143
  reference_to Target
144
- attribute :held_by, Engineer
144
+ attribute :held_by, Engineer, sets: true
145
145
  attribute :now, Instant
146
146
  needs :now
147
147
 
@@ -149,7 +149,6 @@ Hecks.bluebook "QualityControl" do
149
149
  status != "held" || claimed_at.value + window.value <= now.value
150
150
  end
151
151
 
152
- sets :held_by
153
152
  sets :claimed_at, to: :now
154
153
 
155
154
  emits "TargetClaimed"
@@ -162,7 +161,7 @@ Hecks.bluebook "QualityControl" do
162
161
 
163
162
  command "Release" do
164
163
  role "QA engineer"
165
- goal "Hand a chapter back to the rotation, stamped with when, what this pass was worth, and how the clean streak moves"
164
+ goal "Hand a bluebook back to the rotation, stamped with when, what this pass was worth, and how the clean streak moves"
166
165
 
167
166
  # `now` is the argument and `last_swept` the field, so the entry point can fill the clock.
168
167
  #
@@ -193,24 +192,22 @@ Hecks.bluebook "QualityControl" do
193
192
  # Dispatched by `SuspendOnSurprise` as `System`; `reason` is the literal that policy supplies.
194
193
  command "Suspend" do
195
194
  role "System"
196
- goal "Take a chapter out of the rotation because a check surprised, until a person releases it"
195
+ goal "Take a bluebook out of the rotation because a check surprised, until a person releases it"
197
196
 
198
197
  reference_to Target
199
- attribute :reason, TargetReason
198
+ attribute :reason, TargetReason, sets: true
200
199
 
201
- sets :reason
202
200
 
203
201
  emits "TargetSuspended"
204
202
  end
205
203
 
206
204
  command "Shelve" do
207
205
  role "QA engineer"
208
- goal "Decide a chapter is not worth the practice's time, and say why"
206
+ goal "Decide a bluebook is not worth the practice's time, and say why"
209
207
 
210
208
  reference_to Target
211
- attribute :reason, TargetReason
209
+ attribute :reason, TargetReason, sets: true
212
210
 
213
- sets :reason
214
211
 
215
212
  emits "TargetShelved"
216
213
  end
@@ -218,28 +215,26 @@ Hecks.bluebook "QualityControl" do
218
215
  # `reason` is required so the record's `reason` reads as the last decision in either direction.
219
216
  command "Restore" do
220
217
  role "QA engineer"
221
- goal "Put a shelved chapter back in the rotation, and say what changed"
218
+ goal "Put a shelved bluebook back in the rotation, and say what changed"
222
219
 
223
220
  reference_to Target
224
- attribute :reason, TargetReason
221
+ attribute :reason, TargetReason, sets: true
225
222
 
226
- sets :reason
227
223
 
228
224
  emits "TargetRestored"
229
225
  end
230
226
 
231
- # Not a lifecycle move, and reachable whatever the chapter's status: a recorded path can go
227
+ # Not a lifecycle move, and reachable whatever the bluebook's status: a recorded path can go
232
228
  # stale (a worktree removed, a project relocated) at any point in the rotation, and fixing it
233
229
  # should not have to wait on whatever status a stale claim or a pending sweep happens to leave
234
- # the chapter in.
230
+ # the bluebook in.
235
231
  command "Relocate" do
236
232
  role "QA engineer"
237
- goal "Correct where a chapter's own domain actually lives, once its recorded path stops resolving"
233
+ goal "Correct where a bluebook's own domain actually lives, once its recorded path stops resolving"
238
234
 
239
235
  reference_to Target
240
- attribute :path, TargetPath
236
+ attribute :path, TargetPath, sets: true
241
237
 
242
- sets :path
243
238
 
244
239
  emits "TargetRelocated"
245
240
  end
@@ -247,13 +242,13 @@ Hecks.bluebook "QualityControl" do
247
242
  # Ordered by `last_swept` alone: `order_by` sorts one stored field, and the yield-weighted
248
243
  # blend needs `now`. `RotationPriority.pick` weights these rows in Ruby.
249
244
  query "Rotation" do
250
- description "Whose turn it is — waiting chapters, least recently swept first. The one reason this aggregate exists. Raw ordering only — see Hecks::Fuzzing::RotationPriority for the yield-weighted pick built on top of these same rows."
245
+ description "Whose turn it is — waiting bluebooks, least recently swept first. The one reason this aggregate exists. Raw ordering only — see Hecks::Fuzzing::RotationPriority for the yield-weighted pick built on top of these same rows."
251
246
  where(status: "waiting")
252
247
  order_by :last_swept
253
248
  end
254
249
 
255
250
  query "Untouched" do
256
- description "Never swept at all — zero is the epoch and means nobody has looked. The gap no count of checks can show you, because an unswept chapter leaves no rows anywhere."
251
+ description "Never swept at all — zero is the epoch and means nobody has looked. The gap no count of checks can show you, because an unswept bluebook leaves no rows anywhere."
257
252
  where(status: "waiting")
258
253
  where(:"last_swept.value" => 0)
259
254
  order_by :reference
@@ -272,14 +267,14 @@ Hecks.bluebook "QualityControl" do
272
267
  end
273
268
 
274
269
  query "Suspended" do
275
- description "Chapters a check surprised, waiting for a person — each with the reason the policy wrote. Nothing automatic touches these; hecks quality_control query sweep.run <target> --release --notes is how one comes back."
270
+ description "Bluebooks a check surprised, waiting for a person — each with the reason the policy wrote. Nothing automatic touches these; hecks quality_control query sweep.run <target> --release --notes is how one comes back."
276
271
  where(status: "suspended")
277
272
  order_by :reference
278
273
  end
279
274
 
280
- # Answers from the ledger which waiting chapters a mode could run against.
275
+ # Answers from the ledger which waiting bluebooks a mode could run against.
281
276
  query "EligibleFor" do
282
- description "Waiting chapters whose recorded capabilities include one mode — e.g. mode=postgres_era for the persistence-parity axis. The ledger's own answer to which chapters a mode can reach; inference at sweep time is still what decides."
277
+ description "Waiting bluebooks whose recorded capabilities include one mode — e.g. mode=postgres_era for the persistence-parity axis. The ledger's own answer to which bluebooks a mode can reach; inference at sweep time is still what decides."
283
278
  attribute :mode, Capability
284
279
  where(:"capabilities.value" => { contains: :mode })
285
280
  where(status: "waiting")
@@ -287,16 +282,16 @@ Hecks.bluebook "QualityControl" do
287
282
  end
288
283
 
289
284
  query "All" do
290
- description "Every chapter ever written down — the inventory a runner walking the repository checks its findings against."
285
+ description "Every bluebook ever written down — the inventory a runner walking the repository checks its findings against."
291
286
  order_by :reference
292
287
  end
293
288
 
294
- # The commands that enrol, generate and judge chapters. TargetTools answers each by running the
289
+ # The commands that enrol, generate and judge bluebooks. TargetTools answers each by running the
295
290
  # script's own command as a child process (lib/hecks/quality_control/adapters/target_tools.rb) and
296
291
  # handing back what it printed; none reads or writes this aggregate's records, so each is a query.
297
292
  # `arguments` is the command's own flags as one string, such as `--domains 3 --rust`.
298
293
  value_object "Words" do
299
- attribute :value, String, pattern: '[^\n\r]'
294
+ attribute :value, String, matches: :single_line
300
295
  end
301
296
 
302
297
  value_object "DomainPath" do
@@ -327,6 +322,12 @@ Hecks.bluebook "QualityControl" do
327
322
  returns Document
328
323
  end
329
324
 
325
+ query "Mutate" do
326
+ description "Mutation-test the Rust kernel: change one operator or return value at a time and run its tests; a mutant no test catches is a finding."
327
+ attribute :arguments, Words, optional: true
328
+ returns Document
329
+ end
330
+
330
331
  query "JudgeNovelty" do
331
332
  description "Whether a new stress domain puts two forms together on one aggregate that no existing target does: the gate before it becomes a target."
332
333
  attribute :domain, DomainPath
@@ -342,7 +343,7 @@ Hecks.bluebook "QualityControl" do
342
343
  end
343
344
 
344
345
  aggregate "Sweep" do
345
- description "One agent's pass over one chapter — every check it made, what each expected, and what actually came back."
346
+ description "One agent's pass over one bluebook — every check it made, what each expected, and what actually came back."
346
347
 
347
348
  reference_to Target
348
349
 
@@ -351,7 +352,7 @@ Hecks.bluebook "QualityControl" do
351
352
  attribute :reference, SweepReference
352
353
  attribute :engineer, Engineer
353
354
  attribute :made, CheckCount
354
- attribute :notes, SweepNotes
355
+ attribute :notes, SweepNotes, optional: true
355
356
  # A counter, not a flag (a sweep can bend several gates) or a list (`where` cannot test
356
357
  # emptiness).
357
358
  attribute :waived, WaiverCount
@@ -446,7 +447,7 @@ Hecks.bluebook "QualityControl" do
446
447
  attribute :observation, Observation, optional: true
447
448
  # Sticky: `outcome` is the current verdict and `Remake` resets it, but `Release`'s
448
449
  # `next_streak` needs "did anything ever surprise this sweep", which a remake must not erase.
449
- # `one_of` rather than a Boolean, which this chapter has no precedent for.
450
+ # `one_of` rather than a Boolean, which this bluebook has no precedent for.
450
451
  attribute :ever_surprised, one_of("no", "yes"), default: { value: "no" }
451
452
 
452
453
  # `surprising` is not `failed`: it covers the crash and the quiet divergence without
@@ -460,12 +461,11 @@ Hecks.bluebook "QualityControl" do
460
461
 
461
462
  command "Held" do
462
463
  role "QA engineer"
463
- goal "Record that the system did what the chapter promised"
464
+ goal "Record that the system did what the bluebook promised"
464
465
 
465
466
  attribute :sequence, CheckSequence
466
- attribute :observation, Observation
467
+ attribute :observation, Observation, sets: true
467
468
 
468
- sets :observation
469
469
 
470
470
  emits "CheckHeld"
471
471
  end
@@ -475,13 +475,12 @@ Hecks.bluebook "QualityControl" do
475
475
  goal "Record that the system did something other than what was written down"
476
476
 
477
477
  attribute :sequence, CheckSequence
478
- attribute :observation, Observation
478
+ attribute :observation, Observation, sets: true
479
479
  # Restated so `CheckSurprised` carries a `Target` id for `SuspendOnSurprise`; see
480
480
  # `TargetRef`. Required: a caller that omits it is refused (`AbsentArgument`) rather than
481
481
  # suspending nothing.
482
482
  attribute :target, TargetRef
483
483
 
484
- sets :observation
485
484
  # A literal, set here and nowhere else; see `ever_surprised`.
486
485
  sets :ever_surprised, to: "yes"
487
486
 
@@ -493,9 +492,8 @@ Hecks.bluebook "QualityControl" do
493
492
  goal "Record a check that ran and settled nothing"
494
493
 
495
494
  attribute :sequence, CheckSequence
496
- attribute :observation, Observation
495
+ attribute :observation, Observation, sets: true
497
496
 
498
- sets :observation
499
497
 
500
498
  emits "CheckUnsettled"
501
499
  end
@@ -535,11 +533,12 @@ Hecks.bluebook "QualityControl" do
535
533
  transition "Waive" => "sweeping", from: "sweeping"
536
534
  transition "Conclude" => "concluded", from: "sweeping"
537
535
  transition "Abandon" => "abandoned", from: "sweeping"
536
+ mark :terminal, "abandoned", "concluded"
538
537
  end
539
538
 
540
539
  command "Open" do
541
540
  role "QA engineer"
542
- goal "Begin a pass over one chapter"
541
+ goal "Begin a pass over one bluebook"
543
542
 
544
543
  reference_to Target
545
544
  attribute :reference, SweepReference
@@ -591,13 +590,12 @@ Hecks.bluebook "QualityControl" do
591
590
  goal "End a pass and say what it taught"
592
591
 
593
592
  reference_to Sweep
594
- attribute :notes, SweepNotes
593
+ attribute :notes, SweepNotes, sets: true
595
594
 
596
595
  # A sweep that checked nothing tested nothing; the `waived` clause makes this a gate, not a
597
596
  # wall.
598
597
  given("a sweep that checked nothing tested nothing") { made.value.positive? || waived.value.positive? }
599
598
 
600
- sets :notes
601
599
 
602
600
  emits "SweepConcluded"
603
601
  end
@@ -633,7 +631,7 @@ Hecks.bluebook "QualityControl" do
633
631
  # report. They log their own checks through the commands above; none of these queries reads this
634
632
  # aggregate's records. `arguments` is the command's own flags as one string, such as `--all`.
635
633
  value_object "Words" do
636
- attribute :value, String, pattern: '[^\n\r]'
634
+ attribute :value, String, matches: :single_line
637
635
  end
638
636
 
639
637
  value_object "DomainPath" do
@@ -729,6 +727,11 @@ Hecks.bluebook "QualityControl" do
729
727
  aggregate "Bug" do
730
728
  description "One thing now known to be wrong, the test that proves it, and how far the fix got."
731
729
 
730
+ acknowledges :key_by_value, "the commit the bug was found at, and a Clearance exists only once CI has run on that commit, so a reference would refuse a commit CI has not seen",
731
+ of: :commit
732
+ acknowledges :orphaned_reference, "a sweep concluding or being abandoned completes the sweep that found the bug and does not end the bug, which stays a true record of what was found",
733
+ of: :Sweep
734
+
732
735
  reference_to Sweep
733
736
 
734
737
  identified_by :reference
@@ -744,12 +747,12 @@ Hecks.bluebook "QualityControl" do
744
747
  attribute :submitter, Submitter
745
748
  attribute :order, BugOrder
746
749
  attribute :tags, list_of(Tag)
747
- attribute :site, BugSite
748
- attribute :cause, BugCause
749
- attribute :commit, CommitRef
750
- attribute :verification, Verification
751
- attribute :reason, BugReason
752
- attribute :next_step, NextStep
750
+ attribute :site, BugSite, optional: true
751
+ attribute :cause, BugCause, optional: true
752
+ attribute :commit, CommitRef, optional: true
753
+ attribute :verification, Verification, optional: true
754
+ attribute :reason, BugReason, optional: true
755
+ attribute :next_step, NextStep, optional: true
753
756
  attribute :waived, WaiverCount
754
757
  # The same signature as `Sweep.waived_by`; absent until a person waives.
755
758
  attribute :waived_by, WaivedBy, optional: true
@@ -763,7 +766,7 @@ Hecks.bluebook "QualityControl" do
763
766
  # demonstration. `no` is the escape hatch for a real but flaky finding (`hecks quality_control bug.log
764
767
  # --reproduced no`).
765
768
  attribute :reproduced, one_of("yes", "no"), default: { value: "yes" }
766
- # Bugs are claimed like chapters so two agents do not fix the same one. A `given` rather than a
769
+ # Bugs are claimed like bluebooks so two agents do not fix the same one. A `given` rather than a
767
770
  # lifecycle edge: holding a bug is orthogonal to how far the fix got.
768
771
  attribute :held_by, Engineer
769
772
  attribute :claimed_at, Instant
@@ -910,6 +913,7 @@ Hecks.bluebook "QualityControl" do
910
913
  transition "Withdraw" => "withdrawn", from: ["logged", "investigating", "paused"]
911
914
  transition "Regress" => "investigating", from: ["fixed", "verified"]
912
915
  transition "Revisit" => "investigating", from: "paused"
916
+ mark :terminal, "withdrawn"
913
917
  end
914
918
 
915
919
  command "Log" do
@@ -943,9 +947,8 @@ Hecks.bluebook "QualityControl" do
943
947
  goal "Say what should be dealt with first"
944
948
 
945
949
  reference_to Bug
946
- attribute :order, BugOrder
950
+ attribute :order, BugOrder, sets: true
947
951
 
948
- sets :order
949
952
 
950
953
  emits "BugRanked"
951
954
  end
@@ -957,9 +960,8 @@ Hecks.bluebook "QualityControl" do
957
960
  goal "Say what kind of thing this bug is, so it can be found with its kind later"
958
961
 
959
962
  reference_to Bug
960
- attribute :tags, list_of(Tag)
963
+ attribute :tags, list_of(Tag), sets: true
961
964
 
962
- sets :tags
963
965
 
964
966
  emits "BugTagged"
965
967
  end
@@ -971,14 +973,13 @@ Hecks.bluebook "QualityControl" do
971
973
  goal "Write down whether this can be fixed on the spot or needs a bigger judgment"
972
974
 
973
975
  reference_to Bug
974
- attribute :disposition, one_of("self_contained", "bigger")
976
+ attribute :disposition, one_of("self_contained", "bigger"), sets: true
975
977
 
976
978
  # The `given` is the fence: an argument named like the record's own `one_of` field coerces
977
979
  # against the wider set, so the narrower inline set did not refuse "undecided". Predicates
978
980
  # read args first.
979
981
  given("a triage decides — self_contained or bigger, never undecided") { disposition.value != "undecided" }
980
982
 
981
- sets :disposition
982
983
 
983
984
  emits "BugTriaged"
984
985
  end
@@ -990,9 +991,8 @@ Hecks.bluebook "QualityControl" do
990
991
  goal "Give a bug a short, memorable slug — at log time or any point after"
991
992
 
992
993
  reference_to Bug
993
- attribute :name, BugName
994
+ attribute :name, BugName, sets: true
994
995
 
995
- sets :name
996
996
 
997
997
  emits "BugNamed"
998
998
  end
@@ -1021,7 +1021,7 @@ Hecks.bluebook "QualityControl" do
1021
1021
 
1022
1022
  # Same reason as `Target.Claim`: the window is on the record, not the claimer's to name.
1023
1023
  reference_to Bug
1024
- attribute :held_by, Engineer
1024
+ attribute :held_by, Engineer, sets: true
1025
1025
  attribute :now, Instant
1026
1026
  needs :now
1027
1027
 
@@ -1029,7 +1029,6 @@ Hecks.bluebook "QualityControl" do
1029
1029
  held_by.value == "nobody" || claimed_at.value + window.value <= now.value
1030
1030
  end
1031
1031
 
1032
- sets :held_by
1033
1032
  sets :claimed_at, to: :now
1034
1033
 
1035
1034
  emits "BugClaimed"
@@ -1040,9 +1039,8 @@ Hecks.bluebook "QualityControl" do
1040
1039
  goal "Put a bug back on the queue without finishing it"
1041
1040
 
1042
1041
  reference_to Bug
1043
- attribute :held_by, Engineer
1042
+ attribute :held_by, Engineer, sets: true
1044
1043
 
1045
- sets :held_by
1046
1044
 
1047
1045
  emits "BugDropped"
1048
1046
  end
@@ -1052,11 +1050,9 @@ Hecks.bluebook "QualityControl" do
1052
1050
  goal "Name the code that is wrong and say why"
1053
1051
 
1054
1052
  reference_to Bug
1055
- attribute :site, BugSite
1056
- attribute :cause, BugCause
1053
+ attribute :site, BugSite, sets: true
1054
+ attribute :cause, BugCause, sets: true
1057
1055
 
1058
- sets :site
1059
- sets :cause
1060
1056
 
1061
1057
  emits "BugInvestigated"
1062
1058
  end
@@ -1070,9 +1066,8 @@ Hecks.bluebook "QualityControl" do
1070
1066
 
1071
1067
  reference_to Bug
1072
1068
  attribute :reference, BugReference
1073
- attribute :commit, CommitRef
1069
+ attribute :commit, CommitRef, sets: true
1074
1070
 
1075
- sets :commit
1076
1071
 
1077
1072
  emits "BugFixed"
1078
1073
  end
@@ -1094,11 +1089,9 @@ Hecks.bluebook "QualityControl" do
1094
1089
  goal "Stop on a bug that is real and too large to fix here — why, and what would move it"
1095
1090
 
1096
1091
  reference_to Bug
1097
- attribute :reason, BugReason
1098
- attribute :next_step, NextStep
1092
+ attribute :reason, BugReason, sets: true
1093
+ attribute :next_step, NextStep, sets: true
1099
1094
 
1100
- sets :reason
1101
- sets :next_step
1102
1095
 
1103
1096
  emits "BugPaused"
1104
1097
  end
@@ -1108,9 +1101,8 @@ Hecks.bluebook "QualityControl" do
1108
1101
  goal "Take back a report whose test turned out to prove something else"
1109
1102
 
1110
1103
  reference_to Bug
1111
- attribute :reason, BugReason
1104
+ attribute :reason, BugReason, sets: true
1112
1105
 
1113
- sets :reason
1114
1106
 
1115
1107
  emits "BugWithdrawn"
1116
1108
  end
@@ -1215,6 +1207,14 @@ Hecks.bluebook "QualityControl" do
1215
1207
  order_by :sequence
1216
1208
  end
1217
1209
 
1210
+ # `hecks quality_control bug.fix_and_land --bug BUG#n` is the script. It is a query because the
1211
+ # records it writes are the Bug commands above, and the branch, commit, landing and push live
1212
+ # outside the ledger. It stops, and writes nothing, on a bug triaged bigger.
1213
+ query "FixAndLand" do
1214
+ description "Takes one self-contained bug through a fix on a fresh branch, the quick gate on that exact commit, a landing on local main and a push through the push train. A bigger bug stops here, untouched."
1215
+ order_by :sequence
1216
+ end
1217
+
1218
1218
  query "All" do
1219
1219
  description "Every bug ever logged — what a runner mints the next reference from."
1220
1220
  order_by :sequence
@@ -1233,8 +1233,8 @@ Hecks.bluebook "QualityControl" do
1233
1233
  attribute :citation, AngleCitation
1234
1234
  attribute :proposer, Proposer
1235
1235
  attribute :proposed_at, Instant
1236
- attribute :resolution, AngleResolution
1237
- attribute :reason, AngleReason
1236
+ attribute :resolution, AngleResolution, optional: true
1237
+ attribute :reason, AngleReason, optional: true
1238
1238
 
1239
1239
  value_object "AngleReference" do
1240
1240
  attribute :value, String, matches: :present
@@ -1285,6 +1285,7 @@ Hecks.bluebook "QualityControl" do
1285
1285
  transition "Investigate" => "investigating", from: "proposed"
1286
1286
  transition "Build" => "built", from: "investigating"
1287
1287
  transition "Discard" => "discarded", from: ["proposed", "investigating"]
1288
+ mark :terminal, "built", "discarded"
1288
1289
  end
1289
1290
 
1290
1291
  command "Propose" do
@@ -1317,9 +1318,8 @@ Hecks.bluebook "QualityControl" do
1317
1318
  goal "Say what actually came of chasing this lead"
1318
1319
 
1319
1320
  reference_to Angle
1320
- attribute :resolution, AngleResolution
1321
+ attribute :resolution, AngleResolution, sets: true
1321
1322
 
1322
- sets :resolution
1323
1323
 
1324
1324
  emits "AngleBuilt"
1325
1325
  end
@@ -1329,9 +1329,8 @@ Hecks.bluebook "QualityControl" do
1329
1329
  goal "Decide a lead is not worth the practice's time, and say why"
1330
1330
 
1331
1331
  reference_to Angle
1332
- attribute :reason, AngleReason
1332
+ attribute :reason, AngleReason, sets: true
1333
1333
 
1334
- sets :reason
1335
1334
 
1336
1335
  emits "AngleDiscarded"
1337
1336
  end
@@ -1383,6 +1382,9 @@ Hecks.bluebook "QualityControl" do
1383
1382
  aggregate "Ticket" do
1384
1383
  description "One issue raised in a tracker outside this repository — what it says, whether the tracker took it, and how many times we have asked."
1385
1384
 
1385
+ acknowledges :orphaned_reference, "a Ticket is an issue in an outside tracker, written from what the tracker reports; closing it when its bug is withdrawn would record a close that did not happen there",
1386
+ of: :Bug
1387
+
1386
1388
  reference_to Bug
1387
1389
 
1388
1390
  identified_by :reference
@@ -1464,6 +1466,7 @@ Hecks.bluebook "QualityControl" do
1464
1466
  transition "Retry" => "submitting", from: "refused"
1465
1467
  transition "Abandon" => "abandoned", from: ["raised", "submitting", "refused"]
1466
1468
  transition "Close" => "closed", from: "filed"
1469
+ mark :terminal, "abandoned", "closed"
1467
1470
  end
1468
1471
 
1469
1472
  # The port is declared in `quality_control.ports.hecksagon`, where wiring lives.
@@ -1499,11 +1502,9 @@ Hecks.bluebook "QualityControl" do
1499
1502
  goal "Record that the tracker took it, and where it landed"
1500
1503
 
1501
1504
  reference_to Ticket
1502
- attribute :number, IssueNumber
1503
- attribute :url, IssueUrl
1505
+ attribute :number, IssueNumber, sets: true
1506
+ attribute :url, IssueUrl, sets: true
1504
1507
 
1505
- sets :number
1506
- sets :url
1507
1508
 
1508
1509
  emits "TicketFiled"
1509
1510
  end
@@ -1513,9 +1514,8 @@ Hecks.bluebook "QualityControl" do
1513
1514
  goal "Record that the tracker would not take it, and what it said"
1514
1515
 
1515
1516
  reference_to Ticket
1516
- attribute :refusal, RefusalText
1517
+ attribute :refusal, RefusalText, sets: true
1517
1518
 
1518
- sets :refusal
1519
1519
  sets :attempts, increment: { value: 1 }
1520
1520
 
1521
1521
  emits "TicketFilingRefused"
@@ -1523,17 +1523,16 @@ Hecks.bluebook "QualityControl" do
1523
1523
 
1524
1524
  # A policy re-enters its target with the event payload verbatim, so `Retry` must accept
1525
1525
  # `refusal` or be refused outright. It is set rather than dropped: an argument taken and
1526
- # ignored is exactly what this chapter hunts.
1526
+ # ignored is exactly what this bluebook hunts.
1527
1527
  command "Retry" do
1528
1528
  role "System"
1529
1529
  goal "Ask again, up to the limit, carrying what was refused"
1530
1530
 
1531
1531
  reference_to Ticket
1532
- attribute :refusal, RefusalText
1532
+ attribute :refusal, RefusalText, sets: true
1533
1533
 
1534
1534
  given("a retry is still allowed") { attempts.value < max_attempts.value }
1535
1535
 
1536
- sets :refusal
1537
1536
 
1538
1537
  emits "TicketRetried"
1539
1538
  end
@@ -1624,6 +1623,11 @@ Hecks.bluebook "QualityControl" do
1624
1623
  aggregate "Patch" do
1625
1624
  description "One pull request opened for a Bug's own fix — number, branch, and the exact commit that makes checking its CI status a lookup instead of a guess."
1626
1625
 
1626
+ acknowledges :key_by_value, "the commit the pull request was opened at, and a Clearance exists only once CI has run on that commit, so a reference would refuse a commit CI has not seen",
1627
+ of: :commit
1628
+ acknowledges :orphaned_reference, "a Patch is a pull request, written from what GitHub reports; closing it when its bug is withdrawn would record a close that did not happen on GitHub",
1629
+ of: :Bug
1630
+
1627
1631
  reference_to Bug
1628
1632
 
1629
1633
  identified_by :number
@@ -1675,6 +1679,7 @@ Hecks.bluebook "QualityControl" do
1675
1679
  lifecycle :status, default: "opened" do
1676
1680
  transition "Merge" => "merged", from: "opened"
1677
1681
  transition "Close" => "closed", from: "opened"
1682
+ mark :terminal, "closed", "merged"
1678
1683
  end
1679
1684
 
1680
1685
  # Dispatched only by `hecks quality_control patch.open --bug`, which reads the facts back from `gh pr view`, so
@@ -1773,10 +1778,9 @@ Hecks.bluebook "QualityControl" do
1773
1778
  role "QA engineer"
1774
1779
  goal "Open the day the clock reads, with no slot taken yet"
1775
1780
 
1776
- attribute :today, Day
1781
+ attribute :today, Day, sets: true
1777
1782
  needs :today
1778
1783
 
1779
- sets :today
1780
1784
 
1781
1785
  emits "QuotaOpened"
1782
1786
  end
@@ -1815,6 +1819,11 @@ Hecks.bluebook "QualityControl" do
1815
1819
  aggregate "Improvement" do
1816
1820
  description "One pull request landed for deliberate, non-bugfix work — a domain-modeling addition, a tool, an aggregate this very practice needed — number, branch, and the exact commit that makes watching its CI a lookup instead of a guess, the same discipline `Patch` already keeps for a bug's own fix."
1817
1821
 
1822
+ acknowledges :key_by_value, "the commit the work landed at, and a Clearance exists only once CI has run on that commit, so a reference would refuse a commit CI has not seen",
1823
+ of: :commit
1824
+ acknowledges :orphaned_reference, "an angle being built or discarded completes the lead and does not end the improvement, which stays a true record of what landed",
1825
+ of: :Angle
1826
+
1818
1827
  # Optional, set only at `Open`: not all deliberate work began as a cited `Angle`, and forcing
1819
1828
  # one would invent a lead after the fact.
1820
1829
  reference_to Angle, optional: true
@@ -1824,7 +1833,7 @@ Hecks.bluebook "QualityControl" do
1824
1833
  attribute :number, ImprovementNumber
1825
1834
  attribute :url, ImprovementUrl
1826
1835
  attribute :branch, ImprovementBranch
1827
- attribute :commit, CommitRef
1836
+ attribute :commit, CommitRef, optional: true
1828
1837
  attribute :title, ImprovementTitle
1829
1838
  # See `Patch.opened_at`.
1830
1839
  attribute :opened_at, Instant
@@ -1873,6 +1882,7 @@ Hecks.bluebook "QualityControl" do
1873
1882
  transition "Regress" => "needs_fix", from: "landed"
1874
1883
  transition "Merge" => "merged", from: ["opened", "landed", "needs_fix"]
1875
1884
  transition "Close" => "closed", from: ["opened", "landed", "needs_fix"]
1885
+ mark :terminal, "closed", "merged"
1876
1886
  end
1877
1887
 
1878
1888
  # Dispatched by `hecks quality_control patch.open --improvement`, which then dispatches `Land` in the same run so
@@ -1907,9 +1917,8 @@ Hecks.bluebook "QualityControl" do
1907
1917
 
1908
1918
  reference_to Improvement
1909
1919
  attribute :number, ImprovementNumber
1910
- attribute :commit, CommitRef
1920
+ attribute :commit, CommitRef, sets: true
1911
1921
 
1912
- sets :commit
1913
1922
 
1914
1923
  emits "ImprovementLanded"
1915
1924
  end
@@ -1966,6 +1975,822 @@ Hecks.bluebook "QualityControl" do
1966
1975
  end
1967
1976
  end
1968
1977
 
1978
+ # The quick gate run on local main, in a temporary worktree of it. One record per commit checked, so a
1979
+ # tick that finds the same commit again does not log the same red checks twice.
1980
+ aggregate "MainCheck" do
1981
+ description "One run of the quick gate on local main at one commit, and whether every one of its checks came back green."
1982
+
1983
+ identified_by :reference
1984
+
1985
+ attribute :reference, MainCommit
1986
+ attribute :verdict, one_of("green", "red")
1987
+ attribute :red_checks, RedCount
1988
+
1989
+ value_object "MainCommit" do
1990
+ attribute :value, String, matches: :git_sha
1991
+ end
1992
+
1993
+ value_object "RedCount" do
1994
+ attribute :value, Integer, default: 0
1995
+ invariant("a count of red checks is not negative") { !value.negative? }
1996
+ end
1997
+
1998
+ # Written as soon as the gate has answered, before any red check is logged or fixed, so the record
1999
+ # says what the gate said even when what follows fails.
2000
+ command "Record" do
2001
+ role "QA engineer"
2002
+ goal "Write down what the quick gate said about one commit of main"
2003
+
2004
+ attribute :reference, MainCommit
2005
+ attribute :verdict, one_of("green", "red")
2006
+ attribute :red_checks, RedCount
2007
+
2008
+ given("a red verdict names a red check, and a green one names none") do
2009
+ (verdict.value == "red" && red_checks.value.positive?) || (verdict.value == "green" && red_checks.value == 0)
2010
+ end
2011
+
2012
+ emits "MainCheckRecorded"
2013
+ end
2014
+
2015
+ # `hecks quality_control main_check.check_main` is the tick's step. It answers from the record when the
2016
+ # commit has one; otherwise it runs the gate, logs each red check as a bug and fixes the self-contained
2017
+ # ones. It is a query because it reads the commit and runs the gate; every write it makes is a
2018
+ # command of the Bug and Sweep aggregates.
2019
+ query "CheckMain" do
2020
+ description "Runs the quick gate on local main in a temporary worktree of it and records the verdict, logging each red check as a bug."
2021
+ order_by :reference
2022
+ end
2023
+
2024
+ query "All" do
2025
+ description "Every commit of main the quick gate has been run on, with its verdict."
2026
+ order_by :reference
2027
+ end
2028
+ end
2029
+
2030
+ # The event pump: each attached domain's policies read the events past their cursors and react to
2031
+ # them. The pump's own writes are the cursors below; it appends to no domain's event log.
2032
+ aggregate "EventCursor" do
2033
+ description "How far one consumer has read one domain's event log, as the count of entries it has reacted to. One row per (log, consumer)."
2034
+
2035
+ identified_by :key
2036
+
2037
+ attribute :key, CursorKey
2038
+ attribute :log, CursorDomain
2039
+ attribute :consumer, CursorDomain
2040
+ attribute :position, CursorPosition
2041
+ attribute :read_at, CursorReadAt, optional: true
2042
+
2043
+ value_object "CursorKey" do
2044
+ attribute :value, String, matches: :present
2045
+ invariant("a cursor is keyed by its log and consumer") { !value.to_s.empty? }
2046
+ end
2047
+
2048
+ value_object "CursorReadAt" do
2049
+ attribute :value, String, matches: :present
2050
+ end
2051
+
2052
+ value_object "CursorDomain" do
2053
+ attribute :value, String, matches: :present
2054
+ invariant("a cursor names its domain") { !value.to_s.empty? }
2055
+ end
2056
+
2057
+ value_object "CursorPosition" do
2058
+ attribute :value, Integer, default: 0
2059
+ invariant("a position is not negative") { !value.negative? }
2060
+ end
2061
+
2062
+ command "Start" do
2063
+ role "QA engineer"
2064
+ goal "Open a consumer's cursor on one domain's event log, at the start of the log"
2065
+
2066
+ attribute :key, CursorKey
2067
+ attribute :log, CursorDomain
2068
+ attribute :consumer, CursorDomain
2069
+
2070
+ emits "CursorStarted"
2071
+ end
2072
+
2073
+ # The pump passes only the position it has just reacted to, so a cursor moves forward in practice.
2074
+ command "Advance" do
2075
+ role "QA engineer"
2076
+ goal "Move one consumer's cursor past the entries it has reacted to"
2077
+
2078
+ attribute :position, CursorPosition, sets: true
2079
+
2080
+ emits "CursorAdvanced"
2081
+ end
2082
+
2083
+ query "All" do
2084
+ description "Every cursor the event pump holds, with the position each consumer has read to."
2085
+ order_by :key
2086
+ end
2087
+ end
2088
+
2089
+ # One policy's reaction to one event, recorded once the policy's command has answered: delivered or
2090
+ # refused. The pump checks a row before it runs the policy, so a reaction already on the ledger is not
2091
+ # run again, whatever the cursor says. Keyed by (consumer, event, policy), so the event's other policies
2092
+ # for the same consumer still run.
2093
+ aggregate "EventReaction" do
2094
+ description "A policy's reaction to one event, once its command has answered. One row per (consumer, event, policy)."
2095
+
2096
+ identified_by :key
2097
+
2098
+ attribute :key, ReactionKey
2099
+ attribute :consumer, ReactionConsumer
2100
+ attribute :event_id, ReactionEvent
2101
+ attribute :policy, ReactionPolicy
2102
+
2103
+ value_object "ReactionKey" do
2104
+ attribute :value, String, matches: :present
2105
+ invariant("a reaction is keyed by its consumer, event and policy") { !value.to_s.empty? }
2106
+ end
2107
+
2108
+ value_object "ReactionConsumer" do
2109
+ attribute :value, String, matches: :present
2110
+ invariant("a reaction names its consumer") { !value.to_s.empty? }
2111
+ end
2112
+
2113
+ value_object "ReactionEvent" do
2114
+ attribute :value, String, matches: :present
2115
+ invariant("a reaction names the event it answered") { !value.to_s.empty? }
2116
+ end
2117
+
2118
+ value_object "ReactionPolicy" do
2119
+ attribute :value, String, matches: :present
2120
+ invariant("a reaction names its policy") { !value.to_s.empty? }
2121
+ end
2122
+
2123
+ command "Record" do
2124
+ role "QA engineer"
2125
+ goal "Record that one consumer's policy has answered one event, so the pump does not run it again"
2126
+
2127
+ attribute :key, ReactionKey
2128
+ attribute :consumer, ReactionConsumer
2129
+ attribute :event_id, ReactionEvent
2130
+ attribute :policy, ReactionPolicy
2131
+
2132
+ emits "EventReacted"
2133
+ end
2134
+
2135
+ query "All" do
2136
+ description "Every reaction the event pump has recorded, by its key."
2137
+ order_by :key
2138
+ end
2139
+ end
2140
+
2141
+ # One run of the event pump, requested as a command and answered by the `PumpTools` port, which runs
2142
+ # `hecks quality_control qa_event_pump`. The QA tick runs the same pump as its last step.
2143
+ aggregate "EventPump" do
2144
+ description "One run of the event pump: every attached domain's policies reacting to the events past their cursors, and what each reaction answered."
2145
+
2146
+ identified_by :run
2147
+
2148
+ attribute :run, PumpRun
2149
+
2150
+ value_object "PumpRun" do
2151
+ attribute :value, String, matches: :present
2152
+ invariant("a pump run is named") { !value.to_s.empty? }
2153
+ end
2154
+
2155
+ command "Pump" do
2156
+ role "QA engineer"
2157
+ goal "Run the event pump once: each attached domain's policies react to the events past their cursors, and every refusal is named"
2158
+
2159
+ attribute :run, PumpRun
2160
+
2161
+ emits "PumpRequested"
2162
+ end
2163
+ end
2164
+
2165
+ policy "PumpOnRequest" do
2166
+ on "EventPump.PumpRequested"
2167
+ ask :execute, with: { run: :run }
2168
+ end
2169
+
2170
+ # The maintenance of local main as events and policies. A coder's `Submission.WorkSubmitted` starts
2171
+ # a run. Each step's body is an `ask` of a port the `MainMaintenance` adapter answers: the quick gate,
2172
+ # the reconcile, the push through the train. The answer is an event, and a policy turns each event into
2173
+ # the next step. A refusal is a named event, and nothing follows it.
2174
+ aggregate "Maintenance" do
2175
+ description "One run of local main's maintenance: the quick gate on a submitted commit, the reconcile, and the push through the train."
2176
+
2177
+ identified_by :run
2178
+
2179
+ attribute :run, MaintenanceRun
2180
+ attribute :sha, MaintenanceSha
2181
+ # The gate's colour and the reconcile's verdict. A run opened only to mint an era (`MintEra`) never
2182
+ # runs the gate or the reconcile, so its row holds neither.
2183
+ attribute :color, one_of("green", "red"), optional: true
2184
+ attribute :verdict, one_of("reported", "written", "refused"), optional: true
2185
+
2186
+ value_object "MaintenanceRun" do
2187
+ attribute :value, String, matches: :present
2188
+ invariant("a run names its branch") { !value.to_s.empty? }
2189
+ end
2190
+
2191
+ value_object "MaintenanceSha" do
2192
+ attribute :value, String, matches: :git_sha
2193
+ end
2194
+
2195
+ # The era a mint created, as the Minted event carries it.
2196
+ value_object "MintedEra" do
2197
+ attribute :value, Integer
2198
+ end
2199
+
2200
+ # Opens a run for a submitted commit of main; the gate is the first step it asks for.
2201
+ command "Start" do
2202
+ role "QA engineer"
2203
+ goal "Open the maintenance of main for one submitted commit"
2204
+
2205
+ attribute :run, MaintenanceRun
2206
+ attribute :sha, MaintenanceSha
2207
+
2208
+ emits "RunStarted"
2209
+ end
2210
+
2211
+ # Refuses a red gate: the policy that reads `GateVerdict` red calls it, and nothing reconciles or pushes.
2212
+ command "RefuseGate" do
2213
+ role "QA engineer"
2214
+ goal "Stop a run whose quick gate on main is red"
2215
+
2216
+ attribute :run, MaintenanceRun
2217
+ attribute :color, one_of("green", "red")
2218
+
2219
+ given("only a red verdict is refused") { color.value == "red" }
2220
+
2221
+ emits "GateRefused"
2222
+ end
2223
+
2224
+ # Asks for the reconcile once the gate is green.
2225
+ command "RequestReconcile" do
2226
+ role "QA engineer"
2227
+ goal "Ask for the reconcile of a commit whose quick gate is green"
2228
+
2229
+ attribute :run, MaintenanceRun
2230
+ attribute :sha, MaintenanceSha
2231
+ attribute :color, one_of("green", "red")
2232
+
2233
+ given("only a green gate is reconciled") { color.value == "green" }
2234
+
2235
+ emits "ReconcileRequested"
2236
+ end
2237
+
2238
+ # Asks for the push once the reconcile has not refused and the gate is green.
2239
+ command "RequestPush" do
2240
+ role "QA engineer"
2241
+ goal "Ask for the push of a commit whose gate is green and whose reconcile did not refuse"
2242
+
2243
+ attribute :run, MaintenanceRun
2244
+ attribute :sha, MaintenanceSha
2245
+ attribute :color, one_of("green", "red")
2246
+ attribute :verdict, one_of("reported", "written", "refused")
2247
+
2248
+ given("the reconcile did not refuse and the gate is green") do
2249
+ verdict.value != "refused" && color.value == "green"
2250
+ end
2251
+
2252
+ emits "PushRequested"
2253
+ end
2254
+
2255
+ value_object "MintVerdict" do
2256
+ attribute :value, String, one_of: ["would_mint", "would_refuse", "needs_edge", "cannot_boot", "empty_copy"]
2257
+ end
2258
+
2259
+ # Records what the rehearsal of a domain's next era concluded, at the ledger watermark it read. The mint
2260
+ # policy reads the verdict off `MintRequested`, so a mint is only ever asked for a rehearsal that said
2261
+ # would_mint.
2262
+ command "RecordRehearsalVerdict" do
2263
+ role "QA engineer"
2264
+ goal "Record what the rehearsal of a domain's next era concluded, and the watermark it read"
2265
+
2266
+ attribute :run, MaintenanceRun
2267
+ attribute :domain, String
2268
+ attribute :watermark, Integer
2269
+ attribute :rehearsal_verdict, MintVerdict
2270
+
2271
+ emits "RehearsalVerdict"
2272
+ end
2273
+
2274
+ # The confirmation of a mint: the owner's `--confirm` flag, which the launcher reads as a Boolean. A mint
2275
+ # the auto-mint rule covers runs without it; every other mint needs it.
2276
+ value_object "Confirmation" do
2277
+ attribute :value, Boolean
2278
+ end
2279
+
2280
+ # Why a mint was refused, as the refusal the mint entry point names. A held mint says "needs owner
2281
+ # approval", which the approval policy reads.
2282
+ value_object "MintRefusal" do
2283
+ attribute :value, String
2284
+ end
2285
+
2286
+ # The single entry point for a mint of a domain's next era. It is the only command that asks for a mint:
2287
+ # a boot never mints, and the mint names the commit its landing puts on main, so the ledger and main move
2288
+ # together. The rehearsal ref and the expected watermark are checked against the live ledger by the era check.
2289
+ # `refusal_total` is the rehearsal's refusal count and `ledger_dir` the bluebook directory of the ledger
2290
+ # the era belongs to (the QualityControl ledger when omitted). A mint with no `confirm` runs only when
2291
+ # the auto-mint rule (`AutoMintAdditive`) holds; the mint entry point checks it.
2292
+ command "MintEra" do
2293
+ role "QA engineer"
2294
+ goal "Mint a domain's next era, against the rehearsal of that same era and the watermark it read"
2295
+ attribute :run, MaintenanceRun
2296
+ attribute :domain, String
2297
+ attribute :era, Integer
2298
+ attribute :sha, MaintenanceSha
2299
+ attribute :branch, String
2300
+ attribute :rehearsal_ref, String
2301
+ attribute :watermark, Integer
2302
+ attribute :rehearsal_verdict, MintVerdict
2303
+ attribute :refusal_total, Integer, optional: true
2304
+ attribute :ledger_dir, String, optional: true
2305
+ attribute :confirm, Confirmation, optional: true
2306
+
2307
+ emits "MintRequested"
2308
+ end
2309
+
2310
+ # Refuses a mint whose rehearsal did not say would_mint, and nothing mints or lands after it. It also
2311
+ # carries the refusal the mint entry point named when it held a mint for the owner.
2312
+ command "RefuseMint" do
2313
+ role "QA engineer"
2314
+ goal "Stop a mint whose rehearsal did not say would_mint"
2315
+
2316
+ attribute :run, MaintenanceRun
2317
+ attribute :domain, String
2318
+ attribute :era, Integer
2319
+ attribute :rehearsal_verdict, MintVerdict
2320
+ attribute :refusal, MintRefusal, optional: true
2321
+
2322
+ given("only a rehearsal that did not say would_mint is refused") { rehearsal_verdict.value != "would_mint" }
2323
+
2324
+ emits "MintRefused"
2325
+ end
2326
+ end
2327
+
2328
+ # One release PR: the bump of the version on main, opened as a PR and approved on GitHub by the owner. The
2329
+ # approval is written as the release trailer on the merge, which is the line `Hecks::Release::Approval`
2330
+ # reads. A PR is approved only when every auto-approval condition holds (see ReleaseCondition); a failed
2331
+ # condition is a named refusal and nothing is approved.
2332
+ aggregate "ReleasePR" do
2333
+ description "One release PR: the version bump opened on GitHub, approved by the owner only when every auto-approval condition holds."
2334
+
2335
+ identified_by :release
2336
+
2337
+ attribute :release, ReleaseVersion
2338
+ attribute :branch, ReleaseBranch
2339
+ attribute :sha, MaintenanceSha
2340
+ attribute :verdict, one_of("open", "approved", "refused")
2341
+
2342
+ value_object "ReleaseBranch" do
2343
+ attribute :value, String, matches: :present
2344
+ end
2345
+
2346
+ value_object "ReleaseVersion" do
2347
+ attribute :value, String
2348
+ invariant("a release names a semantic version") { value.to_s.match?(/\A[0-9]+\.[0-9]+\.[0-9]+\z/) }
2349
+ end
2350
+
2351
+ # The four conditions an approval needs, each named so a refusal says which one failed. `met` is the only
2352
+ # value an approval accepts; the Ruby judge (`Hecks::Release::Conditions.judge`) answers the first failure
2353
+ # in this order: the commit is on stable's head, the required checks passed on it, the CHANGELOG has a
2354
+ # dated `## [<version>]` heading, and every version file names the same version.
2355
+ value_object "ReleaseCondition" do
2356
+ attribute :value, String, one_of: ["met", "not_on_stable_head", "checks_not_green",
2357
+ "changelog_undated", "version_mismatch"]
2358
+ end
2359
+
2360
+ # The owner who approves each release PR. The trailer line names this person; no other name is approved.
2361
+ value_object "ReleaseApprover" do
2362
+ attribute :value, String, one_of: ["Chris Young"]
2363
+ end
2364
+
2365
+ # The commit-message trailer an approval writes. It is the `release_trailer` of the stable `Lane` row
2366
+ # (Vocabulary), which `Hecks::Release::Approval` reads, so the check accepts what the policy writes.
2367
+ value_object "ReleaseTrailer" do
2368
+ attribute :value, String, one_of: ["Release-Approved-By"]
2369
+ end
2370
+
2371
+ # Opens the release PR for a version bump on a branch. The open is answered by the `ReleaseGh` port.
2372
+ command "Open" do
2373
+ role "Release owner"
2374
+ goal "Open the release PR for a version bump on main, so the owner can approve it on GitHub"
2375
+
2376
+ attribute :release, ReleaseVersion
2377
+ attribute :branch, ReleaseBranch
2378
+ attribute :sha, MaintenanceSha
2379
+
2380
+ emits "ReleaseOpenRequested"
2381
+ end
2382
+
2383
+ # Records the result of the four auto-approval conditions for one release PR. The caller names the approver
2384
+ # and the trailer, which the approval policy passes on to the approval.
2385
+ command "Check" do
2386
+ role "Release owner"
2387
+ goal "Record which auto-approval condition held for a release PR, naming the first one that failed"
2388
+
2389
+ attribute :release, ReleaseVersion
2390
+ attribute :sha, MaintenanceSha
2391
+ attribute :condition, ReleaseCondition
2392
+ attribute :approver, ReleaseApprover
2393
+ attribute :trailer, ReleaseTrailer
2394
+
2395
+ emits "ReleaseChecked"
2396
+ end
2397
+
2398
+ # Approves a release PR whose conditions all held. Only a condition of `met` is approved; the trailer
2399
+ # is then written on the merge by the `ReleaseGh` port.
2400
+ command "Approve" do
2401
+ role "Release owner"
2402
+ goal "Approve a release PR once every auto-approval condition holds, writing the release trailer for the owner"
2403
+
2404
+ attribute :release, ReleaseVersion
2405
+ attribute :sha, MaintenanceSha
2406
+ attribute :condition, ReleaseCondition
2407
+ attribute :approver, ReleaseApprover
2408
+ attribute :trailer, ReleaseTrailer
2409
+
2410
+ given("only a release whose conditions all held is approved") { condition.value == "met" }
2411
+
2412
+ emits "ReleaseApproved"
2413
+ end
2414
+
2415
+ # Refuses a release PR one of whose conditions failed, and names that condition.
2416
+ command "Refuse" do
2417
+ role "Release owner"
2418
+ goal "Refuse a release PR, naming the auto-approval condition that failed"
2419
+
2420
+ attribute :release, ReleaseVersion
2421
+ attribute :condition, ReleaseCondition
2422
+
2423
+ given("only a release with a failed condition is refused") { condition.value != "met" }
2424
+
2425
+ emits "ReleaseRefused"
2426
+ end
2427
+ end
2428
+
2429
+ # What remote CI said about one commit of a repository's main, once every job it ran for that
2430
+ # commit
2431
+ # settled. The Runner adapter answers `Check`; a green verdict is announced as `CiGreen`, and a
2432
+ # red one
2433
+ # as `CiRed` with the failing jobs. Lives here, beside the roll it feeds: a policy reads only
2434
+ # events
2435
+ # its own bluebook emits.
2436
+ aggregate "Head" do
2437
+ description "One commit of a repository's main, and whether remote CI passed every job it ran for that commit."
2438
+
2439
+ identified_by :commit
2440
+
2441
+ attribute :commit, HeadCommit
2442
+ attribute :branch, HeadBranch
2443
+ attribute :repo, HeadRepo
2444
+ attribute :color, one_of("green", "red")
2445
+ attribute :failing_jobs, FailingJobs
2446
+
2447
+ value_object "HeadCommit" do
2448
+ attribute :value, String, pattern: '^[0-9a-f]{40}$'
2449
+ end
2450
+
2451
+ value_object "HeadBranch" do
2452
+ attribute :value, String, matches: :present
2453
+ invariant("a head names its branch") { !value.to_s.empty? }
2454
+ end
2455
+
2456
+ value_object "HeadRepo" do
2457
+ # GitHub's `owner/name`.
2458
+ attribute :value, String, pattern: '^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$'
2459
+ end
2460
+
2461
+ # The failing jobs of a red run, comma-separated; empty for a green one.
2462
+ value_object "FailingJobs" do
2463
+ attribute :value, String, default: ""
2464
+ end
2465
+
2466
+ # Asks remote CI about one commit. Only main is judged: a commit on a branch says nothing about
2467
+ # main.
2468
+ command "Request" do
2469
+ role "CI engineer"
2470
+ goal "Ask remote CI what it said about one commit of a repository's main"
2471
+
2472
+ attribute :commit, HeadCommit
2473
+ attribute :branch, HeadBranch
2474
+ attribute :repo, HeadRepo
2475
+
2476
+ given("only main is judged") { branch.value == "main" }
2477
+
2478
+ emits "HeadRequested"
2479
+ end
2480
+
2481
+ # Records a green verdict. Refused for any other colour: a red head is never announced as
2482
+ # green.
2483
+ command "Green" do
2484
+ role "System"
2485
+ goal "Announce that remote CI passed every job it ran for one commit of main"
2486
+
2487
+ attribute :commit, HeadCommit
2488
+ attribute :branch, HeadBranch
2489
+ attribute :repo, HeadRepo
2490
+ attribute :color, one_of("green", "red")
2491
+
2492
+ given("only a green verdict is announced") { color.value == "green" }
2493
+
2494
+ emits "CiGreen"
2495
+ end
2496
+
2497
+ # Records a red verdict, naming the jobs that failed. Refused for any other colour.
2498
+ command "Red" do
2499
+ role "System"
2500
+ goal "Announce that remote CI refused one commit of main, and which jobs failed"
2501
+
2502
+ attribute :commit, HeadCommit
2503
+ attribute :repo, HeadRepo
2504
+ attribute :color, one_of("green", "red")
2505
+ attribute :failing_jobs, FailingJobs
2506
+
2507
+ given("only a red verdict names the jobs that failed") do
2508
+ color.value == "red" && !failing_jobs.value.to_s.empty?
2509
+ end
2510
+
2511
+ emits "CiRed"
2512
+ end
2513
+ end
2514
+
2515
+ # One spec file that is red on main, keyed `red-<spec path slug>`. A red run reports each failing
2516
+ # spec file; the first report opens the row and a later one only updates what it knew, so a spec
2517
+ # red for days is one row, and `since` is the day it first went red. A settled run that no longer
2518
+ # fails the file clears it. Tickets mirrors it as a Work row for QA (`PlanWorkWhenSpecWentRed`, `FinishWorkWhenSpecWentGreen`).
2519
+ aggregate "RedSpec" do
2520
+ description "One spec file that is red on main: how many examples fail, the first failure, the run that saw it last, and the day it first went red."
2521
+
2522
+ identified_by :spec
2523
+
2524
+ attribute :spec, SpecKey
2525
+ attribute :path, SpecPath
2526
+ attribute :failures, FailureCount
2527
+ attribute :first_failure, FailureLine, optional: true
2528
+ attribute :examples, FailureLine, optional: true
2529
+ attribute :last_run, RunId
2530
+ attribute :commit, SpecCommit
2531
+ attribute :since, SeenOn
2532
+ attribute :title, WorkLine
2533
+ attribute :detail, WorkLine
2534
+ attribute :cleared_by, RunId, optional: true
2535
+
2536
+ value_object "SpecKey" do
2537
+ attribute :value, String, pattern: '^red-[a-z0-9_-]+$'
2538
+ end
2539
+
2540
+ value_object "SpecPath" do
2541
+ attribute :value, String, matches: :present
2542
+ end
2543
+
2544
+ value_object "FailureCount" do
2545
+ attribute :value, Integer
2546
+ invariant("a red spec has failing examples") { value.positive? }
2547
+ end
2548
+
2549
+ # Text as the failing run printed it, shortened by the reader.
2550
+ value_object "FailureLine" do
2551
+ attribute :value, String, default: ""
2552
+ end
2553
+
2554
+ # A line of the Work row the spec mirrors into.
2555
+ value_object "WorkLine" do
2556
+ attribute :value, String, matches: :present
2557
+ end
2558
+
2559
+ value_object "RunId" do
2560
+ attribute :value, String, matches: :present
2561
+ end
2562
+
2563
+ value_object "SpecCommit" do
2564
+ attribute :value, String, matches: :present
2565
+ end
2566
+
2567
+ # An ISO 8601 date, read from the clock by the run reader, never by the bluebook.
2568
+ value_object "SeenOn" do
2569
+ attribute :value, String, matches: :present
2570
+ end
2571
+
2572
+ # A cleared file that fails again goes back to red: the row reopens, it is never filed twice.
2573
+ lifecycle :status, default: "red" do
2574
+ mark :failure, "red"
2575
+ transition "Clear" => "green", from: "red"
2576
+ transition "Reopen" => "red", from: "green"
2577
+ end
2578
+
2579
+ # Opens the row for a spec file. A spec already red is not reported twice: see `Update`.
2580
+ command "Open" do
2581
+ role "System"
2582
+ goal "Record that a spec file is red on main"
2583
+
2584
+ attribute :spec, SpecKey, sets: true
2585
+ attribute :path, SpecPath, sets: true
2586
+ attribute :failures, FailureCount, sets: true
2587
+ attribute :first_failure, FailureLine, optional: true, sets: true
2588
+ attribute :examples, FailureLine, optional: true, sets: true
2589
+ attribute :last_run, RunId, sets: true
2590
+ attribute :commit, SpecCommit, sets: true
2591
+ attribute :since, SeenOn, sets: true
2592
+ attribute :title, WorkLine, sets: true
2593
+ attribute :detail, WorkLine, sets: true
2594
+
2595
+ emits "SpecWentRed"
2596
+ end
2597
+
2598
+ # A spec still red in a later run: what the latest run saw replaces what the row knew; `since` stays.
2599
+ command "Update" do
2600
+ role "System"
2601
+ goal "Record what a later red run saw of a spec file that was already red"
2602
+
2603
+ reference_to RedSpec
2604
+ attribute :failures, FailureCount, sets: true
2605
+ attribute :first_failure, FailureLine, optional: true, sets: true
2606
+ attribute :examples, FailureLine, optional: true, sets: true
2607
+ attribute :last_run, RunId, sets: true
2608
+ attribute :commit, SpecCommit, sets: true
2609
+ attribute :detail, WorkLine, sets: true
2610
+
2611
+ emits "SpecStillRed"
2612
+ end
2613
+
2614
+ # A spec that was cleared and failed again: what the new red run saw replaces what the row knew,
2615
+ # and `since` is the day it went red this time.
2616
+ command "Reopen" do
2617
+ role "System"
2618
+ goal "Record that a spec file cleared earlier is red on main again"
2619
+
2620
+ reference_to RedSpec
2621
+ attribute :failures, FailureCount, sets: true
2622
+ attribute :first_failure, FailureLine, optional: true, sets: true
2623
+ attribute :examples, FailureLine, optional: true, sets: true
2624
+ attribute :last_run, RunId, sets: true
2625
+ attribute :commit, SpecCommit, sets: true
2626
+ attribute :since, SeenOn, sets: true
2627
+ attribute :title, WorkLine, sets: true
2628
+ attribute :detail, WorkLine, sets: true
2629
+
2630
+ emits "SpecWentRedAgain"
2631
+ end
2632
+
2633
+ # `seen_in` is the run that last saw the file fail; a run that did see it fails to clear it.
2634
+ command "Clear" do
2635
+ role "System"
2636
+ goal "Record that a settled run of main no longer fails a spec file"
2637
+
2638
+ reference_to RedSpec
2639
+ attribute :run, RunId
2640
+ attribute :seen_in, RunId
2641
+
2642
+ given("a run that still saw the file fail does not clear it") { run.value != seen_in.value }
2643
+
2644
+ sets :cleared_by, to: :run
2645
+
2646
+ emits "SpecWentGreen"
2647
+ end
2648
+
2649
+ query "OnMain" do
2650
+ description "The red specs on main: every spec file still red, with the day it first went red and the run that last saw it fail."
2651
+ where(status: "red")
2652
+ order_by :since
2653
+ end
2654
+ end
2655
+
2656
+ # One CI run of main read for its failing spec files. The Reader port reports each failing file
2657
+ # to `RedSpec` and answers what the run settled to.
2658
+ aggregate "MainRun" do
2659
+ description "One CI run of main, read for the spec files it failed."
2660
+
2661
+ identified_by :run
2662
+
2663
+ attribute :run, MainRunId
2664
+ attribute :repo, HeadRepo
2665
+ attribute :commit, SpecCommit, optional: true
2666
+ attribute :settled, SettledFlag, optional: true
2667
+
2668
+ value_object "MainRunId" do
2669
+ attribute :value, String, matches: :present
2670
+ end
2671
+
2672
+ # "yes" once every job that runs specs finished, so a spec absent from the failures passed.
2673
+ value_object "SettledFlag" do
2674
+ attribute :value, String, default: ""
2675
+ end
2676
+
2677
+ command "Request" do
2678
+ role "CI engineer"
2679
+ goal "Ask for one CI run of main to be read for the spec files it failed"
2680
+
2681
+ attribute :run, MainRunId, sets: true
2682
+ attribute :repo, HeadRepo, sets: true
2683
+
2684
+ emits "MainRunReadRequested"
2685
+ end
2686
+
2687
+ command "Record" do
2688
+ role "System"
2689
+ goal "Keep how a read run settled"
2690
+
2691
+ reference_to MainRun
2692
+ attribute :commit, SpecCommit, sets: true
2693
+ attribute :settled, SettledFlag, sets: true
2694
+
2695
+ emits "MainRunRecorded"
2696
+ end
2697
+ end
2698
+
2699
+ # The image roll of one commit of embryonaut_platform's main. A commit whose remote CI is green
2700
+ # is
2701
+ # classified by the paths it changed: only the console container's inputs roll by themselves, and
2702
+ # anything else waits for a person. A commit rolls once; a second request finds the roll under
2703
+ # way.
2704
+ aggregate "ImageRoll" do
2705
+ description "One commit of embryonaut_platform's main: whether its container image was rolled, or waits for a person."
2706
+
2707
+ identified_by :commit
2708
+
2709
+ attribute :commit, CommitRef
2710
+ attribute :app, AppName
2711
+ attribute :paths, ChangedPaths
2712
+ attribute :outcome, one_of("done", "failed")
2713
+
2714
+ lifecycle :roll, default: "idle" do
2715
+ transition "Request" => "requested", from: "idle"
2716
+ transition "NeedsApproval" => "awaiting_approval", from: "idle"
2717
+ transition "Finish" => "finished", from: "requested"
2718
+ mark :terminal, "awaiting_approval", "finished"
2719
+ end
2720
+
2721
+ value_object "CommitRef" do
2722
+ attribute :value, String, pattern: '^[0-9a-f]{40}$'
2723
+ end
2724
+
2725
+ value_object "AppName" do
2726
+ attribute :value, String, matches: :present
2727
+ invariant("an app is named") { !value.to_s.empty? }
2728
+ end
2729
+
2730
+ value_object "RollBranch" do
2731
+ attribute :value, String, matches: :present
2732
+ end
2733
+
2734
+ value_object "RollRepo" do
2735
+ # GitHub's `owner/name`.
2736
+ attribute :value, String, pattern: '^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$'
2737
+ end
2738
+
2739
+ # The changed paths of the commit, newline-separated, as the classifier read them.
2740
+ value_object "ChangedPaths" do
2741
+ attribute :value, String, default: ""
2742
+ end
2743
+
2744
+ # Takes a green commit of the platform's main into the roll's chain; the classifier answers
2745
+ # next.
2746
+ command "Consider" do
2747
+ role "System"
2748
+ goal "Take one green commit of embryonaut_platform's main into the image roll's chain"
2749
+
2750
+ attribute :commit, CommitRef
2751
+ attribute :branch, RollBranch
2752
+ attribute :repo, RollRepo
2753
+
2754
+ emits "RollConsidered"
2755
+ end
2756
+
2757
+ # Opens the roll of one classified commit; only an idle one may be requested.
2758
+ command "Request" do
2759
+ role "System"
2760
+ goal "Start the image roll of one commit whose changes touch only the console container's inputs"
2761
+
2762
+ attribute :commit, CommitRef
2763
+ attribute :app, AppName
2764
+
2765
+ emits "RollRequested"
2766
+ end
2767
+
2768
+ # Holds a commit whose changes reach past the container: a person releases it.
2769
+ command "NeedsApproval" do
2770
+ role "System"
2771
+ goal "Hold one commit whose changes reach past the container's inputs for a person to approve"
2772
+
2773
+ attribute :commit, CommitRef
2774
+ attribute :paths, ChangedPaths
2775
+
2776
+ emits "RollNeedsApproval"
2777
+ end
2778
+
2779
+ # Records how a requested roll ended, done or failed.
2780
+ command "Finish" do
2781
+ role "System"
2782
+ goal "Record how the image roll of one commit ended"
2783
+
2784
+ reference_to ImageRoll
2785
+ attribute :app, AppName
2786
+ attribute :status, one_of("done", "failed")
2787
+
2788
+ sets :outcome, to: :status
2789
+
2790
+ emits "RollDone"
2791
+ end
2792
+ end
2793
+
1969
2794
  # One CI run against one commit. A clearance is minted per commit, so a later commit is stale
1970
2795
  # by simply having none.
1971
2796
  aggregate "Clearance" do
@@ -1989,6 +2814,7 @@ Hecks.bluebook "QualityControl" do
1989
2814
  mark :failure, "red"
1990
2815
  transition "Passed" => "green", from: "running"
1991
2816
  transition "Failed" => "red", from: "running"
2817
+ mark :terminal, "green", "red"
1992
2818
  end
1993
2819
 
1994
2820
  command "Start" do
@@ -2000,14 +2826,24 @@ Hecks.bluebook "QualityControl" do
2000
2826
  emits "ClearanceStarted"
2001
2827
  end
2002
2828
 
2829
+ # Start and ask CI in one step: the verdict comes back as `SuitePassed` or `SuiteFailed`, and
2830
+ # `ClearOnPass` and `RefuseOnFail` settle the record. `Start` alone records a verdict CI gave elsewhere.
2831
+ command "Check" do
2832
+ role "QA engineer"
2833
+ goal "Put a commit through CI and record the verdict it gives"
2834
+
2835
+ attribute :commit, CommitRef
2836
+
2837
+ emits "ClearanceChecked"
2838
+ end
2839
+
2003
2840
  command "Passed" do
2004
2841
  role "System"
2005
2842
  goal "Record that the suite went green against this commit"
2006
2843
 
2007
2844
  reference_to Clearance
2008
- attribute :summary, RunSummary
2845
+ attribute :summary, RunSummary, sets: true
2009
2846
 
2010
- sets :summary
2011
2847
 
2012
2848
  emits "ClearanceGiven"
2013
2849
  end
@@ -2125,6 +2961,31 @@ Hecks.bluebook "QualityControl" do
2125
2961
  group_by :status, :number
2126
2962
  end
2127
2963
 
2964
+ # The fixer does the work of a fix; the ledger records each step it reports, so only these policies
2965
+ # write a bug's state after logging. Each names the fixer event it reacts to, and the Bug command
2966
+ # it records.
2967
+ policy "RecordClaimOnAttemptClaimed" do
2968
+ on "Attempt.AttemptClaimed"
2969
+ trigger Bug::Claim, with: { bug: :reference, held_by: :held_by, now: :now }
2970
+ end
2971
+
2972
+ policy "RecordInvestigationOnAttemptInvestigated" do
2973
+ on "Attempt.AttemptInvestigated"
2974
+ trigger Bug::Investigate, with: { bug: :reference, site: :site, cause: :cause }
2975
+ end
2976
+
2977
+ # The fix commit is recorded as the bug's fixed state; `BugCiWatch` starts on the `BugFixed` it emits.
2978
+ policy "RecordFixOnFixReady" do
2979
+ on "Attempt.FixReady"
2980
+ trigger Bug::Fix, with: { reference: :reference, commit: :commit }
2981
+ end
2982
+
2983
+ # A verified fix is the ledger's verified state, recorded with the evidence the fixer names.
2984
+ policy "RecordVerifyOnFixVerified" do
2985
+ on "Attempt.FixVerified"
2986
+ trigger Bug::Verify, with: { bug: :reference, evidence: :evidence }
2987
+ end
2988
+
2128
2989
  # `Ticket.Close` is the only way a ticket leaves `filed`, and only the outside can know it
2129
2990
  # happened, so the fact arrives by whichever route reaches us first.
2130
2991
  policy "CloseWhenClosedUpstream" do
@@ -2132,6 +2993,11 @@ Hecks.bluebook "QualityControl" do
2132
2993
  trigger Ticket::Close
2133
2994
  end
2134
2995
 
2996
+ policy "RunWhenChecked" do
2997
+ on "Clearance.ClearanceChecked"
2998
+ ask :run, with: { commit: :commit }
2999
+ end
3000
+
2135
3001
  # The adapter decides by answering or refusing, the only branch a policy can express.
2136
3002
  policy "ClearOnPass" do
2137
3003
  on "Clearance.SuitePassed"
@@ -2146,7 +3012,7 @@ Hecks.bluebook "QualityControl" do
2146
3012
  # `Raise` and the call are split so a crash leaves a `Ticket.Raised` row rather than a lie.
2147
3013
  policy "FileWhenSubmitted" do
2148
3014
  on "Ticket.TicketSubmitted"
2149
- trigger Ticket::IssueTracker::File
3015
+ ask :file
2150
3016
  end
2151
3017
 
2152
3018
  policy "RecordTheIssue" do
@@ -2167,7 +3033,7 @@ Hecks.bluebook "QualityControl" do
2167
3033
 
2168
3034
  policy "AskOnceMore" do
2169
3035
  on "Ticket.TicketRetried"
2170
- trigger Ticket::IssueTracker::File
3036
+ ask :file
2171
3037
  end
2172
3038
 
2173
3039
  # Nothing reacts to `TicketRaised` on purpose: a ticket waits until somebody submits it.
@@ -2183,4 +3049,259 @@ Hecks.bluebook "QualityControl" do
2183
3049
  reason: { value: "a check surprised — a person releases with hecks quality_control query sweep.run <target> --release --notes" }
2184
3050
  }
2185
3051
  end
3052
+
3053
+ # A requested head is read from remote CI by the CiHead port; the answer is the verdict's event.
3054
+ policy "CheckHeadOnRequest" do
3055
+ on "Head.HeadRequested"
3056
+ ask :check, with: { commit: :commit, branch: :branch, repo: :repo }
3057
+ end
3058
+
3059
+ policy "GreenOnHeadChecked" do
3060
+ on "Head.HeadChecked"
3061
+ where { color.value == "green" }
3062
+ trigger Head::Green, with: { commit: :commit, branch: :branch, repo: :repo, color: :color }
3063
+ end
3064
+
3065
+ policy "RedOnHeadChecked" do
3066
+ on "Head.HeadChecked"
3067
+ where { color.value == "red" }
3068
+ trigger Head::Red, with: { commit: :commit, repo: :repo, color: :color, failing_jobs: :failing_jobs }
3069
+ end
3070
+
3071
+ # A run of main read for its failing spec files. The reader reports each failing file to RedSpec
3072
+ # (opening a row or updating it) before it answers.
3073
+ policy "ReadRunOnRequest" do
3074
+ on "MainRun.MainRunReadRequested"
3075
+ ask :read, with: { run: :run, repo: :repo }
3076
+ end
3077
+
3078
+ policy "RecordTheRunRead" do
3079
+ on "MainRun.MainRunRead"
3080
+ trigger MainRun::Record, with: { commit: :commit, settled: :settled }
3081
+ end
3082
+
3083
+ # A settled run clears every red spec it did not see fail; `Clear` refuses one it did, which stays open.
3084
+ policy "ClearSpecsOnSettledRun" do
3085
+ on "MainRun.MainRunRead"
3086
+ where { settled.value == "yes" }
3087
+ for_each "RedSpec.OnMain"
3088
+ trigger RedSpec::Clear, with: { spec: :spec, run: :run, seen_in: :last_run }
3089
+ end
3090
+
3091
+ # The image roll's chain. A green remote CI on embryonaut_platform's main is classified by the
3092
+ # `ImageRoll` port: the answer is `ImageClassified`, and a refusal (the change set unreadable)
3093
+ # ends the chain. Only the classifier's verdict decides; an infra commit is held, and its roll
3094
+ # needs a green quick gate on record.
3095
+ policy "RollImages" do
3096
+ on "Head.CiGreen"
3097
+ where { repo.value == "heckslabs/embryonaut_platform" }
3098
+ trigger ImageRoll::Consider, with: { commit: :commit, branch: :branch, repo: :repo }
3099
+ end
3100
+
3101
+ policy "ClassifyConsidered" do
3102
+ on "ImageRoll.RollConsidered"
3103
+ ask :classify, with: { commit: :commit, branch: :branch, repo: :repo }
3104
+ end
3105
+
3106
+ policy "RollWhenImageOnly" do
3107
+ on "ImageRoll.ImageClassified"
3108
+ where { kind.value == "image" }
3109
+ trigger ImageRoll::Request, with: { commit: :commit, app: :app }
3110
+ end
3111
+
3112
+ policy "HoldWhenInfra" do
3113
+ on "ImageRoll.ImageClassified"
3114
+ where { kind.value == "infra" }
3115
+ trigger ImageRoll::NeedsApproval, with: { commit: :commit, paths: :paths }
3116
+ end
3117
+
3118
+ policy "RunRollOnRequest" do
3119
+ on "ImageRoll.RollRequested"
3120
+ ask :roll, with: { commit: :commit, app: :app }
3121
+ end
3122
+
3123
+ policy "FinishOnRollAnswered" do
3124
+ on "ImageRoll.RollAnswered"
3125
+ trigger ImageRoll::Finish, with: { commit: :commit, app: :app, status: :status }
3126
+ end
3127
+
3128
+ policy "FinishOnRollRefused" do
3129
+ on "ImageRoll.RollRefused"
3130
+ trigger ImageRoll::Finish, with: { commit: :commit, app: :app, status: { value: "failed" } }
3131
+ end
3132
+
3133
+ # The main-maintenance chain, one policy per event. Each `ask` is answered by the `MainMaintenance` port;
3134
+ # each `trigger` is a command above. The events are the contract: `WorkSubmitted(branch, sha)` from the
3135
+ # coder side, `GateVerdict(run, sha, color)`, `ReconcileRequested`, `ReconcileDone(run, sha, color,
3136
+ # verdict)`, `PushRequested`, `Pushed(run, sha, origin_sha)`, and the refusals `GateRefused`,
3137
+ # `ReconcileRefused`, `PushRefused`.
3138
+ policy "StartOnSubmission" do
3139
+ on "Submission.WorkSubmitted"
3140
+ trigger Maintenance::Start, with: { run: :branch, sha: :sha }
3141
+ end
3142
+
3143
+ policy "GateOnStart" do
3144
+ on "Maintenance.RunStarted"
3145
+ ask :gate, with: { run: :run, sha: :sha }
3146
+ end
3147
+
3148
+ policy "RefuseOnRedGate" do
3149
+ on "Maintenance.GateVerdict"
3150
+ where { color.value == "red" }
3151
+ trigger Maintenance::RefuseGate, with: { run: :run, color: :color }
3152
+ end
3153
+
3154
+ policy "ReconcileOnGreenGate" do
3155
+ on "Maintenance.GateVerdict"
3156
+ where { color.value == "green" }
3157
+ trigger Maintenance::RequestReconcile, with: { run: :run, sha: :sha, color: :color }
3158
+ end
3159
+
3160
+ policy "ReconcileOnRequest" do
3161
+ on "Maintenance.ReconcileRequested"
3162
+ ask :reconcile, with: { run: :run, sha: :sha, color: :color }
3163
+ end
3164
+
3165
+ policy "PushOnReconciled" do
3166
+ on "Maintenance.ReconcileDone"
3167
+ where { verdict.value != "refused" && color.value == "green" }
3168
+ trigger Maintenance::RequestPush, with: { run: :run, sha: :sha, color: :color, verdict: :verdict }
3169
+ end
3170
+
3171
+ policy "PushOnRequest" do
3172
+ on "Maintenance.PushRequested"
3173
+ ask :push, with: { run: :run, sha: :sha }
3174
+ end
3175
+
3176
+ # The mint chain. `MintRequested` carries the rehearsal's verdict and the watermark it read; the mint is
3177
+ # asked only for a would_mint verdict, and the refusal is the same named event as every other refusal.
3178
+ # A mint's landing follows it in the same step; a failed landing is `MintStranded`, the event a refused
3179
+ # `Land` ask names.
3180
+ policy "RefuseMintWithoutVerdict" do
3181
+ on "Maintenance.MintRequested"
3182
+ where { rehearsal_verdict.value != "would_mint" }
3183
+ trigger Maintenance::RefuseMint, with: { run: :run, domain: :domain, era: :era, rehearsal_verdict: :rehearsal_verdict }
3184
+ end
3185
+
3186
+ # The auto-mint rule, declared. A mint without the owner's confirm runs only when all four hold, and the
3187
+ # mint entry point (`Adapters::MainMaintenance#mint`, checked by `Adapters::QaAutoMint`) enforces it:
3188
+ # (a) the translation edge leaving the held era is empty: no aggregate block, derive, drop, rename,
3189
+ # convert, retype or rekey;
3190
+ # (b) every change in the shape diff is additive: an attribute an existing aggregate gained is optional,
3191
+ # and a new aggregate, required attributes included, adds no field to an existing one;
3192
+ # (c) the rehearsal said would_mint with a refusal total of 0, at the live watermark;
3193
+ # (d) no stranded marker exists.
3194
+ # Otherwise the mint is held: the entry point refuses it as "needs owner approval", and the policy below
3195
+ # asks for the approval, which answers `MintNeedsApproval` and stops. A stale watermark or a stranded
3196
+ # marker is a refusal, never a held mint. The ask forwards no `ledger_dir`: an optional attribute a call
3197
+ # leaves out is not on the event, so the entry point takes the QualityControl ledger by default.
3198
+ policy "AutoMintAdditive" do
3199
+ on "Maintenance.MintRequested"
3200
+ where { rehearsal_verdict.value == "would_mint" }
3201
+ ask :mint, with: { run: :run, domain: :domain, era: :era, sha: :sha, branch: :branch,
3202
+ watermark: :watermark, rehearsal_verdict: :rehearsal_verdict,
3203
+ refusal_total: :refusal_total, confirm: :confirm }
3204
+ end
3205
+
3206
+ # Holds a mint the auto-mint rule does not cover for the owner. Reads the refusal the entry point named.
3207
+ policy "AskOwnerApprovalOnHeldMint" do
3208
+ on "Maintenance.MintRefused"
3209
+ where { refusal && refusal.value.start_with?("needs owner approval") }
3210
+ ask :approval, with: { domain: :domain, era: :era, reason: :refusal }
3211
+ end
3212
+
3213
+ policy "LandOnMinted" do
3214
+ on "Maintenance.Minted"
3215
+ where { branch.value != "" }
3216
+ ask :land, with: { run: :run, era: :era, sha: :sha, branch: :branch }
3217
+ end
3218
+
3219
+ # The release PR chain. A version bump opens its PR; the conditions judged on `ReleaseChecked` either
3220
+ # approve it (every condition `met`) or refuse it by the name of the condition that failed. An approval
3221
+ # writes the release trailer on the merge through the `ReleaseGh` port.
3222
+ policy "OpenOnReleaseRequest" do
3223
+ on "ReleasePR.ReleaseOpenRequested"
3224
+ ask :open_pull_request, with: { release: :release, branch: :branch, sha: :sha }
3225
+ end
3226
+
3227
+ policy "ApproveOnConditionsMet" do
3228
+ on "ReleasePR.ReleaseChecked"
3229
+ where { condition.value == "met" }
3230
+ trigger ReleasePR::Approve, with: { release: :release, sha: :sha, condition: :condition,
3231
+ approver: :approver, trailer: :trailer }
3232
+ end
3233
+
3234
+ policy "RefuseOnFailedCondition" do
3235
+ on "ReleasePR.ReleaseChecked"
3236
+ where { condition.value != "met" }
3237
+ trigger ReleasePR::Refuse, with: { release: :release, condition: :condition }
3238
+ end
3239
+
3240
+ policy "WriteTrailerOnApproved" do
3241
+ on "ReleasePR.ReleaseApproved"
3242
+ ask :write_trailer, with: { approver: :approver, trailer: :trailer }
3243
+ end
3244
+
3245
+ # ---- The push nudge ----------------------------------------------------------------------------
3246
+ # Local main drifting ahead of origin/main is red that nobody sees. Each tick checks once whether a
3247
+ # push is due and keeps ONE Work row, `push-due`, for QA: filed when the push is due beyond the
3248
+ # world's thresholds, updated while it stays due, finished when it no longer is. The check reads
3249
+ # refs git already holds (`PushRehearsal.Due`); it never fetches, pushes or merges. Tickets turns the
3250
+ # answer into the row (`PlanWorkWhenPushDue`, `ReviseWorkWhenPushStillDue`, `FinishWorkWhenPushSettled`).
3251
+ aggregate "PushNudge" do
3252
+ description "One check of whether a push of local main is due: whether it is, whether the push-due Work row is already open, and the numbers."
3253
+
3254
+ identified_by :nudge
3255
+
3256
+ attribute :nudge, NudgeKey
3257
+ attribute :due, NudgeFlag, optional: true
3258
+ attribute :raised, NudgeFlag, optional: true
3259
+ attribute :work, NudgeLine, optional: true
3260
+ attribute :title, NudgeLine, optional: true
3261
+ attribute :detail, NudgeLine, optional: true
3262
+
3263
+ value_object "NudgeKey" do
3264
+ attribute :value, String, matches: :present
3265
+ end
3266
+
3267
+ # "yes" or "no".
3268
+ value_object "NudgeFlag" do
3269
+ attribute :value, String, default: ""
3270
+ end
3271
+
3272
+ value_object "NudgeLine" do
3273
+ attribute :value, String, default: ""
3274
+ end
3275
+
3276
+ command "Check" do
3277
+ role "QA engineer"
3278
+ goal "Ask whether a push of local main is due, from the refs git already holds"
3279
+
3280
+ attribute :nudge, NudgeKey, sets: true
3281
+
3282
+ emits "PushDueCheckRequested"
3283
+ end
3284
+
3285
+ command "Record" do
3286
+ role "System"
3287
+ goal "Keep what a check found"
3288
+
3289
+ reference_to PushNudge
3290
+ attribute :due, NudgeFlag, sets: true
3291
+ attribute :raised, NudgeFlag, sets: true
3292
+ attribute :detail, NudgeLine, sets: true
3293
+
3294
+ emits "PushDueRecorded"
3295
+ end
3296
+ end
3297
+
3298
+ policy "ReadPushDueOnCheck" do
3299
+ on "PushNudge.PushDueCheckRequested"
3300
+ ask :read, with: { nudge: :nudge }
3301
+ end
3302
+
3303
+ policy "RecordThePushDueRead" do
3304
+ on "PushNudge.PushDueRead"
3305
+ trigger PushNudge::Record, with: { due: :due, raised: :raised, detail: :detail }
3306
+ end
2186
3307
  end