@cleocode/contracts 2026.9.9 → 2026.9.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.
@@ -88,9 +88,14 @@ export interface GateBase {
88
88
  // ─── Variants ────────────────────────────────────────────────────────────────
89
89
 
90
90
  /**
91
- * Run a command and verify its actual exit status. Positive `minCount` requires
92
- * a structured test-count capability and currently returns an explicit error. Designed for test suites:
91
+ * Run a command and verify its actual exit status. Designed for test suites:
93
92
  * `{ kind: 'test', command: 'pnpm test', expect: 'pass' }`.
93
+ *
94
+ * A positive `minCount` additionally requires the gate's OWN command to emit a
95
+ * machine-readable report satisfying `testCountReportSchema` (e.g. by adding
96
+ * `--reporter=json`). A run that emits none is an error, never a pass: an exit
97
+ * code carries no count, and a report file written by some other invocation is
98
+ * not bound to this execution.
94
99
  */
95
100
  export interface TestGate extends GateBase {
96
101
  kind: 'test';
@@ -103,7 +108,13 @@ export interface TestGate extends GateBase {
103
108
  * - `"exit0"`: exit code 0 only (permissive mode).
104
109
  */
105
110
  expect: 'pass' | 'exit0';
106
- /** Minimum test count; unsupported count evidence must return error, never infer a count from exit zero. */
111
+ /**
112
+ * Minimum number of PASSING tests the run must report.
113
+ *
114
+ * Satisfied only by a structured report emitted by this gate's own command;
115
+ * a run that produces none returns an error rather than inferring a count
116
+ * from exit zero (T12308).
117
+ */
107
118
  minCount?: number;
108
119
  /** Working directory relative to project root. Default `.`. */
109
120
  cwd?: string;
@@ -1811,6 +1811,36 @@ export const OPERATIONS: OperationDef[] = [
1811
1811
  },
1812
1812
  ] satisfies ParamDef[],
1813
1813
  },
1814
+ // T12308: the typed-gate runner `cleo verify <id> --run`. A query — it
1815
+ // executes the gates and reports them, and records nothing. Documented as
1816
+ // the canonical driver since T768 and emitted into every validation-stage
1817
+ // spawn prompt, but the flag had been dropped from the command.
1818
+ {
1819
+ gateway: 'query',
1820
+ domain: 'check',
1821
+ operation: 'gate.run',
1822
+ description:
1823
+ "check.gate.run (query) — execute a task's typed acceptance gates and report results; persists nothing (T12308)",
1824
+ tier: 1,
1825
+ idempotent: false,
1826
+ sessionRequired: false,
1827
+ requiredParams: ['taskId'],
1828
+ params: [
1829
+ {
1830
+ name: 'taskId',
1831
+ type: 'string',
1832
+ required: true,
1833
+ description: 'Task whose typed gates should run',
1834
+ cli: { positional: true },
1835
+ },
1836
+ {
1837
+ name: 'agent',
1838
+ type: 'string',
1839
+ required: false,
1840
+ description: 'Actor attribution recorded on each gate result',
1841
+ },
1842
+ ] satisfies ParamDef[],
1843
+ },
1814
1844
  // check.archive.stats incoming from admin (T5615)
1815
1845
  {
1816
1846
  gateway: 'query',
package/src/index.ts CHANGED
@@ -43,6 +43,7 @@ export {
43
43
  httpGateSchema,
44
44
  lintGateSchema,
45
45
  manualGateSchema,
46
+ testCountReportSchema,
46
47
  testGateSchema,
47
48
  } from './acceptance-gate-schema.js';
48
49
  // === Provider Adapter Contracts ===
@@ -1830,6 +1831,7 @@ export type {
1830
1831
  ValidateComplianceViolationsResult,
1831
1832
  ValidateGateParams,
1832
1833
  ValidateGateResult,
1834
+ ValidateGateRunResult,
1833
1835
  ValidateGradeListParams,
1834
1836
  ValidateGradeListResult,
1835
1837
  ValidateGradeParams,
@@ -184,6 +184,29 @@ export interface ValidateCoherenceResult {
184
184
  warnings: string[];
185
185
  }
186
186
 
187
+ /**
188
+ * Result of `check.gate.run` — typed gates executed, nothing persisted.
189
+ *
190
+ * Structurally the core preview payload; declared here so the dispatch layer
191
+ * narrows it without importing from core.
192
+ *
193
+ * @task T12308
194
+ */
195
+ export interface ValidateGateRunResult {
196
+ /** Task whose typed gates were run. */
197
+ taskId: string;
198
+ /** Number of typed gates found on the acceptance array. */
199
+ gateCount: number;
200
+ /** One result per typed gate, in acceptance-array order. */
201
+ results: unknown[];
202
+ /** True when no gate returned `fail` or `error`. */
203
+ passed: boolean;
204
+ /** Always false — `--run` observes, `--evidence` attests. */
205
+ persisted: false;
206
+ /** Present when the task carries no typed gates. */
207
+ note?: string;
208
+ }
209
+
187
210
  export interface ValidateGateParams {
188
211
  taskId: string;
189
212
  gate?: string;
@@ -365,6 +388,7 @@ export type CheckOps = {
365
388
  readonly coherence: readonly [ValidateCoherenceParams, ValidateCoherenceResult];
366
389
  readonly 'gate.status': readonly [ValidateGateParams, ValidateGateResult];
367
390
  readonly 'gate.set': readonly [ValidateGateParams, ValidateGateResult];
391
+ readonly 'gate.run': readonly [ValidateGateParams, ValidateGateRunResult];
368
392
  readonly 'verify.explain': readonly [ValidateVerifyExplainParams, ValidateVerifyExplainResult];
369
393
  readonly 'archive.stats': readonly [ValidateArchiveStatsParams, ValidateArchiveStatsResult];
370
394
  readonly grade: readonly [ValidateGradeParams, ValidateGradeResult];
@@ -55,6 +55,23 @@ export type FileNamingConvention = 'kebab-case' | 'snake_case' | 'camelCase' | '
55
55
  /** Module import style. */
56
56
  export type ImportStyle = 'esm' | 'commonjs' | 'mixed';
57
57
 
58
+ /**
59
+ * Evidence execution configured per project.
60
+ *
61
+ * @task T12308
62
+ */
63
+ export interface ProjectEvidenceContext {
64
+ /**
65
+ * Checkout that `git`/`gh` evidence tools must run in, relative to the CLEO
66
+ * store root (an absolute path is also accepted).
67
+ *
68
+ * Needed only when the store root is not itself a git work tree AND parents
69
+ * more than one repository — CLEO resolves a single nested checkout, and a
70
+ * `commit:` atom whose SHA exists in exactly one sibling, without help.
71
+ */
72
+ gitRoot?: string;
73
+ }
74
+
58
75
  /** Release and evidence behavior configured per project. */
59
76
  export interface ProjectReleaseContext {
60
77
  /** Branches whose reachable commits may satisfy `commit:` evidence atoms. */
@@ -121,6 +138,8 @@ export interface ProjectContext {
121
138
  };
122
139
  /** Release and evidence behavior for this project. */
123
140
  release?: ProjectReleaseContext;
141
+ /** Evidence execution overrides for this project (T12308). */
142
+ evidence?: ProjectEvidenceContext;
124
143
  }
125
144
 
126
145
  /**