@cleocode/contracts 2026.10.18 → 2026.10.19
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/branch-lock.d.ts +14 -3
- package/dist/branch-lock.d.ts.map +1 -1
- package/dist/branch-lock.js +8 -3
- package/dist/branch-lock.js.map +1 -1
- package/dist/dispatch/operations-registry.d.ts.map +1 -1
- package/dist/dispatch/operations-registry.js +7 -0
- package/dist/dispatch/operations-registry.js.map +1 -1
- package/dist/done-plan.d.ts +69 -0
- package/dist/done-plan.d.ts.map +1 -1
- package/dist/goal-contract.d.ts +44 -4
- package/dist/goal-contract.d.ts.map +1 -1
- package/dist/goal-contract.js +2 -2
- package/dist/goal-contract.js.map +1 -1
- package/dist/goal-runtime.d.ts +89 -0
- package/dist/goal-runtime.d.ts.map +1 -0
- package/dist/goal-runtime.js +13 -0
- package/dist/goal-runtime.js.map +1 -0
- package/dist/goal.d.ts +12 -116
- package/dist/goal.d.ts.map +1 -1
- package/dist/goal.js +9 -72
- package/dist/goal.js.map +1 -1
- package/dist/heavy-command-hook.d.ts +6 -0
- package/dist/heavy-command-hook.d.ts.map +1 -1
- package/dist/index.d.ts +6 -4
- 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.js +6 -5
- package/dist/invariants/sync-write-invariants.js.map +1 -1
- package/dist/operations/docs.d.ts +2 -2
- package/dist/operations/docs.d.ts.map +1 -1
- package/dist/project-hooks.d.ts +15 -2
- package/dist/project-hooks.d.ts.map +1 -1
- package/dist/project-hooks.js +8 -0
- package/dist/project-hooks.js.map +1 -1
- package/dist/release/hook-pilot.d.ts +141 -2
- package/dist/release/hook-pilot.d.ts.map +1 -1
- package/dist/release/hook-pilot.js +75 -3
- package/dist/release/hook-pilot.js.map +1 -1
- package/dist/task.d.ts +23 -0
- package/dist/task.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/__snapshots__/operations-registry.test.ts.snap +1 -1
- package/src/branch-lock.ts +14 -3
- package/src/dispatch/operations-registry.ts +8 -0
- package/src/done-plan.ts +73 -0
- package/src/goal-contract.ts +48 -4
- package/src/goal-runtime.ts +105 -0
- package/src/goal.ts +12 -133
- package/src/heavy-command-hook.ts +9 -0
- package/src/index.ts +18 -7
- package/src/invariants/sync-write-invariants.ts +5 -5
- package/src/operations/docs.ts +3 -2
- package/src/project-hooks.ts +15 -1
- package/src/release/hook-pilot.ts +85 -3
- package/src/task.ts +23 -0
package/dist/done-plan.d.ts
CHANGED
|
@@ -61,6 +61,8 @@ export interface DonePlanBlocker {
|
|
|
61
61
|
next: DoneNextStep;
|
|
62
62
|
/** Original evidence error code when the blocker wraps a validator refusal. */
|
|
63
63
|
cause?: string;
|
|
64
|
+
/** The verification gate the blocker holds back, when it is one gate's (T13795). */
|
|
65
|
+
gate?: VerificationGate;
|
|
64
66
|
}
|
|
65
67
|
/** A merged PR that cites the task. */
|
|
66
68
|
export interface ChangeSetPrCandidate {
|
|
@@ -329,4 +331,71 @@ export interface DoneBlockedDetails {
|
|
|
329
331
|
/** The plan, for tooling. */
|
|
330
332
|
plan: DonePlan;
|
|
331
333
|
}
|
|
334
|
+
/** A test file a covering test-run report must run, and why. */
|
|
335
|
+
export interface OwedTestFile {
|
|
336
|
+
/** Repo-relative test file. */
|
|
337
|
+
file: string;
|
|
338
|
+
/** Why the binding requires it. */
|
|
339
|
+
reason: string;
|
|
340
|
+
}
|
|
341
|
+
/** An affected package a covering report must run at least one test file of. */
|
|
342
|
+
export interface OwedTestPackage {
|
|
343
|
+
/** Workspace package name. */
|
|
344
|
+
name: string;
|
|
345
|
+
/** Changed itself, or depends on a changed package. */
|
|
346
|
+
reason: 'changed' | 'depends on a changed package';
|
|
347
|
+
/** Test files of this package the change adds or edits (the natural choice). */
|
|
348
|
+
changedTestFiles: string[];
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* The tests a task's change owes, as the `test-run:` binding and
|
|
352
|
+
* `cleo done --plan` enforce them (T13795).
|
|
353
|
+
*
|
|
354
|
+
* - `targeted`: a passing report of every `files` entry plus at least one test
|
|
355
|
+
* file of every `packages` entry binds (config files and typecheck-only
|
|
356
|
+
* dependents are owed their own results).
|
|
357
|
+
* - `full`: the change is workspace-wide; only `tool:test` (or `ci:<pr>`) binds.
|
|
358
|
+
* - `none`: no changed path to judge (no origin default branch, or no change).
|
|
359
|
+
*/
|
|
360
|
+
export interface TaskTestPlan {
|
|
361
|
+
/** Changed paths judged, or null when none could be read. */
|
|
362
|
+
changedPaths: string[] | null;
|
|
363
|
+
/** How the change can be tested. */
|
|
364
|
+
scope: 'targeted' | 'full' | 'none';
|
|
365
|
+
/** Why only a full run binds (`scope === 'full'`). */
|
|
366
|
+
reason?: string;
|
|
367
|
+
/** Exact test files a covering report must run. */
|
|
368
|
+
files: OwedTestFile[];
|
|
369
|
+
/** Packages a covering report must run at least one test file of. */
|
|
370
|
+
packages: OwedTestPackage[];
|
|
371
|
+
/** Affected packages with no test file at all. */
|
|
372
|
+
untestedPackages: string[];
|
|
373
|
+
/** CLEO config files the change edits, owed `tool:config-schema` instead of a test. */
|
|
374
|
+
configPaths: string[];
|
|
375
|
+
/** Typecheck-only dependent package dirs, owed a typecheck instead of a test. */
|
|
376
|
+
typecheckDirs: string[];
|
|
377
|
+
/**
|
|
378
|
+
* Whether the change has merged. A merged change is judged as `cleo complete`
|
|
379
|
+
* judges it: the task's own part of the landed change, and every test file it
|
|
380
|
+
* adds or edits owed by a test-run recorded on the default branch.
|
|
381
|
+
*/
|
|
382
|
+
merged: boolean;
|
|
383
|
+
/** Whether the task already holds a standing testsPassed gate. */
|
|
384
|
+
gatePassed: boolean;
|
|
385
|
+
/** The testsPassed tool runs `cleo done` would use. */
|
|
386
|
+
toolRuns: DonePlanToolRun[];
|
|
387
|
+
/** The testsPassed blockers `cleo done --plan` reports. */
|
|
388
|
+
blockers: DonePlanBlocker[];
|
|
389
|
+
}
|
|
390
|
+
/** Result of `cleo tasks changeset <id> [--test-plan]` (T13795). */
|
|
391
|
+
export interface TaskChangeSetReport {
|
|
392
|
+
/** Task id. */
|
|
393
|
+
taskId: string;
|
|
394
|
+
/** The change set `cleo done` derives. */
|
|
395
|
+
changeSet: TaskChangeSet;
|
|
396
|
+
/** Commits of the change, oldest first. */
|
|
397
|
+
commits: string[];
|
|
398
|
+
/** The tests owed (with `--test-plan`). */
|
|
399
|
+
testPlan?: TaskTestPlan;
|
|
400
|
+
}
|
|
332
401
|
//# sourceMappingURL=done-plan.d.ts.map
|
package/dist/done-plan.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"done-plan.d.ts","sourceRoot":"","sources":["../src/done-plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAElD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE3E;;;;;;;;;GASG;AACH,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,qBAAqB,GAAG,eAAe,GAAG,OAAO,CAAC;AAEjG,wCAAwC;AACxC,MAAM,WAAW,YAAY;IAC3B,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,wCAAwC;IACxC,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAC3B,UAAU,GACV,YAAY,GACZ,eAAe,GACf,cAAc,GACd,eAAe,GACf,YAAY,GACZ,aAAa,GACb,sBAAsB,GACtB,kBAAkB,GAClB,iBAAiB,GACjB,aAAa,GACb,mBAAmB,GACnB,oBAAoB,GACpB,iBAAiB,GACjB,eAAe,GACf,mBAAmB,GACnB,aAAa,GACb,aAAa,GACb,mBAAmB,GACnB,mBAAmB,GACnB,kBAAkB,GAClB,oB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U,EAAE,OAAO,CAAC;IACpB,uDAAuD;IACvD,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,2DAA2D;IAC3D,QAAQ,EAAE,eAAe,EAAE,CAAC;CAC7B;AAED,oEAAoE;AACpE,MAAM,WAAW,mBAAmB;IAClC,eAAe;IACf,MAAM,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,SAAS,EAAE,aAAa,CAAC;IACzB,2CAA2C;IAC3C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB"}
|
package/dist/goal-contract.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* goal/v1 — the contract a goal runtime executes against, and what CLEO reads
|
|
3
3
|
* back from a run.
|
|
4
4
|
*
|
|
5
|
-
* CLEO owns the goal protocol;
|
|
5
|
+
* CLEO owns the goal protocol; CLEO Goal (`@cleocode/goal`, bin `cleo-goal`, alias `ocg`) is the goal runtime (owner
|
|
6
6
|
* decision 2026-10-16, epic T13791). The two stay separate packages and talk
|
|
7
7
|
* only through the `cleo` CLI and LAFS envelopes:
|
|
8
8
|
*
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* 3. `cleo goal close` reads the outcome and records evidence for each passing
|
|
14
14
|
* criterion on the gate it demonstrates, via {@link GoalCriterion.proves}.
|
|
15
15
|
*
|
|
16
|
-
* The shapes mirror
|
|
16
|
+
* The shapes mirror CLEO Goal's `src/contract/types.ts` field for field, in CLEO Goal's
|
|
17
17
|
* snake_case YAML spelling, so one file means the same thing on both sides.
|
|
18
18
|
* The only addition is the optional per-criterion `proves` list.
|
|
19
19
|
*
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
* @epic T13791
|
|
31
31
|
* @task T13792
|
|
32
32
|
*/
|
|
33
|
+
import type { GoalRuntimeStatus } from './goal-runtime.js';
|
|
33
34
|
/** The schema tag every goal/v1 contract carries. */
|
|
34
35
|
export declare const GOAL_CONTRACT_SCHEMA: "goal/v1";
|
|
35
36
|
/** Expected result of a {@link GoalCommandCheck}. Absent fields are not checked; no field at all means `exit: 0`. */
|
|
@@ -210,9 +211,9 @@ export type GoalVerificationMode = 'host' | 'host+verifier' | 'strict';
|
|
|
210
211
|
/** The CLEO evidence gates a goal can declare evidence for. */
|
|
211
212
|
export type GoalCleoGate = 'implemented' | 'testsPassed' | 'qaPassed';
|
|
212
213
|
/**
|
|
213
|
-
* A CLEO task the goal serves (
|
|
214
|
+
* A CLEO task the goal serves (CLEO Goal `CleoTaskLink`).
|
|
214
215
|
*
|
|
215
|
-
* The bare id links the task for reporting. `acs` is
|
|
216
|
+
* The bare id links the task for reporting. `acs` is CLEO Goal's older per-gate
|
|
216
217
|
* claim of which AC aliases a gate's evidence proves; per-criterion
|
|
217
218
|
* {@link GoalCriterion.proves} is the precise form and what `cleo goal draft`
|
|
218
219
|
* writes. An AC neither form claims stays open.
|
|
@@ -401,4 +402,43 @@ export interface GoalOutcome {
|
|
|
401
402
|
/** Per-criterion and per-invariant verdicts. */
|
|
402
403
|
results: GoalCriterionOutcome[];
|
|
403
404
|
}
|
|
405
|
+
/** A drafted goal and the CLEO tasks it serves, from its `goal.yaml` (T13821). */
|
|
406
|
+
export interface GoalDraftEntry {
|
|
407
|
+
/** Goal slug (its directory under `.opencode/goals/`). */
|
|
408
|
+
slug: string;
|
|
409
|
+
/** Contract title, when the contract parses. */
|
|
410
|
+
title: string | null;
|
|
411
|
+
/** CLEO tasks the goal serves: `cleo.tasks` plus every task a criterion proves. */
|
|
412
|
+
tasks: string[];
|
|
413
|
+
/** Why the contract could not be read, when it could not. */
|
|
414
|
+
problem?: string;
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* `cleo goal status` (T13821): the drafted goals and the live run, which CLEO
|
|
418
|
+
* reads only through `cleo-goal status --json`, never the runtime's files.
|
|
419
|
+
*/
|
|
420
|
+
export interface GoalStatusReport {
|
|
421
|
+
/** Whether the CLEO Goal bin (`cleo-goal`, alias `ocg`) is installed. */
|
|
422
|
+
runtime: 'installed' | 'not-installed';
|
|
423
|
+
/** The commands that install it, when it is not installed. */
|
|
424
|
+
install?: string[];
|
|
425
|
+
/** The live run, from `cleo-goal status --json`; null when not installed. */
|
|
426
|
+
live: GoalRuntimeStatus | null;
|
|
427
|
+
/** The drafted goals (filtered to one task with `--task`). */
|
|
428
|
+
goals: GoalDraftEntry[];
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* The goal runtime (CLEO Goal) as `cleo go` finds it, and the exact next step
|
|
432
|
+
* in the current harness (T13821).
|
|
433
|
+
*/
|
|
434
|
+
export interface GoalRuntimeHandoff {
|
|
435
|
+
/** Whether the CLEO Goal bin (`cleo-goal`, then `ocg`) resolves. */
|
|
436
|
+
installed: boolean;
|
|
437
|
+
/** The resolved bin, when installed. */
|
|
438
|
+
bin?: string;
|
|
439
|
+
/** The commands that install it, when it is not installed. */
|
|
440
|
+
install?: string[];
|
|
441
|
+
/** The one next step, in plain words. */
|
|
442
|
+
next: string;
|
|
443
|
+
}
|
|
404
444
|
//# sourceMappingURL=goal-contract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"goal-contract.d.ts","sourceRoot":"","sources":["../src/goal-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,qDAAqD;AACrD,eAAO,MAAM,oBAAoB,EAAG,SAAkB,CAAC;AAEvD,qHAAqH;AACrH,MAAM,WAAW,eAAe;IAC9B,0BAA0B;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,4CAA4C;IAC5C,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,2DAA2D;AAC3D,MAAM,WAAW,gBAAgB;IAC/B,oBAAoB;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,kDAAkD;IAClD,GAAG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CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;CACd"}
|
package/dist/goal-contract.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* goal/v1 — the contract a goal runtime executes against, and what CLEO reads
|
|
3
3
|
* back from a run.
|
|
4
4
|
*
|
|
5
|
-
* CLEO owns the goal protocol;
|
|
5
|
+
* CLEO owns the goal protocol; CLEO Goal (`@cleocode/goal`, bin `cleo-goal`, alias `ocg`) is the goal runtime (owner
|
|
6
6
|
* decision 2026-10-16, epic T13791). The two stay separate packages and talk
|
|
7
7
|
* only through the `cleo` CLI and LAFS envelopes:
|
|
8
8
|
*
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* 3. `cleo goal close` reads the outcome and records evidence for each passing
|
|
14
14
|
* criterion on the gate it demonstrates, via {@link GoalCriterion.proves}.
|
|
15
15
|
*
|
|
16
|
-
* The shapes mirror
|
|
16
|
+
* The shapes mirror CLEO Goal's `src/contract/types.ts` field for field, in CLEO Goal's
|
|
17
17
|
* snake_case YAML spelling, so one file means the same thing on both sides.
|
|
18
18
|
* The only addition is the optional per-criterion `proves` list.
|
|
19
19
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"goal-contract.js","sourceRoot":"","sources":["../src/goal-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;
|
|
1
|
+
{"version":3,"file":"goal-contract.js","sourceRoot":"","sources":["../src/goal-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAIH,qDAAqD;AACrD,MAAM,CAAC,MAAM,oBAAoB,GAAG,SAAkB,CAAC;AAiGvD,uEAAuE;AACvE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAU,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire shapes of the CLEO Goal runtime bin (`@cleocode/goal`, bin `cleo-goal`,
|
|
3
|
+
* alias `ocg`) that CLEO parses. CLEO talks to the runtime only through these
|
|
4
|
+
* JSON outputs (T13791); an unknown `schemaVersion` is refused, never guessed.
|
|
5
|
+
*
|
|
6
|
+
* @task T13819
|
|
7
|
+
* @task T13820
|
|
8
|
+
* @task T13821
|
|
9
|
+
* @epic T13791
|
|
10
|
+
*/
|
|
11
|
+
/** The only `schemaVersion` this CLEO understands for every shape below. */
|
|
12
|
+
export declare const GOAL_RUNTIME_SCHEMA_VERSION = 1;
|
|
13
|
+
/** Run state reported by `cleo-goal status --json`; `none` when no goal is live. */
|
|
14
|
+
export type GoalRuntimeRunStatus = 'running' | 'waiting' | 'verifying' | 'paused' | 'blocked' | 'needs_review' | 'budget_limited' | 'complete' | 'failed' | 'aborted' | 'superseded' | 'none';
|
|
15
|
+
/** One criterion of the live goal. */
|
|
16
|
+
export interface GoalRuntimeCriterion {
|
|
17
|
+
readonly id: string;
|
|
18
|
+
readonly statement: string;
|
|
19
|
+
readonly status: string;
|
|
20
|
+
readonly essential: boolean;
|
|
21
|
+
readonly invariant: boolean;
|
|
22
|
+
readonly by: string;
|
|
23
|
+
readonly detail: string;
|
|
24
|
+
}
|
|
25
|
+
/** One budget dimension (turns, tokens, time, …). */
|
|
26
|
+
export interface GoalRuntimeBudgetPart {
|
|
27
|
+
readonly name: string;
|
|
28
|
+
readonly used: number;
|
|
29
|
+
readonly limit: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* `cleo-goal status --json` stdout. The bin exits 0 whenever the project was
|
|
33
|
+
* readable, including with no goal (`goal: null`, `status: 'none'`).
|
|
34
|
+
*/
|
|
35
|
+
export interface GoalRuntimeStatus {
|
|
36
|
+
readonly schemaVersion: typeof GOAL_RUNTIME_SCHEMA_VERSION;
|
|
37
|
+
readonly goal: string | null;
|
|
38
|
+
readonly runId: string | null;
|
|
39
|
+
readonly title: string;
|
|
40
|
+
readonly status: GoalRuntimeRunStatus;
|
|
41
|
+
readonly priority?: string;
|
|
42
|
+
readonly turn: number;
|
|
43
|
+
readonly reason: string | null;
|
|
44
|
+
readonly criteria: readonly GoalRuntimeCriterion[];
|
|
45
|
+
readonly proven: number;
|
|
46
|
+
readonly total: number;
|
|
47
|
+
readonly budget: {
|
|
48
|
+
readonly ratio: number;
|
|
49
|
+
readonly parts: readonly GoalRuntimeBudgetPart[];
|
|
50
|
+
};
|
|
51
|
+
readonly verdict: {
|
|
52
|
+
readonly passed: boolean;
|
|
53
|
+
readonly lines: readonly string[];
|
|
54
|
+
readonly turn: number;
|
|
55
|
+
} | null;
|
|
56
|
+
readonly blocker: {
|
|
57
|
+
readonly key: string;
|
|
58
|
+
readonly count: number;
|
|
59
|
+
readonly reason: string;
|
|
60
|
+
} | null;
|
|
61
|
+
/** Epoch milliseconds. */
|
|
62
|
+
readonly updatedAt: number;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* One OpenCode v2 `plugins` entry: a spec, a `[spec, options]` tuple, or a
|
|
66
|
+
* `{ package, options }` object.
|
|
67
|
+
*/
|
|
68
|
+
export type GoalRuntimePluginEntry = string | readonly [string, Readonly<Record<string, unknown>>] | {
|
|
69
|
+
readonly package: string;
|
|
70
|
+
readonly options?: Readonly<Record<string, unknown>>;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* `cleo-goal install --project --json` stdout on exit 0. Writes only the
|
|
74
|
+
* project's `.opencode/opencode.json` (OpenCode v2 `plugins` key).
|
|
75
|
+
*/
|
|
76
|
+
export interface GoalRuntimeInstall {
|
|
77
|
+
readonly schemaVersion: typeof GOAL_RUNTIME_SCHEMA_VERSION;
|
|
78
|
+
readonly action: 'installed' | 'already-present' | 'updated' | 'dry-run';
|
|
79
|
+
readonly file: string;
|
|
80
|
+
/** The npm or git spec registered (`github:…#vX.Y.Z` until npm publish). */
|
|
81
|
+
readonly spec: string;
|
|
82
|
+
readonly plugins: readonly GoalRuntimePluginEntry[];
|
|
83
|
+
}
|
|
84
|
+
/** `cleo-goal` stdout on exit 1 (exit 2 is a usage error on stderr only). */
|
|
85
|
+
export interface GoalRuntimeError {
|
|
86
|
+
readonly schemaVersion: typeof GOAL_RUNTIME_SCHEMA_VERSION;
|
|
87
|
+
readonly error: string;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=goal-runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goal-runtime.d.ts","sourceRoot":"","sources":["../src/goal-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,4EAA4E;AAC5E,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAE7C,oFAAoF;AACpF,MAAM,MAAM,oBAAoB,GAC5B,SAAS,GACT,SAAS,GACT,WAAW,GACX,QAAQ,GACR,SAAS,GACT,cAAc,GACd,gBAAgB,GAChB,UAAU,GACV,QAAQ,GACR,SAAS,GACT,YAAY,GACZ,MAAM,CAAC;AAEX,sCAAsC;AACtC,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,qDAAqD;AACrD,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,iBA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AQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,GACpD;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CAAE,CAAC;AAEvF;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,aAAa,EAAE,OAAO,2BAA2B,CAAC;IAC3D,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,iBAAiB,GAAG,SAAS,GAAG,SAAS,CAAC;IACzE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,SAAS,sBAAsB,EAAE,CAAC;CACrD;AAED,6EAA6E;AAC7E,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,aAAa,EAAE,OAAO,2BAA2B,CAAC;IAC3D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire shapes of the CLEO Goal runtime bin (`@cleocode/goal`, bin `cleo-goal`,
|
|
3
|
+
* alias `ocg`) that CLEO parses. CLEO talks to the runtime only through these
|
|
4
|
+
* JSON outputs (T13791); an unknown `schemaVersion` is refused, never guessed.
|
|
5
|
+
*
|
|
6
|
+
* @task T13819
|
|
7
|
+
* @task T13820
|
|
8
|
+
* @task T13821
|
|
9
|
+
* @epic T13791
|
|
10
|
+
*/
|
|
11
|
+
/** The only `schemaVersion` this CLEO understands for every shape below. */
|
|
12
|
+
export const GOAL_RUNTIME_SCHEMA_VERSION = 1;
|
|
13
|
+
//# sourceMappingURL=goal-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goal-runtime.js","sourceRoot":"","sources":["../src/goal-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,4EAA4E;AAC5E,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC"}
|
package/dist/goal.d.ts
CHANGED
|
@@ -1,38 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* CLEO
|
|
2
|
+
* CLEO goal record contracts.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* - **Hermes** — a post-turn loop with a turn budget and parse-failure
|
|
12
|
-
* auto-pause, but it still judges *fuzzy* intent against transcript text.
|
|
13
|
-
*
|
|
14
|
-
* CLEO's differentiator is the **evidence-gate-aware judge**: when a goal is to
|
|
15
|
-
* *complete a task* (`complete T123`), the judge does NOT read the transcript.
|
|
16
|
-
* It resolves the target task's actual `status` and re-uses the shipped ADR-051
|
|
17
|
-
* evidence infrastructure ({@link GateEvidenceRequirement} +
|
|
18
|
-
* `validateEvidenceForGate`) — the goal is satisfied ONLY when the task is
|
|
19
|
-
* `done` with its required gates backed by real, validated evidence atoms
|
|
20
|
-
* (commit reachable, file sha256 match, test-run hash match). Transcript text
|
|
21
|
-
* can never satisfy a task-completion goal. Fuzzy goals fall back to an
|
|
22
|
-
* injectable LLM judge (see {@link GoalJudge}) so the model is consulted only
|
|
23
|
-
* where no machine-checkable artifact exists.
|
|
24
|
-
*
|
|
25
|
-
* This module is the LEAF contract: it declares the persisted record shape
|
|
26
|
-
* ({@link GoalRecord}), the lifecycle status union ({@link GoalStatus}), the
|
|
27
|
-
* discriminated goal-kind union ({@link GoalKind}), and the judge verdict shape
|
|
28
|
-
* ({@link GoalJudgeVerdict}) that every layer (store, judge, loop, continuation,
|
|
29
|
-
* CLI) agrees on. It has ZERO runtime dependencies beyond sibling contracts.
|
|
4
|
+
* CLEO owns the goal protocol and CLEO Goal is the goal runtime (owner
|
|
5
|
+
* decision 2026-10-16, epic T13791, ADR-097 `adr-097-goal-protocol-ocg-runtime`). The
|
|
6
|
+
* protocol's portable shapes (goal/v1 contract, task link, outcome) live in
|
|
7
|
+
* `./goal-contract.ts`. This module keeps the DB-persisted per-agent goal
|
|
8
|
+
* record ({@link GoalRecord}) and its status and kind unions. CLEO's own
|
|
9
|
+
* turn-budgeted goal loop (judge, continuation builder, Stop-hook advance) was
|
|
10
|
+
* retired in T13797, with its judge and continuation contracts.
|
|
30
11
|
*
|
|
31
12
|
* @packageDocumentation
|
|
32
13
|
* @module @cleocode/contracts/goal
|
|
33
14
|
*
|
|
34
15
|
* @epic T11290 EP-CLEO-GOAL-SYSTEM
|
|
35
16
|
* @task T11376
|
|
17
|
+
* @task T13797
|
|
36
18
|
* @saga T11283 SG-COGNITIVE-SUBSTRATE
|
|
37
19
|
*/
|
|
38
20
|
/**
|
|
@@ -71,16 +53,6 @@ export type GoalStatus = 'active' | 'paused' | 'satisfied' | 'abandoned' | 'impo
|
|
|
71
53
|
* @public
|
|
72
54
|
*/
|
|
73
55
|
export declare const GOAL_STATUSES: readonly GoalStatus[];
|
|
74
|
-
/**
|
|
75
|
-
* The terminal {@link GoalStatus} values a continuation builder must NOT nudge:
|
|
76
|
-
* a satisfied/abandoned/impossible goal yields no next-turn message.
|
|
77
|
-
*
|
|
78
|
-
* `paused` is intentionally absent — a paused goal CAN be resumed, so the
|
|
79
|
-
* continuation builder still emits a nudge for it (see `buildContinuation`).
|
|
80
|
-
*
|
|
81
|
-
* @public
|
|
82
|
-
*/
|
|
83
|
-
export declare const GOAL_TERMINAL_STATUSES: readonly GoalStatus[];
|
|
84
56
|
/**
|
|
85
57
|
* Discriminant tag for the {@link GoalKind} union.
|
|
86
58
|
*
|
|
@@ -108,7 +80,7 @@ export interface TaskCompletionGoal {
|
|
|
108
80
|
}
|
|
109
81
|
/**
|
|
110
82
|
* A goal with no machine-checkable completion artifact — satisfaction is
|
|
111
|
-
* decided by
|
|
83
|
+
* decided by an LLM judge as a fallback.
|
|
112
84
|
*
|
|
113
85
|
* The fuzzy path NEVER touches the evidence infrastructure; it exists only for
|
|
114
86
|
* intents that cannot be reduced to a task + gates (e.g. "explore the auth
|
|
@@ -188,8 +160,8 @@ export interface GoalRecord {
|
|
|
188
160
|
*/
|
|
189
161
|
readonly pausedReason: string | null;
|
|
190
162
|
/**
|
|
191
|
-
* The most recent judge verdict, persisted
|
|
192
|
-
*
|
|
163
|
+
* The most recent judge verdict, persisted with the record. `null` before
|
|
164
|
+
* the first judge.
|
|
193
165
|
*/
|
|
194
166
|
readonly lastVerdict: GoalJudgeVerdict | null;
|
|
195
167
|
/** ISO-8601 creation timestamp. */
|
|
@@ -227,73 +199,6 @@ export interface GoalJudgeVerdict {
|
|
|
227
199
|
*/
|
|
228
200
|
readonly evidence?: readonly string[];
|
|
229
201
|
}
|
|
230
|
-
/**
|
|
231
|
-
* Injectable LLM-judge interface for {@link FuzzyGoal} evaluation.
|
|
232
|
-
*
|
|
233
|
-
* The goal judge depends on THIS interface, never on a concrete model client,
|
|
234
|
-
* so vitest can pass a deterministic mock and stay fully offline/hermetic — CI
|
|
235
|
-
* must never flake on a live model call. Production wires a real LLM-backed
|
|
236
|
-
* implementation; tests wire a stub that returns a canned verdict.
|
|
237
|
-
*
|
|
238
|
-
* @public
|
|
239
|
-
*/
|
|
240
|
-
export interface GoalJudge {
|
|
241
|
-
/**
|
|
242
|
-
* Judge a fuzzy goal from its record alone (no transcript dependency in the
|
|
243
|
-
* contract — an implementation MAY consult external context, but the
|
|
244
|
-
* interface keeps the judge a pure function of the goal for testability).
|
|
245
|
-
*
|
|
246
|
-
* @param goal - The goal record under evaluation.
|
|
247
|
-
* @returns The verdict (same shape as the evidence path).
|
|
248
|
-
*/
|
|
249
|
-
judge(goal: GoalRecord): Promise<GoalJudgeVerdict>;
|
|
250
|
-
}
|
|
251
|
-
/**
|
|
252
|
-
* A single next-turn continuation message produced by the cache-safe builder.
|
|
253
|
-
*
|
|
254
|
-
* Critically, the role is ALWAYS `'user'`: the goal loop nudges the agent by
|
|
255
|
-
* appending a user-style message, NEVER by mutating the system prompt. A stable
|
|
256
|
-
* system-prompt prefix is what makes prompt-caching effective; rewriting it on
|
|
257
|
-
* every turn would bust the cache. See `buildContinuation` for the full
|
|
258
|
-
* prompt-cache-safety contract.
|
|
259
|
-
*
|
|
260
|
-
* @public
|
|
261
|
-
*/
|
|
262
|
-
export interface GoalContinuation {
|
|
263
|
-
/** Always `'user'` — the nudge is a user message, never a system mutation. */
|
|
264
|
-
readonly role: 'user';
|
|
265
|
-
/** The continuation text: goal intent + outstanding criteria + judge reason. */
|
|
266
|
-
readonly content: string;
|
|
267
|
-
}
|
|
268
|
-
/**
|
|
269
|
-
* Result of advancing a goal one turn through the turn-budgeted loop.
|
|
270
|
-
*
|
|
271
|
-
* @public
|
|
272
|
-
*/
|
|
273
|
-
export interface GoalAdvanceResult {
|
|
274
|
-
/** The verdict the judge returned this turn. */
|
|
275
|
-
readonly verdict: GoalJudgeVerdict;
|
|
276
|
-
/** The status the goal transitions to after this turn. */
|
|
277
|
-
readonly nextStatus: GoalStatus;
|
|
278
|
-
/** Turns left after this one. Never negative. */
|
|
279
|
-
readonly turnsRemaining: number;
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* Type guard: is this a {@link TaskCompletionGoal} (evidence-judged)?
|
|
283
|
-
*
|
|
284
|
-
* @param kind - A {@link GoalKind} discriminated union value.
|
|
285
|
-
* @returns `true` when the goal is judged via task status + evidence atoms.
|
|
286
|
-
* @public
|
|
287
|
-
*/
|
|
288
|
-
export declare function isTaskCompletionGoal(kind: GoalKind): kind is TaskCompletionGoal;
|
|
289
|
-
/**
|
|
290
|
-
* Type guard: is this a {@link FuzzyGoal} (LLM-judged fallback)?
|
|
291
|
-
*
|
|
292
|
-
* @param kind - A {@link GoalKind} discriminated union value.
|
|
293
|
-
* @returns `true` when the goal is judged by the injectable LLM judge.
|
|
294
|
-
* @public
|
|
295
|
-
*/
|
|
296
|
-
export declare function isFuzzyGoal(kind: GoalKind): kind is FuzzyGoal;
|
|
297
202
|
/**
|
|
298
203
|
* Test whether a string is a valid goal target task id (`T` + 1–7 digits).
|
|
299
204
|
*
|
|
@@ -302,13 +207,4 @@ export declare function isFuzzyGoal(kind: GoalKind): kind is FuzzyGoal;
|
|
|
302
207
|
* @public
|
|
303
208
|
*/
|
|
304
209
|
export declare function isValidGoalTargetTaskId(value: string): boolean;
|
|
305
|
-
/**
|
|
306
|
-
* Test whether a {@link GoalStatus} is terminal (no further turns / nudges that
|
|
307
|
-
* advance work). A terminal status yields NO continuation.
|
|
308
|
-
*
|
|
309
|
-
* @param status - A goal status.
|
|
310
|
-
* @returns `true` for `satisfied` / `abandoned` / `impossible`.
|
|
311
|
-
* @public
|
|
312
|
-
*/
|
|
313
|
-
export declare function isTerminalGoalStatus(status: GoalStatus): boolean;
|
|
314
210
|
//# sourceMappingURL=goal.d.ts.map
|
package/dist/goal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"goal.d.ts","sourceRoot":"","sources":["../src/goal.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"goal.d.ts","sourceRoot":"","sources":["../src/goal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,QAAkB,CAAC;AAEzD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,GAAG,WAAW,GAAG,YAAY,CAAC;AAExF;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,EAAE,SAAS,UAAU,EAM7C,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,iBAAiB,GAAG,OAAO,CAAC;AAEtD;;;;;;;;GAQG;AACH,MAAM,WAAW,kBAAkB;IACjC,uEAAuE;IACvE,QAAQ,CAAC,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