@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
@@ -46,7 +46,7 @@
46
46
  * imports the barrel back by value is a runtime cycle. None of the
47
47
  * eight files behind this one imports outward by value:
48
48
  * `core-section.ts` reads the routing defaults from `default-routing.ts`
49
- * beside it, and `src/tiers/routing.ts` imports them from this barrel by
49
+ * beside it, and `packages/rafa-inventory/src/tiers/routing.ts` imports them from this barrel by
50
50
  * value with nothing here importing it back. No file behind it
51
51
  * imports a section file (`src/config-schema-*.ts`), by value or as a
52
52
  * type: `config-merged.ts`, which spread the eleven into one schema,
@@ -69,7 +69,7 @@
69
69
  *
70
70
  * Measured again when core's keys moved into `core-section.ts`, on bun
71
71
  * 1.3.14: each barrel, each of the five files, `section.ts`,
72
- * `src/tiers/routing.ts` and each section file loaded first in a fresh
72
+ * `packages/rafa-inventory/src/tiers/routing.ts` and each section file loaded first in a fresh
73
73
  * `bun` process, `SETTINGS` and `CONFIG_DEFAULTS` holding 89 entries and
74
74
  * `CORE_SECTION` 42 each time. The control, `config-schema-hub.ts`
75
75
  * reading `SETTINGS` off this barrel at load, threw `Cannot access
@@ -87,7 +87,7 @@
87
87
  * the value imports of the five files behind this one reach no section
88
88
  * file and not the registry, and each config barrel, each of the five
89
89
  * files, `config-load.ts`, the registry, `packages/rafa/src/effort/store/settings.ts`,
90
- * `src/tiers/routing.ts`, `packages/rafa/src/core/adapters/registry.ts` and each
90
+ * `packages/rafa-inventory/src/tiers/routing.ts`, `packages/rafa/src/core/adapters/registry.ts` and each
91
91
  * section file loaded first in a fresh `bun` process, the registry then
92
92
  * answering 89 registered settings and 89 defaults each time.
93
93
  *
@@ -113,7 +113,7 @@
113
113
  * or `registeredSettings()` from here, which answer the registered
114
114
  * records typed whole.
115
115
  * Neither are the hub's `HubContext` and `HubTimeout`, which a file
116
- * imports from `src/config-schema-hub.ts`.
116
+ * imports from `packages/rafa/src/config-schema-hub.ts`.
117
117
  *
118
118
  * The published surface is narrower than this file. `src/index.ts`
119
119
  * re-exports part of it, and of the runtime names leaves out core's
@@ -3,16 +3,16 @@
3
3
  * {@link MERGE_METHODS} list a reader validates against and the
4
4
  * {@link isMergeMethod} guard.
5
5
  *
6
- * They sat in `src/pr/types.ts`, the pull request port, until the
6
+ * They sat in `packages/rafa/src/pr/types.ts`, the pull request port, until the
7
7
  * monorepo cut: the `pr.mergeMethod` setting in
8
- * `src/config-schema-release.ts` read them there, which tied the
8
+ * `packages/rafa/src/config-schema-release.ts` read them there, which tied the
9
9
  * release section to `src/pr/`. Here they are a core leaf, importing
10
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
11
+ * barrel `./sections.ts`, and `packages/rafa/src/pr/types.ts` re-exports them under
12
12
  * the same names for the port's own importers.
13
13
  *
14
14
  * The setting's reader, `mergeMethod`, stays in
15
- * `src/config-schema-release.ts` beside the one setting that reads it:
15
+ * `packages/rafa/src/config-schema-release.ts` beside the one setting that reads it:
16
16
  * this file holds the words, not a reading of the config.
17
17
  */
18
18
  /**
@@ -28,11 +28,14 @@
28
28
  * through the `naming.branch` template, `branchGlob` and `stubOfBranch`.
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
+ * `DEFAULT_BASE_BRANCH`, the base `pr.base` unset is read as, joined it
32
+ * from `packages/rafa-run/src/next/sources.ts`, so a reader of the base takes it beside
33
+ * `DEFAULT_BRANCH_TEMPLATE` without reaching `rafa next`'s composition.
31
34
  *
32
35
  * `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
36
+ * list and its guard, moved out of `packages/rafa/src/pr/types.ts` so the release
34
37
  * 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
