rigortype 0.3.9 → 0.4.1

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 (407) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -4
  3. data/data/core_overlay/enumerable.rbs +51 -0
  4. data/data/core_overlay/enumerator.rbs +84 -0
  5. data/data/core_overlay/hash_rbs3.rbs +41 -0
  6. data/data/core_overlay/process.rbs +40 -0
  7. data/data/core_overlay/string_io.rbs +33 -0
  8. data/data/effects/core.yml +3 -3
  9. data/data/gem_overlay/activesupport/core_ext.rbs +127 -4
  10. data/docs/handbook/03-narrowing.md +95 -10
  11. data/docs/handbook/04-tuples-and-shapes.md +8 -6
  12. data/docs/handbook/07-rbs-and-extended.md +16 -11
  13. data/docs/handbook/08-understanding-errors.md +3 -2
  14. data/docs/handbook/10-sorbet.md +9 -10
  15. data/docs/handbook/11-sig-gen.md +454 -13
  16. data/docs/install.md +87 -15
  17. data/docs/manual/02-cli-reference.md +65 -4
  18. data/docs/manual/03-configuration.md +12 -0
  19. data/docs/manual/04-diagnostics.md +4 -0
  20. data/docs/manual/07-plugins.md +1 -1
  21. data/docs/manual/08-skills.md +4 -3
  22. data/docs/manual/10-mcp-server.md +3 -2
  23. data/docs/manual/12-caching.md +43 -4
  24. data/docs/manual/14-rails-quickstart.md +19 -11
  25. data/docs/manual/16-rbs-extended-annotations.md +40 -7
  26. data/docs/manual/19-effect-labels.md +10 -0
  27. data/docs/manual/plugins/README.md +7 -0
  28. data/docs/manual/plugins/rigor-actioncable.md +8 -1
  29. data/docs/manual/plugins/rigor-actionmailer.md +7 -0
  30. data/docs/manual/plugins/rigor-actionpack.md +243 -0
  31. data/docs/manual/plugins/rigor-active-model-serializers.md +153 -0
  32. data/docs/manual/plugins/rigor-activejob.md +7 -0
  33. data/docs/manual/plugins/rigor-activerecord.md +110 -4
  34. data/docs/manual/plugins/rigor-activestorage.md +8 -1
  35. data/docs/manual/plugins/rigor-activesupport-core-ext.md +11 -5
  36. data/docs/manual/plugins/rigor-grape.md +106 -0
  37. data/docs/manual/plugins/rigor-graphql.md +23 -2
  38. data/docs/manual/plugins/rigor-pundit.md +8 -1
  39. data/docs/manual/plugins/rigor-rails-i18n.md +10 -5
  40. data/docs/manual/plugins/rigor-rails-routes.md +7 -0
  41. data/docs/manual/plugins/rigor-rbs-inline.md +212 -25
  42. data/docs/manual/plugins/rigor-sidekiq.md +8 -1
  43. data/docs/manual/plugins/rigor-sorbet.md +21 -5
  44. data/exe/rigor +19 -4
  45. data/lib/rigor/analysis/baseline.rb +1 -1
  46. data/lib/rigor/analysis/check_rules/declaration_sourced_guard.rb +167 -2
  47. data/lib/rigor/analysis/check_rules/lexical_method_sites.rb +189 -0
  48. data/lib/rigor/analysis/check_rules/main_pass_collector.rb +5 -3
  49. data/lib/rigor/analysis/check_rules/rule_ids.rb +20 -5
  50. data/lib/rigor/analysis/check_rules/rule_walk.rb +2 -1
  51. data/lib/rigor/analysis/check_rules/source_arity.rb +427 -0
  52. data/lib/rigor/analysis/check_rules/special_global_setters.rb +146 -0
  53. data/lib/rigor/analysis/check_rules/unreachable_clause_collector.rb +36 -2
  54. data/lib/rigor/analysis/check_rules.rb +638 -136
  55. data/lib/rigor/analysis/dependency_recorder.rb +222 -17
  56. data/lib/rigor/analysis/fact_store.rb +9 -0
  57. data/lib/rigor/analysis/incremental.rb +26 -0
  58. data/lib/rigor/analysis/incremental_run_slot/write_guard.rb +266 -0
  59. data/lib/rigor/analysis/incremental_run_slot.rb +171 -0
  60. data/lib/rigor/analysis/incremental_session.rb +309 -53
  61. data/lib/rigor/analysis/plugin_fact_fingerprint.rb +24 -13
  62. data/lib/rigor/analysis/project_scan.rb +11 -1
  63. data/lib/rigor/analysis/reachability/plugin_roots.rb +0 -1
  64. data/lib/rigor/analysis/reachability/scan_cache.rb +3 -1
  65. data/lib/rigor/analysis/rule_catalog.rb +127 -0
  66. data/lib/rigor/analysis/run_cache_key.rb +46 -18
  67. data/lib/rigor/analysis/run_stats.rb +2 -2
  68. data/lib/rigor/analysis/runner/diagnostic_aggregator.rb +168 -12
  69. data/lib/rigor/analysis/runner/effect_envelope_pass.rb +9 -4
  70. data/lib/rigor/analysis/runner/pool_coordinator.rb +109 -17
  71. data/lib/rigor/analysis/runner/project_pre_passes.rb +44 -17
  72. data/lib/rigor/analysis/runner.rb +603 -54
  73. data/lib/rigor/analysis/shadow_harness.rb +27 -0
  74. data/lib/rigor/analysis/source_rbs_gate.rb +157 -0
  75. data/lib/rigor/analysis/template_unit_collector.rb +303 -0
  76. data/lib/rigor/analysis/template_unit_paths.rb +93 -0
  77. data/lib/rigor/analysis/template_unit_positions.rb +293 -0
  78. data/lib/rigor/analysis/template_units.rb +409 -0
  79. data/lib/rigor/analysis/worker_session.rb +57 -13
  80. data/lib/rigor/bleeding_edge.rb +0 -2
  81. data/lib/rigor/builtins/hkt_builtins.rb +1 -0
  82. data/lib/rigor/builtins/imported_refinements.rb +4 -0
  83. data/lib/rigor/builtins/regex_refinement.rb +17 -9
  84. data/lib/rigor/builtins/static_return_refinements.rb +2 -0
  85. data/lib/rigor/cache/descriptor.rb +45 -1
  86. data/lib/rigor/cache/engine_source.rb +29 -1
  87. data/lib/rigor/cache/file_digest.rb +28 -0
  88. data/lib/rigor/cache/incremental_snapshot.rb +102 -8
  89. data/lib/rigor/cache/rbs_cache_producer.rb +4 -0
  90. data/lib/rigor/cache/rbs_descriptor.rb +37 -7
  91. data/lib/rigor/cache/store.rb +63 -4
  92. data/lib/rigor/cache/value_digest.rb +325 -0
  93. data/lib/rigor/ci_detector.rb +1 -0
  94. data/lib/rigor/cli/check_command.rb +83 -13
  95. data/lib/rigor/cli/doc_links.rb +1 -1
  96. data/lib/rigor/cli/docs_command.rb +4 -4
  97. data/lib/rigor/cli/doctor_command.rb +1 -1
  98. data/lib/rigor/cli/effects_report.rb +2 -2
  99. data/lib/rigor/cli/plugin_command.rb +3 -3
  100. data/lib/rigor/cli/prism_colorizer.rb +0 -1
  101. data/lib/rigor/cli/sig_gen_command.rb +210 -29
  102. data/lib/rigor/cli/skill_command.rb +1 -1
  103. data/lib/rigor/cli/skill_describe.rb +0 -1
  104. data/lib/rigor/cli/type_of_command.rb +19 -5
  105. data/lib/rigor/cli/type_of_renderer.rb +20 -9
  106. data/lib/rigor/cli/type_of_template_probe.rb +189 -0
  107. data/lib/rigor/cli/unused_command.rb +3 -3
  108. data/lib/rigor/cli.rb +21 -3
  109. data/lib/rigor/config_audit.rb +3 -2
  110. data/lib/rigor/config_path.rb +29 -0
  111. data/lib/rigor/configuration/severity_profile.rb +24 -3
  112. data/lib/rigor/configuration.rb +71 -7
  113. data/lib/rigor/effects/ancestry_recorder.rb +191 -0
  114. data/lib/rigor/effects/attribution.rb +11 -2
  115. data/lib/rigor/effects/callee_rule.rb +368 -0
  116. data/lib/rigor/effects/catalog.rb +7 -4
  117. data/lib/rigor/effects/collector.rb +11 -5
  118. data/lib/rigor/effects/config_envelopes.rb +9 -2
  119. data/lib/rigor/effects/definition_context.rb +179 -0
  120. data/lib/rigor/effects/effect_table.rb +11 -3
  121. data/lib/rigor/effects/envelope_check.rb +1 -1
  122. data/lib/rigor/effects/envelope_index.rb +15 -0
  123. data/lib/rigor/effects/file_collection.rb +59 -5
  124. data/lib/rigor/effects/framework_units.rb +1 -1
  125. data/lib/rigor/effects/identity.rb +16 -0
  126. data/lib/rigor/effects/local_ownership.rb +38 -12
  127. data/lib/rigor/effects/method_key.rb +21 -0
  128. data/lib/rigor/effects/mutation_classifier.rb +23 -12
  129. data/lib/rigor/effects/plugin_facts.rb +49 -37
  130. data/lib/rigor/effects/propagator.rb +295 -16
  131. data/lib/rigor/effects/registry.rb +1 -1
  132. data/lib/rigor/effects/scanner.rb +121 -72
  133. data/lib/rigor/effects/signature_sources.rb +1 -1
  134. data/lib/rigor/effects/snapshot.rb +2 -1
  135. data/lib/rigor/effects/summary.rb +27 -4
  136. data/lib/rigor/effects/unit_scan.rb +385 -30
  137. data/lib/rigor/effects/visibility.rb +101 -0
  138. data/lib/rigor/environment/bundle_sig_discovery.rb +5 -3
  139. data/lib/rigor/environment/lockfile_resolver.rb +27 -1
  140. data/lib/rigor/environment/member_consistency/comparator.rb +708 -0
  141. data/lib/rigor/environment/member_consistency.rb +298 -0
  142. data/lib/rigor/environment/rbs_collection_discovery.rb +10 -1
  143. data/lib/rigor/environment/rbs_loader.rb +400 -134
  144. data/lib/rigor/environment/source_rbs_synthesis.rb +147 -0
  145. data/lib/rigor/environment.rb +104 -96
  146. data/lib/rigor/hashing/xxh3.rb +264 -0
  147. data/lib/rigor/inference/acceptance.rb +139 -9
  148. data/lib/rigor/inference/block_auto_splat.rb +216 -0
  149. data/lib/rigor/inference/block_call_timing.rb +338 -0
  150. data/lib/rigor/inference/block_parameter_binder.rb +88 -26
  151. data/lib/rigor/inference/block_repetition.rb +71 -0
  152. data/lib/rigor/inference/body_fixpoint.rb +2 -1
  153. data/lib/rigor/inference/budget_trace.rb +2 -1
  154. data/lib/rigor/inference/builtins/method_catalog.rb +2 -1
  155. data/lib/rigor/inference/builtins/string_catalog.rb +1 -1
  156. data/lib/rigor/inference/captured_locals.rb +393 -15
  157. data/lib/rigor/inference/closure_escape_analyzer.rb +157 -13
  158. data/lib/rigor/inference/content_join.rb +200 -27
  159. data/lib/rigor/inference/declaration_walk/context.rb +195 -0
  160. data/lib/rigor/inference/declaration_walk/errors.rb +18 -0
  161. data/lib/rigor/inference/declaration_walk/shadow.rb +147 -0
  162. data/lib/rigor/inference/declaration_walk/traversal.rb +441 -0
  163. data/lib/rigor/inference/declaration_walk.rb +7 -0
  164. data/lib/rigor/inference/def_node_resolver.rb +3 -2
  165. data/lib/rigor/inference/def_return_typer.rb +11 -7
  166. data/lib/rigor/inference/define_method_block_self.rb +64 -0
  167. data/lib/rigor/inference/definer_resolution.rb +266 -0
  168. data/lib/rigor/inference/element_read_widening.rb +22 -10
  169. data/lib/rigor/inference/error_info.rb +196 -0
  170. data/lib/rigor/inference/expression_typer.rb +1665 -538
  171. data/lib/rigor/inference/external_ancestor_resolution.rb +264 -0
  172. data/lib/rigor/inference/fresh_frame_blocks.rb +127 -0
  173. data/lib/rigor/inference/global_write_census.rb +239 -0
  174. data/lib/rigor/inference/guard_rebinding.rb +488 -0
  175. data/lib/rigor/inference/hash_lookup_mutation.rb +88 -0
  176. data/lib/rigor/inference/index_write_widening.rb +16 -3
  177. data/lib/rigor/inference/indexed_narrowing.rb +61 -9
  178. data/lib/rigor/inference/jump_targets.rb +82 -0
  179. data/lib/rigor/inference/last_line/implicit_self.rb +210 -0
  180. data/lib/rigor/inference/last_line/self_evidence.rb +329 -0
  181. data/lib/rigor/inference/last_line.rb +340 -0
  182. data/lib/rigor/inference/last_status.rb +144 -0
  183. data/lib/rigor/inference/macro_block_self_type.rb +179 -17
  184. data/lib/rigor/inference/match_rebinding/calls.rb +281 -0
  185. data/lib/rigor/inference/match_rebinding/frame.rb +148 -0
  186. data/lib/rigor/inference/match_rebinding/operands.rb +236 -0
  187. data/lib/rigor/inference/match_rebinding/self_calls.rb +83 -0
  188. data/lib/rigor/inference/match_rebinding.rb +392 -0
  189. data/lib/rigor/inference/method_dispatcher/alias_strict_nominals.rb +36 -0
  190. data/lib/rigor/inference/method_dispatcher/block_folding.rb +85 -24
  191. data/lib/rigor/inference/method_dispatcher/facet_distribution.rb +147 -0
  192. data/lib/rigor/inference/method_dispatcher/hash_transform_keys_folding.rb +191 -0
  193. data/lib/rigor/inference/method_dispatcher/iterator_dispatch.rb +4 -0
  194. data/lib/rigor/inference/method_dispatcher/match_data_folding.rb +159 -0
  195. data/lib/rigor/inference/method_dispatcher/overload_selector.rb +113 -73
  196. data/lib/rigor/inference/method_dispatcher/process_folding.rb +56 -0
  197. data/lib/rigor/inference/method_dispatcher/proven_overload.rb +72 -0
  198. data/lib/rigor/inference/method_dispatcher/rbs_dispatch.rb +901 -38
  199. data/lib/rigor/inference/method_dispatcher/self_substitute.rb +142 -0
  200. data/lib/rigor/inference/method_dispatcher/shape_dispatch.rb +128 -53
  201. data/lib/rigor/inference/method_dispatcher/struct_folding.rb +1 -1
  202. data/lib/rigor/inference/method_dispatcher.rb +214 -13
  203. data/lib/rigor/inference/method_parameter_binder.rb +8 -3
  204. data/lib/rigor/inference/module_function_state.rb +213 -0
  205. data/lib/rigor/inference/multi_target_binder.rb +345 -52
  206. data/lib/rigor/inference/mutation_rejoin.rb +4 -1
  207. data/lib/rigor/inference/mutation_widening.rb +70 -48
  208. data/lib/rigor/inference/narrowing.rb +674 -124
  209. data/lib/rigor/inference/operand_effects.rb +167 -0
  210. data/lib/rigor/inference/operand_walk.rb +88 -0
  211. data/lib/rigor/inference/optimistic_origin.rb +152 -9
  212. data/lib/rigor/inference/parameter_inference_collector.rb +13 -11
  213. data/lib/rigor/inference/project_method_ownership.rb +136 -0
  214. data/lib/rigor/inference/project_patched_methods.rb +7 -2
  215. data/lib/rigor/inference/project_patched_scanner.rb +7 -3
  216. data/lib/rigor/inference/receiver_alias.rb +90 -1
  217. data/lib/rigor/inference/receiver_blind_block.rb +219 -0
  218. data/lib/rigor/inference/refinement_mutation.rb +15 -11
  219. data/lib/rigor/inference/repeated_or_writes.rb +463 -0
  220. data/lib/rigor/inference/return_barrier.rb +54 -0
  221. data/lib/rigor/inference/rewrite_mutation.rb +120 -0
  222. data/lib/rigor/inference/scope_indexer/certainty.rb +176 -0
  223. data/lib/rigor/inference/scope_indexer/class_cvars_collector.rb +35 -0
  224. data/lib/rigor/inference/scope_indexer/def_nestings_collector.rb +47 -0
  225. data/lib/rigor/inference/scope_indexer/layered_def_nestings.rb +36 -0
  226. data/lib/rigor/inference/scope_indexer/member_layouts_collector.rb +61 -0
  227. data/lib/rigor/inference/scope_indexer/mixin_accumulator.rb +130 -0
  228. data/lib/rigor/inference/scope_indexer/superclasses_collector.rb +64 -0
  229. data/lib/rigor/inference/scope_indexer.rb +5913 -701
  230. data/lib/rigor/inference/singleton_hook_decline.rb +253 -0
  231. data/lib/rigor/inference/statement_evaluator.rb +3249 -497
  232. data/lib/rigor/inference/stored_block_call.rb +54 -0
  233. data/lib/rigor/inference/string_mutation.rb +44 -7
  234. data/lib/rigor/inference/unknown_store_widening.rb +200 -0
  235. data/lib/rigor/inference/unthreaded_rebinds.rb +282 -0
  236. data/lib/rigor/language_server/debouncer.rb +0 -1
  237. data/lib/rigor/language_server/diagnostic_publisher.rb +3 -2
  238. data/lib/rigor/language_server/hover_renderer.rb +3 -3
  239. data/lib/rigor/language_server/project_context.rb +5 -3
  240. data/lib/rigor/mcp/server.rb +2 -1
  241. data/lib/rigor/plugin/base.rb +196 -13
  242. data/lib/rigor/plugin/box_probe.rb +91 -0
  243. data/lib/rigor/plugin/bundled_catalog.rb +1 -1
  244. data/lib/rigor/plugin/effect_attribution.rb +58 -4
  245. data/lib/rigor/plugin/io_boundary.rb +82 -4
  246. data/lib/rigor/plugin/isolation.rb +1 -1
  247. data/lib/rigor/plugin/loader.rb +2 -1
  248. data/lib/rigor/plugin/macro/block_as_method.rb +45 -6
  249. data/lib/rigor/plugin/manifest.rb +71 -10
  250. data/lib/rigor/plugin/registry.rb +35 -1
  251. data/lib/rigor/plugin/source_rbs_synthesis_reporter.rb +9 -3
  252. data/lib/rigor/plugin/template_unit.rb +196 -0
  253. data/lib/rigor/plugin/trust_policy.rb +3 -3
  254. data/lib/rigor/plugin.rb +1 -0
  255. data/lib/rigor/protection/discovery_seed.rb +20 -9
  256. data/lib/rigor/protection/kill_signature.rb +0 -1
  257. data/lib/rigor/protection/mutation_cache.rb +4 -5
  258. data/lib/rigor/rbs_extended.rb +27 -0
  259. data/lib/rigor/reflection/constant_ancestors.rb +146 -0
  260. data/lib/rigor/reflection/constant_path.rb +41 -13
  261. data/lib/rigor/reflection.rb +73 -107
  262. data/lib/rigor/scope/discovery_index.rb +351 -2
  263. data/lib/rigor/scope/resolution_chain/relevance.rb +165 -0
  264. data/lib/rigor/scope/resolution_chain.rb +884 -0
  265. data/lib/rigor/scope.rb +981 -198
  266. data/lib/rigor/sig_gen/alias_index.rb +289 -0
  267. data/lib/rigor/sig_gen/classification.rb +22 -5
  268. data/lib/rigor/sig_gen/declaration_equivalence.rb +127 -0
  269. data/lib/rigor/sig_gen/effect_annotation.rb +202 -0
  270. data/lib/rigor/sig_gen/generator.rb +580 -47
  271. data/lib/rigor/sig_gen/inline_declarations.rb +184 -0
  272. data/lib/rigor/sig_gen/method_candidate.rb +47 -3
  273. data/lib/rigor/sig_gen/observation_collector.rb +1 -1
  274. data/lib/rigor/sig_gen/renderer.rb +124 -9
  275. data/lib/rigor/sig_gen/skip_reason_catalog.rb +44 -1
  276. data/lib/rigor/sig_gen/write_result.rb +19 -3
  277. data/lib/rigor/sig_gen/writer.rb +166 -35
  278. data/lib/rigor/sig_gen.rb +3 -0
  279. data/lib/rigor/signature_path_audit.rb +1 -1
  280. data/lib/rigor/source/node_walker.rb +0 -3
  281. data/lib/rigor/source/parameter_envelope.rb +72 -0
  282. data/lib/rigor/source.rb +1 -0
  283. data/lib/rigor/type/combinator.rb +112 -12
  284. data/lib/rigor/type/difference.rb +1 -0
  285. data/lib/rigor/type/hash_shape.rb +1 -1
  286. data/lib/rigor/type/refined.rb +1 -0
  287. data/lib/rigor/version.rb +1 -1
  288. data/lib/rigor.rb +1 -0
  289. data/plugins/rigor-actioncable/lib/rigor/plugin/actioncable/effects.rb +1 -0
  290. data/plugins/rigor-actioncable/lib/rigor/plugin/actioncable.rb +9 -5
  291. data/plugins/rigor-actionmailer/lib/rigor/plugin/actionmailer.rb +13 -4
  292. data/plugins/rigor-actionpack/lib/rigor/plugin/actionpack/analyzer.rb +0 -1
  293. data/plugins/rigor-actionpack/lib/rigor/plugin/actionpack/controller_scan.rb +96 -0
  294. data/plugins/rigor-actionpack/lib/rigor/plugin/actionpack/effects.rb +65 -8
  295. data/plugins/rigor-actionpack/lib/rigor/plugin/actionpack/erb_compiler.rb +270 -0
  296. data/plugins/rigor-actionpack/lib/rigor/plugin/actionpack/render_locals.rb +402 -0
  297. data/plugins/rigor-actionpack/lib/rigor/plugin/actionpack/view_assigns.rb +370 -0
  298. data/plugins/rigor-actionpack/lib/rigor/plugin/actionpack/view_units.rb +132 -0
  299. data/plugins/rigor-actionpack/lib/rigor/plugin/actionpack.rb +239 -4
  300. data/plugins/rigor-actionpack/sig/action_view.rbs +43 -0
  301. data/plugins/rigor-active-model-serializers/lib/rigor/plugin/active_model_serializers/serializer_discoverer.rb +220 -0
  302. data/plugins/rigor-active-model-serializers/lib/rigor/plugin/active_model_serializers/serializer_index.rb +56 -0
  303. data/plugins/rigor-active-model-serializers/lib/rigor/plugin/active_model_serializers.rb +263 -0
  304. data/plugins/rigor-active-model-serializers/lib/rigor-active-model-serializers.rb +7 -0
  305. data/plugins/rigor-active-model-serializers/sig/active_model_serializers.rbs +45 -0
  306. data/plugins/rigor-activejob/lib/rigor/plugin/activejob/effects.rb +1 -0
  307. data/plugins/rigor-activejob/lib/rigor/plugin/activejob.rb +9 -5
  308. data/plugins/rigor-activerecord/lib/rigor/plugin/activerecord/analyzer.rb +35 -3
  309. data/plugins/rigor-activerecord/lib/rigor/plugin/activerecord/effects.rb +72 -12
  310. data/plugins/rigor-activerecord/lib/rigor/plugin/activerecord/model_discoverer.rb +380 -3
  311. data/plugins/rigor-activerecord/lib/rigor/plugin/activerecord/model_index.rb +14 -6
  312. data/plugins/rigor-activerecord/lib/rigor/plugin/activerecord.rb +281 -35
  313. data/plugins/rigor-activerecord/sig/active_record/relation.rbs +206 -31
  314. data/plugins/rigor-activestorage/lib/rigor/plugin/activestorage.rb +25 -14
  315. data/plugins/rigor-activesupport-core-ext/lib/rigor/plugin/activesupport_core_ext/effects.rb +9 -2
  316. data/plugins/rigor-activesupport-core-ext/sig/active_support/core_ext.rbs +171 -5
  317. data/plugins/rigor-dry-monads/lib/rigor/plugin/dry_monads.rb +2 -0
  318. data/plugins/rigor-ethon/lib/rigor/plugin/ethon.rb +1 -0
  319. data/plugins/rigor-ffi/lib/rigor/plugin/ffi/types.rb +1 -1
  320. data/plugins/rigor-ffi/lib/rigor/plugin/ffi.rb +10 -0
  321. data/plugins/rigor-grape/lib/rigor/plugin/grape.rb +141 -0
  322. data/plugins/rigor-grape/lib/rigor-grape.rb +6 -0
  323. data/plugins/rigor-grape/sig/grape.rbs +263 -0
  324. data/plugins/rigor-graphql/lib/rigor/plugin/graphql.rb +72 -2
  325. data/plugins/rigor-graphql/sig/graphql.rbs +485 -0
  326. data/plugins/rigor-minitest/lib/rigor/plugin/minitest/assertion_analyzer.rb +2 -0
  327. data/plugins/rigor-pundit/lib/rigor/plugin/pundit.rb +11 -7
  328. data/plugins/rigor-rails-i18n/lib/rigor/plugin/rails_i18n.rb +35 -37
  329. data/plugins/rigor-rails-routes/lib/rigor/plugin/rails_routes/analyzer.rb +0 -1
  330. data/plugins/rigor-rails-routes/lib/rigor/plugin/rails_routes/devise_routes.rb +2 -0
  331. data/plugins/rigor-rails-routes/lib/rigor/plugin/rails_routes/doorkeeper_routes.rb +1 -0
  332. data/plugins/rigor-rails-routes/lib/rigor/plugin/rails_routes.rb +9 -17
  333. data/plugins/rigor-rbs-inline/lib/rigor/plugin/rbs_inline/same_line_annotations.rb +149 -0
  334. data/plugins/rigor-rbs-inline/lib/rigor/plugin/rbs_inline.rb +217 -36
  335. data/plugins/rigor-sidekiq/lib/rigor/plugin/sidekiq/schedule_scan.rb +1 -0
  336. data/plugins/rigor-sidekiq/lib/rigor/plugin/sidekiq.rb +9 -5
  337. data/plugins/rigor-sorbet/lib/rigor/plugin/sorbet/sigil_detector.rb +0 -1
  338. data/plugins/rigor-sorbet/lib/rigor/plugin/sorbet.rb +46 -1
  339. data/plugins/rigor-sorbet/sig/sorbet.rbs +277 -0
  340. data/sig/rigor/analysis/baseline.rbs +69 -7
  341. data/sig/rigor/analysis/fact_store.rbs +1 -1
  342. data/sig/rigor/analysis/project_scan.rbs +74 -0
  343. data/sig/rigor/effects/config_envelopes.rbs +100 -0
  344. data/sig/rigor/effects/effect_table.rbs +60 -0
  345. data/sig/rigor/effects/envelope.rbs +97 -0
  346. data/sig/rigor/effects/envelope_index.rbs +33 -0
  347. data/sig/rigor/effects/file_collection.rbs +81 -0
  348. data/sig/rigor/effects/label.rbs +26 -0
  349. data/sig/rigor/effects/label_set.rbs +46 -0
  350. data/sig/rigor/effects/method_key.rbs +24 -0
  351. data/sig/rigor/effects/origin.rbs +50 -0
  352. data/sig/rigor/effects/plugin_facts.rbs +141 -0
  353. data/sig/rigor/effects/registry.rbs +68 -0
  354. data/sig/rigor/effects/summary.rbs +50 -0
  355. data/sig/rigor/effects/taint_cause.rbs +12 -0
  356. data/sig/rigor/environment.rbs +14 -10
  357. data/sig/rigor/inference/optimistic_origin.rbs +10 -0
  358. data/sig/rigor/inference.rbs +6 -4
  359. data/sig/rigor/plugin/additional_initializer.rbs +36 -0
  360. data/sig/rigor/plugin/base.rbs +30 -7
  361. data/sig/rigor/plugin/effect_ancestry.rbs +27 -0
  362. data/sig/rigor/plugin/effect_attribution.rbs +66 -0
  363. data/sig/rigor/plugin/effect_edge.rbs +33 -0
  364. data/sig/rigor/plugin/effect_entry_points.rbs +25 -0
  365. data/sig/rigor/plugin/io_boundary.rbs +2 -1
  366. data/sig/rigor/plugin/loader.rbs +3 -3
  367. data/sig/rigor/plugin/manifest.rbs +50 -11
  368. data/sig/rigor/plugin/protocol_contract.rbs +68 -0
  369. data/sig/rigor/plugin/registry.rbs +62 -1
  370. data/sig/rigor/plugin.rbs +1 -1
  371. data/sig/rigor/rbs_extended.rbs +1 -1
  372. data/sig/rigor/reflection.rbs +7 -6
  373. data/sig/rigor/scope.rbs +177 -20
  374. data/sig/rigor/sig_gen/skip_reason_catalog.rbs +14 -7
  375. data/sig/rigor/source.rbs +4 -4
  376. data/sig/rigor/testing.rbs +10 -4
  377. data/sig/rigor/type.rbs +6 -0
  378. data/sig/rigor.rbs +38 -20
  379. data/skills/rigor-ask/SKILL.md +8 -5
  380. data/skills/rigor-baseline-reduce/SKILL.md +4 -6
  381. data/skills/rigor-ci-setup/SKILL.md +17 -21
  382. data/skills/rigor-doctor/SKILL.md +24 -22
  383. data/skills/rigor-doctor/references/01-checks.md +97 -33
  384. data/skills/rigor-editor-setup/SKILL.md +6 -4
  385. data/skills/rigor-mcp-setup/SKILL.md +5 -4
  386. data/skills/rigor-monkeypatch-resolve/SKILL.md +5 -3
  387. data/skills/rigor-next-steps/SKILL.md +4 -2
  388. data/skills/rigor-plugin-author/SKILL.md +19 -23
  389. data/skills/rigor-plugin-author/references/01-plan-and-scaffold.md +9 -8
  390. data/skills/rigor-plugin-author/references/02-walker-and-types.md +12 -25
  391. data/skills/rigor-plugin-author/references/03-test-and-ship.md +6 -8
  392. data/skills/rigor-plugin-review/SKILL.md +6 -4
  393. data/skills/rigor-plugin-review/references/01-best-practices-checklist.md +2 -1
  394. data/skills/rigor-plugin-tune/SKILL.md +4 -2
  395. data/skills/rigor-project-init/SKILL.md +46 -18
  396. data/skills/rigor-project-init/references/01-detect.md +13 -9
  397. data/skills/rigor-project-init/references/02-configure.md +40 -10
  398. data/skills/rigor-project-init/references/03-baseline-and-bugs.md +14 -14
  399. data/skills/rigor-project-init/references/04-sig-uplift.md +27 -14
  400. data/skills/rigor-protection-uplift/SKILL.md +4 -6
  401. data/skills/rigor-rbs-setup/SKILL.md +4 -2
  402. data/skills/rigor-type-oracle/SKILL.md +4 -6
  403. data/skills/rigor-type-oracle/references/01-oracle-commands.md +12 -8
  404. data/skills/rigor-type-oracle/references/03-gap-protocol.md +0 -3
  405. data/skills/rigor-unused-adjudicate/SKILL.md +4 -2
  406. data/skills/rigor-upgrade/SKILL.md +13 -8
  407. metadata +132 -1
