@sublang/slc 0.5.0 → 0.6.0
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 +4 -4
- package/dist/app.d.ts +20 -20
- package/dist/app.js +29 -29
- package/dist/app.js.map +1 -1
- package/dist/artifacts.d.ts +6 -6
- package/dist/artifacts.d.ts.map +1 -1
- package/dist/artifacts.js +9 -9
- package/dist/artifacts.js.map +1 -1
- package/dist/cli.js +3 -3
- package/dist/cligent-agent.d.ts +1 -1
- package/dist/cligent-agent.js +5 -5
- package/dist/compiled-executor.d.ts +14 -6
- package/dist/compiled-executor.d.ts.map +1 -1
- package/dist/compiled-executor.js +133 -31
- package/dist/compiled-executor.js.map +1 -1
- package/dist/config-file.d.ts +6 -6
- package/dist/config-file.js +5 -5
- package/dist/config.d.ts +17 -15
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +26 -16
- package/dist/config.js.map +1 -1
- package/dist/emitted-imports.d.ts +14 -0
- package/dist/emitted-imports.d.ts.map +1 -1
- package/dist/emitted-imports.js +63 -7
- package/dist/emitted-imports.js.map +1 -1
- package/dist/entry-module.d.ts +5 -3
- package/dist/entry-module.d.ts.map +1 -1
- package/dist/entry-module.js +41 -13
- package/dist/entry-module.js.map +1 -1
- package/dist/execution.d.ts +10 -10
- package/dist/execution.d.ts.map +1 -1
- package/dist/execution.js +13 -13
- package/dist/execution.js.map +1 -1
- package/dist/hash.js +2 -2
- package/dist/host-capabilities.d.ts +115 -0
- package/dist/host-capabilities.d.ts.map +1 -0
- package/dist/host-capabilities.js +507 -0
- package/dist/host-capabilities.js.map +1 -0
- package/dist/interpreter.d.ts +2 -2
- package/dist/interpreter.d.ts.map +1 -1
- package/dist/interpreter.js +7 -7
- package/dist/invocation.d.ts +6 -6
- package/dist/invocation.d.ts.map +1 -1
- package/dist/invocation.js +1 -1
- package/dist/link.d.ts +4 -4
- package/dist/link.d.ts.map +1 -1
- package/dist/link.js +11 -11
- package/dist/link.js.map +1 -1
- package/dist/phase-runner.d.ts +4 -4
- package/dist/phase-runner.js +9 -9
- package/dist/phase.d.ts +4 -4
- package/dist/phase.d.ts.map +1 -1
- package/dist/phase.js +7 -7
- package/dist/phase.js.map +1 -1
- package/dist/pin-closure.d.ts +35 -7
- package/dist/pin-closure.d.ts.map +1 -1
- package/dist/pin-closure.js +135 -21
- package/dist/pin-closure.js.map +1 -1
- package/dist/pin-currency.d.ts +9 -4
- package/dist/pin-currency.d.ts.map +1 -1
- package/dist/pin-currency.js +57 -20
- package/dist/pin-currency.js.map +1 -1
- package/dist/pin-generate.d.ts +7 -7
- package/dist/pin-generate.d.ts.map +1 -1
- package/dist/pin-generate.js +14 -8
- package/dist/pin-generate.js.map +1 -1
- package/dist/pin-inputs.d.ts +41 -0
- package/dist/pin-inputs.d.ts.map +1 -0
- package/dist/pin-inputs.js +179 -0
- package/dist/pin-inputs.js.map +1 -0
- package/dist/pin-paths.d.ts +1 -1
- package/dist/pin-paths.js +4 -4
- package/dist/pin-paths.js.map +1 -1
- package/dist/pins.d.ts +4 -4
- package/dist/pins.d.ts.map +1 -1
- package/dist/pins.js +5 -5
- package/dist/pins.js.map +1 -1
- package/dist/pipeline.d.ts +5 -5
- package/dist/pipeline.js +10 -10
- package/dist/playbook-contract.d.ts +53 -5
- package/dist/playbook-contract.d.ts.map +1 -1
- package/dist/playbook-contract.js +70 -21
- package/dist/playbook-contract.js.map +1 -1
- package/dist/playbook-ports.d.ts +9 -9
- package/dist/playbook-ports.d.ts.map +1 -1
- package/dist/playbook-ports.js +3 -3
- package/dist/playbook-ports.js.map +1 -1
- package/dist/progress.d.ts +8 -9
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +3 -3
- package/dist/progress.js.map +1 -1
- package/dist/resolver.d.ts +9 -9
- package/dist/resolver.d.ts.map +1 -1
- package/dist/resolver.js +12 -12
- package/dist/resolver.js.map +1 -1
- package/dist/runner.d.ts +1 -1
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +195 -80
- package/dist/runner.js.map +1 -1
- package/dist/verify-coverage.d.ts +4 -3
- package/dist/verify-coverage.d.ts.map +1 -1
- package/dist/verify-coverage.js +509 -71
- package/dist/verify-coverage.js.map +1 -1
- package/dist/verify.d.ts +111 -15
- package/dist/verify.d.ts.map +1 -1
- package/dist/verify.js +656 -59
- package/dist/verify.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,507 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// SPDX-FileCopyrightText: 2026 SubLang International <https://sublang.ai>
|
|
3
|
+
/**
|
|
4
|
+
* Host capabilities for driving a schema-3 compiled `playbook` artifact
|
|
5
|
+
* (DR-024).
|
|
6
|
+
*
|
|
7
|
+
* A schema-3 linked factory takes configured options plus live host
|
|
8
|
+
* capabilities, and Playbook publishes the `XStateRepositoryCapability` and
|
|
9
|
+
* effect-ledger *interfaces* without shipping an implementation — its own lives
|
|
10
|
+
* inside `playbook run`. Any other host embedding a compiled artifact therefore
|
|
11
|
+
* has to supply one, so SLC owns a real implementation here rather than leaving
|
|
12
|
+
* each caller to hand-roll the engine contract. The classification and
|
|
13
|
+
* observation rules mirror the engine's reference implementation
|
|
14
|
+
* (`reference/sdlc/code.playbook/bin/repository-effects.js`), reduced to the
|
|
15
|
+
* single-worktree shape this host needs.
|
|
16
|
+
*
|
|
17
|
+
* {@link failClosedHostCapabilities} rejects every repository or effect write:
|
|
18
|
+
* correct wherever the artifact declares no governed player state.
|
|
19
|
+
* {@link worktreeHostCapabilities} runs governed operations against a real
|
|
20
|
+
* worktree, which is what an artifact carrying governed player states needs.
|
|
21
|
+
*
|
|
22
|
+
* Deliberate scope limit: `runDeferred` supports `park` and `restore` for a
|
|
23
|
+
* bound Boss question, but not `continue` — cross-turn continuation of a
|
|
24
|
+
* deferred operation (DR-005) is not implemented by this demo host. A
|
|
25
|
+
* declared-`deferred` arm binds and parks cleanly; answering the parked
|
|
26
|
+
* question in a later turn fails with an explicit unsupported-operation error.
|
|
27
|
+
*/
|
|
28
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
29
|
+
import { isDeepStrictEqual } from 'node:util';
|
|
30
|
+
const REPOSITORY_UNSUPPORTED = 'compiled composed-v3 phase host does not support repository operations';
|
|
31
|
+
const EFFECT_UNSUPPORTED = 'compiled composed-v3 phase host does not support effect-ledger writes';
|
|
32
|
+
/** The null Git OID, reported before a repository has its first commit. */
|
|
33
|
+
export const NULL_GIT_OID = '0'.repeat(40);
|
|
34
|
+
function sha256Hex(text) {
|
|
35
|
+
return createHash('sha256').update(text).digest('hex');
|
|
36
|
+
}
|
|
37
|
+
function projectionText(projection) {
|
|
38
|
+
return JSON.stringify(projection);
|
|
39
|
+
}
|
|
40
|
+
function projectionsEqual(left, right) {
|
|
41
|
+
return (left.projectionDigest === right.projectionDigest &&
|
|
42
|
+
projectionText(left.projection) === projectionText(right.projection));
|
|
43
|
+
}
|
|
44
|
+
function projectionPreservesBaseline(baseline, after) {
|
|
45
|
+
return Object.entries(baseline).every(([path, entry]) => Object.prototype.hasOwnProperty.call(after, path) &&
|
|
46
|
+
JSON.stringify(after[path]) === JSON.stringify(entry));
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Builds a repository observation whose digest matches the engine's rule
|
|
50
|
+
* exactly: `sha256:` over `JSON.stringify(projection)`. Callers supply the
|
|
51
|
+
* worktree paths, HEAD, and the dirty-state projection; a repository with no
|
|
52
|
+
* commit yet reports the null OID, which is what the engine's canonical-OID
|
|
53
|
+
* check expects. The projection is required: an empty projection asserts a
|
|
54
|
+
* clean worktree, so it must come from a real status observation such as
|
|
55
|
+
* {@link observeGitWorktree}, never from a default.
|
|
56
|
+
*/
|
|
57
|
+
export function observeWorktree(opts) {
|
|
58
|
+
return {
|
|
59
|
+
worktree: opts.worktree,
|
|
60
|
+
gitDir: opts.gitDir,
|
|
61
|
+
head: opts.head,
|
|
62
|
+
projection: opts.projection,
|
|
63
|
+
projectionDigest: `sha256:${sha256Hex(projectionText(opts.projection))}`,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Observes one Git worktree: HEAD plus a path-keyed projection of every
|
|
68
|
+
* dirty or untracked entry, derived from `git status --porcelain` with
|
|
69
|
+
* content identities so a change is visible even when the status code alone
|
|
70
|
+
* would not move. Mirrors the reference host's status-derived projection in
|
|
71
|
+
* reduced form: one sample, index identities from `ls-files -s`, worktree
|
|
72
|
+
* identities from `hash-object`.
|
|
73
|
+
*/
|
|
74
|
+
export function observeGitWorktree(opts) {
|
|
75
|
+
let head = NULL_GIT_OID;
|
|
76
|
+
try {
|
|
77
|
+
head = opts.run(['rev-parse', '--verify', 'HEAD^{commit}']).trim();
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
// No commit yet (or unborn branch): the null OID is the canonical report.
|
|
81
|
+
}
|
|
82
|
+
const status = opts.run([
|
|
83
|
+
'status',
|
|
84
|
+
'--porcelain',
|
|
85
|
+
'-z',
|
|
86
|
+
'--untracked-files=all',
|
|
87
|
+
'--no-renames',
|
|
88
|
+
]);
|
|
89
|
+
const records = [];
|
|
90
|
+
for (const record of status.split('\0')) {
|
|
91
|
+
if (record.length === 0)
|
|
92
|
+
continue;
|
|
93
|
+
if (record.length < 4 || record[2] !== ' ') {
|
|
94
|
+
throw new Error(`git status returned an unrecognized record: ${JSON.stringify(record)}`);
|
|
95
|
+
}
|
|
96
|
+
records.push({ xy: record.slice(0, 2), path: record.slice(3) });
|
|
97
|
+
}
|
|
98
|
+
records.sort((left, right) => left.path < right.path ? -1 : left.path > right.path ? 1 : 0);
|
|
99
|
+
// Staged content identity for every tracked path in the status set.
|
|
100
|
+
const indexOids = new Map();
|
|
101
|
+
if (records.some(({ xy }) => xy !== '??')) {
|
|
102
|
+
for (const record of opts.run(['ls-files', '-s', '-z']).split('\0')) {
|
|
103
|
+
if (record.length === 0)
|
|
104
|
+
continue;
|
|
105
|
+
const tab = record.indexOf('\t');
|
|
106
|
+
const fields = record.slice(0, tab).split(' ');
|
|
107
|
+
if (tab < 0 || fields.length !== 3) {
|
|
108
|
+
throw new Error(`git ls-files returned an unrecognized record: ${JSON.stringify(record)}`);
|
|
109
|
+
}
|
|
110
|
+
indexOids.set(record.slice(tab + 1), `${fields[0]}:${fields[1]}`);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
// Worktree content identity for every entry whose worktree side differs
|
|
114
|
+
// from the index (or is untracked); a worktree-deleted side needs none —
|
|
115
|
+
// its absence is the identity.
|
|
116
|
+
const hashPaths = records
|
|
117
|
+
.filter(({ xy }) => xy[1] !== ' ' && xy[1] !== 'D')
|
|
118
|
+
.map(({ path }) => path);
|
|
119
|
+
const worktreeOids = new Map();
|
|
120
|
+
if (hashPaths.length > 0) {
|
|
121
|
+
const hashes = opts
|
|
122
|
+
.run(['hash-object', '--', ...hashPaths])
|
|
123
|
+
.split('\n')
|
|
124
|
+
.filter((line) => line.length > 0);
|
|
125
|
+
if (hashes.length !== hashPaths.length) {
|
|
126
|
+
throw new Error('git hash-object did not identify every dirty path');
|
|
127
|
+
}
|
|
128
|
+
hashPaths.forEach((path, index) => {
|
|
129
|
+
worktreeOids.set(path, hashes[index]);
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
const projection = {};
|
|
133
|
+
for (const { xy, path } of records) {
|
|
134
|
+
if (path.length === 0) {
|
|
135
|
+
throw new Error('git status returned an empty repository path');
|
|
136
|
+
}
|
|
137
|
+
if (Object.prototype.hasOwnProperty.call(projection, path)) {
|
|
138
|
+
throw new Error(`git status returned duplicate entries for ${JSON.stringify(path)}`);
|
|
139
|
+
}
|
|
140
|
+
const index = indexOids.get(path);
|
|
141
|
+
const worktree = worktreeOids.get(path);
|
|
142
|
+
projection[path] = {
|
|
143
|
+
xy,
|
|
144
|
+
...(index === undefined ? {} : { index }),
|
|
145
|
+
...(worktree === undefined ? {} : { worktree }),
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
return observeWorktree({
|
|
149
|
+
worktree: opts.worktree,
|
|
150
|
+
gitDir: opts.gitDir,
|
|
151
|
+
head,
|
|
152
|
+
projection,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
function commandExitCode(error) {
|
|
156
|
+
if (typeof error !== 'object' || error === null)
|
|
157
|
+
return undefined;
|
|
158
|
+
const status = error.status;
|
|
159
|
+
if (typeof status === 'number')
|
|
160
|
+
return status;
|
|
161
|
+
const code = error.code;
|
|
162
|
+
return typeof code === 'number' ? code : undefined;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Classifies what one governed operation did to a repository, which is the
|
|
166
|
+
* judgement the engine matches against the state's declared
|
|
167
|
+
* `repositoryDisposition`. Mirrors the engine reference's
|
|
168
|
+
* `classifyRepositoryReceipt` decision order: an identical observation is
|
|
169
|
+
* `unchanged`; any change under all-`unchanged` dispositions is
|
|
170
|
+
* `concurrent-or-foreign-change`; a same-HEAD change is `worktree-only-change`
|
|
171
|
+
* only when it preserves every baseline entry and a commit arm is declared;
|
|
172
|
+
* a moved HEAD is one descendant commit only when ancestry proves exactly one
|
|
173
|
+
* new commit and the dirty projection is preserved; everything the observation
|
|
174
|
+
* cannot prove is `observation-ambiguous`.
|
|
175
|
+
*/
|
|
176
|
+
export function classifyGitChange(opts) {
|
|
177
|
+
const { baseline, after } = opts;
|
|
178
|
+
const sameHead = baseline.head === after.head;
|
|
179
|
+
const sameProjection = projectionsEqual(baseline, after);
|
|
180
|
+
if (sameHead && sameProjection)
|
|
181
|
+
return 'unchanged';
|
|
182
|
+
const allowed = opts.dispositions ?? ['unchanged', 'one-descendant-commit'];
|
|
183
|
+
if (allowed.length > 0 && allowed.every((value) => value === 'unchanged')) {
|
|
184
|
+
return 'concurrent-or-foreign-change';
|
|
185
|
+
}
|
|
186
|
+
if (sameHead) {
|
|
187
|
+
if (!projectionPreservesBaseline(baseline.projection, after.projection)) {
|
|
188
|
+
return 'observation-ambiguous';
|
|
189
|
+
}
|
|
190
|
+
return allowed.includes('one-descendant-commit')
|
|
191
|
+
? 'worktree-only-change'
|
|
192
|
+
: 'observation-ambiguous';
|
|
193
|
+
}
|
|
194
|
+
if (after.head === NULL_GIT_OID)
|
|
195
|
+
return 'rewritten-or-non-descendant';
|
|
196
|
+
if (baseline.head !== NULL_GIT_OID) {
|
|
197
|
+
try {
|
|
198
|
+
opts.run(['merge-base', '--is-ancestor', baseline.head, after.head]);
|
|
199
|
+
}
|
|
200
|
+
catch (error) {
|
|
201
|
+
// Exit code 1 is Git's definitive "not an ancestor"; any other failure
|
|
202
|
+
// proves nothing about ancestry and stays ambiguous.
|
|
203
|
+
return commandExitCode(error) === 1
|
|
204
|
+
? 'rewritten-or-non-descendant'
|
|
205
|
+
: 'observation-ambiguous';
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
const range = baseline.head === NULL_GIT_OID
|
|
209
|
+
? after.head
|
|
210
|
+
: `${baseline.head}..${after.head}`;
|
|
211
|
+
let count;
|
|
212
|
+
try {
|
|
213
|
+
count = Number.parseInt(opts.run(['rev-list', '--count', range]).trim(), 10);
|
|
214
|
+
}
|
|
215
|
+
catch {
|
|
216
|
+
return 'observation-ambiguous';
|
|
217
|
+
}
|
|
218
|
+
if (!Number.isSafeInteger(count) || count < 0)
|
|
219
|
+
return 'observation-ambiguous';
|
|
220
|
+
if (count > 1)
|
|
221
|
+
return 'multiple-commits';
|
|
222
|
+
if (count !== 1)
|
|
223
|
+
return 'rewritten-or-non-descendant';
|
|
224
|
+
if (!sameProjection)
|
|
225
|
+
return 'observation-ambiguous';
|
|
226
|
+
return 'one-descendant-commit';
|
|
227
|
+
}
|
|
228
|
+
/** An empty ledger: revision zero exactly when both ordered ledgers are empty. */
|
|
229
|
+
export function emptyEffectLedger() {
|
|
230
|
+
return {
|
|
231
|
+
schemaVersion: 1,
|
|
232
|
+
revision: 0,
|
|
233
|
+
boundaries: [],
|
|
234
|
+
logicalOperations: [],
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Capabilities whose repository and effect-mutation seams reject. Correct
|
|
239
|
+
* wherever the artifact declares no governed player state (DR-024).
|
|
240
|
+
*/
|
|
241
|
+
export function failClosedHostCapabilities() {
|
|
242
|
+
const rejectRepository = () => Promise.reject(new Error(REPOSITORY_UNSUPPORTED));
|
|
243
|
+
const rejectEffectWrite = () => Promise.reject(new Error(EFFECT_UNSUPPORTED));
|
|
244
|
+
return {
|
|
245
|
+
repository: {
|
|
246
|
+
runExclusive: rejectRepository,
|
|
247
|
+
runDeferred: rejectRepository,
|
|
248
|
+
},
|
|
249
|
+
effectLedger: {
|
|
250
|
+
snapshot: emptyEffectLedger,
|
|
251
|
+
writeAhead: rejectEffectWrite,
|
|
252
|
+
},
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Capabilities that run governed operations against a real worktree, observing
|
|
257
|
+
* it before and after so the engine receives a classified receipt. The engine
|
|
258
|
+
* owns each boundary's identity — it re-checks the source state and outcome
|
|
259
|
+
* schema on completion — so the seed it supplies is completed, never replaced.
|
|
260
|
+
*
|
|
261
|
+
* The boundary is recorded in the ledger when the operation starts, before the
|
|
262
|
+
* completion callback runs, so the engine's semantic correction budget can
|
|
263
|
+
* find and spend it through `writeAhead` mid-completion (DR-025, DR-028); the
|
|
264
|
+
* settlement then replaces the started record with the receipt and exactly the
|
|
265
|
+
* evidence the completion callback returned. A completion carrying a deferred
|
|
266
|
+
* Boss-question binding appends the reciprocal logical operation and settles
|
|
267
|
+
* `deferredStatus: 'bound'` (DR-005, DR-040).
|
|
268
|
+
*/
|
|
269
|
+
export function worktreeHostCapabilities(opts) {
|
|
270
|
+
const boundaries = [];
|
|
271
|
+
const logicalOperations = [];
|
|
272
|
+
let revision = 0;
|
|
273
|
+
// The engine holds one active governed attempt id per runtime boundary and
|
|
274
|
+
// rejects a second, so the host mints one identity and reuses it; a distinct
|
|
275
|
+
// attempt would come from a retry this capability does not perform.
|
|
276
|
+
const attemptId = randomUUID();
|
|
277
|
+
// One governed operation owns the worktree at a time: `runExclusive` and
|
|
278
|
+
// `runDeferred` calls are chained, and the boundary sequence is assigned
|
|
279
|
+
// under the same chain so concurrent callers cannot collide.
|
|
280
|
+
let tail = Promise.resolve();
|
|
281
|
+
const exclusive = (task) => {
|
|
282
|
+
const settled = tail.then(task, task);
|
|
283
|
+
tail = settled.then(() => undefined, () => undefined);
|
|
284
|
+
return settled;
|
|
285
|
+
};
|
|
286
|
+
const snapshot = () => ({
|
|
287
|
+
schemaVersion: 1,
|
|
288
|
+
revision,
|
|
289
|
+
boundaries: [...boundaries],
|
|
290
|
+
logicalOperations: [...logicalOperations],
|
|
291
|
+
});
|
|
292
|
+
const boundaryIndexById = (boundaryId) => {
|
|
293
|
+
const index = boundaries.findIndex((candidate) => candidate.boundaryId === boundaryId);
|
|
294
|
+
if (index < 0) {
|
|
295
|
+
throw new Error(`effect boundary ${boundaryId} is not in the ledger`);
|
|
296
|
+
}
|
|
297
|
+
return index;
|
|
298
|
+
};
|
|
299
|
+
const operationIndexById = (operationId) => {
|
|
300
|
+
const index = logicalOperations.findIndex((candidate) => candidate.operationId === operationId);
|
|
301
|
+
if (index < 0) {
|
|
302
|
+
throw new Error(`deferred logical operation ${operationId} is not in the ledger`);
|
|
303
|
+
}
|
|
304
|
+
return index;
|
|
305
|
+
};
|
|
306
|
+
const classify = (baseline, after, dispositions) => opts.classify
|
|
307
|
+
? opts.classify(baseline, after, { dispositions })
|
|
308
|
+
: projectionsEqual(baseline, after) && baseline.head === after.head
|
|
309
|
+
? 'unchanged'
|
|
310
|
+
: 'observation-ambiguous';
|
|
311
|
+
return {
|
|
312
|
+
repository: {
|
|
313
|
+
runExclusive(options) {
|
|
314
|
+
return exclusive(async () => {
|
|
315
|
+
options.signal?.throwIfAborted();
|
|
316
|
+
const seed = options.effectBoundary;
|
|
317
|
+
const baseline = opts.observe();
|
|
318
|
+
// `PlaybookEffectBoundaryStart` omits every host-owned member, so
|
|
319
|
+
// the host supplies ordering and attempt identity while everything
|
|
320
|
+
// identifying the work comes from the engine's seed. Recording the
|
|
321
|
+
// started boundary now lets the engine's correction budget find it.
|
|
322
|
+
const started = {
|
|
323
|
+
...seed,
|
|
324
|
+
sequence: boundaries.length + 1,
|
|
325
|
+
attemptId,
|
|
326
|
+
attemptNumber: 1,
|
|
327
|
+
playbookId: opts.playbookId,
|
|
328
|
+
canonicalWorktree: {
|
|
329
|
+
worktree: baseline.worktree,
|
|
330
|
+
gitDir: baseline.gitDir,
|
|
331
|
+
},
|
|
332
|
+
baseline,
|
|
333
|
+
};
|
|
334
|
+
boundaries.push(started);
|
|
335
|
+
revision += 1;
|
|
336
|
+
let operation;
|
|
337
|
+
try {
|
|
338
|
+
operation = {
|
|
339
|
+
status: 'fulfilled',
|
|
340
|
+
value: await options.operation({ baseline, identity: {} }),
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
catch (reason) {
|
|
344
|
+
operation = { status: 'rejected', reason };
|
|
345
|
+
}
|
|
346
|
+
let receipt;
|
|
347
|
+
try {
|
|
348
|
+
const after = opts.observe();
|
|
349
|
+
const classification = classify(baseline, after, seed.dispositions);
|
|
350
|
+
receipt = {
|
|
351
|
+
classification,
|
|
352
|
+
baseline,
|
|
353
|
+
after,
|
|
354
|
+
...(classification === 'one-descendant-commit'
|
|
355
|
+
? { commitOid: after.head }
|
|
356
|
+
: {}),
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
catch {
|
|
360
|
+
// An after-observation that cannot be taken proves nothing; the
|
|
361
|
+
// engine accepts `observation-ambiguous` with no after.
|
|
362
|
+
receipt = { classification: 'observation-ambiguous', baseline };
|
|
363
|
+
}
|
|
364
|
+
const evidence = ((await options.completeEffectBoundary({
|
|
365
|
+
boundary: started,
|
|
366
|
+
operation,
|
|
367
|
+
receipt,
|
|
368
|
+
outcomeReceipt: receipt,
|
|
369
|
+
})) ?? {});
|
|
370
|
+
// The engine re-checks that the settled boundary carries exactly the
|
|
371
|
+
// evidence its completion callback returned, so that evidence is
|
|
372
|
+
// acknowledged verbatim — present keys copied, absent keys removed —
|
|
373
|
+
// over whatever the completion (e.g., a spent correction budget)
|
|
374
|
+
// left in the ledger.
|
|
375
|
+
const index = boundaryIndexById(started.boundaryId);
|
|
376
|
+
const retained = { ...boundaries[index] };
|
|
377
|
+
delete retained.finalText;
|
|
378
|
+
delete retained.semanticCandidate;
|
|
379
|
+
let settled = {
|
|
380
|
+
...retained,
|
|
381
|
+
...(receipt.after === undefined ? {} : { after: receipt.after }),
|
|
382
|
+
physicalReceipt: receipt,
|
|
383
|
+
...(Object.prototype.hasOwnProperty.call(evidence, 'finalText')
|
|
384
|
+
? { finalText: evidence.finalText }
|
|
385
|
+
: {}),
|
|
386
|
+
...(Object.prototype.hasOwnProperty.call(evidence, 'semanticCandidate')
|
|
387
|
+
? { semanticCandidate: evidence.semanticCandidate }
|
|
388
|
+
: {}),
|
|
389
|
+
};
|
|
390
|
+
let deferredStatus;
|
|
391
|
+
if (evidence.deferred !== undefined) {
|
|
392
|
+
const binding = evidence.deferred;
|
|
393
|
+
if (receipt.after === undefined) {
|
|
394
|
+
// Without a checkpoint observation the question cannot bind;
|
|
395
|
+
// append the operation without binding evidence so the engine
|
|
396
|
+
// sees it as structurally unresolved.
|
|
397
|
+
logicalOperations.push({
|
|
398
|
+
sequence: logicalOperations.length + 1,
|
|
399
|
+
operationId: binding.operationId,
|
|
400
|
+
playbookId: opts.playbookId,
|
|
401
|
+
runtimeSessionId: started.runtimeSessionId,
|
|
402
|
+
boundaryIds: [started.boundaryId],
|
|
403
|
+
originalBaseline: baseline,
|
|
404
|
+
checkpointRestorationEligible: false,
|
|
405
|
+
});
|
|
406
|
+
deferredStatus = 'unresolved';
|
|
407
|
+
}
|
|
408
|
+
else {
|
|
409
|
+
const question = binding.pendingQuestion;
|
|
410
|
+
logicalOperations.push({
|
|
411
|
+
sequence: logicalOperations.length + 1,
|
|
412
|
+
operationId: binding.operationId,
|
|
413
|
+
playbookId: opts.playbookId,
|
|
414
|
+
runtimeSessionId: started.runtimeSessionId,
|
|
415
|
+
boundaryIds: [started.boundaryId],
|
|
416
|
+
originalBaseline: baseline,
|
|
417
|
+
checkpoint: receipt.after,
|
|
418
|
+
pendingQuestion: {
|
|
419
|
+
questionId: question.questionId,
|
|
420
|
+
asker: question.asker,
|
|
421
|
+
question: question.question,
|
|
422
|
+
...(typeof question.sourceItem === 'string'
|
|
423
|
+
? { sourceItem: question.sourceItem }
|
|
424
|
+
: {}),
|
|
425
|
+
},
|
|
426
|
+
playerContinuation: binding.playerContinuation,
|
|
427
|
+
checkpointRestorationEligible: false,
|
|
428
|
+
});
|
|
429
|
+
deferredStatus = 'bound';
|
|
430
|
+
}
|
|
431
|
+
settled = { ...settled, logicalOperationId: binding.operationId };
|
|
432
|
+
}
|
|
433
|
+
boundaries[index] = settled;
|
|
434
|
+
revision += 1;
|
|
435
|
+
return {
|
|
436
|
+
operation,
|
|
437
|
+
receipt,
|
|
438
|
+
effectLedger: snapshot(),
|
|
439
|
+
...(deferredStatus === undefined ? {} : { deferredStatus }),
|
|
440
|
+
};
|
|
441
|
+
});
|
|
442
|
+
},
|
|
443
|
+
runDeferred(options) {
|
|
444
|
+
return exclusive(async () => {
|
|
445
|
+
if (options.mode === 'park') {
|
|
446
|
+
const index = operationIndexById(options.operationId);
|
|
447
|
+
logicalOperations[index] = {
|
|
448
|
+
...logicalOperations[index],
|
|
449
|
+
checkpointRestorationEligible: true,
|
|
450
|
+
};
|
|
451
|
+
revision += 1;
|
|
452
|
+
return { status: 'parked', effectLedger: snapshot() };
|
|
453
|
+
}
|
|
454
|
+
if (options.mode === 'restore') {
|
|
455
|
+
const index = operationIndexById(options.operationId);
|
|
456
|
+
const operation = logicalOperations[index];
|
|
457
|
+
const checkpoint = operation.checkpoint;
|
|
458
|
+
if (checkpoint === undefined ||
|
|
459
|
+
!operation.checkpointRestorationEligible) {
|
|
460
|
+
return { status: 'ineligible', effectLedger: snapshot() };
|
|
461
|
+
}
|
|
462
|
+
const current = opts.observe();
|
|
463
|
+
if (current.head !== checkpoint.head ||
|
|
464
|
+
!projectionsEqual(current, checkpoint)) {
|
|
465
|
+
return {
|
|
466
|
+
status: 'checkpoint-mismatch',
|
|
467
|
+
effectLedger: snapshot(),
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
logicalOperations[index] = {
|
|
471
|
+
...operation,
|
|
472
|
+
checkpointRestorationEligible: false,
|
|
473
|
+
};
|
|
474
|
+
revision += 1;
|
|
475
|
+
return { status: 'restored', effectLedger: snapshot() };
|
|
476
|
+
}
|
|
477
|
+
throw new Error('worktree host capabilities do not continue a deferred operation');
|
|
478
|
+
});
|
|
479
|
+
},
|
|
480
|
+
},
|
|
481
|
+
effectLedger: {
|
|
482
|
+
snapshot,
|
|
483
|
+
// The engine's only write-ahead command against a live host capability
|
|
484
|
+
// is the correction-budget boundary replacement (DR-025); it arrives
|
|
485
|
+
// mid-completion, inside the exclusive chain, so it must apply directly.
|
|
486
|
+
writeAhead: async (commands) => {
|
|
487
|
+
for (const command of commands) {
|
|
488
|
+
const { kind } = command;
|
|
489
|
+
if (kind !== 'replace-boundaries') {
|
|
490
|
+
throw new Error(`worktree host capabilities do not support effect-ledger command ${String(kind)}`);
|
|
491
|
+
}
|
|
492
|
+
const { replacements } = command;
|
|
493
|
+
for (const { expected, next } of replacements) {
|
|
494
|
+
const index = boundaries.findIndex((candidate) => isDeepStrictEqual(candidate, expected));
|
|
495
|
+
if (index < 0) {
|
|
496
|
+
throw new Error('effect-ledger replacement expected a boundary that is not in the ledger');
|
|
497
|
+
}
|
|
498
|
+
boundaries[index] = next;
|
|
499
|
+
revision += 1;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
return snapshot();
|
|
503
|
+
},
|
|
504
|
+
},
|
|
505
|
+
};
|
|
506
|
+
}
|
|
507
|
+
//# sourceMappingURL=host-capabilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,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AAU,CAAC,KAAK,CAAC,GAAG,IAAsB,CAAC;wBAC3C,QAAQ,IAAI,CAAC,CAAC;oBAChB,CAAC;gBACH,CAAC;gBACD,OAAO,QAAQ,EAAE,CAAC;YACpB,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
package/dist/interpreter.d.ts
CHANGED
|
@@ -23,14 +23,14 @@ export interface AgentRunResult {
|
|
|
23
23
|
export interface AgentClient {
|
|
24
24
|
run(request: AgentRunRequest): Promise<AgentRunResult>;
|
|
25
25
|
}
|
|
26
|
-
/** Agent/model selection, applied as configuration not phase semantics (
|
|
26
|
+
/** Agent/model selection, applied as configuration not phase semantics (phase-execution-13). */
|
|
27
27
|
export interface InterpreterConfig {
|
|
28
28
|
model?: string;
|
|
29
29
|
cwd?: string;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
32
|
* Builds the agent-contract prompt for a phase from its definition and inputs
|
|
33
|
-
* (
|
|
33
|
+
* (phase-execution-11, phase-execution-14, phase-execution-15).
|
|
34
34
|
*/
|
|
35
35
|
export declare function buildPhasePrompt(opts: {
|
|
36
36
|
request: ExecuteRequest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interpreter.d.ts","sourceRoot":"","sources":["../src/interpreter.ts"],"names":[],"mappings":"AAmBA,OAAO,EAEL,KAAK,cAAc,EAGnB,KAAK,aAAa,EACnB,MAAM,gBAAgB,CAAC;AAExB,sEAAsE;AACtE,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACxB,2EAA2E;IAC3E,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,MAAM,EAAE,WAAW,CAAC;CACrB;AAED,sDAAsD;AACtD,MAAM,WAAW,cAAc;IAC7B,uEAAuE;IACvE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OAAO,EAAE,cAAc,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,MAAM,CAkDT;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE;IAC9C,KAAK,EAAE,WAAW,CAAC;IACnB,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B,GAAG,aAAa,CAoChB"}
|
package/dist/interpreter.js
CHANGED
|
@@ -4,20 +4,20 @@
|
|
|
4
4
|
* Interpreted phase execution (DR-004).
|
|
5
5
|
*
|
|
6
6
|
* `createInterpretedExecutor` implements the {@link PhaseExecutor} boundary by
|
|
7
|
-
* prompting a coding agent once per phase (
|
|
8
|
-
* definition and the phase inputs (
|
|
9
|
-
* (
|
|
10
|
-
* cited content (
|
|
7
|
+
* prompting a coding agent once per phase (phase-execution-12) with the phase or link
|
|
8
|
+
* definition and the phase inputs (phase-execution-11), establishing the agent contract
|
|
9
|
+
* (phase-execution-14) and allowing the agent to run definition-called tools and read
|
|
10
|
+
* cited content (phase-execution-15). The agent is reached through an injected
|
|
11
11
|
* {@link AgentClient}; the Cligent-backed default lives in cligent-agent.ts so
|
|
12
12
|
* this core stays transport-free and testable. Agent and model selection are
|
|
13
|
-
* configuration, not phase semantics (
|
|
14
|
-
* specs/
|
|
13
|
+
* configuration, not phase semantics (phase-execution-13). See
|
|
14
|
+
* specs/packages/phase-execution.md.
|
|
15
15
|
*/
|
|
16
16
|
import { readFile } from 'node:fs/promises';
|
|
17
17
|
import { updateContextLines, } from './execution.js';
|
|
18
18
|
/**
|
|
19
19
|
* Builds the agent-contract prompt for a phase from its definition and inputs
|
|
20
|
-
* (
|
|
20
|
+
* (phase-execution-11, phase-execution-14, phase-execution-15).
|
|
21
21
|
*/
|
|
22
22
|
export function buildPhasePrompt(opts) {
|
|
23
23
|
const { request, definition } = opts;
|
package/dist/invocation.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* CLI parsing and invocation routing (DR-001, DR-002).
|
|
3
3
|
*
|
|
4
|
-
* Implements
|
|
4
|
+
* Implements pipeline-9 (`slc <pipeline>[.<phase>] <source> [-o <target>]`), pipeline-12
|
|
5
5
|
* (`slc <pipeline>.link <object>... <target>` with positional, not extension- or
|
|
6
|
-
* `--`-inferred, roles),
|
|
7
|
-
* for full-pipeline runs), and
|
|
8
|
-
* See specs/
|
|
6
|
+
* `--`-inferred, roles), pipeline-13 (`--link` selects the terminal link phase only
|
|
7
|
+
* for full-pipeline runs), and pipeline-14 (opaque `--link-option name=value` pairs).
|
|
8
|
+
* See specs/packages/pipeline.md.
|
|
9
9
|
*/
|
|
10
|
-
/** An opaque link option passed through to the link phase (
|
|
10
|
+
/** An opaque link option passed through to the link phase (pipeline-14). */
|
|
11
11
|
export interface LinkOption {
|
|
12
12
|
name: string;
|
|
13
13
|
value: string;
|
|
@@ -60,7 +60,7 @@ export declare class CliError extends Error {
|
|
|
60
60
|
* Parses argv (without the node/script prefix) into a routed {@link Invocation}.
|
|
61
61
|
*
|
|
62
62
|
* Options (`-o`, `--link`, `--link-option`, `--rebuild`) may be interspersed with positionals;
|
|
63
|
-
* positional roles are assigned by position alone (
|
|
63
|
+
* positional roles are assigned by position alone (pipeline-12).
|
|
64
64
|
*
|
|
65
65
|
* @throws {CliError} when the grammar is violated.
|
|
66
66
|
*/
|
package/dist/invocation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invocation.d.ts","sourceRoot":"","sources":["../src/invocation.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AAEH,
|
|
1
|
+
{"version":3,"file":"invocation.d.ts","sourceRoot":"","sources":["../src/invocation.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AAEH,4EAA4E;AAC5E,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,sEAAsE;AACtE,MAAM,MAAM,UAAU,GAClB;IACE,I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AAQ,CAAC,IAAI,EAAE,YAAY,CAAC;gBAEhB,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM;CAKhD;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,UAAU,CA2InE"}
|
package/dist/invocation.js
CHANGED
|
@@ -13,7 +13,7 @@ export class CliError extends Error {
|
|
|
13
13
|
* Parses argv (without the node/script prefix) into a routed {@link Invocation}.
|
|
14
14
|
*
|
|
15
15
|
* Options (`-o`, `--link`, `--link-option`, `--rebuild`) may be interspersed with positionals;
|
|
16
|
-
* positional roles are assigned by position alone (
|
|
16
|
+
* positional roles are assigned by position alone (pipeline-12).
|
|
17
17
|
*
|
|
18
18
|
* @throws {CliError} when the grammar is violated.
|
|
19
19
|
*/
|