@cleocode/core 2026.6.19 → 2026.7.2

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 (52) hide show
  1. package/dist/docs/export-document.js +1160 -329
  2. package/dist/docs/export-document.js.map +3 -3
  3. package/dist/llm/plugin-facade.js +1211 -383
  4. package/dist/llm/plugin-facade.js.map +3 -3
  5. package/dist/memory/brain-writer-handlers.d.ts.map +1 -1
  6. package/dist/memory/brain-writer-handlers.js +39 -0
  7. package/dist/memory/brain-writer-handlers.js.map +1 -1
  8. package/dist/orchestrate/admission.d.ts +65 -0
  9. package/dist/orchestrate/admission.d.ts.map +1 -0
  10. package/dist/orchestrate/admission.js +54 -0
  11. package/dist/orchestrate/admission.js.map +1 -0
  12. package/dist/orchestrate/query-ops.d.ts.map +1 -1
  13. package/dist/orchestrate/query-ops.js +37 -8
  14. package/dist/orchestrate/query-ops.js.map +1 -1
  15. package/dist/orchestrate/spawn-ops.d.ts.map +1 -1
  16. package/dist/orchestrate/spawn-ops.js +24 -0
  17. package/dist/orchestrate/spawn-ops.js.map +1 -1
  18. package/dist/resources/governor.d.ts +133 -0
  19. package/dist/resources/governor.d.ts.map +1 -0
  20. package/dist/resources/governor.js +377 -0
  21. package/dist/resources/governor.js.map +1 -0
  22. package/dist/resources/supervisor-admit.d.ts +42 -0
  23. package/dist/resources/supervisor-admit.d.ts.map +1 -0
  24. package/dist/resources/supervisor-admit.js +136 -0
  25. package/dist/resources/supervisor-admit.js.map +1 -0
  26. package/dist/selfimprove/draft-pr.d.ts +93 -9
  27. package/dist/selfimprove/draft-pr.d.ts.map +1 -1
  28. package/dist/selfimprove/draft-pr.js +164 -23
  29. package/dist/selfimprove/draft-pr.js.map +1 -1
  30. package/dist/selfimprove/fix-gen.js +1209 -381
  31. package/dist/selfimprove/fix-gen.js.map +3 -3
  32. package/dist/selfimprove/run-loop.d.ts +9 -1
  33. package/dist/selfimprove/run-loop.d.ts.map +1 -1
  34. package/dist/selfimprove/run-loop.js +7 -1
  35. package/dist/selfimprove/run-loop.js.map +1 -1
  36. package/dist/sentient/tick.d.ts.map +1 -1
  37. package/dist/sentient/tick.js +29 -0
  38. package/dist/sentient/tick.js.map +1 -1
  39. package/dist/store/agent-registry-store.d.ts.map +1 -1
  40. package/dist/store/agent-registry-store.js +17 -2
  41. package/dist/store/agent-registry-store.js.map +1 -1
  42. package/dist/store/dual-scope-db.d.ts.map +1 -1
  43. package/dist/store/dual-scope-db.js +35 -0
  44. package/dist/store/dual-scope-db.js.map +1 -1
  45. package/dist/store/sqlite.d.ts.map +1 -1
  46. package/dist/store/sqlite.js +15 -0
  47. package/dist/store/sqlite.js.map +1 -1
  48. package/dist/tasks/tool-semaphore.d.ts +25 -0
  49. package/dist/tasks/tool-semaphore.d.ts.map +1 -1
  50. package/dist/tasks/tool-semaphore.js +68 -1
  51. package/dist/tasks/tool-semaphore.js.map +1 -1
  52. package/package.json +12 -12
@@ -5,7 +5,7 @@
5
5
  * PR against the cleocode repo (ADR-065 — PRs target `main` via the Merge Queue;
6
6
  * NEVER a direct push to `main`, NEVER an auto-merge, NEVER a publish). This module