38
+ * nothing, so it is a leaf too, and `packages/rafa/src/pr/types.ts` re-exports its
36
39
  * names from here.
37
40
  *
38
41
  * ## What it exports
@@ -47,7 +50,7 @@
47
50
  export type { ReleasePublishMode, ReleaseSettleMode, ReleaseStrategy, ReleaseTagMode, VersionCollisionMode, } from './config-readers.js';
48
51
  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
52
  export type { MergeMethod } from './merge-method.js';
50
- export { branchGlob, stubOfBranch } from './branch-template.js';
53
+ export { branchGlob, DEFAULT_BASE_BRANCH, stubOfBranch } from './branch-template.js';
51
54
  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';
52
55
  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
56
  export { isMergeMethod, MERGE_METHODS } from './merge-method.js';
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * Declared here, below the `github` tracker that spawns `gh`, so the
6
6
  * adapter registry types its `gh` option without importing the tracker.
7
- * `src/adapters/tracker/github.ts` imports both names from this file
7
+ * `packages/rafa-board/src/adapters/tracker/github.ts` imports both names from this file
8
8
  * and re-exports them under the same names, so none of its importers
9
9
  * changes.
10
10
  */
@@ -20,3 +20,37 @@ export declare function createGitRunner(cwd: string): GitRunner;
20
20
  * all, which a successful `git switch` does.
21
21
  */
22
22
  export declare function gitSaid(result: GitResult): string;
23
+ /** A checkout's working tree, as `git status --porcelain` reported it. */
24
+ export interface WorkingTreeStatus {
25
+ /** True when git reported nothing at all. */
26
+ readonly clean: boolean;
27
+ /** Every porcelain line, as git wrote it; see the module note. */
28
+ readonly entries: readonly string[];
29
+ /** The porcelain lines naming a tracked path, as git wrote them. */
30
+ readonly tracked: readonly string[];
31
+ /**
32
+ * The untracked paths, unquoted ({@link unquoteGitPath}). A directory
33
+ * git folded into one line keeps its trailing `/`.
34
+ */
35
+ readonly untracked: readonly string[];
36
+ }
37
+ /**
38
+ * Parses `git status --porcelain` into a status.
39
+ *
40
+ * Every non-blank line lands in {@link WorkingTreeStatus.entries}, and
41
+ * each one in exactly one of the two halves: a `?? ` line is untracked
42
+ * and its path is unquoted, every other line is tracked and kept as git
43
+ * wrote it; see the module note. Which half refuses a merge is
44
+ * `readMergeRefusal`'s, in `packages/rafa-pr/src/pr/merge.ts`.
45
+ */
46
+ export declare function parseWorkingTree(stdout: string): WorkingTreeStatus;
47
+ /**
48
+ * A path as git printed it, with git's quoting undone. git wraps a path
49
+ * in double quotes when it holds a character it will not print bare —
50
+ * `git status --porcelain` for a space, `git ls-tree` for a non-ASCII
51
+ * byte, which it writes as octal escapes under `core.quotePath` — and
52
+ * leaves every other path as it is. Measured on git 2.53.0: an
53
+ * untracked `a b.txt` read `?? "a b.txt"` in porcelain and `a b.txt` in
54
+ * `ls-tree -r --name-only`, and `é.txt` read `"\303\251.txt"` in both.
55
+ */
56
+ export declare function unquoteGitPath(raw: string): string;
@@ -11,7 +11,9 @@
11
11
  * ## What sits behind it
12
12
  *
13
13
  * - `git.ts`: the runner that spawns `git` in a directory and answers
14
- * what git said instead of throwing, with the reader of that answer;
14
+ * what git said instead of throwing, with the reader of that answer,
15
+ * and the reader of `git status --porcelain` with git's path
16
+ * unquoting;
15
17
  * - `commit.ts`: staging and committing one task's work on the loop's
16
18
  * behalf, the subject derived from the task text, and the argv of
17
19
  * each step;
@@ -50,16 +52,19 @@
50
52
  * file imports one file outside `packages/rafa/src/core/` by value,
51
53
  * `packages/rafa/src/schema/tiers.ts`, and it does not reach this barrel.
52
54
  *
