@cleocode/core 2026.11.9 → 2026.11.10

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 (121) hide show
  1. package/README.md +9 -9
  2. package/dist/.source-stamp.json +1 -1
  3. package/dist/build-provenance.json +2 -2
  4. package/dist/conduit/conduit-client.d.ts +1 -1
  5. package/dist/conduit/conduit-client.js +1 -1
  6. package/dist/conduit/factory.d.ts +1 -1
  7. package/dist/conduit/factory.js +1 -1
  8. package/dist/conduit/http-transport.d.ts +1 -1
  9. package/dist/conduit/http-transport.js +1 -1
  10. package/dist/conduit/local-transport.d.ts +1 -1
  11. package/dist/conduit/local-transport.js +1 -1
  12. package/dist/conduit/sse-transport.d.ts +1 -1
  13. package/dist/conduit/sse-transport.js +1 -1
  14. package/dist/crypto/credentials.d.ts +1 -1
  15. package/dist/crypto/credentials.js +1 -1
  16. package/dist/docs/build-provenance-graph.d.ts +1 -1
  17. package/dist/docs/build-provenance-graph.js +35 -39
  18. package/dist/docs/build-provenance-graph.js.map +1 -1
  19. package/dist/docs/docs-update.js +9 -1
  20. package/dist/docs/docs-update.js.map +1 -1
  21. package/dist/docs/doctor.js +46 -28
  22. package/dist/docs/doctor.js.map +1 -1
  23. package/dist/docs/lineage.js +70 -2
  24. package/dist/docs/lineage.js.map +1 -1
  25. package/dist/docs/modernize/guard.d.ts +10 -0
  26. package/dist/docs/modernize/guard.js +27 -0
  27. package/dist/docs/modernize/guard.js.map +1 -1
  28. package/dist/docs/modernize/restore.js +10 -2
  29. package/dist/docs/modernize/restore.js.map +1 -1
  30. package/dist/docs/modernize/store.d.ts +14 -0
  31. package/dist/docs/modernize/store.js +44 -0
  32. package/dist/docs/modernize/store.js.map +1 -1
  33. package/dist/docs/slug-rename.d.ts +29 -1
  34. package/dist/docs/slug-rename.js +41 -26
  35. package/dist/docs/slug-rename.js.map +1 -1
  36. package/dist/docs/supersede.d.ts +43 -0
  37. package/dist/docs/supersede.js +103 -0
  38. package/dist/docs/supersede.js.map +1 -1
  39. package/dist/docs/wikilinks.d.ts +8 -0
  40. package/dist/docs/wikilinks.js +23 -16
  41. package/dist/docs/wikilinks.js.map +1 -1
  42. package/dist/memory/decision-cross-link.d.ts +1 -1
  43. package/dist/memory/decision-cross-link.js +1 -1
  44. package/dist/release/ci-evidence.d.ts +2 -17
  45. package/dist/release/ci-evidence.js +122 -33
  46. package/dist/release/ci-evidence.js.map +1 -1
  47. package/dist/store/attachment-store.js +35 -0
  48. package/dist/store/attachment-store.js.map +1 -1
  49. package/dist/store/backup-sidecar.d.ts +5 -1
  50. package/dist/store/backup-sidecar.js +26 -1
  51. package/dist/store/backup-sidecar.js.map +1 -1
  52. package/dist/store/conduit-doc-history.d.ts +26 -1
  53. package/dist/store/conduit-doc-history.js +68 -11
  54. package/dist/store/conduit-doc-history.js.map +1 -1
  55. package/dist/store/open-cleo-db.d.ts +3 -5
  56. package/dist/store/open-cleo-db.js +68 -168
  57. package/dist/store/open-cleo-db.js.map +1 -1
  58. package/dist/store/recover-malformed-db.d.ts +34 -0
  59. package/dist/store/recover-malformed-db.js +408 -5
  60. package/dist/store/recover-malformed-db.js.map +1 -1
  61. package/dist/store/repair-store-salvage.js +5 -3
  62. package/dist/store/repair-store-salvage.js.map +1 -1
  63. package/dist/store/repair-store.js +28 -1
  64. package/dist/store/repair-store.js.map +1 -1
  65. package/dist/store/restore-marker.d.ts +5 -1
  66. package/dist/store/restore-marker.js +35 -1
  67. package/dist/store/restore-marker.js.map +1 -1
  68. package/dist/store/row-identity.d.ts +11 -0
  69. package/dist/store/row-identity.js +13 -0
  70. package/dist/store/row-identity.js.map +1 -1
  71. package/dist/store/schema/cleo-global/agent-registry.d.ts +2 -2
  72. package/dist/store/schema/cleo-global/agent-registry.js +2 -2
  73. package/dist/store/schema/cleo-global/index.d.ts +3 -3
  74. package/dist/store/schema/cleo-global/index.js +3 -3
  75. package/dist/store/schema/cleo-global/nexus.d.ts +2 -2
  76. package/dist/store/schema/cleo-global/nexus.js +2 -2
  77. package/dist/store/schema/cleo-global/services.d.ts +1 -1
  78. package/dist/store/schema/cleo-global/services.js +1 -1
  79. package/dist/store/schema/cleo-global/skills.d.ts +2 -2
  80. package/dist/store/schema/cleo-global/skills.js +2 -2
  81. package/dist/store/schema/cleo-global/telemetry.d.ts +2 -2
  82. package/dist/store/schema/cleo-global/telemetry.js +2 -2
  83. package/dist/store/schema/cleo-project/audit.d.ts +2 -2
  84. package/dist/store/schema/cleo-project/audit.js +2 -2
  85. package/dist/store/schema/cleo-project/conduit.d.ts +2 -2
  86. package/dist/store/schema/cleo-project/conduit.js +2 -2
  87. package/dist/store/schema/cleo-project/docs.d.ts +3 -3
  88. package/dist/store/schema/cleo-project/docs.js +3 -3
  89. package/dist/store/schema/cleo-project/index.d.ts +3 -3
  90. package/dist/store/schema/cleo-project/index.js +3 -3
  91. package/dist/store/schema/cleo-project/lifecycle.d.ts +2 -2
  92. package/dist/store/schema/cleo-project/lifecycle.js +2 -2
  93. package/dist/store/schema/cleo-project/nexus-graph.d.ts +1 -1
  94. package/dist/store/schema/cleo-project/nexus-graph.js +1 -1
  95. package/dist/store/schema/cleo-project/provenance-commits.d.ts +2 -2
  96. package/dist/store/schema/cleo-project/provenance-commits.js +2 -2
  97. package/dist/store/schema/cleo-project/provenance-rest.d.ts +2 -2
  98. package/dist/store/schema/cleo-project/provenance-rest.js +2 -2
  99. package/dist/store/schema/cleo-project/runtime.d.ts +2 -2
  100. package/dist/store/schema/cleo-project/runtime.js +2 -2
  101. package/dist/store/schema/cleo-project/tasks-core-batch2.d.ts +2 -2
  102. package/dist/store/schema/cleo-project/tasks-core-batch2.js +2 -2
  103. package/dist/store/schema/cleo-project/tasks-core.d.ts +2 -2
  104. package/dist/store/schema/cleo-project/tasks-core.js +2 -2
  105. package/dist/store/schema/cleo-shared/brain.d.ts +3 -3
  106. package/dist/store/schema/cleo-shared/brain.js +3 -3
  107. package/dist/store/sqlite-backup.js +54 -30
  108. package/dist/store/sqlite-backup.js.map +1 -1
  109. package/dist/store/sync/apply/applier.js +2 -1
  110. package/dist/store/sync/apply/applier.js.map +1 -1
  111. package/dist/store/table-classification.js +12 -0
  112. package/dist/store/table-classification.js.map +1 -1
  113. package/dist/system/backup.d.ts +2 -0
  114. package/dist/system/backup.js +16 -7
  115. package/dist/system/backup.js.map +1 -1
  116. package/dist/tasks/done-plan.js +5 -1
  117. package/dist/tasks/done-plan.js.map +1 -1
  118. package/migrations/README.md +56 -29
  119. package/package.json +13 -13
  120. package/schemas/project-context.schema.json +24 -3
  121. package/templates/CLEO-REFERENCE.md +4 -0