@@ -8,9 +8,70 @@ class Rigor::Plugin::Registry
8
8
  def self.materialize: (blueprints: untyped, services: untyped) -> Rigor::Plugin::Registry
9
9
 
10
10
  def initialize: (?plugins: untyped, ?load_errors: untyped, ?blueprints: untyped) -> void
11
- def find: (String | Symbol id) -> untyped
11
+ def find: (String | Symbol id) -> Rigor::Plugin::Base?
12
12
  def ids: () -> Array[String]
13
13
  def empty?: () -> bool
14
14
  def any_load_errors?: () -> bool
15
15
  def type_node_resolvers: () -> Array[untyped]
16
+ def rbs_complete_ancestors: () -> Array[String]
17
+ def rbs_complete_ancestor?: (untyped class_name) -> bool
18
+
19
+ # Newly declared — the attr_reader was absent from the sig. `compile_aggregates` builds the ivar
20
+ # with `flat_map` over the manifests (not from an `initialize` parameter, so this is unmarked
21
+ # residue like the `rbs_complete_ancestors` sibling rather than a #1154 row); the element type is
22
+ # `AdditionalInitializer`, enforced per manifest by `validate_additional_initializers!`.
23
+ attr_reader additional_initializers: Array[Rigor::Plugin::AdditionalInitializer]
24
+
25
+ # Newly declared — same unmarked-residue shape as `additional_initializers` (a
26
+ # `compile_aggregates` flat_map ivar, not an initialize-parameter read).
27
+ attr_reader protocol_contracts: Array[Rigor::Plugin::ProtocolContract]
28
+
29
+ # The subset of `protocol_contracts` whose `path_glob` matches `path` (memoised per path).
30
+ def contracts_for_path: (untyped path) -> Array[Rigor::Plugin::ProtocolContract]
31
+
32
+ # ADR-103 WD2/WD6/WD10/WD14 — every loaded plugin's effect contribution, in registration order.
33
+ # Lazy and memoised like `contracts_for_path`: computing it can force a plugin's project-facts
34
+ # read, which a run with effects off must never pay. Unmarked residue — a memoised
35
+ # `filter_map` aggregate, not an `initialize`-parameter read.
36
+ def effect_contributions: () -> Array[Contribution]
37
+
38
+ # One plugin's effect contribution, flattened off whichever surface answered it. Carries the two
39
+ # authority answers — `owner`, the label root this plugin may open, and `discharge_allowed`,
40
+ # whether its attributions may discharge — so nothing downstream re-derives who is first-party.
41
+ class Contribution < ::Data
42
+ # sig-gen gap: #1150 — a `Data.define` member; sig-gen proposes `untyped`.
43
+ attr_reader id: String
44
+ # sig-gen gap: #1150 — a `Data.define` member.
45
+ attr_reader owner: String
46
+ # sig-gen gap: #1150 — a `Data.define` member.
47
+ attr_reader requested_root: String?
48
+ # sig-gen gap: #1150 — a `Data.define` member.
49
+ attr_reader discharge_allowed: bool
50
+ # sig-gen gap: #1150 — a `Data.define` member.
51
+ attr_reader labels: Array[String]
52
+ # sig-gen gap: #1150 — a `Data.define` member.
53
+ attr_reader attributions: Array[EffectAttribution]
54
+ # sig-gen gap: #1150 — a `Data.define` member.
55
+ attr_reader edges: Array[EffectEdge]
56
+ # sig-gen gap: #1150 — a `Data.define` member.
57
+ attr_reader entry_points: Array[EffectEntryPoints]
58
+ # sig-gen gap: #1150 — a `Data.define` member.
59
+ attr_reader ancestry: Array[EffectAncestry]
60
+
61
+ # sig-gen gap: #1150 — member constructor. The custom `initialize` defaults `ancestry:`;
62
+ # the positional arm `Data` dispatches bypasses it, so only the kwargs arm is declared
63
+ # (same shape as `Effects::PluginFacts::Row`).
64
+ def self.new: (id: String, owner: String, requested_root: String?, discharge_allowed: bool,
65
+ labels: Array[String], attributions: Array[EffectAttribution],
66
+ edges: Array[EffectEdge], entry_points: Array[EffectEntryPoints],
67
+ ?ancestry: Array[EffectAncestry]) -> instance
68
+ # sig-gen gap: #1150 — as above.
69
+ def self.[]: (id: String, owner: String, requested_root: String?, discharge_allowed: bool,
70
+ labels: Array[String], attributions: Array[EffectAttribution],
71
+ edges: Array[EffectEdge], entry_points: Array[EffectEntryPoints],
72
+ ?ancestry: Array[EffectAncestry]) -> instance
73
+
74
+ # Whether the row carries nothing — no labels, attributions, edges, entry points, or ancestry.
75
+ def empty?: () -> bool
76
+ end
16
77
  end