7
7
  * is the egress primitive, modeled on `propose-patch.ts` (the closest "agent
8
- * proposes a fix PR" exemplar) with three self-dogfooding hardenings:
8
+ * proposes a fix PR" exemplar) with four self-dogfooding hardenings:
9
9
  *
10
10
  * 1. **`--draft` is ALWAYS appended** to `gh pr create` — the PR is never
11
11
  * ready-for-merge; a human reviews and undrafts it.
@@ -14,6 +14,13 @@
14
14
  * side-effect-free at egress by default.
15
15
  * 3. **Branch `feat/T11889-selfimprove-<scenario>-<ts>`** — a feature branch
16
16
  * (ADR-065); no main mutation path exists in this module.
17
+ * 4. **Workspace isolation (T12007).** The patch is applied inside an
18
+ * *ephemeral transient worktree* cut fresh off `origin/main` — NEVER the
19
+ * invoking checkout — and ONLY the paths the patch names are staged
20
+ * (`git add -- <paths>`, never `git add -A`). This closes a P1 data-safety
21
+ * defect where the egress swept the orchestrator's entire dirty working
22
+ * tree (untracked owner scratch notes, uncommitted edits) into the public
23
+ * branch and deleted them locally. The invoking repo is never mutated.
17
24
  *
18
25
  * The live path wraps the git/gh shell-out in
19
26
  * {@link "../sentient/skill-provenance.js".withProvenance}`('pr-generator', …)`
@@ -26,11 +33,15 @@
26
33
  * @module @cleocode/core/selfimprove/draft-pr
27
34
  * @epic T11889
28
35
  * @task T11913
36
+ * @task T12007
29
37
  */
30
38
  import { execFileSync } from 'node:child_process';
31
- import { existsSync, readFileSync } from 'node:fs';
32
- import { resolve as resolvePath } from 'node:path';
39
+ import { randomBytes } from 'node:crypto';
40
+ import { existsSync, readFileSync, rmSync } from 'node:fs';
41
+ import { tmpdir } from 'node:os';
42
+ import { join, resolve as resolvePath } from 'node:path';
33
43
  import { cwd as processCwd } from 'node:process';
44
+ import { addTransientWorktree, removeTransientWorktree } from '@cleocode/worktree';
34
45
  import { withProvenance } from '../sentient/skill-provenance.js';
35
46
  /**
36
47
  * The required Claude Code trailer every self-improvement PR body ends with.
@@ -38,7 +49,15 @@ import { withProvenance } from '../sentient/skill-provenance.js';
38
49
  */
39
50
  const PR_BODY_TRAILER = '\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)';
40
51
  /** Default command runner — wraps `execFileSync` with stdout-piped semantics. */
41
- const defaultRun = (file, args) => execFileSync(file, [...args], { stdio: 'pipe' }).toString('utf8');
52
+ const defaultRun = (file, args, cwd) => execFileSync(file, [...args], { cwd, stdio: 'pipe' }).toString('utf8');
53
+ /**
54
+ * Sanitize a scenario name into a filesystem/ref-safe stem.
55
+ *
56
+ * @internal
57
+ */
58
+ function safeStem(scenario) {
59
+ return scenario.replace(/[^a-z0-9-]/gi, '-');
60
+ }
42
61
  /**
43
62
  * Compute the feature branch name for a scenario's draft PR (ADR-065 feature
44
63
  * branch — `feat/T11889-selfimprove-<scenario>-<ts>`). The timestamp is
@@ -49,19 +68,89 @@ const defaultRun = (file, args) => execFileSync(file, [...args], { stdio: 'pipe'
49
68
  * @returns The branch name.
50
69
  */
51
70
  export function draftPrBranchName(scenario, ts) {
52
- const safeScenario = scenario.replace(/[^a-z0-9-]/gi, '-');
71
+ const safeScenario = safeStem(scenario);
53
72
  const safeTs = ts.replace(/[:.]/g, '-');
54
73
  return `feat/T11889-selfimprove-${safeScenario}-${safeTs}`;
55
74
  }
75
+ /**
76
+ * Extract the set of repo-relative paths a unified diff touches — the SSoT for
77
+ * "which paths may be staged" (T12007).
78
+ *
79
+ * Parses the `diff --git a/<old> b/<new>` header (the authoritative per-file
80
+ * boundary in a git-format diff), collecting BOTH the pre-image (`a/`) and
81
+ * post-image (`b/`) paths so renames stage their old path too and deletions
82
+ * stage the removed path. `/dev/null` sentinels (pure add / pure delete) are
83
+ * skipped. Also parses bare `--- ` / `+++ ` headers as a fallback for
84
+ * non-`diff --git` unified diffs. The result is de-duplicated and stable
85
+ * ordered by first appearance.
86
+ *
87
+ * The egress stages ONLY these paths (`git add -- <paths>`), so the isolated
88
+ * worktree can never sweep anything the patch did not name.
89
+ *
90
+ * @param diffText - The unified-diff text.
91
+ * @returns The de-duplicated repo-relative paths the diff touches.
92
+ */
93
+ export function parseUnifiedDiffPaths(diffText) {
94
+ const paths = [];
95
+ const seen = new Set();
96
+ const push = (raw) => {
97
+ // Strip surrounding double-quotes git adds for paths with special chars,
98
+ // then drop a leading `a/` or `b/` prefix and any trailing tab-timestamp.
99
+ let p = raw.trim();
100
+ if (p.startsWith('"') && p.endsWith('"') && p.length >= 2)
101
+ p = p.slice(1, -1);
102
+ p = p.replace(/\t.*$/, '');
103
+ if (p === '/dev/null' || p.length === 0)
104
+ return;
105
+ const rel = p.replace(/^[ab]\//, '');
106
+ if (rel.length === 0 || rel === '/dev/null' || seen.has(rel))
107
+ return;
108
+ seen.add(rel);
109
+ paths.push(rel);
110
+ };
111
+ for (const line of diffText.split('\n')) {
112
+ const trimmed = line.replace(/\r$/, '');
113
+ const gitHeader = /^diff --git (\S+) (\S+)\s*$/.exec(trimmed);
114
+ if (gitHeader) {
115
+ push(gitHeader[1]);
116
+ push(gitHeader[2]);
117
+ continue;
118
+ }
119
+ const minus = /^--- (.+)$/.exec(trimmed);
120
+ if (minus) {
121
+ push(minus[1]);
122
+ continue;
123
+ }
124
+ const plus = /^\+\+\+ (.+)$/.exec(trimmed);
125
+ if (plus)
126
+ push(plus[1]);
127
+ }
128
+ return paths;
129
+ }
130
+ /**
131
+ * Build a unique ephemeral worktree path under `os.tmpdir()` for a scenario.
132
+ * The random suffix keeps concurrent self-improve runs from colliding.
133
+ *
134
+ * @internal
135
+ */
136
+ function tempWorktreeDir(scenario) {
137
+ return join(tmpdir(), `cleo-selfimprove-${safeStem(scenario)}-${randomBytes(4).toString('hex')}`);
138
+ }
56
139
  /**
57
140
  * Open ONE DRAFT PR carrying a proposed self-improvement fix.
58
141
  *
59
142
  * DRY-RUN by default ({@link OpenDraftPrArgs.execute} falsey): returns the planned
60
143
  * `steps[]` (the `gh pr create` step ALWAYS carries `--draft`) WITHOUT touching
61
144
  * git/gh — so the loop is egress-side-effect-free unless `--execute` is threaded
62
- * through. The live path (`execute: true`) cuts the feature branch, applies the
63
- * diff, commits, pushes the FEATURE branch (NEVER `main`), and runs
64
- * `gh pr create --base main --head <branch> --draft`, returning the PR URL.
145
+ * through.
146
+ *
147
+ * The live path (`execute: true`) never mutates the invoking checkout (T12007).
148
+ * It cuts an EPHEMERAL transient worktree fresh off `origin/main`, applies the
149
+ * diff there, stages ONLY the paths the patch names (`git add -- <paths>` — NEVER
150
+ * `git add -A`), commits, pushes the FEATURE branch (NEVER `main`), runs
151
+ * `gh pr create --base main --head <branch> --draft`, and tears the worktree
152
+ * down in a `finally`. The orchestrator's untracked/uncommitted files are never
153
+ * staged, pushed, or deleted.
65
154
  *
66
155
  * NEVER pushes `main`, NEVER auto-merges, NEVER publishes — the only egress is a
67
156
  * draft PR against a feature branch.
@@ -73,7 +162,7 @@ export function draftPrBranchName(scenario, ts) {
73
162
  * ```ts
74
163
  * // dry-run (default): no side effects, steps include `--draft`
75
164
  * const plan = await openDraftPr({ scenario: 'x', diffPath: 'fix.patch', title, body });
76
- * // live: cuts branch + opens draft PR
165
+ * // live: cuts an isolated worktree + opens draft PR (invoking repo untouched)
77
166
  * const res = await openDraftPr({ scenario: 'x', diffPath: 'fix.patch', title, body, execute: true });
78
167
  * ```
79
168
  */
@@ -100,6 +189,16 @@ export async function openDraftPr(args) {
100
189
  message: `Patch file '${resolvedDiff}' is empty`,
101
190
  };
102
191
  }
192
+ // The authoritative "what may be staged" set. A patch that names no files is
193
+ // treated as empty — staging nothing would produce an empty PR.
194
+ const patchPaths = parseUnifiedDiffPaths(diffBytes);
195
+ if (patchPaths.length === 0) {
196
+ return {
197
+ kind: 'error',
198
+ code: 'E_PATCH_EMPTY',
199
+ message: `Patch file '${resolvedDiff}' names no files (no unified-diff headers)`,
200
+ };
201
+ }
103
202
  if (execute) {
104
203
  try {
105
204
  run('gh', ['--version']);
@@ -113,24 +212,50 @@ export async function openDraftPr(args) {
113
212
  }
114
213
  }
115
214
  const branchName = draftPrBranchName(args.scenario, isoNow);
215
+ const worktreePath = args.worktreeDir ?? tempWorktreeDir(args.scenario);
216
+ // Planned steps reflect the ISOLATED flow: every git mutation runs inside the
217
+ // ephemeral worktree (`<worktree>`), and staging is scoped to the patch paths.
116
218
  const steps = [
117
- `git checkout -b ${branchName}`,
118
- `git apply ${resolvedDiff}`,
119
- 'git add -A',
120
- `git commit -m "fix(selfimprove): ${args.scenario} regression"`,
121
- `git push -u origin ${branchName}`,
219
+ `git fetch origin ${base}`,
220
+ `# provision ephemeral worktree at ${worktreePath} off origin/${base} (via @cleocode/worktree)`,
221
+ `git -C <worktree> apply ${resolvedDiff}`,
222
+ `git -C <worktree> add -- ${patchPaths.join(' ')}`,
223
+ `git -C <worktree> commit -m "fix(selfimprove): ${args.scenario} regression"`,
224
+ `git -C <worktree> push -u origin ${branchName}`,
122
225
  `gh pr create --base ${base} --head ${branchName} --draft --title "${args.title}" --body <stdin>`,
226
+ '# remove ephemeral worktree (finally)',
123
227
  ];
124
228
  if (!execute) {
125
- return { kind: 'dry-run', scenario: args.scenario, branchName, steps };
229
+ return { kind: 'dry-run', scenario: args.scenario, branchName, steps, patchPaths };
126
230
  }
231
+ const provision = args.provisionWorktree ??
232
+ ((o) => addTransientWorktree({
233
+ projectRoot: o.projectRoot,
234
+ worktreePath: o.worktreePath,
235
+ branch: o.branch,
236
+ baseRef: o.baseRef,
237
+ resetBranch: true,
238
+ }));
239
+ const teardown = args.removeWorktree ?? ((projectRoot, p) => removeTransientWorktree(projectRoot, p));
127
240
  try {
128
- const prUrl = await withProvenance('pr-generator', () => {
129
- run('git', ['checkout', '-b', branchName]);
130
- run('git', ['apply', resolvedDiff]);
131
- run('git', ['add', '-A']);
132
- run('git', ['commit', '-m', `fix(selfimprove): ${args.scenario} regression`]);
133
- run('git', ['push', '-u', 'origin', branchName]);
241
+ // Freshen origin/<base> so the isolated worktree branches off the true tip.
242
+ run('git', ['fetch', 'origin', base], cwd);
243
+ // Provision the ephemeral worktree OFF origin/<base> — NEVER the invoking
244
+ // tree. All subsequent git mutations target `worktreePath`.
245
+ await provision({
246
+ projectRoot: cwd,
247
+ worktreePath,
248
+ branch: branchName,
249
+ baseRef: `origin/${base}`,
250
+ });
251
+ const prUrl = await withProvenance('pr-generator', async () => {
252
+ // Apply the patch INSIDE the isolated worktree (its working tree only).
253
+ run('git', ['apply', resolvedDiff], worktreePath);
254
+ // Stage ONLY the paths the patch names — never `git add -A`, never the
255
+ // invoking checkout. This is the crux of the T12007 fix.
256
+ run('git', ['add', '--', ...patchPaths], worktreePath);
257
+ run('git', ['commit', '-m', `fix(selfimprove): ${args.scenario} regression`], worktreePath);
258
+ run('git', ['push', '-u', 'origin', branchName], worktreePath);
134
259
  return run('gh', [
135
260
  'pr',
136
261
  'create',
@@ -143,9 +268,9 @@ export async function openDraftPr(args) {
143
268
  args.title,
144
269
  '--body',
145
270
  body,
146
- ]).trim();
271
+ ], worktreePath).trim();
147
272
  });
148
- return { kind: 'ok', scenario: args.scenario, branchName, prUrl };
273
+ return { kind: 'ok', scenario: args.scenario, branchName, prUrl, patchPaths };
149
274
  }
150
275
  catch (err) {
151
276
  return {
@@ -154,5 +279,21 @@ export async function openDraftPr(args) {
154
279
  message: `draft-pr failed: ${err instanceof Error ? err.message : String(err)}`,
155
280
  };
156
281
  }
282
+ finally {
283
+ // Best-effort teardown — the invoking checkout is never touched, only the
284
+ // ephemeral worktree registration + its tmpdir directory.
285
+ try {
286
+ await teardown(cwd, worktreePath);
287
+ }
288
+ catch {
289
+ /* best-effort */
290
+ }
291
+ try {
292
+ rmSync(worktreePath, { recursive: true, force: true });
293
+ }
294
+ catch {
295
+ /* best-effort */
296
+ }
297
+ }
157
298
  }
158
299
  //# sourceMappingURL=draft-pr.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"draft-pr.js","sourceRoot":"","sources":["../../src/selfimprove/draft-pr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,GAAG,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE;;;GAGG;AACH,MAAM,eAAe,GACnB,qEAA8E,CAAC;AAQjF,iFAAiF;AACjF,MAAM,UAAU,GAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAC/C,YAAY,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAmEpE;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAi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