rigortype 0.2.1 → 0.2.3

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 (109) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +41 -14
  3. data/docs/handbook/01-getting-started.md +311 -0
  4. data/docs/handbook/02-everyday-types.md +337 -0
  5. data/docs/handbook/03-narrowing.md +359 -0
  6. data/docs/handbook/04-tuples-and-shapes.md +321 -0
  7. data/docs/handbook/05-methods-and-blocks.md +339 -0
  8. data/docs/handbook/06-classes.md +305 -0
  9. data/docs/handbook/07-rbs-and-extended.md +427 -0
  10. data/docs/handbook/08-understanding-errors.md +373 -0
  11. data/docs/handbook/09-plugins.md +241 -0
  12. data/docs/handbook/10-sorbet.md +347 -0
  13. data/docs/handbook/11-sig-gen.md +312 -0
  14. data/docs/handbook/12-lightweight-hkt.md +333 -0
  15. data/docs/handbook/README.md +275 -0
  16. data/docs/handbook/appendix-elixir.md +370 -0
  17. data/docs/handbook/appendix-go.md +399 -0
  18. data/docs/handbook/appendix-java-csharp.md +470 -0
  19. data/docs/handbook/appendix-liskov.md +580 -0
  20. data/docs/handbook/appendix-mypy.md +370 -0
  21. data/docs/handbook/appendix-phpstan.md +338 -0
  22. data/docs/handbook/appendix-protocols-and-structural-typing.md +292 -0
  23. data/docs/handbook/appendix-rust.md +446 -0
  24. data/docs/handbook/appendix-steep.md +336 -0
  25. data/docs/handbook/appendix-type-theory.md +1662 -0
  26. data/docs/handbook/appendix-typeprof.md +416 -0
  27. data/docs/handbook/appendix-typescript.md +332 -0
  28. data/docs/install.md +189 -0
  29. data/docs/llms.txt +72 -0
  30. data/docs/manual/01-installation.md +342 -0
  31. data/docs/manual/02-cli-reference.md +569 -0
  32. data/docs/manual/03-configuration.md +152 -0
  33. data/docs/manual/04-diagnostics.md +206 -0
  34. data/docs/manual/05-inspecting-types.md +109 -0
  35. data/docs/manual/06-baseline.md +104 -0
  36. data/docs/manual/07-plugins.md +92 -0
  37. data/docs/manual/08-skills.md +143 -0
  38. data/docs/manual/09-editor-integration.md +245 -0
  39. data/docs/manual/10-mcp-server.md +539 -0
  40. data/docs/manual/11-ci.md +274 -0
  41. data/docs/manual/12-caching.md +116 -0
  42. data/docs/manual/13-troubleshooting.md +120 -0
  43. data/docs/manual/14-rails-quickstart.md +332 -0
  44. data/docs/manual/15-type-protection-coverage.md +204 -0
  45. data/docs/manual/16-rbs-extended-annotations.md +190 -0
  46. data/docs/manual/17-driving-improvement.md +160 -0
  47. data/docs/manual/README.md +87 -0
  48. data/docs/manual/ci-templates/README.md +58 -0
  49. data/docs/manual/plugins/README.md +86 -0
  50. data/docs/manual/plugins/rigor-actioncable.md +78 -0
  51. data/docs/manual/plugins/rigor-actionmailer.md +74 -0
  52. data/docs/manual/plugins/rigor-actionpack.md +80 -0
  53. data/docs/manual/plugins/rigor-activejob.md +58 -0
  54. data/docs/manual/plugins/rigor-activerecord.md +102 -0
  55. data/docs/manual/plugins/rigor-activestorage.md +74 -0
  56. data/docs/manual/plugins/rigor-activesupport-core-ext.md +86 -0
  57. data/docs/manual/plugins/rigor-devise.md +70 -0
  58. data/docs/manual/plugins/rigor-dry-schema.md +56 -0
  59. data/docs/manual/plugins/rigor-dry-struct.md +60 -0
  60. data/docs/manual/plugins/rigor-dry-types.md +59 -0
  61. data/docs/manual/plugins/rigor-dry-validation.md +62 -0
  62. data/docs/manual/plugins/rigor-factorybot.md +76 -0
  63. data/docs/manual/plugins/rigor-graphql.md +89 -0
  64. data/docs/manual/plugins/rigor-hanami.md +83 -0
  65. data/docs/manual/plugins/rigor-mangrove.md +73 -0
  66. data/docs/manual/plugins/rigor-minitest.md +86 -0
  67. data/docs/manual/plugins/rigor-pundit.md +72 -0
  68. data/docs/manual/plugins/rigor-rails-i18n.md +92 -0
  69. data/docs/manual/plugins/rigor-rails-routes.md +94 -0
  70. data/docs/manual/plugins/rigor-rails.md +44 -0
  71. data/docs/manual/plugins/rigor-rbs-inline.md +83 -0
  72. data/docs/manual/plugins/rigor-rspec-rails.md +72 -0
  73. data/docs/manual/plugins/rigor-rspec.md +86 -0
  74. data/docs/manual/plugins/rigor-shoulda-matchers.md +78 -0
  75. data/docs/manual/plugins/rigor-sidekiq.md +78 -0
  76. data/docs/manual/plugins/rigor-sinatra.md +61 -0
  77. data/docs/manual/plugins/rigor-sorbet.md +63 -0
  78. data/docs/manual/plugins/rigor-statesman.md +75 -0
  79. data/docs/manual/plugins/rigor-typescript-utility-types.md +71 -0
  80. data/exe/rigor +1 -1
  81. data/lib/rigor/analysis/incremental_session.rb +4 -2
  82. data/lib/rigor/analysis/run_stats.rb +13 -1
  83. data/lib/rigor/analysis/runner.rb +54 -12
  84. data/lib/rigor/cli/check_command.rb +1 -1
  85. data/lib/rigor/cli/docs_command.rb +248 -0
  86. data/lib/rigor/cli/skill_command.rb +103 -41
  87. data/lib/rigor/cli/skill_describe.rb +346 -0
  88. data/lib/rigor/cli/triage_command.rb +8 -2
  89. data/lib/rigor/cli/triage_renderer.rb +4 -0
  90. data/lib/rigor/cli.rb +25 -3
  91. data/lib/rigor/inference/method_dispatcher/constant_folding.rb +124 -32
  92. data/lib/rigor/inference/method_dispatcher/shape_dispatch.rb +37 -6
  93. data/lib/rigor/inference/scope_indexer.rb +87 -89
  94. data/lib/rigor/plugin/isolation.rb +5 -5
  95. data/lib/rigor/plugin/loader.rb +4 -2
  96. data/lib/rigor/triage/catalogue.rb +16 -1
  97. data/lib/rigor/triage.rb +30 -7
  98. data/lib/rigor/version.rb +1 -1
  99. data/skills/rigor-ask/SKILL.md +172 -0
  100. data/skills/rigor-doctor/SKILL.md +87 -0
  101. data/skills/rigor-editor-setup/SKILL.md +114 -0
  102. data/skills/rigor-mcp-setup/SKILL.md +117 -0
  103. data/skills/rigor-monkeypatch-resolve/SKILL.md +79 -0
  104. data/skills/rigor-next-steps/SKILL.md +113 -0
  105. data/skills/rigor-plugin-tune/SKILL.md +79 -0
  106. data/skills/rigor-protection-uplift/SKILL.md +133 -0
  107. data/skills/rigor-rbs-setup/SKILL.md +128 -0
  108. data/skills/rigor-upgrade/SKILL.md +79 -0
  109. metadata +90 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 11db7e9c0140dbb303b0644587e80cc683e5a9ee32791c007234dd12e37ecb21