data/sig/rigor/plugin.rbs CHANGED
@@ -3,6 +3,6 @@ module Rigor
3
3
  def self.register: (Class plugin_class) -> Class
4
4
  def self.registered_for: (String | Symbol id) -> Class?
5
5
  def self.registered: () -> Hash[String, Class]
6
- def self.unregister!: (?(String | Symbol)? id) -> untyped
6
+ def self.unregister!: (?(String | Symbol)? id) -> void
7
7
  end
8
8
  end
@@ -51,7 +51,7 @@ module Rigor
51
51
  # (`RBS::Definition::Method#annotations`, or a declaration / member's own `#annotations`); the result
52
52
  # is a `Rigor::Effects::Envelope`, or nil when the list carries neither purity spelling.
53
53
  def self?.pure_annotation?: (String? string) -> bool
54
- def self?.read_effect_envelope: (untyped annotations, owner_key: String, ?source: Symbol, ?registry: untyped, ?reporter: untyped) -> untyped?
54
+ def self?.read_effect_envelope: (untyped annotations, owner_key: String, ?source: Symbol, ?registry: untyped, ?reporter: untyped) -> Effects::Envelope?
55
55
 
56
56
  class ParamOverride
57
57
  attr_reader param_name: Symbol
@@ -7,14 +7,15 @@ module Rigor
7
7
  def self?.nominal_for_name: (String | Symbol class_name, ?scope: Scope) -> Type::Nominal?
