@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,95 @@
1
+ /**
2
+ * The `issues` section of the config schema: the five keys a bug record
3
+ * is filed and listed with (#951), each one's field, its default, its
4
+ * spec and its reader. {@link ISSUES_SECTION} hands them to core as one
5
+ * `ConfigSection`, package `issues`, and the `declare module` below adds
6
+ * {@link IssuesConfigSettings} to `RafaConfig`.
7
+ * {@link IssuesShape} holds the keys a file writes, which
8
+ * `src/config/shape.ts` composes into `ConfigShape`, the nested file shape.
9
+ * `config-registry.ts`'s `CONFIG_DEFAULTS` and `SETTINGS`
10
+ * spread the objects below right after the `logger` section. It has its
11
+ * own module for the reason `config-schema-errors.ts` gives.
12
+ *
13
+ * ## The keys
14
+ *
15
+ * - `issues.titles.bug` is the template a bug's title is rendered
16
+ * with and read back by (`bugs/title.ts`). It is refused at load
17
+ * when it cannot be parsed, when its summary is not the last
18
+ * variable outside every group, and when a title it renders does not
19
+ * read back as the fields it was rendered from, so `rafa issue list
20
+ * --type=bug` can always split a title this project filed.
21
+ * - `issues.titles.summaryMax` is the most characters a bug's summary
22
+ * holds, from {@link SUMMARY_MAX_FLOOR} to
23
+ * {@link SUMMARY_MAX_CEILING}, the cap triage cuts a whole title to.
24
+ * - `issues.environments` adds places to `local`, `ci` and `prod`,
25
+ * such as `staging`. A place names where a bug was seen, never what
26
+ * was running.
27
+ * - `issues.vocabulary.modules` and `issues.vocabulary.actions` are the
28
+ * names a bug may carry. Empty, the default, accepts any name of the
29
+ * shape; set, a name outside the list is refused with the closest
30
+ * ones shown, so one module is never filed under three spellings.
31
+ *
32
+ * `titles` holds one template: a bug is the only type whose title rafa
33
+ * renders. Another type's key arrives with the code that renders it.
34
+ *
35
+ * ## When they take effect
36
+ *
37
+ * At each `rafa issue create --type=bug`, which checks the record
38
+ * against {@link bugRulesOf}, and each `rafa issue list --type=bug`,
39
+ * which reads the titles back with the template.
40
+ *
41
+ * None of the keys is a `CommandLineSetting`: a line's own flags name
42
+ * the fields of one bug, and the rules they are held to are the
43
+ * project's.
44
+ */
45
+ import type { BugRules } from '@open-tomato/rafa/bugs/record';
46
+ import type { ErrorsSettings } from '@open-tomato/rafa/config-schema-errors';
47
+ import type { ConfigSection, SettingSpec } from '@open-tomato/rafa/core/config';
48
+ declare module '@open-tomato/rafa/core/config/config-schema' {
49
+ /** The `issues` section's fields, added to core's. */
50
+ interface RafaConfig extends IssuesConfigSettings {
51
+ }
52
+ }
53
+ /** The `issues` keys a file writes; `src/config/shape.ts` composes them into `ConfigShape`. */
54
+ export interface IssuesShape {
55
+ readonly issues: {
56
+ readonly titles: {
57
+ readonly bug: string;
58
+ readonly summaryMax: number;
59
+ };
60
+ readonly environments: readonly string[];
61
+ readonly vocabulary: {
62
+ readonly modules: readonly string[];
63
+ readonly actions: readonly string[];
64
+ };
65
+ };
66
+ }
67
+ /** The `issues` settings. */
68
+ export interface IssuesConfigSettings {
69
+ /** The template a bug's title is rendered with. `issues.titles.bug`. */
70
+ issuesTitleBug: string;
71
+ /** The most characters a bug's summary holds. `issues.titles.summaryMax`. */
72
+ issuesSummaryMax: number;
73
+ /** Places beside local, ci and prod. `issues.environments`. */
74
+ issuesEnvironments: readonly string[];
75
+ /** The module names a bug may carry; empty for any. `issues.vocabulary.modules`. */
76
+ issuesVocabularyModules: readonly string[];
77
+ /** The actions a bug may carry; empty for any. `issues.vocabulary.actions`. */
78
+ issuesVocabularyActions: readonly string[];
79
+ }
80
+ /** The summary cap when the config names none. */
81
+ export declare const SUMMARY_MAX_DEFAULT = 80;
82
+ /** The fewest characters `issues.titles.summaryMax` accepts. */
83
+ export declare const SUMMARY_MAX_FLOOR = 20;
84
+ /** The most characters `issues.titles.summaryMax` accepts: triage's cap on a whole title. */
85
+ export declare const SUMMARY_MAX_CEILING = 120;
86
+ /** The defaults: the default template, its cap, no added place and no vocabulary. */
87
+ export declare const ISSUES_DEFAULTS: Readonly<IssuesConfigSettings>;
88
+ /** Every `issues` setting. */
89
+ export declare const ISSUES_SETTINGS: {
90
+ readonly [K in keyof IssuesConfigSettings]: SettingSpec<K>;
91
+ };
92
+ /** The `issues` section: the five `issues` keys, with their defaults and no check. */
93
+ export declare const ISSUES_SECTION: ConfigSection;
94
+ /** The rules a bug record is checked against, from a resolved config; see the module note. */
95
+ export declare function bugRulesOf(config: IssuesConfigSettings & ErrorsSettings): BugRules;
@@ -0,0 +1,91 @@
1
+ /**
2
+ * The `logger` section of the config schema: the six keys the logger
3
+ * reads (#950), each one's field, its default, its spec and its reader.
4
+ * {@link LOGGER_SECTION} hands them to core as one `ConfigSection`,
5
+ * package `logger`, and the `declare module` below adds
6
+ * {@link LoggerConfigSettings} to `RafaConfig`.
7
+ * {@link LoggerShape} holds the keys a file writes, which
8
+ * `src/config/shape.ts` composes into `ConfigShape`, the nested file shape.
9
+ * `config-registry.ts`'s `CONFIG_DEFAULTS` and `SETTINGS`
10
+ * spread the objects below right after the `errors` section. It has its
11
+ * own module for the reason `config-schema-errors.ts` gives.
12
+ *
13
+ * ## The keys
14
+ *
15
+ * - `logger.level` is the loudest ORDERED level written: `error`,
16
+ * `warn` (the default) or `debug`. `api` is refused here: it sits
17
+ * outside the order and has its own key.
18
+ * - `logger.modules` gives one module a level of its own, over
19
+ * `logger.level`: `modules: { board: { level: debug } }`. It is one
20
+ * of the map settings `config.ts` merges across layers (its spec
21
+ * sets `map`), so the user's and the project's maps are joined by
22
+ * module name, the project's entry winning for a module both name. A module's mapping
23
+ * holds `level` today, and any other key is kept and warned about.
24
+ * - `logger.api` turns on `api` entries, the metadata of each request
25
+ * to a service. Off by default.
26
+ * - `logger.theme` is `default` or `plain`, which writes no colour.
27
+ * - `logger.callSite` names the calling file on `debug` lines.
28
+ * - `logger.kind` names the logger adapter, `console` by default. A
29
+ * kind nothing registered is not refused at load, since the registry
30
+ * an add-on fills is not at hand here: the active logger warns once
31
+ * and stays on `console` (`adapters/logger/active.ts`).
32
+ *
33
+ * ## When they take effect
34
+ *
35
+ * `loadConfig` (`config-load.ts`) calls core's load hook as soon as a
36
+ * config is read, and `src/config-registry.ts` sets that hook to hand
37
+ * {@link loggerSettingsOf} to the logger. A command's logger exists
38
+ * before that, so until a command loads its config the defaults apply.
39
+ *
40
+ * None of the keys is a `CommandLineSetting`: the verbosity flags are the
41
+ * command line's say over what is written.
42
+ */
43
+ import type { LoggerSettings, LoggerTheme } from './adapters/logger/settings.js';
44
+ import type { ConfigSection, SettingSpec } from './core/config/index.js';
45
+ import type { LogLevel } from './ports/log-level.js';
46
+ declare module './core/config/config-schema.js' {
47
+ /** The `logger` section's fields, added to core's. */
48
+ interface RafaConfig extends LoggerConfigSettings {
49
+ }
50
+ }
51
+ /**
52
+ * The `logger` keys a file writes, each `logger.modules` entry a mapping
53
+ * holding `level`; `src/config/shape.ts` composes them into `ConfigShape`.
54
+ */
55
+ export interface LoggerShape {
56
+ readonly logger: {
57
+ readonly kind: string;
58
+ readonly level: LogLevel;
59
+ readonly theme: LoggerTheme;
60
+ readonly modules: Readonly<Record<string, {
61
+ readonly level: LogLevel;
62
+ }>>;
63
+ readonly callSite: boolean;
64
+ readonly api: boolean;
65
+ };
66
+ }
67
+ /** The `logger` settings. */
68
+ export interface LoggerConfigSettings {
69
+ /** The logger adapter's kind. `logger.kind`. */
70
+ loggerKind: string;
71
+ /** The loudest ordered level written. `logger.level`. */
72
+ loggerLevel: LogLevel;
73
+ /** How lines are coloured. `logger.theme`. */
74
+ loggerTheme: LoggerTheme;
75
+ /** A level per module, over `logger.level`. `logger.modules`. */
76
+ loggerModules: ReadonlyMap<string, LogLevel>;
77
+ /** Whether a `debug` line names the calling file. `logger.callSite`. */
78
+ loggerCallSite: boolean;
79
+ /** Whether `api` entries are written. `logger.api`. */
80
+ loggerApi: boolean;
81
+ }
82
+ /** The defaults: the console logger at `warn`, nothing else turned on. */
83
+ export declare const LOGGER_DEFAULTS: Readonly<LoggerConfigSettings>;
84
+ /** Every `logger` setting. */
85
+ export declare const LOGGER_SETTINGS: {
86
+ readonly [K in keyof LoggerConfigSettings]: SettingSpec<K>;
87
+ };
88
+ /** The `logger` section: the six `logger` keys, with their defaults and no check. */
89
+ export declare const LOGGER_SECTION: ConfigSection;
90
+ /** The settings a logger reads, from a resolved config's `logger` fields. */
91
+ export declare function loggerSettingsOf(config: LoggerConfigSettings): LoggerSettings;
@@ -0,0 +1,122 @@
1
+ /**
2
+ * The four keys `rafa loop start --continue` reads, with their fields,
3
+ * their defaults, their specs and their readers:
4
+ * `loop.retriesOnContinue`, `loop.continue.criteria`,
5
+ * `loop.continue.criteriaMode` and `loop.forceWrapUp.maxNewFailures`.
6
+ * {@link LOOP_CONTINUE_SECTION} hands them to core as one
7
+ * `ConfigSection`, package `loop-continue`, and the `declare module`
8
+ * below adds {@link LoopContinueSettings} to `RafaConfig`.
9
+ * {@link LoopContinueShape} holds its part of the shared `loop` namespace,
10
+ * which `src/config/shape.ts` composes into `LoopShape` of `ConfigShape`,
11
+ * the nested file shape.
12
+ * `config-registry.ts`'s `CONFIG_DEFAULTS` and `SETTINGS`
13
+ * spread the objects below right after `loop.retries` and ahead of
14
+ * `loop.wrapUp`, so the order settings are reported in holds the `loop`
15
+ * section together.
16
+ *
17
+ * The keys have their own module, as `config-schema-loop-retries.ts`
18
+ * has, because `config-schema.ts`'s own note asks a new section for a
19
+ * sibling, and the two count readers are rules about VALUES that only
20
+ * these keys read. `config-registry.ts` imports this file to spread it; a
21
+ * caller reads the settings off the resolved `RafaConfig`.
22
+ *
23
+ * ## The keys
24
+ *
25
+ * Under `--continue`, a stop that would end the run is handed to a
26
+ * decision instead (`start/decision-prompt.ts`, `start/decision-parse.ts`):
27
+ * retry the task with a new approach, stop, jump over it, or defer it
28
+ * until a later task is done.
29
+ *
30
+ * - `loop.retriesOnContinue` is the retry budget a `--continue` run
31
+ * opens when `--retry` is not typed: `false` or a whole number from
32
+ * 1 to 3, default `1`, counted in a row as `loop.retries` is
33
+ * (`start/retry-budget.ts`). A run without `--continue` never reads it.
34
+ * It follows `loop.retries`' rules: `false` and not `0` means no
35
+ * retry, and `0`, a negative number, a fraction, anything above 3,
36
+ * `true` and a quoted number are refused.
37
+ * - `loop.continue.criteria` is the project's own criteria file, read
38
+ * from the project root on every decision, default
39
+ * `.rafa/continue-criteria.md`. A missing file is not an error here:
40
+ * whether it may be missing is the mode's rule.
41
+ * - `loop.continue.criteriaMode` says how the project file meets the
42
+ * bundled base criteria: `extend` (the default) appends it under the
43
+ * base, `replace` uses it alone, and a `replace` whose file is
44
+ * missing is refused when the run starts.
45
+ * - `loop.forceWrapUp.maxNewFailures` is how many NEW suite failures
46
+ * `--force-wrap-up` tolerates before it refuses the wrap-up: `false`
47
+ * (the default, none tolerated) or a whole number from 1 to 50, with
48
+ * the same refusals as the retry count. Inherited baseline failures
49
+ * are not counted.
50
+ *
51
+ * None is a `CommandLineSetting`: the flags that outrank a key for one
52
+ * run (`--retry=<n>`) are read by `start/run-setup.ts`.
53
+ */
54
+ import type { ConfigSection, SettingSpec } from '@open-tomato/rafa/core/config';
55
+ import type { Reader } from '@open-tomato/rafa/core/config/sections';
56
+ declare module '@open-tomato/rafa/core/config/config-schema' {
57
+ /** The `loop-continue` section's fields, added to core's. */
58
+ interface RafaConfig extends LoopContinueSettings {
59
+ }
60
+ }
61
+ /**
62
+ * The `loop` keys `loop start --continue` reads, the section's part of
63
+ * the shared `loop` namespace; `src/config/shape.ts` composes it into
64
+ * `LoopShape`.
65
+ */
66
+ export interface LoopContinueShape {
67
+ readonly retriesOnContinue: ContinueCount;
68
+ readonly continue: {
69
+ readonly criteria: string;
70
+ readonly criteriaMode: ContinueCriteriaMode;
71
+ };
72
+ readonly forceWrapUp: {
73
+ readonly maxNewFailures: ContinueCount;
74
+ };
75
+ }
76
+ /** The fewest retries `loop.retriesOnContinue` accepts as a number. */
77
+ export declare const RETRIES_ON_CONTINUE_MIN = 1;
78
+ /** The most retries `loop.retriesOnContinue` accepts. */
79
+ export declare const RETRIES_ON_CONTINUE_MAX = 3;
80
+ /** The fewest new failures `loop.forceWrapUp.maxNewFailures` accepts as a number. */
81
+ export declare const FORCE_WRAP_UP_MAX_NEW_FAILURES_MIN = 1;
82
+ /** The most new failures `loop.forceWrapUp.maxNewFailures` accepts. */
83
+ export declare const FORCE_WRAP_UP_MAX_NEW_FAILURES_MAX = 50;
84
+ /** How the project criteria file meets the bundled base criteria. */
85
+ export declare const CONTINUE_CRITERIA_MODES: readonly ["extend", "replace"];
86
+ /** One of {@link CONTINUE_CRITERIA_MODES}. */
87
+ export type ContinueCriteriaMode = (typeof CONTINUE_CRITERIA_MODES)[number];
88
+ /** A whole-number count a key bounds, or `false` for none. */
89
+ export type ContinueCount = number | false;
90
+ /** The settings `loop start --continue` reads, resolved. */
91
+ export interface LoopContinueSettings {
92
+ /**
93
+ * The retries a `--continue` run opens when `--retry` is not typed,
94
+ * or `false` for none. `loop.retriesOnContinue`.
95
+ */
96
+ loopRetriesOnContinue: ContinueCount;
97
+ /** The project criteria file, from the project root. `loop.continue.criteria`. */
98
+ loopContinueCriteria: string;
99
+ /** How the project criteria meet the base. `loop.continue.criteriaMode`. */
100
+ loopContinueCriteriaMode: ContinueCriteriaMode;
101
+ /**
102
+ * The new suite failures `--force-wrap-up` tolerates, or `false` for
103
+ * none. `loop.forceWrapUp.maxNewFailures`.
104
+ */
105
+ loopForceWrapUpMaxNewFailures: ContinueCount;
106
+ }
107
+ /** Accepts `false` or a whole number from 1 to 3; the module note says why. */
108
+ export declare const retriesOnContinue: Reader<ContinueCount>;
109
+ /** Accepts `false` or a whole number from 1 to 50; the module note says why. */
110
+ export declare const forceWrapUpMaxNewFailures: Reader<ContinueCount>;
111
+ /** Accepts a non-blank path, kept as written. */
112
+ export declare const continueCriteria: Reader<string>;
113
+ /** Accepts `extend` or `replace`. */
114
+ export declare const continueCriteriaMode: Reader<ContinueCriteriaMode>;
115
+ /** What the four settings resolve to when no layer names them. */
116
+ export declare const LOOP_CONTINUE_DEFAULTS: Readonly<LoopContinueSettings>;
117
+ /** The four settings' specs. */
118
+ export declare const LOOP_CONTINUE_SETTINGS: {
119
+ readonly [K in keyof LoopContinueSettings]: SettingSpec<K>;
120
+ };
121
+ /** The `loop-continue` section: the four keys `loop start --continue` reads, with their defaults and no check. */
122
+ export declare const LOOP_CONTINUE_SECTION: ConfigSection;
@@ -0,0 +1,94 @@
1
+ /**
2
+ * `loop.retries`, the loop's own retry count: how many times in a row
3
+ * one run re-enters its task loop after a stop a blind re-run is known
4
+ * to pass, with its field, its default, its spec and its reader.
5
+ * {@link LOOP_RETRIES_SECTION} hands it to core as one `ConfigSection`,
6
+ * package `loop-retries`, and the `declare module` below adds
7
+ * {@link LoopRetriesSettings} to `RafaConfig`.
8
+ * {@link LoopRetriesShape} holds its part of the shared `loop` namespace,
9
+ * which `src/config/shape.ts` composes into `LoopShape` of `ConfigShape`,
10
+ * the nested file shape.
11
+ * `config-registry.ts`'s `CONFIG_DEFAULTS` and `SETTINGS`
12
+ * spread the objects below right after `loop.worktreeDir` and ahead of
13
+ * `loop.wrapUp`, so the order settings are reported in holds the `loop`
14
+ * section together.
15
+ *
16
+ * The key has its own module, as `config-schema-wrap-up.ts` has, because
17
+ * `config-schema.ts`'s own note asks a new section for a sibling, and
18
+ * the reader is a rule about a VALUE that only this key reads, so it
19
+ * sits here beside it. `config-registry.ts` imports this file to spread
20
+ * it; a caller reads the setting off the resolved `RafaConfig`, and
21
+ * `start/run-setup.ts` checks `--retry` against the same two bounds.
22
+ *
23
+ * ## The key
24
+ *
25
+ * A soft stop of `rafa loop start` (a red suite step, a session that
26
+ * exited nonzero, a session that left neither a report nor a commit)
27
+ * ends the run today, and the person runs `rafa loop start` again by
28
+ * hand, which resumes at the `[BLOCKED]` line or the inserted repair.
29
+ * `loop.retries` is how many of those re-runs the loop makes itself,
30
+ * in a row, at those stops alone (`start/retry-budget.ts`): a task done
31
+ * past the stop, neither the stopped task nor a repair, starts the count
32
+ * over.
33
+ *
34
+ *
35
+ * - It defaults to `false`: no retry, so a run stops where it always
36
+ * did until a person asks for more.
37
+ * - It accepts a whole number from 1 to 3. Each retry spends at least
38
+ * one more session, so the cap of 3 bounds what a run whose stop
39
+ * keeps coming back can spend before it halts: a task that keeps
40
+ * failing never starts its own count over.
41
+ * - `false` means no retry. It is spelled `false` and not `0`, so a
42
+ * number always names retries that run; `0` is refused, as are a
43
+ * negative number, a fraction and anything above 3. `true` is
44
+ * refused too: it names no count, and reading it as some count
45
+ * would be a choice nobody wrote.
46
+ *
47
+ * A quoted `"2"` is refused, as every other reader refuses a string
48
+ * spelled like its type. The key is not a `CommandLineSetting`: the
49
+ * flag that outranks it for one run is `loop start --retry=<n>`, read
50
+ * by `start/run-setup.ts`.
51
+ */
52
+ import type { ConfigSection, SettingSpec } from '@open-tomato/rafa/core/config';
53
+ import type { Reader } from '@open-tomato/rafa/core/config/sections';
54
+ declare module '@open-tomato/rafa/core/config/config-schema' {
55
+ /** The `loop-retries` section's fields, added to core's. */
56
+ interface RafaConfig extends LoopRetriesSettings {
57
+ }
58
+ }
59
+ /**
60
+ * `loop.retries`, the section's part of the shared `loop` namespace;
61
+ * `src/config/shape.ts` composes it into `LoopShape`.
62
+ */
63
+ export interface LoopRetriesShape {
64
+ readonly retries: LoopRetries;
65
+ }
66
+ /** The fewest retries `loop.retries` accepts as a number. */
67
+ export declare const LOOP_RETRIES_MIN = 1;
68
+ /** The most retries `loop.retries` accepts. */
69
+ export declare const LOOP_RETRIES_MAX = 3;
70
+ /** How many times in a row one run re-enters its loop after a retry-safe stop, or `false` for none. */
71
+ export type LoopRetries = number | false;
72
+ /** The `loop.retries` setting, resolved. */
73
+ export interface LoopRetriesSettings {
74
+ /**
75
+ * The retries in a row one run makes after a retry-safe stop, or
76
+ * `false` for none. `loop.retries`.
77
+ */
78
+ loopRetries: LoopRetries;
79
+ }
80
+ /** True for a whole number from {@link LOOP_RETRIES_MIN} to {@link LOOP_RETRIES_MAX}. */
81
+ export declare function isLoopRetryCount(raw: unknown): raw is number;
82
+ /**
83
+ * Accepts `false` or a whole number from 1 to 3, each as itself; the
84
+ * module note says why `0`, `true` and a quoted number are refused.
85
+ */
86
+ export declare const loopRetries: Reader<LoopRetries>;
87
+ /** What `loop.retries` resolves to when no layer names it. */
88
+ export declare const LOOP_RETRIES_DEFAULTS: Readonly<LoopRetriesSettings>;
89
+ /** The `loop.retries` setting spec. */
90
+ export declare const LOOP_RETRIES_SETTINGS: {
91
+ readonly [K in keyof LoopRetriesSettings]: SettingSpec<K>;
92
+ };
93
+ /** The `loop-retries` section: `loop.retries`, with their defaults and no check. */
94
+ export declare const LOOP_RETRIES_SECTION: ConfigSection;