@cleocode/core 2026.8.2 → 2026.8.3

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 (167) hide show
  1. package/dist/check/pr-gate.d.ts.map +1 -1
  2. package/dist/check/pr-gate.js +9 -0
  3. package/dist/check/pr-gate.js.map +1 -1
  4. package/dist/docs/export-document.js +66 -16
  5. package/dist/docs/export-document.js.map +3 -3
  6. package/dist/hooks/registry.d.ts +2 -2
  7. package/dist/hooks/registry.d.ts.map +1 -1
  8. package/dist/hooks/registry.js +5 -0
  9. package/dist/hooks/registry.js.map +1 -1
  10. package/dist/hooks/types.d.ts +59 -0
  11. package/dist/hooks/types.d.ts.map +1 -1
  12. package/dist/init/scaffold-workflows.d.ts +12 -0
  13. package/dist/init/scaffold-workflows.d.ts.map +1 -1
  14. package/dist/init/scaffold-workflows.js +16 -0
  15. package/dist/init/scaffold-workflows.js.map +1 -1
  16. package/dist/init/upgrade-workflows.d.ts.map +1 -1
  17. package/dist/init/upgrade-workflows.js +16 -0
  18. package/dist/init/upgrade-workflows.js.map +1 -1
  19. package/dist/init.d.ts.map +1 -1
  20. package/dist/init.js +16 -1
  21. package/dist/init.js.map +1 -1
  22. package/dist/internal.d.ts +1 -0
  23. package/dist/internal.d.ts.map +1 -1
  24. package/dist/internal.js +2 -0
  25. package/dist/internal.js.map +1 -1
  26. package/dist/llm/credentials.d.ts +16 -1
  27. package/dist/llm/credentials.d.ts.map +1 -1
  28. package/dist/llm/credentials.js.map +1 -1
  29. package/dist/llm/cross-provider-selector.d.ts +25 -0
  30. package/dist/llm/cross-provider-selector.d.ts.map +1 -1
  31. package/dist/llm/cross-provider-selector.js +76 -3
  32. package/dist/llm/cross-provider-selector.js.map +1 -1
  33. package/dist/llm/local-inference-probe.d.ts +101 -0
  34. package/dist/llm/local-inference-probe.d.ts.map +1 -0
  35. package/dist/llm/local-inference-probe.js +174 -0
  36. package/dist/llm/local-inference-probe.js.map +1 -0
  37. package/dist/llm/plugin-facade.js +199 -21
  38. package/dist/llm/plugin-facade.js.map +3 -3
  39. package/dist/llm/role-executor.d.ts.map +1 -1
  40. package/dist/llm/role-executor.js +95 -9
  41. package/dist/llm/role-executor.js.map +1 -1
  42. package/dist/llm/role-resolver.d.ts +10 -0
  43. package/dist/llm/role-resolver.d.ts.map +1 -1
  44. package/dist/llm/role-resolver.js +92 -1
  45. package/dist/llm/role-resolver.js.map +1 -1
  46. package/dist/llm/system-resolver.d.ts.map +1 -1
  47. package/dist/llm/system-resolver.js +2 -0
  48. package/dist/llm/system-resolver.js.map +1 -1
  49. package/dist/memory/brain-search.d.ts +109 -0
  50. package/dist/memory/brain-search.d.ts.map +1 -1
  51. package/dist/memory/brain-search.js +149 -37
  52. package/dist/memory/brain-search.js.map +1 -1
  53. package/dist/memory/brain-stub-prune.d.ts +109 -0
  54. package/dist/memory/brain-stub-prune.d.ts.map +1 -0
  55. package/dist/memory/brain-stub-prune.js +155 -0
  56. package/dist/memory/brain-stub-prune.js.map +1 -0
  57. package/dist/memory/engine-compat.d.ts.map +1 -1
  58. package/dist/memory/engine-compat.js +61 -3
  59. package/dist/memory/engine-compat.js.map +1 -1
  60. package/dist/nexus/analyze-orchestrator.d.ts.map +1 -1
  61. package/dist/nexus/analyze-orchestrator.js +28 -0
  62. package/dist/nexus/analyze-orchestrator.js.map +1 -1
  63. package/dist/nexus/context.d.ts.map +1 -1
  64. package/dist/nexus/context.js +3 -3
  65. package/dist/nexus/context.js.map +1 -1
  66. package/dist/nexus/impact.d.ts.map +1 -1
  67. package/dist/nexus/impact.js +3 -3
  68. package/dist/nexus/impact.js.map +1 -1
  69. package/dist/nexus/symbol-miss.d.ts +132 -0
  70. package/dist/nexus/symbol-miss.d.ts.map +1 -0
  71. package/dist/nexus/symbol-miss.js +168 -0
  72. package/dist/nexus/symbol-miss.js.map +1 -0
  73. package/dist/orchestrate/spawn-ops.d.ts +21 -1
  74. package/dist/orchestrate/spawn-ops.d.ts.map +1 -1
  75. package/dist/orchestrate/spawn-ops.js +39 -2
  76. package/dist/orchestrate/spawn-ops.js.map +1 -1
  77. package/dist/orchestrate/worker-verify.d.ts.map +1 -1
  78. package/dist/orchestrate/worker-verify.js +22 -0
  79. package/dist/orchestrate/worker-verify.js.map +1 -1
  80. package/dist/release/changesets-aggregator.d.ts.map +1 -1
  81. package/dist/release/changesets-aggregator.js +15 -1
  82. package/dist/release/changesets-aggregator.js.map +1 -1
  83. package/dist/release/open.d.ts +29 -2
  84. package/dist/release/open.d.ts.map +1 -1
  85. package/dist/release/open.js +48 -11
  86. package/dist/release/open.js.map +1 -1
  87. package/dist/resources/governor.d.ts +12 -2
  88. package/dist/resources/governor.d.ts.map +1 -1
  89. package/dist/resources/governor.js +12 -3
  90. package/dist/resources/governor.js.map +1 -1
  91. package/dist/scaffold/ensure-dirs.d.ts.map +1 -1
  92. package/dist/scaffold/ensure-dirs.js +14 -2
  93. package/dist/scaffold/ensure-dirs.js.map +1 -1
  94. package/dist/scaffold/project-detection.d.ts.map +1 -1
  95. package/dist/scaffold/project-detection.js +2 -1
  96. package/dist/scaffold/project-detection.js.map +1 -1
  97. package/dist/selfimprove/draft-pr.d.ts +14 -1
  98. package/dist/selfimprove/draft-pr.d.ts.map +1 -1
  99. package/dist/selfimprove/draft-pr.js.map +1 -1
  100. package/dist/selfimprove/fix-gen.d.ts +0 -21
  101. package/dist/selfimprove/fix-gen.d.ts.map +1 -1
  102. package/dist/selfimprove/fix-gen.js +276 -76
  103. package/dist/selfimprove/fix-gen.js.map +3 -3
  104. package/dist/selfimprove/run-loop.d.ts.map +1 -1
  105. package/dist/selfimprove/run-loop.js +50 -19
  106. package/dist/selfimprove/run-loop.js.map +1 -1
  107. package/dist/selfimprove/scenarios/dhq-replay-find/golden.json +114 -4
  108. package/dist/selfimprove/scenarios/dhq-replay-find/scenario.json +3 -3
  109. package/dist/sentient/dream-cycle.d.ts +20 -19
  110. package/dist/sentient/dream-cycle.d.ts.map +1 -1
  111. package/dist/sentient/dream-cycle.js +322 -11
  112. package/dist/sentient/dream-cycle.js.map +1 -1
  113. package/dist/sentient/dream-watermark.d.ts +134 -0
  114. package/dist/sentient/dream-watermark.d.ts.map +1 -0
  115. package/dist/sentient/dream-watermark.js +156 -0
  116. package/dist/sentient/dream-watermark.js.map +1 -0
  117. package/dist/sentient/state.d.ts +17 -0
  118. package/dist/sentient/state.d.ts.map +1 -1
  119. package/dist/sentient/state.js +22 -3
  120. package/dist/sentient/state.js.map +1 -1
  121. package/dist/sentient/tick.d.ts.map +1 -1
  122. package/dist/sentient/tick.js +79 -2
  123. package/dist/sentient/tick.js.map +1 -1
  124. package/dist/sessions/index.d.ts.map +1 -1
  125. package/dist/sessions/index.js +5 -1
  126. package/dist/sessions/index.js.map +1 -1
  127. package/dist/sessions/snapshot.d.ts.map +1 -1
  128. package/dist/sessions/snapshot.js +6 -3
  129. package/dist/sessions/snapshot.js.map +1 -1
  130. package/dist/store/checkpoint-git-dir.d.ts +95 -0
  131. package/dist/store/checkpoint-git-dir.d.ts.map +1 -0
  132. package/dist/store/checkpoint-git-dir.js +111 -0
  133. package/dist/store/checkpoint-git-dir.js.map +1 -0
  134. package/dist/store/git-checkpoint.d.ts.map +1 -1
  135. package/dist/store/git-checkpoint.js +6 -5
  136. package/dist/store/git-checkpoint.js.map +1 -1
  137. package/dist/system/health.d.ts.map +1 -1
  138. package/dist/system/health.js +2 -1
  139. package/dist/system/health.js.map +1 -1
  140. package/dist/tasks/add.d.ts.map +1 -1
  141. package/dist/tasks/add.js +40 -4
  142. package/dist/tasks/add.js.map +1 -1
  143. package/dist/tasks/collection.d.ts +51 -0
  144. package/dist/tasks/collection.d.ts.map +1 -0
  145. package/dist/tasks/collection.js +81 -0
  146. package/dist/tasks/collection.js.map +1 -0
  147. package/dist/tasks/complete.d.ts.map +1 -1
  148. package/dist/tasks/complete.js +8 -3
  149. package/dist/tasks/complete.js.map +1 -1
  150. package/dist/tasks/evidence.d.ts.map +1 -1
  151. package/dist/tasks/evidence.js +17 -0
  152. package/dist/tasks/evidence.js.map +1 -1
  153. package/dist/tasks/find.d.ts +50 -0
  154. package/dist/tasks/find.d.ts.map +1 -1
  155. package/dist/tasks/find.js +63 -2
  156. package/dist/tasks/find.js.map +1 -1
  157. package/dist/tasks/tool-resolver.d.ts +1 -1
  158. package/dist/tasks/tool-resolver.d.ts.map +1 -1
  159. package/dist/tasks/tool-resolver.js +83 -0
  160. package/dist/tasks/tool-resolver.js.map +1 -1
  161. package/dist/tasks/tool-semaphore.d.ts +82 -12
  162. package/dist/tasks/tool-semaphore.d.ts.map +1 -1
  163. package/dist/tasks/tool-semaphore.js +79 -17
  164. package/dist/tasks/tool-semaphore.js.map +1 -1
  165. package/package.json +13 -13
  166. package/templates/CLEO-INJECTION.md +40 -25
  167. package/templates/workflows/release-prepare.yml.tmpl +73 -16
