@open-tomato/rafa 0.46.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 (59) hide show
  1. package/README.md +65 -35
  2. package/dist/adapters/logger/settings.d.ts +2 -2
  3. package/dist/bugs/record.d.ts +1 -1
  4. package/dist/bundled/skills/dev-planner/SKILL.md +1 -1
  5. package/dist/cli.js +74711 -74226
  6. package/dist/config/index.d.ts +5 -0
  7. package/dist/config/index.js +6 -3
  8. package/dist/config/shape.d.ts +8 -5
  9. package/dist/config/templates.d.ts +64 -0
  10. package/dist/config-registry.d.ts +21 -12
  11. package/dist/config-schema-bugs.d.ts +3 -3
  12. package/dist/config-schema-checks.d.ts +114 -0
  13. package/dist/config-schema-errors.d.ts +3 -3
  14. package/dist/config-schema-features.d.ts +4 -4
  15. package/dist/config-schema-hub.d.ts +3 -1
  16. package/dist/config-schema-issues.d.ts +2 -2
  17. package/dist/config-schema-logger.d.ts +3 -3
  18. package/dist/config-schema-release.d.ts +11 -12
  19. package/dist/config-schema-tests.d.ts +32 -24
  20. package/dist/core/command/command.d.ts +1 -1
  21. package/dist/core/command/confirm.d.ts +11 -5
  22. package/dist/core/command/index.d.ts +27 -9
  23. package/dist/core/command/shared-flags.d.ts +40 -0
  24. package/dist/core/config/config-load-module.d.ts +43 -0
  25. package/dist/core/config/config-load.d.ts +43 -12
  26. package/dist/core/config/config-origins.d.ts +31 -30
  27. package/dist/core/config/config-schema.d.ts +5 -0
  28. package/dist/core/config/config.d.ts +90 -25
  29. package/dist/core/config/core-section.d.ts +1 -1
  30. package/dist/core/config/index.d.ts +10 -6
  31. package/dist/core/config/merge-method.d.ts +40 -0
  32. package/dist/core/config/scope.d.ts +2 -2
  33. package/dist/core/config/section.d.ts +81 -1
  34. package/dist/core/config/sections.d.ts +13 -5
  35. package/dist/core/loop/hop-record.d.ts +6 -6
  36. package/dist/core/loop/index.d.ts +6 -6
  37. package/dist/core/loop/session-record-parse.d.ts +9 -2
  38. package/dist/core/loop/sessions.d.ts +22 -10
  39. package/dist/core/plan/block-reader.d.ts +1 -1
  40. package/dist/effort/store/index.js +5 -5
  41. package/dist/errors/rafa-codes.d.ts +1 -1
  42. package/dist/{index-77ajfffn.js → index-38ktnyvz.js} +1 -1
  43. package/dist/{index-jh1r4kcn.js → index-3mwsr6wg.js} +333 -330
  44. package/dist/{index-gqz4jn6j.js → index-7dgc5g1t.js} +4755 -4722
  45. package/dist/{index-gvek4r8m.js → index-cbqvgda6.js} +82 -26
  46. package/dist/{index-cy98y87p.js → index-eay1bd2w.js} +143 -108
  47. package/dist/{index-2a7nb3an.js → index-f1y86zbb.js} +31 -31
  48. package/dist/{index-j4k2vdz3.js → index-n3e31fmw.js} +205 -289
  49. package/dist/{index-39kbcw68.js → index-nwzx41g1.js} +4 -4
  50. package/dist/index-pzpb1rf7.js +153 -0
  51. package/dist/{index-ykggr043.js → index-r5q2pdky.js} +10 -5
  52. package/dist/index.js +14602 -14328
  53. package/dist/learning/index.js +1 -1
  54. package/dist/plan/index.js +3 -3
  55. package/dist/ports/index.d.ts +1 -1
  56. package/dist/{ready-4f8edezt.js → ready-6p40c3gw.js} +260 -269
  57. package/package.json +22 -1
  58. package/dist/pr/checks.d.ts +0 -133
  59. package/dist/pr/types.d.ts +0 -422
@@ -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,11 +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";
7
+ } from "../index-n3e31fmw.js";
8
+ import"../index-pzpb1rf7.js";
9
+ import"../index-cbqvgda6.js";
10
+ import"../index-r5q2pdky.js";
9
11
  import"../index-z1w83f81.js";
10
12
 
11
13
  // src/config/entry.ts
@@ -46,6 +48,7 @@ function fileValueOf(setting, value) {
46
48
  }
