@cleocode/contracts 2026.4.68 → 2026.4.70
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__/acceptance-gate.test.d.ts +14 -0
- package/dist/__tests__/acceptance-gate.test.d.ts.map +1 -0
- package/dist/__tests__/acceptance-gate.test.js +642 -0
- package/dist/__tests__/acceptance-gate.test.js.map +1 -0
- package/dist/__tests__/attachment.test.d.ts +17 -0
- package/dist/__tests__/attachment.test.d.ts.map +1 -0
- package/dist/__tests__/attachment.test.js +505 -0
- package/dist/__tests__/attachment.test.js.map +1 -0
- package/dist/acceptance-gate-schema.d.ts +624 -0
- package/dist/acceptance-gate-schema.d.ts.map +1 -0
- package/dist/acceptance-gate-schema.js +244 -0
- package/dist/acceptance-gate-schema.js.map +1 -0
- package/dist/acceptance-gate.d.ts +253 -0
- package/dist/acceptance-gate.d.ts.map +1 -0
- package/dist/acceptance-gate.js +22 -0
- package/dist/acceptance-gate.js.map +1 -0
- package/dist/attachment-schema.d.ts +243 -0
- package/dist/attachment-schema.d.ts.map +1 -0
- package/dist/attachment-schema.js +200 -0
- package/dist/attachment-schema.js.map +1 -0
- package/dist/attachment.d.ts +224 -0
- package/dist/attachment.d.ts.map +1 -0
- package/dist/attachment.js +21 -0
- package/dist/attachment.js.map +1 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/task.d.ts +23 -4
- package/dist/task.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/acceptance-gate.test.ts +736 -0
- package/src/__tests__/attachment.test.ts +601 -0
- package/src/acceptance-gate-schema.ts +283 -0
- package/src/acceptance-gate.ts +264 -0
- package/src/attachment-schema.ts +223 -0
- package/src/attachment.ts +245 -0
- package/src/index.ts +49 -0
- package/src/task.ts +24 -4
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod validation schemas for {@link AcceptanceGate} and related types.
|
|
3
|
+
*
|
|
4
|
+
* Kept in a separate file from the plain TypeScript types so that consumers
|
|
5
|
+
* that do not need runtime validation (e.g. type-only imports) pay zero cost.
|
|
6
|
+
*
|
|
7
|
+
* All schemas are named `*Schema` and derive their inferred types from the
|
|
8
|
+
* canonical TypeScript interfaces in `./acceptance-gate.ts`.
|
|
9
|
+
*
|
|
10
|
+
* @epic T760
|
|
11
|
+
* @task T763
|
|
12
|
+
* @task T779
|
|
13
|
+
*/
|
|
14
|
+
import { z } from 'zod';
|
|
15
|
+
// ─── Base schema ──────────────────────────────────────────────────────────────
|
|
16
|
+
/**
|
|
17
|
+
* Zod schema for {@link GateBase} — fields every gate variant carries.
|
|
18
|
+
*
|
|
19
|
+
* Not exported as a standalone validator because it is always composed into a
|
|
20
|
+
* full gate schema via `z.discriminatedUnion`. Exported so downstream packages
|
|
21
|
+
* can extend it (e.g. for migration or testing).
|
|
22
|
+
*/
|
|
23
|
+
export const gateBaseSchema = z.object({
|
|
24
|
+
/** Optional GSD-style REQ-ID, e.g. `"TIMER-03"`. */
|
|
25
|
+
req: z.string().optional(),
|
|
26
|
+
/** Human-readable description of what the gate checks. Required. */
|
|
27
|
+
description: z.string().min(1),
|
|
28
|
+
/** When true, failure is recorded as a warning rather than a block. */
|
|
29
|
+
advisory: z.boolean().optional(),
|
|
30
|
+
/** Per-gate timeout override in milliseconds. */
|
|
31
|
+
timeoutMs: z.number().int().positive().optional(),
|
|
32
|
+
});
|
|
33
|
+
// ─── File assertion schemas ───────────────────────────────────────────────────
|
|
34
|
+
/**
|
|
35
|
+
* Zod schema for {@link FileAssertion}.
|
|
36
|
+
*
|
|
37
|
+
* Each variant carries a `type` literal that drives the discriminated union.
|
|
38
|
+
*/
|
|
39
|
+
export const fileAssertionSchema = z.discriminatedUnion('type', [
|
|
40
|
+
z.object({ type: z.literal('exists') }),
|
|
41
|
+
z.object({ type: z.literal('absent') }),
|
|
42
|
+
z.object({ type: z.literal('nonEmpty') }),
|
|
43
|
+
z.object({ type: z.literal('maxBytes'), value: z.number().int().nonnegative() }),
|
|
44
|
+
z.object({ type: z.literal('minBytes'), value: z.number().int().nonnegative() }),
|
|
45
|
+
z.object({ type: z.literal('contains'), value: z.string() }),
|
|
46
|
+
z.object({
|
|
47
|
+
type: z.literal('matches'),
|
|
48
|
+
/** Serialized `RegExp` source string. */
|
|
49
|
+
regex: z.string().min(1),
|
|
50
|
+
/** Optional `RegExp` flags, e.g. `"gim"`. */
|
|
51
|
+
flags: z.string().optional(),
|
|
52
|
+
}),
|
|
53
|
+
z.object({ type: z.literal('sha256'), value: z.string().length(64) }),
|
|
54
|
+
]);
|
|
55
|
+
// ─── Individual gate schemas ──────────────────────────────────────────────────
|
|
56
|
+
/**
|
|
57
|
+
* Zod schema for {@link TestGate}.
|
|
58
|
+
*
|
|
59
|
+
* Validates that `command` is present and `expect` is one of the two allowed
|
|
60
|
+
* literal values.
|
|
61
|
+
*/
|
|
62
|
+
export const testGateSchema = gateBaseSchema.extend({
|
|
63
|
+
kind: z.literal('test'),
|
|
64
|
+
command: z.string().min(1),
|
|
65
|
+
args: z.array(z.string()).optional(),
|
|
66
|
+
expect: z.enum(['pass', 'exit0']),
|
|
67
|
+
minCount: z.number().int().nonnegative().optional(),
|
|
68
|
+
cwd: z.string().optional(),
|
|
69
|
+
env: z.record(z.string(), z.string()).optional(),
|
|
70
|
+
});
|
|
71
|
+
/** Zod schema for {@link FileGate}. */
|
|
72
|
+
export const fileGateSchema = gateBaseSchema.extend({
|
|
73
|
+
kind: z.literal('file'),
|
|
74
|
+
path: z.string().min(1),
|
|
75
|
+
assertions: z.array(fileAssertionSchema).min(1),
|
|
76
|
+
});
|
|
77
|
+
/** Zod schema for {@link CommandGate}. */
|
|
78
|
+
export const commandGateSchema = gateBaseSchema.extend({
|
|
79
|
+
kind: z.literal('command'),
|
|
80
|
+
cmd: z.string().min(1),
|
|
81
|
+
args: z.array(z.string()).optional(),
|
|
82
|
+
exitCode: z.number().int().optional(),
|
|
83
|
+
stdoutMatches: z.string().optional(),
|
|
84
|
+
stderrMatches: z.string().optional(),
|
|
85
|
+
cwd: z.string().optional(),
|
|
86
|
+
env: z.record(z.string(), z.string()).optional(),
|
|
87
|
+
});
|
|
88
|
+
/** Zod schema for {@link LintGate}. */
|
|
89
|
+
export const lintGateSchema = gateBaseSchema.extend({
|
|
90
|
+
kind: z.literal('lint'),
|
|
91
|
+
tool: z.enum(['biome', 'eslint', 'tsc', 'prettier', 'rustc', 'clippy']),
|
|
92
|
+
args: z.array(z.string()).optional(),
|
|
93
|
+
expect: z.enum(['clean', 'noErrors']),
|
|
94
|
+
cwd: z.string().optional(),
|
|
95
|
+
});
|
|
96
|
+
/** Zod schema for {@link HttpGate}. */
|
|
97
|
+
export const httpGateSchema = gateBaseSchema.extend({
|
|
98
|
+
kind: z.literal('http'),
|
|
99
|
+
url: z.string().url(),
|
|
100
|
+
method: z.enum(['GET', 'HEAD', 'POST', 'PUT', 'DELETE']).optional(),
|
|
101
|
+
status: z.number().int().min(100).max(599),
|
|
102
|
+
bodyMatches: z.string().optional(),
|
|
103
|
+
headers: z.record(z.string(), z.string()).optional(),
|
|
104
|
+
startCommand: z.string().optional(),
|
|
105
|
+
startupDelayMs: z.number().int().nonnegative().optional(),
|
|
106
|
+
});
|
|
107
|
+
/** Zod schema for {@link ManualGate}. */
|
|
108
|
+
export const manualGateSchema = gateBaseSchema.extend({
|
|
109
|
+
kind: z.literal('manual'),
|
|
110
|
+
prompt: z.string().min(1),
|
|
111
|
+
verdicts: z.array(z.enum(['pass', 'fail', 'warn'])).optional(),
|
|
112
|
+
});
|
|
113
|
+
// ─── Discriminated union ──────────────────────────────────────────────────────
|
|
114
|
+
/**
|
|
115
|
+
* Zod discriminated-union schema for {@link AcceptanceGate}.
|
|
116
|
+
*
|
|
117
|
+
* Uses `z.discriminatedUnion('kind', [...])` for O(1) variant lookup.
|
|
118
|
+
* Parse with `acceptanceGateSchema.parse(input)` or
|
|
119
|
+
* `acceptanceGateSchema.safeParse(input)`.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```ts
|
|
123
|
+
* const gate = acceptanceGateSchema.parse({
|
|
124
|
+
* kind: 'test',
|
|
125
|
+
* command: 'pnpm test',
|
|
126
|
+
* expect: 'pass',
|
|
127
|
+
* description: 'Test suite must pass',
|
|
128
|
+
* });
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
131
|
+
export const acceptanceGateSchema = z.discriminatedUnion('kind', [
|
|
132
|
+
testGateSchema,
|
|
133
|
+
fileGateSchema,
|
|
134
|
+
commandGateSchema,
|
|
135
|
+
lintGateSchema,
|
|
136
|
+
httpGateSchema,
|
|
137
|
+
manualGateSchema,
|
|
138
|
+
]);
|
|
139
|
+
// ─── Result schema ────────────────────────────────────────────────────────────
|
|
140
|
+
/**
|
|
141
|
+
* Zod schema for {@link AcceptanceGateResult}.
|
|
142
|
+
*
|
|
143
|
+
* Validates the shape produced by the gate runner and stored in
|
|
144
|
+
* `lifecycle_gate_results`.
|
|
145
|
+
*/
|
|
146
|
+
export const acceptanceGateResultSchema = z.object({
|
|
147
|
+
index: z.number().int().nonnegative(),
|
|
148
|
+
req: z.string().optional(),
|
|
149
|
+
kind: z.enum(['test', 'file', 'command', 'lint', 'http', 'manual']),
|
|
150
|
+
result: z.enum(['pass', 'fail', 'warn', 'skipped', 'error']),
|
|
151
|
+
durationMs: z.number().nonnegative(),
|
|
152
|
+
evidence: z.string().optional(),
|
|
153
|
+
errorMessage: z.string().optional(),
|
|
154
|
+
/** ISO 8601 timestamp. */
|
|
155
|
+
checkedAt: z.string().datetime(),
|
|
156
|
+
checkedBy: z.string().min(1),
|
|
157
|
+
});
|
|
158
|
+
// ─── Mixed acceptance item schema (T780 + T800) ───────────────────────────────
|
|
159
|
+
/**
|
|
160
|
+
* Zod schema for a single acceptance criterion — either a non-empty string
|
|
161
|
+
* (legacy) or a structured {@link AcceptanceGate} (machine-verifiable).
|
|
162
|
+
*
|
|
163
|
+
* **Tightened (T800)**: Rejects empty strings, whitespace-only strings, and
|
|
164
|
+
* any non-gate objects. Clear error messages guide callers toward valid input.
|
|
165
|
+
*
|
|
166
|
+
* Strings are validated with `z.string().trim().min(1)` to eliminate empty
|
|
167
|
+
* and whitespace-only criteria. The gate branch uses the existing discriminated-union
|
|
168
|
+
* schema so all six gate kinds (`test`, `file`, `command`, `lint`, `http`, `manual`)
|
|
169
|
+
* are accepted.
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* ```ts
|
|
173
|
+
* acceptanceItemSchema.parse('must render in <100ms'); // => 'must render in <100ms'
|
|
174
|
+
* acceptanceItemSchema.parse({ kind: 'test', command: 'pnpm test', expect: 'pass', description: '...' }); // => TestGate
|
|
175
|
+
* acceptanceItemSchema.parse(''); // ERROR: string must be non-empty
|
|
176
|
+
* acceptanceItemSchema.parse({ foo: 'bar' }); // ERROR: invalid gate object
|
|
177
|
+
* ```
|
|
178
|
+
*
|
|
179
|
+
* @epic T760
|
|
180
|
+
* @task T780
|
|
181
|
+
* @task T800
|
|
182
|
+
*/
|
|
183
|
+
export const acceptanceItemSchema = z.union([
|
|
184
|
+
z
|
|
185
|
+
.string()
|
|
186
|
+
.trim()
|
|
187
|
+
.min(1, {
|
|
188
|
+
message: 'Acceptance string criterion must be non-empty. Provide a non-blank description or a valid AcceptanceGate object.',
|
|
189
|
+
})
|
|
190
|
+
.describe('Free-text legacy acceptance criterion (non-empty string)'),
|
|
191
|
+
acceptanceGateSchema.describe('Structured machine-verifiable acceptance gate'),
|
|
192
|
+
]);
|
|
193
|
+
/**
|
|
194
|
+
* Zod schema for a mixed acceptance array — `(string | AcceptanceGate)[]`.
|
|
195
|
+
*
|
|
196
|
+
* **Tightened (T800)**:
|
|
197
|
+
* - Requires at least 1 item (matching CLEO's anti-hallucination policy).
|
|
198
|
+
* - Rejects duplicate `req:` GSD-style REQ-IDs within the same array.
|
|
199
|
+
*
|
|
200
|
+
* Use this to validate the full `Task.acceptance` field after widening (T780).
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* ```ts
|
|
204
|
+
* // Valid: mixed types with unique req IDs
|
|
205
|
+
* acceptanceArraySchema.parse([
|
|
206
|
+
* 'must render in <100ms',
|
|
207
|
+
* { kind: 'test', command: 'pnpm test', expect: 'pass', description: 'Tests pass', req: 'TEST-01' }
|
|
208
|
+
* ]);
|
|
209
|
+
*
|
|
210
|
+
* // ERROR: empty array
|
|
211
|
+
* acceptanceArraySchema.parse([]);
|
|
212
|
+
*
|
|
213
|
+
* // ERROR: duplicate req:'TEST-01' across two gates
|
|
214
|
+
* acceptanceArraySchema.parse([
|
|
215
|
+
* { kind: 'test', command: 'pnpm test', expect: 'pass', description: 'Tests pass', req: 'TEST-01' },
|
|
216
|
+
* { kind: 'file', path: 'README.md', assertions: [{ type: 'exists' }], description: 'README exists', req: 'TEST-01' }
|
|
217
|
+
* ]);
|
|
218
|
+
* ```
|
|
219
|
+
*
|
|
220
|
+
* @epic T760
|
|
221
|
+
* @task T780
|
|
222
|
+
* @task T800
|
|
223
|
+
*/
|
|
224
|
+
export const acceptanceArraySchema = z
|
|
225
|
+
.array(acceptanceItemSchema)
|
|
226
|
+
.min(1, {
|
|
227
|
+
message: 'Task must have at least one acceptance criterion. Provide a non-empty string or a valid AcceptanceGate object.',
|
|
228
|
+
})
|
|
229
|
+
.refine((items) => {
|
|
230
|
+
// Extract all req: values from gates (skip plain strings)
|
|
231
|
+
const reqIds = new Set();
|
|
232
|
+
for (const item of items) {
|
|
233
|
+
if (typeof item === 'object' && item !== null && 'req' in item && item.req) {
|
|
234
|
+
if (reqIds.has(item.req)) {
|
|
235
|
+
return false; // Duplicate found
|
|
236
|
+
}
|
|
237
|
+
reqIds.add(item.req);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return true; // No duplicates
|
|
241
|
+
}, {
|
|
242
|
+
message: 'Duplicate req: (REQ-ID) values within the same acceptance array. Each GSD-style requirement ID must be unique. Check for repeated req fields and ensure each gate has a distinct identifier.',
|
|
243
|
+
});
|
|
244
|
+
//# sourceMappingURL=acceptance-gate-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acceptance-gate-schema.js","sourceRoot":"","sources":["../src/acceptance-gate-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,iFAAiF;AAEjF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,oDAAoD;IACpD,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,oEAAoE;IACpE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,uEAAuE;IACvE,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAChC,iDAAiD;IACjD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CAClD,CAAC,CAAC;AAEH,iFAAiF;AAEjF;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAC9D,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;IACvC,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;IACvC,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IACzC,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,K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C,kBAAkB;YAClC,CAAC;YACD,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC,CAAC,gBAAgB;AAC/B,CAAC,EACD;IACE,OAAO,EACL,8LAA8L;CACjM,CACF,CAAC"}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Acceptance gate discriminated union and result types.
|
|
3
|
+
*
|
|
4
|
+
* A machine-verifiable acceptance gate. Gates coexist with free-text criteria
|
|
5
|
+
* in `Task.acceptance`; the runtime executes only gates and records results in
|
|
6
|
+
* `task.verification.gateResults` and in the `lifecycle_gate_results` DB table.
|
|
7
|
+
*
|
|
8
|
+
* Six gate kinds are supported:
|
|
9
|
+
* - `test` — run a command and assert exit code / test-count
|
|
10
|
+
* - `file` — assert properties of a file on disk
|
|
11
|
+
* - `command` — run any CLI command and assert exit code / stdout
|
|
12
|
+
* - `lint` — run a static-analysis tool and require a clean result
|
|
13
|
+
* - `http` — hit a URL and assert status + optional body
|
|
14
|
+
* - `manual` — explicit escape hatch requiring human/agent verdict
|
|
15
|
+
*
|
|
16
|
+
* @epic T760
|
|
17
|
+
* @task T763
|
|
18
|
+
* @task T779
|
|
19
|
+
* @see {@link https://github.com/kryptobaseddev/cleo} T760 RCASD hardening
|
|
20
|
+
*/
|
|
21
|
+
/** Fields every gate variant carries. */
|
|
22
|
+
export interface GateBase {
|
|
23
|
+
/**
|
|
24
|
+
* Optional REQ-ID (GSD-style: `TIMER-03`, `A11Y-04`). When present the
|
|
25
|
+
* gate is addressable via `cleo req show <taskId> --id TIMER-03` and its
|
|
26
|
+
* result is indexed in `lifecycle_gate_results.gate_name`.
|
|
27
|
+
*/
|
|
28
|
+
req?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Free-text description of what this gate is checking. Shown in
|
|
31
|
+
* `cleo show` output and in failure messages. Required so agents and
|
|
32
|
+
* humans can read the gate without executing it.
|
|
33
|
+
*/
|
|
34
|
+
description: string;
|
|
35
|
+
/**
|
|
36
|
+
* When `true` a failure of this gate does not block completion — it is
|
|
37
|
+
* recorded as `result: 'warn'` in `lifecycle_gate_results`.
|
|
38
|
+
*
|
|
39
|
+
* @defaultValue false
|
|
40
|
+
*/
|
|
41
|
+
advisory?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Gate timeout in milliseconds.
|
|
44
|
+
*
|
|
45
|
+
* @defaultValue 120_000
|
|
46
|
+
*/
|
|
47
|
+
timeoutMs?: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Run a command; pass when exit code is 0 and when at least `minCount`
|
|
51
|
+
* tests have run. Designed for test suites:
|
|
52
|
+
* `{ kind: 'test', command: 'pnpm test', expect: 'pass' }`.
|
|
53
|
+
*/
|
|
54
|
+
export interface TestGate extends GateBase {
|
|
55
|
+
kind: 'test';
|
|
56
|
+
/** Shell command. Executed via `child_process.spawn`, no `shell: true`. */
|
|
57
|
+
command: string;
|
|
58
|
+
/** Arguments split explicitly (avoids shell-injection). */
|
|
59
|
+
args?: string[];
|
|
60
|
+
/**
|
|
61
|
+
* - `"pass"`: exit code 0 AND stdout contains no `FAIL|failing|Error:` pattern.
|
|
62
|
+
* - `"exit0"`: exit code 0 only (permissive mode).
|
|
63
|
+
*/
|
|
64
|
+
expect: 'pass' | 'exit0';
|
|
65
|
+
/** Minimum number of tests that must have run. */
|
|
66
|
+
minCount?: number;
|
|
67
|
+
/** Working directory relative to project root. Default `.`. */
|
|
68
|
+
cwd?: string;
|
|
69
|
+
/** Environment variable overrides. Keys must match `/^[A-Z_][A-Z0-9_]*$/`. */
|
|
70
|
+
env?: Record<string, string>;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Assert properties of a file on disk. Multiple assertions are AND-ed:
|
|
74
|
+
* all must hold for the gate to pass.
|
|
75
|
+
*/
|
|
76
|
+
export interface FileGate extends GateBase {
|
|
77
|
+
kind: 'file';
|
|
78
|
+
/**
|
|
79
|
+
* Absolute or project-root-relative path. Globs are not supported here
|
|
80
|
+
* — use one gate per path.
|
|
81
|
+
*/
|
|
82
|
+
path: string;
|
|
83
|
+
assertions: FileAssertion[];
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* A single assertion about a file on disk.
|
|
87
|
+
*
|
|
88
|
+
* All assertion variants in a `FileGate` must pass for the gate to pass.
|
|
89
|
+
*/
|
|
90
|
+
export type FileAssertion = {
|
|
91
|
+
type: 'exists';
|
|
92
|
+
} | {
|
|
93
|
+
type: 'absent';
|
|
94
|
+
} | {
|
|
95
|
+
type: 'nonEmpty';
|
|
96
|
+
} | {
|
|
97
|
+
type: 'maxBytes';
|
|
98
|
+
value: number;
|
|
99
|
+
} | {
|
|
100
|
+
type: 'minBytes';
|
|
101
|
+
value: number;
|
|
102
|
+
} | {
|
|
103
|
+
type: 'contains';
|
|
104
|
+
value: string;
|
|
105
|
+
} | {
|
|
106
|
+
type: 'matches';
|
|
107
|
+
/** Serialized `RegExp` source string. */
|
|
108
|
+
regex: string;
|
|
109
|
+
/** Optional `RegExp` flags, e.g. `"gim"`. */
|
|
110
|
+
flags?: string;
|
|
111
|
+
} | {
|
|
112
|
+
type: 'sha256';
|
|
113
|
+
value: string;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Run any CLI command and assert exit code and optional stdout match.
|
|
117
|
+
* Escape hatch for anything `TestGate`/`LintGate`/`HttpGate` do not cover.
|
|
118
|
+
*/
|
|
119
|
+
export interface CommandGate extends GateBase {
|
|
120
|
+
kind: 'command';
|
|
121
|
+
cmd: string;
|
|
122
|
+
args?: string[];
|
|
123
|
+
/**
|
|
124
|
+
* Expected exit code.
|
|
125
|
+
*
|
|
126
|
+
* @defaultValue 0
|
|
127
|
+
*/
|
|
128
|
+
exitCode?: number;
|
|
129
|
+
/** stdout must match this regex source. */
|
|
130
|
+
stdoutMatches?: string;
|
|
131
|
+
/** stderr must match this regex source. */
|
|
132
|
+
stderrMatches?: string;
|
|
133
|
+
/** Working directory relative to project root. */
|
|
134
|
+
cwd?: string;
|
|
135
|
+
/** Environment variable overrides. */
|
|
136
|
+
env?: Record<string, string>;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Run a static-analysis tool and require a clean result.
|
|
140
|
+
* Wraps common cases with known exit codes so agents do not re-invent them.
|
|
141
|
+
*/
|
|
142
|
+
export interface LintGate extends GateBase {
|
|
143
|
+
kind: 'lint';
|
|
144
|
+
/** Linting tool to invoke. */
|
|
145
|
+
tool: 'biome' | 'eslint' | 'tsc' | 'prettier' | 'rustc' | 'clippy';
|
|
146
|
+
/**
|
|
147
|
+
* Tool arguments. Defaults: biome→`['check', '.']`, eslint→`['.']`,
|
|
148
|
+
* tsc→`['--noEmit']`.
|
|
149
|
+
*/
|
|
150
|
+
args?: string[];
|
|
151
|
+
/**
|
|
152
|
+
* - `"clean"`: zero findings.
|
|
153
|
+
* - `"noErrors"`: tolerates warnings but not errors.
|
|
154
|
+
*/
|
|
155
|
+
expect: 'clean' | 'noErrors';
|
|
156
|
+
/** Working directory relative to project root. */
|
|
157
|
+
cwd?: string;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Hit a URL and assert HTTP status and optional body match. For tasks that
|
|
161
|
+
* ship a webapp or API. The runner starts a server only if `startCommand`
|
|
162
|
+
* is set and tears it down after the probe.
|
|
163
|
+
*/
|
|
164
|
+
export interface HttpGate extends GateBase {
|
|
165
|
+
kind: 'http';
|
|
166
|
+
url: string;
|
|
167
|
+
/** HTTP method for the probe request. Default `"GET"`. */
|
|
168
|
+
method?: 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE';
|
|
169
|
+
/** Expected HTTP status code. */
|
|
170
|
+
status: number;
|
|
171
|
+
/** Response body must match this regex source. */
|
|
172
|
+
bodyMatches?: string;
|
|
173
|
+
/** Request headers to include. */
|
|
174
|
+
headers?: Record<string, string>;
|
|
175
|
+
/** Pre-probe command to start a server. Runs in background; killed after probe. */
|
|
176
|
+
startCommand?: string;
|
|
177
|
+
/**
|
|
178
|
+
* Milliseconds to wait after starting before probing.
|
|
179
|
+
*
|
|
180
|
+
* @defaultValue 2000
|
|
181
|
+
*/
|
|
182
|
+
startupDelayMs?: number;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Explicit escape hatch: a gate the runtime CANNOT verify automatically.
|
|
186
|
+
* Requires a human or a different agent to record a verdict before
|
|
187
|
+
* `cleo complete` will accept it.
|
|
188
|
+
*
|
|
189
|
+
* This is the ONLY gate variant that preserves today's free-text behaviour.
|
|
190
|
+
* Use for subjective criteria: "copy reads well", "visual design matches mockup".
|
|
191
|
+
*/
|
|
192
|
+
export interface ManualGate extends GateBase {
|
|
193
|
+
kind: 'manual';
|
|
194
|
+
/** Question or prompt shown to the human or agent performing verification. */
|
|
195
|
+
prompt: string;
|
|
196
|
+
/**
|
|
197
|
+
* Valid verdicts the reviewer may record.
|
|
198
|
+
*
|
|
199
|
+
* @defaultValue ['pass', 'fail']
|
|
200
|
+
*/
|
|
201
|
+
verdicts?: ('pass' | 'fail' | 'warn')[];
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* A machine-verifiable acceptance gate attached to a task.
|
|
205
|
+
*
|
|
206
|
+
* All variants share the {@link GateBase} fields (`req`, `description`,
|
|
207
|
+
* `advisory`, `timeoutMs`). The `kind` discriminant selects the variant.
|
|
208
|
+
*
|
|
209
|
+
* @example
|
|
210
|
+
* ```ts
|
|
211
|
+
* const gate: AcceptanceGate = {
|
|
212
|
+
* kind: 'test',
|
|
213
|
+
* command: 'pnpm test',
|
|
214
|
+
* expect: 'pass',
|
|
215
|
+
* minCount: 3,
|
|
216
|
+
* description: '≥3 tests must pass',
|
|
217
|
+
* };
|
|
218
|
+
* ```
|
|
219
|
+
*/
|
|
220
|
+
export type AcceptanceGate = TestGate | FileGate | CommandGate | LintGate | HttpGate | ManualGate;
|
|
221
|
+
/** All valid `kind` discriminants for `AcceptanceGate`. */
|
|
222
|
+
export type AcceptanceGateKind = AcceptanceGate['kind'];
|
|
223
|
+
/**
|
|
224
|
+
* Result of running one acceptance gate.
|
|
225
|
+
*
|
|
226
|
+
* Persisted to `lifecycle_gate_results` and summarised in
|
|
227
|
+
* `task.verification.gateResults`.
|
|
228
|
+
*
|
|
229
|
+
* NOTE: Named `AcceptanceGateResult` (not `GateResult`) to avoid collision
|
|
230
|
+
* with the existing {@link GateResult} from `./warp-chain.js` which describes
|
|
231
|
+
* WarpChain LOOM-gate evaluation outcomes.
|
|
232
|
+
*/
|
|
233
|
+
export interface AcceptanceGateResult {
|
|
234
|
+
/** Zero-based index in the task's acceptance array. */
|
|
235
|
+
index: number;
|
|
236
|
+
/** REQ-ID if the gate had one, else `undefined`. */
|
|
237
|
+
req?: string;
|
|
238
|
+
/** Gate variant. */
|
|
239
|
+
kind: AcceptanceGateKind;
|
|
240
|
+
/** Outcome of the gate execution. */
|
|
241
|
+
result: 'pass' | 'fail' | 'warn' | 'skipped' | 'error';
|
|
242
|
+
/** Wall-clock duration of the gate execution in milliseconds. */
|
|
243
|
+
durationMs: number;
|
|
244
|
+
/** Truncated stdout/stderr or file snippet shown in failure messages. */
|
|
245
|
+
evidence?: string;
|
|
246
|
+
/** Error message when `result` is `"error"` (the gate runner itself crashed). */
|
|
247
|
+
errorMessage?: string;
|
|
248
|
+
/** ISO 8601 timestamp at which the gate ran. */
|
|
249
|
+
checkedAt: string;
|
|
250
|
+
/** Agent identifier or `"human"` that ran or attested the gate. */
|
|
251
|
+
checkedBy: string;
|
|
252
|
+
}
|
|
253
|
+
//# sourceMappingURL=acceptance-gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acceptance-gate.d.ts","sourceRoot":"","sources":["../src/acceptance-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,yCAAyC;AACzC,MAAM,WAAW,QAAQ;IACvB;;;;OAIG;IACH,GAAG,CAA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gate discriminated union and result types.
|
|
3
|
+
*
|
|
4
|
+
* A machine-verifiable acceptance gate. Gates coexist with free-text criteria
|
|
5
|
+
* in `Task.acceptance`; the runtime executes only gates and records results in
|
|
6
|
+
* `task.verification.gateResults` and in the `lifecycle_gate_results` DB table.
|
|
7
|
+
*
|
|
8
|
+
* Six gate kinds are supported:
|
|
9
|
+
* - `test` — run a command and assert exit code / test-count
|
|
10
|
+
* - `file` — assert properties of a file on disk
|
|
11
|
+
* - `command` — run any CLI command and assert exit code / stdout
|
|
12
|
+
* - `lint` — run a static-analysis tool and require a clean result
|
|
13
|
+
* - `http` — hit a URL and assert status + optional body
|
|
14
|
+
* - `manual` — explicit escape hatch requiring human/agent verdict
|
|
15
|
+
*
|
|
16
|
+
* @epic T760
|
|
17
|
+
* @task T763
|
|
18
|
+
* @task T779
|
|
19
|
+
* @see {@link https://github.com/kryptobaseddev/cleo} T760 RCASD hardening
|
|
20
|
+
*/
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=acceptance-gate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acceptance-gate.js","sourceRoot":"","sources":["../src/acceptance-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG"}
|