@@ -127,7 +127,7 @@ CLEO has **three distinct relationship systems**. Do not conflate them.
127
127
  |------|---------|
128
128
  | Check session | `cleo session status` |
129
129
  | Resume context | `cleo briefing` |
130
- | Start session | `cleo session start --scope global` |
130
+ | Start session | `cleo session start --scope global --name "<what you are doing>"` (both flags are REQUIRED) |
131
131
  | End session | `cleo session end --note "..."` |
132
132
  <!-- /CLEO-INJECTION:section=session-commands -->
133
133
 
@@ -151,29 +151,44 @@ Memory context: `cleo memory digest --brief` gives a live project memory summary
151
151
  <!-- CLEO-INJECTION:section=nexus -->
152
152
  ## Nexus — when to use which scope
153
153
 
154
- `cleo nexus` is the code-intelligence surface. It has **5 scopes**. Pick by intent, not name.
155
-
156
- | Intent | Scope | First-reach command |
157
- |---------------------------------------------|----------------|-----------------------------------------|
158
- | Edit/refactor *this* repo safely | `project` | `cleo nexus impact <symbol>` |
159
- | Explore *this* repo by concept or symbol | `project` | `cleo nexus query` / `context` |
160
- | One-shot machine-readable repo snapshot | `project` | `cleo nexus report` (LAFS JSON) |
161
- | Recall what the agent knows across sessions | `living-brain` | `cleo nexus brain find "<q>"` |
162
- | Compare or share patterns across repos | `cross-project`| `cleo nexus compare` / `shared` |
163
- | Blend code + memory + cross-repo | `hybrid` | `cleo nexus synthesize <topic>` |
164
- | Index health / reindex / purge | `global-infra` | `cleo nexus admin <status|analyze|clean>` |
165
-
166
- **Project resolution** (project + hybrid scopes only):
167
- `--project-id` > `--path` > `cwd`. Default ID = `base64url(path).slice(0,32)`.
168
-
169
- **Every nexus envelope returns**:
170
- - `meta.scope` — confirms which scope answered
171
- - `meta.projectId` — confirms which project (if applicable)
172
- - `meta.suggestedNext: string[]` — chained-reasoning hints (use these before re-discovering)
173
-
174
- **Rule**: BEFORE editing any symbol, run `cleo nexus impact <symbol>`. HIGH/CRITICAL = stop and warn.
175
-
176
- **Skip the help dump**: `cleo nexus report` answers most agent project-questions in one call.
154
+ `cleo nexus` is the code-intelligence surface over THIS repo's symbol graph.
155
+ Pick by intent. Every command below is verified to exist — see the gate note.
156
+
157
+ | Intent | Command |
158
+ |-------------------------------------------|----------------------------------|
159
+ | **Check the index before trusting it** | `cleo nexus status` |
160
+ | Blast radius before editing a symbol | `cleo nexus impact <symbol>` |
161
+ | Callers / callees / community of a symbol | `cleo nexus context <symbol>` |
162
+ | Everything about one symbol in one call | `cleo nexus full-context <symbol>` |
163
+ | Find a symbol by code text | `cleo nexus search-code "<text>"` |
164
+ | Symbols touched by a task | `cleo nexus task-symbols <taskId>` |
165
+ | Why does this symbol exist / who needs it | `cleo nexus why <symbol>` |
166
+ | Detected communities / execution flows | `cleo nexus clusters` / `flows` |
167
+ | Rebuild the index | `cleo nexus analyze` |
168
+
169
+ **FIRST CALL IS `cleo nexus status`.** It returns `nodeCount`, `lastIndexedAt`
170
+ and `staleFileCount`. The index is NOT auto-refreshed — a symbol added after
171
+ the last `analyze` run is simply absent, and a lookup for it returns
172
+ `E_NOT_FOUND` that reads identically to "no such symbol". If `staleFileCount`
173
+ is a large fraction of `fileCount`, run `cleo nexus analyze` or treat
174
+ `git grep` as the ground truth and SAY SO in your response.
175
+
176
+ `E_NOT_FOUND` from `impact`/`context` now reports the index size, its median
177
+ entry age, and the repair command. Read it — do not infer that nexus is broken.
178
+
179
+ **Project resolution**: `--project-id` > `--path` > `cwd`.
180
+ Default ID = `base64url(path).slice(0,32)`.
181
+
182
+ **Rule**: BEFORE editing any symbol, run `cleo nexus impact <symbol>`.
183
+ HIGH/CRITICAL = stop and warn. If the index is stale, say that instead of
184
+ silently substituting `git grep`.
185
+
186
+ > Commands named here are asserted against the live CLI by
187
+ > `scripts/lint-injection-commands.mjs` (T12069). Five commands previously
188
+ > listed in this section — `nexus report`, `nexus brain find`, `nexus compare`,
189
+ > `nexus shared`, `nexus synthesize`, plus `nexus admin` — never existed; the
190
+ > gate exists so a protocol that every agent is told to follow can no longer
191
+ > drift from the binary.
177
192
  <!-- /CLEO-INJECTION:section=nexus -->
