@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
@@ -0,0 +1,40 @@
1
+ /**
2
+ * How a pull request is merged: the {@link MergeMethod} words, the
3
+ * {@link MERGE_METHODS} list a reader validates against and the
4
+ * {@link isMergeMethod} guard.
5
+ *
6
+ * They sat in `src/pr/types.ts`, the pull request port, until the
7
+ * monorepo cut: the `pr.mergeMethod` setting in
8
+ * `src/config-schema-release.ts` read them there, which tied the
9
+ * release section to `src/pr/`. Here they are a core leaf, importing
10
+ * nothing, so the section and the port both read them from the sections
11
+ * barrel `./sections.ts`, and `src/pr/types.ts` re-exports them under
12
+ * the same names for the port's own importers.
13
+ *
14
+ * The setting's reader, `mergeMethod`, stays in
15
+ * `src/config-schema-release.ts` beside the one setting that reads it:
16
+ * this file holds the words, not a reading of the config.
17
+ */
18
+ /**
19
+ * How a merge is made. GitHub's three, and no other: `gh pr merge`
20
+ * takes exactly `--squash`, `--merge` and `--rebase`, and a provider
21
+ * that cannot do one of them refuses the call rather than substituting
22
+ * another, which would rewrite history the operator did not ask for.
23
+ */
24
+ export type MergeMethod = 'squash' | 'merge' | 'rebase';
25
+ /**
26
+ * The merge methods, in the order a refusal lists them.
27
+ *
28
+ * A runtime value beside the type so the config reader and the
29
+ * `--method` flag validate against one list rather than each spelling
30
+ * the three words again. Frozen: a caller that pushed onto it would
31
+ * change what every later refusal says it accepts.
32
+ */
33
+ export declare const MERGE_METHODS: readonly MergeMethod[];
34
+ /**
35
+ * Whether a value is one of {@link MERGE_METHODS}.
36
+ *
37
+ * @param value - Anything, a flag's value or a config reading.
38
+ * @returns True when the value is exactly one of the three words.
39
+ */
40
+ export declare function isMergeMethod(value: unknown): value is MergeMethod;
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * One scope's paths, and the project the dispatcher resolved: the
3
- * shapes `resolveScope` answers in `src/project/scope.ts`, and
3
+ * shapes `resolveScope` answers in `packages/rafa/src/project/scope.ts`, and
4
4
  * {@link scopeAt}, which builds a scope from its base directory.
5
5
  *
6
6
  * The walk itself, `resolveScope` with its refusals and its hint, stays
7
- * in `src/project/scope.ts`, which imports these names from the config
7
+ * in `packages/rafa/src/project/scope.ts`, which imports these names from the config
8
8
  * barrel and re-exports them under the same names. Core holds the
9
9
  * shapes alone, so `RafaContext` can name the project a command runs in
10
10
  * and the session store can find a project's `.rafa` directory without
@@ -13,6 +13,12 @@
13
13
  * sections lives outside `packages/rafa/src/core/`, in `src/config-registry.ts`, the
14
14
  * module that calls {@link registerConfigSections}.
15
15
  *
16
+ * {@link registeredDefaults} and {@link registeredSettings} answer the
17
+ * same two records typed whole, as {@link RafaConfig} and
18
+ * {@link SettingsRecord}, for a feature file that reads a default or a
19
+ * spec without importing that module; each refuses with a
20
+ * {@link ConfigSectionError} naming it while nothing is registered.
21
+ *
16
22
  * This file imports types alone, so it loads first in any order and can
17
23
  * be imported by value from the loader and from every section file
18
24
  * without closing a runtime cycle.
@@ -91,7 +97,7 @@
91
97
  *
92
98
  * A setting core resolves can be read by a module outside `packages/rafa/src/core/`
93
99
  * that core must not import: the logger's settings are read through