53
- * `src/pr/index.ts`, the `pr` subject's barrel, re-exports the four
54
- * names of `git.ts` from this file, as it re-exported them from
55
- * `git.ts` before the move. `config-sections.ts` imports
56
- * `src/pr/types.ts` directly and not that barrel, which is why the edge
55
+ * `packages/rafa-pr/src/pr/index.ts`, the `pr` subject's barrel, re-exports four names
56
+ * of `git.ts` from this file (`GitResult`, `GitRunner`,
57
+ * `createGitRunner`, `gitSaid`), as it re-exported them from `git.ts`
58
+ * before the move; the working tree reader and `unquoteGitPath`, which
59
+ * came here later from `packages/rafa-pr/src/pr/merge.ts`, it does not re-export.
60
+ * `config-sections.ts` imports
61
+ * `packages/rafa/src/pr/types.ts` directly and not that barrel, which is why the edge
57
62
  * closes nothing.
58
63
  *
59
64
  * Measured when the two moved: the value imports of the non-test files
60
65
  * under `src/` and `packages/` held six cycles before the move and the
61
66
  * same six after it, none through a file of this folder. The control,
62
- * the same tree with `src/pr/types.ts` taking one value (`gitSaid`) from
67
+ * the same tree with `packages/rafa/src/pr/types.ts` taking one value (`gitSaid`) from
63
68
  * this barrel, held a seventh: that file, `config-sections.ts`, `git.ts`
64
69
  * and this one. No load order of the control was run.
65
70
  *
@@ -79,7 +84,7 @@
79
84
  * `git.ts` declares, and no other name is here.
80
85
  */
81
86
  export type { GhResult, GhRunner } from './gh-runner.js';
82
- export type { GitResult, GitRunner } from './git.js';
87
+ export type { GitResult, GitRunner, WorkingTreeStatus } from './git.js';
83
88
  export type { CommitAttempt, CommitMessage, CommitOptions, CommitOutcome, CommitStep, CommitType, CommitTypeRule, DerivedSubject, GitRunResult, SubjectOptions, } from './commit.js';
84
- export { createGitRunner, gitSaid } from './git.js';
89
+ export { createGitRunner, gitSaid, parseWorkingTree, unquoteGitPath } from './git.js';
85
90
  export { buildCommitMessage, COMMIT_TYPE_RULES, commitArgs, commitTaskWork, DEFAULT_COMMIT_TYPE, deriveCommitSubject, FALLBACK_DESCRIPTION, firstClause, headShaArgs, inferCommitType, MAX_MESSAGE_CHARS, MAX_SUBJECT_LENGTH, normaliseTaskText, spawnGit, stageAllArgs, stagedChangesArgs, } from './commit.js';
@@ -167,7 +167,7 @@
167
167
  * `with` declaration and the run carries the flag, or an `unless`
168
168
  * declaration and the run does not. `through` covers a run because the
169
169
  * command runs another's action in-process (`rafa next`,
170
- * `src/next/actions.ts`), and the recorded command stays the outer one.
170
+ * `packages/rafa-run/src/next/actions.ts`), and the recorded command stays the outer one.
171
171
  * A flag is matched by its name without the dashes, and `--no-<name>`
172
172
  * also as the parser keys it, `<name>` set to `false`; a flag recorded
173
173
  * as `false` is not carried. With no command recorded, as for a caller
@@ -204,6 +204,12 @@ export declare const CLAUDE_BASE_ARGS: readonly string[];
204
204
  * module note.
205
205
  */
206
206
  export declare const SETTING_SOURCES_FLAG = "--setting-sources";