47
49
  var defaults = entryOf(SETTING_NAMES.filter((setting) => CONFIG_DEFAULTS[setting] !== null).map((setting) => [SETTINGS[setting].key, fileValueOf(setting, CONFIG_DEFAULTS[setting])]));
48
50
  export {
51
+ CONFIG_TEMPLATES as templates,
49
52
  defineConfig,
50
53
  defaults
51
54
  };
@@ -46,18 +46,19 @@
46
46
  * Every type is `import type`, so this module loads nothing.
47
47
  */
48
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';
49
+ import type { ChecksShape } from '../config-schema-checks.js';
52
50
  import type { HubShape } from '../config-schema-hub.js';
53
51
  import type { IssuesShape } from '../config-schema-issues.js';
54
- import type { LoggerShape } from '../config-schema-logger.js';
55
52
  import type { LoopContinueShape } from '../config-schema-loop-continue.js';
56
53
  import type { LoopRetriesShape } from '../config-schema-loop-retries.js';
57
54
  import type { ReleaseDangerousShape, ReleaseShape } from '../config-schema-release.js';
58
55
  import type { TestsShape } from '../config-schema-tests.js';
59
56
  import type { TriageShape } from '../config-schema-triage.js';
60
57
  import type { WrapUpShape } from '../config-schema-wrap-up.js';
58
+ import type { BugsShape } from '@open-tomato/rafa/config-schema-bugs';
59
+ import type { ErrorsShape } from '@open-tomato/rafa/config-schema-errors';
60
+ import type { FeaturesShape } from '@open-tomato/rafa/config-schema-features';
61
+ import type { LoggerShape } from '@open-tomato/rafa/config-schema-logger';
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
  /**
@@ -126,7 +127,7 @@ export interface DangerousShape extends ReleaseDangerousShape {
126
127
  readonly selfUpdateDuringLoop: boolean;
127
128
  }
128
129
  /** 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 {
130
+ export interface ConfigShape extends BugsShape, ChecksShape, ErrorsShape, FeaturesShape, HubShape, IssuesShape, LoggerShape, ReleaseShape, TestsShape, TriageShape {
130
131
  /** `version`: the config format's version. */
131
132
  readonly version: ConfigVersion;
132
133
  /** `store`: the effort store's backend. */
@@ -228,5 +229,7 @@ export interface ConfigShape extends BugsShape, ErrorsShape, FeaturesShape, HubS
228
229
  /** `naming.branch`: the template the branch `loop start` creates is named from, holding `{stub}` once. */
229
230
  readonly branch: string;
230
231
  };
232
+ /** `templates`: the config templates this file adopts, by name. */
233
+ readonly templates: readonly string[];
231
234
  }
232
235
  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. */
@@ -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 '@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 `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
  *
@@ -42,8 +42,8 @@
42
42
  * the fields of one bug, and the rules they are held to are the
43
43
  * project's.
44
44
  */
45
- import type { BugRules } from './bugs/record.js';
46
- import type { ErrorsSettings } from './config-schema-errors.js';
45
+ import type { BugRules } from '@open-tomato/rafa/bugs/record';
46
+ import type { ErrorsSettings } from '@open-tomato/rafa/config-schema-errors';
47
47
  import type { ConfigSection, SettingSpec } from '@open-tomato/rafa/core/config';
48
48
  declare module '@open-tomato/rafa/core/config/config-schema' {
49
49
  /** The `issues` section's fields, added to core's. */
@@ -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
  }
@@ -155,9 +155,8 @@
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
158
  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';