8
8
  def self?.singleton_for_name: (String | Symbol class_name, ?scope: Scope) -> Type::Singleton?
9
9
  def self?.constant_type_for: (String | Symbol constant_name, ?scope: Scope) -> Type::t?
10
- def self?.resolve_constant_type: (String | Symbol name, ?scope: Scope, ?rooted: bool) -> Type::t?
11
- # sig-gen gap: #656 — sig-gen skips the method (untyped return), so the resolved-name-or-decline is hand-written.
10
+ def self?.resolve_constant_type: (String | Symbol name, ?scope: Scope, ?rooted: bool, ?caller_derived: bool) -> Type::t?
11
+ # sig-gen gap: #1157 — sig-gen skips the method (untyped return: the `&known` block-taking resolver
12
+ # declines through `nil` paths), so the resolved-name-or-decline is hand-written.
12
13
  def self?.resolve_constant_path_name: (String | Symbol name, Scope scope) { (String candidate) -> boolish } -> String?
13
14
  def self?.lexical_nesting_chain: (Scope scope) -> Array[String]
14
- def self?.instance_method_definition: (String | Symbol class_name, String | Symbol method_name, ?scope: Scope) -> untyped
15
- def self?.singleton_method_definition: (String | Symbol class_name, String | Symbol method_name, ?scope: Scope) -> untyped
16
- def self?.instance_definition: (String | Symbol class_name, ?scope: Scope) -> untyped
17
- def self?.singleton_definition: (String | Symbol class_name, ?scope: Scope) -> untyped
15
+ def self?.instance_method_definition: (String | Symbol class_name, String | Symbol method_name, ?scope: Scope) -> ::RBS::Definition::Method?
16
+ def self?.singleton_method_definition: (String | Symbol class_name, String | Symbol method_name, ?scope: Scope) -> ::RBS::Definition::Method?
17
+ def self?.instance_definition: (String | Symbol class_name, ?scope: Scope) -> ::RBS::Definition?
18
+ def self?.singleton_definition: (String | Symbol class_name, ?scope: Scope) -> ::RBS::Definition?
18
19
  def self?.class_type_param_names: (String | Symbol class_name, ?scope: Scope) -> Array[Symbol]
19
20
  def self?.discovered_class?: (String | Symbol class_name, ?scope: Scope) -> bool
20
21
  def self?.discovered_method?: (String | Symbol class_name, String | Symbol method_name, ?kind: Symbol, ?scope: Scope) -> bool
data/sig/rigor/scope.rbs CHANGED
@@ -14,14 +14,32 @@ module Rigor
14
14
  attr_reader void_origins: Hash[untyped, Inference::VoidOrigin]
15
15
  attr_reader plugin_typed_calls: Hash[untyped, bool]
16
16
  attr_reader optimistic_origins: Hash[untyped, Symbol]