207
+ /**
208
+ * The flag a session is spawned with to run under the id the loop
209
+ * picked for it. A task session's id goes ahead of its declaration's
210
+ * flags; see the module note.
211
+ */
212
+ export declare const SESSION_ID_FLAG = "--session-id";
207
213
  /**
208
214
  * Builds the argument list for one session: the base arguments, the
209
215
  * setting sources, the served flags, then the flags.
@@ -220,7 +226,7 @@ export declare const SETTING_SOURCES_FLAG = "--setting-sources";
220
226
  * for a decision `core/plan/declaration.ts` already makes.
221
227
  *
222
228
  * `served` is `ServedSet.flags` from `serveResolution`
223
- * (`src/tiers/serve.ts`), the session-only flags handing the run's
229
+ * (`packages/rafa-inventory/src/tiers/serve.ts`), the session-only flags handing the run's
224
230
  * served directory over, and is taken as it is for the same reason.
225
231
  * It defaults to empty, so a caller that serves nothing spawns what it
226
232
  * spawned before. It goes BEFORE `flags`, never after: `--tools` has to
@@ -307,13 +313,13 @@ export interface CapturedSession {
307
313
  export interface CapturedSpawnOptions {
308
314
  /**
309
315
  * The session's working directory, or the loop's own when absent. The
310
- * search session (`src/inventory/search/index.ts`) names the scratch
316
+ * search session (`packages/rafa-inventory/src/inventory/search/index.ts`) names the scratch
311
317
  * copy of its candidates, each check session of the epic verification
312
- * run (`src/epic/verify-run.ts`) a detached worktree of main, the plan
318
+ * run (`packages/rafa-board/src/epic/verify-run.ts`) a detached worktree of main, the plan
313
319
  * session of the `claude` planner (`src/adapters/planner/claude.ts`)
314
320
  * the project root it writes the plan under, and the loop's task,
315
321
  * wrap-up and CI repair sessions the run's checkout
316
- * (`src/start/checkout.ts`).
322
+ * (`packages/rafa-run/src/start/checkout.ts`).
317
323
  */
318
324
  readonly cwd?: string;
319
325
  }
@@ -25,7 +25,8 @@
25
25
  * - `session-env.ts`: the environment a Claude session is spawned
26
26
  * with, which `claude.ts` imports by path;
27
27
  * - `suite-failure.ts`: the type of one failing test, which
28
- * `sessions.ts` imports by path and `src/suite/run.ts` re-exports.
28
+ * `sessions.ts` imports by path and `packages/rafa/src/suite/run.ts`
29
+ * re-exports.
29
30
  *
30
31
  * The four files share no name, and only `sessions.ts` imports
31
32
  * `suite-failure.ts`, for a type. One
