@cleocode/contracts 2026.10.25 → 2026.10.26-rc.ci.697

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.
@@ -39,6 +39,11 @@ export interface AcceptanceGateRunOptions
39
39
  extends Pick<ProcessCaptureOptions, 'memoryMaxMb' | 'tasksMax'> {
40
40
  /** Explicit project root, or the captured operation's project root. */
41
41
  projectRoot?: string;
42
+ /**
43
+ * Task whose `task/<id>` worktree may be the tree the gates run in (T14058);
44
+ * absent skips that tier of `resolveTypedGateRoot`.
45
+ */
46
+ taskId?: string;
42
47
  /** Manual gates remain skipped and never become machine proof. */
43
48
  skipManual?: boolean;
44
49
  /** Original admitted operation, including project identity, deadline and cancellation. */
@@ -127,9 +132,10 @@ export interface GateBase {
127
132
  *
128
133
  * A positive `minCount` additionally requires the gate's OWN command to emit a
129
134
  * machine-readable report satisfying `testCountReportSchema` (e.g. by adding
130
- * `--reporter=json`). A run that emits none is an error, never a pass: an exit
131
- * code carries no count, and a report file written by some other invocation is
132
- * not bound to this execution.
135
+ * `--reporter=json`), a `testCountSummarySchema` last stdout line, or node:test
136
+ * TAP (`--test-reporter=tap`, T14051). A run that emits none is an error,
137
+ * never a pass: an exit code carries no count, and a report file written by
138
+ * some other invocation is not bound to this execution.
133
139
  */
134
140
  export interface TestGate extends GateBase {
135
141
  kind: 'test';
@@ -200,6 +200,30 @@ export interface WorktreeIntegrationPlan {
200
200
  reason: string;
201
201
  }
202
202
 
203
+ /**
204
+ * What completion knows about a task's worktree, read once through one model
205
+ * (T10871): where it is, which branch git has checked out there, how CLEO
206
+ * provisioned it, and whether it is locked or dirty.
207
+ */
208
+ export interface WorktreeLifecycleState {
209
+ /** Task ID. */
210
+ taskId: string;
211
+ /** Worktree path: the one git has registered for the task, else the canonical one. */
212
+ path: string;
213
+ /** Branch git reports checked out there; `task/<id>` when git has no worktree for the task. */
214
+ branch: string;
215
+ /** Whether git has a worktree registered for the task. */
216
+ registered: boolean;
217
+ /** Whether the worktree directory exists on disk. */
218
+ exists: boolean;
219
+ /** Newest provisioning row in the lifecycle audit log: `create`, `adopt`, or `null` (not CLEO's). */
220
+ provisioning: 'create' | 'adopt' | null;
221
+ /** Whether git holds a lock on the worktree. */
222
+ locked: boolean;
223
+ /** Whether the worktree has uncommitted changes (`git status --porcelain` non-empty). */
224
+ dirty: boolean;
225
+ }
226
+
203
227
  /**
204
228
  * The single integration result on the `cleo complete` envelope (T14053).
205
229
  * `action` is what happened: `merge` only when a merge commit was made.
@@ -4230,6 +4230,13 @@ export const OPERATIONS: OperationDef[] = [
4230
4230
  required: false,
4231
4231
  description: 'Progressive disclosure tier (0-2)',
4232
4232
  },
4233
+ {
4234
+ name: 'baseRef',
4235
+ type: 'string',
4236
+ required: false,
4237
+ description:
4238
+ 'T14046: ref the task branch is created from instead of HEAD; a provisioning failure refuses the spawn',
4239
+ },
4233
4240
  ],
4234
4241
  },
4235
4242
  {
package/src/done-plan.ts CHANGED
@@ -74,6 +74,10 @@ export type DonePlanBlockerCode =
74
74
  | 'qa-run-needed'
75
75
  | 'ac-mapping-needed'
76
76
  | 'manual-gate'
77
+ /** A required gate is not passed and `cleo done` cannot derive its evidence (T14036). */
78
+ | 'gate-not-derivable'
79
+ /** A `depends` edge points at a task that is not terminal; complete refuses (T14036). */
80
+ | 'dependency-unresolved'
77
81
  | 'epic-rollup'
78
82
  | 'run-from-worktree'
79
83
  | 'checkout-required'
package/src/index.ts CHANGED
@@ -201,6 +201,7 @@ export type {
201
201
  WorktreeIntegrationAction,
202
202
  WorktreeIntegrationOutcome,
203
203
  WorktreeIntegrationPlan,
204
+ WorktreeLifecycleState,
204
205
  WorktreeMergeResult,
205
206
  WorktreeSpawnResult,
206
207
  } from './branch-lock.js';
@@ -2372,6 +2373,7 @@ export type {
2372
2373
  MemoryConsumer,
2373
2374
  MemoryConsumers,
2374
2375
  MemoryPressureReading,
2376
+ ProjectSettingOverride,
2375
2377
  ResourceClass,
2376
2378
  ResourceDeferral,
2377
2379
  ResourceGrant,
@@ -126,6 +126,23 @@ const tasksShowOutputContract: OperationOutputContract = {
126
126
  description: 'Human / owner assignee. Separate from `claim`.',
127
127
  },
128
128
  claim: TASK_CLAIM_SCHEMA,
129
+ // T14043: optional fields a record may omit. `--field` on one that is
130
+ // absent prints its empty value (`[]` for a list, `null` otherwise).
131
+ description: { type: ['string', 'null'] },
132
+ acceptance: {
133
+ type: 'array',
134
+ description: 'Acceptance criteria (strings or typed gates).',
135
+ },
136
+ notes: { type: 'array', description: 'Timestamped notes; absent when none.' },
137
+ labels: { type: 'array' },
138
+ files: { type: 'array', description: 'Declared files (`--files`).' },
139
+ depends: { type: 'array' },
140
+ relates: { type: 'array' },
141
+ size: { type: ['string', 'null'] },
142
+ kind: { type: ['string', 'null'] },
143
+ verification: { type: ['object', 'null'] },
144
+ completedAt: { type: ['string', 'null'] },
145
+ cancelledAt: { type: ['string', 'null'] },
129
146
  },
130
147
  },
131
148
  view: {
@@ -178,6 +195,7 @@ const tasksShowOutputContract: OperationOutputContract = {
178
195
  '/data/task/verification',
179
196
  '/data/task/verification/gates',
180
197
  '/data/task/verification/evidence',
198
+ '/data/task/notes',
181
199
  '/data/view/id',
182
200
  '/data/view/title',
183
201
  ],
@@ -236,6 +236,23 @@ export interface HeavyLeverChange {
236
236
  readonly to: string;
237
237
  }
238
238
 
239
+ /**
240
+ * A setting from a project file that the heavy-run overlay overrides (T14038),
241
+ * so a run that behaves differently from the project's own setup says why.
242
+ */
243
+ export interface ProjectSettingOverride {
244
+ /** What the project set, e.g. `vitest maxWorkers` or `pnpm workspace-concurrency`. */
245
+ readonly setting: string;
246
+ /** The file that sets it, relative to the run's directory. */
247
+ readonly file: string;
248
+ /** The project's value. */
249
+ readonly projectValue: string;
250
+ /** The overlay variable that overrides it, e.g. `VITEST_MAX_WORKERS`. */
251
+ readonly variable: string;
252
+ /** The value the run gets. */
253
+ readonly appliedValue: string;
254
+ }
255
+
239
256
  /**
240
257
  * The resource plan a memory-bound tool (`test`, `build`, and since T13123
241
258
  * `typecheck`, `lint`) was spawned with, and why (T13122). Reported by
@@ -270,6 +287,11 @@ export interface HeavyToolResourcePlan {
270
287
  readonly kept: readonly string[];
271
288
  /** `true` when explicit `CLEO_HEAVY_*` overrides put the run over {@link budgetMb}. */
272
289
  readonly overBudget: boolean;
290
+ /**
291
+ * Settings the project's own files make that the overlay overrides (T14038):
292
+ * vitest `maxWorkers`, pnpm `workspace-concurrency`. Absent when none.
293
+ */
294
+ readonly projectOverrides?: readonly ProjectSettingOverride[];
273
295
  /** One line naming the heap and worker count chosen and why. */
274
296
  readonly summary: string;
275
297
  }
package/src/task.ts CHANGED
@@ -172,6 +172,10 @@ export interface EvidenceMergeAnchor {
172
172
  mergedAt: string;
173
173
  /** Paths the PR changed. */
174
174
  changedPaths?: readonly string[];
175
+ /** Paths the PR deleted: absent from its merge tree, so never `files:` artifacts (T14030). */
176
+ deletedPaths?: readonly string[];
177
+ /** The PR's number, named when a `files:` path it deleted is refused (T14030). */
178
+ prNumber?: number;
175
179
  }
176
180
 
177
181
  /** Task and criterion scope used while validating evidence, independent of PR metadata. */
@@ -198,6 +202,13 @@ export interface EvidenceValidationContext {
198
202
  * Takes precedence over {@link EvidenceValidationContext.artifactCommitSha}.
199
203
  */
200
204
  artifactPrs?: ReadonlyArray<EvidenceMergeAnchor>;
205
+ /**
206
+ * Every `test-run:` path in the evidence write (T14031). A report's coverage
207
+ * of the change is judged over the test files all of them passed, so a
208
+ * vitest report and a Playwright report together cover unit and e2e files;
209
+ * each report is still validated on its own.
210
+ */
211
+ testRunPaths?: readonly string[];
201
212
  /**
202
213
  * Validate without persisting anything: `pr:`/`ci:` lookups write neither
203
214
  * the PR-result cache nor the branch-protection cache (T12671 review — the
@@ -463,6 +474,12 @@ export type EvidenceAtom =
463
474
  * every uncommitted, not-ignored change applied.
464
475
  */
465
476
  treeHash?: string;
477
+ /**
478
+ * HEAD of the checkout the run measured (T13003). With `treeHash` it lets
479
+ * verify and complete refuse a run whose checkout lacks the task's
480
+ * implemented commits. Absent on atoms recorded before T13003.
481
+ */
482
+ headSha?: string;
466
483
  /** `true` when the result was served from the tool cache (no spawn). */
467
484
  cacheHit?: boolean;
468
485
  /**
@@ -675,6 +692,24 @@ export type EvidenceAtom =
675
692
  * merge-commit run.
676
693
  */
677
694
  nonTestFailures?: Array<{ name: string; mergeRunId: number }>;
695
+ /**
696
+ * The merge commit's own run FAILED, but every failing job failed with
697
+ * no failed test: its runner was cancelled (T14049) or a vitest worker
698
+ * crashed (T14074). `descendantSha` is the later green main run standing
699
+ * in. Each job records its failing merge-commit run and the cause.
700
+ */
701
+ untestedFailures?: Array<{
702
+ name: string;
703
+ mergeRunId: number;
704
+ cause: 'runner-cancel' | 'worker-crash';
705
+ }>;
706
+ /**
707
+ * Later default-branch runs the stand-in search looked past before
708
+ * `descendantSha`, and why (T14086): the flaky-quarantine budget stopped
709
+ * them before their flake rerun, so a quarantined failure or a test that
710
+ * only timed out decided nothing.
711
+ */
712
+ passedOverRuns?: Array<{ sha: string; jobs: string[]; reason: string }>;
678
713
  /**
679
714
  * The PR edited a pinned workflow, so only default-branch `push` runs
680
715
  * attested it; its own `pull_request` runs (which ran the edited