automatic 14.12.2 → 26.09

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 (177) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +669 -83
  3. data/VERSION +1 -1
  4. data/assets/siteinfo/items_all.json +60300 -52138
  5. data/automatic.gemspec +110 -248
  6. data/bin/automatic +20 -139
  7. data/config/feed2console.yml +10 -4
  8. data/config/feed2markdown.yml +41 -0
  9. data/doc/AI_TUTORIAL.md +542 -0
  10. data/doc/BASIC_DESIGN.md +547 -0
  11. data/doc/COPYING.LESSER +165 -0
  12. data/doc/DEPLOYMENT.md +830 -0
  13. data/doc/LICENSE.md +14 -0
  14. data/doc/PLUGINS.md +2015 -0
  15. data/doc/PLUGIN_DEVELOPMENT.md +86 -0
  16. data/doc/POLICY.md +962 -0
  17. data/doc/QUICKSTART.md +260 -0
  18. data/doc/RELEASING.md +394 -0
  19. data/doc/REQUIREMENTS.md +556 -0
  20. data/doc/VERSIONS +266 -0
  21. data/lib/automatic/cli.rb +270 -0
  22. data/lib/automatic/environment.rb +31 -5
  23. data/lib/automatic/feed_maker.rb +65 -25
  24. data/lib/automatic/feed_parser.rb +51 -35
  25. data/lib/automatic/http.rb +107 -0
  26. data/lib/automatic/log.rb +49 -18
  27. data/lib/automatic/opml.rb +3 -1
  28. data/lib/automatic/pipeline.rb +73 -32
  29. data/lib/automatic/recipe.rb +100 -17
  30. data/lib/automatic/version.rb +14 -1
  31. data/lib/automatic.rb +93 -20
  32. data/plugins/custom_feed/svn_log.rb +73 -32
  33. data/plugins/custom_feed/web.rb +348 -0
  34. data/plugins/filter/absolute_uri.rb +43 -27
  35. data/plugins/filter/accept.rb +38 -45
  36. data/plugins/filter/batch.rb +97 -0
  37. data/plugins/filter/claude.rb +217 -0
  38. data/plugins/filter/clear.rb +12 -8
  39. data/plugins/filter/description_link.rb +66 -51
  40. data/plugins/filter/full_feed.rb +170 -52
  41. data/plugins/filter/gemini.rb +216 -0
  42. data/plugins/filter/github_feed.rb +38 -26
  43. data/plugins/filter/ignore.rb +33 -44
  44. data/plugins/filter/image.rb +36 -25
  45. data/plugins/filter/image_source.rb +75 -52
  46. data/plugins/filter/join.rb +105 -0
  47. data/plugins/filter/kimi.rb +216 -0
  48. data/plugins/filter/limit.rb +57 -0
  49. data/plugins/filter/one.rb +19 -26
  50. data/plugins/filter/open_ai.rb +198 -0
  51. data/plugins/filter/present.rb +75 -0
  52. data/plugins/filter/rand.rb +16 -17
  53. data/plugins/filter/sakura_ai.rb +205 -0
  54. data/plugins/filter/sanitize.rb +29 -34
  55. data/plugins/filter/sort.rb +20 -27
  56. data/plugins/filter/tumblr_resize.rb +31 -23
  57. data/plugins/notify/ikachan.rb +86 -48
  58. data/plugins/provide/fluentd.rb +43 -24
  59. data/plugins/publish/amazon_s3.rb +79 -40
  60. data/plugins/publish/console.rb +19 -16
  61. data/plugins/publish/console_link.rb +20 -17
  62. data/plugins/publish/eject.rb +48 -26
  63. data/plugins/publish/fluentd.rb +50 -30
  64. data/plugins/publish/hatena_bookmark.rb +88 -71
  65. data/plugins/publish/instapaper.rb +69 -59
  66. data/plugins/publish/markdown.rb +278 -0
  67. data/plugins/publish/memcached.rb +35 -29
  68. data/plugins/store/database.rb +50 -48
  69. data/plugins/store/digest.rb +212 -0
  70. data/plugins/store/file.rb +107 -68
  71. data/plugins/store/full_text.rb +31 -28
  72. data/plugins/store/permalink.rb +18 -22
  73. data/plugins/subscription/feed.rb +34 -21
  74. data/plugins/subscription/link.rb +31 -32
  75. data/plugins/subscription/text.rb +40 -45
  76. data/plugins/subscription/tumblr.rb +55 -44
  77. data/plugins/subscription/xml.rb +40 -36
  78. metadata +112 -321
  79. data/Gemfile +0 -38
  80. data/Rakefile +0 -59
  81. data/doc/ChangeLog +0 -303
  82. data/doc/PLUGINS +0 -750
  83. data/doc/PLUGINS.ja +0 -753
  84. data/doc/README +0 -511
  85. data/doc/README.ja +0 -519
  86. data/plugins/filter/google_news.rb +0 -50
  87. data/plugins/publish/google_calendar.rb +0 -84
  88. data/plugins/publish/hipchat.rb +0 -46
  89. data/plugins/publish/pocket.rb +0 -45
  90. data/plugins/publish/twitter.rb +0 -58
  91. data/plugins/subscription/chan_toru.rb +0 -57
  92. data/plugins/subscription/g_guide.rb +0 -57
  93. data/plugins/subscription/pocket.rb +0 -51
  94. data/plugins/subscription/twitter.rb +0 -69
  95. data/plugins/subscription/twitter_search.rb +0 -50
  96. data/plugins/subscription/weather.rb +0 -33
  97. data/script/build +0 -84
  98. data/spec/fixtures/sampleFeeds.tsv +0 -1
  99. data/spec/fixtures/sampleFeeds2.tsv +0 -2
  100. data/spec/fixtures/sampleRecipe.yml +0 -24
  101. data/spec/lib/automatic/log_spec.rb +0 -32
  102. data/spec/lib/automatic/pipeline_spec.rb +0 -68
  103. data/spec/lib/automatic/recipe_spec.rb +0 -40
  104. data/spec/lib/automatic_spec.rb +0 -99
  105. data/spec/plugins/custom_feed/svn_log_spec.rb +0 -31
  106. data/spec/plugins/filter/absolute_uri_spec.rb +0 -61
  107. data/spec/plugins/filter/accept_spec.rb +0 -331
  108. data/spec/plugins/filter/clear_spec.rb +0 -49
  109. data/spec/plugins/filter/description_link_spec.rb +0 -138
  110. data/spec/plugins/filter/full_feed_spec.rb +0 -129
  111. data/spec/plugins/filter/github_feed_spec.rb +0 -55
  112. data/spec/plugins/filter/google_news_spec.rb +0 -69
  113. data/spec/plugins/filter/ignore_spec.rb +0 -328
  114. data/spec/plugins/filter/image_source_spec.rb +0 -89
  115. data/spec/plugins/filter/image_spec.rb +0 -65
  116. data/spec/plugins/filter/one_spec.rb +0 -71
  117. data/spec/plugins/filter/rand_spec.rb +0 -52
  118. data/spec/plugins/filter/sanitize_spec.rb +0 -153
  119. data/spec/plugins/filter/sort_spec.rb +0 -189
  120. data/spec/plugins/filter/tumblr_resize_spec.rb +0 -109
  121. data/spec/plugins/notify/ikachan_spec.rb +0 -58
  122. data/spec/plugins/provide/fluentd_spec.rb +0 -49
  123. data/spec/plugins/publish/amazon_s3_spec.rb +0 -40
  124. data/spec/plugins/publish/console_spec.rb +0 -30
  125. data/spec/plugins/publish/eject_spec.rb +0 -40
  126. data/spec/plugins/publish/fluentd_spec.rb +0 -40
  127. data/spec/plugins/publish/google_calendar_spec.rb +0 -83
  128. data/spec/plugins/publish/hatena_bookmark_spec.rb +0 -134
  129. data/spec/plugins/publish/hipchat_spec.rb +0 -69
  130. data/spec/plugins/publish/instapaper_spec.rb +0 -82
  131. data/spec/plugins/publish/memcached_spec.rb +0 -63
  132. data/spec/plugins/publish/pocket_spec.rb +0 -51
  133. data/spec/plugins/publish/twitter_spec.rb +0 -73
  134. data/spec/plugins/store/file_spec.rb +0 -58
  135. data/spec/plugins/store/full_text_spec.rb +0 -152
  136. data/spec/plugins/store/permalink_spec.rb +0 -206
  137. data/spec/plugins/subscription/chan_toru_spec.rb +0 -56
  138. data/spec/plugins/subscription/feed_spec.rb +0 -71
  139. data/spec/plugins/subscription/g_guide_spec.rb +0 -82
  140. data/spec/plugins/subscription/link_spec.rb +0 -72
  141. data/spec/plugins/subscription/pocket_spec.rb +0 -57
  142. data/spec/plugins/subscription/text_spec.rb +0 -84
  143. data/spec/plugins/subscription/tumblr_spec.rb +0 -74
  144. data/spec/plugins/subscription/twitter_search_spec.rb +0 -57
  145. data/spec/plugins/subscription/twitter_spec.rb +0 -73
  146. data/spec/plugins/subscription/weather_spec.rb +0 -44
  147. data/spec/plugins/subscription/xml_spec.rb +0 -84
  148. data/spec/spec_helper.rb +0 -106
  149. data/spec/user_dir/plugins/store/mock.rb +0 -16
  150. data/test/fixtures/sampleOPML.xml +0 -11
  151. data/test/integration/test_absoluteurl.yml +0 -25
  152. data/test/integration/test_activerecord.yml +0 -24
  153. data/test/integration/test_add_pocket.yml +0 -26
  154. data/test/integration/test_chan_toru.yml +0 -21
  155. data/test/integration/test_descriptionlink.yml +0 -21
  156. data/test/integration/test_fluentd.yml +0 -22
  157. data/test/integration/test_fulltext.yml +0 -30
  158. data/test/integration/test_google_news.yml +0 -21
  159. data/test/integration/test_googlealert.yml +0 -21
  160. data/test/integration/test_hatenabookmark.yml +0 -30
  161. data/test/integration/test_ignore.yml +0 -25
  162. data/test/integration/test_ignore2.yml +0 -22
  163. data/test/integration/test_image2local.yml +0 -33
  164. data/test/integration/test_instapaper.yml +0 -26
  165. data/test/integration/test_link2local.yml +0 -34
  166. data/test/integration/test_one.yml +0 -23
  167. data/test/integration/test_pocket.yml +0 -22
  168. data/test/integration/test_rand.yml +0 -21
  169. data/test/integration/test_sanitize.yml +0 -23
  170. data/test/integration/test_sort.yml +0 -36
  171. data/test/integration/test_svnlog.yml +0 -15
  172. data/test/integration/test_text2feed.yml +0 -36
  173. data/test/integration/test_tumblr2local.yml +0 -43
  174. data/test/integration/test_twitter_search.yml +0 -22
  175. data/test/integration/test_weather.yml +0 -19
  176. data/test/integration/test_xml2fluentd.yml +0 -21
  177. data/vendor/.gitkeep +0 -0