17
- attr_reader optimistic_locals: Hash[Symbol, Symbol]
18
- attr_reader optimistic_ivars: Hash[Symbol, Symbol]
17
+ # A marked binding whose miss answer is known stores an `Inference::OptimisticOrigin::BoundMark` (a `Data`)
18
+ # in place of its bare cause (issue #1302).
19
+ attr_reader optimistic_locals: Hash[Symbol, Symbol | Data]
20
+ attr_reader optimistic_ivars: Hash[Symbol, Symbol | Data]
21
+ # sig-gen gap: #1154 — an `attr_reader` over an ivar assigned in `initialize` from a parameter reaches `untyped`.
22
+ attr_reader repeated_or_writes: Hash[untyped, bool]
23
+ # sig-gen gap: #1154 — the same reader shape; `Inference::MatchRebinding::Frame` carries no signature.
24
+ attr_reader match_frame: untyped
19
25
  attr_reader indexed_narrowings: Hash[IndexedKey, Type::t]
20
26
  attr_reader method_chain_narrowings: Hash[ChainKey, Type::t]
21
27
  attr_reader source_path: String?
22
28
  attr_reader struct_fold_safe_locals: Set[Symbol]
23
29
  attr_reader opaque_block_self: bool
30
+ # sig-gen gap: #1154 — sig-gen skips the reader (sig.skipped.untyped-return): an `attr_reader`
31
+ # over an ivar assigned in `initialize` from a parameter, so inference reaches `untyped`.
32
+ attr_reader singleton_class_body: bool
24
33
  attr_reader lexical_nesting: Array[String]?
34
+ # Issue #1429 — a guard's narrowing of a constant reference, keyed by its spelling.
35
+ # sig-gen gap: #1154 — a reader over an ivar `initialize` assigns from a parameter.
36
+ attr_reader constant_narrowings: Hash[String, Type::t]
37
+ # Issue #1429 — the pre-guard type of each global or constant a guard narrowed.
38
+ # sig-gen gap: #1154 — a reader over an ivar `initialize` assigns from a parameter.
39
+ attr_reader guard_records: Hash[[Symbol, Symbol | String], Type::t]
40
+ # Issue #1446 — the classes a class guard narrowed a `bot` receiver to.
41
+ # sig-gen gap: #1154 — a reader over an ivar `initialize` assigns from a parameter.
42
+ attr_reader bot_guard_classes: Hash[[Symbol, Symbol | String], Array[String]]
25
43
 
26
44
  # ADR-53 Track A — the seed-time discovery tables live on the
27
45
  # DiscoveryIndex; Scope keeps per-table readers as delegates.
@@ -37,15 +55,34 @@ module Rigor
37
55
  def discovered_def_sources: () -> Hash[String, Hash[Symbol, String]]
38
56
  def discovered_singleton_def_sources: () -> Hash[String, Hash[Symbol, String]]
39
57
  def discovered_method_visibilities: () -> Hash[String, Hash[Symbol, Symbol]]
58
+ # sig-gen gap: #1148 — sig-gen skips an endless-def reader (untyped return); the row is hand-written.
59
+ def discovered_parameter_envelopes: () -> Hash[String, Hash[untyped, untyped]]
60
+ # sig-gen gap: #1149 — sig-gen skips the `||` fallback reader (untyped return); the row is hand-written.
61
+ def parameter_envelopes_of: (String class_name) -> Hash[untyped, untyped]
40
62
  def discovered_superclasses: () -> Hash[String, String]
63
+ # sig-gen gap: #1148 — sig-gen skips the endless-def reader (untyped return), so the per-file
64
+ # deferred-range table's row shape is hand-written.
65
+ def discovered_deferred_ranges: () -> Hash[String, Array[[Integer, Integer, Symbol?, Symbol?, String?]]]
66
+ # sig-gen gap: #1148 — sig-gen skips the endless-def reader (untyped return), so the refinement table's
67
+ # shape is hand-written.
68
+ def discovered_refinements: () -> Hash[String, Hash[Symbol, Array[String]]]
69
+ # sig-gen gap: #1148 — sig-gen skips the endless-def reader (untyped return), so the census shape is
70
+ # hand-written.
71
+ def discovered_global_write_census: () -> Set[Array[untyped]]
41
72
  def discovered_includes: () -> Hash[String, Array[String]]
42
- # sig-gen gap: #898 — sig-gen skips the endless-def reader (untyped return), so the table shape is hand-written.
73
+ # Issue #1123 — the instance-ancestor-ORDER table beside the include one.
74
+ def discovered_prepends: () -> Hash[String, Array[String]]
75
+ # sig-gen gap: #1148 — sig-gen skips the endless-def reader (untyped return), so the table shape is hand-written.
43
76
  def discovered_extends: () -> Hash[String, Array[String]]
44
77
  def discovered_class_sources: () -> Hash[String, Set[String]]
45
78
  def constant_sources: () -> Hash[String, Set[String]]
46
79
  def published_constant_names: () -> Set[String]
47
80
  def local_constant_names: () -> Set[String]
48
- # sig-gen gap: #667 — sig-gen types the `||` fallback `untyped`, so the element type is hand-written.
81
+ # sig-gen gap: #1150 — the `Data.define` table it reads carries no type, so sig-gen skips the return; the shape is hand-written.
82
+ def bound_constant_names: (String name) -> Array[String]
83
+ # sig-gen gap: #1150 — the `Data.define` table it reads carries no type, so sig-gen skips the return; the shape is hand-written.
84
+ def shadowing_constant_names: (String name) -> Array[String]
85
+ # sig-gen gap: #1149 — sig-gen types the `||` fallback `untyped`, so the element type is hand-written.
49
86
  def published_constant_ivars_for: (String class_name) -> Set[Symbol]
50
87
  def published_constant?: (String name) -> bool
51
88
  def record_constant_dependency: (String name) -> void
@@ -62,11 +99,17 @@ module Rigor
62
99
  def record_plugin_typed_call: (untyped node) -> Scope
63
100
  def plugin_typed_call?: (untyped node) -> bool
64
101
 
102
+ def with_repeated_or_writes: (untyped nodes) -> Rigor::Scope
103
+ # sig-gen gap: #1154 — `Hash#key?` over that reader reaches `untyped`, so the `bool` is hand-written.
104
+ def repeated_or_write?: (untyped node) -> bool
105
+
65
106
  class DiscoveryIndex
66
107
  attr_reader declared_types: Hash[untyped, Type::t]
67
108
  attr_reader class_ivars: Hash[String, Hash[Symbol, Type::t]]
68
109
  attr_reader class_cvars: Hash[String, Hash[Symbol, Type::t]]
69
110
  attr_reader program_globals: Hash[Symbol, Type::t]
111
+ # sig-gen gap: #1150 — `Data.define` members carry no type, as for every other row in this class.
112
+ attr_reader program_global_seeds: Hash[Symbol, Type::t]
70
113
  attr_reader discovered_classes: Hash[String, Type::Singleton]
71
114
  attr_reader in_source_constants: Hash[String, Type::t]
72
115
  attr_reader discovered_methods: Hash[String, Hash[Symbol, Symbol]]
@@ -76,26 +119,76 @@ module Rigor
76
119
  attr_reader discovered_def_sources: Hash[String, Hash[Symbol, String]]
77
120
  attr_reader discovered_singleton_def_sources: Hash[String, Hash[Symbol, String]]
78
121
  attr_reader discovered_method_visibilities: Hash[String, Hash[Symbol, Symbol]]
122
+ # sig-gen gap: #1150 — `Data.define` members carry no type, as for every other row in this class.
123
+ attr_reader discovered_parameter_envelopes: Hash[String, Hash[untyped, untyped]]
79
124
  attr_reader discovered_superclasses: Hash[String, String]
80
125
  attr_reader discovered_includes: Hash[String, Array[String]]
81
- # sig-gen gap: #898 — `Data.define` members carry no type, as for every other row in this class.
126
+ attr_reader discovered_prepends: Hash[String, Array[String]]
127
+ # sig-gen gap: #1150 — `Data.define` members carry no type, as for every other row in this class.
82
128
  attr_reader discovered_extends: Hash[String, Array[String]]
83
129
  attr_reader discovered_class_sources: Hash[String, Set[String]]
84
130
  attr_reader constant_sources: Hash[String, Set[String]]
131
+ # sig-gen gap: #1150 — `Data.define` members carry no type, as for every other row in this class.
132
+ attr_reader constant_writers: Hash[String, Array[String]]
133
+ # sig-gen gap: #1150 — `Data.define` members carry no type, as for every other row in this class.
134
+ attr_reader constant_shadowers: Hash[String, Array[String]]
85
135
  attr_reader published_constant_names: Set[String]
86
136
  attr_reader local_constant_names: Set[String]
87
- # sig-gen gap: #667 — `Data.define` members carry no type, so every row in this class is authored.
137
+ # sig-gen gap: #1150 — `Data.define` members carry no type, so every row in this class is authored.
88
138
  attr_reader published_constant_alias_names: Set[String]
89
- # sig-gen gap: #667 — as above.
139
+ # sig-gen gap: #1150 — as above.
90
140
  attr_reader published_constant_ivars: Hash[String, Set[Symbol]]
91
141
  attr_reader data_member_layouts: Hash[String, Array[Symbol]]
92
142
  attr_reader struct_member_layouts: Hash[String, { members: Array[Symbol], keyword_init: bool }]
93
143
  attr_reader param_inferred_types: Hash[[String, Symbol, Symbol], Hash[Symbol, Type::t]]
144
+ # sig-gen gap: #1150 — `Data.define` members carry no type, as for every other row in this class.
145
+ attr_reader discovered_deferred_ranges: Hash[String, Array[[Integer, Integer, Symbol?, Symbol?, String?]]]
146
+ # sig-gen gap: #1150 — `Data.define` members carry no type, as for every other row in this class.
147
+ attr_reader discovered_refinements: Hash[String, Hash[Symbol, Array[String]]]
148
+ # sig-gen gap: #1150 — `Data.define` members carry no type, as for every other row in this class.
149
+ attr_reader discovered_global_write_census: Set[Array[untyped]]
94
150
  attr_reader run_generation: Object?