94
- * `loggerSettingsOf` in `src/config-schema-logger.ts`. So the module that
100
+ * `loggerSettingsOf` in `packages/rafa/src/config-schema-logger.ts`. So the module that
95
101
  * lists the sections also hands core one {@link ConfigLoadHook} with
96
102
  * {@link setConfigLoadHook}, and `loadConfig` (`config-load.ts`) calls
97
103
  * {@link activeConfigLoadHook} with every config it resolves, before it
@@ -99,8 +105,28 @@
99
105
  * own, beside the registry rather than in it: restoring a registry
100
106
  * leaves the hook as it was, and a case that sets one puts the previous
101
107
  * hook back in a `finally`, as a case that registers does.
108
+ *
109
+ * ## The template hook
110
+ *
111
+ * A config template is a named entry a file adopts with its `templates`
112
+ * key, and the templates live outside `packages/rafa/src/core/` too,
113
+ * in `src/config/templates.ts`, which core must not import. So core
114
+ * takes one {@link ConfigTemplateHook} through
115
+ * {@link setConfigTemplateHook}, for the module that lists the sections
116
+ * to set, and answers it off {@link activeConfigTemplateHook} for the
117
+ * loader to call by name. The hook answers the entry a name
118
+ * stands for, a mapping nested as a file nests its keys (the shape of a
119
+ * `ConfigEntry`, `src/config/entry.ts`, typed here as a plain
120
+ * {@link Mapping} since core imports nothing from `src/config/`), or null
121
+ * for a name it does not know, and may carry the `names` it knows, which
122
+ * the loader lists when it refuses a name. Like the load hook it is a module-level
123
+ * value of its own, beside the registry: restoring a registry leaves it
124
+ * as it was, and a case that sets one puts the previous hook back in a
125
+ * `finally`.
102
126
  */
127
+ import type { SettingOrigin } from './config-origins.js';
103
128
  import type { ConfigSetting, RafaConfig, SettingSpec } from './config-schema.js';
129
+ import type { Mapping } from './config-sections.js';
104
130
  import type { ConfigSource } from './config.js';
105
131
  /** Every setting's spec, by name: the record a section hands a part of. */