4
- data.tar.gz: 375cbd7387b2f8cac6d668db993b34e627d19ebacf74e5092c17c8717191b401
3
+ metadata.gz: 775a0b6e3050294352d505366428814ab73348d2ced5ccf45842644c38752155
4
+ data.tar.gz: 7ec72c4aa56cbb43ae18dd3c1a029da3bb6746a604c4a3d72811b34b5d1c1439
5
5
  SHA512:
6
- metadata.gz: 42a9121e67acbf27afc287c586c7b3cd9fbd271a0de9e0a7f28a1e57703ffb578572213402e37f57b7327572c944f799a186ccc0a13dbe1fba49eca02c39df6b
7
- data.tar.gz: d5b333586309d0b25b17880608797e005a2083bad60d91e2a20163265cb31b948a08363ef4f37920862dc7ee5da3fb0cd1d7c67a7af6f64b1bc37d8721469f6c
6
+ metadata.gz: cc0650acb783740184fb76f0c5382fefe3950bd84011c84ccd2e23a60ff703519de94a294b39e96e11198748b2539917fae117972be7366dd06725ee54975935
7
+ data.tar.gz: d06b60ff922cfb4ab77ea680b5d624702a4f782b65c1dcb2e3f631793fe90cb4bb8302d50ac5a3656cbd1a1fe79e198cfee9c8641b037acf48906ae1aa63eeb8
data/README.md CHANGED
@@ -4,20 +4,25 @@
4
4
  [![GitHub License](https://img.shields.io/github/license/rigortype/rigor)](https://github.com/rigortype/rigor/blob/master/LICENSE)
5
5
  [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/rigortype/rigor)
6
6
 
7
- **Type-aware bug finding for Ruby — zero annotations, and a
8
- zero-false-positive bar enforced against real codebases.** Run one
9
- command over the code you already have, and trust every line of
10
- output.
7
+ **Type-aware bug finding for Ruby — no annotations required, and a
8
+ zero-false-positive bar enforced against real codebases.** Built on
9
+ RBS: Rigor infers types from the values your code produces, reads any
10
+ RBS you write as an authoritative source, and generates more — but
11
+ needs none to start. Run one command over the code you already have,
12
+ and trust every line of output.
11
13
 
12
14
  ```sh
13
- gem install rigortype && rigor check app lib
15
+ mise use -g ruby@4.0 gem:rigortype # install the tool, globally, on Ruby 4.0
16
+ rigor check app lib # find bugs in the code you already have
14
17
  ```
15
18
 
16
- (The tool itself runs on Ruby 4.0; your project can stay on whatever
17
- Ruby it targets see [Get started](#get-started-in-one-prompt).)
19
+ (The tool runs on Ruby 4.0 while your project keeps its own Ruby; the
20
+ global `-g` install keeps it off your project's pins. See
21
+ [Get started](#get-started-in-one-prompt).)
18
22
 
19
- No type annotations to write or maintain, no runtime dependency, no
20
- changes to your code. Rigor parses Ruby with
23
+ No annotations required, no runtime dependency, no changes to your
24
+ code and any RBS you do add, Rigor reads and uses. Rigor parses Ruby
25
+ with
21
26
  [Prism](https://github.com/ruby/prism) and runs a flow-sensitive
22
27
  inference engine that reasons about the *values* your expressions
23
28
  produce — not just their classes. It catches undefined methods (and
@@ -106,13 +111,14 @@ Bahasa Indonesia, Polski, Українська, Русский, Română, Türk
106
111
  the [installation guide](https://rigor.typedduck.fail/reference/manual/01-installation/#set-up-in-your-language).
107
112
 
108
113
  **Manual install** — Rigor is a tool, not a library: install it
109
- independently, **not** in your project's `Gemfile`. It runs on Ruby
110
- 4.0 regardless of which Ruby your project targets
111
- ([`mise`](https://mise.jdx.dev/) provisions both, pinned per project):
114
+ independently, **not** in your project's `Gemfile`. Install it
115
+ **globally** so `rigor` is on your `PATH` everywhere, running on Ruby
116
+ 4.0 while each project keeps its own Ruby — the `-g` install lives in
117
+ your global [`mise`](https://mise.jdx.dev/) config and never touches a
118
+ project's pins:
112
119
 
113
120
  ```sh
114
- mise use ruby@4.0
115
- mise use gem:rigortype # or: gem install rigortype
121
+ mise use -g ruby@4.0 gem:rigortype # or: gem install rigortype
116
122
  ```
117
123
 
118
124
  The gem is named `rigortype` (the name `rigor` was taken on RubyGems);
@@ -202,6 +208,27 @@ walks the whole type model; the
202
208
  and [user manual](https://rigor.typedduck.fail/reference/manual/) are
203
209
  the reference companions.
204
210
 
211
+ **Stuck on Rigor — or just curious how it works? Ask your agent in
212
+ plain language.** The whole skill surface collapses to two an agent (and
213
+ you) need to remember: **`rigor-next-steps`** ("what should we do
214
+ next?") and **`rigor-ask`** ("answer this about Rigor"). Rigor is niche
215
+ and fast-moving, so a model's *remembered* answer is often stale —
216
+ `rigor-ask` **investigates instead**: it reads Rigor's own handbook and
217
+ manual (bundled in the gem, served **offline** by `rigor docs`, always
218
+ matching your installed version) *and* runs Rigor over your actual code
219
+ (`rigor check` / `annotate` / `type-of`), then answers from what it
220
+ found — citing the page, or the inferred type. Ask *"why is this
221
+ flagged?"*, *"how does narrowing work?"*, *"how is it different from
222
+ Sorbet?"*, *"does it handle Sidekiq?"*, or *"how do I type this
223
+ method?"* — you only have to remember the question, never the command.
224
+ To browse the docs yourself:
225
+
226
+ ```sh
227
+ rigor docs # the offline doc index
228
+ rigor docs handbook/03-narrowing # any handbook or manual page by name
229
+ rigor docs --list # list every bundled page
230
+ ```
231
+
205
232
  ## Status
206
233
 
207
234
  Current release: **`v0.2.0`** (2026-06-17) — the first
@@ -0,0 +1,311 @@
1
+ # Getting started
2
+
3
+ By the end of this chapter you will be able to:
4
+
5
+ - get `rigor` onto your `PATH` (the fast AI-assisted way, or
6
+ by hand);
7
+ - run `rigor check` and read the diagnostics it prints;
8
+ - understand the "no annotations needed" stance that sets
9
+ Rigor apart from most checkers, and the escape hatches for
10
+ when inference falls short.
11
+
12
+ It is the only chapter you must read top to bottom. The rest
13
+ of the handbook is reference you can dip into later.
14
+
15
+ ## Installing Rigor
16
+
17
+ Rigor is a tool, not a library — like a linter or a compiler, it
18
+ analyses your project but is not part of its runtime. **Do not add
19
+ it to your application's `Gemfile`.** Install it on its own and
20
+ point it at your project.
21
+
22
+ Rigor itself runs on Ruby 4.0, independently of the Ruby your own
23
+ code targets. The [`target_ruby:` config key](#the-config-file)
24
+ tells Rigor which Ruby *your* project runs.
25
+
26
+ ### The fast path: let an AI agent set it up
27
+
28
+ If you work with an AI coding agent (Claude Code or any assistant
29
+ that supports [Agent Skills](https://agentskills.io/)), hand it
30
+ this prompt:
31
+
32
+ ```
33
+ Install Rigor in this project by following the instructions at
34
+ https://raw.githubusercontent.com/rigortype/rigor/refs/heads/master/docs/install.md
35
+ ```
36
+
37
+ The agent detects your environment, installs Rigor, then runs the
38
+ **`rigor-project-init` skill** — which walks your `Gemfile`,
39
+ proposes a plugin set matched to your framework, picks an adoption
40
+ mode, and writes `.rigor.dist.yml` for you. No manual YAML editing.
41
+ This is the recommended path; the [config file](#the-config-file)
42
+ section below shows what the skill produces so you can read and
43
+ tweak it afterwards.
44
+
45
+ The same prompt is available in sixteen languages in the
46
+ [Rails quickstart](../manual/14-rails-quickstart.md#step-1--install-ruby-40-and-rigor-common-to-both-paths).
47
+
48
+ ### The manual path: mise
49
+
50
+ If you prefer to drive the setup yourself, the recommended runtime
51
+ version manager is [`mise`](https://mise.jdx.dev/), which
52
+ provisions both Ruby 4.0 and Rigor:
53
+
54
+ ```sh
55
+ mise use ruby@4.0
56
+ mise use gem:rigortype
57
+ ```
58
+
59
+ With mise activated in your shell, `rigor` is on your `PATH`. The
60
+ gem is named `rigortype` (the name `rigor` was taken on RubyGems);
61
+ the executable it installs is `rigor`. If you already have Ruby
62
+ 4.0, `gem install rigortype` works too.
63
+
64
+ For shell activation and shims, `asdf`, and developing inside a
65
+ container, see [Installing Rigor](../manual/01-installation.md);
66
+ for continuous integration, see
67
+ [Running Rigor in CI](../manual/11-ci.md).
68
+
69
+ ## What does `rigor check` look at?
70
+
71
+ Rigor reads your `.rb` files, runs a flow-sensitive type
72
+ inference engine over each one, consults any `sig/*.rbs`
73
+ declarations available to your project, and reports a small
74
+ catalogue of bugs:
75
+
76
+ - methods called on the wrong receiver class;
77
+ - methods called with the wrong number of arguments;
78
+ - arithmetic that can be proved to raise (`5 / 0`);
79
+ - arguments whose type does not satisfy a refined parameter
80
+ contract;
81
+ - a few more, all listed in
82
+ [Chapter 8 — Understanding errors](08-understanding-errors.md).
83
+
84
+ Rigor does **not** ask you to write type annotations in
85
+ your Ruby source. It infers as much as it can, and stays
86
+ silent everywhere it cannot prove a narrower type.
87
+ A diagnostic only fires when Rigor has enough static
88
+ information to be confident.
89
+
90
+ ## The smallest working session
91
+
92
+ Drop into your project root and run:
93
+
94
+ ```sh
95
+ rigor check lib
96
+ ```
97
+
98
+ That walks every `.rb` under `lib/`. When the analyzer finds
99
+ nothing to complain about, it prints `No diagnostics` and
100
+ exits `0`:
101
+
102
+ ```text
103
+ No diagnostics
104
+ ```
105
+
106
+ When it does find something, each diagnostic is one line. Given
107
+ this file:
108
+
109
+ ```ruby
110
+ # lib/demo.rb
111
+ "hello".no_such_method # typo'd method name
112
+ [1, 2, 3].rotate(1, 2) # too many arguments
113
+ ```
114
+
115
+ `rigor check lib/demo.rb` prints:
116
+
117
+ ```text
118
+ lib/demo.rb:1:9: error: undefined method `no_such_method' for "hello" [call.undefined-method]
119
+ lib/demo.rb:2:11: error: wrong number of arguments to `rotate' on Array (given 2, expected 0..1) [call.wrong-arity]
120
+ ```
121
+
122
+ To run on a single file, pass the file instead of a directory:
123
+
124
+ ```sh
125
+ rigor check path/to/file.rb
126
+ ```
127
+
128
+ And to ask what Rigor inferred at one precise position:
129
+
130
+ ```sh
131
+ rigor type-of lib/foo.rb:10:5
132
+ ```
133
+
134
+ That prints both the rich Rigor type and the conservative
135
+ RBS erasure (the type a non-Rigor RBS tool would see). It is
136
+ the fastest way to ask "what does Rigor think this expression
137
+ produces?"
138
+
139
+ ## Reading a diagnostic
140
+
141
+ Take the first line from the run above:
142
+
143
+ ```text
144
+ lib/demo.rb:1:9: error: undefined method `no_such_method' for "hello" [call.undefined-method]
145
+ ```
146
+
147
+ | Slice | Meaning |
148
+ | --- | --- |
149
+ | `lib/demo.rb:1:9` | File, 1-indexed line, 1-indexed column |
150
+ | `error` | Severity (`error` / `warning` / `info`) |
151
+ | `undefined method ...` | Human-readable message |
152
+ | `[call.undefined-method]` | The qualified rule identifier |
153
+
154
+ The qualified rule identifier is the handle you use to silence,
155
+ demote, or look up a rule. The quickest is an in-source comment
156
+ on the offending line:
157
+
158
+ ```ruby
159
+ "hello".no_such_method # rigor:disable call.undefined-method
160
+ ```
161
+
162
+ The same identifier also drives the `disable:` and
163
+ `severity_overrides:` config keys, and family wildcards work
164
+ (`# rigor:disable call` suppresses every `call.*` rule on that
165
+ line). The full list of families and rules, and when to reach
166
+ for each suppression mechanism, is in
167
+ [Chapter 8 — Understanding errors](08-understanding-errors.md).
168
+
169
+ ## The "no annotations" stance
170
+
171
+ Most static checkers ask the user to annotate types. Rigor
172
+ does the opposite: it looks at what your Ruby code does and
173
+ **proves** types from the values themselves. Three quick
174
+ examples:
175
+
176
+ ```ruby
177
+ n = 100
178
+ m = n + 1
179
+ assert_type("101", m) # arithmetic folds
180
+ ```
181
+
182
+ ```ruby
183
+ def kind(x)
184
+ case x
185
+ when Integer then :int
186
+ when String then :str
187
+ end
188
+ end
189
+ assert_type(":int | :str | nil", kind(7)) # union of all case branches
190
+ ```
191
+
192
+ ```ruby
193
+ greeting = "Hello, " # Constant<"Hello, ">
194
+ name = ARGV.first # String? (RBS-declared)
195
+ hello = "#{greeting}#{name}!" # literal-string carrier:
196
+ # every interpolated part
197
+ # is itself literal-string-
198
+ # compatible, so the result
199
+ # is "provably source-derived"
200
+ ```
201
+
202
+ You did not write a single annotation. Rigor reasons about the
203
+ values directly.
204
+
205
+ > The `assert_type(...)` line is Rigor's introspection helper,
206
+ > not a runtime check — it pins the inferred type at that point
207
+ > so you can compare the prose to the analyzer's actual output.
208
+ > See [How to read this handbook](README.md#how-to-read-this-handbook)
209
+ > for the full snippet convention.
210
+
211
+ When inference cannot prove a narrower type, the engine
212
+ returns `Dynamic[top]` (the gradual carrier — "could be any
213
+ Ruby value") and stays silent. Rigor never invents
214
+ diagnostics it cannot prove.
215
+
216
+ ## When inference is not enough
217
+
218
+ *First read? Skip this section.* Out of the box, inference plus
219
+ any RBS your gems already ship covers most code, and the next
220
+ chapters teach you to read what it produces. Come back here when
221
+ Rigor resolves something to `Dynamic[top]` that you wish it knew
222
+ more about. For most projects only escape hatches (1) and (2)
223
+ ever come up.
224
+
225
+ There are five escape hatches, in rough order of how often you
226
+ will need them:
227
+
228
+ 1. **Add an `.rbs` file.** Drop a signature into `sig/` and
229
+ Rigor picks it up automatically. This is the most common
230
+ reason inference does not see further than the local
231
+ `def` — by default the analyzer treats every external gem
232
+ as `Dynamic[top]` unless the gem ships RBS or you
233
+ opt in to gem-source inference per (4) below.
234
+ 2. **Tighten an existing RBS sig with `RBS::Extended`.** Add
235
+ a `%a{rigor:v1:return: non-empty-string}` annotation
236
+ above the method's `def ... -> ::String` line. Rigor
237
+ sees the refinement; ordinary RBS tools see a comment.
238
+ 3. **Write a plugin.** When your project has a domain DSL
239
+ (`Lisp.eval`, `100.kilometers`, `transition_to(:foo)`)
240
+ that no general-purpose analyzer can know about, a
241
+ plugin teaches Rigor about it.
242
+ 4. **Opt in to gem-source inference.** When a no-RBS gem's
243
+ methods would otherwise resolve to `Dynamic[top]`, list
244
+ the gem under `dependencies.source_inference:` in
245
+ `.rigor.dist.yml` and Rigor will walk its `lib/` the same way
246
+ it walks project source. Returns are wrapped in
247
+ `Dynamic[T]` so the call site retains the provenance.
248
+ See [ADR-10](../adr/10-dependency-source-inference.md)
249
+ for the trade-offs (per-gem opt-in by design — broad
250
+ defaults would inflate budgets and make `bundle update`
251
+ noisy).
252
+ 5. **Use the `rigor-sorbet` adapter.** If your project
253
+ already uses [Sorbet](https://sorbet.org/), Rigor can
254
+ read your existing `sig { ... }` blocks, RBI files, and
255
+ `T.let` / `T.cast` / `T.must` / `T.unsafe` assertions
256
+ as type sources without rewriting anything. See
257
+ [Chapter 10](10-sorbet.md) for the migration patterns
258
+ and the translation table.
259
+
260
+ Chapters 7 and 9 cover (1)–(3) in detail; chapter 10 covers
261
+ (5).
262
+
263
+ ## The config file
264
+
265
+ The minimum useful run needs no config file at all —
266
+ `rigor check lib` works out of the box. A config file is for
267
+ non-default behaviours: extra `paths`, an alternative
268
+ `severity_profile`, project-wide rule disables, plugins.
269
+
270
+ If you used the [AI-assisted setup](#the-fast-path-let-an-ai-agent-set-it-up),
271
+ the `rigor-project-init` skill already wrote one for you. To
272
+ write a starter by hand, `rigor init` emits `.rigor.dist.yml`
273
+ — the project default that gets committed:
274
+
275
+ ```yaml
276
+ target_ruby: "3.4" # your project's Ruby — not Rigor's own 4.0
277
+
278
+ paths:
279
+ - lib
280
+
281
+ # signature_paths: [sig] # auto-detected when omitted
282
+
283
+ severity_profile: balanced
284
+
285
+ # severity_overrides:
286
+ # call.argument-type-mismatch: warning
287
+
288
+ # disable: []
289
+
290
+ # plugins: []
291
+ ```
292
+
293
+ That is all most projects need. The remaining mechanics —
294
+ editor autocomplete from the bundled JSON schema, the
295
+ `.rigor.yml` vs `.rigor.dist.yml` precedence rule, `includes:`
296
+ composition, and how path-bearing keys resolve relative to the
297
+ declaring file — are covered in
298
+ [Configuration](../manual/03-configuration.md). The one rule
299
+ worth knowing up front: when a developer keeps a local
300
+ `.rigor.yml`, it is the *sole* source of config for their runs
301
+ (the two files are never merged automatically), so to extend
302
+ the shared default it must list it under `includes:`.
303
+
304
+ ## What's next
305
+
306
+ Chapter 2 introduces the carriers Rigor uses to represent
307
+ types — the part of the model that distinguishes Rigor from
308
+ ordinary RBS. After that, Chapter 3 (narrowing) makes the
309
+ carriers come alive: the carriers describe values, and
310
+ narrowing describes how those carriers change as control
311
+ flow passes through `if` / `case` / predicate methods.