@cleocode/core 2026.9.16 → 2026.9.18

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 (236) hide show
  1. package/dist/changesets/parser.d.ts.map +1 -1
  2. package/dist/changesets/parser.js +67 -0
  3. package/dist/changesets/parser.js.map +1 -1
  4. package/dist/crypto/credentials.d.ts +128 -26
  5. package/dist/crypto/credentials.d.ts.map +1 -1
  6. package/dist/crypto/credentials.js +183 -142
  7. package/dist/crypto/credentials.js.map +1 -1
  8. package/dist/docs/export-document.js +14705 -12949
  9. package/dist/docs/export-document.js.map +3 -3
  10. package/dist/doctor/index.d.ts +1 -1
  11. package/dist/doctor/index.d.ts.map +1 -1
  12. package/dist/doctor/index.js +1 -1
  13. package/dist/doctor/index.js.map +1 -1
  14. package/dist/doctor/nexus-schema-residency.d.ts +1 -1
  15. package/dist/doctor/nexus-schema-residency.d.ts.map +1 -1
  16. package/dist/doctor/nexus-schema-residency.js +1 -0
  17. package/dist/doctor/nexus-schema-residency.js.map +1 -1
  18. package/dist/doctor/project-identity.d.ts +124 -0
  19. package/dist/doctor/project-identity.d.ts.map +1 -0
  20. package/dist/doctor/project-identity.js +307 -0
  21. package/dist/doctor/project-identity.js.map +1 -0
  22. package/dist/doctor/superseded-store.d.ts +8 -0
  23. package/dist/doctor/superseded-store.d.ts.map +1 -1
  24. package/dist/doctor/superseded-store.js +48 -3
  25. package/dist/doctor/superseded-store.js.map +1 -1
  26. package/dist/init.d.ts +7 -0
  27. package/dist/init.d.ts.map +1 -1
  28. package/dist/init.js +17 -2
  29. package/dist/init.js.map +1 -1
  30. package/dist/internal.d.ts +6 -3
  31. package/dist/internal.d.ts.map +1 -1
  32. package/dist/internal.js +4 -2
  33. package/dist/internal.js.map +1 -1
  34. package/dist/llm/credentials-store.d.ts +10 -0
  35. package/dist/llm/credentials-store.d.ts.map +1 -1
  36. package/dist/llm/credentials-store.js +7 -1
  37. package/dist/llm/credentials-store.js.map +1 -1
  38. package/dist/llm/plugin-facade.js +13368 -1550
  39. package/dist/llm/plugin-facade.js.map +3 -3
  40. package/dist/nexus/analyze-orchestrator.d.ts +20 -3
  41. package/dist/nexus/analyze-orchestrator.d.ts.map +1 -1
  42. package/dist/nexus/analyze-orchestrator.js +210 -16
  43. package/dist/nexus/analyze-orchestrator.js.map +1 -1
  44. package/dist/nexus/assessment-store.d.ts +86 -0
  45. package/dist/nexus/assessment-store.d.ts.map +1 -0
  46. package/dist/nexus/assessment-store.js +113 -0
  47. package/dist/nexus/assessment-store.js.map +1 -0
  48. package/dist/nexus/freshness.d.ts +131 -0
  49. package/dist/nexus/freshness.d.ts.map +1 -0
  50. package/dist/nexus/freshness.js +391 -0
  51. package/dist/nexus/freshness.js.map +1 -0
  52. package/dist/nexus/graph-manifest.d.ts +88 -0
  53. package/dist/nexus/graph-manifest.d.ts.map +1 -0
  54. package/dist/nexus/graph-manifest.js +114 -0
  55. package/dist/nexus/graph-manifest.js.map +1 -0
  56. package/dist/nexus/knowledge.d.ts +21 -1
  57. package/dist/nexus/knowledge.d.ts.map +1 -1
  58. package/dist/nexus/knowledge.js +74 -37
  59. package/dist/nexus/knowledge.js.map +1 -1
  60. package/dist/nexus/path-map.d.ts +55 -0
  61. package/dist/nexus/path-map.d.ts.map +1 -0
  62. package/dist/nexus/path-map.js +87 -0
  63. package/dist/nexus/path-map.js.map +1 -0
  64. package/dist/nexus/projects-clean.d.ts +21 -28
  65. package/dist/nexus/projects-clean.d.ts.map +1 -1
  66. package/dist/nexus/projects-clean.js +168 -85
  67. package/dist/nexus/projects-clean.js.map +1 -1
  68. package/dist/nexus/query.d.ts.map +1 -1
  69. package/dist/nexus/query.js +3 -2
  70. package/dist/nexus/query.js.map +1 -1
  71. package/dist/nexus/registry-hygiene.d.ts +70 -0
  72. package/dist/nexus/registry-hygiene.d.ts.map +1 -0
  73. package/dist/nexus/registry-hygiene.js +113 -0
  74. package/dist/nexus/registry-hygiene.js.map +1 -0
  75. package/dist/nexus/registry.d.ts +2 -2
  76. package/dist/nexus/registry.d.ts.map +1 -1
  77. package/dist/nexus/registry.js +48 -12
  78. package/dist/nexus/registry.js.map +1 -1
  79. package/dist/paths.d.ts +26 -0
  80. package/dist/paths.d.ts.map +1 -1
  81. package/dist/paths.js +99 -6
  82. package/dist/paths.js.map +1 -1
  83. package/dist/release/index.d.ts +1 -1
  84. package/dist/release/index.d.ts.map +1 -1
  85. package/dist/release/index.js.map +1 -1
  86. package/dist/release/plan.d.ts +84 -2
  87. package/dist/release/plan.d.ts.map +1 -1
  88. package/dist/release/plan.js +61 -14
  89. package/dist/release/plan.js.map +1 -1
  90. package/dist/release/pr-evidence.d.ts +81 -1
  91. package/dist/release/pr-evidence.d.ts.map +1 -1
  92. package/dist/release/pr-evidence.js +149 -9
  93. package/dist/release/pr-evidence.js.map +1 -1
  94. package/dist/render/nexus/graph/index.d.ts.map +1 -1
  95. package/dist/render/nexus/graph/index.js +8 -0
  96. package/dist/render/nexus/graph/index.js.map +1 -1
  97. package/dist/scaffold/ensure-config.d.ts +12 -3
  98. package/dist/scaffold/ensure-config.d.ts.map +1 -1
  99. package/dist/scaffold/ensure-config.js +61 -38
  100. package/dist/scaffold/ensure-config.js.map +1 -1
  101. package/dist/scaffold/project-identity.d.ts +136 -0
  102. package/dist/scaffold/project-identity.d.ts.map +1 -0
  103. package/dist/scaffold/project-identity.js +225 -0
  104. package/dist/scaffold/project-identity.js.map +1 -0
  105. package/dist/selfimprove/fix-gen.js +13319 -1556
  106. package/dist/selfimprove/fix-gen.js.map +3 -3
  107. package/dist/store/agent-api-key.d.ts +114 -0
  108. package/dist/store/agent-api-key.d.ts.map +1 -0
  109. package/dist/store/agent-api-key.js +136 -0
  110. package/dist/store/agent-api-key.js.map +1 -0
  111. package/dist/store/agent-registry-accessor.d.ts +4 -2
  112. package/dist/store/agent-registry-accessor.d.ts.map +1 -1
  113. package/dist/store/agent-registry-accessor.js +39 -89
  114. package/dist/store/agent-registry-accessor.js.map +1 -1
  115. package/dist/store/api-key-kdf.d.ts +7 -0
  116. package/dist/store/api-key-kdf.d.ts.map +1 -1
  117. package/dist/store/api-key-kdf.js +7 -0
  118. package/dist/store/api-key-kdf.js.map +1 -1
  119. package/dist/store/backup-crypto.d.ts +49 -0
  120. package/dist/store/backup-crypto.d.ts.map +1 -1
  121. package/dist/store/backup-crypto.js +154 -0
  122. package/dist/store/backup-crypto.js.map +1 -1
  123. package/dist/store/credential-transfer.d.ts +303 -0
  124. package/dist/store/credential-transfer.d.ts.map +1 -0
  125. package/dist/store/credential-transfer.js +774 -0
  126. package/dist/store/credential-transfer.js.map +1 -0
  127. package/dist/store/exodus/column-transforms.d.ts +79 -4
  128. package/dist/store/exodus/column-transforms.d.ts.map +1 -1
  129. package/dist/store/exodus/column-transforms.js +121 -4
  130. package/dist/store/exodus/column-transforms.js.map +1 -1
  131. package/dist/store/exodus/index.d.ts +1 -0
  132. package/dist/store/exodus/index.d.ts.map +1 -1
  133. package/dist/store/exodus/index.js +1 -0
  134. package/dist/store/exodus/index.js.map +1 -1
  135. package/dist/store/exodus/migrate.d.ts +17 -1
  136. package/dist/store/exodus/migrate.d.ts.map +1 -1
  137. package/dist/store/exodus/migrate.js +155 -33
  138. package/dist/store/exodus/migrate.js.map +1 -1
  139. package/dist/store/exodus/on-open.d.ts +14 -0
  140. package/dist/store/exodus/on-open.d.ts.map +1 -1
  141. package/dist/store/exodus/on-open.js +115 -6
  142. package/dist/store/exodus/on-open.js.map +1 -1
  143. package/dist/store/exodus/reconcile.d.ts +103 -0
  144. package/dist/store/exodus/reconcile.d.ts.map +1 -0
  145. package/dist/store/exodus/reconcile.js +728 -0
  146. package/dist/store/exodus/reconcile.js.map +1 -0
  147. package/dist/store/exodus/recovery.d.ts.map +1 -1
  148. package/dist/store/exodus/recovery.js +14 -2
  149. package/dist/store/exodus/recovery.js.map +1 -1
  150. package/dist/store/exodus/runtime-targets.d.ts +39 -0
  151. package/dist/store/exodus/runtime-targets.d.ts.map +1 -0
  152. package/dist/store/exodus/runtime-targets.js +63 -0
  153. package/dist/store/exodus/runtime-targets.js.map +1 -0
  154. package/dist/store/exodus/table-name-map.d.ts.map +1 -1
  155. package/dist/store/exodus/table-name-map.js +5 -0
  156. package/dist/store/exodus/table-name-map.js.map +1 -1
  157. package/dist/store/exodus/table-order.d.ts +35 -0
  158. package/dist/store/exodus/table-order.d.ts.map +1 -0
  159. package/dist/store/exodus/table-order.js +62 -0
  160. package/dist/store/exodus/table-order.js.map +1 -0
  161. package/dist/store/exodus/verify-migration.d.ts +4 -1
  162. package/dist/store/exodus/verify-migration.d.ts.map +1 -1
  163. package/dist/store/exodus/verify-migration.js +142 -10
  164. package/dist/store/exodus/verify-migration.js.map +1 -1
  165. package/dist/store/global-salt.d.ts +16 -0
  166. package/dist/store/global-salt.d.ts.map +1 -1
  167. package/dist/store/global-salt.js +22 -7
  168. package/dist/store/global-salt.js.map +1 -1
  169. package/dist/store/legacy-tasks-lineage.d.ts +86 -0
  170. package/dist/store/legacy-tasks-lineage.d.ts.map +1 -0
  171. package/dist/store/legacy-tasks-lineage.js +285 -0
  172. package/dist/store/legacy-tasks-lineage.js.map +1 -0
  173. package/dist/store/migration-manager.d.ts +27 -0
  174. package/dist/store/migration-manager.d.ts.map +1 -1
  175. package/dist/store/migration-manager.js +63 -0
  176. package/dist/store/migration-manager.js.map +1 -1
  177. package/dist/store/portable-bundle-import.d.ts +117 -0
  178. package/dist/store/portable-bundle-import.d.ts.map +1 -0
  179. package/dist/store/portable-bundle-import.js +589 -0
  180. package/dist/store/portable-bundle-import.js.map +1 -0
  181. package/dist/store/portable-bundle-relocate.d.ts +66 -0
  182. package/dist/store/portable-bundle-relocate.d.ts.map +1 -0
  183. package/dist/store/portable-bundle-relocate.js +304 -0
  184. package/dist/store/portable-bundle-relocate.js.map +1 -0
  185. package/dist/store/portable-bundle-scan.d.ts +167 -0
  186. package/dist/store/portable-bundle-scan.d.ts.map +1 -0
  187. package/dist/store/portable-bundle-scan.js +569 -0
  188. package/dist/store/portable-bundle-scan.js.map +1 -0
  189. package/dist/store/portable-bundle.d.ts +146 -0
  190. package/dist/store/portable-bundle.d.ts.map +1 -0
  191. package/dist/store/portable-bundle.js +674 -0
  192. package/dist/store/portable-bundle.js.map +1 -0
  193. package/dist/store/regenerators.d.ts +3 -1
  194. package/dist/store/regenerators.d.ts.map +1 -1
  195. package/dist/store/regenerators.js +6 -2
  196. package/dist/store/regenerators.js.map +1 -1
  197. package/dist/store/schema/cleo-global/nexus.d.ts +98 -0
  198. package/dist/store/schema/cleo-global/nexus.d.ts.map +1 -1
  199. package/dist/store/schema/cleo-global/nexus.js +19 -0
  200. package/dist/store/schema/cleo-global/nexus.js.map +1 -1
  201. package/dist/store/schema/nexus-schema.d.ts +102 -0
  202. package/dist/store/schema/nexus-schema.d.ts.map +1 -1
  203. package/dist/store/schema/nexus-schema.js +24 -0
  204. package/dist/store/schema/nexus-schema.js.map +1 -1
  205. package/dist/store/split-brain-import.d.ts +176 -0
  206. package/dist/store/split-brain-import.d.ts.map +1 -0
  207. package/dist/store/split-brain-import.js +680 -0
  208. package/dist/store/split-brain-import.js.map +1 -0
  209. package/dist/store/sqlite.d.ts +29 -0
  210. package/dist/store/sqlite.d.ts.map +1 -1
  211. package/dist/store/sqlite.js +57 -5
  212. package/dist/store/sqlite.js.map +1 -1
  213. package/dist/system/health.d.ts.map +1 -1
  214. package/dist/system/health.js +30 -5
  215. package/dist/system/health.js.map +1 -1
  216. package/dist/tasks/complete.d.ts.map +1 -1
  217. package/dist/tasks/complete.js +5 -27
  218. package/dist/tasks/complete.js.map +1 -1
  219. package/dist/tasks/evidence.js +1 -1
  220. package/dist/tasks/evidence.js.map +1 -1
  221. package/dist/tasks/verification-policy.d.ts +55 -0
  222. package/dist/tasks/verification-policy.d.ts.map +1 -0
  223. package/dist/tasks/verification-policy.js +75 -0
  224. package/dist/tasks/verification-policy.js.map +1 -0
  225. package/dist/upgrade.d.ts.map +1 -1
  226. package/dist/upgrade.js +60 -0
  227. package/dist/upgrade.js.map +1 -1
  228. package/dist/validation/doctor/checks.d.ts +14 -0
  229. package/dist/validation/doctor/checks.d.ts.map +1 -1
  230. package/dist/validation/doctor/checks.js +33 -0
  231. package/dist/validation/doctor/checks.js.map +1 -1
  232. package/migrations/drizzle-cleo-global/20260924000000_t12354-project-paths/migration.sql +40 -0
  233. package/migrations/drizzle-nexus/20260924000000_t12315-nexus-parse-cache/migration.sql +21 -0
  234. package/package.json +13 -13
  235. package/templates/CLEO-INJECTION.md +3 -3
  236. package/templates/cleo-gitignore +7 -0