151
+ # sig-gen gap: #1150 — `Data.define` members carry no type, as for every other row in this class.
152
+ attr_reader patched_line_readers: Set[Symbol]
153
+ # sig-gen gap: #1150 — `Data.define` members carry no type, as for every other row in this class.
154
+ attr_reader clears_last_status: bool
155
+ # sig-gen gap: #1150 — `Data.define` members carry no type, as for every other row in this class.
156
+ attr_reader defines_case_equality: bool
157
+ # `untyped`: the value is an `Inference::LastLine::SelfEvidence` (or nil), and that class carries no signature,
158
+ # as `Inference::MatchRebinding::Frame` carries none for `match_frame`.
159
+ attr_reader implicit_self_evidence: untyped
160
+ # sig-gen gap: #1150 — `Data.define` members carry no type, as for every other row in this class.
161
+ attr_reader possible_discovered_methods: Hash[String, Hash[Symbol, Symbol]]
162
+ # sig-gen gap: #1150 — `Data.define` members carry no type, as for every other row in this class.
163
+ attr_reader possible_discovered_deferred_ranges: Hash[String, Array[[Integer, Integer, Symbol?, Symbol?, String?]]]
164
+ # sig-gen gap: #1150 — `Data.define` members carry no type, as for every other row in this class.
165
+ attr_reader contested_discovered_def_nodes: Set[Array[untyped]]
166
+ # sig-gen gap: #1150 — `Data.define` members carry no type, as for every other row in this class.
167
+ attr_reader contested_discovered_singleton_def_nodes: Set[Array[untyped]]
168
+ # sig-gen gap: #1150 — `Data.define` members carry no type, as for every other row in this class.
169
+ attr_reader contested_discovered_method_visibilities: Set[Array[untyped]]
170
+ # sig-gen gap: #1150 — `Data.define` members carry no type, as for every other row in this class.
171
+ attr_reader contested_discovered_parameter_envelopes: Set[Array[untyped]]
95
172
 
96
173
  EMPTY: DiscoveryIndex
174
+ # authored: ADR-119 WD1 — hand-written beside the `Data.define` rows above (#1150).
175
+ # authored: ADR-119 WD1 sibling pairing; no inferred signature exists for it (#1150).
176
+ SIBLINGS: Hash[Symbol, Symbol]
177
+ # authored: ADR-119 WD1 sibling pairing; no inferred signature exists for it (#1150).
178
+ EMPTY_SIBLINGS: Hash[Symbol, untyped]
179
+
180
+ # authored: ADR-119 WD1 sibling pairing; no inferred signature exists for it (#1150).
181
+ def self.empty_value: (Symbol name) -> untyped
182
+ # authored: ADR-119 WD1 sibling pairing; no inferred signature exists for it (#1150).
183
+ def self.empty_siblings: () -> Hash[Symbol, untyped]
184
+ # authored: ADR-119 WD1 sibling pairing; no inferred signature exists for it (#1150).
185
+ def self.compact_pairs: (Hash[Symbol, untyped] tables) -> Hash[Symbol, untyped]
186
+ # authored: ADR-119 WD1 sibling pairing; no inferred signature exists for it (#1150).
187
+ def self.paired?: (Symbol name) -> bool
188
+ # authored: ADR-119 WD1 sibling pairing; no inferred signature exists for it (#1150).
189
+ def sibling_tables: () -> Hash[Symbol, untyped]
97
190
 
98
- def with: (?declared_types: Hash[untyped, Type::t], ?class_ivars: Hash[String, Hash[Symbol, Type::t]], ?class_cvars: Hash[String, Hash[Symbol, Type::t]], ?program_globals: Hash[Symbol, Type::t], ?discovered_classes: Hash[String, Type::Singleton], ?in_source_constants: Hash[String, Type::t], ?discovered_methods: Hash[String, Hash[Symbol, Symbol]], ?discovered_def_nodes: Hash[String, Hash[Symbol, untyped]], ?discovered_def_nestings: Hash[untyped, Array[String]], ?discovered_singleton_def_nodes: Hash[String, Hash[Symbol, untyped]], ?discovered_def_sources: Hash[String, Hash[Symbol, String]], ?discovered_singleton_def_sources: Hash[String, Hash[Symbol, String]], ?discovered_method_visibilities: Hash[String, Hash[Symbol, Symbol]], ?discovered_superclasses: Hash[String, String], ?discovered_includes: Hash[String, Array[String]], ?discovered_extends: Hash[String, Array[String]], ?discovered_class_sources: Hash[String, Set[String]], ?constant_sources: Hash[String, Set[String]], ?published_constant_names: Set[String], ?local_constant_names: Set[String], ?published_constant_alias_names: Set[String], ?published_constant_ivars: Hash[String, Set[Symbol]], ?data_member_layouts: Hash[String, Array[Symbol]], ?struct_member_layouts: Hash[String, { members: Array[Symbol], keyword_init: bool }], ?param_inferred_types: Hash[[String, Symbol, Symbol], Hash[Symbol, Type::t]], ?run_generation: Object?) -> DiscoveryIndex
191
+ def with: (?declared_types: Hash[untyped, Type::t], ?class_ivars: Hash[String, Hash[Symbol, Type::t]], ?class_cvars: Hash[String, Hash[Symbol, Type::t]], ?program_globals: Hash[Symbol, Type::t], ?program_global_seeds: Hash[Symbol, Type::t], ?discovered_classes: Hash[String, Type::Singleton], ?in_source_constants: Hash[String, Type::t], ?discovered_methods: Hash[String, Hash[Symbol, Symbol]], ?discovered_def_nodes: Hash[String, Hash[Symbol, untyped]], ?discovered_def_nestings: Hash[untyped, Array[String]], ?discovered_singleton_def_nodes: Hash[String, Hash[Symbol, untyped]], ?discovered_def_sources: Hash[String, Hash[Symbol, String]], ?discovered_singleton_def_sources: Hash[String, Hash[Symbol, String]], ?discovered_method_visibilities: Hash[String, Hash[Symbol, Symbol]], ?discovered_parameter_envelopes: Hash[String, Hash[untyped, untyped]], ?discovered_superclasses: Hash[String, String], ?discovered_includes: Hash[String, Array[String]], ?discovered_prepends: Hash[String, Array[String]], ?discovered_extends: Hash[String, Array[String]], ?discovered_class_sources: Hash[String, Set[String]], ?constant_sources: Hash[String, Set[String]], ?constant_writers: Hash[String, Array[String]], ?constant_shadowers: Hash[String, Array[String]], ?published_constant_names: Set[String], ?local_constant_names: Set[String], ?published_constant_alias_names: Set[String], ?published_constant_ivars: Hash[String, Set[Symbol]], ?data_member_layouts: Hash[String, Array[Symbol]], ?struct_member_layouts: Hash[String, { members: Array[Symbol], keyword_init: bool }], ?param_inferred_types: Hash[[String, Symbol, Symbol], Hash[Symbol, Type::t]], ?discovered_deferred_ranges: Hash[String, Array[[Integer, Integer, Symbol?, Symbol?, String?]]], ?discovered_refinements: Hash[String, Hash[Symbol, Array[String]]], ?discovered_global_write_census: Set[Array[untyped]], ?run_generation: Object?, ?patched_line_readers: Set[Symbol], ?clears_last_status: bool, ?defines_case_equality: bool, ?implicit_self_evidence: untyped, ?possible_discovered_methods: Hash[String, Hash[Symbol, Symbol]], ?possible_discovered_deferred_ranges: Hash[String, Array[[Integer, Integer, Symbol?, Symbol?, String?]]], ?contested_discovered_def_nodes: Set[Array[untyped]], ?contested_discovered_singleton_def_nodes: Set[Array[untyped]], ?contested_discovered_method_visibilities: Set[Array[untyped]], ?contested_discovered_parameter_envelopes: Set[Array[untyped]]) -> DiscoveryIndex
99
192
  end
100
193
 
101
194
  class IndexedKey
@@ -119,6 +212,9 @@ module Rigor
119
212
  def struct_fold_safe?: (String | Symbol name) -> bool
120
213
  def entering_opaque_block: () -> Scope
121
214
  def opaque_block_self?: () -> bool
215
+ def with_singleton_class_body: (bool) -> Scope
216
+ # sig-gen gap: #1148 — sig-gen skips the endless-def reader (sig.skipped.untyped-return); the row is hand-written.
217
+ def singleton_class_body?: () -> bool
122
218
  def with_discovery: (DiscoveryIndex index) -> Scope
123
219
  def local: (String | Symbol name) -> Type::t?
124
220
  def ivar: (String | Symbol name) -> Type::t?
@@ -128,54 +224,115 @@ module Rigor
128
224
  def ivar_origin: (String | Symbol name) -> Symbol?
129
225
  def optimistic_local: (String | Symbol name) -> Symbol?
130
226
  def optimistic_ivar: (String | Symbol name) -> Symbol?
227
+ def optimistic_local_miss: (String | Symbol name) -> Object?
228
+ def optimistic_ivar_miss: (String | Symbol name) -> Object?
131
229
  def with_local: (String | Symbol name, Type::t type) -> Scope
132
230
  def with_ivar: (String | Symbol name, Type::t type) -> Scope
133
231
  def with_local_origin: (String | Symbol name, Symbol? cause) -> Scope
134
- def with_optimistic_local: (String | Symbol name, Symbol? cause) -> Scope
135
- def with_optimistic_ivar: (String | Symbol name, Symbol? cause) -> Scope
232
+ def with_optimistic_local: (String | Symbol name, Symbol? cause, ?miss: Object?) -> Scope
233
+ def with_optimistic_ivar: (String | Symbol name, Symbol? cause, ?miss: Object?) -> Scope
136
234
  def with_ivar_origin: (String | Symbol name, Symbol? cause) -> Scope
137
235
  def with_cvar: (String | Symbol name, Type::t type) -> Scope
138
236
  def with_global: (String | Symbol name, Type::t type) -> Scope
