@cleocode/contracts 2026.5.95 → 2026.5.97
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.
- package/dist/__tests__/enums.test.d.ts +14 -0
- package/dist/__tests__/enums.test.d.ts.map +1 -0
- package/dist/__tests__/enums.test.js +75 -0
- package/dist/__tests__/enums.test.js.map +1 -0
- package/dist/__tests__/jobs.test.d.ts +11 -0
- package/dist/__tests__/jobs.test.d.ts.map +1 -0
- package/dist/__tests__/jobs.test.js +48 -0
- package/dist/__tests__/jobs.test.js.map +1 -0
- package/dist/__tests__/memory-wire-shapes.test.d.ts +19 -0
- package/dist/__tests__/memory-wire-shapes.test.d.ts.map +1 -0
- package/dist/__tests__/memory-wire-shapes.test.js +119 -0
- package/dist/__tests__/memory-wire-shapes.test.js.map +1 -0
- package/dist/__tests__/operation-def.test.d.ts +20 -0
- package/dist/__tests__/operation-def.test.d.ts.map +1 -0
- package/dist/__tests__/operation-def.test.js +111 -0
- package/dist/__tests__/operation-def.test.js.map +1 -0
- package/dist/__tests__/provenance.test.d.ts +18 -0
- package/dist/__tests__/provenance.test.d.ts.map +1 -0
- package/dist/__tests__/provenance.test.js +142 -0
- package/dist/__tests__/provenance.test.js.map +1 -0
- package/dist/__tests__/scaffold-diagnostics.test.d.ts +19 -0
- package/dist/__tests__/scaffold-diagnostics.test.d.ts.map +1 -0
- package/dist/__tests__/scaffold-diagnostics.test.js +70 -0
- package/dist/__tests__/scaffold-diagnostics.test.js.map +1 -0
- package/dist/dispatch/identity.d.ts +72 -0
- package/dist/dispatch/identity.d.ts.map +1 -0
- package/dist/dispatch/identity.js +72 -0
- package/dist/dispatch/identity.js.map +1 -0
- package/dist/dispatch/operation-def.d.ts +92 -0
- package/dist/dispatch/operation-def.d.ts.map +1 -0
- package/dist/dispatch/operation-def.js +31 -0
- package/dist/dispatch/operation-def.js.map +1 -0
- package/dist/doctor.d.ts +52 -0
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +7 -0
- package/dist/doctor.js.map +1 -1
- package/dist/enums.d.ts +123 -0
- package/dist/enums.d.ts.map +1 -0
- package/dist/enums.js +139 -0
- package/dist/enums.js.map +1 -0
- package/dist/index.d.ts +16 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/jobs.d.ts +39 -0
- package/dist/jobs.d.ts.map +1 -0
- package/dist/jobs.js +19 -0
- package/dist/jobs.js.map +1 -0
- package/dist/memory/budgeted.d.ts +67 -0
- package/dist/memory/budgeted.d.ts.map +1 -0
- package/dist/memory/budgeted.js +17 -0
- package/dist/memory/budgeted.js.map +1 -0
- package/dist/memory/fetch.d.ts +58 -0
- package/dist/memory/fetch.d.ts.map +1 -0
- package/dist/memory/fetch.js +19 -0
- package/dist/memory/fetch.js.map +1 -0
- package/dist/memory/observe.d.ts +158 -0
- package/dist/memory/observe.d.ts.map +1 -0
- package/dist/memory/observe.js +46 -0
- package/dist/memory/observe.js.map +1 -0
- package/dist/memory/search.d.ts +137 -0
- package/dist/memory/search.d.ts.map +1 -0
- package/dist/memory/search.js +22 -0
- package/dist/memory/search.js.map +1 -0
- package/dist/memory/timeline.d.ts +89 -0
- package/dist/memory/timeline.d.ts.map +1 -0
- package/dist/memory/timeline.js +22 -0
- package/dist/memory/timeline.js.map +1 -0
- package/dist/operations/focus.d.ts +199 -0
- package/dist/operations/focus.d.ts.map +1 -0
- package/dist/operations/focus.js +15 -0
- package/dist/operations/focus.js.map +1 -0
- package/dist/operations/index.d.ts +1 -0
- package/dist/operations/index.d.ts.map +1 -1
- package/dist/operations/index.js +1 -0
- package/dist/operations/index.js.map +1 -1
- package/dist/operations/session.d.ts +54 -0
- package/dist/operations/session.d.ts.map +1 -1
- package/dist/operations/tasks.d.ts +38 -0
- package/dist/operations/tasks.d.ts.map +1 -1
- package/dist/operations/worktree.d.ts +138 -1
- package/dist/operations/worktree.d.ts.map +1 -1
- package/dist/provenance.d.ts +257 -0
- package/dist/provenance.d.ts.map +1 -0
- package/dist/provenance.js +42 -0
- package/dist/provenance.js.map +1 -0
- package/dist/release/plan.d.ts +7 -7
- package/dist/scaffold-diagnostics.d.ts +110 -0
- package/dist/scaffold-diagnostics.d.ts.map +1 -0
- package/dist/scaffold-diagnostics.js +28 -0
- package/dist/scaffold-diagnostics.js.map +1 -0
- package/dist/session.d.ts +37 -0
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js.map +1 -1
- package/dist/tasks/archive.d.ts +3 -3
- package/package.json +42 -2
- package/src/__tests__/enums.test.ts +114 -0
- package/src/__tests__/jobs.test.ts +76 -0
- package/src/__tests__/memory-wire-shapes.test.ts +371 -0
- package/src/__tests__/operation-def.test.ts +185 -0
- package/src/__tests__/provenance.test.ts +259 -0
- package/src/__tests__/scaffold-diagnostics.test.ts +137 -0
- package/src/dispatch/identity.ts +109 -0
- package/src/dispatch/operation-def.ts +102 -0
- package/src/doctor.ts +62 -0
- package/src/enums.ts +144 -0
- package/src/index.ts +89 -2
- package/src/jobs.ts +45 -0
- package/src/memory/budgeted.ts +75 -0
- package/src/memory/fetch.ts +66 -0
- package/src/memory/observe.ts +176 -0
- package/src/memory/search.ts +145 -0
- package/src/memory/timeline.ts +100 -0
- package/src/operations/focus.ts +226 -0
- package/src/operations/index.ts +1 -0
- package/src/operations/session.ts +56 -0
- package/src/operations/tasks.ts +40 -0
- package/src/operations/worktree.ts +149 -1
- package/src/provenance.ts +335 -0
- package/src/scaffold-diagnostics.ts +119 -0
- package/src/session.ts +37 -0
|
@@ -143,6 +143,25 @@ export interface CreateWorktreeOptions {
|
|
|
143
143
|
* @task T1927
|
|
144
144
|
*/
|
|
145
145
|
forceReset?: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* Sparse-checkout scope pattern (T9807). When set, `createWorktree` runs
|
|
148
|
+
* `git sparse-checkout init --cone` followed by
|
|
149
|
+
* `git sparse-checkout set <spawnScope>` after `git worktree add` completes,
|
|
150
|
+
* limiting the worktree's checked-out tree to paths matching `<spawnScope>`.
|
|
151
|
+
*
|
|
152
|
+
* Exposed on `cleo orchestrate spawn` as the `--scope` flag so callers can
|
|
153
|
+
* request a lean worktree containing only the paths relevant to a task
|
|
154
|
+
* (e.g. `packages/cleo` to contain a CLI-only fix).
|
|
155
|
+
*
|
|
156
|
+
* Cone mode (`--cone`) is used for maximum checkout performance — the scope
|
|
157
|
+
* string must be a directory prefix, not an arbitrary glob.
|
|
158
|
+
*
|
|
159
|
+
* Failures are silently swallowed (best-effort) — the worktree is returned
|
|
160
|
+
* in full-checkout mode when sparse-checkout setup fails.
|
|
161
|
+
*
|
|
162
|
+
* @task T9807
|
|
163
|
+
*/
|
|
164
|
+
spawnScope?: string;
|
|
146
165
|
}
|
|
147
166
|
/**
|
|
148
167
|
* Result of a successful worktree creation.
|
|
@@ -225,6 +244,14 @@ export interface DestroyWorktreeOptions {
|
|
|
225
244
|
force?: boolean;
|
|
226
245
|
/** Declarative hooks to run during destruction lifecycle. */
|
|
227
246
|
hooks?: WorktreeHook[];
|
|
247
|
+
/**
|
|
248
|
+
* Free-form reason string appended to the lifecycle audit log (T9805).
|
|
249
|
+
*
|
|
250
|
+
* Examples: `'pr-merged'`, `'manual'`, `'idle-timeout'`.
|
|
251
|
+
*
|
|
252
|
+
* @default 'manual'
|
|
253
|
+
*/
|
|
254
|
+
reason?: string;
|
|
228
255
|
}
|
|
229
256
|
/**
|
|
230
257
|
* Result of a worktree destroy operation.
|
|
@@ -298,6 +325,16 @@ export interface PruneWorktreesOptions {
|
|
|
298
325
|
* @default true
|
|
299
326
|
*/
|
|
300
327
|
gitPrune?: boolean;
|
|
328
|
+
/**
|
|
329
|
+
* Abandonment-timeout threshold in days (T9805 AC2).
|
|
330
|
+
*
|
|
331
|
+
* When set, worktrees whose branch has had no commits for at least this many
|
|
332
|
+
* days AND which have no open PR associated are eligible for pruning, even
|
|
333
|
+
* if their task ID is not in a known-stale set.
|
|
334
|
+
*
|
|
335
|
+
* @default undefined — disabled; no idle-age check is performed.
|
|
336
|
+
*/
|
|
337
|
+
idleDays?: number;
|
|
301
338
|
}
|
|
302
339
|
/**
|
|
303
340
|
* Result of a prune operation.
|
|
@@ -337,6 +374,20 @@ export interface PruneWorktreesResult {
|
|
|
337
374
|
* @task T9546
|
|
338
375
|
*/
|
|
339
376
|
export type WorktreeStatusCategory = 'active' | 'stale' | 'merged' | 'orphan' | 'locked';
|
|
377
|
+
/**
|
|
378
|
+
* Source classifier for a worktree entry.
|
|
379
|
+
*
|
|
380
|
+
* - `cleo-spawn` — Created by `cleo orchestrate spawn` via the canonical XDG path.
|
|
381
|
+
* - `claude-agent` — Created by Claude Code Agent `isolation:worktree` dispatch (T9804).
|
|
382
|
+
* - `manual` — Created directly via `git worktree add` without CLEO CLI involvement.
|
|
383
|
+
* - `adopted` — Registered via `cleo worktree adopt` from an unknown origin.
|
|
384
|
+
*
|
|
385
|
+
* The `source` field enables downstream consumers (prune, dashboard, sentient daemon)
|
|
386
|
+
* to apply different policies per origin without re-querying git.
|
|
387
|
+
*
|
|
388
|
+
* @task T9804
|
|
389
|
+
*/
|
|
390
|
+
export type WorktreeSource = 'cleo-spawn' | 'claude-agent' | 'manual' | 'adopted';
|
|
340
391
|
/**
|
|
341
392
|
* A single structured worktree entry with full status classification.
|
|
342
393
|
*
|
|
@@ -346,6 +397,7 @@ export type WorktreeStatusCategory = 'active' | 'stale' | 'merged' | 'orphan' |
|
|
|
346
397
|
* sentient daemon) can act on without re-querying git.
|
|
347
398
|
*
|
|
348
399
|
* @task T9546
|
|
400
|
+
* @task T9804 — added `source` field for multi-source listing
|
|
349
401
|
*/
|
|
350
402
|
export interface WorktreeInfo {
|
|
351
403
|
/** Absolute path to the worktree directory. */
|
|
@@ -368,6 +420,22 @@ export interface WorktreeInfo {
|
|
|
368
420
|
owningTaskStatus: string | null;
|
|
369
421
|
/** Mutually-exclusive status category — see {@link WorktreeStatusCategory}. */
|
|
370
422
|
statusCategory: WorktreeStatusCategory;
|
|
423
|
+
/**
|
|
424
|
+
* Origin of this worktree entry.
|
|
425
|
+
*
|
|
426
|
+
* - `cleo-spawn` — Canonical XDG worktree created by `cleo orchestrate spawn`.
|
|
427
|
+
* - `claude-agent` — Created by Claude Code Agent `isolation:worktree` (T9804).
|
|
428
|
+
* - `manual` — Created via direct `git worktree add`.
|
|
429
|
+
* - `adopted` — Registered via `cleo worktree adopt`.
|
|
430
|
+
*
|
|
431
|
+
* For backward-compatibility this field defaults to `cleo-spawn` for entries
|
|
432
|
+
* that originated from `git worktree list --porcelain` and are NOT present in
|
|
433
|
+
* the sentinel index.
|
|
434
|
+
*
|
|
435
|
+
* @task T9804
|
|
436
|
+
* @default 'cleo-spawn'
|
|
437
|
+
*/
|
|
438
|
+
source: WorktreeSource;
|
|
371
439
|
}
|
|
372
440
|
/**
|
|
373
441
|
* Options for the structured worktree listing operation.
|
|
@@ -406,6 +474,9 @@ export interface ListWorktreesResult {
|
|
|
406
474
|
/**
|
|
407
475
|
* Canonical action recorded in `.cleo/audit/worktree-lifecycle.jsonl`.
|
|
408
476
|
*
|
|
477
|
+
* - `create` — worktree was created via `cleo orchestrate spawn` (T9805).
|
|
478
|
+
* - `destroy` — worktree was explicitly destroyed (PR-merged cleanup or manual) (T9805).
|
|
479
|
+
* - `adopt` — an existing worktree directory was attached to a new task ID (T9805).
|
|
409
480
|
* - `prune` — orphaned/merged worktree was removed.
|
|
410
481
|
* - `prune-skip` — orphan was detected but skipped (user said N, or had uncommitted changes).
|
|
411
482
|
* - `force-unlock` — git index.lock removed + `git worktree unlock` ran.
|
|
@@ -415,11 +486,15 @@ export interface ListWorktreesResult {
|
|
|
415
486
|
* `--resolve manual`; no automatic merge attempted (T9548).
|
|
416
487
|
* - `complete-conflict` — auto-merge attempted but failed (e.g. rebase/merge conflict);
|
|
417
488
|
* worktree was preserved for manual resolution (T9548).
|
|
489
|
+
* - `adopt` — externally-created worktree (e.g. Claude Code Agent `isolation:worktree`)
|
|
490
|
+
* registered in the CLEO SSoT via `cleo worktree adopt` (T9804).
|
|
418
491
|
*
|
|
419
492
|
* @task T9547
|
|
420
493
|
* @task T9548
|
|
494
|
+
* @task T9804
|
|
495
|
+
* @task T9805
|
|
421
496
|
*/
|
|
422
|
-
export type WorktreeLifecycleAction = 'prune' | 'prune-skip' | 'force-unlock' | 'complete' | 'complete-skip' | 'complete-manual' | 'complete-conflict';
|
|
497
|
+
export type WorktreeLifecycleAction = 'create' | 'destroy' | 'adopt' | 'prune' | 'prune-skip' | 'force-unlock' | 'complete' | 'complete-skip' | 'complete-manual' | 'complete-conflict' | 'adopt';
|
|
423
498
|
/**
|
|
424
499
|
* One append-only entry written to `.cleo/audit/worktree-lifecycle.jsonl` by
|
|
425
500
|
* the prune + force-unlock commands.
|
|
@@ -574,4 +649,66 @@ export interface ForceUnlockWorktreeResult {
|
|
|
574
649
|
/** Error message when no worktree could be located or all actions failed. */
|
|
575
650
|
error?: string;
|
|
576
651
|
}
|
|
652
|
+
/**
|
|
653
|
+
* Options for {@link adoptWorktree} — the SDK primitive behind
|
|
654
|
+
* `cleo worktree adopt <path>`.
|
|
655
|
+
*
|
|
656
|
+
* @task T9804
|
|
657
|
+
*/
|
|
658
|
+
export interface AdoptWorktreeOpts {
|
|
659
|
+
/**
|
|
660
|
+
* Absolute path to the worktree directory to adopt.
|
|
661
|
+
*
|
|
662
|
+
* Typically a path under `.claude/worktrees/<sessionId>/` for Claude Code
|
|
663
|
+
* Agent `isolation:worktree` spawns, but any valid worktree path is accepted.
|
|
664
|
+
*/
|
|
665
|
+
worktreePath: string;
|
|
666
|
+
/**
|
|
667
|
+
* Absolute path to the project root. Used to resolve the sentinel index
|
|
668
|
+
* and the audit-log file.
|
|
669
|
+
*
|
|
670
|
+
* @default process.cwd()
|
|
671
|
+
*/
|
|
672
|
+
projectRoot?: string;
|
|
673
|
+
/**
|
|
674
|
+
* Source classification for this worktree.
|
|
675
|
+
*
|
|
676
|
+
* @default 'claude-agent'
|
|
677
|
+
*/
|
|
678
|
+
source?: WorktreeSource;
|
|
679
|
+
/**
|
|
680
|
+
* Task ID to associate with this worktree. When not supplied the function
|
|
681
|
+
* attempts to extract it from the branch name following the `task/T####`
|
|
682
|
+
* convention, then falls back to null.
|
|
683
|
+
*/
|
|
684
|
+
taskId?: string | null;
|
|
685
|
+
/** Override actor name written to the audit log and sentinel index. */
|
|
686
|
+
actor?: string;
|
|
687
|
+
/** Optional override for the audit-log file path (testing). */
|
|
688
|
+
auditLogPath?: string;
|
|
689
|
+
/** Optional override for the sentinel index path (testing). */
|
|
690
|
+
sentinelIndexPath?: string;
|
|
691
|
+
}
|
|
692
|
+
/**
|
|
693
|
+
* Result of a successful `cleo worktree adopt` operation.
|
|
694
|
+
*
|
|
695
|
+
* @task T9804
|
|
696
|
+
*/
|
|
697
|
+
export interface AdoptWorktreeResult {
|
|
698
|
+
/** Absolute path of the adopted worktree. */
|
|
699
|
+
path: string;
|
|
700
|
+
/** Branch name extracted from the worktree `.git` gitlink. */
|
|
701
|
+
branch: string;
|
|
702
|
+
/** Task ID associated with the worktree (null if not determinable). */
|
|
703
|
+
taskId: string | null;
|
|
704
|
+
/** Source classification applied to this entry. */
|
|
705
|
+
source: WorktreeSource;
|
|
706
|
+
/**
|
|
707
|
+
* Whether this was a new adoption (`true`) or an idempotent re-adopt
|
|
708
|
+
* of an already-registered worktree (`false`).
|
|
709
|
+
*/
|
|
710
|
+
isNew: boolean;
|
|
711
|
+
/** ISO-8601 timestamp when the sentinel entry was written. */
|
|
712
|
+
adoptedAt: string;
|
|
713
|
+
}
|
|
577
714
|
//# sourceMappingURL=worktree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worktree.d.ts","sourceRoot":"","sources":["../../src/operations/worktree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH;;;;;;;;GAQG;AACH,MAAM,WAAW,YAAY;IAC3B,uEAAuE;IACvE,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,KAA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,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAMD;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;OAKG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+DAA+D;IAC/D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+DAA+D;IAC/D,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,8DAA8D;IAC9D,MAAM,EAAE,MAAM,CAAC;IACf,uEAAuE;IACvE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,mDAAmD;IACnD,MAAM,EAAE,cAAc,CAAC;IACvB;;;OAGG;IACH,KAAK,EAAE,OAAO,CAAC;IACf,8DAA8D;IAC9D,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provenance graph union types.
|
|
3
|
+
*
|
|
4
|
+
* Canonical home for the 16 string-literal union types that describe edges
|
|
5
|
+
* and FSM states in the CLEO provenance graph (commits, pull requests,
|
|
6
|
+
* releases, release artifacts, and BRAIN↔release links). Promoted from
|
|
7
|
+
* `packages/core/src/store/tasks-schema.ts` in Phase 0c of the
|
|
8
|
+
* SG-ARCH-SOLID Saga so that downstream packages can import these unions
|
|
9
|
+
* without pulling in the Drizzle schema runtime.
|
|
10
|
+
*
|
|
11
|
+
* The const arrays that back each union (`PR_STATES`, `COMMIT_LINK_KINDS`,
|
|
12
|
+
* `RELEASE_STATUSES`, …) remain in `tasks-schema.ts` because Drizzle's
|
|
13
|
+
* `text({ enum: ... })` column declaration narrows the runtime row type
|
|
14
|
+
* directly from those `as const` literals. `tasks-schema.ts` re-exports
|
|
15
|
+
* each union from this module to preserve the existing public surface for
|
|
16
|
+
* every `import * as schema from '../store/tasks-schema.js'` consumer.
|
|
17
|
+
*
|
|
18
|
+
* @see SPEC-T9345 §3 — provenance graph table definitions
|
|
19
|
+
* @see ADR-073 — task hierarchy charter (release provenance scope)
|
|
20
|
+
*
|
|
21
|
+
* Consolidated unions:
|
|
22
|
+
* - {@link PrState} — pull-request lifecycle state
|
|
23
|
+
* - {@link PrLinkSource} — how a PR↔task link was discovered
|
|
24
|
+
* - {@link PrLinkKind} — semantic PR↔task relationship
|
|
25
|
+
* - {@link CommitConventionalType} — Conventional Commits prefix
|
|
26
|
+
* - {@link CommitLinkKind} — semantic commit↔task relationship
|
|
27
|
+
* - {@link CommitLinkSource} — how a commit↔task link was discovered
|
|
28
|
+
* - {@link CommitFileChangeType} — git status letter (A/M/D/R/C)
|
|
29
|
+
* - {@link ReleaseScheme} — versioning scheme
|
|
30
|
+
* - {@link ReleaseChannel} — npm dist-tag channel
|
|
31
|
+
* - {@link ReleaseKind} — release packaging type
|
|
32
|
+
* - {@link ReleaseStatus} — unified release FSM state
|
|
33
|
+
* - {@link ReleaseChangeType} — 12-value change taxonomy
|
|
34
|
+
* - {@link ReleaseImpact} — semver impact level
|
|
35
|
+
* - {@link ReleaseClassifiedBy} — change-classification provenance
|
|
36
|
+
* - {@link ReleaseArtifactType} — artifact archetype
|
|
37
|
+
* - {@link BrainReleaseLinkType} — BRAIN↔release link semantics
|
|
38
|
+
*
|
|
39
|
+
* @since SG-ARCH-SOLID Saga T9831 · E-CONTRACTS-FOUNDATION T9832 · T9955 (Phase 0c)
|
|
40
|
+
*/
|
|
41
|
+
/**
|
|
42
|
+
* State of a pull request.
|
|
43
|
+
*
|
|
44
|
+
* Mirrors the GitHub PR state machine:
|
|
45
|
+
* - `open` — PR is open and not yet merged
|
|
46
|
+
* - `closed` — PR was closed without merging
|
|
47
|
+
* - `merged` — PR was merged into the target branch
|
|
48
|
+
*
|
|
49
|
+
* @task T9507
|
|
50
|
+
*/
|
|
51
|
+
export type PrState = 'open' | 'closed' | 'merged';
|
|
52
|
+
/**
|
|
53
|
+
* How a PR↔task link was discovered.
|
|
54
|
+
*
|
|
55
|
+
* - `pr-title` — task ID matched in the PR title
|
|
56
|
+
* - `pr-body` — task ID matched in the PR body markdown
|
|
57
|
+
* - `branch-name` — parsed from the branch name (e.g. `feat/T9507-...`)
|
|
58
|
+
* - `commit-trailer` — extracted from a git trailer in a PR commit
|
|
59
|
+
* - `manual` — explicitly linked via `cleo provenance link`
|
|
60
|
+
*
|
|
61
|
+
* @task T9507
|
|
62
|
+
*/
|
|
63
|
+
export type PrLinkSource = 'pr-title' | 'pr-body' | 'branch-name' | 'commit-trailer' | 'manual';
|
|
64
|
+
/**
|
|
65
|
+
* Semantic classification of a PR↔task relationship.
|
|
66
|
+
*
|
|
67
|
+
* Extends {@link CommitLinkKind} with `'tracks'` for PRs that observe a
|
|
68
|
+
* task without directly implementing, fixing, or documenting it.
|
|
69
|
+
*
|
|
70
|
+
* - `implements` — the PR directly implements the task's acceptance criteria
|
|
71
|
+
* - `fixes` — the PR fixes a bug or regression in the task's work
|
|
72
|
+
* - `refactors` — the PR restructures code introduced by the task
|
|
73
|
+
* - `tests` — the PR adds or updates tests for the task
|
|
74
|
+
* - `docs` — the PR updates documentation for the task
|
|
75
|
+
* - `reverts` — the PR reverts work introduced by the task
|
|
76
|
+
* - `tracks` — the PR is related to but does not directly implement the task
|
|
77
|
+
*
|
|
78
|
+
* @task T9507
|
|
79
|
+
*/
|
|
80
|
+
export type PrLinkKind = 'implements' | 'fixes' | 'refactors' | 'tests' | 'docs' | 'reverts' | 'tracks';
|
|
81
|
+
/**
|
|
82
|
+
* Conventional Commits prefix parsed from a commit subject.
|
|
83
|
+
*
|
|
84
|
+
* Adds `'breaking'` to the canonical CC set to flag BREAKING CHANGE
|
|
85
|
+
* footers. The DB column is nullable — a commit that does not follow
|
|
86
|
+
* Conventional Commits format stores NULL rather than one of these values.
|
|
87
|
+
*
|
|
88
|
+
* @task T9506
|
|
89
|
+
*/
|
|
90
|
+
export type CommitConventionalType = 'feat' | 'fix' | 'chore' | 'docs' | 'refactor' | 'test' | 'build' | 'ci' | 'perf' | 'revert' | 'breaking';
|
|
91
|
+
/**
|
|
92
|
+
* Semantic classification of a commit↔task relationship.
|
|
93
|
+
*
|
|
94
|
+
* - `implements` — the commit directly implements the task's acceptance criteria
|
|
95
|
+
* - `fixes` — the commit fixes a bug or regression in the task's work
|
|
96
|
+
* - `refactors` — the commit restructures code introduced by the task
|
|
97
|
+
* - `tests` — the commit adds or updates tests for the task
|
|
98
|
+
* - `docs` — the commit updates documentation for the task
|
|
99
|
+
* - `reverts` — the commit reverts work introduced by the task
|
|
100
|
+
*
|
|
101
|
+
* @task T9506
|
|
102
|
+
*/
|
|
103
|
+
export type CommitLinkKind = 'implements' | 'fixes' | 'refactors' | 'tests' | 'docs' | 'reverts';
|
|
104
|
+
/**
|
|
105
|
+
* How a commit↔task link was discovered.
|
|
106
|
+
*
|
|
107
|
+
* - `commit-trailer` — extracted from a `T####:` or `Task-Id:` git trailer
|
|
108
|
+
* - `commit-subject` — matched `T####` regex in the commit subject line
|
|
109
|
+
* - `pr-title` — matched task ID in the PR title
|
|
110
|
+
* - `pr-body` — matched task ID in the PR body markdown
|
|
111
|
+
* - `branch-name` — parsed from the branch name (e.g., `feat/T9506-...`)
|
|
112
|
+
* - `manual` — explicitly linked via `cleo provenance link`
|
|
113
|
+
*
|
|
114
|
+
* @task T9506
|
|
115
|
+
*/
|
|
116
|
+
export type CommitLinkSource = 'commit-trailer' | 'commit-subject' | 'pr-title' | 'pr-body' | 'branch-name' | 'manual';
|
|
117
|
+
/**
|
|
118
|
+
* Per-file change type from a git diff (status letter codes).
|
|
119
|
+
*
|
|
120
|
+
* - `A` — added
|
|
121
|
+
* - `M` — modified
|
|
122
|
+
* - `D` — deleted
|
|
123
|
+
* - `R` — renamed
|
|
124
|
+
* - `C` — copied
|
|
125
|
+
*
|
|
126
|
+
* @task T9506
|
|
127
|
+
*/
|
|
128
|
+
export type CommitFileChangeType = 'A' | 'M' | 'D' | 'R' | 'C';
|
|
129
|
+
/**
|
|
130
|
+
* Versioning scheme for a release.
|
|
131
|
+
*
|
|
132
|
+
* - `calver` — YYYY.MM.patch (e.g. 2026.5.74) — CLEO default
|
|
133
|
+
* - `semver` — MAJOR.MINOR.PATCH (e.g. 1.2.3)
|
|
134
|
+
* - `calver-suffix` — YYYY.MM.patch.N suffix hotfix (e.g. 2026.5.74.2)
|
|
135
|
+
*
|
|
136
|
+
* @task T9508
|
|
137
|
+
* @remarks
|
|
138
|
+
* The values here MUST stay aligned with `RELEASE_SCHEMES` in
|
|
139
|
+
* `tasks-schema.ts`; that const array drives the Drizzle row type. A
|
|
140
|
+
* compile-time structural assertion in
|
|
141
|
+
* `packages/contracts/src/__tests__/provenance.test.ts` pins both sides.
|
|
142
|
+
*/
|
|
143
|
+
export type ReleaseScheme = 'calver' | 'semver' | 'calver-suffix';
|
|
144
|
+
/**
|
|
145
|
+
* Release channel — controls which npm dist-tag (or equivalent) the
|
|
146
|
+
* artifact is published under.
|
|
147
|
+
*
|
|
148
|
+
* - `latest` — current stable
|
|
149
|
+
* - `beta` — pre-release tested in production-adjacent environments
|
|
150
|
+
* - `dev` — internal development snapshots
|
|
151
|
+
* - `hotfix` — emergency patch outside the regular cadence
|
|
152
|
+
*
|
|
153
|
+
* @task T9508
|
|
154
|
+
* @remarks
|
|
155
|
+
* Distinct from the `ReleaseChannel` exported by
|
|
156
|
+
* `@cleocode/contracts/release/channel` (which carries the npm-level
|
|
157
|
+
* `latest|beta|alpha` set) and from the `ReleaseChannel` in
|
|
158
|
+
* `@cleocode/contracts/release/plan` (which carries the release-plan
|
|
159
|
+
* `latest|beta|alpha|rc` set). Top-level `@cleocode/contracts` re-exports
|
|
160
|
+
* this union under a disambiguating alias.
|
|
161
|
+
*/
|
|
162
|
+
export type ReleaseChannel = 'latest' | 'beta' | 'dev' | 'hotfix';
|
|
163
|
+
/**
|
|
164
|
+
* Release packaging kind, orthogonal to individual change types within
|
|
165
|
+
* the release.
|
|
166
|
+
*
|
|
167
|
+
* - `regular` — standard scheduled release
|
|
168
|
+
* - `hotfix` — emergency patch outside regular cadence
|
|
169
|
+
* - `prerelease` — alpha/beta/rc release for early adopters
|
|
170
|
+
*
|
|
171
|
+
* @task T9508
|
|
172
|
+
*/
|
|
173
|
+
export type ReleaseKind = 'regular' | 'hotfix' | 'prerelease';
|
|
174
|
+
/**
|
|
175
|
+
* Unified release FSM state (admits values from BOTH the new T9492
|
|
176
|
+
* pipeline and the legacy T5580 pipeline; the status value itself
|
|
177
|
+
* discriminates which pipeline owns the row).
|
|
178
|
+
*
|
|
179
|
+
* **New T9492 pipeline** — SPEC-T9345 §10.1 FSM:
|
|
180
|
+
* `planned → pr-opened → pr-merged → published → reconciled`
|
|
181
|
+
*
|
|
182
|
+
* **Legacy T5580 pipeline** — pre-T9492 12-step flow:
|
|
183
|
+
* `prepared → committed → tagged → pushed`
|
|
184
|
+
*
|
|
185
|
+
* **Shared terminal states**:
|
|
186
|
+
* `rolled_back | failed | cancelled`
|
|
187
|
+
*
|
|
188
|
+
* State transitions per R-302 MUST be monotonic within each lifecycle;
|
|
189
|
+
* illegal transitions return `E_INVALID_STATE` and MUST NOT mutate any row.
|
|
190
|
+
*
|
|
191
|
+
* @task T9508
|
|
192
|
+
* @task T9686 (unification — legacy + new statuses on one column)
|
|
193
|
+
* @see SPEC-T9345 §10.1
|
|
194
|
+
*/
|
|
195
|
+
export type ReleaseStatus = 'planned' | 'pr-opened' | 'pr-merged' | 'published' | 'reconciled' | 'prepared' | 'committed' | 'tagged' | 'pushed' | 'rolled_back' | 'failed' | 'cancelled';
|
|
196
|
+
/**
|
|
197
|
+
* 12-value CLEO release change taxonomy (Option B from
|
|
198
|
+
* provenance-graph-design.md §2.2).
|
|
199
|
+
*
|
|
200
|
+
* Lives at the release-changes level (not on `tasks.kind`) so that:
|
|
201
|
+
* - A single task can produce multiple change rows across releases.
|
|
202
|
+
* - Hotfix classification is a release-packaging decision, not a task property.
|
|
203
|
+
* - Auto-classification is agent-writable without touching OWNER-WRITE-ONLY fields.
|
|
204
|
+
*
|
|
205
|
+
* @task T9508
|
|
206
|
+
* @see SPEC-T9345 §2.2
|
|
207
|
+
*/
|
|
208
|
+
export type ReleaseChangeType = 'feature' | 'enhancement' | 'bug' | 'hotfix' | 'security' | 'breaking' | 'refactor' | 'docs' | 'chore' | 'revert' | 'deprecation' | 'infrastructure';
|
|
209
|
+
/**
|
|
210
|
+
* Impact level for a release change, mapped to semver bump assessment.
|
|
211
|
+
*
|
|
212
|
+
* - `major` — breaking change (MAJOR bump)
|
|
213
|
+
* - `minor` — new feature (MINOR bump)
|
|
214
|
+
* - `patch` — bug fix / chore (PATCH bump)
|
|
215
|
+
* - `none` — cosmetic / docs / trivial (no version bump warranted alone)
|
|
216
|
+
*
|
|
217
|
+
* @task T9508
|
|
218
|
+
*/
|
|
219
|
+
export type ReleaseImpact = 'major' | 'minor' | 'patch' | 'none';
|
|
220
|
+
/**
|
|
221
|
+
* Provenance of a release-change classification.
|
|
222
|
+
*
|
|
223
|
+
* - `auto` — derived by the classification engine from CC prefix + heuristics
|
|
224
|
+
* - `manual` — owner overrode the auto classification via `cleo release classify`
|
|
225
|
+
* - `approved` — owner approved an agent-proposed classification
|
|
226
|
+
*
|
|
227
|
+
* @task T9508
|
|
228
|
+
*/
|
|
229
|
+
export type ReleaseClassifiedBy = 'auto' | 'manual' | 'approved';
|
|
230
|
+
/**
|
|
231
|
+
* Release artifact archetype.
|
|
232
|
+
*
|
|
233
|
+
* - `npm` — npm package published to a registry
|
|
234
|
+
* - `cargo` — Rust crate published to crates.io
|
|
235
|
+
* - `docker` — Container image pushed to an OCI registry
|
|
236
|
+
* - `pypi` — Python package published to pypi.org
|
|
237
|
+
* - `github-release` — GitHub Releases asset attached to a git tag
|
|
238
|
+
* - `binary` — Generic compiled binary distributed via direct URL
|
|
239
|
+
* - `github-tag` — Lightweight git tag (no attached assets)
|
|
240
|
+
*
|
|
241
|
+
* @task T9509
|
|
242
|
+
* @see SPEC-T9345 §3.9
|
|
243
|
+
*/
|
|
244
|
+
export type ReleaseArtifactType = 'npm' | 'cargo' | 'docker' | 'pypi' | 'github-release' | 'binary' | 'github-tag';
|
|
245
|
+
/**
|
|
246
|
+
* Semantic relationship between a BRAIN entry and a release.
|
|
247
|
+
*
|
|
248
|
+
* - `approved-by` — A BRAIN decision approved a change that shipped in this release.
|
|
249
|
+
* - `documented-in` — This release is where the BRAIN entry was first formally documented.
|
|
250
|
+
* - `derived-from` — The release's failure or outcome produced this BRAIN learning/pattern.
|
|
251
|
+
* - `observed-in` — A BRAIN observation was made about this release (e.g. performance note).
|
|
252
|
+
*
|
|
253
|
+
* @task T9509
|
|
254
|
+
* @see SPEC-T9345 §8.1
|
|
255
|
+
*/
|
|
256
|
+
export type BrainReleaseLinkType = 'approved-by' | 'documented-in' | 'derived-from' | 'observed-in';
|
|
257
|
+
//# sourceMappingURL=provenance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provenance.d.ts","sourceRoot":"","sources":["../src/provenance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAIH;;;;;;;;;GASG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEnD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,SAAS,GAAG,aAAa,GAAG,gBAAgB,GAAG,QAAQ,CAAC;AAEhG;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,UAAU,GAClB,YAAY,GACZ,OAAO,GACP,WAAW,GACX,OAAO,GACP,MAA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Q,GACR,aAAa,GACb,gBAAgB,CAAC;AAErB;;;;;;;;;GASG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAEjE;;;;;;;;GAQG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAC;AAIjE;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,mBAAmB,GAC3B,KAAK,GACL,OAAO,GACP,QAAQ,GACR,MAAM,GACN,gBAAgB,GAChB,QAAQ,GACR,YAAY,CAAC;AAEjB;;;;;;;;;;GAUG;AACH,MAAM,MAAM,oBAAoB,GAAG,aAAa,GAAG,eAAe,GAAG,cAAc,GAAG,aAAa,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provenance graph union types.
|
|
3
|
+
*
|
|
4
|
+
* Canonical home for the 16 string-literal union types that describe edges
|
|
5
|
+
* and FSM states in the CLEO provenance graph (commits, pull requests,
|
|
6
|
+
* releases, release artifacts, and BRAIN↔release links). Promoted from
|
|
7
|
+
* `packages/core/src/store/tasks-schema.ts` in Phase 0c of the
|
|
8
|
+
* SG-ARCH-SOLID Saga so that downstream packages can import these unions
|
|
9
|
+
* without pulling in the Drizzle schema runtime.
|
|
10
|
+
*
|
|
11
|
+
* The const arrays that back each union (`PR_STATES`, `COMMIT_LINK_KINDS`,
|
|
12
|
+
* `RELEASE_STATUSES`, …) remain in `tasks-schema.ts` because Drizzle's
|
|
13
|
+
* `text({ enum: ... })` column declaration narrows the runtime row type
|
|
14
|
+
* directly from those `as const` literals. `tasks-schema.ts` re-exports
|
|
15
|
+
* each union from this module to preserve the existing public surface for
|
|
16
|
+
* every `import * as schema from '../store/tasks-schema.js'` consumer.
|
|
17
|
+
*
|
|
18
|
+
* @see SPEC-T9345 §3 — provenance graph table definitions
|
|
19
|
+
* @see ADR-073 — task hierarchy charter (release provenance scope)
|
|
20
|
+
*
|
|
21
|
+
* Consolidated unions:
|
|
22
|
+
* - {@link PrState} — pull-request lifecycle state
|
|
23
|
+
* - {@link PrLinkSource} — how a PR↔task link was discovered
|
|
24
|
+
* - {@link PrLinkKind} — semantic PR↔task relationship
|
|
25
|
+
* - {@link CommitConventionalType} — Conventional Commits prefix
|
|
26
|
+
* - {@link CommitLinkKind} — semantic commit↔task relationship
|
|
27
|
+
* - {@link CommitLinkSource} — how a commit↔task link was discovered
|
|
28
|
+
* - {@link CommitFileChangeType} — git status letter (A/M/D/R/C)
|
|
29
|
+
* - {@link ReleaseScheme} — versioning scheme
|
|
30
|
+
* - {@link ReleaseChannel} — npm dist-tag channel
|
|
31
|
+
* - {@link ReleaseKind} — release packaging type
|
|
32
|
+
* - {@link ReleaseStatus} — unified release FSM state
|
|
33
|
+
* - {@link ReleaseChangeType} — 12-value change taxonomy
|
|
34
|
+
* - {@link ReleaseImpact} — semver impact level
|
|
35
|
+
* - {@link ReleaseClassifiedBy} — change-classification provenance
|
|
36
|
+
* - {@link ReleaseArtifactType} — artifact archetype
|
|
37
|
+
* - {@link BrainReleaseLinkType} — BRAIN↔release link semantics
|
|
38
|
+
*
|
|
39
|
+
* @since SG-ARCH-SOLID Saga T9831 · E-CONTRACTS-FOUNDATION T9832 · T9955 (Phase 0c)
|
|
40
|
+
*/
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=provenance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provenance.js","sourceRoot":"","sources":["../src/provenance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG"}
|
package/dist/release/plan.d.ts
CHANGED
|
@@ -110,8 +110,8 @@ export declare const ReleaseSchemeSchema: z.ZodEnum<{
|
|
|
110
110
|
}>;
|
|
111
111
|
/** Zod schema for {@link RELEASE_KIND}. */
|
|
112
112
|
export declare const ReleaseKindSchema: z.ZodEnum<{
|
|
113
|
-
regular: "regular";
|
|
114
113
|
hotfix: "hotfix";
|
|
114
|
+
regular: "regular";
|
|
115
115
|
prerelease: "prerelease";
|
|
116
116
|
}>;
|
|
117
117
|
/** Zod schema for {@link RELEASE_STATUS}. */
|
|
@@ -119,10 +119,10 @@ export declare const ReleaseStatusSchema: z.ZodEnum<{
|
|
|
119
119
|
failed: "failed";
|
|
120
120
|
cancelled: "cancelled";
|
|
121
121
|
planned: "planned";
|
|
122
|
+
reconciled: "reconciled";
|
|
122
123
|
"pr-opened": "pr-opened";
|
|
123
124
|
"pr-merged": "pr-merged";
|
|
124
125
|
published: "published";
|
|
125
|
-
reconciled: "reconciled";
|
|
126
126
|
rolled_back: "rolled_back";
|
|
127
127
|
}>;
|
|
128
128
|
/** Zod schema for {@link GATE_STATUS}. */
|
|
@@ -169,8 +169,8 @@ export declare const TaskKindSchema: z.ZodEnum<{
|
|
|
169
169
|
refactor: "refactor";
|
|
170
170
|
chore: "chore";
|
|
171
171
|
breaking: "breaking";
|
|
172
|
-
hotfix: "hotfix";
|
|
173
172
|
revert: "revert";
|
|
173
|
+
hotfix: "hotfix";
|
|
174
174
|
}>;
|
|
175
175
|
/** Zod schema for {@link IMPACT}. */
|
|
176
176
|
export declare const ImpactSchema: z.ZodEnum<{
|
|
@@ -207,8 +207,8 @@ export declare const ReleasePlanTaskSchema: z.ZodObject<{
|
|
|
207
207
|
refactor: "refactor";
|
|
208
208
|
chore: "chore";
|
|
209
209
|
breaking: "breaking";
|
|
210
|
-
hotfix: "hotfix";
|
|
211
210
|
revert: "revert";
|
|
211
|
+
hotfix: "hotfix";
|
|
212
212
|
}>;
|
|
213
213
|
impact: z.ZodEnum<{
|
|
214
214
|
major: "major";
|
|
@@ -352,8 +352,8 @@ export declare const ReleasePlanSchema: z.ZodObject<{
|
|
|
352
352
|
}>;
|
|
353
353
|
epicId: z.ZodString;
|
|
354
354
|
releaseKind: z.ZodEnum<{
|
|
355
|
-
regular: "regular";
|
|
356
355
|
hotfix: "hotfix";
|
|
356
|
+
regular: "regular";
|
|
357
357
|
prerelease: "prerelease";
|
|
358
358
|
}>;
|
|
359
359
|
createdAt: z.ZodISODateTime;
|
|
@@ -372,8 +372,8 @@ export declare const ReleasePlanSchema: z.ZodObject<{
|
|
|
372
372
|
refactor: "refactor";
|
|
373
373
|
chore: "chore";
|
|
374
374
|
breaking: "breaking";
|
|
375
|
-
hotfix: "hotfix";
|
|
376
375
|
revert: "revert";
|
|
376
|
+
hotfix: "hotfix";
|
|
377
377
|
}>;
|
|
378
378
|
impact: z.ZodEnum<{
|
|
379
379
|
major: "major";
|
|
@@ -449,10 +449,10 @@ export declare const ReleasePlanSchema: z.ZodObject<{
|
|
|
449
449
|
failed: "failed";
|
|
450
450
|
cancelled: "cancelled";
|
|
451
451
|
planned: "planned";
|
|
452
|
+
reconciled: "reconciled";
|
|
452
453
|
"pr-opened": "pr-opened";
|
|
453
454
|
"pr-merged": "pr-merged";
|
|
454
455
|
published: "published";
|
|
455
|
-
reconciled: "reconciled";
|
|
456
456
|
rolled_back: "rolled_back";
|
|
457
457
|
}>;
|
|
458
458
|
meta: z.ZodOptional<z.ZodObject<{
|