data/doc/POLICY.md ADDED
@@ -0,0 +1,962 @@
1
+ # Implementation Policies
2
+
3
+ This document decides how this repository is implemented: the coding rules, the
4
+ responsibilities of the parts and the direction of dependency between them, the
5
+ handling of settings and credentials, the approach to tests and documentation,
6
+ the versioning scheme, and the criteria a change is judged by.
7
+
8
+ It stands on its own. No rule here is completed by a document kept in another
9
+ repository, and a subject it does not cover is a gap in this document, to be
10
+ filled here rather than looked up elsewhere.
11
+
12
+ What the system is for belongs to [`REQUIREMENTS.md`](REQUIREMENTS.md); how it
13
+ is composed belongs to [`BASIC_DESIGN.md`](BASIC_DESIGN.md); the Recipe format
14
+ and the plugin contract belong to [`PLUGINS.md`](PLUGINS.md). This document does
15
+ not restate them; it decides how they are carried out.
16
+
17
+ The Invariants below decide over the rest of it.
18
+
19
+ ---
20
+
21
+ ## 1. General Policy
22
+
23
+ ### 1.1 Purpose and scope
24
+
25
+ Automatic Ruby is neither system infrastructure nor a purpose-built
26
+ application. It is a general-purpose composition framework. Its purpose is to
27
+ keep a small composition mechanism stable enough that independent plugins can
28
+ be combined freely, without turning the framework into a host baseline, a
29
+ general workflow engine or a collection of hard-coded applications.
30
+
31
+ - **Automatic Ruby is a framework, and the framework is the small part.** It
32
+ loads a Recipe, finds classes by name and calls them in order. Nearly every
33
+ change belongs in a plugin, and a change that adds domain knowledge to the
34
+ framework needs a reason beyond convenience.
35
+ - **Generality comes from composition, not from accumulating framework
36
+ features.** A concrete use case that needs branching, transactional
37
+ orchestration, multi-user state, permissions, a strongly coupled domain
38
+ model or another responsibility that does not fit a short linear pipeline is
39
+ not automatically a reason to enlarge the framework. A purpose-built
40
+ application is often the correct boundary for that complexity.
41
+ - **It is one person's tooling, run unattended from `cron`.** It is not a
42
+ service, not multi-tenant and not a product. That premise decides several
43
+ rules below that would otherwise look lax — the Recipe being trusted, chiefly.
44
+ - This document applies to everything committed here: the library, the plugins,
45
+ the executable, the tests, the packaging and the documents.
46
+ - Ruby is the implementation language and stays the implementation language. A
47
+ proposal to reimplement the core in another language is out of scope, and so
48
+ is turning this into a Rails application.
49
+
50
+ ### 1.2 Invariants
51
+
52
+ These come before every other rule here. Some of what they forbid is what a
53
+ general policy would otherwise ask for.
54
+
55
+ 1. **The Recipe format and the plugin contract are interfaces, and this
56
+ repository is not free to change them.** Both are depended on by files this
57
+ repository cannot see: Recipes in `~/.automatic/config`, plugins in
58
+ `~/.automatic/plugins`. A change that breaks either is deliberate, is
59
+ justified, and is recorded in [`VERSIONS`](VERSIONS).
60
+ 2. **The pipeline value has one shape.** Every plugin takes and returns an array
61
+ of feed objects. Introducing a second representation would end composability,
62
+ which is the whole of what the framework provides.
63
+ 3. **The plugin architecture is not replaced.** Recipes are not superseded by
64
+ hard-coded procedures, the loader is not replaced by a registry that must be
65
+ edited to add a plugin, and the framework does not become a single
66
+ application with the plugins folded into it.
67
+ 4. **A dependency needed by one plugin is not a dependency of the framework.**
68
+ Installing the gem must not pull in an SDK for a service the operator does
69
+ not use. See section 9.
70
+ 5. **Composability is an architectural invariant, not an optimization goal.**
71
+ The small framework, independent plugins, one pipeline representation and
72
+ Recipe-level ordering are the identity of the system. They are not traded
73
+ away merely for convenience, central validation, richer orchestration or a
74
+ more application-like design.
75
+ 6. **A failure is never silent.** No `rescue` that returns an empty pipeline as
76
+ if nothing happened, and no run that exits zero after something went wrong.
77
+ 7. **The default test suite reaches no network and needs no credential.** None
78
+ is configured in CI.
79
+ 8. **A plugin that cannot work is never simulated into working.** Stubbing a
80
+ dead service to make a test pass, or to make the catalogue look better, is
81
+ forbidden outright. Removing the plugin is the correct outcome. See
82
+ section 4.
83
+ 9. **No credential is committed**, in a Recipe, an example, a fixture or a test,
84
+ and none is written to the log.
85
+ 10. **Historical release history is not rewritten.** Past versions and their
86
+ dates in [`VERSIONS`](VERSIONS) are a record, not a thing to tidy.
87
+ 11. **The licence is GPL version 3 or LGPL version 3.** Automatic Ruby is
88
+ dual-licensed, and a user may choose either license at their discretion. New
89
+ files use the same dual license.
90
+
91
+ ### 1.3 Design philosophy
92
+
93
+ The repository is maintained in three layers, and they do not receive the same
94
+ degree of conservatism.
95
+
96
+ - **Core contracts receive the strongest compatibility protection:** the
97
+ Recipe format, plugin contract, pipeline shape, plugin lookup and override
98
+ semantics, execution order and established CLI contract.
99
+ - **Framework implementation may improve within those contracts:** the CLI,
100
+ loader, pipeline implementation, logging and shared helpers are not frozen
101
+ merely because they are old.
102
+ - **Plugins are replaceable components:** they may be added, repaired,
103
+ replaced or removed as their external systems and purposes change. A dead
104
+ integration is not retained by simulation.
105
+
106
+ - Simple comes before clever. Common work should fit in a short Recipe, and a
107
+ new abstraction needs a concrete problem the existing plugin contract cannot
108
+ solve.
109
+ - Documentation examples must run, and the Quick Start uses Supported plugins
110
+ only. Supported paths receive maintenance priority over integrations that
111
+ need rework.
112
+
113
+ - Prefer the smallest change that solves the problem. A pipeline that has run in
114
+ someone's `cron` for a decade has earned the benefit of the doubt.
115
+ - Understand why something exists before replacing it. A constant that looks
116
+ arbitrary usually encodes an operational fact.
117
+ - A capability that can live in a plugin lives in a plugin.
118
+ - Where a decision looks odd, a comment gives the reason, so that a later change
119
+ does not quietly undo it.
120
+ - Old is not a defect. Neither is unfashionable. A defect is something that does
121
+ not work, is not understood, or cannot be tested.
122
+
123
+ ### 1.4 Change discipline and maintenance boundary
124
+
125
+ Automatic Ruby does not inherit every maintenance rule that is appropriate
126
+ for long-lived host infrastructure. Its core contracts deserve comparable
127
+ caution because external Recipes and plugins depend on them, but the whole
128
+ repository is not treated as immutable infrastructure.
129
+
130
+ Finding a possible safety, portability, maintainability, cleanup,
131
+ modernization or refactoring improvement does not by itself authorize an
132
+ implementation change. A change is made when that change is part of the stated
133
+ work, not merely because an opportunity was noticed while editing nearby code.
134
+
135
+ Established behaviour is evaluated by layer. A Recipe or plugin contract that
136
+ has been used for years has strong compatibility value. A framework internal
137
+ implementation detail may be improved while preserving those contracts. A
138
+ shipped plugin may be replaced or removed when its external service or
139
+ interface is gone and the plugin can no longer perform real work.
140
+
141
+ Safety mechanisms are means, not goals. A guard, validation layer, sandbox,
142
+ permission model, retry layer or other defensive mechanism is justified by the
143
+ risk it materially reduces and by whether that benefit outweighs added
144
+ complexity, new failure modes and maintenance cost. This project is trusted
145
+ single-user tooling; controls appropriate to an untrusted multi-user service
146
+ are not added merely because they are generally considered safer.
147
+
148
+ Long-running operational history is evidence, especially for Recipe semantics,
149
+ plugin contracts and cron pipelines. It is not a reason to preserve a broken
150
+ integration or to freeze internal implementation that can change without
151
+ altering those contracts.
152
+
153
+ A change that would introduce branching, loops, fan-out, transactional
154
+ orchestration, multi-user state, a central plugin registry, domain knowledge in
155
+ the framework or another responsibility that changes the composition model is
156
+ an architecture change. It is not reached as a routine refactoring or as a
157
+ convenient way to satisfy one plugin or one Recipe.
158
+
159
+ ### 1.5 The parts and the direction of dependency
160
+
161
+ ```text
162
+ bin/automatic
163
+ |
164
+ v
165
+ lib/automatic/cli.rb
166
+ |
167
+ v
168
+ lib/automatic.rb -> recipe.rb -> pipeline.rb
169
+ | |
170
+ | v
171
+ | Automatic::Plugin::*
172
+ v |
173
+ log.rb feed_maker.rb feed_parser.rb http.rb
174
+ ^----------------------------------+
175
+ ```
176
+
177
+ Dependency points one way and there is no edge back up:
178
+
179
+ - **`bin/automatic` knows only the CLI.** It puts `lib` on the load path,
180
+ requires `automatic/cli`, and exits with the status it is given. No option, no
181
+ subcommand and no policy lives there.
182
+ - **The CLI knows the framework; the framework does not know the CLI.** Nothing
183
+ under `lib/automatic/` other than `cli.rb` may reference it.
184
+ - **`Pipeline` knows how to find and call a plugin; it knows no plugin.** A
185
+ reference to a plugin class name in the framework is a design error.
186
+ - **A plugin knows `Log`, `FeedMaker`, `FeedParser`, `Http` and its own
187
+ libraries.** It does not know another plugin, does not know the CLI, and does
188
+ not reach into `Automatic` for directories other than through the helpers
189
+ provided.
190
+ - **`Log`, `FeedMaker`, `FeedParser` and `Http` are leaves.** They depend on
191
+ nothing else in this repository.
192
+ - A new responsibility goes to the part that owns it. Where it appears to belong
193
+ to two, the boundary is wrong and is corrected, rather than the code being
194
+ written across it.
195
+
196
+ ### 1.6 The plugin boundary
197
+
198
+ - The framework's knowledge of a plugin is: its name, its file's location, its
199
+ constructor's two arguments and its `run` method. It does not know a plugin's
200
+ category semantics, its settings, its dependencies or its failure modes.
201
+ - The framework does not validate a plugin's `config`. It cannot know what is
202
+ valid, and pretending otherwise would put plugin knowledge in the framework.
203
+ - The framework does not inspect the pipeline between plugins.
204
+ - A plugin does not modify framework state. It does not set `Automatic.root_dir`
205
+ or `Automatic.user_dir`, and it does not change the log level.
206
+ - Plugin-to-plugin dependency is avoided. A plugin that wants another plugin's
207
+ result is a Recipe with two entries in it.
208
+ - Shared plugin code that the framework does not use stays under `plugins/`, not
209
+ in `lib/`. `plugins/store/database.rb` is where it is for that reason.
210
+
211
+ ### 1.7 Configuration
212
+
213
+ - A Recipe is the whole of a job's configuration. There is no second file, no
214
+ configuration directory, and no environment-variable settings.
215
+ - The one exception is `AUTOMATIC_RUBY_ENV=test`, which permits the user
216
+ directory to be overridden. It exists for the tests and is not an operator
217
+ interface.
218
+ - The framework reads exactly one `global` key, `global.log.level`. Adding a
219
+ second is a change to the Recipe format and is judged as one.
220
+ - `global.timezone` and `global.cache` are inert and stay inert. They are not
221
+ removed — that would edit operators' files for no gain — and they are not
222
+ given a meaning.
223
+ - A plugin reads its settings from `@config` by string key, tolerates `nil` for
224
+ the mapping and for any key, and follows the established names: `retry`,
225
+ `interval`, `db`, `path`.
226
+ - Not every constant becomes a setting. A value the operator would plausibly
227
+ change is a setting; a value that is part of what the plugin means stays in
228
+ the code.
229
+
230
+ ### 1.8 Error handling
231
+
232
+ - **The framework catches nothing from a plugin.** A plugin that raises ends the
233
+ run, for the reason given in `REQUIREMENTS.md` section 12. Adding a blanket
234
+ rescue around plugin execution would change what every existing Recipe means
235
+ and is not done.
236
+ - **A plugin owns its transient failures**, through `retry` and `interval`, and
237
+ logs each failed attempt.
238
+ - The framework's own failures have named classes in `lib/automatic.rb`:
239
+ `Automatic::Error` and, under it, `NoRecipeError`, `NoPluginError` and
240
+ `InvalidRecipeError`. A new framework failure gets a class rather than a
241
+ `RuntimeError` with a message.
242
+ - **`rescue` without a class is `rescue StandardError` and that is what is
243
+ meant.** A bare `rescue` is acceptable in a plugin's retry block, where the
244
+ point is that any failure of the attempt is retried, and unacceptable
245
+ elsewhere. Where used, it logs.
246
+ - An unexpected exception is left to propagate out of the CLI. It is a defect
247
+ and its backtrace is wanted.
248
+ - **The library never calls `exit` or `abort`.** Exit status is decided at the
249
+ process entry point, from the value `Automatic::CLI.run` returns.
250
+ - The result of an operation, whether later work continues, and whether a
251
+ message is emitted are separate decisions. This does not change the
252
+ framework rule above: a plugin exception still ends the run, and plugin retry
253
+ behavior remains owned by the plugin.
254
+ - A required condition whose absence makes correct completion impossible is a
255
+ failure, not a warning used to keep the run moving. A normal guard, no-op, or
256
+ inapplicable path is not a failure merely because it performs no work.
257
+
258
+ ### 1.9 Logging and output
259
+
260
+ - **A library file never calls `puts`, `print` or `warn`.** It logs, through
261
+ `Automatic::Log`.
262
+ - The CLI writes diagnostics to standard error and requested output — help,
263
+ version, subcommand results — to standard output.
264
+ - A plugin whose purpose is to write to the terminal holds its output object in
265
+ an instance variable defaulting to `$stdout`, so that a test can substitute it.
266
+ - `info` records useful normal progress. `warn` is reserved for a degraded or
267
+ otherwise abnormal but recoverable condition the operator should know about;
268
+ a normal guard, no-op, or inapplicable path may be silent and is not a warning
269
+ merely because work was skipped. `error` says what failed. An error that was
270
+ rescued is logged at `warn` or `error`, never at `info`.
271
+ - Do not emit a line merely to prove that a normal branch was taken, and do not
272
+ duplicate a failure message at multiple layers when one responsible layer
273
+ already reports it through the established interface.
274
+ - No log line contains a credential. A plugin that logs its own settings
275
+ wholesale is a defect.
276
+
277
+ ### 1.10 Filesystem access
278
+
279
+ - The framework touches two roots: the installation directory and
280
+ `~/.automatic`. Nothing else, and no absolute path elsewhere appears in the
281
+ code.
282
+ - Paths are built with `File.join` and `File.expand_path`, never by string
283
+ concatenation.
284
+ - The user directory takes precedence over the installation, for plugins,
285
+ Recipes, databases and assets alike. Where a part of it is absent, the
286
+ installation's own directory is the fallback.
287
+ - `scaffold` creates and never overwrites. `unscaffold` removes the whole user
288
+ directory and is the one destructive operation the framework offers; it is not
289
+ extended, and nothing else acquires the ability to delete an operator's data.
290
+ - A plugin writes only where its settings tell it to.
291
+
292
+ ### 1.11 Network access
293
+
294
+ - **The framework reaches nothing.** No update check, no telemetry, no
295
+ phone-home. Every request is a plugin's, on a Recipe's instruction.
296
+ - HTTPS is used wherever the service offers it. A plugin that still uses plain
297
+ HTTP is a defect to be recorded, and one that sends a credential over plain
298
+ HTTP is recorded as such in [`PLUGINS.md`](PLUGINS.md).
299
+ - **TLS certificate verification is never disabled.** There is no acceptable
300
+ reason, and a plugin that did it has been corrected.
301
+ - A plugin that fetches repeatedly from one host supports `interval` and its
302
+ documentation says to set it. Scraping politely is a requirement, not a
303
+ courtesy.
304
+ - A URL that comes from a setting or from feed content is escaped before use,
305
+ and is never interpolated into a shell command. An external command is run as
306
+ an argument vector.
307
+ - **A URL that comes from feed content is external input.** It is fetched
308
+ through `Automatic::Http`, which restricts the scheme to HTTP and HTTPS,
309
+ because `URI.open` on such a string will read a local file as readily as an
310
+ article.
311
+ - Every request has a connect and a read timeout. An unattended run that hangs
312
+ is a failure mode with no upper bound on its cost.
313
+
314
+ ### 1.12 Security and credentials
315
+
316
+ - **A Recipe is trusted local configuration**, equivalent to a shell script the
317
+ operator wrote. This is the trust boundary, it is stated in
318
+ `REQUIREMENTS.md` section 17, and it is the premise the following rules assume.
319
+ - Even so, YAML is loaded safely, so that a Recipe cannot name a Ruby class to
320
+ instantiate. This costs nothing, since no Recipe needs it, and it removes a
321
+ second and avoidable path to code execution. **Do not present this as making
322
+ an untrusted Recipe safe**; the loader is not the boundary.
323
+ - Credentials are Recipe settings. That makes a Recipe holding them a secret
324
+ file, which the documentation says plainly rather than glossing over.
325
+ - No credential in the repository: not in an example Recipe, not in a fixture,
326
+ not in a test, not in a comment. The example Recipes in `config/` need none.
327
+ - No credential in the log, in an exception message, or in a pipeline item.
328
+ - No credential in CI. A test that needs one is not part of the default suite.
329
+ - A change that touches authentication says in its `VERSIONS` entry what it
330
+ changed.
331
+
332
+ ### 1.13 Judging a change
333
+
334
+ - Does it keep the Recipe format and the plugin contract, and if not, is that
335
+ deliberate and recorded?
336
+ - Does it respect the direction of dependency?
337
+ - Does it leave the framework the small part?
338
+ - Does it keep a plugin's dependency out of everyone else's installation?
339
+ - Is it the smallest change that does the job?
340
+ - Does a test say it works, and does the default suite still need no network?
341
+ - Do the documents still match the code, in the same commit?
342
+ - Which layer is changing: a core contract, framework implementation or a
343
+ replaceable plugin?
344
+ - Is a framework change solving a framework problem, or absorbing
345
+ domain-specific behaviour that belongs in a plugin or an application?
346
+ - Does a new dependency remain local to the plugin that needs it?
347
+ - Does a proposed safety mechanism materially reduce a relevant risk without
348
+ imposing disproportionate complexity on trusted single-user tooling?
349
+ - Does the change preserve the small linear composition model, and if not, has
350
+ an explicit architecture change actually been chosen?
351
+
352
+ ---
353
+
354
+ ## 2. Ruby Policy
355
+
356
+ ### 2.1 Style
357
+
358
+ The prevailing style of this repository is what a change matches. It is not
359
+ current fashion and that is deliberate: a change written in a different style
360
+ makes a diff harder to read than the style saves.
361
+
362
+ - Two-space indentation. No tabs. No trailing whitespace. A newline at end of
363
+ file.
364
+ - Single quotes for a plain string, double quotes when interpolating.
365
+ - `snake_case` for methods and variables, `CamelCase` for classes, `SCREAMING_
366
+ SNAKE_CASE` for constants.
367
+ - Braces for blocks are the established idiom here, including multi-line blocks,
368
+ and were chosen to avoid stacked `end`s. Existing code is left as it is. New
369
+ code may use either; matching the surrounding file matters more than the
370
+ choice.
371
+ - Lines around 100 columns. Not enforced, and not a reason to reformat.
372
+ - Prefer a guard clause to a wrapping `unless`, in new code.
373
+
374
+ ### 2.2 Scope of a change
375
+
376
+ - **Do not reformat a file you are not otherwise changing.** A large diff hides
377
+ the change inside it.
378
+ - Do not rename a class, a method or a setting because the name is dated. The
379
+ names in this repository are domain vocabulary: Recipe, pipeline, plugin,
380
+ subscription, publish. They stay.
381
+ - Do not restructure a plugin while fixing it. A compatibility fix and a rewrite
382
+ are two changes.
383
+ - Where a file is being substantially changed anyway, bringing it to the current
384
+ style is fine.
385
+
386
+ ### 2.3 File headers
387
+
388
+ Every Ruby file carries a header comment. Values start in the same column,
389
+ using `Source Code::`, the longest label, as the alignment baseline. Fields
390
+ appear in the order shown below. An executable uses this canonical form:
391
+
392
+ ```ruby
393
+ #!/usr/bin/env ruby
394
+ # -*- coding: utf-8 -*-
395
+ # Name:: automatic
396
+ # Author: id774 (More info: https://id774.net)
397
+ # Source Code:: https://github.com/id774/automaticruby
398
+ # License:: The GPL version 3, or LGPL version 3 (Dual License).
399
+ # Contact:: idnanashi@gmail.com
400
+ # Created:: Feb 18, 2012
401
+ # Updated:: Aug 14, 2026
402
+ # Copyright:: Copyright (c) 2012-2026 Automatic Ruby Developers.
403
+ ```
404
+
405
+ - Only files directly invoked as executables carry the shebang. Libraries,
406
+ plugins and specs omit the shebang and otherwise use the same form.
407
+ - `Name` is the fully qualified name of what the file defines.
408
+ - `Author` records the author or authors established by the file and its Git
409
+ history. The former name `774` is normalized to `id774`; third-party authors
410
+ are never removed or replaced, and multiple authors retain their recorded
411
+ order. Names and URLs are not inferred when the history does not provide them.
412
+ - The labels are exactly `Name::`, `Author:`, `Source Code::`, `License::`,
413
+ `Contact::`, `Created::`, `Updated::` and `Copyright::`.
414
+ - `Created` is never changed.
415
+ - `Updated` is set to the date of a change that affects behaviour. A
416
+ documentation-only or formatting-only change does not touch it.
417
+ - The project-level copyright notice is `Copyright (c) 2012-2026 Automatic
418
+ Ruby Developers.` Explicit third-party copyright notices are preserved and
419
+ are not inferred from the `Author` field.
420
+ - The `License` line records the GPLv3 or LGPLv3 dual license and matches
421
+ [`LICENSE.md`](LICENSE.md).
422
+ - A `Description::` line may be added below `Name` when the file's purpose is
423
+ not obvious from its name. New plugins should have one.
424
+ - The magic encoding comment is redundant on the supported Rubies. It is left in
425
+ place in existing files, because removing it across existing files is a diff with
426
+ no benefit, and it is not required in a new file.
427
+
428
+ Files do not carry a per-file version history. This repository versions at the
429
+ repository level only; see section 10.
430
+
431
+ ### 2.4 Ruby version compatibility
432
+
433
+ - The supported range is stated in one place, `automatic.gemspec`
434
+ (`required_ruby_version`), and the README and the documents agree with it. The
435
+ set CI validates is a narrower statement and lives in the matrix; section 11
436
+ says how the two relate.
437
+ - **Compatibility is written in the range's common API.** Where a Ruby release
438
+ deprecates or removes something, the replacement chosen is the one that works
439
+ unchanged on every supported version. `URI::Parser#escape` becoming obsolete
440
+ is answered by naming `URI::RFC2396_Parser`, which means the same thing on all
441
+ of them — not by a `RUBY_VERSION` branch.
442
+ - **A `RUBY_VERSION` conditional is a last resort**, for a difference that has
443
+ no common expression. Two implementations of one behaviour cost more than the
444
+ compatibility they buy: the branch not taken is the branch not tested.
445
+ - **Code for an unsupported Ruby is removed, not kept for safety.** A
446
+ `RUBY_VERSION` comparison against 1.8 or 1.9, a branch for an interpreter that
447
+ cannot install the dependencies, and a shim for a method that has been in core
448
+ for a decade are all deleted.
449
+ - Nothing is written against a feature newer than the floor.
450
+ - A method removed by Ruby is replaced by its supported equivalent, and that is
451
+ a compatibility fix rather than a refactor: `Kernel#open` on a URL becomes
452
+ `URI.open`, `File.exists?` becomes `File.exist?`.
453
+ - **A library leaving the standard library is not by itself a reason to declare
454
+ it.** Ruby moves libraries to default and then to bundled gems as it goes.
455
+ Each one is judged on what actually requires it: the framework's own
456
+ requirement becomes a runtime dependency, a plugin's becomes an optional one
457
+ (section 9.1), and a requirement left over from code that no longer uses it is
458
+ deleted.
459
+
460
+ ### 2.5 Requiring
461
+
462
+ - The framework requires only what the framework uses. A plugin's library never
463
+ appears in `lib/`.
464
+ - A plugin requires its libraries at the top of its own file.
465
+ - A library needed only by an optional path is required inside that path, so the
466
+ plugin loads without it. The S3 branch of `StoreFile` is the example.
467
+ - The CLI requires a subcommand's libraries inside that subcommand, so a
468
+ command that does not use `feedbag` or the OPML parser does not load them.
469
+ - **An optional gem is required through `Automatic.require_optional`**, which
470
+ names the gem, what needed it and how to install it when it is absent. A bare
471
+ `require` of an optional gem answers a solvable problem with
472
+ `cannot load such file`, which is not the framework's best answer.
473
+ - **`Bundler.require` is not how the framework loads its dependencies.** An
474
+ installed library must not impose a bundle on the program requiring it. The
475
+ Bundler setup in `environment.rb` is a convenience for a source checkout and
476
+ does nothing when there is no `Gemfile`.
477
+
478
+ ---
479
+
480
+ ## 3. Plugins
481
+
482
+ - A new plugin follows [`PLUGINS.md`](PLUGINS.md) section 3, which is the
483
+ contract, and section 3.10, which says which category it belongs in.
484
+ - **Converting the pipeline into some other representation is a `Publish`
485
+ plugin's work, and the result stays inside the plugin.** It is serialized at
486
+ the boundary, written to the destination, and never passed along the pipeline
487
+ or made known to the framework, which keeps Invariant 2 and section 1.6
488
+ intact. Producing a portable document — one a person can read, ordinary tools
489
+ can process and another program can be given, with no service behind it — is
490
+ a destination like any other and belongs in that category.
491
+ - A new plugin is added to the catalogue in `PLUGINS.md` section 6 in the same
492
+ change, with its settings table and its status.
493
+ - A new plugin comes with a spec that reaches no network.
494
+ - A plugin's dependency is not added to the gemspec's runtime dependencies; see
495
+ section 9.
496
+ - A change to an existing plugin does not change what an existing Recipe means
497
+ unless that is the point of the change.
498
+
499
+ ---
500
+
501
+ ## 4. The life of a plugin
502
+
503
+ Plugins outlive the services they talk to. The policy for what happens then:
504
+
505
+ - **A shipped plugin has a current practical use.** That is the condition for
506
+ being in the gem, and it is a condition that has to keep being met, not one
507
+ met once. Having been useful is not the test.
508
+ - **A plugin is classified, in `PLUGINS.md` section 6**, as Supported, Supported
509
+ (external) or Needs rework, with the reason. There is no status meaning
510
+ "does not work and never will"; a plugin in that position is removed.
511
+ - **A dead integration is never faked into life.** No stub of a shut-down
512
+ service, no mock that makes an integration look alive, no test that asserts
513
+ against a simulation. This is Invariant 8 and it has no exceptions. If a
514
+ plugin can only be made to look supported by simulating what it talks to,
515
+ what it needs is deletion, not a double.
516
+ - **Unsupported code is not kept for preservation.** Git history holds every
517
+ implementation this project ever shipped, and holds it without installing it
518
+ on anyone's machine or listing it in a catalogue an operator reads for
519
+ guidance. A plugin retained only so that its code exists somewhere is
520
+ retained for a reason the version control system already covers.
521
+ - **The judgement is evidenced.** "Nobody uses that any more" is not a reason.
522
+ The service's own site, its API documentation or its published shutdown
523
+ notice is, and the reason goes in the catalogue entry or in the removal
524
+ record. Where the evidence cannot be obtained, the plugin is classified
525
+ **Needs rework** and kept: the failure mode of guessing is deleting something
526
+ that works.
527
+ - **Needs rework means restoration is realistic.** A capability the service
528
+ still offers, reachable by a current API, with the work amounting to a
529
+ migration rather than a new project. A plugin whose service is gone is not
530
+ Needs rework; it is removed.
531
+ - **Restoring a plugin to a service's current API** is a separate change, one
532
+ plugin at a time, with the catalogue entry updated in the same commit. Where
533
+ the current API forces a credential format the old Recipe cannot express,
534
+ that is a breaking change and is documented as one rather than hidden behind
535
+ a translation.
536
+ - **Removing a plugin removes all of it**: implementation, specs, example and
537
+ integration Recipes, catalogue entry, and any optional dependency nothing
538
+ else needs. A class left behind to raise "this no longer works" is not a
539
+ courtesy; the loader's `NoPluginError` says the same thing earlier and
540
+ without shipping code.
541
+ - **A removal is recorded in `VERSIONS`** in enough detail that an operator
542
+ whose Recipe breaks can find out why, and the reasons are kept in
543
+ `PLUGINS.md`. Removals are batched into a release rather than trickled, so
544
+ that an upgrade has one list to read.
545
+ - **A modernized plugin keeps its Recipe's meaning.** Class names, setting
546
+ names and defaults are not changed for tidiness; where a fix makes a plugin
547
+ behave as its documentation always said it did, that is still a behaviour
548
+ change and the catalogue entry says so.
549
+ - **A Supported plugin has deterministic local tests.** They cover this side of
550
+ the boundary — settings, request construction, serialization, response
551
+ handling, error behaviour — and reach no network, need no credential and
552
+ require no running service. The availability of somebody else's API is not
553
+ something a unit test can assert and is not something required CI waits on.
554
+
555
+ ---
556
+
557
+ ## 5. Testing
558
+
559
+ - **RSpec**, under `spec/`, mirroring the source tree: `spec/lib/` for the
560
+ framework and `spec/plugins/<category>/` for plugins.
561
+ - **The default suite reaches no network and needs no credential.** This is
562
+ Invariant 7. A spec that would is not written; the integration Recipes under
563
+ `test/integration/` are where that belongs, and they are run by hand.
564
+ - A framework spec covers the loader, the Recipe, the pipeline, the log and the
565
+ CLI's exit statuses.
566
+ - A plugin spec constructs the plugin with a `config` and a pipeline built by
567
+ `AutomaticSpec.generate_pipeline`, calls `run`, and asserts on the result.
568
+ - **An example that reaches a real host is tagged `:network`** and is excluded
569
+ from the default suite and from CI. It is kept, because it is a real test and
570
+ is the way to check a plugin against the service it talks to, and it is run
571
+ deliberately with `AUTOMATIC_NETWORK_SPECS=1`. Several of these point at hosts
572
+ that no longer serve what they expect, which is a further reason not to make
573
+ them a gate. A new example that reaches a host is tagged; one that does not is
574
+ never given the tag to make a failure go away.
575
+ - **The default suite does not depend on an optional plugin gem.** A gem the
576
+ `Gemfile` declares in an optional group is not installed by `bundle install`,
577
+ so the plugins that need it are not verified by the default suite or by the
578
+ required workflow. That is a decision, taken here, and not something a failure
579
+ discovers: the gems it applies to are the declared list
580
+ `AutomaticSpec::OPTIONAL_PLUGIN_GEMS`, a spec whose plugin needs one guards
581
+ its file with `AutomaticSpec.optional_dependency?`, and naming a gem that is
582
+ not on the list raises rather than skipping. Selecting the group with
583
+ `bundle config set --local with plugins` and installing runs those specs as
584
+ part of the ordinary suite.
585
+ - **A guard is a skip with a reason, not a `pending`.** A spec outside the
586
+ default suite prints why it is outside it and does not run; the default
587
+ suite's output is a list of what was verified rather than a list of what was
588
+ not.
589
+ - A spec whose plugin's gem is not installed is skipped by
590
+ `AutomaticSpec.plugin_available?`, which names the missing gem. That is the
591
+ intended behaviour and is not worked around by faking the gem.
592
+ - **The default suite is kept small and reliable rather than large.** It reaches
593
+ no network, needs no credential, needs no external daemon, writes outside no
594
+ temporary directory of its own, redirects `HOME`, and does not depend on
595
+ filesystem ordering, on the clock or on a random seed. A test that cannot be
596
+ made repeatable does not belong in it. Guaranteeing fewer things reliably is
597
+ the better trade, and it is not the same as weakening a test: `|| true`,
598
+ `continue-on-error` and a rescue that swallows a failure are forbidden, and
599
+ the tests that remain are held strictly.
600
+ - **A spec does not write outside its own temporary directory.** Where a plugin
601
+ resolves a path under the home directory, the spec redirects `HOME` to a
602
+ temporary directory rather than operating on the developer's real
603
+ `~/.automatic`.
604
+ - Coverage is measured with SimpleCov when `COVERAGE=on`, and is not a gate. The
605
+ historical `rcov` and `simplecov-rcov` tooling has been removed; it existed
606
+ for Ruby 1.8 and for a CI server that no longer runs.
607
+ - `rake spec` runs the suite; `rake spec:lib` and `rake spec:plugins` run the
608
+ halves. `rake` alone runs `spec`.
609
+ - CI runs `bundle install` and `rake spec` on every supported Ruby version, and
610
+ nothing that needs a secret.
611
+
612
+ ---
613
+
614
+ ## 6. Command line
615
+
616
+ - **The CLI is a library**, `Automatic::CLI`, and `bin/automatic` is a process
617
+ entry point that does nothing but call it and exit with its result.
618
+ - `CLI.run` returns an `Integer` and never calls `exit`, so the command line is
619
+ unit-testable.
620
+ - Exit statuses are fixed: `0` did the work or printed help or version, `1`
621
+ failed or nothing was asked for, `2` the command line was rejected.
622
+ - `--help` and `--version` exit `0` and print to standard output.
623
+ - Option parsing uses `optparse` from the standard library. **No CLI framework
624
+ is introduced**; the interface is one option and seven subcommands, and a gem
625
+ for that would be a dependency for nothing.
626
+ - The subcommands and the meaning of `-c` are part of the compatibility promise.
627
+ Adding a subcommand is fine; removing or renaming one is a breaking change.
628
+ - A subcommand prints its result to standard output, because printing is what it
629
+ is for.
630
+
631
+ ---
632
+
633
+ ## 7. Backward compatibility
634
+
635
+ What this repository promises not to break, absent a deliberate and recorded
636
+ decision:
637
+
638
+ | Interface | Promise |
639
+ | --- | --- |
640
+ | Recipe format | A Recipe that worked keeps working |
641
+ | Plugin contract | `new(config, pipeline)` and `run` |
642
+ | Plugin naming | The class-name-to-file-path rule |
643
+ | User directory | `~/.automatic` and its four subdirectories |
644
+ | User plugin precedence | The user directory shadows the installation |
645
+ | CLI | `-c`, the subcommand names, and the exit statuses |
646
+ | Store databases | Existing SQLite files stay readable |
647
+ | Gem name | `automatic`, providing the `automatic` executable |
648
+
649
+ Breaking one of these is a decision, taken deliberately, recorded in
650
+ [`VERSIONS`](VERSIONS) in terms an operator can act on, and never a side effect
651
+ of a clean-up. Adding an optional setting whose default preserves current
652
+ behaviour breaks nothing.
653
+
654
+ ---
655
+
656
+ ## 8. Documentation
657
+
658
+ - **Documentation is updated in the same change as the behaviour it describes.**
659
+ A behaviour change with no documentation change has not been finished.
660
+ - The documents divide as follows, and one fact has one home:
661
+
662
+ | Document | Holds |
663
+ | --- | --- |
664
+ | `README.md` | The entry point: what it is, how to install and run it, where everything else is |
665
+ | `doc/REQUIREMENTS.md` | What the system is for and what it guarantees |
666
+ | `doc/BASIC_DESIGN.md` | How it is composed |
667
+ | `doc/PLUGINS.md` | The Recipe format, the plugin contract, the plugin catalogue |
668
+ | `doc/POLICY.md` | This document: how a change is made and judged |
669
+ | `doc/DEPLOYMENT.md` | Installing, running and operating it |
670
+ | `doc/VERSIONS` | Release history |
671
+ | `doc/LICENSE.md`, `doc/COPYING`, `doc/COPYING.LESSER` | The licence |
672
+ | `doc/AUTHORS` | Contributors |
673
+
674
+ - **No cross-repository reference.** These documents never say "see the policy
675
+ of another repository", or "as in *X*". Everything needed to understand,
676
+ build, run and change this repository is here. Another repository may be a
677
+ useful reference while working, and it is not a citation.
678
+ - **Documents are in English**, as are code, comments and commit messages.
679
+ Japanese appears only where it is data: a search keyword in an example, a
680
+ broadcast station name in a plugin's settings.
681
+ - Markdown documents may assume a renderer. `VERSIONS`, `COPYING`, `COPYING.LESSER` and `AUTHORS`
682
+ are plain text and keep their extensionless names, which are the names they
683
+ are published and linked under.
684
+ - Prose wraps near the width the document already uses. `VERSIONS` follows
685
+ section 10.4 instead.
686
+ - **A document is not deleted for being old.** It is deleted when its content
687
+ has been moved somewhere that is now the source of truth, and the move is
688
+ recorded in `VERSIONS`.
689
+
690
+ ---
691
+
692
+ ## 9. Dependencies
693
+
694
+ ### 9.1 The split
695
+
696
+ Install the core by default; install a plugin's dependencies only when they are
697
+ needed. Dependencies fall into three groups, and which group a gem is in is a
698
+ decision, not an accident:
699
+
700
+ **Runtime dependencies** — declared in `automatic.gemspec`, installed by `gem
701
+ install automatic`. A gem is here only if a file in `lib/` requires it: what
702
+ `require 'automatic'`, loading a Recipe, loading a plugin, running a pipeline
703
+ and the command line itself need, and nothing more. A gem that reached this list
704
+ because of a plugin, because a plugin no longer uses it, or because a Ruby
705
+ release moved a library out of the standard library, is moved back out.
706
+
707
+ **Optional dependencies** — used by one plugin or a few, required inside the
708
+ plugin's own file, declared in an optional group of the `Gemfile`, and **not
709
+ declared as runtime dependencies**. An operator who uses that plugin installs
710
+ the gem. This is Invariant 4, and it is why installing this gem does not install
711
+ an AWS SDK.
712
+
713
+ Dependency minimization is not a repository-wide contest to use the fewest
714
+ libraries. A plugin may be rich when its purpose requires it. The rule is that
715
+ the cost stays with the plugin that needs it: a parser, database driver, SDK or
716
+ other domain-specific dependency must not become a framework dependency merely
717
+ because one plugin uses it.
718
+
719
+ The permanent rules of the split:
720
+
721
+ - **A core dependency is one the framework itself has.** A plugin's dependency
722
+ is never a framework runtime dependency, however useful, popular or
723
+ Supported that plugin is. How many Recipes happen to use it is not the test;
724
+ what `lib/` requires is.
725
+ - **The operator who uses the plugin installs its gem.** Not having it must
726
+ never stop the framework from starting, and a Recipe that does not name the
727
+ plugin must run without it.
728
+ - **A new plugin does not increase the core dependencies.** Adding one to the
729
+ runtime list needs an architectural justification — the framework itself
730
+ came to need the gem — recorded with the change; wanting the plugin to work
731
+ out of the box is not one.
732
+ - **The default tests and required CI do not depend on an optional
733
+ integration.** Being in this group has that intended consequence: those
734
+ plugins are not part of what a green build guarantees. See section 5.
735
+ - **An unsupported or optional integration does not decide a framework-wide
736
+ dependency.** Where one plugin needs a gem, that gem is the plugin's.
737
+
738
+ A missing optional gem is reported, not merely raised: the plugin requires it
739
+ through `Automatic.require_optional`, which names the gem, what needed it and
740
+ how to install it. That helper is the whole of the mechanism, and no dependency
741
+ manager, plugin manifest or resolver is introduced beyond it.
742
+
743
+ **Development dependencies** — the test and build tooling.
744
+
745
+ ### 9.2 Adding, updating and removing
746
+
747
+ - A gem is added when something committed here uses it, and the commit says
748
+ which plugin and why.
749
+ - **Dependencies are not raised in bulk.** Each is updated for a reason —
750
+ a security fix, a Ruby compatibility requirement, an API this repository
751
+ needs — and the code that uses it is checked against the new version. Bumping
752
+ everything to latest and then repairing what broke is not how this is done.
753
+ - Version constraints are ranges wide enough not to conflict with the rest of an
754
+ operator's bundle, and tight enough to exclude a major version this code has
755
+ not been checked against.
756
+ - A gem no longer used by anything committed here is removed.
757
+ - A gem whose service no longer exists is removed, along with the plugin that
758
+ needed it; see section 4. An optional group left with nothing to install is
759
+ deleted from the `Gemfile` in the same change.
760
+ - **Nothing is vendored.** Dependencies come from RubyGems, which keeps their
761
+ licences theirs.
762
+
763
+ ### 9.3 Sources
764
+
765
+ - One gem source: `https://rubygems.org`.
766
+ - **No plain-HTTP source, ever.** `http://rubygems.org` in a `Gemfile` is a
767
+ defect, not a style question.
768
+ - No source that has shut down. `gems.github.com` has not existed since 2014 and
769
+ is not to reappear.
770
+
771
+ ### 9.4 Packaging
772
+
773
+ - The gemspec is **hand-maintained**. It was generated by Jeweler, which is no
774
+ longer maintained and which required its own Rake tasks and a `VERSION` file
775
+ to regenerate a file that is easier to simply edit. The generator is gone; the
776
+ file is now source.
777
+ - The gemspec states `required_ruby_version`, the licence, the homepage, the
778
+ source code URL and the metadata links, and its `files` list is derived from
779
+ what Git tracks so that it cannot drift.
780
+ - The `Gemfile` declares the source and evaluates the gemspec, so that runtime
781
+ dependencies are stated once. Development and optional gems are groups in the
782
+ `Gemfile`.
783
+ - `Gemfile.lock` is not committed. This is a library, and locking would impose a
784
+ resolution on every consumer.
785
+ - `Rakefile` carries the test tasks and nothing else. It is not a build system,
786
+ and no build system is introduced.
787
+ - A release requires green required CI. Its built gem is inspected and installed
788
+ locally before publication, and its source version and metadata must agree.
789
+ - A published version is immutable. Credentials are never committed, and
790
+ release commits and tags are not rewritten to conceal a publication error.
791
+ - The manual publication procedure is [`RELEASING.md`](RELEASING.md). Publishing
792
+ is an explicit maintainer action, not a side effect of a build or test task.
793
+
794
+ ---
795
+
796
+ ## 10. Versioning
797
+
798
+ ### 10.1 Scheme
799
+
800
+ Releases are numbered `<year>.<month>`, two digits each, taken from the release
801
+ date. This is the scheme the project has used since its first release in
802
+ February 2012, it mimics Ubuntu's, and it does not change.
803
+
804
+ ```text
805
+ 26.08 a release made in August 2026
806
+ 26.08.1 a release correcting 26.08, in the same month
807
+ ```
808
+
809
+ A third `<patch>` level is appended only when a release corrects an earlier one
810
+ without accumulating a month's work. `14.12.1` and `14.12.2` are historical
811
+ examples.
812
+
813
+ The number carries no compatibility meaning. A month is not a major version, and
814
+ a compatibility break is signalled by what the `VERSIONS` entry says, not by the
815
+ number.
816
+
817
+ ### 10.2 Where the version is written
818
+
819
+ The release version appears in three places, which are changed together in one
820
+ commit:
821
+
822
+ | Place | Form |
823
+ | --- | --- |
824
+ | `VERSION` | `26.08` |
825
+ | `lib/automatic/version.rb` | `Automatic::VERSION` |
826
+ | `doc/VERSIONS` | The entry heading |
827
+
828
+ `automatic.gemspec` reads `VERSION`, and `automatic --version` prints
829
+ `Automatic::VERSION`, so neither is a separate place to update.
830
+
831
+ Historically `lib/automatic/version.rb` carried a `-devel` suffix between
832
+ releases while `VERSION` did not, and a spec asserted the exact string. That
833
+ divergence is not continued: the two agree, and the spec asserts that they
834
+ agree rather than asserting a literal.
835
+
836
+ ### 10.3 What is a release
837
+
838
+ - **Work that is not released yet takes no version of its own.** It belongs to
839
+ the entry already standing at the top of `doc/VERSIONS`.
840
+ - An unreleased entry carries `(Release Date: TBD)`. Replacing that with the
841
+ date is the release itself, and is not a change to record inside the entry.
842
+ - **A repository that has not yet made its first release is in its initial
843
+ construction stage**, and that stage takes no entry here. The work of building
844
+ up to the first release is not accumulated in `doc/VERSIONS` one by one: the
845
+ file is the record of released versions, not of the construction that precedes
846
+ the first of them, and its first entry is written when that release is made.
847
+ - **A series of changes made on one day is one version**, not several. Do not
848
+ split a day's work across version numbers. This rule has no exception:
849
+ separate commits, pull requests, independent features, bug fixes, security
850
+ fixes, compatibility changes, breaking changes, or release units do not
851
+ permit a second version number on the same calendar date. A same-date change
852
+ joins that day's single entry; independence decides bullet grouping only.
853
+ - **If today's release has already been published, a correction may be
854
+ prepared but no second version, tag or package release may be published
855
+ until a later calendar date.** A published version is never overwritten,
856
+ reused or moved, and its correction is a later-dated version.
857
+ - **Historical same-date versions remain recorded as historical facts.**
858
+ `14.10.0` and `14.10.1` were both released on 2014-10-23 and both stay in
859
+ `doc/VERSIONS`, but they violate the current one-version-per-day rule and
860
+ are not precedent for future releases.
861
+ - A documentation-only change takes no entry unless its scale makes it worth one
862
+ line saying so.
863
+ - Git tags carry the release version, and are created only when a release is
864
+ made.
865
+
866
+ ### 10.4 How `doc/VERSIONS` is written
867
+
868
+ `doc/VERSIONS` is a version-level summary of what each release changed. It is
869
+ not a transcription of the commit log: the commits record how the work happened,
870
+ the version history records what it amounts to.
871
+
872
+ - Record externally meaningful or architecturally significant outcomes, such
873
+ as compatibility, security, public interfaces, major features, packaging,
874
+ licensing, documentation architecture and test strategy.
875
+ - Omit development-time corrections, implementation details and intermediate
876
+ states that were reverted or superseded before release. Git history retains
877
+ that process.
878
+ - Summarize related low-level changes under their substantive outcome instead
879
+ of listing each method, dependency, test or file separately.
880
+
881
+ - Each entry opens with `vX.YY (YYYY-MM-DD)`, or `vX.YY (Release Date: TBD)`
882
+ while unreleased, underlined with `-`, followed by one `-` bullet per change.
883
+ Newest first. UTF-8.
884
+ - **One coherent change is one bullet, at most two physical lines.** A single
885
+ line at or under 80 columns is preferred whenever practical. This is an
886
+ explicit limit, not a prompt to reread: a bullet that runs past two lines,
887
+ or a single line that runs past 80 columns without necessity, must be
888
+ shortened. The entry is a list meant to be scanned, and a bullet that grows
889
+ past this limit costs it that: the eye no longer finds the changes by
890
+ counting lines, and a diff no longer shows a small, bounded edit.
891
+ - A bullet carrying file names, module names, setting names or plugin names
892
+ may pass 80 columns on its one or two lines when those names cannot be
893
+ shortened without losing meaning. The two-line ceiling still applies.
894
+ - **When a bullet runs long, abstract it first.** Drop the implementation
895
+ detail, the example, the reason and the secondary effect, and state what
896
+ the change is. Wrap onto the second line only when the abstracted bullet
897
+ still exceeds 80 columns. Keep what a reader cannot reconstruct without it:
898
+ what changed, what is now observably different, what it does to
899
+ compatibility, what it does to security, and the identifiers someone would
900
+ search for.
901
+ - Changes serving one purpose are described together even when they touch
902
+ several files. Related changes to one file within a version are normally one
903
+ bullet. Changes to one file carrying independent meaning are not forced
904
+ together — coherence decides, not the file name.
905
+ - Entries touching the same file, plugin or feature are placed near each other,
906
+ so that a version reads as a coherent whole. An independent change belonging
907
+ with nothing already listed is appended to the end of the current entry.
908
+ - Order within a version serves the reader, not the commit history.
909
+ - Released entries retain their substantive history even when their wording or
910
+ level of detail predates these rules.
911
+ - `doc/VERSIONS` carries these guidelines again at its foot, and an entry
912
+ written into it follows the limit recorded there.
913
+ - The first entry, at the lowest version `doc/VERSIONS` reaches, reads only
914
+ `Initial release.` and nothing else.
915
+
916
+ ### 10.5 The historical record
917
+
918
+ - **Past entries and their dates are not rewritten**, not to correct their
919
+ wording, not to renumber them, and not to make them consistent with this
920
+ document's current rules. They are the record of what was released.
921
+ - The release history was previously kept in `doc/ChangeLog`. It has been moved
922
+ into `doc/VERSIONS` in full, and `doc/ChangeLog` is gone; the two documents
923
+ had the same responsibility and keeping both meant keeping two records that
924
+ would diverge. No entry and no date was changed in the move.
925
+ - Where the record is incomplete — releases with no tag, or a version bumped
926
+ with no entry — `VERSIONS` says so rather than inventing an entry.
927
+
928
+ ---
929
+
930
+ ## 11. Continuous integration
931
+
932
+ - CI runs on GitHub Actions. `.github/workflows/ci.yml` is the required check;
933
+ `.github/workflows/plugins.yml` is a separate, non-required workflow that
934
+ installs the optional `plugins` group and runs the same suite, so that the
935
+ documented all-plugins setup is checked as well as described.
936
+ - **CI validates representative supported Ruby versions rather than every
937
+ intermediate release.** The matrix runs the ends of the supported range and
938
+ the release in the middle. The matrix and `required_ruby_version` are
939
+ therefore *not* the same set, and neither is wrong: the gemspec states what
940
+ the code is written for, the matrix states what is checked on every commit.
941
+ [`REQUIREMENTS.md`](REQUIREMENTS.md) section 20 states both.
942
+ - Removing a version from the matrix is not a statement that it fails, and no
943
+ incompatibility is introduced to make it one.
944
+ - What CI does is: install the bundle, build the gem, load the library, run the
945
+ command line, run the default suite. It is deliberately short, and an optional
946
+ integration is not added to it.
947
+ - **CI holds no secret and reaches no external service.** No credential is
948
+ configured, and no integration test against a third-party API is run there.
949
+ - **The required workflow installs no optional plugin gem**, so no plugin's own
950
+ dependency is a condition of the check that gates a change. The minimal
951
+ configuration is what it runs, which is what keeps the split of section 9.1
952
+ honest over time. Where an optional integration is worth testing at all, it is
953
+ tested separately from the required workflow; section 5 says how.
954
+ - **A non-required workflow is held to the same standard as the required one.**
955
+ It is separate so that an optional dependency cannot gate a change, not so
956
+ that it may fail quietly.
957
+ - **A failure is fixed, not silenced.** `|| true`, `continue-on-error` and a
958
+ step that hides its exit status are not how a build is made green. Narrowing
959
+ what is guaranteed is a legitimate answer; pretending to guarantee it is not.
960
+ - The Jenkins instance the project used until 2015 is gone. References to it
961
+ have been removed and are not to be reintroduced.
962
+ - A red build is fixed or reverted. It is not left red.