139
- # sig-gen gap: #667 — an `attr_reader` over a frozen Set literal types `untyped`, as the sibling
237
+ # Issue #1429 — `rigor sig-gen` output; the parameters are not inferred here, as for `with_mutated_local`.
238
+ def with_guarded_global: (untyped name, untyped type, untyped pre_guard, ?record: untyped) -> Scope
239
+ def with_constant_narrowing: (untyped key, untyped type, untyped pre_guard) -> Scope
240
+ # Issue #1446 — `rigor sig-gen` output.
241
+ def with_guarded_ivar: (untyped name, untyped type, untyped pre_guard) -> Scope
242
+ def without_ivar_guard: (untyped name) -> Scope
243
+ # sig-gen gap: #1154 — the table reader over an ivar `initialize` assigns from a parameter reaches `untyped`.
244
+ def guard_narrowed_ivar?: (untyped name) -> bool
245
+ # Issue #1446 — `rigor sig-gen` output.
246
+ def with_bot_guard_classes: (untyped kind, untyped name, untyped class_names) -> Scope
247
+ # sig-gen gap: #1154 — the table reader over an ivar `initialize` assigns from a parameter reaches `untyped`.
248
+ def bot_guard_classes_for: (untyped kind, untyped name) -> Array[String]?
249
+ def without_constant_narrowing: (untyped key) -> Scope
250
+ def guard_narrowed?: () -> bool
251
+ def forget_guard_narrowings: () -> Scope
252
+ def forget_guard_narrowing_of: (untyped kind, untyped name) -> Scope
253
+ def without_constant_narrowings_named: (untyped name) -> Scope
254
+ # sig-gen gap: #1154 — the table reader over an ivar `initialize` assigns from a parameter reaches `untyped`.
255
+ def constant_narrowing: (String key) -> Type::t?
256
+ # sig-gen gap: #1151 — an `attr_reader` over a frozen Set literal types `untyped`, as the sibling
140
257
  # `declaration_sourced` row does.
141
258
  def published_constant_sourced: () -> Set[[Symbol, Symbol]]
142
- # sig-gen gap: #667 — `Set#include?` over a tuple key types `untyped`, so the `bool` is hand-written.
259
+ # sig-gen gap: #1152 — `Set#include?` over a tuple key types `untyped`, so the `bool` is hand-written.
143
260
  def published_constant_sourced?: (Symbol kind, String | Symbol name) -> bool
144
261
  def with_published_constant_mark: (Symbol kind, String | Symbol name) -> Scope
145
- def declaration_sourced: () -> Set[[Symbol, Symbol]]
262
+ # Issue #1362 — a `[:global_copy, local, global]` record rides beside the `(kind, name)` refs.
263
+ def declaration_sourced: () -> Set[[Symbol, Symbol] | [Symbol, Symbol, Symbol]]
146
264
  def seed_declaration_sourced_ivar: (String | Symbol name, Type::t type) -> Scope
265
+ def seed_declaration_sourced_global: (String | Symbol name, Type::t type) -> Scope
266
+ def with_global_copy_marks: (String | Symbol name, Array[String | Symbol] globals) -> Scope
267
+ def without_local_declaration_marks: (String | Symbol name) -> Scope
268
+ # sig-gen gap: #1154 — the records come out of `@declaration_sourced`, an ivar assigned in `initialize` from a
269
+ # parameter, which reaches `untyped`.
270
+ def declaration_sourced_global_copies: (String | Symbol name) -> Array[Symbol]
147
271
  def with_declaration_sourced_local: (String | Symbol name, Type::t type) -> Scope
148
272
  def with_local_declaration_mark: (String | Symbol name) -> Scope
273
+ # `rigor sig-gen --params=observed` output; the siblings' hand-written `String | Symbol` / `Type::t`
274
+ # parameters are not inferred here either.
275
+ def with_mutated_local: (untyped name, untyped type) -> Scope
149
276
  def declaration_sourced?: (Symbol kind, String | Symbol name) -> bool
150
277
  def with_inferred_param_mark: (String | Symbol name) -> Scope
151
278
  def without_inferred_param_mark: (String | Symbol name) -> Scope
152
279
  def inferred_param?: (String | Symbol name) -> bool
153
280
  def forget_match_globals: () -> Scope
281
+ def untyped_match_globals: () -> Scope
282
+ def match_globals_bound?: () -> bool
283
+ def with_match_frame: (untyped body, ?untyped parameters) -> Scope
284
+ # sig-gen gap: #1154 — the frame reader over an ivar assigned in `initialize` from a parameter reaches
285
+ # `untyped`, so the `bool` is hand-written.
286
+ def match_rebinding_closure?: () -> bool
287
+ def forget_last_line: () -> Scope
288
+ def untyped_last_line: () -> Scope
289
+ # sig-gen gap: #1154 — the reader over the `@globals` ivar `initialize` assigns from a parameter reaches
290
+ # `untyped`, so the `bool` is hand-written.
291
+ def last_line_bound?: () -> bool
292
+ # sig-gen gap: #1154 — the frame reader over the `@match_frame` ivar `initialize` assigns from a parameter
293
+ # reaches `untyped`, so the `bool` is hand-written.
294
+ def last_line_closure?: () -> bool
295
+ def forget_error_info: () -> Scope
296
+ def untyped_error_info: () -> Scope
297
+ def forget_last_status: () -> Scope
298
+ def untyped_last_status: () -> Scope
154
299
  def class_ivars_for: (String | Symbol? class_name) -> Hash[Symbol, Type::t]
155
300
  def class_cvars_for: (String | Symbol? class_name) -> Hash[Symbol, Type::t]
156
301
  def discovered_method?: (String | Symbol class_name, String | Symbol method_name, Symbol kind) -> bool
157
- def user_def_for: (String | Symbol class_name, String | Symbol method_name) -> untyped?
158
- def user_def_through_ancestors: (String | Symbol class_name, String | Symbol method_name, ?name_memo: Hash[untyped, untyped]) -> ([untyped, String] | [nil, nil])
302
+ # authored: the slot is a Prism::DefNode or a DefHandle until ADR-119 C1d/C2 decide its type.
303
+ def def_node_slot: (untyped class_name, untyped method_name, ?Symbol kind) -> untyped
304
+ def user_def_for: (String | Symbol class_name, String | Symbol method_name) -> ::Prism::DefNode?
305
+ def user_def_through_ancestors: (String | Symbol class_name, String | Symbol method_name, ?name_memo: Hash[untyped, untyped]) -> ([::Prism::DefNode, String] | [nil, nil])
159
306
  def discovered_method_through_ancestors?: (String | Symbol? class_name, String | Symbol method_name, Symbol kind, ?name_memo: Hash[untyped, untyped]) -> bool
160
307
  def external_ancestor_name_candidates: (String | Symbol class_name, ?name_memo: Hash[untyped, untyped]) -> Array[Array[String]]
161
308
  def enqueue_ancestors: (String current, Array[String] queue, Hash[untyped, untyped] name_memo, ?mixins: bool) -> void
162
309
  def ancestor_name_candidates: (String | Symbol subclass_qualified, String | Symbol raw_ancestor) -> Array[String]
163
310
 
311
+ # sig-gen gap: #1148 — sig-gen skips the method (sig.skipped.untyped-return: every decline returns the
312
+ # frozen EMPTY_HEADER_NESTING constant); the row is hand-written.
313
+ def ambiguous_ancestor_resolutions: (String | Symbol subclass_qualified, String | Symbol raw_ancestor) -> Array[String]
314
+
164
315
  # Issue #530 — public so the external-gem ancestry probe asks the same question the walk does.
165
316
  def known_user_class?: (String | Symbol name) -> bool
166
- def singleton_def_for: (String | Symbol class_name, String | Symbol method_name) -> untyped?
167
- def singleton_def_through_ancestors: (String | Symbol class_name, String | Symbol method_name, ?name_memo: Hash[untyped, untyped]) -> ([untyped, String] | [nil, nil])
317
+ def singleton_def_for: (String | Symbol class_name, String | Symbol method_name) -> ::Prism::DefNode?
318
+ def singleton_def_through_ancestors: (String | Symbol class_name, String | Symbol method_name, ?name_memo: Hash[untyped, untyped]) -> ([::Prism::DefNode, String] | [nil, nil])
168
319
  def user_def_site_for: (String | Symbol class_name, String | Symbol method_name) -> String?
169
320
  def user_singleton_def_site_for: (String | Symbol class_name, String | Symbol method_name) -> String?
170
- def top_level_def_for: (String | Symbol method_name) -> untyped?
171
- def bindable_top_level_def_for: (String | Symbol method_name) -> untyped?
321
+ # sig-gen gap: #1167 — the predicate forwards its untyped `Prism::CallNode` into the range scan,
322
+ # which reads `call_node.location` off it: a `Dynamic` receiver answers `Dynamic`, not `bool`, so
323
+ # sig-gen skips the method (and `def_shadows_call?` above it) as an untyped return.
324
+ def singleton_def_shadows_call?: (String | Symbol class_name, String | Symbol method_name, untyped call_node) -> bool
325
+ # sig-gen gap: #1167 — the instance-side twin: the same untyped `call_node`, the same untyped-return skip.
326
+ def instance_def_shadows_call?: (String | Symbol class_name, String | Symbol method_name, untyped call_node) -> bool
327
+ def top_level_def_for: (String | Symbol method_name) -> ::Prism::DefNode?
328
+ def bindable_top_level_def_for: (String | Symbol method_name) -> ::Prism::DefNode?
172
329
  def toplevel?: () -> bool
173
330
  def discovered_method_visibility: (String | Symbol class_name, String | Symbol method_name) -> Symbol?
174
331
  def superclass_of: (String | Symbol class_name) -> String?
175
332
  def data_member_layout: (String | Symbol class_name) -> Array[Symbol]?
176
333
  def struct_member_layout: (String | Symbol class_name) -> { members: Array[Symbol], keyword_init: bool }?
177
334
  def includes_of: (String | Symbol class_name) -> Array[String]
178
- # sig-gen gap: #898 — sig-gen proposes `Array[untyped] | []` off the empty-table early return, so the
335
+ # sig-gen gap: #1153 — sig-gen proposes `Array[untyped] | []` off the empty-table early return, so the
179
336
  # element type is hand-written, matching {#includes_of}.
180
337
  def singleton_extends_of: (String | Symbol class_name) -> Array[String]
181
338
  def indexed_narrowing: (Symbol receiver_kind, String | Symbol receiver_name, untyped key) -> Type::t?
@@ -1,11 +1,18 @@
1
+ # `Rigor::SigGen` itself has no other declaration under `sig/`; without this shell `rbs validate`
2
+ # rejects the two declarations below with `Could not find ::Rigor::SigGen`.
3
+ module Rigor::SigGen
4
+ end
5
+
6
+ # Every entry is built from string literals in `SkipReasonCatalog::ENTRIES`, so the four readers
7
+ # answer `String`.
1
8
  class Rigor::SigGen::SkipReasonCatalog::Entry < ::Data
