@open-tomato/rafa 0.47.0 → 0.49.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 (73) hide show
  1. package/README.md +5 -2
  2. package/dist/bugs/places.d.ts +1 -1
  3. package/dist/bundled/skills/dev-planner/SKILL.md +1 -1
  4. package/dist/cli.js +58774 -58722
  5. package/dist/config/index.js +4 -5
  6. package/dist/config/shape.d.ts +13 -11
  7. package/dist/config-schema-board-project.d.ts +3 -3
  8. package/dist/config-schema-checks.d.ts +3 -3
  9. package/dist/config-schema-hub.d.ts +3 -3
  10. package/dist/config-schema-issues.d.ts +4 -4
  11. package/dist/config-schema-loop-continue.d.ts +3 -3
  12. package/dist/config-schema-loop-retries.d.ts +4 -4
  13. package/dist/config-schema-release.d.ts +13 -13
  14. package/dist/config-schema-tests.d.ts +3 -3
  15. package/dist/config-schema-triage.d.ts +3 -3
  16. package/dist/config-schema-wrap-up.d.ts +4 -4
  17. package/dist/core/command/global-flags.d.ts +25 -0
  18. package/dist/core/command/index.d.ts +31 -25
  19. package/dist/core/command/registry-types.d.ts +4 -4
  20. package/dist/core/command/shared-flags.d.ts +6 -6
  21. package/dist/core/command/types.d.ts +3 -2
  22. package/dist/core/config/branch-template.d.ts +2 -0
  23. package/dist/core/config/config-items.d.ts +1 -1
  24. package/dist/core/config/config-schema.d.ts +6 -0
  25. package/dist/core/config/config-sections.d.ts +15 -14
  26. package/dist/core/config/config.d.ts +1 -1
  27. package/dist/core/config/core-section.d.ts +1 -1
  28. package/dist/core/config/default-routing.d.ts +1 -1
  29. package/dist/core/config/index.d.ts +4 -4
  30. package/dist/core/config/merge-method.d.ts +4 -4
  31. package/dist/core/config/sections.d.ts +6 -3
  32. package/dist/core/git/gh-runner.d.ts +1 -1
  33. package/dist/core/git/git.d.ts +34 -0
  34. package/dist/core/git/index.d.ts +13 -8
  35. package/dist/core/loop/claude.d.ts +11 -5
  36. package/dist/core/loop/index.d.ts +3 -2
  37. package/dist/core/loop/sessions.d.ts +1 -1
  38. package/dist/core/loop/suite-failure.d.ts +8 -6
  39. package/dist/core/output/active.d.ts +1 -1
  40. package/dist/core/runtime/identity.d.ts +13 -0
  41. package/dist/core/runtime/index.d.ts +12 -6
  42. package/dist/effort/store/check-rows.d.ts +1 -1
  43. package/dist/effort/store/commit-stats.d.ts +1 -1
  44. package/dist/effort/store/index.js +8 -9
  45. package/dist/effort/store/merge-commit-gaps.d.ts +1 -1
  46. package/dist/effort/store/plan-stubs.d.ts +1 -1
  47. package/dist/effort/store/session-row-types.d.ts +2 -2
  48. package/dist/{index-f1y86zbb.js → index-2a7nb3an.js} +31 -31
  49. package/dist/index-ajv88fkm.js +448 -0
  50. package/dist/{index-r5q2pdky.js → index-fpgmdmww.js} +4 -1
  51. package/dist/{index-pzpb1rf7.js → index-g91ys6kw.js} +97 -1
  52. package/dist/{index-7dgc5g1t.js → index-j154qpbj.js} +8696 -11193
  53. package/dist/{index-cbqvgda6.js → index-m672ptpg.js} +3 -1
  54. package/dist/index-thqpre1b.js +670 -0
  55. package/dist/{index-eay1bd2w.js → index-vfny3ryr.js} +1090 -652
  56. package/dist/{index-nwzx41g1.js → index-w5qbpdtp.js} +416 -843
  57. package/dist/{index-n3e31fmw.js → index-zsak0jy6.js} +172 -254
  58. package/dist/index.js +24867 -18958
  59. package/dist/learning/index.js +221 -12
  60. package/dist/plan/index.js +11 -10
  61. package/dist/ports/index.d.ts +6 -6
  62. package/dist/ports/learning.d.ts +5 -4
  63. package/dist/ports/spec-review.d.ts +1 -1
  64. package/dist/ready-mh5wdzq5.js +241 -0
  65. package/dist/release-templates/release-bot-fragment.yml +6 -6
  66. package/dist/release-templates/release-publish.yml +8 -8
  67. package/dist/release-templates/release-settle.yml +8 -7
  68. package/dist/release-templates/release-tag.yml +8 -7
  69. package/package.json +32 -2
  70. package/dist/index-38ktnyvz.js +0 -223
  71. package/dist/index-3mwsr6wg.js +0 -1070
  72. package/dist/index-z1w83f81.js +0 -4
  73. package/dist/ready-6p40c3gw.js +0 -2007