106
132
  export type SettingsRecord = {
@@ -116,6 +142,13 @@ export interface ConfigCheckInput {
116
142
  readonly path: string | null;
117
143
  /** The user scope's file consulted, or null when there was none. */
118
144
  readonly userPath: string | null;
145
+ /**
146
+ * The file and entry that answered each setting, null where the
147
+ * command line or a default did: the one reading that tells a scope's
148
+ * local file from its module file, and the user scope's two files,
149
+ * which both report `user`, apart.
150
+ */
151
+ readonly provenance: Readonly<Record<ConfigSetting, SettingOrigin | null>>;
119
152
  }
120
153
  /**
121
154
  * A cross-key refusal: the problems the resolved config holds, one
@@ -178,6 +211,31 @@ export declare function activeSettings(): Readonly<Partial<SettingsRecord>>;
178
211
  export declare function activeDefaults(): Readonly<Partial<RafaConfig>>;
179
212
  /** Every registered section's checks, in registration order. */
180
213
  export declare function activeChecks(): readonly ConfigCheck[];
214
+ /**
215
+ * Every setting's default, typed as the whole {@link RafaConfig}: the
216
+ * active registry's defaults, the same object {@link activeDefaults}
217
+ * answers, for a file outside `packages/rafa/src/core/` that reads a
218
+ * default without importing the module that lists the sections.
219
+ *
220
+ * Throws a {@link ConfigSectionError} naming `src/config-registry.ts`
221
+ * while no section is registered, as `loadConfig` refuses then. Types
222
+ * are erased at runtime, so core cannot list the {@link ConfigSetting}
223
+ * names and refuses an empty registry alone: the completeness rule
224
+ * pairs every registered setting with its default, and
225
+ * `src/config-registry.test.ts` holds what the registration answers
226
+ * here equal to the registry's whole `CONFIG_DEFAULTS`. Read it when a
227
+ * default is needed, never as a module loads: an entry registers after
228
+ * its imports have loaded.
229
+ */
230
+ export declare function registeredDefaults(): Readonly<RafaConfig>;
231
+ /**
232
+ * Every setting's spec, typed as the whole {@link SettingsRecord}: the
233
+ * active registry's settings, the same object {@link activeSettings}
234
+ * answers. Refuses as {@link registeredDefaults} does, on the same
235
+ * reading, and `src/config-registry.test.ts` holds it equal to the
236
+ * registry's whole `SETTINGS`.
237
+ */
238
+ export declare function registeredSettings(): SettingsRecord;
181
239
  /** Every registered setting's name, by the dotted key a file spells it with. */
182
240
  export declare function activeSettingByKey(): ReadonlyMap<string, ConfigSetting>;
183
241
  /** Every dotted prefix a registered setting sits under: the sections a file opens. */
@@ -204,3 +262,25 @@ export type ConfigLoadHook = (config: Readonly<RafaConfig>) => void;
204
262
  export declare function setConfigLoadHook(hook: ConfigLoadHook | null): ConfigLoadHook | null;
205
263
  /** The hook `loadConfig` calls with every config it resolves, or null when none is set. */
206
264
  export declare function activeConfigLoadHook(): ConfigLoadHook | null;
265
+ /**
266
+ * The entry a config template's name stands for, a mapping nested as a
267
+ * file nests its keys, or null for a name the hook does not know. See
268
+ * "The template hook" in the module note.
269
+ */
270
+ export interface ConfigTemplateHook {
271
+ /** The entry `name` stands for, or null for a name the hook does not know. */
272
+ (name: string): Mapping | null;
273
+ /**
274
+ * Every name the hook knows, which `loadConfig` lists when it refuses
275
+ * one a file gives. Absent from a hook that cannot list its names.
276
+ */
277
+ readonly names?: readonly string[];
278
+ }
279
+ /**
280
+ * Makes `hook` the one core reads a config template's entry from, or
281
+ * clears it with null. Answers the hook it replaced, for a caller to put
282
+ * back.
283
+ */
284
+ export declare function setConfigTemplateHook(hook: ConfigTemplateHook | null): ConfigTemplateHook | null;
285
+ /** The hook core reads a config template's entry from, or null when none is set. */
286
+ export declare function activeConfigTemplateHook(): ConfigTemplateHook | null;
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * The barrel over the config's value readers: every name
3
- * `config-sections.ts`, `config-readers.ts` and `branch-template.ts`
4
- * export, and nothing else.
3
+ * `config-sections.ts`, `config-readers.ts`, `branch-template.ts` and
4
+ * `merge-method.ts` export, and nothing else.
5
5
  *
6
- * A file outside `packages/rafa/src/core/` imports this file and never the three behind
6
+ * A file outside `packages/rafa/src/core/` imports this file and never the four behind
7
7
  * it (`scripts/survey/core-barrels.ts` measures that, and
8
8
  * `src/tests/core-barrels.sweep.test.ts` holds it against the tree). A
9
- * file inside `packages/rafa/src/core/` imports the three directly and never this file.
9
+ * file inside `packages/rafa/src/core/` imports the four directly and never this file.
10
10
  *
11
11
  * ## Why the pair has a barrel of its own
12
12
  *
@@ -29,17 +29,25 @@
29
29
  * It imports `config-readers.ts` alone, so it is a leaf as the pair is,
30
30
  * and it sits beside `branchFromTemplate`, the writer it reads back.
31
31
  *
32
+ * `merge-method.ts` joined with the words `pr.mergeMethod` takes, its
33
+ * list and its guard, moved out of `src/pr/types.ts` so the release
34
+ * section reads them without reaching the pull request port. It imports
35
+ * nothing, so it is a leaf too, and `src/pr/types.ts` re-exports its
36
+ * names from here.
37
+ *
32
38
  * ## What it exports
33
39
  *
34
40
  * Each name is spelled, types apart from values, as the entries
35
41
  * `src/index.ts` and `src/plan/index.ts` spell theirs.
36
42
  *
37
- * `sections.test.ts` holds the list to the three files: every name any
43
+ * `sections.test.ts` holds the list to the four files: every name any
38
44
  * of them exports is here once, as the same binding, and no name is here
39
45
  * that none of them exports.
40
46
  */
41
47
  export type { ReleasePublishMode, ReleaseSettleMode, ReleaseStrategy, ReleaseTagMode, VersionCollisionMode, } from './config-readers.js';
42
48
  export type { BoardRelationshipMode, ClaimsAhead, ClaimsStaleAfter, ClaudeSettingSource, ConfigExtra, ConfigVersion, DuplicatesLevel, InjectMode, LessonSwitch, Mapping, OutputMode, PrProvider, Reader, Reading, ReleaseEnabled, RouteTarget, SkillResolverName, StoreBackend, SyncStrategy, TierPin, TierSwitch, ValueAt, } from './config-sections.js';
49
+ export type { MergeMethod } from './merge-method.js';
43
50
  export { branchGlob, stubOfBranch } from './branch-template.js';
44
51
  export { BRANCH_STUB, branchFromTemplate, branchTemplate, DEFAULT_BRANCH_TEMPLATE, directory, fragmentsDirectory, isBranchTemplate, mapOf, RELEASE_PUBLISH_MODES, RELEASE_SETTLE_MODES, RELEASE_STRATEGIES, RELEASE_TAG_MODES, releaseFile, releasePublishMode, releaseSettleMode, releaseStrategy, releaseTagMode, routeTable, tierPins, trackerKind, VERSION_COLLISION_MODES, versionCollisionMode, } from './config-readers.js';
45
52
  export { below, BOARD_PROJECT_TEMPLATE_DEFAULT, BOARD_RELATIONSHIP_MODES, BUSY_TIMEOUT_MAX_MS, BUSY_TIMEOUT_MIN_MS, busyTimeoutMs, claimDurationHours, CLAIMS_AHEAD, CLAIMS_STALE_DISABLED, claimsAhead, claimsStaleAfter, CLAUDE_SETTING_SOURCES, confidence, CONFIDENCE_MAX, CONFIDENCE_MIN, CONFIG_VERSIONS, dayCount, describeValue, DUPLICATE_LEVELS, duplicatesLevel, flag, githubLogin, INJECT_MODES, isBusyTimeoutMs, isGitHubLogin, isMapping, issueNumber, LESSON_SWITCHES, lessonSwitch, listOf, mapReading, messageOf, oneOf, OUTPUT_MODES, PR_PROVIDERS, projectNumber, projectUrl, recurrenceCount, refused, refusedWith, RELEASE_AUTO, releaseEnabled, routeTarget, SKILL_RESOLVERS, skillResolverName, STORE_BACKENDS, subsetOf, SYNC_STRATEGIES, text, TIER_SWITCHES, tierPin, tierSwitch, usdAmount, } from './config-sections.js';
53
+ export { isMergeMethod, MERGE_METHODS } from './merge-method.js';
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * The shapes of the hop record and of a place, with the checks that read
3
- * them from parsed JSON: the part of `src/next/hop-record.ts` and
4
- * `src/project/position.ts` a session record needs (`sessions.ts` keeps a
3
+ * them from parsed JSON: the part of `packages/rafa/src/next/hop-record.ts` and
4
+ * `packages/rafa/src/project/position.ts` a session record needs (`sessions.ts` keeps a
5
5
  * hop record in its `hop` field).
6
6
  *
7
7
  * It sits in core so `sessions.ts` reads them without importing above
8
- * core. `src/project/position.ts` re-exports `Place` and `asPlace`, and
9
- * `src/next/hop-record.ts` re-exports `HopKind`, `HopState`, `HopRecord`
8
+ * core. `packages/rafa/src/project/position.ts` re-exports `Place` and `asPlace`, and
9
+ * `packages/rafa/src/next/hop-record.ts` re-exports `HopKind`, `HopState`, `HopRecord`
10
10
  * and `asHopRecord`, each under the same name; the reading and writing of
11
11
  * `.rafa/position.json` and `.rafa/hop.json`, and the module notes that
12
12
  * describe both files, stay there. `isRecord` is exported for the
@@ -23,7 +23,7 @@ export interface Place {
23
23
  export type HopKind = 'blocker' | 'dry';
24
24
  /** Where the hop stands: working its target, back home waiting on it or with it merged, or back home from a halt. */
25
25
  export type HopState = 'away' | 'waiting' | 'merged' | 'halted';
26
- /** The record `.rafa/hop.json` holds; see the module note of `src/next/hop-record.ts`. */
26
+ /** The record `.rafa/hop.json` holds; see the module note of `packages/rafa/src/next/hop-record.ts`. */
27
27
  export interface HopRecord {
28
28
  readonly kind: HopKind;
29
29
  readonly home: Place;
@@ -46,7 +46,7 @@ export declare function isRecord(value: unknown): value is Record<string, unknow
46
46
  export declare function asPlace(value: unknown): Place | null;
47
47
  /**
48
48
  * `value` as a hop record, or null when it is not one: the check
49
- * `readHopRecord` (`src/next/hop-record.ts`) makes on the parsed file,
49
+ * `readHopRecord` (`packages/rafa/src/next/hop-record.ts`) makes on the parsed file,
50
50
  * which the session record makes on its `hop` field (`sessions.ts`).
51
51
  */
52
52
  export declare function asHopRecord(value: unknown): HopRecord | null;
@@ -67,14 +67,14 @@
67
67
  * ## Why the hop record is not here
68
68
  *
69
69
  * `hop-record.ts`, the shapes of the hop record and of a place, sits
70
- * alone behind `hops.ts`. `src/next/hop-record.ts` and
71
- * `src/project/position.ts` re-export its names, so they import a
70
+ * alone behind `hops.ts`. `packages/rafa/src/next/hop-record.ts` and
71
+ * `packages/rafa/src/project/position.ts` re-export its names, so they import a
72
72
  * barrel over it by value, and `src/loop/session-record-parse.ts`,
73
73
  * which `sessions.ts` imported by value, imported `asHopRecord` from
74
- * `src/next/hop-record.ts` by value when the split was made; it has
74
+ * `packages/rafa/src/next/hop-record.ts` by value when the split was made; it has
75
75
  * since moved here and imports `hop-record.ts` by path. With `hop-record.ts` behind this
76
76
  * barrel that is a cycle of four files: this one, `sessions.ts`, the
77
- * parser and `src/next/hop-record.ts`. `hops.ts` records the
77
+ * parser and `packages/rafa/src/next/hop-record.ts`. `hops.ts` records the
78
78
  * measurement, and `hops.test.ts` holds that no name is on two loop
79
79
  * barrels. `sessions.ts` imports `hop-record.ts` by path, for
80
80
  * `HopRecord`.
@@ -86,7 +86,7 @@
86
86
  * imported three files by value when it moved:
87
87
  * `packages/rafa/src/core/config/config-sections.ts`, for `messageOf`, and two outside
88
88
  * `packages/rafa/src/core/`, `src/loop/session-record-parse.ts` and
89
- * `src/project/scope.ts`. Through them it reached 38 files by value, and
89
+ * `packages/rafa/src/project/scope.ts`. Through them it reached 38 files by value, and
90
90
  * none of the 38 imported it by value. Both have since moved into
91
91
  * `packages/rafa/src/core/`, as `session-record-parse.ts` beside it and
92
92
  * `packages/rafa/src/core/config/scope.ts`.
@@ -174,6 +174,6 @@ export type { PidProbe, SessionChange, SessionConflict, SessionConflictReason, S
174
174
  export type { CapturedSession, CapturedSpawnOptions, CapturingSpawner, ClaudeSpawner } from './claude.js';
175
175
  export type { SpawnEnv } from './session-env.js';
176
176
  export type { SuiteFailure } from './suite-failure.js';
177
- export { beginSession, errorCode, isPidAlive, isPositiveWhole, isSessionId, parseSessionRecord, readSession, readSessions, readState, RECORD_EXTENSION, RUNS_DIR, runsDir, samePlan, SESSION_DECISION_STRATEGIES, SESSION_PHASES, SESSION_STATES, SESSION_STEP_KINDS, SESSION_STEP_REASONS, SessionConflictError, sessionConflicts, sessionDecisions, sessionFilePath, sessionPhase, SessionRecordError, SessionStateError, sessionSteps, updateSession, } from './sessions.js';
177
+ export { beginSession, errorCode, isPidAlive, isPositiveWhole, isSessionId, NONE_STEP_SCOPE, parseSessionRecord, readSession, readSessions, readState, RECORD_EXTENSION, RUNS_DIR, runsDir, samePlan, SESSION_DECISION_STRATEGIES, SESSION_PHASES, SESSION_STATES, SESSION_STEP_KINDS, SESSION_STEP_REASONS, SessionConflictError, sessionConflicts, sessionDecisions, sessionFilePath, sessionPhase, SessionRecordError, SessionStateError, sessionSteps, updateSession, } from './sessions.js';
178
178
  export { carriesFlag, CLAUDE_BASE_ARGS, CLAUDE_BIN, claudeArgs, interruptClaudeSessions, runClaude, runClaudeCaptured, SETTING_SOURCES_FLAG, spawnClaude, spawnClaudeCaptured, spendWarning, } from './claude.js';
179
179
  export { sessionPath, sessionSpawnEnv } from './session-env.js';
@@ -20,11 +20,18 @@ export type SessionStepKind = (typeof SESSION_STEP_KINDS)[number];
20
20
  * Why a suite step ran at the scope it did: the task's own `tests=`
21
21
  * declaration, a full-suite trigger, the `--changed` fallback taken when
22
22
  * no `Owns:` folder narrows the run, a `tests=module` task whose module
23
- * holds no test file, and a stage step's own scope.
23
+ * holds no test file, a stage step's own scope, a check-point entry that
24
+ * names no check (a `none` step), and the entry's `unit` check.
24
25
  */
25
- export declare const SESSION_STEP_REASONS: readonly ['declared', 'trigger', 'fallback', 'no-module-tests', 'stage'];
26
+ export declare const SESSION_STEP_REASONS: readonly ['declared', 'trigger', 'fallback', 'no-module-tests', 'stage', 'no-check', 'unit'];
26
27
  /** One of {@link SESSION_STEP_REASONS}. */
27
28
  export type SessionStepReason = (typeof SESSION_STEP_REASONS)[number];
29
+ /**
30
+ * The scope of a step that ran nothing: its check-point entry named no
31
+ * check. Such a step holds an empty `command`, exit code 0 and no
32
+ * failures; see the module note, "A `none` step".
33
+ */
34
+ export declare const NONE_STEP_SCOPE: "none";
28
35
  /** The strategies a saved decision may name: the two that pass over a task. */
29
36
  export declare const SESSION_DECISION_STRATEGIES: readonly ['jump', 'defer'];
30
37
  /** A record file that cannot be read, or holds no record this module accepts. */
@@ -38,7 +38,7 @@
38
38
  * - `hop`: only on a run started with `loop start --roadmap` while a
39
39
  * `rafa next --roadmap` hop is away, the hop record as
40
40
  * `.rafa/hop.json` held it when the run began
41
- * (`src/next/hop-record.ts`, `start/session.ts`). A record of any
41
+ * (`packages/rafa/src/next/hop-record.ts`, `start/session.ts`). A record of any
42
42
  * other run carries no `hop` key at all, never one set to null, so
43
43
  * such a record is written byte for byte as it was before the field.
44
44
  * Once written, every later write of the record keeps it as it is.
@@ -80,19 +80,28 @@
80
80
  * first dispatch, `task` after a task commits, `stage` after a stage's
81
81
  * last task, `pre-wrap-up` before the wrap-up.
82
82
  * - `scope`: `affected`, `module` or `full` (`TEST_SCOPES`,
83
- * `core/plan/declaration.ts`), or the list of files and folders run, which
84
- * may be empty.
83
+ * `core/plan/declaration.ts`), `none` ({@link NONE_STEP_SCOPE}) for a
84
+ * step that ran nothing because its check-point entry named no check,
85
+ * or the list of files and folders run, which may be empty.
85
86
  * - `reason`: optional, why the step ran at that scope, one of
86
87
  * {@link SESSION_STEP_REASONS}: `declared` for the task's own `tests=`
87
- * declaration, `trigger` for a full-suite trigger, `fallback` for the
88
+ * declaration or the check-point entry, `trigger` for a full-suite trigger, `fallback` for the
88
89
  * `--changed` run taken when no `Owns:` folder narrows it,
89
90
  * `no-module-tests` for a `tests=module` task whose module holds no
90
- * test file, and `stage` for a stage step's own scope. It is written
91
+ * test file, `stage` for a stage step's own scope, `no-check` for a
92
+ * `none` step, and `unit` for a run the entry's `unit` check chose. It is written
91
93
  * as its own key right after `scope`. A step written by rafa 0.35.0
92
94
  * or earlier carries no `reason` key and reads as having none; a
93
95
  * value outside the set is left out on read, never refused, as an
94
96
  * unknown `phase` is.
95
- * - `command`: the argv spawned, `bun` first, never empty.
97
+ * - `declared`: only on a `none` step whose task line declared a
98
+ * `tests=` value, that value, which the step set aside; written right
99
+ * after `reason`. On read a value outside `TEST_SCOPES`, or the key on
100
+ * any other step, is left out, never refused.
101
+ * - `command`: the argv spawned, `bun` first, never empty but on a
102
+ * `none` step, whose command is the empty list, its `exitCode` 0 and
103
+ * its `failures` and `newFailures` empty. A `none` step outside that
104
+ * shape, and an empty command at any other scope, are refused on read.
96
105
  * - `exitCode`: the command's exit code, a whole number.
97
106
  * - `summary`: Bun's `Ran N tests across M files.` line, or null when it
98
107
  * printed none.
@@ -218,8 +227,9 @@ import type { HopRecord } from './hop-record.js';
218
227
  import type { SessionPhase, SessionState, SessionStepKind, SessionStepReason } from './session-record-parse.js';
219
228
  import type { SuiteFailure } from './suite-failure.js';
220
229
  import type { TestScope } from '../plan/declaration.js';
230
+ import { NONE_STEP_SCOPE } from './session-record-parse.js';
221
231
  export type { SessionPhase, SessionState, SessionStepKind, SessionStepReason, } from './session-record-parse.js';
222
- export { isPositiveWhole, isSessionId, parseSessionRecord, RECORD_EXTENSION, SESSION_DECISION_STRATEGIES, SESSION_PHASES, SESSION_STATES, SESSION_STEP_KINDS, SESSION_STEP_REASONS, SessionRecordError, sessionDecisions, sessionPhase, sessionSteps, } from './session-record-parse.js';
232
+ export { isPositiveWhole, isSessionId, NONE_STEP_SCOPE, parseSessionRecord, RECORD_EXTENSION, SESSION_DECISION_STRATEGIES, SESSION_PHASES, SESSION_STATES, SESSION_STEP_KINDS, SESSION_STEP_REASONS, SessionRecordError, sessionDecisions, sessionPhase, sessionSteps, } from './session-record-parse.js';
223
233
  /** The directory the records are kept in, under a project's `.rafa/`. */
224
234
  export declare const RUNS_DIR = "runs";
225
235
  /** The task a session is running. */
@@ -245,11 +255,13 @@ export interface SessionStepOnly {
245
255
  /** One suite run the runner recorded for a session. See the module note. */
246
256
  export interface SessionStep {
247
257
  readonly kind: SessionStepKind;
248
- /** A named scope, or the files and folders run. */
249
- readonly scope: TestScope | readonly string[];
258
+ /** A named scope, `none` for a step that ran nothing, or the files and folders run. */
259
+ readonly scope: TestScope | typeof NONE_STEP_SCOPE | readonly string[];
250
260
  /** Why the step ran at {@link SessionStep.scope}; left out of a step from rafa 0.35.0 or earlier. See the module note. */
251
261
  readonly reason?: SessionStepReason;
252
- /** The argv spawned, `bun` first. */
262
+ /** The `tests=` value a `none` step set aside; only on a `none` step whose task line had one. See the module note. */
263
+ readonly declared?: TestScope;
264
+ /** The argv spawned, `bun` first; empty on a `none` step alone. */
253
265
  readonly command: readonly string[];
254
266
  readonly exitCode: number;
255
267
  /** Bun's summary line, or null when it printed none. */
@@ -17,7 +17,7 @@
17
17
  *
18
18
  * A barrel that groups a file with a file outside `packages/rafa/src/core/` that
19
19
  * imports the barrel back by value is a runtime cycle.
20
- * `src/utils/tracker.ts` imports `readRafaBlocks` by value, and
20
+ * `packages/rafa/src/utils/tracker.ts` imports `readRafaBlocks` by value, and
21
21
  * `parse.ts`, behind `index.ts`, imported that file by value when the
22
22
  * split was made. So `blocks.ts` behind `index.ts` closed a cycle
23
23
  * through the tracker. `blocks.ts` imports no file, so a barrel that
@@ -11,17 +11,17 @@ import {
11
11
  mergeStore,
12
12
  openNdjsonStore,
13
13
  selectEffortStore
14
- } from "../../index-jh1r4kcn.js";
14
+ } from "../../index-3mwsr6wg.js";
15
15
  import {
16
16
  EFFORT_KEY_PROJECTIONS,
17
17
  TRUSTED_PERMISSIONS,
18
18
  openSqliteStore
19
- } from "../../index-cy98y87p.js";
20
- import"../../index-2a7nb3an.js";
21
- import"../../index-gvek4r8m.js";
19
+ } from "../../index-eay1bd2w.js";
20
+ import"../../index-f1y86zbb.js";
21
+ import"../../index-cbqvgda6.js";
22
22
  import {
23
23
  STORE_BACKENDS
24
- } from "../../index-ykggr043.js";
24
+ } from "../../index-r5q2pdky.js";
25
25
  import"../../index-z1w83f81.js";
26
26
  export {
27
27
  selectEffortStore,
@@ -18,7 +18,7 @@
18
18
  * added here by the change that fixes it.
19
19
  *
20
20
  * A project's own codes come from `errors.codes`
21
- * (`src/config-schema-errors.ts`), and {@link listedCodes} puts the two
21
+ * (`packages/rafa/src/config-schema-errors.ts`), and {@link listedCodes} puts the two
22
22
  * side by side.
23
23
  */
24
24
  import type { ErrorCodeEntry } from './codes.js';
@@ -220,4 +220,4 @@ function merge(held, payload, now) {
220
220
  discarded: keys.flatMap((key) => outcomes.get(key).discarded)
221
221
  };
222
222
  }
223
- export { bless, promotable, GAP, SOURCE_STEP, CONFIDENCE_MIN, CONFIDENCE_MAX, actionHash, triggerKey, merge };
223
+ export { GAP, SOURCE_STEP, CONFIDENCE_MIN, CONFIDENCE_MAX, actionHash, triggerKey, bless, promotable, merge };