@cleocode/cleo 2026.5.87 → 2026.5.88
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/cli/index.js +189 -149
- package/dist/cli/index.js.map +3 -3
- package/package.json +11 -11
package/dist/cli/index.js
CHANGED
|
@@ -1538,6 +1538,45 @@ var init_branch_lock = __esm({
|
|
|
1538
1538
|
}
|
|
1539
1539
|
});
|
|
1540
1540
|
|
|
1541
|
+
// packages/contracts/src/changesets.ts
|
|
1542
|
+
import { z as z3 } from "zod";
|
|
1543
|
+
var CHANGESET_KINDS, TASK_ID_RE, ChangesetEntrySchema;
|
|
1544
|
+
var init_changesets = __esm({
|
|
1545
|
+
"packages/contracts/src/changesets.ts"() {
|
|
1546
|
+
"use strict";
|
|
1547
|
+
CHANGESET_KINDS = [
|
|
1548
|
+
"feat",
|
|
1549
|
+
"fix",
|
|
1550
|
+
"perf",
|
|
1551
|
+
"refactor",
|
|
1552
|
+
"docs",
|
|
1553
|
+
"test",
|
|
1554
|
+
"chore",
|
|
1555
|
+
"breaking"
|
|
1556
|
+
];
|
|
1557
|
+
TASK_ID_RE = /^(T\d+(-[A-Z][A-Za-z0-9]*)?|E-\d+(-[A-Z][A-Za-z0-9]*)?)$/;
|
|
1558
|
+
ChangesetEntrySchema = z3.object({
|
|
1559
|
+
/** Filename slug (without the `.md` extension). */
|
|
1560
|
+
id: z3.string().min(1, "id must be non-empty").regex(/^[a-z0-9][a-z0-9-]*$/, "id must be kebab-case (lowercase, digits, hyphens)"),
|
|
1561
|
+
/** One or more CLEO task IDs this change is anchored to. */
|
|
1562
|
+
tasks: z3.array(z3.string().regex(TASK_ID_RE, "task ID must match T#### or E-#### format")).min(1, "tasks must contain at least one task ID"),
|
|
1563
|
+
/** Type of change. */
|
|
1564
|
+
kind: z3.enum(CHANGESET_KINDS),
|
|
1565
|
+
/** Single-line user-facing description. */
|
|
1566
|
+
summary: z3.string().min(1, "summary must be non-empty"),
|
|
1567
|
+
/** Linked PR numbers, when known. */
|
|
1568
|
+
prs: z3.array(z3.number().int().positive()).optional(),
|
|
1569
|
+
/** Markdown body — longer-form explanation. */
|
|
1570
|
+
notes: z3.string().optional(),
|
|
1571
|
+
/** Migration note. Required iff `kind === 'breaking'`. */
|
|
1572
|
+
breaking: z3.string().optional()
|
|
1573
|
+
}).refine((entry) => entry.kind !== "breaking" || (entry.breaking?.length ?? 0) > 0, {
|
|
1574
|
+
message: "breaking entries must include a non-empty `breaking` migration note",
|
|
1575
|
+
path: ["breaking"]
|
|
1576
|
+
});
|
|
1577
|
+
}
|
|
1578
|
+
});
|
|
1579
|
+
|
|
1541
1580
|
// packages/contracts/src/credentials.ts
|
|
1542
1581
|
var init_credentials = __esm({
|
|
1543
1582
|
"packages/contracts/src/credentials.ts"() {
|
|
@@ -1679,58 +1718,58 @@ var init_errors = __esm({
|
|
|
1679
1718
|
});
|
|
1680
1719
|
|
|
1681
1720
|
// packages/contracts/src/evidence-record-schema.ts
|
|
1682
|
-
import { z as
|
|
1721
|
+
import { z as z4 } from "zod";
|
|
1683
1722
|
var evidenceBaseSchema, implDiffRecordSchema, validateSpecCheckRecordSchema, testOutputRecordSchema, lintReportRecordSchema, commandOutputRecordSchema, evidenceRecordSchema;
|
|
1684
1723
|
var init_evidence_record_schema = __esm({
|
|
1685
1724
|
"packages/contracts/src/evidence-record-schema.ts"() {
|
|
1686
1725
|
"use strict";
|
|
1687
|
-
evidenceBaseSchema =
|
|
1726
|
+
evidenceBaseSchema = z4.object({
|
|
1688
1727
|
/** Identity string of the agent that produced this record. */
|
|
1689
|
-
agentIdentity:
|
|
1728
|
+
agentIdentity: z4.string().min(1),
|
|
1690
1729
|
/** SHA-256 hex digest (64 chars) of the attached artifact. */
|
|
1691
|
-
attachmentSha256:
|
|
1730
|
+
attachmentSha256: z4.string().length(64),
|
|
1692
1731
|
/** ISO 8601 timestamp at which the action ran. */
|
|
1693
|
-
ranAt:
|
|
1732
|
+
ranAt: z4.string().datetime(),
|
|
1694
1733
|
/** Wall-clock duration of the action in milliseconds. */
|
|
1695
|
-
durationMs:
|
|
1734
|
+
durationMs: z4.number().nonnegative()
|
|
1696
1735
|
});
|
|
1697
1736
|
implDiffRecordSchema = evidenceBaseSchema.extend({
|
|
1698
|
-
kind:
|
|
1699
|
-
phase:
|
|
1700
|
-
filesChanged:
|
|
1701
|
-
linesAdded:
|
|
1702
|
-
linesRemoved:
|
|
1737
|
+
kind: z4.literal("impl-diff"),
|
|
1738
|
+
phase: z4.literal("implement"),
|
|
1739
|
+
filesChanged: z4.array(z4.string().min(1)).min(1),
|
|
1740
|
+
linesAdded: z4.number().int().nonnegative(),
|
|
1741
|
+
linesRemoved: z4.number().int().nonnegative()
|
|
1703
1742
|
});
|
|
1704
1743
|
validateSpecCheckRecordSchema = evidenceBaseSchema.extend({
|
|
1705
|
-
kind:
|
|
1706
|
-
phase:
|
|
1707
|
-
reqIdsChecked:
|
|
1708
|
-
passed:
|
|
1709
|
-
details:
|
|
1744
|
+
kind: z4.literal("validate-spec-check"),
|
|
1745
|
+
phase: z4.literal("validate"),
|
|
1746
|
+
reqIdsChecked: z4.array(z4.string().min(1)).min(1),
|
|
1747
|
+
passed: z4.boolean(),
|
|
1748
|
+
details: z4.string().min(1)
|
|
1710
1749
|
});
|
|
1711
1750
|
testOutputRecordSchema = evidenceBaseSchema.extend({
|
|
1712
|
-
kind:
|
|
1713
|
-
phase:
|
|
1714
|
-
command:
|
|
1715
|
-
exitCode:
|
|
1716
|
-
testsPassed:
|
|
1717
|
-
testsFailed:
|
|
1751
|
+
kind: z4.literal("test-output"),
|
|
1752
|
+
phase: z4.literal("test"),
|
|
1753
|
+
command: z4.string().min(1),
|
|
1754
|
+
exitCode: z4.number().int(),
|
|
1755
|
+
testsPassed: z4.number().int().nonnegative(),
|
|
1756
|
+
testsFailed: z4.number().int().nonnegative()
|
|
1718
1757
|
});
|
|
1719
1758
|
lintReportRecordSchema = evidenceBaseSchema.extend({
|
|
1720
|
-
kind:
|
|
1721
|
-
phase:
|
|
1722
|
-
tool:
|
|
1723
|
-
passed:
|
|
1724
|
-
warnings:
|
|
1725
|
-
errors:
|
|
1759
|
+
kind: z4.literal("lint-report"),
|
|
1760
|
+
phase: z4.enum(["implement", "test"]),
|
|
1761
|
+
tool: z4.string().min(1),
|
|
1762
|
+
passed: z4.boolean(),
|
|
1763
|
+
warnings: z4.number().int().nonnegative(),
|
|
1764
|
+
errors: z4.number().int().nonnegative()
|
|
1726
1765
|
});
|
|
1727
1766
|
commandOutputRecordSchema = evidenceBaseSchema.extend({
|
|
1728
|
-
kind:
|
|
1729
|
-
phase:
|
|
1730
|
-
cmd:
|
|
1731
|
-
exitCode:
|
|
1767
|
+
kind: z4.literal("command-output"),
|
|
1768
|
+
phase: z4.enum(["implement", "validate", "test"]),
|
|
1769
|
+
cmd: z4.string().min(1),
|
|
1770
|
+
exitCode: z4.number().int()
|
|
1732
1771
|
});
|
|
1733
|
-
evidenceRecordSchema =
|
|
1772
|
+
evidenceRecordSchema = z4.discriminatedUnion("kind", [
|
|
1734
1773
|
implDiffRecordSchema,
|
|
1735
1774
|
validateSpecCheckRecordSchema,
|
|
1736
1775
|
testOutputRecordSchema,
|
|
@@ -2544,7 +2583,7 @@ var init_peer = __esm({
|
|
|
2544
2583
|
});
|
|
2545
2584
|
|
|
2546
2585
|
// packages/contracts/src/release/plan.ts
|
|
2547
|
-
import { z as
|
|
2586
|
+
import { z as z5 } from "zod";
|
|
2548
2587
|
var RELEASE_CHANNEL, RELEASE_SCHEME, RELEASE_KIND, RELEASE_STATUS, GATE_STATUS, GATE_NAME, PLATFORM_TUPLE, PUBLISHER, TASK_KIND, IMPACT, RESOLVED_SOURCE, ReleaseChannelSchema, ReleaseSchemeSchema, ReleaseKindSchema, ReleaseStatusSchema, GateStatusSchema, GateNameSchema, PlatformTupleSchema, PublisherSchema, TaskKindSchema, ImpactSchema, ResolvedSourceSchema, Iso8601, NonEmptyString, ReleasePlanTaskSchema, ReleaseGateSchema, ReleasePlatformMatrixEntrySchema, ReleasePreflightSummarySchema, ReleasePlanChangelogSchema, ReleasePlanMetaSchema, ReleasePlanSchema;
|
|
2549
2588
|
var init_plan = __esm({
|
|
2550
2589
|
"packages/contracts/src/release/plan.ts"() {
|
|
@@ -2587,20 +2626,20 @@ var init_plan = __esm({
|
|
|
2587
2626
|
];
|
|
2588
2627
|
IMPACT = ["major", "minor", "patch"];
|
|
2589
2628
|
RESOLVED_SOURCE = ["project-context", "language-default", "legacy-alias"];
|
|
2590
|
-
ReleaseChannelSchema =
|
|
2591
|
-
ReleaseSchemeSchema =
|
|
2592
|
-
ReleaseKindSchema =
|
|
2593
|
-
ReleaseStatusSchema =
|
|
2594
|
-
GateStatusSchema =
|
|
2595
|
-
GateNameSchema =
|
|
2596
|
-
PlatformTupleSchema =
|
|
2597
|
-
PublisherSchema =
|
|
2598
|
-
TaskKindSchema =
|
|
2599
|
-
ImpactSchema =
|
|
2600
|
-
ResolvedSourceSchema =
|
|
2601
|
-
Iso8601 =
|
|
2602
|
-
NonEmptyString =
|
|
2603
|
-
ReleasePlanTaskSchema =
|
|
2629
|
+
ReleaseChannelSchema = z5.enum(RELEASE_CHANNEL);
|
|
2630
|
+
ReleaseSchemeSchema = z5.enum(RELEASE_SCHEME);
|
|
2631
|
+
ReleaseKindSchema = z5.enum(RELEASE_KIND);
|
|
2632
|
+
ReleaseStatusSchema = z5.enum(RELEASE_STATUS);
|
|
2633
|
+
GateStatusSchema = z5.enum(GATE_STATUS);
|
|
2634
|
+
GateNameSchema = z5.enum(GATE_NAME);
|
|
2635
|
+
PlatformTupleSchema = z5.enum(PLATFORM_TUPLE);
|
|
2636
|
+
PublisherSchema = z5.enum(PUBLISHER);
|
|
2637
|
+
TaskKindSchema = z5.enum(TASK_KIND);
|
|
2638
|
+
ImpactSchema = z5.enum(IMPACT);
|
|
2639
|
+
ResolvedSourceSchema = z5.enum(RESOLVED_SOURCE);
|
|
2640
|
+
Iso8601 = z5.iso.datetime({ offset: true });
|
|
2641
|
+
NonEmptyString = z5.string().min(1);
|
|
2642
|
+
ReleasePlanTaskSchema = z5.object({
|
|
2604
2643
|
/** Task ID (e.g. "T10001"). Format intentionally loose so historical IDs validate. */
|
|
2605
2644
|
id: NonEmptyString,
|
|
2606
2645
|
/** Conventional-commit-aligned task classification. */
|
|
@@ -2608,20 +2647,20 @@ var init_plan = __esm({
|
|
|
2608
2647
|
/** SemVer impact classification. */
|
|
2609
2648
|
impact: ImpactSchema,
|
|
2610
2649
|
/** Human-readable changelog line for this task. */
|
|
2611
|
-
userFacingSummary:
|
|
2650
|
+
userFacingSummary: z5.string(),
|
|
2612
2651
|
/**
|
|
2613
2652
|
* ADR-051 evidence atoms attesting the task's gate results. Format is
|
|
2614
2653
|
* `kind:value` (e.g. `commit:abc123`, `test-run:vitest.json`). The contract
|
|
2615
2654
|
* accepts empty arrays so legacy plans validate; `cleo release plan`
|
|
2616
2655
|
* enforces non-empty via R-301.
|
|
2617
2656
|
*/
|
|
2618
|
-
evidenceAtoms:
|
|
2657
|
+
evidenceAtoms: z5.array(NonEmptyString),
|
|
2619
2658
|
/** IVTR phase at plan time — informational only per R-316. */
|
|
2620
|
-
ivtrPhaseAtPlan:
|
|
2659
|
+
ivtrPhaseAtPlan: z5.string().optional(),
|
|
2621
2660
|
/** Epic this task rolls up to, locked at plan time per R-303. */
|
|
2622
2661
|
epicAncestor: NonEmptyString
|
|
2623
2662
|
});
|
|
2624
|
-
ReleaseGateSchema =
|
|
2663
|
+
ReleaseGateSchema = z5.object({
|
|
2625
2664
|
/** Canonical gate name. */
|
|
2626
2665
|
name: GateNameSchema,
|
|
2627
2666
|
/** ADR-051 atom string identifying the resolved tool (e.g. `tool:test`). */
|
|
@@ -2631,11 +2670,11 @@ var init_plan = __esm({
|
|
|
2631
2670
|
/** ISO-8601 timestamp the gate was last verified. */
|
|
2632
2671
|
lastVerifiedAt: Iso8601,
|
|
2633
2672
|
/** Resolved shell command (e.g. `pnpm run test`). Optional for unresolved gates. */
|
|
2634
|
-
resolvedCommand:
|
|
2673
|
+
resolvedCommand: z5.string().optional(),
|
|
2635
2674
|
/** Provenance of the resolved command. Optional for unresolved gates. */
|
|
2636
2675
|
resolvedSource: ResolvedSourceSchema.optional()
|
|
2637
2676
|
});
|
|
2638
|
-
ReleasePlatformMatrixEntrySchema =
|
|
2677
|
+
ReleasePlatformMatrixEntrySchema = z5.object({
|
|
2639
2678
|
/** Target platform tuple. */
|
|
2640
2679
|
platform: PlatformTupleSchema,
|
|
2641
2680
|
/** Distribution backend. */
|
|
@@ -2643,47 +2682,47 @@ var init_plan = __esm({
|
|
|
2643
2682
|
/** Package identifier on the target backend (e.g. `@cleocode/cleo`). */
|
|
2644
2683
|
package: NonEmptyString,
|
|
2645
2684
|
/** Whether to run the GHA smoke job for this matrix entry. */
|
|
2646
|
-
smoke:
|
|
2685
|
+
smoke: z5.boolean().default(true).optional()
|
|
2647
2686
|
});
|
|
2648
|
-
ReleasePreflightSummarySchema =
|
|
2687
|
+
ReleasePreflightSummarySchema = z5.object({
|
|
2649
2688
|
/** True if esbuild externals are out of sync with package.json. */
|
|
2650
|
-
esbuildExternalsDrift:
|
|
2689
|
+
esbuildExternalsDrift: z5.boolean(),
|
|
2651
2690
|
/** True if `pnpm-lock.yaml` diverges from the workspace manifest. */
|
|
2652
|
-
lockfileDrift:
|
|
2691
|
+
lockfileDrift: z5.boolean(),
|
|
2653
2692
|
/** True if all epic children are in terminal lifecycle states. */
|
|
2654
|
-
epicCompletenessClean:
|
|
2693
|
+
epicCompletenessClean: z5.boolean(),
|
|
2655
2694
|
/** True if no task appears in multiple in-flight release plans. */
|
|
2656
|
-
doubleListingClean:
|
|
2695
|
+
doubleListingClean: z5.boolean(),
|
|
2657
2696
|
/** Non-fatal preflight warnings (e.g. unresolved tools per R-024). */
|
|
2658
|
-
preflightWarnings:
|
|
2697
|
+
preflightWarnings: z5.array(z5.string()).default([]).optional()
|
|
2659
2698
|
});
|
|
2660
|
-
ReleasePlanChangelogSchema =
|
|
2699
|
+
ReleasePlanChangelogSchema = z5.object({
|
|
2661
2700
|
/** `kind=feat` tasks. */
|
|
2662
|
-
features:
|
|
2701
|
+
features: z5.array(NonEmptyString).default([]),
|
|
2663
2702
|
/** `kind=fix` or `kind=hotfix` tasks. */
|
|
2664
|
-
fixes:
|
|
2703
|
+
fixes: z5.array(NonEmptyString).default([]),
|
|
2665
2704
|
/** `kind=chore`, `docs`, `refactor`, `test`, `perf` tasks. */
|
|
2666
|
-
chores:
|
|
2705
|
+
chores: z5.array(NonEmptyString).default([]),
|
|
2667
2706
|
/** `kind=breaking` or `kind=revert` tasks. */
|
|
2668
|
-
breaking:
|
|
2707
|
+
breaking: z5.array(NonEmptyString).default([])
|
|
2669
2708
|
});
|
|
2670
|
-
ReleasePlanMetaSchema =
|
|
2709
|
+
ReleasePlanMetaSchema = z5.object({
|
|
2671
2710
|
/** True if this is the project's first ever release. */
|
|
2672
|
-
firstEverRelease:
|
|
2711
|
+
firstEverRelease: z5.boolean().optional(),
|
|
2673
2712
|
/** Canonical tool names that could not be resolved at plan time. */
|
|
2674
|
-
unresolvedTools:
|
|
2713
|
+
unresolvedTools: z5.array(z5.string()).optional(),
|
|
2675
2714
|
/** Project archetype detected at plan time. */
|
|
2676
|
-
archetype:
|
|
2677
|
-
}).catchall(
|
|
2678
|
-
ReleasePlanSchema =
|
|
2715
|
+
archetype: z5.string().optional()
|
|
2716
|
+
}).catchall(z5.unknown());
|
|
2717
|
+
ReleasePlanSchema = z5.object({
|
|
2679
2718
|
/** Schema URL for this plan version. */
|
|
2680
|
-
$schema:
|
|
2719
|
+
$schema: z5.string().optional(),
|
|
2681
2720
|
/** Requested version string (e.g. "v2026.6.0"). Includes the leading `v`. */
|
|
2682
2721
|
version: NonEmptyString,
|
|
2683
2722
|
/** Resolved version string after suffix application (e.g. "v2026.6.0.2"). */
|
|
2684
2723
|
resolvedVersion: NonEmptyString,
|
|
2685
2724
|
/** True if a `calver-suffix` was applied to disambiguate a same-day hotfix. */
|
|
2686
|
-
suffixApplied:
|
|
2725
|
+
suffixApplied: z5.boolean(),
|
|
2687
2726
|
/** Versioning scheme governing `version` / `resolvedVersion`. */
|
|
2688
2727
|
scheme: ReleaseSchemeSchema,
|
|
2689
2728
|
/** npm dist-tag channel for this release. */
|
|
@@ -2700,27 +2739,27 @@ var init_plan = __esm({
|
|
|
2700
2739
|
* Version of the previous release on the same channel. MUST be `null` only
|
|
2701
2740
|
* for first-ever releases (R-300, enforced at the verb layer).
|
|
2702
2741
|
*/
|
|
2703
|
-
previousVersion:
|
|
2742
|
+
previousVersion: z5.string().nullable(),
|
|
2704
2743
|
/** Git tag of the previous release (typically `previousVersion` prefixed). */
|
|
2705
|
-
previousTag:
|
|
2744
|
+
previousTag: z5.string().nullable(),
|
|
2706
2745
|
/** ISO-8601 timestamp the previous release was published. */
|
|
2707
2746
|
previousShippedAt: Iso8601.nullable(),
|
|
2708
2747
|
/** Tasks rolled into this release. */
|
|
2709
|
-
tasks:
|
|
2748
|
+
tasks: z5.array(ReleasePlanTaskSchema),
|
|
2710
2749
|
/** Bucketed changelog. */
|
|
2711
2750
|
changelog: ReleasePlanChangelogSchema,
|
|
2712
2751
|
/** Per-gate verification status. */
|
|
2713
|
-
gates:
|
|
2752
|
+
gates: z5.array(ReleaseGateSchema),
|
|
2714
2753
|
/** Platform / publisher matrix. */
|
|
2715
|
-
platformMatrix:
|
|
2754
|
+
platformMatrix: z5.array(ReleasePlatformMatrixEntrySchema),
|
|
2716
2755
|
/** Preflight summary from `cleo release plan`. */
|
|
2717
2756
|
preflightSummary: ReleasePreflightSummarySchema,
|
|
2718
2757
|
/** URL of the GHA workflow run (populated by `release-prepare.yml`). */
|
|
2719
|
-
workflowRunUrl:
|
|
2758
|
+
workflowRunUrl: z5.string().nullable(),
|
|
2720
2759
|
/** URL of the bump PR (populated by `cleo release open`). */
|
|
2721
|
-
prUrl:
|
|
2760
|
+
prUrl: z5.string().nullable(),
|
|
2722
2761
|
/** Merge commit SHA on `main` (populated by `release-publish.yml`). */
|
|
2723
|
-
mergeCommitSha:
|
|
2762
|
+
mergeCommitSha: z5.string().nullable(),
|
|
2724
2763
|
/** Current FSM state per R-302. */
|
|
2725
2764
|
status: ReleaseStatusSchema,
|
|
2726
2765
|
/** Informational / forward-compat metadata. */
|
|
@@ -2737,52 +2776,52 @@ var init_session2 = __esm({
|
|
|
2737
2776
|
});
|
|
2738
2777
|
|
|
2739
2778
|
// packages/contracts/src/session-journal.ts
|
|
2740
|
-
import { z as
|
|
2779
|
+
import { z as z6 } from "zod";
|
|
2741
2780
|
var SESSION_JOURNAL_SCHEMA_VERSION, sessionJournalDoctorSummarySchema, sessionJournalDebriefSummarySchema, sessionJournalEntrySchema;
|
|
2742
2781
|
var init_session_journal = __esm({
|
|
2743
2782
|
"packages/contracts/src/session-journal.ts"() {
|
|
2744
2783
|
"use strict";
|
|
2745
2784
|
SESSION_JOURNAL_SCHEMA_VERSION = "1.0";
|
|
2746
|
-
sessionJournalDoctorSummarySchema =
|
|
2785
|
+
sessionJournalDoctorSummarySchema = z6.object({
|
|
2747
2786
|
/** `true` when zero noise patterns were detected. */
|
|
2748
|
-
isClean:
|
|
2787
|
+
isClean: z6.boolean(),
|
|
2749
2788
|
/** Total number of noise findings across all patterns. */
|
|
2750
|
-
findingsCount:
|
|
2789
|
+
findingsCount: z6.number().int().nonnegative(),
|
|
2751
2790
|
/** Pattern names that were detected (empty when isClean). */
|
|
2752
|
-
patterns:
|
|
2791
|
+
patterns: z6.array(z6.string()),
|
|
2753
2792
|
/** Total brain entries scanned. `0` = empty or unavailable. */
|
|
2754
|
-
totalScanned:
|
|
2793
|
+
totalScanned: z6.number().int().nonnegative()
|
|
2755
2794
|
});
|
|
2756
|
-
sessionJournalDebriefSummarySchema =
|
|
2795
|
+
sessionJournalDebriefSummarySchema = z6.object({
|
|
2757
2796
|
/** First 200 characters of the session end note (if provided). */
|
|
2758
|
-
noteExcerpt:
|
|
2797
|
+
noteExcerpt: z6.string().max(200).optional(),
|
|
2759
2798
|
/** Number of tasks completed during the session. */
|
|
2760
|
-
tasksCompletedCount:
|
|
2799
|
+
tasksCompletedCount: z6.number().int().nonnegative(),
|
|
2761
2800
|
/** Up to 5 task IDs (not titles) that were the focus of the session. */
|
|
2762
|
-
tasksFocused:
|
|
2801
|
+
tasksFocused: z6.array(z6.string()).max(5).optional()
|
|
2763
2802
|
});
|
|
2764
|
-
sessionJournalEntrySchema =
|
|
2803
|
+
sessionJournalEntrySchema = z6.object({
|
|
2765
2804
|
// Identity
|
|
2766
2805
|
/** Schema version for forward-compatibility. Always `'1.0'` in this release. */
|
|
2767
|
-
schemaVersion:
|
|
2806
|
+
schemaVersion: z6.literal(SESSION_JOURNAL_SCHEMA_VERSION),
|
|
2768
2807
|
/** ISO 8601 timestamp when the entry was written. */
|
|
2769
|
-
timestamp:
|
|
2808
|
+
timestamp: z6.string(),
|
|
2770
2809
|
/** CLEO session ID (e.g. `ses_20260424055456_ede571`). */
|
|
2771
|
-
sessionId:
|
|
2810
|
+
sessionId: z6.string(),
|
|
2772
2811
|
/** Event type that triggered this journal entry. */
|
|
2773
|
-
eventType:
|
|
2812
|
+
eventType: z6.enum(["session_start", "session_end", "observation", "decision", "error"]),
|
|
2774
2813
|
// Session metadata (set on session_start / session_end)
|
|
2775
2814
|
/** Agent identifier (e.g. `cleo-prime`, `claude-code`). */
|
|
2776
|
-
agentIdentifier:
|
|
2815
|
+
agentIdentifier: z6.string().optional(),
|
|
2777
2816
|
/** Provider adapter ID active for this session. */
|
|
2778
|
-
providerId:
|
|
2817
|
+
providerId: z6.string().optional(),
|
|
2779
2818
|
/** Session scope string (e.g. `'global'` or `'epic:T1263'`). */
|
|
2780
|
-
scope:
|
|
2819
|
+
scope: z6.string().optional(),
|
|
2781
2820
|
// Session-end fields
|
|
2782
2821
|
/** Duration of the session in seconds (session_end only). */
|
|
2783
|
-
duration:
|
|
2822
|
+
duration: z6.number().int().nonnegative().optional(),
|
|
2784
2823
|
/** Task IDs (not titles) completed during the session. */
|
|
2785
|
-
tasksCompleted:
|
|
2824
|
+
tasksCompleted: z6.array(z6.string()).optional(),
|
|
2786
2825
|
// Doctor summary (T1262 absorbed)
|
|
2787
2826
|
/** Compact result of `scanBrainNoise` run at session-end. */
|
|
2788
2827
|
doctorSummary: sessionJournalDoctorSummarySchema.optional(),
|
|
@@ -2791,7 +2830,7 @@ var init_session_journal = __esm({
|
|
|
2791
2830
|
debriefSummary: sessionJournalDebriefSummarySchema.optional(),
|
|
2792
2831
|
// Optional hash chain
|
|
2793
2832
|
/** SHA-256 hex of the previous entry's raw JSON string (for integrity chain). */
|
|
2794
|
-
prevEntryHash:
|
|
2833
|
+
prevEntryHash: z6.string().optional()
|
|
2795
2834
|
});
|
|
2796
2835
|
}
|
|
2797
2836
|
});
|
|
@@ -2837,52 +2876,52 @@ var init_task = __esm({
|
|
|
2837
2876
|
});
|
|
2838
2877
|
|
|
2839
2878
|
// packages/contracts/src/task-evidence.ts
|
|
2840
|
-
import { z as
|
|
2879
|
+
import { z as z7 } from "zod";
|
|
2841
2880
|
var fileEvidenceSchema, logEvidenceSchema, screenshotEvidenceSchema, testOutputEvidenceSchema, commandOutputEvidenceSchema, taskEvidenceSchema;
|
|
2842
2881
|
var init_task_evidence = __esm({
|
|
2843
2882
|
"packages/contracts/src/task-evidence.ts"() {
|
|
2844
2883
|
"use strict";
|
|
2845
|
-
fileEvidenceSchema =
|
|
2846
|
-
kind:
|
|
2847
|
-
sha256:
|
|
2848
|
-
timestamp:
|
|
2849
|
-
path:
|
|
2850
|
-
mime:
|
|
2851
|
-
description:
|
|
2852
|
-
});
|
|
2853
|
-
logEvidenceSchema =
|
|
2854
|
-
kind:
|
|
2855
|
-
sha256:
|
|
2856
|
-
timestamp:
|
|
2857
|
-
source:
|
|
2858
|
-
description:
|
|
2859
|
-
});
|
|
2860
|
-
screenshotEvidenceSchema =
|
|
2861
|
-
kind:
|
|
2862
|
-
sha256:
|
|
2863
|
-
timestamp:
|
|
2864
|
-
mime:
|
|
2865
|
-
description:
|
|
2866
|
-
});
|
|
2867
|
-
testOutputEvidenceSchema =
|
|
2868
|
-
kind:
|
|
2869
|
-
sha256:
|
|
2870
|
-
timestamp:
|
|
2871
|
-
passed:
|
|
2872
|
-
failed:
|
|
2873
|
-
skipped:
|
|
2874
|
-
exitCode:
|
|
2875
|
-
description:
|
|
2876
|
-
});
|
|
2877
|
-
commandOutputEvidenceSchema =
|
|
2878
|
-
kind:
|
|
2879
|
-
sha256:
|
|
2880
|
-
timestamp:
|
|
2881
|
-
cmd:
|
|
2882
|
-
exitCode:
|
|
2883
|
-
description:
|
|
2884
|
-
});
|
|
2885
|
-
taskEvidenceSchema =
|
|
2884
|
+
fileEvidenceSchema = z7.object({
|
|
2885
|
+
kind: z7.literal("file"),
|
|
2886
|
+
sha256: z7.string().length(64),
|
|
2887
|
+
timestamp: z7.string().datetime(),
|
|
2888
|
+
path: z7.string().min(1),
|
|
2889
|
+
mime: z7.string().optional(),
|
|
2890
|
+
description: z7.string().optional()
|
|
2891
|
+
});
|
|
2892
|
+
logEvidenceSchema = z7.object({
|
|
2893
|
+
kind: z7.literal("log"),
|
|
2894
|
+
sha256: z7.string().length(64),
|
|
2895
|
+
timestamp: z7.string().datetime(),
|
|
2896
|
+
source: z7.string().min(1),
|
|
2897
|
+
description: z7.string().optional()
|
|
2898
|
+
});
|
|
2899
|
+
screenshotEvidenceSchema = z7.object({
|
|
2900
|
+
kind: z7.literal("screenshot"),
|
|
2901
|
+
sha256: z7.string().length(64),
|
|
2902
|
+
timestamp: z7.string().datetime(),
|
|
2903
|
+
mime: z7.enum(["image/png", "image/jpeg", "image/webp"]).optional(),
|
|
2904
|
+
description: z7.string().optional()
|
|
2905
|
+
});
|
|
2906
|
+
testOutputEvidenceSchema = z7.object({
|
|
2907
|
+
kind: z7.literal("test-output"),
|
|
2908
|
+
sha256: z7.string().length(64),
|
|
2909
|
+
timestamp: z7.string().datetime(),
|
|
2910
|
+
passed: z7.number().int().nonnegative(),
|
|
2911
|
+
failed: z7.number().int().nonnegative(),
|
|
2912
|
+
skipped: z7.number().int().nonnegative(),
|
|
2913
|
+
exitCode: z7.number().int(),
|
|
2914
|
+
description: z7.string().optional()
|
|
2915
|
+
});
|
|
2916
|
+
commandOutputEvidenceSchema = z7.object({
|
|
2917
|
+
kind: z7.literal("command-output"),
|
|
2918
|
+
sha256: z7.string().length(64),
|
|
2919
|
+
timestamp: z7.string().datetime(),
|
|
2920
|
+
cmd: z7.string().min(1),
|
|
2921
|
+
exitCode: z7.number().int(),
|
|
2922
|
+
description: z7.string().optional()
|
|
2923
|
+
});
|
|
2924
|
+
taskEvidenceSchema = z7.discriminatedUnion("kind", [
|
|
2886
2925
|
fileEvidenceSchema,
|
|
2887
2926
|
logEvidenceSchema,
|
|
2888
2927
|
screenshotEvidenceSchema,
|
|
@@ -2893,12 +2932,12 @@ var init_task_evidence = __esm({
|
|
|
2893
2932
|
});
|
|
2894
2933
|
|
|
2895
2934
|
// packages/contracts/src/tasks/archive.ts
|
|
2896
|
-
import { z as
|
|
2935
|
+
import { z as z8 } from "zod";
|
|
2897
2936
|
var ArchiveReason, ARCHIVE_REASON_VALUES;
|
|
2898
2937
|
var init_archive = __esm({
|
|
2899
2938
|
"packages/contracts/src/tasks/archive.ts"() {
|
|
2900
2939
|
"use strict";
|
|
2901
|
-
ArchiveReason =
|
|
2940
|
+
ArchiveReason = z8.enum([
|
|
2902
2941
|
"verified",
|
|
2903
2942
|
"reconciled",
|
|
2904
2943
|
"superseded",
|
|
@@ -2916,6 +2955,7 @@ var init_src2 = __esm({
|
|
|
2916
2955
|
init_acceptance_gate_schema();
|
|
2917
2956
|
init_attachment_schema();
|
|
2918
2957
|
init_branch_lock();
|
|
2958
|
+
init_changesets();
|
|
2919
2959
|
init_credentials();
|
|
2920
2960
|
init_engine_result();
|
|
2921
2961
|
init_errors();
|
|
@@ -38674,7 +38714,7 @@ var init_check2 = __esm({
|
|
|
38674
38714
|
process.exit(1);
|
|
38675
38715
|
}
|
|
38676
38716
|
const lines = logOutput.trim().split("\n").filter(Boolean);
|
|
38677
|
-
const
|
|
38717
|
+
const TASK_ID_RE2 = /T[0-9]+/;
|
|
38678
38718
|
const EXEMPT_RE = /^(Merge |Revert |fixup! |squash! |amend! )/;
|
|
38679
38719
|
const untagged = [];
|
|
38680
38720
|
const total = lines.length;
|
|
@@ -38684,7 +38724,7 @@ var init_check2 = __esm({
|
|
|
38684
38724
|
const sha = line.slice(0, tabIdx).trim();
|
|
38685
38725
|
const subject = line.slice(tabIdx + 1).trim();
|
|
38686
38726
|
if (EXEMPT_RE.test(subject)) continue;
|
|
38687
|
-
if (!
|
|
38727
|
+
if (!TASK_ID_RE2.test(subject)) {
|
|
38688
38728
|
untagged.push({ sha: sha.slice(0, 12), subject });
|
|
38689
38729
|
}
|
|
38690
38730
|
}
|