@@ -175,5 +176,5 @@ export type { CapturedSession, CapturedSpawnOptions, CapturingSpawner, ClaudeSpa
175
176
  export type { SpawnEnv } from './session-env.js';
176
177
  export type { SuiteFailure } from './suite-failure.js';
177
178
  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
- export { carriesFlag, CLAUDE_BASE_ARGS, CLAUDE_BIN, claudeArgs, interruptClaudeSessions, runClaude, runClaudeCaptured, SETTING_SOURCES_FLAG, spawnClaude, spawnClaudeCaptured, spendWarning, } from './claude.js';
179
+ export { carriesFlag, CLAUDE_BASE_ARGS, CLAUDE_BIN, claudeArgs, interruptClaudeSessions, runClaude, runClaudeCaptured, SESSION_ID_FLAG, SETTING_SOURCES_FLAG, spawnClaude, spawnClaudeCaptured, spendWarning, } from './claude.js';
179
180
  export { sessionPath, sessionSpawnEnv } from './session-env.js';
@@ -221,7 +221,7 @@
221
221
  * refused on read. This module re-exports what a caller reads from
222
222
  * there, so `./sessions.js` stays the one import a record's reader
223
223
  * needs: `isPositiveWhole` and `RECORD_EXTENSION` among them, which
224
- * `src/stretch/folder.ts` and `src/cleanup/runs.ts` read.
224
+ * `src/stretch/folder.ts` and `packages/rafa-run/src/cleanup/runs.ts` read.
225
225
  */
226
226
  import type { HopRecord } from './hop-record.js';
227
227
  import type { SessionPhase, SessionState, SessionStepKind, SessionStepReason } from './session-record-parse.js';
@@ -1,10 +1,11 @@
1
1
  /**
2
- * The record of one failing test, as `src/suite/run.ts` reads it from a
3
- * JUnit report and a session record keeps it among a suite step's
4
- * failures (`sessions.ts`).
2
+ * The record of one failing test, as `packages/rafa/src/suite/run.ts`
3
+ * reads it from a JUnit report and a session record keeps it among a
4
+ * suite step's failures (`sessions.ts`).
5
5
  *
6
6
  * It sits in core so `sessions.ts` reads it without importing above
7
- * core; `src/suite/run.ts` re-exports it under the same name.
7
+ * core; `packages/rafa/src/suite/run.ts` re-exports it under the same
8
+ * name.
8
9
  */
9
10
  /** One failing test: its file, relative to the run's directory, and its full name. */
10
11
  export interface SuiteFailure {
@@ -13,13 +14,14 @@ export interface SuiteFailure {
13
14
  readonly name: string;
14
15
  /**
15
16
  * The first line of its JUnit failure's message; absent when the
16
- * report gave none. Compared by `src/triage/inherited.ts` when present to
17
+ * report gave none. Compared by `packages/rafa-pr/src/triage/inherited.ts` when present to
17
18
  * identify inherited failures.
18
19
  */
19
20
  readonly message?: string;
20
21
  /**
21
22
  * The first lines of the error Bun printed for it on stderr, trimmed;
22
- * absent when it printed none. See the module note of `src/suite/run.ts`.
23
+ * absent when it printed none. See the module note of
24
+ * `packages/rafa/src/suite/run.ts`.
23
25
  */
24
26
  readonly errorLines?: readonly string[];
25
27
  }
@@ -2,7 +2,7 @@
2
2
  * The Output this process writes through, and the mode it renders in.
3
3
  *
4
4
  * A function that prints asks {@link activeOutput} for the output rather
5
- * than taking one as an argument, as `src/start/stamp.ts` holds a run's
5
+ * than taking one as an argument, as `packages/rafa-run/src/start/stamp.ts` holds a run's
6
6
  * plan stub: an `Output` threaded through every function that prints
7
7
  * would add an argument to call sites that have nothing to say about
8
8
  * output. The output is held in two places, and the readers answer the
@@ -1,3 +1,16 @@
1
+ /**
2
+ * Rafa's published name, the `name` of the root `package.json`. It is
3
+ * spelled here rather than read from that manifest, which lies above
4
+ * core's package (#1090); the manifest beside this package names the
5
+ * package itself, `@open-tomato/rafa-core`, until #808 renames it.
6
+ * `src/tests/core-coupled/core/runtime/identity.test.ts` plants its
7
+ * manifests with the root manifest's `name`, so a drift fails there.
8
+ * It is also what run's install and pr's merge follow-ups compare a
9
+ * manifest's `name` against.
10
+ */
11
+ export declare const RAFA_PACKAGE_NAME = "@open-tomato/rafa";
12
+ /** Where versions sit under the home: `~/.rafa/runtime/<version>/`. */
13
+ export declare const RUNTIME_SUBDIR: string;
1
14
  /** An installed runtime: a runtime copy, or the package installed from npm. */
2
15
  export interface InstalledIdentity {
3
16
  readonly kind: 'installed';
@@ -17,15 +17,19 @@
17
17
  * from a checkout, and the three types it answers with. It moved here
18
18
  * from `src/runtime/identity.ts` (#1088), so the effort store, which
19
19
  * asks it before it migrates a live store, imports nothing above core
20
- * for it.
20
+ * for it. Beside it sit two values: `RAFA_PACKAGE_NAME`, rafa's
21
+ * published name, which the walk compares each manifest against, and
22
+ * `RUNTIME_SUBDIR`, where installed versions sit under the home. Both
23
+ * moved into core in the seventh decouple item, so pr's merge reads
24
+ * them without importing run.
21
25
  *
22
26
  * ## Why one barrel can hold it
23
27
  *
24
28
  * A barrel that groups a file with a file outside `packages/rafa/src/core/` that
25
29
  * imports the barrel back by value is a runtime cycle. `identity.ts`
26
- * imports `node:fs`, `node:path` and the root `package.json`, and no
27
- * file under `src/`, so no file behind this barrel reaches a file that
28
- * imports it back.
30
+ * imports only `node:fs` and `node:path`, no file under `src/`, and
31
+ * spells rafa's package name as a literal, so no file behind this barrel
32
+ * reaches a file that imports it back.
29
33
  *
30
34
  * ## The old path
31
35
  *
@@ -37,10 +41,12 @@
37
41
  *
38
42
  * Each name is spelled, types apart from values, as the other core
39
43
  * barrels spell theirs. No name here is part of the published surface:
40
- * `src/index.ts` re-exports nothing from this file.
44
+ * `src/index.ts` re-exports nothing from this file. The values are
45
+ * {@link readRuntimeIdentity}, `RAFA_PACKAGE_NAME` and `RUNTIME_SUBDIR`;
46
+ * the types are the three identities.
41
47
  *
42
48
  * `index.test.ts` holds the list to the file: every name `identity.ts`
43
49
  * exports is here once, as the same binding, and no other name is here.
44
50
  */
45
51
  export type { DevelopmentIdentity, InstalledIdentity, RuntimeIdentity } from './identity.js';
46
- export { readRuntimeIdentity } from './identity.js';
52
+ export { readRuntimeIdentity, RAFA_PACKAGE_NAME, RUNTIME_SUBDIR } from './identity.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * The check rows of a pull request and the verdict over them, which the
3
- * store's plan CI writer (`./plan-ci.ts`) reads and `src/pr/checks.ts`
3
+ * store's plan CI writer (`./plan-ci.ts`) reads and `packages/rafa-pr/src/pr/checks.ts`
4
4
  * re-exports for the poll and the provider that parse and wait on them.
5
5
  *
6
6
  * They sit in core so the store reads a verdict without importing the
@@ -2,7 +2,7 @@
2
2
  * The commit row of the effort store and the gap arithmetic its rows
3
3
  * carry.
4
4
  *
5
- * Moved down from `src/effort/commits.ts`, which parses `git log` into
5
+ * Moved down from `packages/rafa-effort/src/effort/commits.ts`, which parses `git log` into
6
6
  * these rows and re-exports both names under the same names: the
7
7
  * store's row types (`types.ts`), the merge's gap recompute
8
8
  * (`merge-commit-gaps.ts`) and its scenario fixtures
@@ -1,5 +1,6 @@
1
1
  // @bun
2
2
  import {
3
+ EFFORT_KEY_PROJECTIONS,
3
4
  WIRE_FORMAT,
4
5
  WIRE_VERSION,
5
6
  WireExportRefusal,
@@ -10,19 +11,17 @@ import {
10
11
  materialiseWirePayload,
11
12
  mergeStore,
12
13
  openNdjsonStore,
14
+ openSqliteStore,
13
15
  selectEffortStore
14
- } from "../../index-3mwsr6wg.js";
16
+ } from "../../index-vfny3ryr.js";
15
17
  import {
16
- EFFORT_KEY_PROJECTIONS,
17
- TRUSTED_PERMISSIONS,
18
- openSqliteStore
19
- } from "../../index-eay1bd2w.js";
20
- import"../../index-f1y86zbb.js";
21
- import"../../index-cbqvgda6.js";
18
+ TRUSTED_PERMISSIONS
19
+ } from "../../index-thqpre1b.js";
20
+ import"../../index-2a7nb3an.js";
21
+ import"../../index-m672ptpg.js";
22
22
  import {
23
23
  STORE_BACKENDS
24
- } from "../../index-r5q2pdky.js";
25
- import"../../index-z1w83f81.js";
24
+ } from "../../index-fpgmdmww.js";
26
25
  export {
27
26
  selectEffortStore,
28
27
  openSqliteStore,
@@ -7,7 +7,7 @@
7
7
  * ## Why only those rows
8
8
  *
9
9
  * A commit's gap is the minutes since the commit before it in time
10
- * (`assignElapsedMinutes`, `src/effort/commits.ts`), measured with
10
+ * (`assignElapsedMinutes`, `packages/rafa-effort/src/effort/commits.ts`), measured with
11
11
  * {@link minutesBetween}. A commit brought in between two commits here
12
12
  * changes exactly two gaps: its own, which the other store measured
13
13
  * against its own neighbours, and that of the commit after it, which now
@@ -3,7 +3,7 @@
3
3
  * and a stub, how plan stubs are read out of a directory listing, and
4
4
  * how a branch stub resolves against them.
5
5
  *
6
- * Moved down from `src/effort/attribution.ts`, which attributes a
6
+ * Moved down from `packages/rafa-effort/src/effort/attribution.ts`, which attributes a
7
7
  * session to its plan, issue and task text and re-exports these names
8
8
  * under the same names: the store's row types (`types.ts`) and its plan
9
9
  * CI reader (`plan-ci.ts`) need the resolution but not the session
@@ -2,8 +2,8 @@
2
2
  * The session row's own types: what a session was dispatched to do and
3
3
  * the stats accumulated over its log.
4
4
  *
5
- * Moved down from `src/effort/classify.ts` (`SessionKind`) and
6
- * `src/effort/session-log.ts` (`SessionStats` and the
5
+ * Moved down from `packages/rafa-effort/src/effort/classify.ts` (`SessionKind`) and
6
+ * `packages/rafa/src/effort/session-log.ts` (`SessionStats` and the
7
7
  * `SessionUsageTotals` it names), which classify and read session logs
8
8
  * and re-export these names under the same names: the store's row types
9
9
  * (`types.ts`) need the shapes but not the classifier or the reader, so
@@ -1,34 +1,4 @@
1
1
  // @bun
2
- // packages/rafa/src/core/plan/plan-stamp.ts
3
- var STUB_PATTERN = "[A-Za-z0-9._-]+";
4
- var STAMP_PATTERN = new RegExp(`<!--\\s*ralph:plan=(${STUB_PATTERN})\\s*-->`);
5
- function isStampableStub(stub) {
6
- return new RegExp(`^${STUB_PATTERN}$`).test(stub);
7
- }
8
- function planStampLine(stub) {
9
- if (!isStampableStub(stub)) {
10
- throw new Error(`rafa plan stamp: unusable stub ${JSON.stringify(stub)}`);
11
- }
12
- return `<!-- ralph:plan=${stub} -->`;
13
- }
14
- function planStubFromPrompt(content) {
15
- if (typeof content !== "string" || content.length === 0)
16
- return null;
17
- const match = STAMP_PATTERN.exec(content);
18
- const stub = match?.[1];
19
- return stub !== undefined && isStampableStub(stub) ? stub : null;
20
- }
21
- function stampPrompt(stub, prompt) {
22
- return `${prompt}
23
- ${planStampLine(stub)}`;
24
- }
25
- function planStubFromPath(planPath) {
26
- const base = planPath.split("/").pop() ?? planPath;
27
- const match = /^PLAN(?:_TRACKER)?-(.+)\.md$/.exec(base);
28
- const stub = match?.[1];
29
- return stub !== undefined && isStampableStub(stub) ? stub : null;
30
- }
31
-
32
2
  // packages/rafa/src/core/output/text.ts
33
3
  var DEBUG_VERBOSITY = 2;
34
4
  function formatPayload(payload) {
@@ -122,4 +92,34 @@ function activeOutputMode() {
122
92
  return scopes.getStore()?.mode ?? activeMode;
123
93
  }
124
94
 
125
- export { isStampableStub, planStubFromPrompt, stampPrompt, planStubFromPath, createTextOutput, activeOutput, activeOutputMode };
95
+ // packages/rafa/src/core/plan/plan-stamp.ts
96
+ var STUB_PATTERN = "[A-Za-z0-9._-]+";
97
+ var STAMP_PATTERN = new RegExp(`<!--\\s*ralph:plan=(${STUB_PATTERN})\\s*-->`);
98
+ function isStampableStub(stub) {
99
+ return new RegExp(`^${STUB_PATTERN}$`).test(stub);
100
+ }
101
+ function planStampLine(stub) {
102
+ if (!isStampableStub(stub)) {
103
+ throw new Error(`rafa plan stamp: unusable stub ${JSON.stringify(stub)}`);
104
+ }
105
+ return `<!-- ralph:plan=${stub} -->`;
106
+ }
107
+ function planStubFromPrompt(content) {
108
+ if (typeof content !== "string" || content.length === 0)
109
+ return null;
110
+ const match = STAMP_PATTERN.exec(content);
111
+ const stub = match?.[1];
112
+ return stub !== undefined && isStampableStub(stub) ? stub : null;
113
+ }
114
+ function stampPrompt(stub, prompt) {
115
+ return `${prompt}
116
+ ${planStampLine(stub)}`;
117
+ }
118
+ function planStubFromPath(planPath) {
119
+ const base = planPath.split("/").pop() ?? planPath;
120
+ const match = /^PLAN(?:_TRACKER)?-(.+)\.md$/.exec(base);
121
+ const stub = match?.[1];
122
+ return stub !== undefined && isStampableStub(stub) ? stub : null;
123
+ }
124
+
125
+ export { createTextOutput, activeOutput, activeOutputMode, isStampableStub, planStubFromPrompt, stampPrompt, planStubFromPath };