@cleocode/contracts 2026.9.7 → 2026.9.9
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.js +242 -1
- package/dist/__tests__/acceptance-gate.test.js.map +1 -1
- package/dist/__tests__/evidence-atom-schema.test.js +17 -14
- package/dist/__tests__/evidence-atom-schema.test.js.map +1 -1
- package/dist/__tests__/memory-wire-shapes.test.js.map +1 -1
- package/dist/__tests__/operations-registry.test.js +18 -0
- package/dist/__tests__/operations-registry.test.js.map +1 -1
- package/dist/acceptance-gate-schema.d.ts +60 -2
- package/dist/acceptance-gate-schema.d.ts.map +1 -1
- package/dist/acceptance-gate-schema.js +273 -1
- package/dist/acceptance-gate-schema.js.map +1 -1
- package/dist/acceptance-gate.d.ts +122 -11
- package/dist/acceptance-gate.d.ts.map +1 -1
- package/dist/acceptance-gate.js +3 -3
- package/dist/audit.d.ts +71 -2
- package/dist/audit.d.ts.map +1 -1
- package/dist/backup-manifest.d.ts +80 -0
- package/dist/backup-manifest.d.ts.map +1 -1
- package/dist/caamp-markers.d.ts +20 -0
- package/dist/caamp-markers.d.ts.map +1 -1
- package/dist/capabilities.d.ts +282 -0
- package/dist/capabilities.d.ts.map +1 -1
- package/dist/changesets.d.ts +4 -4
- package/dist/code-symbol.d.ts +33 -0
- package/dist/code-symbol.d.ts.map +1 -1
- package/dist/daemon/health.d.ts +3 -3
- package/dist/data-accessor.d.ts +15 -0
- package/dist/data-accessor.d.ts.map +1 -1
- package/dist/data-accessor.js.map +1 -1
- package/dist/dispatch/__tests__/tasks-gateway-crud-ops.test.js +19 -1
- package/dist/dispatch/__tests__/tasks-gateway-crud-ops.test.js.map +1 -1
- package/dist/dispatch/operations-registry.d.ts.map +1 -1
- package/dist/dispatch/operations-registry.js +684 -3
- package/dist/dispatch/operations-registry.js.map +1 -1
- package/dist/docs-taxonomy.d.ts +25 -0
- package/dist/docs-taxonomy.d.ts.map +1 -1
- package/dist/docs-taxonomy.js.map +1 -1
- package/dist/evidence-atom-schema.d.ts +7 -6
- package/dist/evidence-atom-schema.d.ts.map +1 -1
- package/dist/evidence-atom-schema.js +10 -9
- package/dist/evidence-atom-schema.js.map +1 -1
- package/dist/graph.d.ts +283 -2
- package/dist/graph.d.ts.map +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/invariants/adr-070-orchestration.d.ts.map +1 -1
- package/dist/invariants/adr-070-orchestration.js +1 -1
- package/dist/invariants/adr-070-orchestration.js.map +1 -1
- package/dist/invariants/adr-073-saga.js +2 -2
- package/dist/invariants/adr-073-saga.js.map +1 -1
- package/dist/jobs.d.ts +329 -3
- package/dist/jobs.d.ts.map +1 -1
- package/dist/knowledge-health.d.ts +695 -0
- package/dist/knowledge-health.d.ts.map +1 -0
- package/dist/knowledge-health.js +8 -0
- package/dist/knowledge-health.js.map +1 -0
- package/dist/llm/catalog-schema.d.ts +4 -4
- package/dist/memory/observe.d.ts +4 -2
- package/dist/memory/observe.d.ts.map +1 -1
- package/dist/memory/search.d.ts +4 -0
- package/dist/memory/search.d.ts.map +1 -1
- package/dist/nexus-living-brain-ops.d.ts +28 -3
- package/dist/nexus-living-brain-ops.d.ts.map +1 -1
- package/dist/nexus-tasks-bridge-ops.d.ts +11 -0
- package/dist/nexus-tasks-bridge-ops.d.ts.map +1 -1
- package/dist/operations/admin.d.ts +10 -4
- package/dist/operations/admin.d.ts.map +1 -1
- package/dist/operations/docs.d.ts +138 -0
- package/dist/operations/docs.d.ts.map +1 -1
- package/dist/operations/docs.js +47 -0
- package/dist/operations/docs.js.map +1 -1
- package/dist/operations/focus.d.ts +7 -0
- package/dist/operations/focus.d.ts.map +1 -1
- package/dist/operations/nexus.d.ts +7 -2
- package/dist/operations/nexus.d.ts.map +1 -1
- package/dist/operations/output-contracts-data.d.ts.map +1 -1
- package/dist/operations/output-contracts-data.js +31 -3
- package/dist/operations/output-contracts-data.js.map +1 -1
- package/dist/operations/research.d.ts +33 -0
- package/dist/operations/research.d.ts.map +1 -1
- package/dist/operations/tasks.d.ts +107 -4
- package/dist/operations/tasks.d.ts.map +1 -1
- package/dist/operations/tasks.js +5 -0
- package/dist/operations/tasks.js.map +1 -1
- package/dist/package-artifact.d.ts +112 -0
- package/dist/package-artifact.d.ts.map +1 -0
- package/dist/package-artifact.js +8 -0
- package/dist/package-artifact.js.map +1 -0
- package/dist/release/evidence-atoms.d.ts +10 -0
- package/dist/release/evidence-atoms.d.ts.map +1 -1
- package/dist/release/evidence-atoms.js +6 -0
- package/dist/release/evidence-atoms.js.map +1 -1
- package/dist/release/plan.d.ts +6 -6
- package/dist/resource-governor.d.ts +114 -0
- package/dist/resource-governor.d.ts.map +1 -1
- package/dist/resource-governor.js.map +1 -1
- package/dist/supervisor-ipc/messages.d.ts +6 -6
- package/dist/task-record.d.ts +25 -4
- package/dist/task-record.d.ts.map +1 -1
- package/dist/task.d.ts +55 -36
- package/dist/task.d.ts.map +1 -1
- package/dist/task.js.map +1 -1
- package/dist/tasks/archive.d.ts +3 -3
- package/dist/templates/manifest.d.ts +1 -1
- package/dist/workgraph.d.ts +5 -3
- package/dist/workgraph.d.ts.map +1 -1
- package/dist/workgraph.js +19 -0
- package/dist/workgraph.js.map +1 -1
- package/package.json +2 -2
- package/schemas/gate-result.schema.json +350 -1
- package/src/__tests__/__snapshots__/operations-registry.test.ts.snap +1 -1
- package/src/__tests__/acceptance-gate.test.ts +282 -1
- package/src/__tests__/evidence-atom-schema.test.ts +17 -14
- package/src/__tests__/memory-wire-shapes.test.ts +2 -0
- package/src/__tests__/operations-registry.test.ts +26 -0
- package/src/acceptance-gate-schema.ts +320 -14
- package/src/acceptance-gate.ts +133 -11
- package/src/audit.ts +72 -2
- package/src/backup-manifest.ts +88 -0
- package/src/caamp-markers.ts +22 -0
- package/src/capabilities.ts +311 -0
- package/src/code-symbol.ts +37 -0
- package/src/data-accessor.ts +16 -0
- package/src/dispatch/__tests__/tasks-gateway-crud-ops.test.ts +31 -1
- package/src/dispatch/operations-registry.ts +689 -3
- package/src/docs-taxonomy.ts +26 -0
- package/src/evidence-atom-schema.ts +10 -9
- package/src/graph.ts +326 -2
- package/src/index.ts +43 -1
- package/src/invariants/adr-070-orchestration.ts +2 -1
- package/src/invariants/adr-073-saga.ts +2 -2
- package/src/jobs.ts +382 -3
- package/src/knowledge-health.ts +748 -0
- package/src/memory/observe.ts +4 -2
- package/src/memory/search.ts +4 -0
- package/src/nexus-living-brain-ops.ts +34 -3
- package/src/nexus-tasks-bridge-ops.ts +12 -0
- package/src/operations/admin.ts +11 -4
- package/src/operations/docs.ts +153 -0
- package/src/operations/focus.ts +11 -0
- package/src/operations/nexus.ts +7 -1
- package/src/operations/output-contracts-data.ts +33 -3
- package/src/operations/research.ts +36 -0
- package/src/operations/tasks.ts +116 -4
- package/src/package-artifact.ts +127 -0
- package/src/release/evidence-atoms.ts +6 -0
- package/src/resource-governor.ts +132 -0
- package/src/task-record.ts +27 -4
- package/src/task.ts +58 -36
- package/src/workgraph.ts +19 -0
package/src/task.ts
CHANGED
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
* @task T4456
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
-
import type { AcceptanceGate } from './acceptance-gate.js';
|
|
24
|
+
import type { AcceptanceGate, AcceptanceGateResult } from './acceptance-gate.js';
|
|
25
|
+
import type { AcRow } from './data-accessor.js';
|
|
25
26
|
import type { TaskStatus } from './status-registry.js';
|
|
26
27
|
|
|
27
28
|
export type { TaskStatus };
|
|
@@ -159,6 +160,29 @@ export type VerificationGate =
|
|
|
159
160
|
*/
|
|
160
161
|
| 'nexusImpact';
|
|
161
162
|
|
|
163
|
+
/** Task and criterion scope used while validating evidence, independent of PR metadata. */
|
|
164
|
+
export interface EvidenceValidationContext {
|
|
165
|
+
/** Canonical current task intent; prose is never interpreted as a file declaration. */
|
|
166
|
+
task: Pick<Task, 'id' | 'kind' | 'labels' | 'files' | 'acceptance' | 'verification'>;
|
|
167
|
+
/** Gates requested by this verification operation. */
|
|
168
|
+
gates: readonly VerificationGate[];
|
|
169
|
+
/** Canonical criteria read for this verification operation. */
|
|
170
|
+
criteria: ReadonlyArray<Pick<AcRow, 'id' | 'text' | 'updatedAt'>>;
|
|
171
|
+
/** Verified PR merge whose immutable artifact bytes must be inspected. */
|
|
172
|
+
artifactCommitSha?: string;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/** Explicit criterion link to inspected artifacts and validated results in one gate receipt. */
|
|
176
|
+
export interface CriterionEvidenceLink {
|
|
177
|
+
/** Canonical criterion identity and exact text hash at verification time. */
|
|
178
|
+
criterionId: string;
|
|
179
|
+
criterionHash: string;
|
|
180
|
+
/** Inspected changed artifacts; correspondence is asserted by the foreground caller. */
|
|
181
|
+
artifactPaths: string[];
|
|
182
|
+
/** Indices of actual validated result atoms in the containing gate's atoms array. */
|
|
183
|
+
resultAtomIndices: number[];
|
|
184
|
+
}
|
|
185
|
+
|
|
162
186
|
/** Verification failure log entry. */
|
|
163
187
|
export interface VerificationFailure {
|
|
164
188
|
/** Verification round number when the failure occurred. */
|
|
@@ -288,35 +312,9 @@ export type EvidenceAtom =
|
|
|
288
312
|
}
|
|
289
313
|
| {
|
|
290
314
|
/**
|
|
291
|
-
*
|
|
292
|
-
*
|
|
293
|
-
*
|
|
294
|
-
* Closes the release-verb dogfood gap (T9764): tasks that ship via the
|
|
295
|
-
* standard PR + admin-merge flow lacked a zero-friction way to record
|
|
296
|
-
* `implemented` / `testsPassed` / `qaPassed` evidence after the fact.
|
|
297
|
-
* Re-running `tool:test` against the entire monorepo is overkill for
|
|
298
|
-
* one-line tasks, and `note:` is rejected for hard gates on critical
|
|
299
|
-
* verifications.
|
|
300
|
-
*
|
|
301
|
-
* A `pr:<number>` atom satisfies `implemented`, `testsPassed`, and
|
|
302
|
-
* `qaPassed` simultaneously (T9838) when:
|
|
303
|
-
* 1. `state === 'MERGED'` (PR was actually shipped to main)
|
|
304
|
-
* 2. `mergedAt` is non-null (defends against API races)
|
|
305
|
-
* 3. The status-check rollup contains ≥1 SUCCESS check and zero
|
|
306
|
-
* FAILURE checks in the required workflows
|
|
307
|
-
* (`CI`, `Lockfile Check`, `Contracts Dep Lint`)
|
|
308
|
-
*
|
|
309
|
-
* Format: `pr:<positive integer>` (e.g. `pr:357`)
|
|
310
|
-
*
|
|
311
|
-
* Validation: CLEO calls `gh pr view <num> --json
|
|
312
|
-
* statusCheckRollup,mergeable,state,mergedAt,headRefOid` and parses
|
|
313
|
-
* the rollup. Results are cached under
|
|
314
|
-
* `.cleo/cache/evidence/pr-<num>.json` keyed on `(prNumber, mergedAt)`
|
|
315
|
-
* so re-verifies skip the network round trip.
|
|
316
|
-
*
|
|
317
|
-
* @task T9764
|
|
318
|
-
* @epic T9762
|
|
319
|
-
* @saga T9758
|
|
315
|
+
* Merged-PR provenance. Implementation additionally requires inspected
|
|
316
|
+
* changed artifacts and task/criterion linkage. Test and review gates
|
|
317
|
+
* require their own result atoms; merge status cannot satisfy them.
|
|
320
318
|
*/
|
|
321
319
|
kind: 'pr';
|
|
322
320
|
/** PR number (positive integer). */
|
|
@@ -329,6 +327,10 @@ export type EvidenceAtom =
|
|
|
329
327
|
successCount: number;
|
|
330
328
|
/** Total number of checks evaluated in the rollup. */
|
|
331
329
|
totalChecks: number;
|
|
330
|
+
/** Complete PR changed-file inventory retained for task-scope checks and display. */
|
|
331
|
+
changedPaths?: string[];
|
|
332
|
+
/** Explicit task relationship established when this atom was accepted. */
|
|
333
|
+
taskId?: string;
|
|
332
334
|
}
|
|
333
335
|
| {
|
|
334
336
|
/**
|
|
@@ -379,6 +381,13 @@ export type EvidenceAtom =
|
|
|
379
381
|
export interface GateEvidence {
|
|
380
382
|
/** One or more evidence atoms supporting this gate. */
|
|
381
383
|
atoms: EvidenceAtom[];
|
|
384
|
+
/** Task and gate scope captured alongside explicitly linked criterion evidence. */
|
|
385
|
+
scope?: {
|
|
386
|
+
taskId: string;
|
|
387
|
+
gate: VerificationGate;
|
|
388
|
+
classification: 'code' | 'documentation' | 'research';
|
|
389
|
+
criteria: CriterionEvidenceLink[];
|
|
390
|
+
};
|
|
382
391
|
/** ISO 8601 timestamp of when evidence was captured. */
|
|
383
392
|
capturedAt: string;
|
|
384
393
|
/** Agent identifier that captured the evidence. */
|
|
@@ -395,6 +404,8 @@ export interface GateEvidence {
|
|
|
395
404
|
|
|
396
405
|
/** Task verification state. */
|
|
397
406
|
export interface TaskVerification {
|
|
407
|
+
/** Explicitly verified acceptance results; only current authenticated bindings support completion. */
|
|
408
|
+
gateResults?: AcceptanceGateResult[];
|
|
398
409
|
/** Whether all required verification gates have passed. */
|
|
399
410
|
passed: boolean;
|
|
400
411
|
/** Current verification round number (starts at 1). */
|
|
@@ -732,13 +743,13 @@ export type CancelledTask = Task & {
|
|
|
732
743
|
};
|
|
733
744
|
|
|
734
745
|
/**
|
|
735
|
-
*
|
|
746
|
+
* Severity assertion signed with the project identity.
|
|
736
747
|
*
|
|
737
|
-
*
|
|
738
|
-
*
|
|
739
|
-
*
|
|
740
|
-
*
|
|
741
|
-
* payload
|
|
748
|
+
* Explicit severity changes through CLI, params, or SDK receive signed
|
|
749
|
+
* assertions bound to the actual task ID in the same transaction as the task
|
|
750
|
+
* audit. Standalone legacy JSONL assertions remain historical evidence and
|
|
751
|
+
* do not establish that a task mutation committed. Sorted-key serialization
|
|
752
|
+
* lets verifiers reconstruct the signed payload.
|
|
742
753
|
*
|
|
743
754
|
* Renamed from the earlier `BugSeverityAttestation` (which was scoped only to
|
|
744
755
|
* `cleo bug`). The new name reflects that severity attestation is a
|
|
@@ -763,6 +774,17 @@ export interface SeverityAttestation {
|
|
|
763
774
|
signerPub: string;
|
|
764
775
|
}
|
|
765
776
|
|
|
777
|
+
/** Signed severity assertion; task audit persistence establishes commit provenance. */
|
|
778
|
+
export interface SignedSeverityAttestation extends SeverityAttestation {
|
|
779
|
+
/** Ed25519 signature of the canonical assertion, excluding this signature field. */
|
|
780
|
+
_sig: {
|
|
781
|
+
/** Hex-encoded signature. */
|
|
782
|
+
sig: string;
|
|
783
|
+
/** Hex-encoded signing public key, matching signerPub. */
|
|
784
|
+
pub: string;
|
|
785
|
+
};
|
|
786
|
+
}
|
|
787
|
+
|
|
766
788
|
/** Phase status. */
|
|
767
789
|
export type PhaseStatus = 'pending' | 'active' | 'completed';
|
|
768
790
|
|
package/src/workgraph.ts
CHANGED
|
@@ -1058,6 +1058,23 @@ export interface WorkGraphHierarchyValidationOptions {
|
|
|
1058
1058
|
readonly throwOnViolation?: boolean;
|
|
1059
1059
|
}
|
|
1060
1060
|
|
|
1061
|
+
/**
|
|
1062
|
+
* Tiers that may sit at the root of a containment tree.
|
|
1063
|
+
*
|
|
1064
|
+
* Deliberately WIDER than the `cleo add` write path, which enforces strict-spine
|
|
1065
|
+
* containment (T11811) and hard-rejects a net-new parentless `epic`. The two are
|
|
1066
|
+
* not in conflict — they answer different questions. This set describes which
|
|
1067
|
+
* shapes are structurally VALID (the WorkGraph scaffold subsystem builds and
|
|
1068
|
+
* applies epic-rooted graphs, and the fleet still carries legacy root epics);
|
|
1069
|
+
* T11811 governs what a net-new agent-authored `cleo add` may CREATE.
|
|
1070
|
+
*
|
|
1071
|
+
* Narrowing this to `['saga']` to match the add path was attempted and reverted:
|
|
1072
|
+
* `validateWorkGraphHierarchy` never throws without `throwOnViolation`, but
|
|
1073
|
+
* `scaffold-validate.ts` consumes the returned violations and fails the
|
|
1074
|
+
* scaffold, so the change silently broke epic-rooted scaffolding. Tightening it
|
|
1075
|
+
* is a behaviour change to that subsystem, not a set edit — it needs its own
|
|
1076
|
+
* task, with the scaffold's root handling decided first.
|
|
1077
|
+
*/
|
|
1061
1078
|
const ROOT_TASK_TYPES: ReadonlySet<TaskType> = new Set(['saga', 'epic']);
|
|
1062
1079
|
|
|
1063
1080
|
const PARENT_TYPE_MATRIX: Readonly<Record<TaskType, readonly TaskType[]>> = {
|
|
@@ -1143,6 +1160,8 @@ function makeViolation(
|
|
|
1143
1160
|
* contain subtasks, and subtasks are leaves. Saga membership uses `parentId`
|
|
1144
1161
|
* containment, never `task_relations.groups`.
|
|
1145
1162
|
*
|
|
1163
|
+
* Note that `cleo add` is STRICTER — see {@link ROOT_TASK_TYPES}.
|
|
1164
|
+
*
|
|
1146
1165
|
* @param nodes - Task-like hierarchy rows to validate.
|
|
1147
1166
|
* @param options - Optional fail-fast behavior for enforcement call sites.
|
|
1148
1167
|
* @returns Structured validation result with all violations in input order.
|