@open-tomato/rafa 0.46.0 → 0.48.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 (94) hide show
  1. package/README.md +70 -37
  2. package/dist/adapters/logger/settings.d.ts +2 -2
  3. package/dist/bugs/places.d.ts +1 -1
  4. package/dist/bugs/record.d.ts +1 -1
  5. package/dist/bundled/skills/dev-planner/SKILL.md +2 -2
  6. package/dist/cli.js +73457 -72996
  7. package/dist/config/index.d.ts +5 -0
  8. package/dist/config/index.js +6 -4
  9. package/dist/config/shape.d.ts +20 -15
  10. package/dist/config/templates.d.ts +64 -0
  11. package/dist/config-registry.d.ts +21 -12
  12. package/dist/config-schema-board-project.d.ts +3 -3
  13. package/dist/config-schema-bugs.d.ts +3 -3
  14. package/dist/config-schema-checks.d.ts +114 -0
  15. package/dist/config-schema-errors.d.ts +3 -3
  16. package/dist/config-schema-features.d.ts +4 -4
  17. package/dist/config-schema-hub.d.ts +6 -4
  18. package/dist/config-schema-issues.d.ts +2 -2
  19. package/dist/config-schema-logger.d.ts +3 -3
  20. package/dist/config-schema-loop-continue.d.ts +3 -3
  21. package/dist/config-schema-loop-retries.d.ts +4 -4
  22. package/dist/config-schema-release.d.ts +23 -24
  23. package/dist/config-schema-tests.d.ts +35 -27
  24. package/dist/config-schema-triage.d.ts +3 -3
  25. package/dist/config-schema-wrap-up.d.ts +4 -4
  26. package/dist/core/command/command.d.ts +1 -1
  27. package/dist/core/command/confirm.d.ts +11 -5
  28. package/dist/core/command/global-flags.d.ts +25 -0
  29. package/dist/core/command/index.d.ts +47 -23
  30. package/dist/core/command/registry-types.d.ts +4 -4
  31. package/dist/core/command/shared-flags.d.ts +40 -0
  32. package/dist/core/command/types.d.ts +3 -2
  33. package/dist/core/config/branch-template.d.ts +2 -0
  34. package/dist/core/config/config-items.d.ts +1 -1
  35. package/dist/core/config/config-load-module.d.ts +43 -0
  36. package/dist/core/config/config-load.d.ts +43 -12
  37. package/dist/core/config/config-origins.d.ts +31 -30
  38. package/dist/core/config/config-schema.d.ts +11 -0
  39. package/dist/core/config/config-sections.d.ts +15 -14
  40. package/dist/core/config/config.d.ts +90 -25
  41. package/dist/core/config/core-section.d.ts +1 -1
  42. package/dist/core/config/default-routing.d.ts +1 -1
  43. package/dist/core/config/index.d.ts +14 -10
  44. package/dist/core/config/merge-method.d.ts +40 -0
  45. package/dist/core/config/scope.d.ts +2 -2
  46. package/dist/core/config/section.d.ts +81 -1
  47. package/dist/core/config/sections.d.ts +17 -6
  48. package/dist/core/git/gh-runner.d.ts +1 -1
  49. package/dist/core/git/git.d.ts +34 -0
  50. package/dist/core/git/index.d.ts +13 -8
  51. package/dist/core/loop/claude.d.ts +11 -5
  52. package/dist/core/loop/hop-record.d.ts +6 -6
  53. package/dist/core/loop/index.d.ts +9 -8
  54. package/dist/core/loop/session-record-parse.d.ts +9 -2
  55. package/dist/core/loop/sessions.d.ts +23 -11
  56. package/dist/core/loop/suite-failure.d.ts +8 -6
  57. package/dist/core/output/active.d.ts +1 -1
  58. package/dist/core/plan/block-reader.d.ts +1 -1
  59. package/dist/core/runtime/identity.d.ts +13 -0
  60. package/dist/core/runtime/index.d.ts +12 -6
  61. package/dist/effort/store/check-rows.d.ts +1 -1
  62. package/dist/effort/store/commit-stats.d.ts +1 -1
  63. package/dist/effort/store/index.js +7 -8
  64. package/dist/effort/store/merge-commit-gaps.d.ts +1 -1
  65. package/dist/effort/store/plan-stubs.d.ts +1 -1
  66. package/dist/effort/store/session-row-types.d.ts +2 -2
  67. package/dist/errors/rafa-codes.d.ts +1 -1
  68. package/dist/index-2xzkzwm6.js +670 -0
  69. package/dist/index-ajv88fkm.js +448 -0
  70. package/dist/{index-ykggr043.js → index-fpgmdmww.js} +13 -5
  71. package/dist/index-g91ys6kw.js +249 -0
  72. package/dist/{index-cy98y87p.js → index-jx3x70xh.js} +1111 -638
  73. package/dist/{index-gvek4r8m.js → index-m672ptpg.js} +84 -26
  74. package/dist/{index-39kbcw68.js → index-w5qbpdtp.js} +415 -842
  75. package/dist/{index-gqz4jn6j.js → index-z4r20zwr.js} +8974 -11438
  76. package/dist/{index-j4k2vdz3.js → index-zsak0jy6.js} +124 -290
  77. package/dist/index.js +24940 -18766
  78. package/dist/learning/index.js +221 -12
  79. package/dist/plan/index.js +10 -9
  80. package/dist/ports/index.d.ts +7 -7
  81. package/dist/ports/learning.d.ts +5 -4
  82. package/dist/ports/spec-review.d.ts +1 -1
  83. package/dist/ready-gax3hhtt.js +241 -0
  84. package/dist/release-templates/release-bot-fragment.yml +6 -6
  85. package/dist/release-templates/release-publish.yml +8 -8
  86. package/dist/release-templates/release-settle.yml +8 -7
  87. package/dist/release-templates/release-tag.yml +8 -7
  88. package/package.json +53 -2
  89. package/dist/index-77ajfffn.js +0 -223
  90. package/dist/index-jh1r4kcn.js +0 -1067
  91. package/dist/index-z1w83f81.js +0 -4
  92. package/dist/pr/checks.d.ts +0 -133
  93. package/dist/pr/types.d.ts +0 -422
  94. package/dist/ready-4f8edezt.js +0 -2016