2
- def id: () -> untyped
3
- def summary: () -> untyped
4
- def explanation: () -> untyped
5
- def next_step: () -> untyped
6
- def self.new: (id: untyped, summary: untyped, explanation: untyped, next_step: untyped) -> instance | (untyped id, untyped summary, untyped explanation, untyped next_step) -> instance
7
- def self.[]: (id: untyped, summary: untyped, explanation: untyped, next_step: untyped) -> instance | (untyped id, untyped summary, untyped explanation, untyped next_step) -> instance
8
- def to_h: () -> Hash[String, untyped]
9
+ def id: () -> String
10
+ def summary: () -> String
11
+ def explanation: () -> String
12
+ def next_step: () -> String
13
+ def self.new: (id: String, summary: String, explanation: String, next_step: String) -> instance | (String id, String summary, String explanation, String next_step) -> instance
14
+ def self.[]: (id: String, summary: String, explanation: String, next_step: String) -> instance | (String id, String summary, String explanation, String next_step) -> instance
15
+ def to_h: () -> Hash[String, String]
9
16
  end
10
17
 
11
18
  module Rigor::SigGen::SkipReasonCatalog
data/sig/rigor/source.rbs CHANGED
@@ -4,11 +4,11 @@ module Rigor
4
4
  class OutOfRangeError < StandardError
5
5
  end
6
6
 
7
- def self.at_position: (source: String, root: untyped, line: Integer, column: Integer) -> untyped?
8
- def self.at_offset: (root: untyped, offset: Integer) -> untyped?
7
+ def self.at_position: (source: String, root: untyped, line: Integer, column: Integer) -> ::Prism::Node?
8
+ def self.at_offset: (root: untyped, offset: Integer) -> ::Prism::Node?
9
9
  def initialize: (source: String, root: untyped) -> void
10
- def at_position: (line: Integer, column: Integer) -> untyped?
11
- def at_offset: (Integer offset) -> untyped?
10
+ def at_position: (line: Integer, column: Integer) -> ::Prism::Node?
11
+ def at_offset: (Integer offset) -> ::Prism::Node?
12
12
  end
13
13
 
14
14
  module Literals
@@ -1,9 +1,15 @@
1
1
  module Rigor
2
2
  module Testing
3
- def self?.dump_type: (untyped value) -> untyped
4
- def self?.assert_type: (String expected, untyped value) -> untyped
3
+ # Both helpers return `value` unchanged (lib/rigor/testing.rb); the type variable carries the
4
+ # argument's type through so a probed expression stays typed downstream instead of widening to
5
+ # `Dynamic[top]`. `A` binds only on a dispatch that carries a scope — a `Rigor.` /
6
+ # `Rigor::Testing.` receiver, or an including class that is RBS-known. A bare `dump_type(x)` after
7
+ # `include Rigor::Testing` in a discovered-only class still reaches the ancestor fallback without a
8
+ # scope and answers `Dynamic[top]`, as it did under `-> untyped` (#303 follow-up).
9
+ def self?.dump_type: [A] (A value) -> A
10
+ def self?.assert_type: [A] (String expected, A value) -> A
5
11
  end
6
12
 
7
- def self.dump_type: (untyped value) -> untyped
8
- def self.assert_type: (String expected, untyped value) -> untyped
13
+ def self.dump_type: [A] (A value) -> A
14
+ def self.assert_type: [A] (String expected, A value) -> A
9
15
  end
data/sig/rigor/type.rbs CHANGED
@@ -429,8 +429,14 @@ module Rigor
429
429
  attr_reader trinary: Trinary
430
430
  attr_reader mode: accepts_mode
431
431
  attr_reader reasons: Array[String]
432
+ # sig-gen gap: #1155 — the memoized `||=` return is an honest union with an
433
+ # untyped arm (the slot read cannot prove the memoized value), so sig-gen
434
+ # skips it (sig.skipped.untyped-return); the runtime result is always
435
+ # AcceptsResult and the row is hand-written.
432
436
  def self.yes: (?mode: accepts_mode, ?reasons: (Array[String] | String)?) -> AcceptsResult
437
+ # sig-gen gap: #1155 — same memoized `||=` untyped-return gap as `self.yes`.
433
438
  def self.no: (?mode: accepts_mode, ?reasons: (Array[String] | String)?) -> AcceptsResult
439
+ # sig-gen gap: #1155 — same memoized `||=` untyped-return gap as `self.yes`.
434
440
  def self.maybe: (?mode: accepts_mode, ?reasons: (Array[String] | String)?) -> AcceptsResult
435
441
  def initialize: (Trinary trinary, ?mode: accepts_mode, ?reasons: (Array[String] | String)?) -> void
436
442
  def yes?: () -> bool
data/sig/rigor.rbs CHANGED
@@ -124,32 +124,50 @@ module Rigor
124
124
  attr_reader buffer: untyped
125
125
  attr_reader file_dependencies: Hash[String, untyped]
126
126
  attr_reader analyzed_files: Array[String]
127
- def initialize: (configuration: Configuration, ?explain: bool, ?cache_store: untyped, ?plugin_requirer: untyped, ?workers: Integer, ?collect_stats: bool, ?buffer: untyped, ?prebuilt: untyped, ?environment: untyped, ?record_dependencies: bool, ?analyze_only: untyped) -> void
127
+ def initialize: (configuration: Configuration, ?explain: bool, ?cache_store: untyped, ?plugin_requirer: untyped, ?workers: Integer, ?collect_stats: bool, ?buffer: untyped, ?prebuilt: Analysis::ProjectScan?, ?environment: untyped, ?record_dependencies: bool, ?analyze_only: untyped) -> void
128
128
  def run: (?Array[String] paths) -> Result
129
129
  def run_source: (source: String, ?path: String) -> Result
130
130
  def analysis_file_set: (?Array[String] paths) -> Array[String]
131
131
  def file_dependents: () -> Hash[String, untyped]
132
- def prepare_project_scan: (?paths: Array[String]) -> untyped
132
+ def prepare_project_scan: (?paths: Array[String]) -> Analysis::ProjectScan
133
133
  # ADR-103 — the propagated effect graph and the merged per-file collections behind it. A report
134
- # surface: never a diagnostic, empty when the configuration carries no `effects:` block. Typed
135
- # `untyped` for the same reason `cache_store` is — `Rigor::Effects` is not sig-covered yet
136
- # (`spec/rigor/public_api_drift_spec.rb`), and a named reference would raise `RBS::UnknownTypeName`.
137
- def effect_table: () -> untyped
138
- def effect_collection: () -> untyped
139
- # #381 — `{ "Class#m" => [path] }`, which the snapshot's `reach:` globs match against. Same
140
- # `untyped` reasoning as its two siblings above.
141
- def effect_sources: () -> untyped
142
- # #387 — the loaded plugins' compiled effect contributions, read by `rigor effects` so the snapshot's
143
- # vocabulary is the one the collection window scanned under. Same `untyped` reasoning again.
144
- def effect_plugin_facts: () -> untyped
134
+ # surface: never a diagnostic, empty when the configuration carries no `effects:` block.
135
+ def effect_table: () -> Effects::EffectTable
136
+ def effect_collection: () -> Effects::FileCollection
137
+ # ADR-103 WD9 (#391): the resolved envelope index `rigor sig-gen`'s annotation emission
138
+ # consults, built on demand so a warm-cache run still serves the same strata.
139
+ def effect_envelopes: () -> Effects::EnvelopeIndex
140
+ # #381 — `{ "Class#m" => [path] }`, which the snapshot's `reach:` globs match against.
141
+ def effect_sources: () -> Hash[String, Array[String]]
142
+ # #387 — the loaded plugins' compiled effect contributions, read by `rigor effects` so the
143
+ # snapshot's vocabulary is the one the collection window scanned under.
144
+ def effect_plugin_facts: () -> Effects::PluginFacts
145
+ # The run's as-written superclass table — what `effect.liskov-widened` reads.
146
+ def effect_ancestry: () -> Hash[String, String]
147
+ # `{ "lib/a.rb" => FileCollection, … }` — the per-file collections the caches persist (#382).
148
+ def effect_collections_by_path: () -> Hash[String, Effects::FileCollection]
149
+ # Issue #382 — adopt persisted collections as this run's own (the warm-hit half of the
150
+ # whole-run effects slot).
151
+ def adopt_effect_collections: (Hash[String, Effects::FileCollection] collections,
152
+ ?table: Effects::EffectTable?) -> void
153
+ # #482 — adopt the served run's small summary entry, collections left behind a loader.
154
+ def adopt_effect_summary: (table: Effects::EffectTable, sources: Hash[String, Array[String]],
155
+ ancestry: Hash[String, String], collections_loader: untyped) -> void
156
+ # Whether this run's effect collections came from the whole-run effects slot (#382).
157
+ def effects_served_from_cache?: () -> bool
145
158
  # The incremental session's read surface (ADR-46 / ADR-67 / ADR-103) — `IncrementalSession`
146
- # drives a live Runner through these between rechecks. Typed `untyped` like the cache / effects
147
- # readers above until their namespaces are sig-covered.
148
- def return_summaries: () -> untyped
149
- def param_inferred_types: () -> untyped
150
- def effect_collections_by_path: () -> untyped
151
- def collect_param_inference_table: (untyped files) -> untyped
152
- def evaluate_return_types: (untyped paths, untyped specs) -> untyped
159
+ # drives a live Runner through these between rechecks.
160
+ # sig-gen gap: #1008 — `result` is populated by `collect_return_summaries` mutating it by
161
+ # reference from a sibling method; sig-gen folds only the `{}` seed and the empty-memo early
162
+ # return, so it proposes the seed shape instead of the honest, usually-non-empty contract.
163
+ # Keys are `[path, "Class#method"]` pairs; values are `{ keys:, returns:, effects: }` bundles.
164
+ def return_summaries: () -> Hash[[String, String], Hash[Symbol, untyped]]
165
+ # ADR-67 — `[class_name, method_name, kind] => { param_name => Type }`.
166
+ def param_inferred_types: () -> Hash[[String, Symbol, Symbol], Hash[Symbol, Type::t]]
167
+ def collect_param_inference_table: (untyped files) -> Hash[[String, Symbol, Symbol], Hash[Symbol, Type::t]]
168
+ # `{ class_name:, method_name:, singleton: }` spec triple => the per-key return descriptors
169
+ # (`describe(:short)` strings; nil for a missing/bodyless def).
170
+ def evaluate_return_types: (untyped paths, untyped specs) -> Hash[[String, Symbol, bool], Array[String?]]
153
171
  end
154
172
  end
155
173