159
+ import type { MergeMethod, PrProvider, Reader, ReleaseEnabled, ReleasePublishMode, ReleaseSettleMode, ReleaseStrategy, ReleaseTagMode, VersionCollisionMode } from '@open-tomato/rafa/core/config/sections';
161
160
  declare module '@open-tomato/rafa/core/config/config-schema' {
162
161
  /** The `release` section's fields, added to core's. */
163
162
  interface RafaConfig extends PrSettings, ReleaseSettings, DangerousReleaseSettings {
@@ -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. */
@@ -29,31 +29,35 @@
29
29
  *
30
30
  * - `tests.fullSuiteTriggers` names the files a task's diff runs the
31
31
  * full suite for, however the task line scoped its tests. Its
32
- * default is the five files whose change can move a test no import
33
- * graph reaches: `bunfig.toml`, `tsconfig*.json`, `package.json`,
34
- * `bun.lock` and `bun.lockb`. The plan adds the preload files
35
- * `bunfig.toml`'s `[test] preload` names, and those are NOT in this
36
- * default: a default is a value this module can spell, and which
37
- * files a project preloads is a question about its disk, answered
38
- * at run time by the reader of the scope. A project that sets this
39
- * key replaces the five, and the preload files are added to its own
40
- * list all the same.
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.
41
40
  * - `tests.integration` names the test files a stage step runs beside
42
41
  * the tests under the folders the stage touched, because they drive
43
- * the whole CLI rather than one folder's modules. Its default is the
44
- * four spellings this repository gives such a file, in any folder:
45
- * a name ending `-integration.test.ts` or `.integration.test.ts`,
46
- * one holding `-spawned` and ending `.test.ts`, and one ending
47
- * `-cli.test.ts`. Each default pattern opens with the any-folder
48
- * prefix, two stars and a slash, which this note cannot spell
49
- * because it would close the comment.
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`.
50
51
  * - `tests.contract` names the contract tests. A contract test checks
51
52
  * the promise a package makes to others, with a fixture, and runs in
52
53
  * that package's own `test` task in ring 1 of CI, where a use-case
53
54
  * test matching `tests.integration` runs in ring 0's full run. Its
54
- * default is one pattern: a name ending `.contract.test.ts`, in any
55
- * folder, under the same any-folder prefix. No step reads the key
56
- * yet; its readers come with the CI rings that run each kind.
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.
57
61
  * - `tests.alwaysRun` names the test files a task's scoped run takes
58
62
  * beside the ones `bun test --changed=<base>` selects. A content
59
63
  * sweep, a test that imports no project file and reads the tree at
@@ -64,14 +68,18 @@
64
68
  * since the sweeps it names may not have been written yet. The task
65
69
  * prompt reads it (`start/task-gate-lines.ts`), naming the files it
66
70
  * resolves to, and so does the runner's task step
67
- * (`start/task-always-run.ts`), running those files beside a
68
- * `module` or `affected` scope.
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).
69
74
  *
70
75
  * An empty list is a value every glob key accepts, and means what it says:
71
76
  * no file triggers the full suite beyond the preload files, a stage
72
- * runs no integration tier, no file is a contract test, or a task runs no sweep beside its scoped
73
- * tests. It is not read as "the default", since a list written `[]`
74
- * has been said.
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.
75
83
  *
76
84
  * ## The reader
77
85
  *
@@ -30,7 +30,7 @@
30
30
  * second one.
31
31
  *
32
32
  * And it carries `project`, the project the command runs in as
33
- * `resolveScope` answers it (`src/project/scope.ts`): its root, the home,
33
+ * `resolveScope` answers it (`packages/rafa/src/project/scope.ts`): its root, the home,
34
34
  * and both scopes' paths. A command runs inside a project unless it
35
35
  * declares `needsProject: false`. The dispatcher resolves the project
36
36
  * before any other command runs, and runs none outside a project, so
@@ -26,11 +26,15 @@
26
26
  * {@link lazyPrompter} wraps the opening of a prompter so a run that
27
27
  * never asks opens nothing: the prompter is opened at the first
28
28
  * question, kept for the next, and closed by `close`, after which the
29
- * next question opens a fresh one. Its `ask` answers whether the line
30
- * typed means yes: `y` or `yes`, trimmed and in any case, the reading
31
- * every `[y/N]` question in rafa makes. Anything else declines, the empty
32
- * answer and the null of an input that ended included. `issue ready`,
33
- * `next`, `cleanup` and `plan create`'s three offers ask through it.
29
+ * next question opens a fresh one. It asks in two forms over the one
30
+ * prompter: `askLine` answers the line as typed, or null once the input
31
+ * has ended, for a question that reads its own answer; `ask` is the yes
32
+ * reading over `askLine`, whether the line typed means yes: `y` or `yes`,
33
+ * trimmed and in any case, the reading every `[y/N]` question in rafa
34
+ * makes. Anything else declines, the empty answer and the null of an
35
+ * input that ended included. `issue ready`, `issue unblock`, `next`,
36
+ * `cleanup` and `plan create`'s three offers ask through `ask`, and
37
+ * `epic defer` and `epic promote` through `askLine`.
34
38
  */
35
39
  import type { Readable } from 'node:stream';
36
40
  /** Asks an operator, and tells them what went wrong. */
@@ -44,6 +48,8 @@ export interface Prompter {
44
48
  }
45
49
  /** A prompter opened at its first question, see the module note. */
46
50
  export interface LazyPrompter {
51
+ /** Opens the prompter if it is not open, asks `question` and answers the line typed, or null once the input has ended. */
52
+ readonly askLine: (question: string) => Promise<string | null>;
47
53
  /** Opens the prompter if it is not open, asks `question` and answers whether the line typed means yes. */
48
54
  readonly ask: (question: string) => Promise<boolean>;
49
55
  /** Closes the prompter if one is open; the next question opens another. */