@@ -7,6 +7,10 @@
7
7
  * `ConfigShape` (`entry.ts`, `shape.ts`).
8
8
  * - `defineConfig`, the identity, typed for its parameter.
9
9
  * - {@link defaults}, the one entry holding every setting's default.
10
+ * - `templates`, the config templates by name (`templates.ts`), each a
11
+ * frozen `ConfigEntry`, for a project that installs rafa to spread by
12
+ * value into its own entries, as `templates.escalation`. A YAML file
13
+ * names one with its `templates` key instead.
10
14
  *
11
15
  * ## The defaults entry
12
16
  *
@@ -32,5 +36,6 @@ import type { ConfigEntry } from './entry.js';
32
36
  export type { Config, ConfigEntry } from './entry.js';
33
37
  export type { ConfigShape } from './shape.js';
34
38
  export { defineConfig } from './entry.js';
39
+ export { CONFIG_TEMPLATES as templates } from './templates.js';
35
40
  /** Every setting's default, as one entry; see the module note. */
36
41
  export declare const defaults: ConfigEntry;
@@ -1,12 +1,13 @@
1
1
  // @bun
2
2
  import {
3
3
  CONFIG_DEFAULTS,
4
+ CONFIG_TEMPLATES,
4
5
  SETTINGS,
5
6
  SETTING_NAMES
6
- } from "../index-j4k2vdz3.js";
7
- import"../index-gvek4r8m.js";
8
- import"../index-ykggr043.js";
9
- import"../index-z1w83f81.js";
7
+ } from "../index-zsak0jy6.js";
8
+ import"../index-g91ys6kw.js";
9
+ import"../index-m672ptpg.js";
10
+ import"../index-fpgmdmww.js";
10
11
 
11
12
  // src/config/entry.ts