178
193
 
179
194
  <!-- CLEO-INJECTION:section=orchestration -->
@@ -372,7 +387,7 @@ Every spawn prompt contains these required sections — orchestrators can progra
372
387
  ## Rules
373
388
 
374
389
  - No time estimates — use `small`, `medium`, `large` sizing
375
- - Token budget: avoid `cleo list` without `--parent`, avoid `cleo help --tier 2` before tier 0
390
+ - Token budget: avoid `cleo list` without `--parent`; get usage from `cleo <command> --help` (there is no top-level help command)
376
391
  - Do not read full task details for tasks you won't work on
377
392
  <!-- /CLEO-INJECTION:section=rules -->
378
393
 
@@ -40,6 +40,10 @@ on:
40
40
  description: 'Epic task ID (e.g. T9999) used by `cleo release plan`'
41
41
  type: string
42
42
  required: false
43
+ tasks:
44
+ description: 'Comma-separated task IDs (e.g. T101,T102) used by `cleo release plan` when the release is task-scoped rather than epic-scoped'
45
+ type: string
46
+ required: false
43
47
  channel:
44
48
  description: 'Release channel'
45
49
  type: choice
@@ -310,11 +314,24 @@ jobs:
310
314
  PLAN_FILE=".cleo/release/${{ inputs.version }}.plan.json"