@@ -1,6 +1,6 @@
1
1
  # CLEO Migration System — Hybrid Path A+
2
2
 
3
- > **Decision record**: [`docs/adr/ADR-054-migration-system-hybrid-path-a-plus.md`](../../../docs/adr/ADR-054-migration-system-hybrid-path-a-plus.md)
3
+ > **Decision record**: [`docs/adr/adr-054-migration-system-hybrid-path-a-plus.md`](../../../docs/adr/adr-054-migration-system-hybrid-path-a-plus.md)
4
4
  > **Epic**: T1150 (T-MSR RCASD) — Wave 2A implementation
5
5
  > **Synthesis**: [`.cleo/agent-outputs/T-MSR/RECOMMENDATION.md`](../../../.cleo/agent-outputs/T-MSR/RECOMMENDATION.md)
6
6
 
@@ -9,19 +9,38 @@ This is the living guide for authoring, maintaining, and recovering migrations i
9
9
 
10
10
  ---
11
11
 
12
- ## Overview — 5 DBs and Their Purpose
12
+ ## Overview: two stores, one journal each
13
13
 
14
- CLEO manages five SQLite databases. Four use `packages/core/src/store/migration-manager.ts`
15
- as their runtime migration orchestrator. `signaldock.db` has a structurally distinct
16
- embedded runner (see [signaldock note](#signaldock-structural-note) below).
14
+ CLEO keeps its data in two SQLite stores, each one `cleo.db` with domain-prefixed tables:
15
+ the **project** store (`<project>/.cleo/cleo.db`) and the **global** store
16
+ (`<CLEO home>/cleo.db`). The former per-domain files (`tasks.db`, `brain.db`, `nexus.db`,
17
+ `conduit.db`, `signaldock.db`) are legacy; their data moved into the two stores, and
18
+ `signaldock.db` is retired.
17
19
 
18
- | DB | Scope | Schema file | Migration folder | Runtime runner |
19
- |---|---|---|---|---|
20
- | `tasks` | project-level | `packages/core/src/store/tasks-schema.ts` | `drizzle-tasks/` | `migration-manager.ts` |
21
- | `brain` | project-level | `packages/core/src/store/memory-schema.ts` | `drizzle-brain/` | `migration-manager.ts` |
22
- | `nexus` | global/cross-project | `packages/core/src/store/nexus-schema.ts` | `drizzle-nexus/` | `migration-manager.ts` |
23
- | `signaldock` | global/cross-project | `packages/core/src/store/signaldock-schema.ts` | `drizzle-signaldock/` | bespoke embedded runner |
24
- | `telemetry` | opt-in CLI telemetry | `packages/core/src/telemetry/schema.ts` | `drizzle-telemetry/` | `migration-manager.ts` |
20
+ Every open goes through `openDualScopeDb` (`packages/core/src/store/dual-scope-db.ts`), which
21
+ migrates the store with its consolidated lineage before returning it. Domain store modules then
22
+ apply the legacy lineages they still own to the same file, into the same journal:
23
+
24
+ | Store | Lineages that run against it | Where new migrations land |
25
+ |---|---|---|
26
+ | project `cleo.db` | `drizzle-cleo-project` (on open); `drizzle-tasks` (`store/sqlite.ts`), `drizzle-brain` (`store/memory-sqlite.ts`), `drizzle-nexus` (`store/nexus-sqlite.ts`, the delta only) and `drizzle-conduit` (`store/conduit-sqlite.ts`, the FTS5 quartet) | `drizzle-cleo-project` (newest folders through 2026-11); `drizzle-brain` last gained one in 2026-10, `drizzle-tasks` in 2026-09 |
27
+ | global `cleo.db` | `drizzle-cleo-global` (on open); `drizzle-agent-registry` (its forward migration, `store/agent-registry-store.ts`) | `drizzle-cleo-global` (newest folders through 2026-10) |
28
+ | opt-in `telemetry.db` (CLEO home, its own file and journal) | `drizzle-telemetry` (`telemetry/sqlite.ts`) | `drizzle-telemetry` |
29
+
30
+ `drizzle-skills` is NOT run: `store/skills-db.ts` reads the `skills_*` tables that
31
+ `drizzle-cleo-global` creates, because the legacy lineage would create a bare `skills` table that
32
+ collides with the agent registry. `cleo doctor migrations` still lists `drizzle-skills` and
33
+ `drizzle-telemetry` among the global lineages it reports on (`GLOBAL_LINEAGES` in
34
+ `packages/core/src/doctor/migrations.ts`).
35
+
36
+ Schemas: `packages/core/src/store/schema/cleo-project/` and `.../cleo-global/` (the per-domain
37
+ schema files still define each domain's tables). drizzle-kit configs per lineage live in
38
+ `drizzle/<lineage>.config.ts`. `cleo doctor migrations` reports each store's journal per
39
+ lineage: applied, pending, and drift.
40
+
41
+ `scripts/new-migration.mjs` (`pnpm db:new`) scaffolds into the per-domain lineages only
42
+ (`--db tasks|brain|nexus|agent-registry|telemetry`); it has no `cleo-project` or `cleo-global`
43
+ target.
25
44
 
26
45
  The canonical tree lives here at `packages/core/migrations/`. This is the **single source of
27
46
  truth** for all CLEO migration SQL. Consumers (including `@cleocode/cleo`) locate migration
@@ -227,14 +246,11 @@ removing any causes hard failures on existing installations.
227
246
  T1137 may be deprecated in v2026.6.0 once all installations have passed the drizzle v1-beta
228
247
  upgrade window. The other five patches must remain indefinitely.
229
248
 
230
- ### signaldock structural note
249
+ ### Retired: signaldock
231
250
 
232
- `drizzle-signaldock/` is covered by a drizzle-kit config for scaffolding, but `signaldock.db`
233
- itself uses a bespoke embedded runner (`_signaldock_migrations` table,
234
- `GLOBAL_EMBEDDED_MIGRATIONS` array in `signaldock-sqlite.ts`) rather than `migration-manager.ts`.
235
- Running `pnpm db:new -- --db signaldock` emits a warning and proceeds; the linter catches
236
- any convention violations. Bringing signaldock fully into the `migration-manager.ts` runtime
237
- is an epic-scale refactor out of scope for Wave 2A (ADR-054 R3 §6.1).
251
+ `signaldock.db` and its bespoke embedded runner are retired. Its tables moved into the global
252
+ `cleo.db` with the `agent_registry_` prefix, migrated by the `drizzle-agent-registry` lineage in
253
+ the global journal. There is no `drizzle-signaldock/` folder or `signaldock-schema.ts` any more.
238
254
 
239
255
  ### sync-journal: not a drizzle lineage
240
256
 
@@ -318,7 +334,7 @@ prevent authoring mistakes.
318
334
 
319
335
  ## Adding a New DB Set
320
336
 
321
- Follow these steps when introducing a new fifth (or later) database to CLEO.
337
+ Follow these steps when introducing a new lineage. Since the consolidation, new tables normally go into `drizzle-cleo-project` or `drizzle-cleo-global` instead of a new database.
322
338
 
323
339
  **1. Author the schema file.**
324
340
 
@@ -383,7 +399,7 @@ In most cases the reconciler self-heals without operator intervention.
383
399
  ### When operator action is required
384
400
 
385
401
  If `__drizzle_migrations` rows are visibly out of sync with schema state and the reconciler
386
- has not self-healed (observable via `cleo admin` or direct `sqlite3` inspection):
402
+ has not self-healed (observable via `cleo doctor migrations`):
387
403
 
388
404
  **Step 1 — Take a backup before touching anything.**
389
405
 
@@ -394,9 +410,13 @@ cleo backup add
394
410
  **Step 2 — Inspect the journal.**
395
411
 
396
412
  ```bash
397
- sqlite3 .cleo/tasks.db "SELECT id, hash, name FROM __drizzle_migrations ORDER BY created_at;"
413
+ cleo doctor migrations
398
414
  ```
399
415
 
416
+ It reads each store's journal (project and global `cleo.db`) as a read-only snapshot and reports,
417
+ per lineage, the applied and pending files and any hash drift. Do not open `.cleo/tasks.db`: it is
418
+ a legacy decoy, not the live store.
419
+
400
420
  **Step 3 — Identify the offending migration.**
401
421
 
402
422
  Compare journal entries against `packages/core/migrations/drizzle-<db>/` folder names. A
@@ -413,16 +433,20 @@ shortcut, restart the CLEO process; the reconciler will attempt Scenario 3 on th
413
433
 
414
434
  ```bash
415
435
  cleo doctor
436
+ cleo doctor migrations
416
437
  ```
417
438
 
418
- If the DB passes doctor checks, the recovery is complete.
439
+ If the DB passes doctor checks, the recovery is complete. If the store itself is damaged
440
+ (corruption rather than a journal gap), `cleo doctor repair-store --dry-run`, then
441
+ `cleo doctor repair-store`, repairs `cleo.db` losslessly, keeping the originals and a recovery
442
+ receipt.
419
443
 
420
444
  **Step 6 — File a bug.**
421
445
 
422
446
  If the reconciler did not self-heal a partial migration, file a bug with:
423
447
  - The migration name and the set of columns that were/were not present.
424
448
  - The CLEO version (`cleo version`).
425
- - The full output of `cleo admin` and `sqlite3 .cleo/<db>.db ".schema"`.
449
+ - The full output of `cleo doctor migrations`.
426
450
 
427
451
  ---
428
452
 
@@ -430,9 +454,9 @@ If the reconciler did not self-heal a partial migration, file a bug with:
430
454
 
431
455
  ### Decision records
432
456
 
433
- - [`docs/adr/ADR-054-migration-system-hybrid-path-a-plus.md`](../../../docs/adr/ADR-054-migration-system-hybrid-path-a-plus.md) — canonical governance contract (supersedes ADR-012, ADR-027 §2.6)
434
- - [`docs/adr/ADR-051-programmatic-gate-integrity.md`](../../../docs/adr/ADR-051-programmatic-gate-integrity.md) — evidence-based verify; informs the linter/guard/generator triad
435
- - [`docs/adr/ADR-012-drizzle-kit-migration-system.md`](../../../docs/adr/ADR-012-drizzle-kit-migration-system.md) — original drizzle-kit adoption (superseded)
457
+ - [`docs/adr/adr-054-migration-system-hybrid-path-a-plus.md`](../../../docs/adr/adr-054-migration-system-hybrid-path-a-plus.md) — canonical governance contract (supersedes ADR-012, ADR-027 §2.6)
458
+ - [`docs/adr/adr-051-programmatic-gate-integrity.md`](../../../docs/adr/adr-051-programmatic-gate-integrity.md) — evidence-based verify; informs the linter/guard/generator triad
459
+ - [`docs/adr/adr-012-drizzle-kit-migration-system.md`](../../../docs/adr/adr-012-drizzle-kit-migration-system.md) — original drizzle-kit adoption (superseded)
436
460
 
437
461
  ### Research synthesis
438
462
 
@@ -462,8 +486,11 @@ If the reconciler did not self-heal a partial migration, file a bug with:
462
486
  - `packages/core/src/store/migration-manager.ts` — runtime reconciler (663 lines, 6 patches)
463
487
  - `scripts/new-migration.mjs` — generator wrapper (T1164)
464
488
  - `scripts/lint-migrations.mjs` — migration linter (T1168)
465
- - `drizzle/tasks.config.ts`, `drizzle/brain.config.ts`, `drizzle/nexus.config.ts`,
466
- `drizzle/signaldock.config.ts`, `drizzle/telemetry.config.ts` — drizzle-kit configs (T1163)
489
+ - `drizzle/<lineage>.config.ts` — drizzle-kit configs, one per lineage (`cleo-project`,
490
+ `cleo-global`, `tasks`, `brain`, `nexus`, `conduit`, `agent-registry`, `skills`, `telemetry`)
491
+ - `packages/core/src/store/dual-scope-db.ts` — `openDualScopeDb`, the store chokepoint that migrates each `cleo.db`
492
+ - `packages/core/src/store/migration-runner.ts` — the bracketed per-file migration runner
493
+ - `packages/core/src/doctor/migrations.ts` — `cleo doctor migrations` and the lineage lists
467
494
 
468
495
  ---
469
496
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleocode/core",
3
- "version": "2026.11.9",
3
+ "version": "2026.11.10",
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",
@@ -501,16 +501,16 @@
501
501
  "write-file-atomic": "^7.0.1",
502
502
  "yaml": "^2.8.3",
503
503
  "zod": "4.3.6",
504
- "@cleocode/adapters": "2026.11.9",
505
- "@cleocode/agents": "2026.11.9",
506
- "@cleocode/caamp": "2026.11.9",
507
- "@cleocode/contracts": "2026.11.9",
508
- "@cleocode/git-shim": "2026.11.9",
509
- "@cleocode/lafs": "2026.11.9",
510
- "@cleocode/nexus": "2026.11.9",
511
- "@cleocode/paths": "2026.11.9",
512
- "@cleocode/skills": "2026.11.9",
513
- "@cleocode/worktree": "2026.11.9"
504
+ "@cleocode/adapters": "2026.11.10",
505
+ "@cleocode/agents": "2026.11.10",
506
+ "@cleocode/caamp": "2026.11.10",
507
+ "@cleocode/contracts": "2026.11.10",
508
+ "@cleocode/git-shim": "2026.11.10",
509
+ "@cleocode/lafs": "2026.11.10",
510
+ "@cleocode/nexus": "2026.11.10",
511
+ "@cleocode/paths": "2026.11.10",
512
+ "@cleocode/skills": "2026.11.10",
513
+ "@cleocode/worktree": "2026.11.10"
514
514
  },
515
515
  "engines": {
516
516
  "node": ">=24.16.0"
@@ -536,7 +536,7 @@
536
536
  "@types/proper-lockfile": "^4.1.4",
537
537
  "@types/tar": "^6.1.13",
538
538
  "@types/write-file-atomic": "^4.0.3",
539
- "@cleocode/utils": "2026.11.8"
539
+ "@cleocode/utils": "2026.11.9"
540
540
  },
541
541
  "repository": {
542
542
  "type": "git",
@@ -545,7 +545,7 @@
545
545
  },
546
546
  "optionalDependencies": {
547
547
  "llmtxt": "^2026.5.15",
548
- "@cleocode/studio": "^2026.11.9"
548
+ "@cleocode/studio": "^2026.11.10"
549
549
  },
550
550
  "scripts": {
551
551
  "build": "tsc && node scripts/copy-selfimprove-fixtures.mjs && node scripts/write-build-provenance.mjs",
@@ -7,6 +7,27 @@
7
7
  "type": "object",
8
8
  "required": ["schemaVersion", "detectedAt", "projectTypes"],
9
9
  "additionalProperties": false,
10
+ "definitions": {
11
+ "ciJobGlobs": {
12
+ "type": "array",
13
+ "items": { "type": "string", "minLength": 1 },
14
+ "minItems": 1
15
+ },
16
+ "ciJobRequirements": {
17
+ "oneOf": [
18
+ { "$ref": "#/definitions/ciJobGlobs" },
19
+ {
20
+ "type": "object",
21
+ "additionalProperties": false,
22
+ "required": ["pullRequest", "push"],
23
+ "properties": {
24
+ "pullRequest": { "$ref": "#/definitions/ciJobGlobs" },
25
+ "push": { "$ref": "#/definitions/ciJobGlobs" }
26
+ }
27
+ }
28
+ ]
29
+ }
30
+ },
10
31
  "properties": {
11
32
  "$schema": {
12
33
  "type": "string",
@@ -330,10 +351,10 @@
330
351
  "jobs": {
331
352
  "type": "object",
332
353
  "additionalProperties": false,
333
- "description": "Job-name globs (* wildcard) that must each have run and succeeded in the pinned workflows before ci:<pr> attests a code task's gate.",
354
+ "description": "Job-name globs (* wildcard) that must each have run and succeeded in the pinned workflows before ci:<pr> attests a code task's gate. An array keeps the shared requirements; {pullRequest, push} requires separate lists on the final PR head and main (only push for a workflow-edited PR).",
334
355
  "properties": {
335
- "tests": { "type": "array", "items": { "type": "string", "minLength": 1 }, "minItems": 1 },
336
- "qa": { "type": "array", "items": { "type": "string", "minLength": 1 }, "minItems": 1 }
356
+ "tests": { "$ref": "#/definitions/ciJobRequirements" },
357
+ "qa": { "$ref": "#/definitions/ciJobRequirements" }
337
358
  }
338
359
  },
339
360
  "covering": {
@@ -376,6 +376,10 @@ A criterion of a code task that an owner decision or a stored document meets is
376
376
 
377
377
  With `evidence.ciSatisfies: true`, `ci:<number>` attests `testsPassed`/`qaPassed` from the required checks (`evidence.ciChecks`) green on the merged PR's merge commit, or on a final PR head whose tree equals it. When a concurrency group CANCELLED (or skipped) the merge commit's own push run, a later default-branch commit's green `push` run may stand in (T12742). That run proves the DESCENDANT's tree, not the merge tree, so it counts only when all of these hold: no merge-commit run or job failed; the PR's final head has a green latest `pull_request` run for every stood-in check; the commit descends from the merge commit and is one of the first 10 first-parent commits within 7 days; NO commit between them, merge commits included, touched the PR's changed files, a pinned workflow file or `.github/actions`; and it is the first candidate with a decisive verdict. A red first decisive candidate refuses, and a pending one refuses with "wait for <sha>"; only cancelled, skipped or never-started runs move on. The atom records `descendantSha`, `descendantRange` and `descendantPrHeadSha`, and `cleo complete` re-fetches both runs' latest attempts, because a re-run can turn a completed check red. A WORKSPACE-WIDE change (one a targeted `test-run:` cannot speak for: the lockfile, a root config, a path outside every package) has one more route (owner decision D11192, T14032): when the merge commit is not green and no descendant above stands in, a green `push` run of every required check (and the gates' jobs) on the default branch's CURRENT HEAD stands in, whatever the merge commit's run concluded (a secrets job red on a re-run) and even when later commits touched the PR's files, because it tests the merged change as it is now, like the `test-run:` stand-in (T13673). The run must descend from the merge commit and be on HEAD itself, or on a first-parent commit that differs from HEAD only in documentation (nothing a test reads moved, T13784); a red or pending decisive run refuses. The atom records `workspaceWide` and `descendantSha`, and `cleo complete` re-fetches that push run. A SCOPED change takes the same current-HEAD route (owner decision D11241, T14434) under three conditions: the merge commit's red or cancelled run is not the PR's (cancelled or skipped, inherited from main, red only on the flaky-quarantine budget, or failed with no test run), the PR's final head had a green `pull_request` run of every required check, and every hunk the PR added is still present at the stand-in commit and at HEAD. It runs today's CI definition, so a later change to `ci.yml` no longer blocks it. A failure that is the PR's, a red PR head or a rewritten hunk still refuses, and the refusal names what closes the task instead: a `test-run:` (or `tool:test-affected`) and a `qa-run:` (or `tool:lint;tool:typecheck`) recorded on the default branch after the merge. The atom records `currentHead` and `descendantPrHeadSha`, and `cleo complete` re-fetches both runs. While only the green HEAD run is missing, the merge sweep keeps the task waiting and re-checks it each sweep; `cleo done --from-merge <pr>` re-checks at once. A PR that edits a pinned workflow file is attested by default-branch `push` runs only (T13174): its own `pull_request` runs executed the edited workflow and are never consulted, so the PR-head conditions drop and the atom records `mainOnly`. Until main's push run on the merge commit (or a stand-in under the rule above) finishes, `ci:<pr>` refuses with a wait message; a whole-suite local run is never the fallback. Such an edit is attested by the workflow it introduces, so review the workflow edit itself: a hollowed job (a step that runs nothing) would attest itself green, and the job globs only catch a removed or renamed job. A required job skipped by CI's own change filter counts as CI's verdict that the change touches nothing it tests (T14260), but only when the diff is entirely outside the package code roots (`packages/`, `crates/`, where CI's `code` filter runs the unit shards for every file, templates included) and the required checks are green; the atom records `filterSkippedJobs`. A cancelled, failed, pending or missing required job never counts as a skip. A merge-commit failure whose base passed refuses; the refusal blames the PR only for a first-attempt run that started before any later default-branch commit landed, and says a re-run or late run may have failed on something that changed after the merge, such as secrets (T14026).
378
378
 
379
+ When PR and main job names differ, set `evidence.ciChecks.jobs.tests` (and `qa`) to an object with two nonempty lists, e.g. `{"pullRequest":["PR guards and affected tests*"],"push":["Full Suite*"]}` (T14577). Both must pass in the pinned workflows: `pullRequest` on the final PR head's `pull_request` runs, and `push` on the merge commit or a permitted main stand-in. The head need not be tree-equal to the merge when both sides pass. A workflow-edited PR stays main-only and consults only `push`. A plain array keeps its existing meaning, including the tree-equal-head substitution and the shared job list on a descendant and PR head. The T14260 filter-skip rule still applies to main's jobs; it never excuses a missing or skipped PR-head job in the per-event form. Refusals name `evidence.ciChecks.jobs.<tests|qa>.pullRequest` or `.push` so the project can correct the relevant list.
380
+
381
+ For a job glob without `*`, an exact reported job name takes precedence over suffixed variants (e.g. required `Type Check` versus non-gating `Type Check (Node 26)`). If the exact name is absent, the bare name matches its parenthesized matrix variants and every reported leg must pass. Wildcards keep direct matching, and names such as `node 20/22` are labels, never matrix-cardinality metadata. To require the presence of particular legs, list their names or globs explicitly. A tree-equal PR head still needs the per-event push side: a cancelled push run uses the permitted descendant search, and a pending one refuses with wait guidance.
382
+
379
383
  Required checks: explicit configuration or target repository protection. `release.prRequiredWorkflows: []` requires no checks; it proves neither testing nor review. `.cleo/cache/evidence/pr-<num>.json` retains provenance and changed files; obsolete versions reject. Use `tool:test-affected` when `testing.affectedCommand` is configured (a full `tool:test` then only for root-config changes, which affected planning refuses), otherwise a targeted `test-run:<json>` or `tool:test`, plus appropriate QA tools, linking each result to verified criteria.
380
384
 
381
385
  **Merged work with no required CI (T14163).** `pr:<n>` proves provenance only: it never satisfies `testsPassed` or `qaPassed`, with or without required workflows; tests need a run. A change whose only paths outside every workspace package are the root `package.json` (dependency fields only) and `pnpm-lock.yaml` is otherwise workspace-wide, so with no `ci:` route only the whole suite would speak for it. After the merge it is scoped instead: a targeted `test-run:` recorded on the default branch after the merge (the T13673 stand-in) covers it when it passes a test file in every package whose lockfile importer the merge changed, the root importer counting as every package, plus their dependents and the change's own packages. The stand-in names the importers (`manifestScoped`). Anything the lockfile diff cannot attribute to a changed importer (settings, overrides, catalogs, a package no changed importer reaches), any other root `package.json` field such as `scripts`, and other lockfiles keep the change workspace-wide.