12
13
  function defineConfig(entries) {
@@ -46,6 +47,7 @@ function fileValueOf(setting, value) {
46
47
  }
47
48
  var defaults = entryOf(SETTING_NAMES.filter((setting) => CONFIG_DEFAULTS[setting] !== null).map((setting) => [SETTINGS[setting].key, fileValueOf(setting, CONFIG_DEFAULTS[setting])]));
48
49
  export {
50
+ CONFIG_TEMPLATES as templates,
49
51
  defineConfig,
50
52
  defaults
51
53
  };
@@ -45,19 +45,20 @@
45
45
  *
46
46
  * Every type is `import type`, so this module loads nothing.
47
47
  */
48
- import type { BoardProjectLimitsShape } from '../config-schema-board-project.js';
49
- import type { BugsShape } from '../config-schema-bugs.js';
50
- import type { ErrorsShape } from '../config-schema-errors.js';
51
- import type { FeaturesShape } from '../config-schema-features.js';
52
- import type { HubShape } from '../config-schema-hub.js';
53
- import type { IssuesShape } from '../config-schema-issues.js';
54
- import type { LoggerShape } from '../config-schema-logger.js';
55
- import type { LoopContinueShape } from '../config-schema-loop-continue.js';
56
- import type { LoopRetriesShape } from '../config-schema-loop-retries.js';
57
- import type { ReleaseDangerousShape, ReleaseShape } from '../config-schema-release.js';
58
- import type { TestsShape } from '../config-schema-tests.js';
59
- import type { TriageShape } from '../config-schema-triage.js';
60
- import type { WrapUpShape } from '../config-schema-wrap-up.js';
48
+ import type { BoardProjectLimitsShape } from '@open-tomato/rafa/config-schema-board-project';
49
+ import type { BugsShape } from '@open-tomato/rafa/config-schema-bugs';
50
+ import type { ChecksShape } from '@open-tomato/rafa/config-schema-checks';
51
+ import type { ErrorsShape } from '@open-tomato/rafa/config-schema-errors';
52
+ import type { FeaturesShape } from '@open-tomato/rafa/config-schema-features';
53
+ import type { HubShape } from '@open-tomato/rafa/config-schema-hub';
54
+ import type { IssuesShape } from '@open-tomato/rafa/config-schema-issues';
55
+ import type { LoggerShape } from '@open-tomato/rafa/config-schema-logger';
56
+ import type { LoopContinueShape } from '@open-tomato/rafa/config-schema-loop-continue';
57
+ import type { LoopRetriesShape } from '@open-tomato/rafa/config-schema-loop-retries';
58
+ import type { ReleaseDangerousShape, ReleaseShape } from '@open-tomato/rafa/config-schema-release';
59
+ import type { TestsShape } from '@open-tomato/rafa/config-schema-tests';
60
+ import type { TriageShape } from '@open-tomato/rafa/config-schema-triage';
61
+ import type { WrapUpShape } from '@open-tomato/rafa/config-schema-wrap-up';
61
62
  import type { ModuleSourceKind, PrerequisiteKind } from '@open-tomato/rafa/core/config';
62
63
  import type { BoardRelationshipMode, ClaimsAhead, ClaimsStaleAfter, ConfigVersion, DuplicatesLevel, InjectMode, LessonSwitch, OutputMode, RouteTarget, SkillResolverName, StoreBackend, SyncStrategy, TierPin, TierSwitch } from '@open-tomato/rafa/core/config/sections';
63
64
  /**
@@ -90,7 +91,7 @@ export type ModuleFileItem = KindKeyed<Exclude<ModuleSourceKind, 'github'>> | {
90
91
  readonly ref?: string | null;
91
92
  };
92
93
  /**
93
- * The `loop` namespace: core's two keys, and the keys the
94
+ * The `loop` namespace: core's three keys, and the keys the
94
95
  * `loop-retries`, `loop-continue` and `wrap-up` sections write.
95
96
  */
96
97
  export interface LoopShape extends LoopRetriesShape, LoopContinueShape, WrapUpShape {
@@ -98,6 +99,8 @@ export interface LoopShape extends LoopRetriesShape, LoopContinueShape, WrapUpSh
98
99
  readonly settingSources: string;
99
100
  /** `loop.worktreeDir`: where the loop's worktrees are made. */
100
101
  readonly worktreeDir: string;
102
+ /** `loop.worktreeSetup`: the shell command run in a new or reused `--as-worktree` worktree, or null for none. */
103
+ readonly worktreeSetup: string | null;
101
104
  }
102
105
  /** The `board.project` namespace: core's two keys and the `board-project` section's limits. */
103
106
  export interface BoardProjectShape extends BoardProjectLimitsShape {
@@ -126,7 +129,7 @@ export interface DangerousShape extends ReleaseDangerousShape {
126
129
  readonly selfUpdateDuringLoop: boolean;
127
130
  }
128
131
  /** The nested file shape: core's keys, and each section's; see the module note. */
129
- export interface ConfigShape extends BugsShape, ErrorsShape, FeaturesShape, HubShape, IssuesShape, LoggerShape, ReleaseShape, TestsShape, TriageShape {
132
+ export interface ConfigShape extends BugsShape, ChecksShape, ErrorsShape, FeaturesShape, HubShape, IssuesShape, LoggerShape, ReleaseShape, TestsShape, TriageShape {
130
133
  /** `version`: the config format's version. */
131
134
  readonly version: ConfigVersion;
132
135
  /** `store`: the effort store's backend. */
@@ -228,5 +231,7 @@ export interface ConfigShape extends BugsShape, ErrorsShape, FeaturesShape, HubS
228
231
  /** `naming.branch`: the template the branch `loop start` creates is named from, holding `{stub}` once. */
229
232
  readonly branch: string;
230
233
  };
234
+ /** `templates`: the config templates this file adopts, by name. */
235
+ readonly templates: readonly string[];
231
236
  }
232
237
  export {};
@@ -0,0 +1,64 @@
1
+ /**
2
+ * The config templates: {@link CONFIG_TEMPLATES}, each a named
3
+ * `ConfigEntry` a file adopts with its `templates` key, {@link TEMPLATE_NAMES}
4
+ * and {@link templateEntry}, the lookup by name.
5
+ *
6
+ * ## The one template
7
+ *
8
+ * `escalation` holds the values a project that runs its tests in rings
9
+ * writes: the five files whose change runs the full suite
10
+ * (`tests.fullSuiteTriggers`), the four spellings of an integration test
11
+ * (`tests.integration`), the one of a contract test (`tests.contract`),
12
+ * and three check points, `checks.task: [affected]`,
13
+ * `checks.stage: [related, integration]` and `checks.loop: [full]`. The
14
+ * other four check points it leaves unnamed, so they keep their empty
15
+ * default.
16
+ *
17
+ * Values are spelled as a file writes them, so `templates.test.ts` reads
18
+ * each back through its setting's reader to the value written here.
19
+ *
20
+ * ## How core reaches it
21
+ *
22
+ * Core imports nothing from this module: `registerCoreConfigSections`
23
+ * in `src/config-registry.ts` sets {@link templateEntry} as core's template
24
+ * hook (`setConfigTemplateHook` in `packages/rafa/src/core/config/section.ts`),
25
+ * and the loader calls the active hook by name. A project that installs
26
+ * rafa can also take the map by value as `templates` from
27
+ * `@open-tomato/rafa/config` and spread an entry into its own
28
+ * `rafa.config.ts`.
29
+ *
30
+ * {@link templateEntry} carries {@link TEMPLATE_NAMES} as its `names`, so
31
+ * the loader can list them when a file names a template none holds.
32
+ *
33
+ * Every mapping and list is frozen, and a name is looked up with
34
+ * `Object.hasOwn`, so `constructor` or `__proto__` answers null rather
35
+ * than something off `Object.prototype`.
36
+ */
37
+ import type { ConfigEntry } from './entry.js';
38
+ /** The name of a config template: one of {@link TEMPLATE_NAMES}. */
39
+ export type TemplateName = 'escalation';
40
+ /** Every config template, by name, each a frozen `ConfigEntry`. */
41
+ export declare const CONFIG_TEMPLATES: Readonly<Record<TemplateName, ConfigEntry>>;
42
+ /** The name of every template in {@link CONFIG_TEMPLATES}, in the order it lists them. */
43
+ export declare const TEMPLATE_NAMES: readonly TemplateName[];
44
+ /** The lookup {@link templateEntry} is: a template's entry by name, and every name it knows. */
45
+ export interface TemplateLookup {
46
+ /**
47
+ * The entry a template's name stands for, or null for a name
48
+ * {@link CONFIG_TEMPLATES} does not hold.
49
+ *
50
+ * @param name - The name a file's `templates` key gives.
51
+ * @returns The template's frozen entry, or null.
52
+ */
53
+ (name: string): ConfigEntry | null;
54
+ /** {@link TEMPLATE_NAMES}, which the loader lists when it refuses a name. */
55
+ readonly names: readonly TemplateName[];
56
+ }
57
+ /**
58
+ * The entry a template's name stands for, or null for a name
59
+ * {@link CONFIG_TEMPLATES} does not hold, carrying {@link TEMPLATE_NAMES}
60
+ * as its `names`. Set as core's template hook by
61
+ * `registerCoreConfigSections`, so a file naming a template no entry
62
+ * holds is refused with the names this lookup knows.
63
+ */
64
+ export declare const templateEntry: TemplateLookup;
@@ -1,14 +1,14 @@
1
1
  /**
2
- * The registry: the fourteen sections of the config schema, handed to
2
+ * The registry: the fifteen sections of the config schema, handed to
3
3
  * core when {@link registerCoreConfigSections} is called, and the merged schema read off
4
4
  * them, {@link SETTINGS}, {@link CONFIG_DEFAULTS}, {@link SETTING_NAMES},
5
5
  * {@link SETTING_BY_KEY}, {@link SECTIONS} and {@link knownKeysAbove}.
6
6
  *
7
7
  * Core declares the section contract (`packages/rafa/src/core/config/section.ts`) and
8
8
  * names no section. This module, outside `packages/rafa/src/core/`, is the one place
9
- * the fourteen are listed, {@link CONFIG_SECTIONS}: core's own
10
- * (`CORE_SECTION`) and the thirteen files `src/config-schema-*.ts` that
11
- * each export one.
9
+ * the fifteen are listed, {@link CONFIG_SECTIONS}: core's own
10
+ * (`CORE_SECTION`) and the fourteen files `config-schema-*.ts` that
11
+ * each export one, under `src/` (ten) or, for four, under `packages/rafa/src/`.
12
12
  *
13
13
  * Importing it registers nothing. {@link registerCoreConfigSections}
14
14
  * calls `registerConfigSections` once, with that list cut into the runs
@@ -30,7 +30,11 @@
30
30
  * The call also sets core's load hook (`setConfigLoadHook` in
31
31
  * `packages/rafa/src/core/config/section.ts`) to {@link handConfigToLogger}, so every
32
32
  * config `loadConfig` resolves hands the logger its `logger` settings
33
- * without core importing the logger's section file.
33
+ * without core importing the logger's section file. It sets core's
34
+ * template hook too (`setConfigTemplateHook`, same file) to
35
+ * `templateEntry` from `src/config/templates.ts`, so the loader reads a
36
+ * template a file names by calling the active hook, and core imports no
37
+ * template file.
34
38
  *
35
39
  * ## The order
36
40
  *
@@ -48,7 +52,7 @@
48
52
  * in (`inSettingOrder`), each cut under its section's package and a
49
53
  * section's checks on its first cut, and core's registry holds every
50
54
  * setting in this order. Registering the list whole would put core's
51
- * forty-two first, and the warning recorded in
55
+ * forty-five first, and the warning recorded in
52
56
  * `src/tests/fixtures/config-parity/` would list `hub` after `task`.
53
57
  * `config-registry.test.ts` holds that the registry holds the same
54
58
  * settings, in the same order, as the same specs, and the same defaults,
@@ -68,7 +72,11 @@
68
72
  *
69
73
  * This module is the one place the six names are built: the core barrel
70
74
  * `packages/rafa/src/core/config/index.ts` exports none of them, and a file outside
71
- * `packages/rafa/src/core/` imports them from here. Core reads the registered
75
+ * `packages/rafa/src/core/` imports them from here. A feature file reads
76
+ * the whole {@link SETTINGS} or {@link CONFIG_DEFAULTS} record off the
77
+ * registration instead, through core's `registeredSettings()` and
78
+ * `registeredDefaults()`, so it imports nothing of the root.
79
+ * Core reads the registered
72
80
  * settings and defaults through `activeSettings()` and
73
81
  * `activeDefaults()`, and the key indexes through `activeSettingByKey()`,
74
82
  * `activeSectionPaths()` and `activeKnownKeysAbove()`, all in
@@ -78,7 +86,7 @@
78
86
  * `src/index.ts` publishes this module's {@link CONFIG_DEFAULTS}.
79
87
  */
80
88
  import type { ConfigSection, ConfigSetting, RafaConfig, SettingSpec } from '@open-tomato/rafa/core/config';
81
- /** The fourteen sections, core's first, in the order they are registered. */
89
+ /** The fifteen sections, core's first, in the order they are registered. */
82
90
  export declare const CONFIG_SECTIONS: readonly ConfigSection[];
83
91
  /**
84
92
  * The hook `loadConfig` calls with every config it resolves: it hands
@@ -102,15 +110,16 @@ export declare const SETTINGS: {
102
110
  export declare const SETTING_NAMES: readonly ConfigSetting[];
103
111
  /**
104
112
  * Registers {@link CONFIG_SECTIONS} with core, cut into the runs
105
- * {@link SETTINGS} holds them in, and sets core's load hook to
106
- * {@link handConfigToLogger}.
113
+ * {@link SETTINGS} holds them in, sets core's load hook to
114
+ * {@link handConfigToLogger}, and sets core's template hook to
115
+ * `templateEntry` (`src/config/templates.ts`).
107
116
  *
108
117
  * When core's registry holds every setting already, each as the same
109
- * spec, it registers nothing and leaves the load hook as it is, so the
118
+ * spec, it registers nothing and leaves both hooks as they are, so the
110
119
  * preload and an entry may both call it in one process. Throws what
111
120
  * `registerConfigSections` throws on a section core refuses, such as a
112
121
  * setting another package registered first, leaving the registry and
113
- * the load hook as they were.
122
+ * both hooks as they were.
114
123
  */
115
124
  export declare function registerCoreConfigSections(): void;
116
125
  /** Setting names by the dotted key the file spells them with. */
@@ -69,9 +69,9 @@
69
69
  * gives in `config-schema-readings.ts`: every command that refreshes the
70
70
  * project must write it the same way, which one run's flag would split.
71
71
  */
72
- import type { ConfigSection, SettingSpec } from '@open-tomato/rafa/core/config';
73
- import type { Reader } from '@open-tomato/rafa/core/config/sections';
74
- declare module '@open-tomato/rafa/core/config/config-schema' {
72
+ import type { ConfigSection, SettingSpec } from './core/config/index.js';
73
+ import type { Reader } from './core/config/sections.js';
74
+ declare module './core/config/config-schema.js' {
75
75
  /** The `board-project` section's fields, added to core's. */
76
76
  interface RafaConfig extends BoardProjectLimitSettings {
77
77
  }
@@ -26,9 +26,9 @@
26
26
  * further run, or with no deadline, is a recheck nobody asked for.
27
27
  * Neither key is a `CommandLineSetting`.
28
28
  */
29
- import type { ConfigSection, SettingSpec } from '@open-tomato/rafa/core/config';
30
- import type { Reader } from '@open-tomato/rafa/core/config/sections';
31
- declare module '@open-tomato/rafa/core/config/config-schema' {
29
+ import type { ConfigSection, SettingSpec } from './core/config/index.js';
30
+ import type { Reader } from './core/config/sections.js';
31
+ declare module './core/config/config-schema.js' {
32
32
  /** The `bugs` section's fields, added to core's. */
33
33
  interface RafaConfig extends BugsSettings {
34
34
  }
@@ -0,0 +1,114 @@
1
+ /**
2
+ * The `checks` section of the config schema: the check-point table, one
3
+ * setting per point of the work at which the runner checks it, each one's
4
+ * field, its default, its spec and its reader. {@link CHECKS_SECTION}
5
+ * hands them to core as one `ConfigSection`, package `checks`, and the
6
+ * `declare module` below adds {@link ChecksSettings} to `RafaConfig`.
7
+ * {@link ChecksShape} holds the keys a file writes, which
8
+ * `src/config/shape.ts` composes into `ConfigShape`, the nested file
9
+ * shape. `config-registry.ts` registers the section after the `tests`
10
+ * section in `CONFIG_SECTIONS`, and its `CONFIG_DEFAULTS` and `SETTINGS`
11
+ * spread the objects below right after the `tests` section's.
12
+ *
13
+ * ## The keys
14
+ *
15
+ * Seven check points, each a list of check names, spelled as the plan
16
+ * `rafa-908-spec-person-sets-checks` names them:
17
+ *
18
+ * - `checks.task`: what a task step runs.
19
+ * - `checks.stage`: what a stage step runs.
20
+ * - `checks.loop`: what the loop runs before its wrap-up.
21
+ * - `checks.pullRequest`: what a pull request's CI runs.
22
+ * - `checks.stretch`: what a stretch of work runs.
23
+ * - `checks.releasePullRequest`: what a release pull request's CI runs.
24
+ * - `checks.publish`: what a publish runs.
25
+ *
26
+ * Each resolves as `checks` and its key's name capitalised:
27
+ * `checksTask`, `checksPullRequest` and the like. The runner's task step
28
+ * reads `checksTask` (`start/suite-task-step.ts`) and its stage step
29
+ * `checksStage` (`start/suite-stage-step.ts`); no step reads the others
30
+ * yet.
31
+ *
32
+ * ## The vocabulary
33
+ *
34
+ * A check name is one of six, {@link CHECK_NAMES}: `affected`,
35
+ * `related`, `unit`, `contract`, `integration` and `full`. The set is
36
+ * closed, and no entry holds a shell command: what each name runs is the
37
+ * resolver's, which imports {@link CHECK_NAMES} from here. {@link checkList}
38
+ * reads a list of them, and refuses a value that is not a list, an entry
39
+ * outside the six, and a name written twice, each naming the key and the
40
+ * six, since a point that runs one check twice says nothing a single
41
+ * mention does not.
42
+ *
43
+ * ## The default
44
+ *
45
+ * Every key defaults to an empty list, and an empty list means what it
46
+ * says: the point runs no check. The values a project adopts come from
47
+ * a template or from its own file, not from this module.
48
+ *
49
+ * No key here is a `CommandLineSetting`: each is a list, which the
50
+ * command line has no spelling for, as `config-schema.ts` says.
51
+ */
52
+ import type { ConfigSection, SettingSpec } from './core/config/index.js';
53
+ import type { Reader } from './core/config/sections.js';
54
+ declare module './core/config/config-schema.js' {
55
+ /** The `checks` section's fields, added to core's. */
56
+ interface RafaConfig extends ChecksSettings {
57
+ }
58
+ }
59
+ /** The six check names a check-point entry may hold, in the order a refusal lists them. */
60
+ export declare const CHECK_NAMES: readonly ['affected', 'related', 'unit', 'contract', 'integration', 'full'];
61
+ /** One check name: one of {@link CHECK_NAMES}. */
62
+ export type CheckName = (typeof CHECK_NAMES)[number];
63
+ /** The `checks` keys a file writes; `src/config/shape.ts` composes them into `ConfigShape`. */
64
+ export interface ChecksShape {
65
+ /** The `checks` keys, each a list of check names. */
66
+ readonly checks: {
67
+ /** `checks.task`: the checks a task step runs. */
68
+ readonly task: readonly CheckName[];
69
+ /** `checks.stage`: the checks a stage step runs. */
70
+ readonly stage: readonly CheckName[];
71
+ /** `checks.loop`: the checks the loop runs before its wrap-up. */
72
+ readonly loop: readonly CheckName[];
73
+ /** `checks.pullRequest`: the checks a pull request's CI runs. */
74
+ readonly pullRequest: readonly CheckName[];
75
+ /** `checks.stretch`: the checks a stretch of work runs. */
76
+ readonly stretch: readonly CheckName[];
77
+ /** `checks.releasePullRequest`: the checks a release pull request's CI runs. */
78
+ readonly releasePullRequest: readonly CheckName[];
79
+ /** `checks.publish`: the checks a publish runs. */
80
+ readonly publish: readonly CheckName[];
81
+ };
82
+ }
83
+ /** The `checks` section's settings, resolved. */
84
+ export interface ChecksSettings {
85
+ /** The checks a task step runs. `checks.task`. */
86
+ checksTask: readonly CheckName[];
87
+ /** The checks a stage step runs. `checks.stage`. */
88
+ checksStage: readonly CheckName[];
89
+ /** The checks the loop runs before its wrap-up. `checks.loop`. */
90
+ checksLoop: readonly CheckName[];
91
+ /** The checks a pull request's CI runs. `checks.pullRequest`. */
92
+ checksPullRequest: readonly CheckName[];
93
+ /** The checks a stretch of work runs. `checks.stretch`. */
94
+ checksStretch: readonly CheckName[];
95
+ /** The checks a release pull request's CI runs. `checks.releasePullRequest`. */
96
+ checksReleasePullRequest: readonly CheckName[];
97
+ /** The checks a publish runs. `checks.publish`. */
98
+ checksPublish: readonly CheckName[];
99
+ }
100
+ /**
101
+ * The reader every `checks` setting shares: a list of check names, each
102
+ * one of {@link CHECK_NAMES} and none written twice, answered frozen in
103
+ * the order written. A refusal opens with the key's label and lists the
104
+ * six.
105
+ */
106
+ export declare const checkList: Reader<readonly CheckName[]>;
107
+ /** What every `checks` setting resolves to when no layer names it: no check at any point. */
108
+ export declare const CHECKS_DEFAULTS: Readonly<ChecksSettings>;
109
+ /** The `checks` section's setting specs, in the order problems are reported. */
110
+ export declare const CHECKS_SETTINGS: {
111
+ readonly [K in keyof ChecksSettings]: SettingSpec<K>;
112
+ };
113
+ /** The `checks` section: the seven check points, with their defaults and no check. */
114
+ export declare const CHECKS_SECTION: ConfigSection;
@@ -19,9 +19,9 @@
19
19
  * unknown key inside an entry is kept and warned about, as every other
20
20
  * list of mappings does.
21
21
  */
22
- import type { ConfigSection, SettingSpec } from '@open-tomato/rafa/core/config';
23
- import type { ErrorCodeEntry } from '@open-tomato/rafa/errors/codes';
24
- declare module '@open-tomato/rafa/core/config/config-schema' {
22
+ import type { ConfigSection, SettingSpec } from './core/config/index.js';
23
+ import type { ErrorCodeEntry } from './errors/codes.js';
24
+ declare module './core/config/config-schema.js' {
25
25
  /** The `errors` section's fields, added to core's. */
26
26
  interface RafaConfig extends ErrorsSettings {
27
27
  }
@@ -8,7 +8,7 @@
8
8
  * `src/config/shape.ts` composes into `ConfigShape`, the nested file
9
9
  * shape. `config-registry.ts` registers the section fourteenth in
10
10
  * `CONFIG_SECTIONS`, and its `CONFIG_DEFAULTS` and `SETTINGS` spread the
11
- * objects below last, after the `tests` section.
11
+ * objects below last, after the `checks` section.
12
12
  *
13
13
  * ## The keys
14
14
  *
@@ -20,11 +20,11 @@
20
20
  * before the section existed. None is a `CommandLineSetting`.
21
21
  *
22
22
  * The section holds the switches and nothing that reads them: what a
23
- * `false` turns off is the loader's (`src/modules/load.ts`), which reads
23
+ * `false` turns off is the loader's (`packages/rafa/src/modules/load.ts`), which reads
24
24
  * these settings off the resolved `RafaConfig`.
25
25
  */
26
- import type { ConfigSection, SettingSpec } from '@open-tomato/rafa/core/config';
27
- declare module '@open-tomato/rafa/core/config/config-schema' {
26
+ import type { ConfigSection, SettingSpec } from './core/config/index.js';
27
+ declare module './core/config/config-schema.js' {
28
28
  /** The `features` section's fields, added to core's. */
29
29
  interface RafaConfig extends FeaturesSettings {
30
30
  }
@@ -60,7 +60,9 @@
60
60
  * spec's README section describes. So no single file can be refused for
61
61
  * it, and {@link hubUrlProblems} is the section's check: `resolveConfig`
62
62
  * asks it once every setting is ranked, and it names the file that chose
63
- * `service`. Every other
63
+ * `service`, read off that setting's provenance: a scope's module file
64
+ * and its YAML file, the local layer, are each named by their own path,
65
+ * as are the user scope's two files, which both report `user`. Every other
64
66
  * strategy reads no `hub` key, so a `hub.url` beside `local` is kept and
65
67
  * never refused: switching strategy is then a one-line edit.
66
68
  *
@@ -73,9 +75,9 @@
73
75
  * adapter could reach; the refusal above keeps that from happening
74
76
  * under `service`.
75
77
  */
76
- import type { ConfigCheckInput, ConfigSection, SettingSpec } from '@open-tomato/rafa/core/config';
77
- import type { Reader } from '@open-tomato/rafa/core/config/sections';
78
- declare module '@open-tomato/rafa/core/config/config-schema' {
78
+ import type { ConfigCheckInput, ConfigSection, SettingSpec } from './core/config/index.js';
79
+ import type { Reader } from './core/config/sections.js';
80
+ declare module './core/config/config-schema.js' {
79
81
  /** The `hub` section's fields, added to core's. */
80
82
  interface RafaConfig extends HubSettings {
81
83
  }
@@ -44,8 +44,8 @@
44
44
  */
45
45
  import type { BugRules } from './bugs/record.js';
46
46
  import type { ErrorsSettings } from './config-schema-errors.js';
47
- import type { ConfigSection, SettingSpec } from '@open-tomato/rafa/core/config';
48
- declare module '@open-tomato/rafa/core/config/config-schema' {
47
+ import type { ConfigSection, SettingSpec } from './core/config/index.js';
48
+ declare module './core/config/config-schema.js' {
49
49
  /** The `issues` section's fields, added to core's. */
50
50
  interface RafaConfig extends IssuesConfigSettings {
51
51
  }
@@ -41,9 +41,9 @@
41
41
  * command line's say over what is written.
42
42
  */
43
43
  import type { LoggerSettings, LoggerTheme } from './adapters/logger/settings.js';
44
- import type { ConfigSection, SettingSpec } from '@open-tomato/rafa/core/config';
45
- import type { LogLevel } from '@open-tomato/rafa/ports/log-level';
46
- declare module '@open-tomato/rafa/core/config/config-schema' {
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
47
  /** The `logger` section's fields, added to core's. */
48
48
  interface RafaConfig extends LoggerConfigSettings {
49
49
  }
@@ -51,9 +51,9 @@
51
51
  * None is a `CommandLineSetting`: the flags that outrank a key for one
52
52
  * run (`--retry=<n>`) are read by `start/run-setup.ts`.
53
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' {
54
+ import type { ConfigSection, SettingSpec } from './core/config/index.js';
55
+ import type { Reader } from './core/config/sections.js';
56
+ declare module './core/config/config-schema.js' {
57
57
  /** The `loop-continue` section's fields, added to core's. */
58
58
  interface RafaConfig extends LoopContinueSettings {
59
59
  }
@@ -9,7 +9,7 @@
9
9
  * which `src/config/shape.ts` composes into `LoopShape` of `ConfigShape`,
10
10
  * the nested file shape.
11
11
  * `config-registry.ts`'s `CONFIG_DEFAULTS` and `SETTINGS`
12
- * spread the objects below right after `loop.worktreeDir` and ahead of
12
+ * spread the objects below right after `loop.worktreeSetup` and ahead of
13
13
  * `loop.wrapUp`, so the order settings are reported in holds the `loop`
14
14
  * section together.
15
15
  *
@@ -49,9 +49,9 @@
49
49
  * flag that outranks it for one run is `loop start --retry=<n>`, read
50
50
  * by `start/run-setup.ts`.
51
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' {
52
+ import type { ConfigSection, SettingSpec } from './core/config/index.js';
53
+ import type { Reader } from './core/config/sections.js';
54
+ declare module './core/config/config-schema.js' {
55
55
  /** The `loop-retries` section's fields, added to core's. */
56
56
  interface RafaConfig extends LoopRetriesSettings {
57
57
  }
@@ -32,16 +32,16 @@
32
32
  * `--max-budget-usd` comes from. Four readings it leaves to this module:
33
33
  *
34
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.
35
+ * "nobody has said", not "off". The spec's default for the provider is `gh`
36
+ * when `origin` is a GitHub remote and `none` otherwise, and its default
37
+ * base is whatever the remote calls its default branch; neither is a value
38
+ * this module can spell, because both are read off the repository at use
39
+ * (`packages/rafa/src/pr/provider.ts`). Writing either default as a literal
40
+ * would be the silent choice the config refuses everywhere else: `prBase:
41
+ * 'main'` would open a pull request into a branch that may not exist on a
42
+ * repository whose default is `master`. A file spelling `provider:` or
43
+ * `base:` with no value says nothing, as every null does, and resolves to
44
+ * the same null.
45
45
  * - `pr.mergeMethod` defaults to `squash`, the first method the spec
46
46
  * lists and the one the merge flow is written for: it deletes the
47
47
  * local branch with `-D` because a squash leaves it unmerged in
@@ -155,10 +155,9 @@
155
155
  * `"true"`, `yes` and `1` are refused, and it is not a
156
156
  * `CommandLineSetting`.
157
157
  */
158
- import type { MergeMethod } from './pr/types.js';
159
- import type { ConfigSection, SettingSpec } from '@open-tomato/rafa/core/config';
160
- import type { PrProvider, Reader, ReleaseEnabled, ReleasePublishMode, ReleaseSettleMode, ReleaseStrategy, ReleaseTagMode, VersionCollisionMode } from '@open-tomato/rafa/core/config/sections';
161
- declare module '@open-tomato/rafa/core/config/config-schema' {
158
+ import type { ConfigSection, SettingSpec } from './core/config/index.js';
159
+ import type { MergeMethod, PrProvider, Reader, ReleaseEnabled, ReleasePublishMode, ReleaseSettleMode, ReleaseStrategy, ReleaseTagMode, VersionCollisionMode } from './core/config/sections.js';
160
+ declare module './core/config/config-schema.js' {
162
161
  /** The `release` section's fields, added to core's. */
163
162
  interface RafaConfig extends PrSettings, ReleaseSettings, DangerousReleaseSettings {
164
163
  }
@@ -277,18 +276,18 @@ export declare const RELEASE_DEFAULTS: Readonly<ReleaseSettings>;
277
276
  /** What the release plan's `dangerous` setting resolves to when no layer names it. */
278
277
  export declare const DANGEROUS_RELEASE_DEFAULTS: Readonly<DangerousReleaseSettings>;
279
278
  /**
280
- * Accepts one of the pull request port's three merge methods. The list
281
- * is the port's (`pr/types.ts`), which spells them to match what
282
- * `gh pr merge` takes, so a second spelling here could not disagree
283
- * with it.
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
284
  *
285
285
  * It sits here, beside the one setting that reads it, and not among
286
- * core's readers in `config-sections.ts`, so no core file imports
287
- * `pr/types.ts`. The port is reached at `./pr/types.js` and not through
288
- * the `./pr/index.js` barrel, because the barrel carries `pr/gh.ts`,
289
- * which imports the config's sections barrel and the `gh` spawner:
290
- * importing it here would put the CLI adapter behind every config read.
291
- * `pr/types.ts` imports types alone, so this import reaches nothing back.
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.
292
291
  */
293
292
  export declare const mergeMethod: Reader<MergeMethod>;
294
293
  /** The `pr` section's setting specs, in the order problems are reported. */