@open-tomato/rafa 0.45.0 → 0.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/README.md +285 -23
  2. package/dist/PROMPT.md +18 -1
  3. package/dist/adapters/logger/settings.d.ts +132 -0
  4. package/dist/bugs/closest.d.ts +19 -0
  5. package/dist/bugs/fenced.d.ts +8 -0
  6. package/dist/bugs/places.d.ts +20 -0
  7. package/dist/bugs/record.d.ts +145 -0
  8. package/dist/bugs/title.d.ts +83 -0
  9. package/dist/bundled/agents/doc-updater.md +17 -3
  10. package/dist/bundled/agents/loop-implementer.md +14 -2
  11. package/dist/bundled/operators/skills/rafa-stretch-pit-stop/SKILL.md +10 -3
  12. package/dist/bundled/operators/skills/rafa-stretch-sweep/SKILL.md +5 -0
  13. package/dist/bundled/skills/dev-planner/SKILL.md +101 -18
  14. package/dist/cli.js +76536 -64285
  15. package/dist/config/entry.d.ts +119 -0
  16. package/dist/config/index.d.ts +41 -0
  17. package/dist/config/index.js +54 -0
  18. package/dist/config/shape.d.ts +235 -0
  19. package/dist/config/templates.d.ts +64 -0
  20. package/dist/config-registry.d.ts +136 -0
  21. package/dist/config-schema-board-project.d.ts +157 -0
  22. package/dist/config-schema-bugs.d.ts +71 -0
  23. package/dist/config-schema-checks.d.ts +114 -0
  24. package/dist/config-schema-errors.d.ts +54 -0
  25. package/dist/config-schema-features.d.ts +64 -0
  26. package/dist/config-schema-hub.d.ts +152 -0
  27. package/dist/config-schema-issues.d.ts +95 -0
  28. package/dist/config-schema-logger.d.ts +91 -0
  29. package/dist/config-schema-loop-continue.d.ts +122 -0
  30. package/dist/config-schema-loop-retries.d.ts +94 -0
  31. package/dist/config-schema-release.d.ts +306 -0
  32. package/dist/config-schema-tests.d.ts +178 -0
  33. package/dist/config-schema-triage.d.ts +142 -0
  34. package/dist/config-schema-wrap-up.d.ts +96 -0
  35. package/dist/core/command/command.d.ts +228 -0
  36. package/dist/core/command/confirm.d.ts +73 -0
  37. package/dist/core/command/index.d.ts +130 -0
  38. package/dist/core/command/lazy.d.ts +54 -0
  39. package/dist/core/command/registry-types.d.ts +96 -0
  40. package/dist/core/command/running.d.ts +96 -0
  41. package/dist/core/command/shared-flags.d.ts +40 -0
  42. package/dist/core/command/spends.d.ts +39 -0
  43. package/dist/core/command/types.d.ts +92 -0
  44. package/dist/core/command/version.d.ts +4 -0
  45. package/dist/core/config/branch-template.d.ts +20 -0
  46. package/dist/core/config/config-items.d.ts +86 -0
  47. package/dist/core/config/config-load-module.d.ts +43 -0
  48. package/dist/core/config/config-load.d.ts +78 -0
  49. package/dist/core/config/config-origins.d.ts +58 -0
  50. package/dist/core/config/config-readers.d.ts +167 -0
  51. package/dist/core/config/config-schema.d.ts +212 -0
  52. package/dist/core/config/config-sections.d.ts +493 -0
  53. package/dist/core/config/config.d.ts +385 -0
  54. package/dist/core/config/core-section.d.ts +39 -0
  55. package/dist/core/config/dangerous.d.ts +58 -0
  56. package/dist/core/config/default-routing.d.ts +16 -0
  57. package/dist/core/config/index.d.ts +145 -0
  58. package/dist/core/config/merge-method.d.ts +40 -0
  59. package/dist/core/config/scope.d.ts +42 -0
  60. package/dist/core/config/section.d.ts +286 -0
  61. package/dist/core/config/sections.d.ts +53 -0
  62. package/dist/core/config/standard-schema.d.ts +27 -0
  63. package/dist/core/git/commit.d.ts +232 -0
  64. package/dist/core/git/gh-runner.d.ts +24 -0
  65. package/dist/core/git/git.d.ts +22 -0
  66. package/dist/core/git/index.d.ts +85 -0
  67. package/dist/core/loop/claude.d.ts +388 -0
  68. package/dist/core/loop/hop-record.d.ts +52 -0
  69. package/dist/core/loop/index.d.ts +179 -0
  70. package/dist/core/loop/session-env.d.ts +20 -0
  71. package/dist/core/loop/session-record-parse.d.ts +70 -0
  72. package/dist/core/loop/sessions.d.ts +420 -0
  73. package/dist/core/loop/suite-failure.d.ts +25 -0
  74. package/dist/core/output/active.d.ts +100 -0
  75. package/dist/core/output/stream.d.ts +20 -0
  76. package/dist/core/output/text.d.ts +55 -0
  77. package/dist/core/plan/block-reader.d.ts +46 -0
  78. package/dist/core/plan/blocks.d.ts +139 -0
  79. package/dist/core/plan/declaration.d.ts +366 -0
  80. package/dist/core/plan/plan-stamp.d.ts +75 -0
  81. package/dist/core/runtime/identity.d.ts +21 -0
  82. package/dist/core/runtime/index.d.ts +46 -0
  83. package/dist/effort/store/bring-forward.d.ts +131 -0
  84. package/dist/effort/store/check-rows.d.ts +31 -0
  85. package/dist/effort/store/commit-stats.d.ts +42 -0
  86. package/dist/effort/store/copy.d.ts +35 -0
  87. package/dist/effort/store/development-build.d.ts +105 -0
  88. package/dist/effort/store/effort-levels.d.ts +13 -0
  89. package/dist/effort/store/findings.d.ts +214 -0
  90. package/dist/effort/store/fix-schema.d.ts +184 -0
  91. package/dist/effort/store/index.js +10 -7
  92. package/dist/effort/store/location.d.ts +44 -0
  93. package/dist/effort/store/merge-commit-gaps.d.ts +68 -0
  94. package/dist/effort/store/merge-conflicts.d.ts +91 -0
  95. package/dist/effort/store/merge-rules.d.ts +82 -0
  96. package/dist/effort/store/merge-store.d.ts +211 -0
  97. package/dist/effort/store/merge-union.d.ts +92 -0
  98. package/dist/effort/store/migrate.d.ts +146 -0
  99. package/dist/effort/store/migrations.d.ts +92 -0
  100. package/dist/effort/store/ndjson-files.d.ts +114 -0
  101. package/dist/effort/store/origins.d.ts +116 -0
  102. package/dist/effort/store/plan-stubs.d.ts +79 -0
  103. package/dist/effort/store/rebuild-aside.d.ts +172 -0
  104. package/dist/effort/store/schema-plan.d.ts +102 -0
  105. package/dist/effort/store/session-row-types.d.ts +64 -0
  106. package/dist/effort/store/settings.d.ts +13 -0
  107. package/dist/effort/store/sqlite.d.ts +340 -0
  108. package/dist/effort/store/store-generation.d.ts +17 -0
  109. package/dist/effort/store/store-identity.d.ts +220 -0
  110. package/dist/effort/store/store-meta.d.ts +305 -0
  111. package/dist/effort/store/store-replaced.d.ts +72 -0
  112. package/dist/effort/store/types.d.ts +223 -0
  113. package/dist/errors/codes.d.ts +56 -0
  114. package/dist/errors/rafa-codes.d.ts +36 -0
  115. package/dist/{index-nv34ptht.js → index-38ktnyvz.js} +14 -9
  116. package/dist/index-3mwsr6wg.js +1070 -0
  117. package/dist/index-7dgc5g1t.js +13480 -0
  118. package/dist/index-cbqvgda6.js +766 -0
  119. package/dist/index-eay1bd2w.js +2632 -0
  120. package/dist/index-f1y86zbb.js +125 -0
  121. package/dist/index-n3e31fmw.js +1041 -0
  122. package/dist/{index-r28fzsvc.js → index-nwzx41g1.js} +351 -166
  123. package/dist/index-pzpb1rf7.js +153 -0
  124. package/dist/{index-mgh2s9bj.js → index-r5q2pdky.js} +65 -457
  125. package/dist/index-z1w83f81.js +4 -0
  126. package/dist/index.js +17592 -24119
  127. package/dist/learning/index.js +5 -6
  128. package/dist/plan/index.js +12 -11
  129. package/dist/plan-prompt.md +3 -1
  130. package/dist/ports/index.d.ts +732 -0
  131. package/dist/ports/learning.d.ts +101 -0
  132. package/dist/ports/log-level.d.ts +13 -0
  133. package/dist/ports/spec-review.d.ts +66 -0
  134. package/dist/ready-6p40c3gw.js +2007 -0
  135. package/dist/release-templates/release-bot-fragment.yml +153 -0
  136. package/dist/release-templates/release-publish.yml +110 -0
  137. package/dist/release-templates/release-settle.yml +122 -0
  138. package/dist/release-templates/release-tag.yml +102 -0
  139. package/dist/report/parse.d.ts +415 -0
  140. package/dist/schema/project-id.d.ts +79 -0
  141. package/dist/schema/tiers.d.ts +107 -0
  142. package/package.json +62 -3
  143. package/dist/index-hf2k497d.js +0 -16
  144. package/dist/index-nsr78ct2.js +0 -8219
