@cleocode/contracts 2026.10.27 → 2026.11.1-canary.3
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/README.md +2 -0
- package/dist/.source-stamp.json +4 -0
- package/dist/__tests__/acceptance-gate.test.js +15 -3
- package/dist/__tests__/acceptance-gate.test.js.map +1 -1
- package/dist/__tests__/evidence-atom-schema.test.js +3 -1
- package/dist/__tests__/evidence-atom-schema.test.js.map +1 -1
- package/dist/__tests__/memory-wire-shapes.test.js.map +1 -1
- package/dist/acceptance-gate-schema.d.ts +25 -0
- package/dist/acceptance-gate-schema.d.ts.map +1 -1
- package/dist/acceptance-gate-schema.js +5 -0
- package/dist/acceptance-gate-schema.js.map +1 -1
- package/dist/acceptance-gate.d.ts +8 -0
- package/dist/acceptance-gate.d.ts.map +1 -1
- package/dist/data-accessor.d.ts +7 -0
- package/dist/data-accessor.d.ts.map +1 -1
- package/dist/data-accessor.js.map +1 -1
- package/dist/dependency.d.ts +2 -0
- package/dist/dependency.d.ts.map +1 -1
- package/dist/dispatch/operations-registry.d.ts.map +1 -1
- package/dist/dispatch/operations-registry.js +216 -0
- package/dist/dispatch/operations-registry.js.map +1 -1
- package/dist/docs/modernize.d.ts +435 -0
- package/dist/docs/modernize.d.ts.map +1 -0
- package/dist/docs/modernize.js +137 -0
- package/dist/docs/modernize.js.map +1 -0
- package/dist/docs-taxonomy.d.ts +6 -0
- package/dist/docs-taxonomy.d.ts.map +1 -1
- package/dist/docs-taxonomy.js +38 -1
- package/dist/docs-taxonomy.js.map +1 -1
- package/dist/done-plan.d.ts +27 -2
- package/dist/done-plan.d.ts.map +1 -1
- package/dist/evidence-atom-schema.d.ts +78 -4
- package/dist/evidence-atom-schema.d.ts.map +1 -1
- package/dist/evidence-atom-schema.js +136 -11
- package/dist/evidence-atom-schema.js.map +1 -1
- package/dist/exit-codes.d.ts +41 -0
- package/dist/exit-codes.d.ts.map +1 -1
- package/dist/exit-codes.js +41 -0
- package/dist/exit-codes.js.map +1 -1
- package/dist/index.d.ts +9 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/invariants/sync-write-invariants.d.ts.map +1 -1
- package/dist/invariants/sync-write-invariants.js +15 -0
- package/dist/invariants/sync-write-invariants.js.map +1 -1
- package/dist/memory/search.d.ts +13 -0
- package/dist/memory/search.d.ts.map +1 -1
- package/dist/merge-close.d.ts +167 -0
- package/dist/merge-close.d.ts.map +1 -0
- package/dist/merge-close.js +16 -0
- package/dist/merge-close.js.map +1 -0
- package/dist/operations/admin.d.ts +6 -0
- package/dist/operations/admin.d.ts.map +1 -1
- package/dist/operations/docs.d.ts +192 -3
- package/dist/operations/docs.d.ts.map +1 -1
- package/dist/operations/docs.js.map +1 -1
- package/dist/operations/worktree.d.ts +63 -0
- package/dist/operations/worktree.d.ts.map +1 -1
- package/dist/project-context.d.ts +31 -0
- package/dist/project-context.d.ts.map +1 -1
- package/dist/release/authorization.d.ts +46 -0
- package/dist/release/authorization.d.ts.map +1 -0
- package/dist/release/authorization.js +10 -0
- package/dist/release/authorization.js.map +1 -0
- package/dist/review-verdict.d.ts +125 -0
- package/dist/review-verdict.d.ts.map +1 -0
- package/dist/review-verdict.js +14 -0
- package/dist/review-verdict.js.map +1 -0
- package/dist/session-journal.d.ts.map +1 -1
- package/dist/session-journal.js +7 -1
- package/dist/session-journal.js.map +1 -1
- package/dist/task-record.d.ts +6 -1
- package/dist/task-record.d.ts.map +1 -1
- package/dist/task.d.ts +130 -3
- package/dist/task.d.ts.map +1 -1
- package/package.json +2 -2
- package/schemas/acceptance-gate.schema.json +24 -0
- package/schemas/task.schema.json +24 -0
- package/src/__tests__/__snapshots__/operations-registry.test.ts.snap +1 -1
- package/src/__tests__/acceptance-gate.test.ts +16 -3
- package/src/__tests__/evidence-atom-schema.test.ts +3 -1
- package/src/__tests__/memory-wire-shapes.test.ts +2 -0
- package/src/acceptance-gate-schema.ts +5 -0
- package/src/acceptance-gate.ts +9 -0
- package/src/data-accessor.ts +8 -0
- package/src/dependency.ts +2 -0
- package/src/dispatch/operations-registry.ts +228 -0
- package/src/docs/modernize.ts +407 -0
- package/src/docs-taxonomy.ts +44 -1
- package/src/done-plan.ts +27 -2
- package/src/evidence-atom-schema.ts +167 -14
- package/src/exit-codes.ts +41 -0
- package/src/index.ts +55 -0
- package/src/invariants/sync-write-invariants.ts +16 -0
- package/src/memory/search.ts +10 -0
- package/src/merge-close.ts +168 -0
- package/src/operations/admin.ts +6 -0
- package/src/operations/docs.ts +199 -4
- package/src/operations/worktree.ts +66 -0
- package/src/project-context.ts +33 -0
- package/src/release/authorization.ts +48 -0
- package/src/review-verdict.ts +122 -0
- package/src/session-journal.ts +7 -1
- package/src/task-record.ts +6 -1
- package/src/task.ts +124 -3
package/src/task.ts
CHANGED
|
@@ -209,6 +209,17 @@ export interface EvidenceValidationContext {
|
|
|
209
209
|
* each report is still validated on its own.
|
|
210
210
|
*/
|
|
211
211
|
testRunPaths?: readonly string[];
|
|
212
|
+
/**
|
|
213
|
+
* The task's criteria this write names with `satisfies:<task>#AC…` (T14094),
|
|
214
|
+
* with their `AC<n>` alias. A merged PR of another task links to this task
|
|
215
|
+
* only through them: each must name the files the PR changed, and none may
|
|
216
|
+
* have been written or edited after the PR merged (`createdAt` and
|
|
217
|
+
* `updatedAt`: an edit gives a criterion a new row). Both are UTC ISO-8601
|
|
218
|
+
* with a zone, normalised by the writer from the store's zoneless text.
|
|
219
|
+
*/
|
|
220
|
+
creditedCriteria?: ReadonlyArray<
|
|
221
|
+
Pick<AcRow, 'id' | 'text' | 'createdAt' | 'updatedAt'> & { alias: string }
|
|
222
|
+
>;
|
|
212
223
|
/**
|
|
213
224
|
* Validate without persisting anything: `pr:`/`ci:` lookups write neither
|
|
214
225
|
* the PR-result cache nor the branch-protection cache (T12671 review — the
|
|
@@ -353,9 +364,9 @@ export type EvidenceAtom =
|
|
|
353
364
|
*/
|
|
354
365
|
runtimeExcluded?: string[];
|
|
355
366
|
/**
|
|
356
|
-
* Untracked files
|
|
357
|
-
*
|
|
358
|
-
* in a shared checkout. The tree hash includes them, so `cleo complete`
|
|
367
|
+
* Untracked files the binding did not judge as this change (T14000,
|
|
368
|
+
* T14125): anything not committed or staged, such as another agent's
|
|
369
|
+
* work in a shared checkout. The tree hash includes them, so `cleo complete`
|
|
359
370
|
* and the superseded check refuse this atom as stale once any of them
|
|
360
371
|
* is tracked (committed into the change): the run never covered it.
|
|
361
372
|
*/
|
|
@@ -396,6 +407,13 @@ export type EvidenceAtom =
|
|
|
396
407
|
nonCodeChange?: boolean;
|
|
397
408
|
/** Untracked files set aside at bind time, as for `test-run` (T14000). */
|
|
398
409
|
untrackedSetAside?: string[];
|
|
410
|
+
/**
|
|
411
|
+
* The changed paths each check reads, judged at bind time (T14089): a
|
|
412
|
+
* check with none is not owed (a `.mjs`-only change owes no typecheck).
|
|
413
|
+
* Absent on receipts bound before T14089, or when nothing was judged:
|
|
414
|
+
* then both checks are owed.
|
|
415
|
+
*/
|
|
416
|
+
owedChecks?: { typecheck: string[]; lint: string[] };
|
|
399
417
|
}
|
|
400
418
|
| {
|
|
401
419
|
kind: 'tool';
|
|
@@ -463,6 +481,12 @@ export type EvidenceAtom =
|
|
|
463
481
|
untestedPackages?: string[];
|
|
464
482
|
/** Changed CLEO config this result leaves to `tool:config-schema` in the same gate write (T13778). */
|
|
465
483
|
configPaths?: string[];
|
|
484
|
+
/**
|
|
485
|
+
* Untracked files a scoped `tool:test`/`tool:test-affected` result did
|
|
486
|
+
* not judge as this change (T14125), as on a test-run atom: `cleo
|
|
487
|
+
* complete` refuses the result once any of them is tracked.
|
|
488
|
+
*/
|
|
489
|
+
untrackedSetAside?: string[];
|
|
466
490
|
/**
|
|
467
491
|
* Test files that failed and then passed on their single retry
|
|
468
492
|
* (T12961). The run counts as a pass; this marks it as a FLAKY pass so
|
|
@@ -734,6 +758,80 @@ export type EvidenceAtom =
|
|
|
734
758
|
/** Where the required-check list came from (env, project context, branch protection). */
|
|
735
759
|
requiredSource: string;
|
|
736
760
|
}
|
|
761
|
+
| {
|
|
762
|
+
/**
|
|
763
|
+
* A green run of `.github/workflows/repeat-run.yml` (T14149): one test
|
|
764
|
+
* file run `runs` times on the default branch, every run passing. Read
|
|
765
|
+
* from GitHub (workflow, event, branch, latest attempt) and cross-checked
|
|
766
|
+
* against the run's uploaded report. `headSha` must contain the task's
|
|
767
|
+
* implemented commits; the test file must be one the task changed or one a
|
|
768
|
+
* linked criterion names. It links criteria; it does not satisfy
|
|
769
|
+
* `testsPassed` on its own.
|
|
770
|
+
*
|
|
771
|
+
* @task T14149
|
|
772
|
+
*/
|
|
773
|
+
kind: 'ci-run';
|
|
774
|
+
/** GitHub Actions run id. */
|
|
775
|
+
runId: number;
|
|
776
|
+
/** Commit the run tested (the run's `head_sha` on the default branch). */
|
|
777
|
+
headSha: string;
|
|
778
|
+
/** Repo-relative test file the run repeated. */
|
|
779
|
+
test: string;
|
|
780
|
+
/** How many consecutive runs passed. */
|
|
781
|
+
runs: number;
|
|
782
|
+
/** Run attempt that was judged (the latest). */
|
|
783
|
+
attempt: number;
|
|
784
|
+
/** Workflow file of the run. */
|
|
785
|
+
workflow: string;
|
|
786
|
+
/** Task the atom was verified for. */
|
|
787
|
+
taskId?: string;
|
|
788
|
+
}
|
|
789
|
+
| {
|
|
790
|
+
/**
|
|
791
|
+
* Probed deployment (T14083, owner decision on option (a)): at verify
|
|
792
|
+
* time CLEO ran a bounded GET of `probeUrl`, it returned 2xx and named
|
|
793
|
+
* the deployed SHA in its body or an `X-Commit` / `X-Version` header.
|
|
794
|
+
* `headSha` must contain the task's implemented commits (ancestor or
|
|
795
|
+
* patch-equivalent); `cleo complete` re-checks only that, never the probe.
|
|
796
|
+
* Satisfies only the gates in `satisfiesGates`, the project's
|
|
797
|
+
* `evidence.deploySatisfies` at verify time.
|
|
798
|
+
*
|
|
799
|
+
* @task T14083
|
|
800
|
+
*/
|
|
801
|
+
kind: 'deploy';
|
|
802
|
+
/** Provider name as given (`railway`, `fly`, …); recorded, not verified. */
|
|
803
|
+
provider: string;
|
|
804
|
+
/** Provider deployment id as given; recorded, not verified. */
|
|
805
|
+
deploymentId: string;
|
|
806
|
+
/** The deployed commit, resolved to its full SHA. */
|
|
807
|
+
headSha: string;
|
|
808
|
+
/** The URL that was probed. */
|
|
809
|
+
probeUrl: string;
|
|
810
|
+
/** The probe's result. */
|
|
811
|
+
probe: {
|
|
812
|
+
/** HTTP status (2xx). */
|
|
813
|
+
status: number;
|
|
814
|
+
/** ISO 8601 time the probe completed. */
|
|
815
|
+
probedAt: string;
|
|
816
|
+
/** sha256 of the (bounded) response body read. */
|
|
817
|
+
bodySha256: string;
|
|
818
|
+
/** Where the SHA was named: `x-commit`, `x-version` or `body`. */
|
|
819
|
+
shaSource: 'x-commit' | 'x-version' | 'body';
|
|
820
|
+
};
|
|
821
|
+
/** The gates this atom satisfies (`evidence.deploySatisfies` at verify time). */
|
|
822
|
+
satisfiesGates: VerificationGate[];
|
|
823
|
+
/**
|
|
824
|
+
* The provider's own word on the deployment (T14091): `verified: true`
|
|
825
|
+
* when its API confirmed the deployment is live and was built from
|
|
826
|
+
* `headSha`; `verified: false` (with why) when no adapter or credential
|
|
827
|
+
* let CLEO ask, and only the probe stands. Absent on atoms before T14091.
|
|
828
|
+
*/
|
|
829
|
+
providerCheck?:
|
|
830
|
+
| { verified: true; status: string; commitSha: string; checkedAt: string }
|
|
831
|
+
| { verified: false; reason: string };
|
|
832
|
+
/** Task the atom was verified for. */
|
|
833
|
+
taskId?: string;
|
|
834
|
+
}
|
|
737
835
|
| {
|
|
738
836
|
/**
|
|
739
837
|
* Satisfies atom — cross-task acceptance-criterion binding per
|
|
@@ -802,6 +900,29 @@ export interface GateEvidence {
|
|
|
802
900
|
override?: boolean;
|
|
803
901
|
/** Reason given for an override (`CLEO_OWNER_OVERRIDE_REASON` env). */
|
|
804
902
|
overrideReason?: string;
|
|
903
|
+
/**
|
|
904
|
+
* Why a scoped run recorded after the merge stands in for this gate where
|
|
905
|
+
* the change alone would have needed a whole-suite run (T14163). Written by
|
|
906
|
+
* `cleo complete` when it accepts the stand-in, so the reason outlives the
|
|
907
|
+
* command's output.
|
|
908
|
+
*/
|
|
909
|
+
standIn?: GateStandIn;
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
/**
|
|
913
|
+
* A recorded post-merge stand-in (T14163): a manifest-only workspace change
|
|
914
|
+
* (root `package.json` dependency fields and the pnpm lockfile) scoped by the
|
|
915
|
+
* lockfile importers its merge changed.
|
|
916
|
+
*/
|
|
917
|
+
export interface GateStandIn {
|
|
918
|
+
/** The stand-in rule that applied. */
|
|
919
|
+
kind: 'manifest-scoped';
|
|
920
|
+
/** The merge commit whose lockfile diff was read. */
|
|
921
|
+
mergeCommit: string;
|
|
922
|
+
/** Lockfile importers the merge changed; `.` is the root, every package. */
|
|
923
|
+
importers: string[];
|
|
924
|
+
/** ISO 8601 time `cleo complete` recorded it. */
|
|
925
|
+
recordedAt: string;
|
|
805
926
|
}
|
|
806
927
|
|
|
807
928
|
/** Task verification state. */
|