@cleocode/contracts 2026.5.92 → 2026.5.94
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__/docs-taxonomy.test.d.ts +16 -0
- package/dist/__tests__/docs-taxonomy.test.d.ts.map +1 -0
- package/dist/__tests__/docs-taxonomy.test.js +404 -0
- package/dist/__tests__/docs-taxonomy.test.js.map +1 -0
- package/dist/cli-category.d.ts +24 -0
- package/dist/cli-category.d.ts.map +1 -0
- package/dist/cli-category.js +32 -0
- package/dist/cli-category.js.map +1 -0
- package/dist/docs-taxonomy.d.ts +286 -0
- package/dist/docs-taxonomy.d.ts.map +1 -0
- package/dist/docs-taxonomy.js +489 -0
- package/dist/docs-taxonomy.js.map +1 -0
- package/dist/doctor.d.ts +120 -0
- package/dist/doctor.d.ts.map +1 -0
- package/dist/doctor.js +16 -0
- package/dist/doctor.js.map +1 -0
- package/dist/exit-codes.d.ts +29 -0
- package/dist/exit-codes.d.ts.map +1 -1
- package/dist/exit-codes.js +29 -0
- package/dist/exit-codes.js.map +1 -1
- package/dist/index.d.ts +11 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/operations/docs.d.ts +89 -11
- package/dist/operations/docs.d.ts.map +1 -1
- package/dist/operations/docs.js +19 -12
- package/dist/operations/docs.js.map +1 -1
- package/dist/operations/release.d.ts +0 -25
- package/dist/operations/release.d.ts.map +1 -1
- package/dist/operations/session.d.ts +66 -0
- package/dist/operations/session.d.ts.map +1 -1
- package/dist/operations/tasks.d.ts +64 -0
- package/dist/operations/tasks.d.ts.map +1 -1
- package/dist/operations/validate.d.ts +32 -0
- package/dist/operations/validate.d.ts.map +1 -1
- package/dist/release/evidence-atoms.d.ts +37 -1
- package/dist/release/evidence-atoms.d.ts.map +1 -1
- package/dist/release/evidence-atoms.js +22 -0
- package/dist/release/evidence-atoms.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/docs-taxonomy.test.ts +465 -0
- package/src/cli-category.ts +52 -0
- package/src/docs-taxonomy.ts +682 -0
- package/src/doctor.ts +130 -0
- package/src/exit-codes.ts +30 -0
- package/src/index.ts +36 -2
- package/src/operations/docs.ts +92 -18
- package/src/operations/release.ts +0 -28
- package/src/operations/session.ts +71 -0
- package/src/operations/tasks.ts +67 -0
- package/src/operations/validate.ts +34 -0
- package/src/release/evidence-atoms.ts +38 -0
|
@@ -277,6 +277,39 @@ export interface ValidateCanonResult {
|
|
|
277
277
|
assertions: Array<{ passed: boolean }>;
|
|
278
278
|
}
|
|
279
279
|
|
|
280
|
+
/**
|
|
281
|
+
* Params for `check.canon.docs` — the T9796 docs-routing CI gate.
|
|
282
|
+
*
|
|
283
|
+
* `baseRef` defaults to `origin/main` and is overridden in CI to
|
|
284
|
+
* `origin/${{ github.base_ref }}` so PRs targeting any branch work.
|
|
285
|
+
* `candidateFiles` is a test seam — when supplied, bypasses `git diff`
|
|
286
|
+
* and treats the list as the candidate set.
|
|
287
|
+
*
|
|
288
|
+
* @task T9796 — E-DOCS-CANON-LOCKDOWN
|
|
289
|
+
*/
|
|
290
|
+
export interface ValidateCanonDocsParams {
|
|
291
|
+
baseRef?: string;
|
|
292
|
+
candidateFiles?: ReadonlyArray<string>;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Result envelope returned by `check.canon.docs`.
|
|
297
|
+
*
|
|
298
|
+
* @task T9796
|
|
299
|
+
*/
|
|
300
|
+
export interface ValidateCanonDocsResult {
|
|
301
|
+
passed: boolean;
|
|
302
|
+
baseRef: string;
|
|
303
|
+
scanned: number;
|
|
304
|
+
violations: ReadonlyArray<{
|
|
305
|
+
file: string;
|
|
306
|
+
kind: string;
|
|
307
|
+
matchedPath: string;
|
|
308
|
+
fix: string;
|
|
309
|
+
}>;
|
|
310
|
+
mode: 'enforced' | 'no-canon';
|
|
311
|
+
}
|
|
312
|
+
|
|
280
313
|
export interface ValidateWorkflowComplianceParams {
|
|
281
314
|
since?: string;
|
|
282
315
|
}
|
|
@@ -350,6 +383,7 @@ export type CheckOps = {
|
|
|
350
383
|
readonly grade: readonly [ValidateGradeParams, ValidateGradeResult];
|
|
351
384
|
readonly 'grade.list': readonly [ValidateGradeListParams, ValidateGradeListResult];
|
|
352
385
|
readonly canon: readonly [ValidateCanonParams, ValidateCanonResult];
|
|
386
|
+
readonly 'canon.docs': readonly [ValidateCanonDocsParams, ValidateCanonDocsResult];
|
|
353
387
|
readonly 'workflow.compliance': readonly [
|
|
354
388
|
ValidateWorkflowComplianceParams,
|
|
355
389
|
ValidateWorkflowComplianceResult,
|
|
@@ -28,7 +28,14 @@ import { z } from 'zod';
|
|
|
28
28
|
* "pr:357"`. The number is restricted to positive integers because
|
|
29
29
|
* GitHub PR numbers cannot be zero or negative.
|
|
30
30
|
*
|
|
31
|
+
* T9838 introduced the optional explicit-form modifier
|
|
32
|
+
* `pr:<num>;state:MERGED`. The `state` modifier is intent-documenting
|
|
33
|
+
* (the resolver always demands state === 'MERGED') and is consumed at
|
|
34
|
+
* parse time without being emitted as a separate atom. See
|
|
35
|
+
* {@link prEvidenceStateModifierSchema}.
|
|
36
|
+
*
|
|
31
37
|
* @task T9764
|
|
38
|
+
* @task T9838
|
|
32
39
|
*/
|
|
33
40
|
export interface ParsedPrEvidenceAtom {
|
|
34
41
|
/** Discriminant — always `'pr'`. */
|
|
@@ -51,6 +58,37 @@ export const parsedPrEvidenceAtomSchema = z.object({
|
|
|
51
58
|
prNumber: z.number().int().positive(),
|
|
52
59
|
}) satisfies z.ZodType<ParsedPrEvidenceAtom>;
|
|
53
60
|
|
|
61
|
+
/**
|
|
62
|
+
* Zod schema for the optional `state:MERGED` modifier that may follow a
|
|
63
|
+
* `pr:<num>` atom in the evidence string (T9838).
|
|
64
|
+
*
|
|
65
|
+
* The modifier is intent-documenting: the resolver always demands
|
|
66
|
+
* `state === 'MERGED'`, so emitting `state:MERGED` explicitly is a
|
|
67
|
+
* no-op assertion that proves the caller knows the contract. Only the
|
|
68
|
+
* literal string `"MERGED"` is accepted — `OPEN`, `CLOSED`, or any other
|
|
69
|
+
* value is rejected at parse time because no other state can satisfy any
|
|
70
|
+
* gate the `pr:` atom is allowed to back.
|
|
71
|
+
*
|
|
72
|
+
* The parser consumes the modifier in-place (it does NOT emit a separate
|
|
73
|
+
* atom) so downstream code never sees a free-standing `state` atom. The
|
|
74
|
+
* schema exists so external producers (e.g. a future provenance importer)
|
|
75
|
+
* can validate the literal payload before passing it to `parseEvidence`.
|
|
76
|
+
*
|
|
77
|
+
* @task T9838
|
|
78
|
+
*/
|
|
79
|
+
export const prEvidenceStateModifierSchema = z.object({
|
|
80
|
+
kind: z.literal('state'),
|
|
81
|
+
value: z.literal('MERGED'),
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Inferred type for the explicit `state:MERGED` modifier emitted alongside
|
|
86
|
+
* a `pr:<num>` atom. See {@link prEvidenceStateModifierSchema}.
|
|
87
|
+
*
|
|
88
|
+
* @task T9838
|
|
89
|
+
*/
|
|
90
|
+
export type PrEvidenceStateModifier = z.infer<typeof prEvidenceStateModifierSchema>;
|
|
91
|
+
|
|
54
92
|
/**
|
|
55
93
|
* Raw shape returned by `gh pr view <num> --json
|
|
56
94
|
* statusCheckRollup,mergeable,state,mergedAt,headRefOid`.
|