@@ -0,0 +1,21 @@
1
+ -- T12315: per-file extraction memo for exact incremental code-graph indexing.
2
+ --
3
+ -- Cross-file resolution needs every file's extraction (raw call sites, access
4
+ -- sites, re-export records, import bindings), most of which is never stored in
5
+ -- `nexus_nodes` / `nexus_relations`. Rather than approximate those facts from
6
+ -- published rows, the pipeline persists each file's extraction here, keyed by
7
+ -- path and valid only for the exact bytes (`content_hash`) and extractor build
8
+ -- (`fingerprint`) that produced it. `generation` names the publication
9
+ -- generation embedded in the payload's anonymous identities so reuse can
10
+ -- rebind it. Rows are replaced in the same transaction as the graph they
11
+ -- describe (`publishNexusGraph`), so the cache never outlives or precedes its
12
+ -- generation.
13
+ --
14
+ -- Underscore-prefixed like `_nexus_meta`: pipeline bookkeeping, not graph data.
15
+ CREATE TABLE IF NOT EXISTS _nexus_parse_cache (
16
+ path TEXT PRIMARY KEY NOT NULL,
17
+ content_hash TEXT NOT NULL,
18
+ fingerprint TEXT NOT NULL,
19
+ generation TEXT NOT NULL,
20
+ payload BLOB NOT NULL
21
+ );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleocode/core",
3
- "version": "2026.9.16",
3
+ "version": "2026.9.18",
4
4
  "description": "CLEO core business logic kernel — tasks, sessions, memory, orchestration, lifecycle, with bundled SQLite store",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -471,16 +471,16 @@