@@ -0,0 +1,306 @@
1
+ /**
2
+ * The `pr` and `release` sections of the config schema, and the one
3
+ * `dangerous` key the release plan adds: each setting's field, its
4
+ * default and its spec. {@link RELEASE_SECTION} hands them to core as
5
+ * one `ConfigSection`, package `release`, and the `declare module` below
6
+ * adds {@link PrSettings}, {@link ReleaseSettings} and
7
+ * {@link DangerousReleaseSettings} to `RafaConfig`.
8
+ * {@link ReleaseShape} holds the keys a file writes and
9
+ * {@link ReleaseDangerousShape} its part of the shared `dangerous`
10
+ * namespace, which `src/config/shape.ts` composes into `ConfigShape`,
11
+ * the nested file shape.
12
+ * `config-registry.ts`'s `CONFIG_DEFAULTS` and `SETTINGS`
13
+ * spread the objects below at the places the two sections always sat,
14
+ * and the `dangerous` key right after `dangerous.acceptStaleRefs`, so
15
+ * the order settings are reported in, and the order a warning lists keys
16
+ * in, holds each key's section.
17
+ *
18
+ * They moved out of `config-schema.ts` when that module stood at 780
19
+ * lines, measured with `wc -l`, before the release plan's six keys
20
+ * joined these two sections and `dangerous`: new keys in a module near
21
+ * the 800-line cap of `context/source.md` would be paid for by
22
+ * rewrapping prose. The six keys then joined here. Every rule the schema module states about a KEY
23
+ * still holds here, and `config-sections.ts` still holds every rule
24
+ * about a VALUE. `config-registry.ts` imports this file to spread it; a
25
+ * caller reads these settings off the resolved `RafaConfig`.
26
+ *
27
+ * ## The `pr` section
28
+ *
29
+ * `.rafa/specs/rafa-20-pr-commands.md` spells it `pr: { provider: gh | none,
30
+ * mergeMethod: squash | merge | rebase, base: <default branch> }`, and
31
+ * names `pr.resolveBudget` as what a `triage --resolve` session's
32
+ * `--max-budget-usd` comes from. Four readings it leaves to this module:
33
+ *
34
+ * - `pr.provider` and `pr.base` default to NULL, and null here means
35
+ * "nobody has said", not "off". The spec's default for the provider
36
+ * is `gh` when `origin` is a GitHub remote and `none` otherwise, and
37
+ * its default base is whatever the remote calls its default branch;
38
+ * neither is a value this module can spell, because both are read
39
+ * off the repository at use (`pr/provider.ts`). Writing either
40
+ * default as a literal would be the silent choice the config refuses
41
+ * everywhere else: `prBase: 'main'` would open a pull request into a
42
+ * branch that may not exist on a repository whose default is
43
+ * `master`. A file spelling `provider:` or `base:` with no value
44
+ * says nothing, as every null does, and resolves to the same null.
45
+ * - `pr.mergeMethod` defaults to `squash`, the first method the spec
46
+ * lists and the one the merge flow is written for: it deletes the
47
+ * local branch with `-D` because a squash leaves it unmerged in
48
+ * git's eyes.
49
+ * - `pr.resolveBudget` defaults to 2 US dollars, which the attempt
50
+ * guard's default of two attempts caps at 4 for one pull request.
51
+ * It is a number and not null: the spec has every resolve run carry
52
+ * `--max-budget-usd`, so a session with no budget is not a state
53
+ * this setting can be left in.
54
+ * - No `pr` setting is a `CommandLineSetting`. `pr merge` takes
55
+ * a `--method` flag, but that flag is the command's own argument for
56
+ * one merge, read by the command beside this setting, and not a
57
+ * layer over the config: a global `--merge-method` nobody typed
58
+ * would be a flag this module invented.
59
+ * - `pr.versionCollision` defaults to `report`. It sets how `rafa pr
60
+ * merge` reacts to a branch the release guard reads as `missing`
61
+ * (source changes and no fragment) or `stale` (a stamped version
62
+ * the base branch has passed): `report` names it and merges,
63
+ * `allow` is silent, `ask` asks and `refuse` stops. A `collision` is
64
+ * not this setting's: it always refuses, unless
65
+ * `dangerous.acceptVersionCollision` says otherwise. A default of
66
+ * `refuse` would stop every project whose branches still stamp their
67
+ * own versions the day it upgrades.
68
+ *
69
+ * ## The `release` section
70
+ *
71
+ * `.rafa/specs/rafa-21-changelog-and-release.md` spells it `release: {
72
+ * enabled: auto, versionFile: package.json, changelog: CHANGELOG.md,
73
+ * heading: "## {version} — {date}, {title}" }`, and those four values
74
+ * are the defaults here. Four readings it leaves to this module:
75
+ *
76
+ * - `release.enabled` is not a flag. `auto`, its default, is a third
77
+ * value meaning "on when both files below exist" — a reading
78
+ * `release/enabled.ts` makes against a disk, which no value here
79
+ * could stand for. What the reader takes beside it, and why `on`
80
+ * and `off` are refused, is `config-sections.ts`'s to say.
81
+ * - `release.versionFile` and `release.changelog` are paths relative
82
+ * to the repository root, and neither is null. Null elsewhere here
83
+ * means "nobody has said", and the spec has said: `package.json`
84
+ * and `CHANGELOG.md`. The absence the spec cares about is the
85
+ * FILE's — "a project with no version file gets the changelog
86
+ * entry under a date heading and no bump" — which is a question
87
+ * about a disk, answered at use and not spellable as a default.
88
+ * - `release.heading` is free text. The spec makes it a template so
89
+ * "a consumer's changelog has another shape" is an edit rather
90
+ * than a fork, and which placeholders it may carry, and what an
91
+ * unknown one renders to, is `release/changelog.ts`'s to say. So
92
+ * nothing here refuses a heading for the placeholders it spells.
93
+ * - No `release` setting is a `CommandLineSetting`, for the
94
+ * reason the `pr` section gives: the `release` commands read these
95
+ * settings beside their own arguments, and a global flag nobody
96
+ * typed would be one this module invented.
97
+ *
98
+ * Four more `release` settings belong to the plan in which no branch
99
+ * owns a version number — a branch commits one change fragment, and
100
+ * `rafa release settle` folds the fragments into a version on the base
101
+ * branch after the merges:
102
+ *
103
+ * - `release.fragments` defaults to `.changes`, the directory a
104
+ * fragment is written into. It is a path relative to the repository
105
+ * root and never under `.rafa/`, which is gitignored; the reader,
106
+ * `config-readers.ts`'s `fragmentsDirectory`, says why.
107
+ * - `release.strategy` defaults to `semver-by-level`, and that is the
108
+ * only value it accepts today: a closed list of one, so a file
109
+ * naming a strategy that does not exist is refused rather than
110
+ * folded by a strategy it did not name.
111
+ * - `release.settle` defaults to `push`: settle pushes the settled
112
+ * commit to the base branch, and `pr` opens a pull request with it
113
+ * instead, for a base branch that takes no direct push.
114
+ * - `release.tag` defaults to `manual`: `rafa release tag` stays the
115
+ * one write of the tag, and `settle` has settle put it on the
116
+ * commit it pushes.
117
+ *
118
+ * One more `release` setting is text `rafa release tag` prints and
119
+ * `rafa release publish` runs:
120
+ *
121
+ * - `release.publishCommand` defaults to `npm publish`, the command
122
+ * `rafa release tag` names for the publish after the tag and
123
+ * `rafa release publish` runs in each tagged unit's folder. It is free
124
+ * text, so a project that publishes with another tool, or with a
125
+ * flag such as `--tag next`, says so here. It was read off the
126
+ * manifest's `packageManager` field until 2026-09-30, which named
127
+ * `bun publish` for this repository while its releases are
128
+ * published with `npm publish`: the tool a project installs with is
129
+ * not the tool it publishes with.
130
+ *
131
+ * One more `release` setting says who publishes a tagged version:
132
+ *
133
+ * - `release.publish` defaults to `manual`: a person runs the publish
134
+ * after the tag. `ci` says the pushed tag publishes through the
135
+ * project's CI workflow instead. It is the third key the release
136
+ * ladder is read off, beside `release.settle` and `release.tag`.
137
+ *
138
+ * One more `release` setting is for the repository that releases rafa:
139
+ *
140
+ * - `release.moveLock` defaults to `false`. When it is `true`, settle
141
+ * also writes `rafa.lock` at the repository root to the version it
142
+ * settles, in the same release commit as the version file and the
143
+ * changelog, so the repository's own lock follows the rafa it
144
+ * publishes. It is read through `flag`, so `"true"`, `yes` and `1`
145
+ * are refused, and it is not a `CommandLineSetting`.
146
+ *
147
+ * ## The `dangerous` key
148
+ *
149
+ * `dangerous.acceptVersionCollision` has `rafa pr merge` accept, on
150
+ * every run, a branch the release guard reads as a `collision` — its
151
+ * version already on the base branch with different notes — which it
152
+ * refuses whatever `pr.versionCollision` says. It is read as `dangerous.acceptStaleRefs`
153
+ * is, for the reasons `config-schema.ts`'s "The `dangerous` section"
154
+ * gives: it defaults to `false` and not null, it goes through `flag` so
155
+ * `"true"`, `yes` and `1` are refused, and it is not a
156
+ * `CommandLineSetting`.
157
+ */
158
+ import type { ConfigSection, SettingSpec } from '@open-tomato/rafa/core/config';
159
+ import type { MergeMethod, PrProvider, Reader, ReleaseEnabled, ReleasePublishMode, ReleaseSettleMode, ReleaseStrategy, ReleaseTagMode, VersionCollisionMode } from '@open-tomato/rafa/core/config/sections';
160
+ declare module '@open-tomato/rafa/core/config/config-schema' {
161
+ /** The `release` section's fields, added to core's. */
162
+ interface RafaConfig extends PrSettings, ReleaseSettings, DangerousReleaseSettings {
163
+ }
164
+ }
165
+ /**
166
+ * The `pr` and `release` keys a file writes, both namespaces this
167
+ * section's alone; `src/config/shape.ts` composes them into `ConfigShape`.
168
+ */
169
+ export interface ReleaseShape {
170
+ readonly pr: {
171
+ readonly provider: PrProvider;
172
+ readonly mergeMethod: MergeMethod;
173
+ readonly base: string;
174
+ readonly resolveBudget: number;
175
+ readonly versionCollision: VersionCollisionMode;
176
+ };
177
+ readonly release: {
178
+ readonly enabled: ReleaseEnabled;
179
+ readonly versionFile: string;
180
+ readonly changelog: string;
181
+ readonly heading: string;
182
+ readonly fragments: string;
183
+ readonly strategy: ReleaseStrategy;
184
+ readonly settle: ReleaseSettleMode;
185
+ readonly tag: ReleaseTagMode;
186
+ readonly publishCommand: string;
187
+ readonly publish: ReleasePublishMode;
188
+ readonly moveLock: boolean;
189
+ };
190
+ }
191
+ /**
192
+ * `dangerous.acceptVersionCollision`, the section's part of the shared
193
+ * `dangerous` namespace; `src/config/shape.ts` composes it into
194
+ * `DangerousShape` beside core's consents.
195
+ */
196
+ export interface ReleaseDangerousShape {
197
+ readonly acceptVersionCollision: boolean;
198
+ }
199
+ /** The `pr` section's settings, resolved. */
200
+ export interface PrSettings {
201
+ /**
202
+ * The provider every `pr` action goes through, or null to read it off
203
+ * the `origin` remote. `pr.provider`.
204
+ */
205
+ prProvider: PrProvider | null;
206
+ /** How `pr merge` merges, unless `--method` names another. `pr.mergeMethod`. */
207
+ prMergeMethod: MergeMethod;
208
+ /**
209
+ * The branch a pull request is opened into, or null for whatever the
210
+ * remote calls its default branch. `pr.base`.
211
+ */
212
+ prBase: string | null;
213
+ /**
214
+ * The budget in US dollars each `pr triage --resolve` session is
215
+ * spawned with. `pr.resolveBudget`.
216
+ */
217
+ prResolveBudget: number;
218
+ /**
219
+ * How `pr merge` reacts to a branch the release guard reads as
220
+ * `missing` or `stale`. `pr.versionCollision`.
221
+ */
222
+ prVersionCollision: VersionCollisionMode;
223
+ }
224
+ /** The `release` section's settings, resolved. */
225
+ export interface ReleaseSettings {
226
+ /**
227
+ * Whether a run bumps the version and writes a changelog entry, or
228
+ * `auto` to decide it off the two files below. `release.enabled`.
229
+ */
230
+ releaseEnabled: ReleaseEnabled;
231
+ /**
232
+ * The manifest the version is read from and written back to, from
233
+ * the repository root. `release.versionFile`.
234
+ */
235
+ releaseVersionFile: string;
236
+ /**
237
+ * The changelog an entry is inserted into, from the repository root.
238
+ * `release.changelog`.
239
+ */
240
+ releaseChangelog: string;
241
+ /** The template one entry's heading is rendered from. `release.heading`. */
242
+ releaseHeading: string;
243
+ /**
244
+ * The directory change fragments are written into, from the
245
+ * repository root. `release.fragments`.
246
+ */
247
+ releaseFragments: string;
248
+ /** The strategy the fragments are folded into a version by. `release.strategy`. */
249
+ releaseStrategy: ReleaseStrategy;
250
+ /** How settle lands the settled version on the base branch. `release.settle`. */
251
+ releaseSettle: ReleaseSettleMode;
252
+ /** Who tags a settled version. `release.tag`. */
253
+ releaseTag: ReleaseTagMode;
254
+ /** The command `rafa release tag` prints for the publish and `rafa release publish` runs. `release.publishCommand`. */
255
+ releasePublishCommand: string;
256
+ /** Who publishes a tagged version: a person, or CI on the pushed tag. `release.publish`. */
257
+ releasePublish: ReleasePublishMode;
258
+ /**
259
+ * Whether settle also writes `rafa.lock` to the version it settles,
260
+ * in the same release commit. `release.moveLock`.
261
+ */
262
+ releaseMoveLock: boolean;
263
+ }
264
+ /** The `dangerous` setting the release plan adds, resolved. */
265
+ export interface DangerousReleaseSettings {
266
+ /**
267
+ * Whether `pr merge` accepts, on every run, a branch the release
268
+ * guard reads as a `collision`. `dangerous.acceptVersionCollision`.
269
+ */
270
+ dangerousAcceptVersionCollision: boolean;
271
+ }
272
+ /** What every `pr` setting resolves to when no layer names it. */
273
+ export declare const PR_DEFAULTS: Readonly<PrSettings>;
274
+ /** What every `release` setting resolves to when no layer names it. */
275
+ export declare const RELEASE_DEFAULTS: Readonly<ReleaseSettings>;
276
+ /** What the release plan's `dangerous` setting resolves to when no layer names it. */
277
+ export declare const DANGEROUS_RELEASE_DEFAULTS: Readonly<DangerousReleaseSettings>;
278
+ /**
279
+ * Accepts one of the three merge methods. The list is core's
280
+ * (`core/config/merge-method.ts`, read through the sections barrel),
281
+ * which spells them to match what `gh pr merge` takes, and the pull
282
+ * request port re-exports the same list, so a second spelling here
283
+ * could not disagree with either.
284
+ *
285
+ * It sits here, beside the one setting that reads it, and not among
286
+ * core's readers in `config-sections.ts`: the reader is the release
287
+ * section's, and the list alone is core's. Nothing under `src/pr/` is
288
+ * imported here, so the section reaches neither the port nor the
289
+ * `./pr/index.js` barrel, which carries `pr/gh.ts` and the `gh`
290
+ * spawner.
291
+ */
292
+ export declare const mergeMethod: Reader<MergeMethod>;
293
+ /** The `pr` section's setting specs, in the order problems are reported. */
294
+ export declare const PR_SETTINGS: {
295
+ readonly [K in keyof PrSettings]: SettingSpec<K>;
296
+ };
297
+ /** The `release` section's setting specs, in the order problems are reported. */
298
+ export declare const RELEASE_SETTINGS: {
299
+ readonly [K in keyof ReleaseSettings]: SettingSpec<K>;
300
+ };
301
+ /** The release plan's `dangerous` setting spec. */
302
+ export declare const DANGEROUS_RELEASE_SETTINGS: {
303
+ readonly [K in keyof DangerousReleaseSettings]: SettingSpec<K>;
304
+ };
305
+ /** The `release` section: the `pr` and `release` keys and `dangerous.acceptVersionCollision`, with their defaults and no check. */
306
+ export declare const RELEASE_SECTION: ConfigSection;
@@ -0,0 +1,178 @@
1
+ /**
2
+ * The `tests` section of the config schema: the three settings the
3
+ * runner reads when it chooses which tests a recorded step runs, the one
4
+ * that names the contract tests, and the one that says whether a step reruns a newly red file alone, each one's
5
+ * field, its default, its spec and its reader. {@link TESTS_SECTION}
6
+ * hands them to core as one `ConfigSection`, package `tests`, and the
7
+ * `declare module` below adds {@link TestsSettings} to `RafaConfig`.
8
+ * {@link TestsShape} holds the keys a file writes, which
9
+ * `src/config/shape.ts` composes into `ConfigShape`, the nested file shape.
10
+ * `config-registry.ts`'s `CONFIG_DEFAULTS` and `SETTINGS`
11
+ * spread the objects below last, after the `task` section, so the order
12
+ * settings are reported in holds the section.
13
+ *
14
+ * The section has its own module, as `config-schema-release.ts` does,
15
+ * because `config-sections.ts` stood at 699 lines, measured with
16
+ * `wc -l`, when these keys were added, and takes nothing new under the
17
+ * 800-line cap of `context/source.md`. The one reader the four glob keys
18
+ * share, {@link globList}, is a rule about a VALUE and sits here all the
19
+ * same, for that reason. `config-registry.ts` imports this file to spread
20
+ * it; a caller reads these settings off the resolved `RafaConfig`.
21
+ *
22
+ * ## The four glob keys
23
+ *
24
+ * `.rafa/plans/PLAN-rafa-479-loop-task-sessions-run.md` names the first
25
+ * two, the plan `rafa-683-content-sweeps-lint-run` the third, and the
26
+ * plan `rafa-807-spec-monorepo-bootstrap-turbo` the fourth. Each
27
+ * is a list of glob patterns, matched against a path relative to the
28
+ * repository root, the form `git diff --name-only` answers with:
29
+ *
30
+ * - `tests.fullSuiteTriggers` names the files a task's diff runs the
31
+ * full suite for, however the task line scoped its tests. Its
32
+ * default is empty. The `escalation` template
33
+ * (`src/config/templates.ts`) names the five files whose change can
34
+ * move a test no import graph reaches: `bunfig.toml`,
35
+ * `tsconfig*.json`, `package.json`, `bun.lock` and `bun.lockb`. The
36
+ * runner adds the preload files `bunfig.toml`'s `[test] preload`
37
+ * names to whatever list resolves, empty included, and those are in
38
+ * no list here: which files a project preloads is a question about
39
+ * its disk, answered at run time by the reader of the scope.
40
+ * - `tests.integration` names the test files a stage step runs beside
41
+ * the tests under the folders the stage touched, because they drive
42
+ * the whole CLI rather than one folder's modules. Its default is
43
+ * empty. The `escalation` template names the four spellings this
44
+ * repository gives such a file, in any folder: a name ending
45
+ * `-integration.test.ts` or `.integration.test.ts`, one holding
46
+ * `-spawned` and ending `.test.ts`, and one ending `-cli.test.ts`.
47
+ * Each of its patterns opens with the any-folder prefix, two stars
48
+ * and a slash, which this note cannot spell because it would close
49
+ * the comment. A task step reads it too when `checks.task` names
50
+ * `integration` or `unit`.
51
+ * - `tests.contract` names the contract tests. A contract test checks
52
+ * the promise a package makes to others, with a fixture, and runs in
53
+ * that package's own `test` task in ring 1 of CI, where a use-case
54
+ * test matching `tests.integration` runs in ring 0's full run. Its
55
+ * default is empty. The `escalation` template names one pattern: a
56
+ * name ending `.contract.test.ts`, in any folder, under the same
57
+ * any-folder prefix. The runner's task step reads it when
58
+ * `checks.task` names `contract` or `unit`
59
+ * (`start/suite-task-step.ts`); its CI readers come with the rings
60
+ * that run each kind.
61
+ * - `tests.alwaysRun` names the test files a task's scoped run takes
62
+ * beside the ones `bun test --changed=<base>` selects. A content
63
+ * sweep, a test that imports no project file and reads the tree at
64
+ * run time, sits outside every import graph, so no changed file ever
65
+ * selects one. Its default is one pattern: any file under `src/`
66
+ * whose name ends `.sweep.test.ts`, the suffix this repository gives
67
+ * a content sweep. A pattern that matches no file today is accepted,
68
+ * since the sweeps it names may not have been written yet. The task
69
+ * prompt reads it (`start/task-gate-lines.ts`), naming the files it
70
+ * resolves to, and so does the runner's task step
71
+ * (`start/task-always-run.ts`), running those files beside an
72
+ * `affected` run and in a path list where `related` is in play
73
+ * (`start/suite-step.ts`'s module note).
74
+ *
75
+ * An empty list is a value every glob key accepts, and means what it says:
76
+ * no file triggers the full suite beyond the preload files, a stage
77
+ * runs no integration file, no file is a contract test, or a task runs
78
+ * no sweep beside its scoped tests. The first three default to it, so a
79
+ * project that names no template runs no trigger, no integration file
80
+ * and no contract file; one that writes `templates: [escalation]` takes
81
+ * the template's lists under its own keys. A list written `[]` has been
82
+ * said, and outranks the template's.
83
+ *
84
+ * ## The reader
85
+ *
86
+ * {@link globList} takes a list whose every entry is a non-empty
87
+ * string, as `cleanup.keep` does, and refuses one more entry `text`
88
+ * would take: an absolute path. The paths a pattern is matched against
89
+ * are relative to the repository root, so a pattern opening with `/`
90
+ * matches nothing, and a trigger that can never fire is the silent
91
+ * failure this key exists to prevent. No other check is made on the
92
+ * pattern: `Bun.Glob` builds a matcher from any string, so there is no
93
+ * malformed glob to refuse.
94
+ *
95
+ * ## The switch
96
+ *
97
+ * `tests.retakeRedAlone` says whether a task, stage or pre-wrap-up step
98
+ * that reads new failures reruns each newly red test file alone, once,
99
+ * before it settles (`start/suite-retake-alone.ts`). A file green alone
100
+ * was red only in the step's own file order, by state another test file
101
+ * left in the shared process, and is reported as such rather than handed
102
+ * to a repair task (issue 926: one run of 2026-10-10 inserted five repair
103
+ * tasks for a file each repair session found green). Two readings:
104
+ *
105
+ * - It defaults to `true`. The retake costs one `bun test <file>` per
106
+ * newly red file and only on a step already red, and what it saves is
107
+ * a repair session per order-dependent file. `false` switches the
108
+ * retake off and nothing else: every new failure blocks, and no file
109
+ * is run a second time. The error lines a step keeps for each failed
110
+ * case (`suite/failure-lines.ts`), on its record, in its output file
111
+ * and in its blocker, are kept either way; no key turns them off.
112
+ * - It is read through `flag` (`config-sections.ts`), a YAML boolean
113
+ * and nothing spelled like one, as `status.notice` is.
114
+ *
115
+ * No key here is a `CommandLineSetting`: four are lists, which the
116
+ * command line has no spelling for, as `config-schema.ts` says, and the
117
+ * switch is none for the reason the `pr` section gives
118
+ * (`config-schema-readings.ts`): a global flag nobody typed would be one
119
+ * this module invented.
120
+ */
121
+ import type { ConfigSection, SettingSpec } from '@open-tomato/rafa/core/config';
122
+ import type { Reader } from '@open-tomato/rafa/core/config/sections';
123
+ declare module '@open-tomato/rafa/core/config/config-schema' {
124
+ /** The `tests` section's fields, added to core's. */
125
+ interface RafaConfig extends TestsSettings {
126
+ }
127
+ }
128
+ /** The `tests` keys a file writes; `src/config/shape.ts` composes them into `ConfigShape`. */
129
+ export interface TestsShape {
130
+ readonly tests: {
131
+ readonly fullSuiteTriggers: readonly string[];
132
+ readonly integration: readonly string[];
133
+ readonly contract: readonly string[];
134
+ readonly alwaysRun: readonly string[];
135
+ readonly retakeRedAlone: boolean;
136
+ };
137
+ }
138
+ /** The `tests` section's settings, resolved. */
139
+ export interface TestsSettings {
140
+ /**
141
+ * Globs naming the files whose change runs the full suite at a task
142
+ * step, beside `bunfig.toml`'s preload files. `tests.fullSuiteTriggers`.
143
+ */
144
+ testsFullSuiteTriggers: readonly string[];
145
+ /**
146
+ * Globs naming the test files every stage step runs.
147
+ * `tests.integration`.
148
+ */
149
+ testsIntegration: readonly string[];
150
+ /**
151
+ * Globs naming the contract tests, each checking the promise a package
152
+ * makes to others. `tests.contract`.
153
+ */
154
+ testsContract: readonly string[];
155
+ /**
156
+ * Globs naming the test files a task's scoped run takes beside the
157
+ * changed-file selection. `tests.alwaysRun`.
158
+ */
159
+ testsAlwaysRun: readonly string[];
160
+ /**
161
+ * Whether a step reading new failures reruns each newly red test file
162
+ * alone, once, before it settles. `tests.retakeRedAlone`.
163
+ */
164
+ testsRetakeRedAlone: boolean;
165
+ }
166
+ /**
167
+ * The reader the four glob settings share: a list of glob patterns, each
168
+ * relative to the repository root, answered frozen in the order written.
169
+ */
170
+ export declare const globList: Reader<readonly string[]>;
171
+ /** What every `tests` setting resolves to when no layer names it. */
172
+ export declare const TESTS_DEFAULTS: Readonly<TestsSettings>;
173
+ /** The `tests` section's setting specs, in the order problems are reported. */
174
+ export declare const TESTS_SETTINGS: {
175
+ readonly [K in keyof TestsSettings]: SettingSpec<K>;
176
+ };
177
+ /** The `tests` section: the five `tests` keys, with their defaults and no check. */
178
+ export declare const TESTS_SECTION: ConfigSection;
@@ -0,0 +1,142 @@
1
+ /**
2
+ * The `triage` section of the config schema: the five settings triage
3
+ * reads when it looks for the nearest open bug a report repeats and ranks
4
+ * the ones a new bug lists, each one's field, its default, its spec and
5
+ * its reader.
6
+ * {@link TRIAGE_SECTION} hands them to core as one `ConfigSection`,
7
+ * package `triage`, and the `declare module` below adds
8
+ * {@link TriageSettings} to `RafaConfig`.
9
+ * {@link TriageShape} holds the keys a file writes, which
10
+ * `src/config/shape.ts` composes into `ConfigShape`, the nested file shape.
11
+ * `config-registry.ts`'s `CONFIG_DEFAULTS` and `SETTINGS`
12
+ * spread the objects below right after the `claims` section.
13
+ *
14
+ * The section has its own module, as `config-schema-tests.ts` and
15
+ * `config-schema-wrap-up.ts` do, because `config-schema.ts` stood at 592
16
+ * lines and `config-sections.ts` at 705, measured with `wc -l`, when
17
+ * these keys were added: the schema module's own note asks a new
18
+ * section for a sibling, and the readers are rules about a VALUE that
19
+ * only these keys read, so they sit here beside them. Only
20
+ * `config-registry.ts` imports this file; a caller reads the settings off
21
+ * the resolved `RafaConfig`.
22
+ *
23
+ * ## The five keys
24
+ *
25
+ * Step 3 of a public bug's lookup (`triage/triage.ts`) scores the
26
+ * report against each open bug by Jaccard similarity of their word
27
+ * sets, after the exact-key lookups have missed:
28
+ *
29
+ * - `triage.similarity.threshold` is the least score at which the
30
+ * nearest open bug is taken for the same bug and commented on. It
31
+ * defaults to `0.3` and accepts a number above 0 and at most 1: a
32
+ * Jaccard score lies in 0..1, so a threshold above 1 could never be
33
+ * met, and one of 0 or below would match every open bug, words
34
+ * shared or not. `false` turns step 3 off, so triage files with the
35
+ * exact-key lookups alone. `true` is refused: it names no score, and
36
+ * reading it as the default would be a choice nobody wrote.
37
+ * - `triage.similarity.candidates` is how many of the nearest open
38
+ * bugs a new bug's `Possible duplicates` section lists. It defaults
39
+ * to `3` and accepts a whole number from 1 to 10; the cap keeps that
40
+ * section short enough to read. It takes no `false`: turning step 3
41
+ * off is the threshold's to say.
42
+ * - `triage.similarity.weights.causeLeaf`, `.causeFamily` and
43
+ * `.boundary` are the bonuses `rankedCandidates`
44
+ * (`triage/similarity.ts`) adds to an open bug's word score when it
45
+ * shares the new bug's cause code, only its cause family, or its
46
+ * module and action; the sum is capped at 1 and orders the
47
+ * `Possible duplicates` list, never the same-bug decision. They
48
+ * default to `0.15`, `0.05` and `0.10` and each accepts a number from
49
+ * 0 to 1 inclusive: `0` turns its signal off, which is why it is
50
+ * accepted here and refused by the threshold, and a bonus above 1
51
+ * could only ever hit the cap. `true` and `false` are refused, as the
52
+ * threshold refuses `true`: `0` already says off.
53
+ *
54
+ * A quoted number is refused, as every other reader refuses a string
55
+ * spelled like its type. No key is a `CommandLineSetting`: the
56
+ * command line has no spelling for `false` or a number this module
57
+ * would not have to invent.
58
+ */
59
+ import type { ConfigSection, SettingSpec } from '@open-tomato/rafa/core/config';
60
+ import type { Reader } from '@open-tomato/rafa/core/config/sections';
61
+ declare module '@open-tomato/rafa/core/config/config-schema' {
62
+ /** The `triage` section's fields, added to core's. */
63
+ interface RafaConfig extends TriageSettings {
64
+ }
65
+ }
66
+ /** The `triage` keys a file writes; `src/config/shape.ts` composes them into `ConfigShape`. */
67
+ export interface TriageShape {
68
+ readonly triage: {
69
+ readonly similarity: {
70
+ readonly threshold: SimilarityThreshold;
71
+ readonly candidates: number;
72
+ readonly weights: {
73
+ readonly causeLeaf: number;
74
+ readonly causeFamily: number;
75
+ readonly boundary: number;
76
+ };
77
+ };
78
+ };
79
+ }
80
+ /** The most `triage.similarity.threshold` accepts. */
81
+ export declare const SIMILARITY_THRESHOLD_MAX = 1;
82
+ /** The least a `triage.similarity.weights.*` bonus accepts; `0` turns its signal off. */
83
+ export declare const SIMILARITY_WEIGHT_MIN = 0;
84
+ /** The most a `triage.similarity.weights.*` bonus accepts. */
85
+ export declare const SIMILARITY_WEIGHT_MAX = 1;
86
+ /** The fewest nearest issues `triage.similarity.candidates` accepts. */
87
+ export declare const SIMILARITY_CANDIDATES_MIN = 1;
88
+ /** The most nearest issues `triage.similarity.candidates` accepts. */
89
+ export declare const SIMILARITY_CANDIDATES_MAX = 10;
90
+ /**
91
+ * The least Jaccard score at which the nearest open bug is taken for the
92
+ * report's, or `false` with the similarity step turned off.
93
+ */
94
+ export type SimilarityThreshold = number | false;
95
+ /** The `triage` section's settings, resolved. */
96
+ export interface TriageSettings {
97
+ /**
98
+ * The least score at which the nearest open bug is commented on, or
99
+ * `false` to skip the similarity step. `triage.similarity.threshold`.
100
+ */
101
+ triageSimilarityThreshold: SimilarityThreshold;
102
+ /**
103
+ * How many nearest open bugs a new bug's `Possible duplicates`
104
+ * section lists. `triage.similarity.candidates`.
105
+ */
106
+ triageSimilarityCandidates: number;
107
+ /**
108
+ * The bonus an open bug with the same cause code earns in the
109
+ * `Possible duplicates` rank. `triage.similarity.weights.causeLeaf`.
110
+ */
111
+ triageSimilarityWeightsCauseLeaf: number;
112
+ /**
113
+ * The bonus an open bug with the same cause family and another leaf
114
+ * earns in that rank. `triage.similarity.weights.causeFamily`.
115
+ */
116
+ triageSimilarityWeightsCauseFamily: number;
117
+ /**
118
+ * The bonus an open bug with the same module and action earns in that
119
+ * rank. `triage.similarity.weights.boundary`.
120
+ */
121
+ triageSimilarityWeightsBoundary: number;
122
+ }
123
+ /**
124
+ * Accepts `false` or a number above 0 and at most 1, each as itself; the
125
+ * module note says why `0`, `true` and a quoted number are refused.
126
+ */
127
+ export declare const similarityThreshold: Reader<SimilarityThreshold>;
128
+ /** Accepts a whole number from 1 to 10 as itself. */
129
+ export declare const similarityCandidates: Reader<number>;
130
+ /**
131
+ * Accepts a number from 0 to 1 inclusive as itself; the module note says
132
+ * why `0` is accepted and `true`, `false` and a quoted number are refused.
133
+ */
134
+ export declare const similarityWeight: Reader<number>;
135
+ /** What every `triage` setting resolves to when no layer names it. */
136
+ export declare const TRIAGE_DEFAULTS: Readonly<TriageSettings>;
137
+ /** The `triage` section's setting specs, in the order problems are reported. */
138
+ export declare const TRIAGE_SETTINGS: {
139
+ readonly [K in keyof TriageSettings]: SettingSpec<K>;
140
+ };
141
+ /** The `triage` section: the five `triage` keys, with their defaults and no check. */
142
+ export declare const TRIAGE_SECTION: ConfigSection;