311
315
  if [ -z "${{ inputs.plan-blob-sha256 }}" ]; then
312
316
  echo "No plan-blob-sha256 input — generating fresh plan."
313
- EPIC_ARGS=()
317
+ # T12089: `cleo release plan` REQUIRES a scope (--saga | --epic |
318
+ # --tasks). This branch previously passed none whenever `epic` was
319
+ # empty, so `plan` exited 2 and every release died here at
320
+ # "Prepare bump-PR" — after a full green preflight. Forward whichever
321
+ # scope the dispatcher supplied, and if none was, say so plainly
322
+ # instead of surfacing an argparse error from a nested command.
323
+ SCOPE_ARGS=()
314
324
  if [ -n "${{ inputs.epic }}" ]; then
315
- EPIC_ARGS=(--epic "${{ inputs.epic }}")
325
+ SCOPE_ARGS+=(--epic "${{ inputs.epic }}")
316
326
  fi
317
- cleo release plan "${{ inputs.version }}" "${EPIC_ARGS[@]}" --json > "$PLAN_FILE"
327
+ if [ -n "${{ inputs.tasks }}" ]; then
328
+ SCOPE_ARGS+=(--tasks "${{ inputs.tasks }}")
329
+ fi
330
+ if [ ${#SCOPE_ARGS[@]} -eq 0 ]; then
331
+ echo "::error::No release scope supplied. Dispatch with 'epic' or 'tasks' (cleo release plan requires --saga, --epic or --tasks), or pass plan-blob-sha256 with a committed plan file."
332
+ exit 1
333
+ fi
334
+ cleo release plan "${{ inputs.version }}" "${SCOPE_ARGS[@]}" --json > "$PLAN_FILE"
318
335
  else
319
336
  echo "Verifying pre-computed plan against sha256=${{ inputs.plan-blob-sha256 }}"
320
337
  if [ ! -f "$PLAN_FILE" ]; then
@@ -330,27 +347,46 @@ jobs:
330
347
  echo "plan_file=$PLAN_FILE" >> "$GITHUB_OUTPUT"
331
348
  timeout-minutes: 5
332
349
 
333
- # R-205(c): bump version files via `cleo version-bump`.
350
+ # R-205(c): bump every package manifest to the release version.
351
+ #
352
+ # T12093: this step used to run `cleo version-bump`, a command that has
353
+ # NEVER existed — the verb is absent from the CLI manifest, so the step
354
+ # died with `Unknown command version-bump` (exit 127) on every dispatch,
355
+ # always AFTER a full green preflight (~20 min). Version bumping is
356
+ # project-shaped (single package vs workspace), so it is a placeholder:
357
+ # override with `versionBumpCmd` in `.cleo/release-config.json`.
334
358
  - name: Bump version
335
- run: cleo version-bump --version "${{ inputs.version }}"
359
+ run: |
360
+ VERSION="${{ inputs.version }}"
361
+ {{VERSION_BUMP_CMD}}
336
362
  timeout-minutes: 3
337
363
 
338
- # R-205(d): regenerate CHANGELOG via the preserved `cleo release
339
- # changelog` primitive, scoped to commits since the previous tag.
340
- - name: Regenerate CHANGELOG
341
- run: |
342
- PREV_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
343
- if [ -n "$PREV_TAG" ]; then
344
- cleo release changelog --since "$PREV_TAG"
345
- else
346
- cleo release changelog
347
- fi
364
+ # R-205(d): CHANGELOG.md.
365
+ #
366
+ # T12093: this step used to run `cleo release changelog`, which also does
367
+ # not exist (`cleo release` has no `changelog` sub-verb). CHANGELOG.md is
368
+ # written by `cleo release plan` itself (T9838), so there is nothing to
369
+ # regenerate here — the correct action is to VERIFY the section is present
370
+ # and fail loudly if it is not, rather than silently ship a release whose
371
+ # notes were never written.
372
+ - name: Verify CHANGELOG section
373
+ run: cleo release validate-changelog "${{ inputs.version }}"
348
374
  timeout-minutes: 3
349
375
 
350
376
  # R-205(e): commit with the canonical subject line.
377
+ #
378
+ # T12093: `git commit` exits 1 on an empty index, so an already-prepared
379
+ # version failed here with a bare "nothing to commit" and no explanation.
380
+ # An empty prepare cannot become a PR either (`gh pr create` rejects a head
381
+ # with no commits ahead of base), so say what state the repo is in and what
382
+ # to do next instead of pushing a branch that cannot open.
351
383
  - name: Commit prepare
352
384
  run: |
353
385
  git add -A
386
+ if git diff --cached --quiet; then
387
+ echo "::error::Nothing to commit — every package.json and CHANGELOG.md already match ${{ inputs.version }} on main. This release is already prepared; tag it directly (git tag -a ${{ inputs.version }} && git push origin ${{ inputs.version }}) instead of re-running prepare."
388
+ exit 1
389
+ fi
354
390
  git commit -m "release: prepare ${{ inputs.version }}"
355
391
  timeout-minutes: 2
356
392
 
@@ -362,6 +398,27 @@ jobs:
362
398
  timeout-minutes: 5
363
399
 
364
400
  # R-205(f): open the bump-PR via `gh pr create`.
401
+ #
402
+ # T12093: the body was `--body-file <plan>.json`, so every bump-PR opened
403
+ # with a raw schema envelope as its description. The plan already carries
404
+ # the rendered notes at `meta.releaseNotes` (the same text that lands in
405
+ # CHANGELOG.md) — use that, and fall back to the JSON only if absent.
406
+ - name: Render PR body
407
+ id: body
408
+ run: |
409
+ node -e '
410
+ const fs = require("node:fs");
411
+ const plan = JSON.parse(fs.readFileSync(process.argv[1], "utf8"));
412
+ const notes = plan?.meta?.releaseNotes;
413
+ fs.writeFileSync(
414
+ "/tmp/bump-pr-body.md",
415
+ typeof notes === "string" && notes.trim().length > 0
416
+ ? notes
417
+ : "```json\n" + JSON.stringify(plan, null, 2) + "\n```\n",
418
+ );
419
+ ' "${{ steps.plan.outputs.plan_file }}"
420
+ timeout-minutes: 2
421
+
365
422
  - name: Open bump-PR
366
423
  run: |
367
424
  gh pr create \
@@ -369,7 +426,7 @@ jobs:
369
426
  --head "${{ steps.branch.outputs.name }}" \
370
427
  --title "release: prepare ${{ inputs.version }}" \
371
428
  --label "{{PR_LABEL}}" \
372
- --body-file "${{ steps.plan.outputs.plan_file }}"
429
+ --body-file /tmp/bump-pr-body.md
373
430
  timeout-minutes: 5
374
431
 
375
432
  # R-209(c): emit recovery hint into the job summary artifact.