471
471
  "write-file-atomic": "^7.0.1",
472
472
  "yaml": "^2.8.3",
473
473
  "zod": "^4.3.6",
474
- "@cleocode/adapters": "2026.9.16",
475
- "@cleocode/agents": "2026.9.16",
476
- "@cleocode/caamp": "2026.9.16",
477
- "@cleocode/contracts": "2026.9.16",
478
- "@cleocode/git-shim": "2026.9.16",
479
- "@cleocode/lafs": "2026.9.16",
480
- "@cleocode/nexus": "2026.9.16",
481
- "@cleocode/paths": "2026.9.16",
482
- "@cleocode/skills": "2026.9.16",
483
- "@cleocode/worktree": "2026.9.16"
474
+ "@cleocode/adapters": "2026.9.18",
475
+ "@cleocode/caamp": "2026.9.18",
476
+ "@cleocode/contracts": "2026.9.18",
477
+ "@cleocode/agents": "2026.9.18",
478
+ "@cleocode/git-shim": "2026.9.18",
479
+ "@cleocode/lafs": "2026.9.18",
480
+ "@cleocode/nexus": "2026.9.18",
481
+ "@cleocode/paths": "2026.9.18",
482
+ "@cleocode/worktree": "2026.9.18",
483
+ "@cleocode/skills": "2026.9.18"
484
484
  },