@@ -4,11 +4,10 @@ import {
4
4
  CONFIG_TEMPLATES,
5
5
  SETTINGS,
6
6
  SETTING_NAMES
7
- } from "../index-n3e31fmw.js";
8
- import"../index-pzpb1rf7.js";
9
- import"../index-cbqvgda6.js";
10
- import"../index-r5q2pdky.js";
11
- import"../index-z1w83f81.js";
7
+ } from "../index-zsak0jy6.js";
8
+ import"../index-g91ys6kw.js";
9
+ import"../index-m672ptpg.js";
10
+ import"../index-fpgmdmww.js";
12
11
 
13
12
  // src/config/entry.ts
14
13
  function defineConfig(entries) {
@@ -45,20 +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 { ChecksShape } from '../config-schema-checks.js';
50
- import type { HubShape } from '../config-schema-hub.js';
51
- import type { IssuesShape } from '../config-schema-issues.js';
52
- import type { LoopContinueShape } from '../config-schema-loop-continue.js';
53
- import type { LoopRetriesShape } from '../config-schema-loop-retries.js';
54
- import type { ReleaseDangerousShape, ReleaseShape } from '../config-schema-release.js';
55
- import type { TestsShape } from '../config-schema-tests.js';
56
- import type { TriageShape } from '../config-schema-triage.js';
57
- import type { WrapUpShape } from '../config-schema-wrap-up.js';
48
+ import type { BoardProjectLimitsShape } from '@open-tomato/rafa/config-schema-board-project';
58
49
  import type { BugsShape } from '@open-tomato/rafa/config-schema-bugs';
50
+ import type { ChecksShape } from '@open-tomato/rafa/config-schema-checks';
59
51
  import type { ErrorsShape } from '@open-tomato/rafa/config-schema-errors';
60
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';
61
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';
62
62
  import type { ModuleSourceKind, PrerequisiteKind } from '@open-tomato/rafa/core/config';
63
63
  import type { BoardRelationshipMode, ClaimsAhead, ClaimsStaleAfter, ConfigVersion, DuplicatesLevel, InjectMode, LessonSwitch, OutputMode, RouteTarget, SkillResolverName, StoreBackend, SyncStrategy, TierPin, TierSwitch } from '@open-tomato/rafa/core/config/sections';
64
64
  /**
@@ -91,7 +91,7 @@ export type ModuleFileItem = KindKeyed<Exclude<ModuleSourceKind, 'github'>> | {
91
91
  readonly ref?: string | null;
92
92
  };
93
93
  /**
94
- * The `loop` namespace: core's two keys, and the keys the
94
+ * The `loop` namespace: core's three keys, and the keys the
95
95
  * `loop-retries`, `loop-continue` and `wrap-up` sections write.
96
96
  */
97
97
  export interface LoopShape extends LoopRetriesShape, LoopContinueShape, WrapUpShape {
@@ -99,6 +99,8 @@ export interface LoopShape extends LoopRetriesShape, LoopContinueShape, WrapUpSh
99
99
  readonly settingSources: string;
100
100
  /** `loop.worktreeDir`: where the loop's worktrees are made. */
101
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;
102
104
  }
103
105
  /** The `board.project` namespace: core's two keys and the `board-project` section's limits. */
104
106
  export interface BoardProjectShape extends BoardProjectLimitsShape {
@@ -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
  }
@@ -49,9 +49,9 @@
49
49
  * No key here is a `CommandLineSetting`: each is a list, which the
50
50
  * command line has no spelling for, as `config-schema.ts` says.
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 `checks` section's fields, added to core's. */
56
56
  interface RafaConfig extends ChecksSettings {
57
57
  }
@@ -75,9 +75,9 @@
75
75
  * adapter could reach; the refusal above keeps that from happening
76
76
  * under `service`.
77
77
  */
78
- import type { ConfigCheckInput, ConfigSection, SettingSpec } from '@open-tomato/rafa/core/config';
79
- import type { Reader } from '@open-tomato/rafa/core/config/sections';
80
- 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' {
81
81
  /** The `hub` section's fields, added to core's. */
82
82
  interface RafaConfig extends HubSettings {
83
83
  }
@@ -42,10 +42,10 @@
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 '@open-tomato/rafa/bugs/record';
46
- import type { ErrorsSettings } from '@open-tomato/rafa/config-schema-errors';
47
- import type { ConfigSection, SettingSpec } from '@open-tomato/rafa/core/config';
48
- declare module '@open-tomato/rafa/core/config/config-schema' {
45
+ import type { BugRules } from './bugs/record.js';
46
+ import type { ErrorsSettings } from './config-schema-errors.js';
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
  }
@@ -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,9 +155,9 @@
155
155
  * `"true"`, `yes` and `1` are refused, and it is not a
156
156
  * `CommandLineSetting`.
157
157
  */
158
- import type { ConfigSection, SettingSpec } from '@open-tomato/rafa/core/config';
159
- import type { MergeMethod, PrProvider, Reader, ReleaseEnabled, ReleasePublishMode, ReleaseSettleMode, ReleaseStrategy, ReleaseTagMode, VersionCollisionMode } from '@open-tomato/rafa/core/config/sections';
160
- declare module '@open-tomato/rafa/core/config/config-schema' {
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' {
161
161
  /** The `release` section's fields, added to core's. */
162
162
  interface RafaConfig extends PrSettings, ReleaseSettings, DangerousReleaseSettings {
163
163
  }
@@ -118,9 +118,9 @@
118
118
  * (`config-schema-readings.ts`): a global flag nobody typed would be one
119
119
  * this module invented.
120
120
  */
121
- import type { ConfigSection, SettingSpec } from '@open-tomato/rafa/core/config';
122
- import type { Reader } from '@open-tomato/rafa/core/config/sections';
123
- declare module '@open-tomato/rafa/core/config/config-schema' {
121
+ import type { ConfigSection, SettingSpec } from './core/config/index.js';
122
+ import type { Reader } from './core/config/sections.js';
123
+ declare module './core/config/config-schema.js' {
124
124
  /** The `tests` section's fields, added to core's. */
125
125
  interface RafaConfig extends TestsSettings {
126
126
  }
@@ -56,9 +56,9 @@
56
56
  * command line has no spelling for `false` or a number this module
57
57
  * would not have to invent.
58
58
  */
59
- import type { ConfigSection, SettingSpec } from '@open-tomato/rafa/core/config';
60
- import type { Reader } from '@open-tomato/rafa/core/config/sections';
61
- declare module '@open-tomato/rafa/core/config/config-schema' {
59
+ import type { ConfigSection, SettingSpec } from './core/config/index.js';
60
+ import type { Reader } from './core/config/sections.js';
61
+ declare module './core/config/config-schema.js' {
62
62
  /** The `triage` section's fields, added to core's. */
63
63
  interface RafaConfig extends TriageSettings {
64
64
  }
@@ -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`, so the order
12
+ * spread the objects below right after `loop.worktreeSetup`, so the order
13
13
  * settings are reported in holds the `loop` section together.
14
14
  *
15
15
  * The section has its own module, as `config-schema-release.ts` and
@@ -48,9 +48,9 @@
48
48
  * command line has no spelling for `false` or a number this module
49
49
  * would not have to invent.
50
50
  */
51
- import type { ConfigSection, SettingSpec } from '@open-tomato/rafa/core/config';
52
- import type { Reader } from '@open-tomato/rafa/core/config/sections';
53
- declare module '@open-tomato/rafa/core/config/config-schema' {
51
+ import type { ConfigSection, SettingSpec } from './core/config/index.js';
52
+ import type { Reader } from './core/config/sections.js';
53
+ declare module './core/config/config-schema.js' {
54
54
  /** The `wrap-up` section's fields, added to core's. */
55
55
  interface RafaConfig extends WrapUpSettings {
56
56
  }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * The flags every command reads, as the root help lists them.
3
+ *
4
+ * {@link GLOBAL_FLAGS} are core's rather than the CLI's because two
5
+ * readers outside one package take them: `src/cli/help.ts`, which lists
6
+ * them in the root help, and `packages/rafa-board/src/refs/verify.ts`, a board file, which
7
+ * reads their names as flags no command declares and still `present`.
8
+ * Board imports core and no CLI file, so the flags sit here, beside the
9
+ * command contract both readers already import.
10
+ *
11
+ * The file imports nothing.
12
+ */
13
+ /** A flag every command reads, as the root help lists it. */
14
+ export interface GlobalFlag {
15
+ /** The spellings, as a person types them. */
16
+ readonly spelling: string;
17
+ /** What the flag does, in a phrase. */
18
+ readonly note: string;
19
+ }
20
+ /**
21
+ * The flags the root help lists: the two `assembleContext` reads for
22
+ * every command, typed ahead of the subject or after the action, then
23
+ * `--version`, which `routeLine` reads and which is typed alone.
24
+ */
25
+ export declare const GLOBAL_FLAGS: readonly GlobalFlag[];
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * The barrel over the command contract: every name `command.ts`,
3
- * `confirm.ts`, `lazy.ts`, `registry-types.ts`, `running.ts`,
4
- * `shared-flags.ts`, `spends.ts`, `types.ts` and `version.ts` export,
5
- * and nothing else.
3
+ * `confirm.ts`, `global-flags.ts`, `lazy.ts`, `registry-types.ts`,
4
+ * `running.ts`, `shared-flags.ts`, `spends.ts`, `types.ts` and
5
+ * `version.ts` export, and nothing else.
6
6
  *
7
- * A file outside `packages/rafa/src/core/` imports this file and never the nine
7
+ * A file outside `packages/rafa/src/core/` imports this file and never the ten
8
8
  * behind it (`scripts/survey/core-barrels.ts` measures that, and
9
9
  * `src/tests/core-barrels.sweep.test.ts` holds it against the tree). A
10
- * file inside `packages/rafa/src/core/` imports the nine directly and never this
10
+ * file inside `packages/rafa/src/core/` imports the ten directly and never this
11
11
  * file.
12
12
  *
13
13
  * ## What sits behind it
@@ -17,13 +17,15 @@
17
17
  * - `confirm.ts`: the `Prompter` every yes-or-no question goes
18
18
  * through, the line prompter that reads one from a stream, and the
19
19
  * lazy prompter that opens one only to ask;
20
+ * - `global-flags.ts`: `GLOBAL_FLAGS`, the flags every command reads
21
+ * as the root help lists them, and `GlobalFlag`, the shape of one;
20
22
  * - `lazy.ts`: `CommandDeclaration`, a command less its `run`, and
21
23
  * `lazyCommand`, the command over a declaration whose `run` imports
22
24
  * the command's module and delegates to its default export;
23
25
  * - `registry-types.ts`: the contract of the dispatcher's registry,
24
26
  * `CommandRegistry` and the five shapes it names, and
25
27
  * `CommandFeature`, what one feature contributes to it, whose
26
- * builder stays in `src/cli/registry.ts`;
28
+ * builder stays in `packages/rafa/src/cli/registry.ts`;
27
29
  * - `running.ts`: the command this process is running with its parsed
28
30
  * flags, recorded by the dispatcher and read by the spend guard;
29
31
  * - `shared-flags.ts`: the flags commands of several features
@@ -39,13 +41,13 @@
39
41
  * - `version.ts`: the version the running build answers with, and the
40
42
  * line that spells it.
41
43
  *
42
- * The nine hold no name in common, so each name is exported once and
44
+ * The ten hold no name in common, so each name is exported once and
43
45
  * from the file that declares it.
44
46
  *
45
- * ## Why one barrel can hold all nine
47
+ * ## Why one barrel can hold all ten
46
48
  *
47
49
  * A barrel that groups a file with a file outside `packages/rafa/src/core/` that
48
- * imports the barrel back by value is a runtime cycle. None of the nine
50
+ * imports the barrel back by value is a runtime cycle. None of the ten
49
51
  * imports a file outside `packages/rafa/src/core/` by value. `command.ts` takes
50
52
  * `spendsProblem` from `spends.ts` beside it, and both take
51
53
  * `describeValue` from `packages/rafa/src/core/config/config-sections.ts`.
@@ -61,46 +63,48 @@
61
63
  * by value either: it names `command.ts` with `import type`, and this
62
64
  * file exports its names with `export type`, so loading the barrel
63
65
  * never loads it. `shared-flags.ts` imports nothing by value either: it
64
- * names `command.ts` with `import type` alone.
66
+ * names `command.ts` with `import type` alone. `global-flags.ts` imports
67
+ * nothing at all.
65
68
  *
66
69
  * `command.ts` also names `packages/rafa/src/project/scope.ts` with `import type`,
67
- * which is erased before anything loads; it named `src/cli/registry.ts`
68
- * the same way until the registry's contract moved into
69
- * `registry-types.ts`. `src/cli/registry.ts` imports this barrel by
70
- * value, for the shape check and the routing words, so that edge is the
71
- * one a value import in `command.ts` would turn into a cycle.
70
+ * which is erased before anything loads; it named
71
+ * `packages/rafa/src/cli/registry.ts` the same way until the registry's
72
+ * contract moved into `registry-types.ts`.
73
+ * `packages/rafa/src/cli/registry.ts` imports this barrel by value, for
74
+ * the shape check and the routing words, so that edge is the one a value
75
+ * import in `command.ts` would turn into a cycle.
72
76
  *
73
77
  * Measured when the three moved: the value imports of the non-test files
74
78
  * under `src/` and `packages/` held six cycles before the move and the
75
79
  * same six after it, none through a file of this folder. The control,
76
80
  * the same tree with `command.ts` taking one value (`HELP_WORD`) from
77
- * `src/cli/registry.ts`, held a seventh: `src/cli/registry.ts`,
78
- * `command.ts` and this file.
81
+ * `packages/rafa/src/cli/registry.ts`, held a seventh:
82
+ * `packages/rafa/src/cli/registry.ts`, `command.ts` and this file.
79
83
  *
80
84
  * Measured again when `types.ts` moved in, over every strongly connected
81
85
  * set of the same value imports: five cycles at the base and five after
82
86
  * the move, none through a file of this folder or of `src/cli/core/`.
83
- * The same `HELP_WORD` control held a sixth, `src/cli/registry.ts`,
84
- * `command.ts` and this file.
87
+ * The same `HELP_WORD` control held a sixth,
88
+ * `packages/rafa/src/cli/registry.ts`, `command.ts` and this file.
85
89
  *
86
90
  * Measured again when `spends.ts` moved in, the same way: five cycles at
87
91
  * the base and five after the move, none through a file of this folder
88
92
  * or of `src/cli/`. The same `HELP_WORD` control held a sixth,
89
- * `src/cli/registry.ts`, `command.ts` and this file.
93
+ * `packages/rafa/src/cli/registry.ts`, `command.ts` and this file.
90
94
  *
91
95
  * Measured again when the registry's contract moved into
92
96
  * `registry-types.ts`, the same way: five cycles at the base and five
93
97
  * after the move, none through a file of this folder or of `src/cli/`.
94
- * The same `HELP_WORD` control held a sixth, `src/cli/registry.ts`,
95
- * `command.ts` and this file.
98
+ * The same `HELP_WORD` control held a sixth,
99
+ * `packages/rafa/src/cli/registry.ts`, `command.ts` and this file.
96
100
  *
97
101
  * Measured again when `shared-flags.ts` moved in, the same way and with
98
102
  * the untracked new file read: five cycles at the base and four after
99
103
  * the move, none through a file of this folder. The one gone is
100
- * `src/next/actions.ts` and `src/next/hint.ts`, broken because
104
+ * `packages/rafa-run/src/next/actions.ts` and `packages/rafa-run/src/next/hint.ts`, broken because
101
105
  * `actions.ts` now takes `HINT_FLAG` from this barrel rather than from
102
106
  * `hint.ts`. The control, `shared-flags.ts` taking one value
103
- * (`HINT_TIMEOUT_MS`) from `src/next/hint.ts`, folded this file,
107
+ * (`HINT_TIMEOUT_MS`) from `packages/rafa-run/src/next/hint.ts`, folded this file,
104
108
  * `shared-flags.ts` and `hint.ts` into one strongly connected set of
105
109
  * seventy files.
106
110
  *
@@ -110,12 +114,13 @@
110
114
  * spell theirs. No name here is part of the published surface:
111
115
  * `src/index.ts` re-exports nothing from this file.
112
116
  *
113
- * `index.test.ts` holds the list to the nine files: every name any of
117
+ * `index.test.ts` holds the list to the ten files: every name any of
114
118
  * them exports is here once, as the same binding, and no other name is
115
119
  * here.
116
120
  */
117
121
  export type { CommandDeprecation, CommandExample, CommandOutput, FlagDeprecation, RafaCommand, RafaContext, RafaFlagSpec, } from './command.js';
118
122
  export type { LazyPrompter, PromptOutput, Prompter } from './confirm.js';
123
+ export type { GlobalFlag } from './global-flags.js';
119
124
  export type { CommandDeclaration } from './lazy.js';
120
125
  export type { CommandAlias, CommandFeature, CommandRegistry, CommandRegistryInput, ModuleMount, RosterOptions, SubjectSpec, } from './registry-types.js';
121
126
  export type { RunningCommand } from './running.js';
@@ -123,6 +128,7 @@ export type { CommandSpend, SpendsWhen } from './spends.js';
123
128
  export type { ArgSpec, CliCommand, CliContext, FlagSpec, } from './types.js';
124
129
  export { COMMAND_OUTPUTS, CommandExit, commandProblem, commandSpelling, isRoutingWord, isTopLevel, } from './command.js';
125
130
  export { createLinePrompter, lazyPrompter } from './confirm.js';
131
+ export { GLOBAL_FLAGS } from './global-flags.js';
126
132
  export { lazyCommand } from './lazy.js';
127
133
  export { restoreRunningCommand, runAsRunningCommand, runningCommand, setRunningCommand, } from './running.js';
128
134
  export { DEFAULT_CI_TIMEOUT_MIN, HINT_FLAG, HINT_FLAG_SPEC } from './shared-flags.js';
@@ -5,10 +5,10 @@
5
5
  * the registry its subjects and commands in.
6
6
  *
7
7
  * The registry itself, `createCommandRegistry` and the refusals it
8
- * throws, stays the CLI's, in `src/cli/registry.ts`, which imports
9
- * these names from here and re-exports them under the same names. Core
10
- * holds the contract alone, so `RafaContext` can name the registry a
11
- * command runs with without importing a file above core.
8
+ * throws, stays the CLI's, in `packages/rafa/src/cli/registry.ts`, which
9
+ * imports these names from here and re-exports them under the same
10
+ * names. Core holds the contract alone, so `RafaContext` can name the
11
+ * registry a command runs with without importing a file above core.
12
12
  *
13
13
  * Every name here is a type: the file imports `RafaCommand` from
14
14
  * `command.ts` beside it with `import type`, and nothing by value.
@@ -2,19 +2,19 @@
2
2
  * The flags commands of several features declare, spelled once.
3
3
  *
4
4
  * {@link HINT_FLAG_SPEC} is the `--no-hint` flag of the six commands
5
- * that end by naming the step that follows (`src/next/ending.ts`):
5
+ * that end by naming the step that follows (`packages/rafa-run/src/next/ending.ts`):
6
6
  * `pr merge`, `pr wait`, `pr triage`, `plan create`, `issue ready` and
7
7
  * `loop start`. They belong to four features, and three of them are
8
- * declared in a declarations file (`src/commands/pr/declarations.ts`,
9
- * `src/commands/issue/declarations.ts`), which imports core's entries
8
+ * declared in a declarations file (`packages/rafa-pr/src/commands/pr/declarations.ts`,
9
+ * `packages/rafa-board/src/commands/issue/declarations.ts`), which imports core's entries
10
10
  * alone and no module under `src/`. So the flag lives here, where every
11
11
  * one of the six can reach it, and each declares this value itself
12
12
  * rather than a copy its tests would have to hold equal.
13
13
  *
14
14
  * {@link DEFAULT_CI_TIMEOUT_MIN} is here for the same reason: the
15
15
  * loop's `--ci-timeout` (`src/commands/loop/start.ts`,
16
- * `src/start/run-setup.ts`) and `pr wait`'s `--timeout`
17
- * (`src/commands/pr/declarations.ts`, `src/commands/pr/wait.ts`) both
16
+ * `packages/rafa-run/src/start/run-setup.ts`) and `pr wait`'s `--timeout`
17
+ * (`packages/rafa-pr/src/commands/pr/declarations.ts`, `packages/rafa-pr/src/commands/pr/wait.ts`) both
18
18
  * default to it, and the second is spelled in a declarations file.
19
19
  *
20
20
  * The file imports nothing by value: it names `command.ts` with
@@ -27,7 +27,7 @@ export declare const HINT_FLAG = "hint";
27
27
  /**
28
28
  * The flag each of the six declares, so `--no-hint` suppresses the
29
29
  * ending. Boolean and defaulting to true, which is what makes
30
- * `--no-hint` read as false for it (`src/cli/core/parseArgs.ts`).
30
+ * `--no-hint` read as false for it (`parseArgs.ts` beside this file).
31
31
  */
32
32
  export declare const HINT_FLAG_SPEC: RafaFlagSpec;
33
33
  /**
@@ -5,8 +5,9 @@
5
5
  * Copied from open-tomato's `packages/shared/cli-core/src/types.ts` at
6
6
  * commit `6c774b81fc62489f31748c47e251f11448e3904a` (2026-06-25). The
7
7
  * package is not on the public registry, so rafa copies it rather than
8
- * depending on it, as it copies `parseArgs.ts` and `assembleContext.ts`,
9
- * which stay in `src/cli/core/`, from the same package.
8
+ * depending on it, as it copies `parseArgs.ts`, now beside this file,
9
+ * and `assembleContext.ts`, which stays in `src/cli/core/`, from the
10
+ * same package.
10
11
  *
11
12
  * The copy sat beside those two until it moved into `packages/rafa/src/core/command/`,
12
13
  * so core's `command.ts` reads it without importing the CLI.
@@ -1,3 +1,5 @@
1
+ /** The base every row that names one is read against where `pr.base` names none. */
2
+ export declare const DEFAULT_BASE_BRANCH = "main";
1
3
  /**
2
4
  * The glob matching every plan branch the template names: the template
3
5
  * with `{stub}` replaced by `rafa-*`.
@@ -37,7 +37,7 @@ export type PrerequisiteKind = (typeof PREREQUISITE_KINDS)[number];
37
37
  /**
38
38
  * Which of a run's dispatches need a plan's item: its tasks, its wrap-up,
39
39
  * or both. Read from the `[tasks]` or `[wrap-up]` marker of a
40
- * PREREQUISITES file (`src/preflight/prerequisites-md.ts`).
40
+ * PREREQUISITES file (`packages/rafa/src/preflight/prerequisites-md.ts`).
41
41
  */
42
42
  export type PrerequisiteScope = 'tasks' | 'wrap-up' | 'both';
43
43
  /** One item of `prerequisites.required`. */
@@ -82,6 +82,12 @@ export interface RafaConfig {
82
82
  * project root. `loop.worktreeDir`.
83
83
  */
84
84
  loopWorktreeDir: string;
85
+ /**
86
+ * The shell command a `--as-worktree` run runs in its new or reused
87
+ * worktree before the first session, or null to run nothing.
88
+ * `loop.worktreeSetup`.
89
+ */
90
+ loopWorktreeSetup: string | null;
85
91
  /**
86
92
  * The logins trusted with board text besides the repository's own
87
93
  * write-holders. `board.trustedAuthors`.
@@ -167,15 +167,16 @@
167
167
  * back.
168
168
  *
169
169
  * The range {@link confidence} accepts, {@link CONFIDENCE_MIN} to
170
- * {@link CONFIDENCE_MAX}, is declared here and not read from the
171
- * learning library: core imports nothing above it, and `src/learning/`
172
- * imports nothing from the rest of `src/`, so each declares the pair the
173
- * library clamps every lesson's confidence to, and
174
- * `src/tests/learning-contract.test.ts` holds the two equal.
175
- *
176
- * The reader of `pr.mergeMethod`, over the pull request port's three
177
- * methods, is not here: it sits with the setting it reads, in
178
- * `config-schema-release.ts`, so no core file imports `pr/types.ts`.
170
+ * {@link CONFIDENCE_MAX}, is declared here and not read from the learning
171
+ * library: core imports nothing above it, and the library under
172
+ * `packages/rafa-inventory/src/learning/` imports nothing outside its folder,
173
+ * so each declares the pair the library clamps every lesson's confidence to,
174
+ * and `src/tests/learning-contract.test.ts` holds the two equal.
175
+ *
176
+ * The reader of `pr.mergeMethod`, over the pull request port's three methods,
177
+ * is not here: it sits with the setting it reads, in
178
+ * `config-schema-release.ts`, so this file imports nothing from
179
+ * `packages/rafa/src/pr/types.ts`.
179
180
  */
180
181
  import type { SkillTier } from '../../schema/tiers.js';
181
182
  /** One key a file carried that names nothing this version reads. */
@@ -253,10 +254,10 @@ export type ClaudeSettingSource = (typeof CLAUDE_SETTING_SOURCES)[number];
253
254
  /**
254
255
  * The pull request providers a file may name: the GitHub CLI, and none.
255
256
  *
256
- * `none` is a provider and not an absence: under it the loop pushes the
257
- * branch, prints the compare URL and skips the CI wait, which is a
258
- * behaviour an operator chooses, where a setting left unnamed is one
259
- * `pr/provider.ts` resolves off the `origin` remote.
257
+ * `none` is a provider and not an absence: under it the loop pushes the branch,
258
+ * prints the compare URL and skips the CI wait, which is a behaviour an
259
+ * operator chooses, where a setting left unnamed is one
260
+ * `packages/rafa/src/pr/provider.ts` resolves off the `origin` remote.
260
261
  */
261
262
  export declare const PR_PROVIDERS: readonly ["gh", "none"];
262
263
  /** One of the two pull request providers. */
@@ -347,7 +348,7 @@ export declare const usdAmount: Reader<number>;
347
348
  * Accepts an issue number as the board spells one: a whole number above
348
349
  * zero, and no string spelled like one.
349
350
  *
350
- * The bound matches `src/board/naming.ts`, which refuses anything else
351
+ * The bound matches `packages/rafa/src/board/naming.ts`, which refuses anything else
351
352
  * with a `RangeError` rather than spelling `rafa-0` into a path. A
352
353
  * setting read here is handed straight to `gh issue view <n>`, so `0`,
353
354
  * `-1` and `2.5` are refused where the person can still fix the file,
@@ -49,7 +49,7 @@
49
49
  * through its barrel `core/config/sections.js`. `MergeMethod`, the type
50
50
  * of {@link RafaConfig.prMergeMethod}, is `merge-method.ts`'s, exported
51
51
  * by that barrel and re-exported by the pull request port
52
- * (`src/pr/types.ts`); this module does not re-export it.
52
+ * (`packages/rafa/src/pr/types.ts`); this module does not re-export it.
53
53
  *
54
54
  * - `config-sections.ts` holds every rule about a VALUE: the readers,
55
55
  * the closed lists of values, and why nothing is coerced.
@@ -21,7 +21,7 @@ export declare const SCOPE_DIR: string;
21
21
  * rather than read off a value, since `isolatedDeclarations` asks every
22
22
  * exported type to be written out.
23
23
  */
24
- export type CoreSetting = 'version' | 'store' | 'effortBusyTimeoutMs' | 'effortSync' | 'inject' | 'planDir' | 'specsDir' | 'trackerDefault' | 'trackerFallback' | 'learningAdapter' | 'learningBlessMinConfidence' | 'learningPromoteAfter' | 'learningPromoteMinConfidence' | 'outputMode' | 'prerequisitesRequired' | 'prerequisitesOptional' | 'trackingSpecs' | 'trackingPlans' | 'trackingAll' | 'modules' | 'allowList' | 'settingSources' | 'loopWorktreeDir' | 'boardTrustedAuthors' | 'boardRelationships' | 'boardProjectTemplate' | 'boardProjectNumber' | 'roadmapIssue' | 'claimsStaleAfter' | 'claimsAhead' | 'cleanupStaleDays' | 'cleanupWorktreeIdleDays' | 'cleanupKeep' | 'dangerousAcceptStaleRefs' | 'dangerousSelfUpdateDuringLoop' | 'statusNotice' | 'tiersRafa' | 'tiersSkills' | 'tiersAgents' | 'routing' | 'taskSkills' | 'taskLessons' | 'mergeDuplicates' | 'namingBranch' | 'templates';
24
+ export type CoreSetting = 'version' | 'store' | 'effortBusyTimeoutMs' | 'effortSync' | 'inject' | 'planDir' | 'specsDir' | 'trackerDefault' | 'trackerFallback' | 'learningAdapter' | 'learningBlessMinConfidence' | 'learningPromoteAfter' | 'learningPromoteMinConfidence' | 'outputMode' | 'prerequisitesRequired' | 'prerequisitesOptional' | 'trackingSpecs' | 'trackingPlans' | 'trackingAll' | 'modules' | 'allowList' | 'settingSources' | 'loopWorktreeDir' | 'loopWorktreeSetup' | 'boardTrustedAuthors' | 'boardRelationships' | 'boardProjectTemplate' | 'boardProjectNumber' | 'roadmapIssue' | 'claimsStaleAfter' | 'claimsAhead' | 'cleanupStaleDays' | 'cleanupWorktreeIdleDays' | 'cleanupKeep' | 'dangerousAcceptStaleRefs' | 'dangerousSelfUpdateDuringLoop' | 'statusNotice' | 'tiersRafa' | 'tiersSkills' | 'tiersAgents' | 'routing' | 'taskSkills' | 'taskLessons' | 'mergeDuplicates' | 'namingBranch' | 'templates';
25
25
  /** Core's section: its package, the spec and the default of each of its settings, and no check. */
26
26
  export interface CoreSection extends ConfigSection {
27
27
  /** Each of core's settings, by name, in the order problems are reported. */
@@ -2,7 +2,7 @@
2
2
  * rafa's routing defaults: which agent a task of each shape goes to
3
3
  * when no config layer says otherwise.
4
4
  *
5
- * The table moved here from `src/tiers/routing.ts`, which re-exports
5
+ * The table moved here from `packages/rafa-inventory/src/tiers/routing.ts`, which re-exports
6
6
  * each name, so `core-section.ts` reads {@link DEFAULT_ROUTING} without
7
7
  * importing above core. What the rows mean, and why the map is one
8
8
  * shared `Map` while the list is frozen, is `routing.ts`'s module note.