485
485
  "engines": {
486
486
  "node": ">=24.16.0"
@@ -506,7 +506,7 @@
506
506
  "@types/proper-lockfile": "^4.1.4",
507
507
  "@types/tar": "^6.1.13",
508
508
  "@types/write-file-atomic": "^4.0.3",
509
- "@cleocode/utils": "2026.9.16"
509
+ "@cleocode/utils": "2026.9.18"
510
510
  },
511
511
  "repository": {
512
512
  "type": "git",
@@ -515,7 +515,7 @@
515
515
  },
516
516
  "optionalDependencies": {
517
517
  "llmtxt": "^2026.5.15",
518
- "@cleocode/studio": "^2026.9.16"
518
+ "@cleocode/studio": "^2026.9.18"
519
519
  },
520
520
  "scripts": {
521
521
  "build": "tsc && node scripts/copy-selfimprove-fixtures.mjs",
@@ -1,6 +1,6 @@
1
1
  # CLEO Protocol
2
2
 
3
- Version: 2.20.5 | CLI-only dispatch | `cleo <command> [args]`
3
+ Version: 2.20.6 | CLI-only dispatch | `cleo <command> [args]`
4
4
 
5
5
  <!-- CLEO-INJECTION:section=session-start -->
6
6
  ## Universal protocol
@@ -194,9 +194,9 @@ Small legacy DBs beside large snapshots do not prove corruption. `cleo doctor su
194
194
  | Symbols touched by a task | `cleo nexus task-symbols <taskId>` |
195
195
  | Why does this symbol exist / who needs it | `cleo nexus why <symbol>` |
196
196
  | Detected communities / execution flows | `cleo nexus clusters` / `flows` |
197
- | Rebuild the index | `cleo nexus analyze` |
197
+ | Refresh the index | `cleo nexus analyze` |
198
198
 
199
- **FIRST CALL IS `cleo nexus status`.** Check `nodeCount`, `lastIndexedAt`, `staleFileCount`/`fileCount`. No auto-refresh: newer symbols may return `E_NOT_FOUND`. For stale coverage, run `cleo nexus analyze` or inspect source with `git grep` and disclose that basis. Impact/context `E_NOT_FOUND` includes index size, median age and a repair command; inspect these first.
199
+ **FIRST CALL IS `cleo nexus status`.** Check `nodeCount`, `lastIndexedAt`, `staleFileCount`/`fileCount`. Queries report `_nexus.freshness` and auto-refresh ≤25 stale files; beyond that they warn `W_NEXUS_INDEX_STALE`. `analyze` is incremental (`--full` rebuilds). For stale coverage, refresh or inspect source with `git grep` and disclose that basis. Impact/context `E_NOT_FOUND` includes index size, median age and a repair command; inspect these first.
200
200
 
201
201
  **Project resolution**: `--project-id` > `--path` > `cwd`.
202
202
  Default ID = `base64url(path).slice(0,32)`.
@@ -19,6 +19,11 @@
19
19
  # parent-repo ignore rules, this file must NOT re-include those four
20
20
  # files — doing so would unignore them at the project repository level
21
21
  # and re-open the T5158 data-loss vector.
22
+ #
23
+ # ADR-094 (amends ADR-013 §9, 2026-09-24, T12325): `project-id` IS tracked. It holds
24
+ # the write-once portable project identity. CLEO creates it once and never
25
+ # rewrites it, so git has nothing to overwrite — unlike the four mutable
26
+ # files above, whose hazard was git replacing live state CLEO rewrites.
22
27
  # =============================================================================
23
28
 
24
29
  # Step 1: Ignore everything in .cleo/
@@ -34,6 +39,8 @@
34
39
  # Step 3: Allow project configuration files that are SAFE to track
35
40
  # (detected project facts and bootstrap scripts — not runtime state).
36
41
  !project-context.json
42
+ # T12325: write-once portable project identity (ADR-094, amends ADR-013 §9).
43
+ !project-id
37
44
  !setup-otel.sh
38
45
  !DATA-SAFETY-IMPLEMENTATION-SUMMARY.md
39
46