@sublang/slc 0.6.0 → 0.7.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 +7 -2
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +15 -2
- package/dist/app.js.map +1 -1
- package/dist/cligent-agent.d.ts +8 -1
- package/dist/cligent-agent.d.ts.map +1 -1
- package/dist/cligent-agent.js +2 -1
- package/dist/cligent-agent.js.map +1 -1
- package/dist/compiled-execution.d.ts +44 -0
- package/dist/compiled-execution.d.ts.map +1 -0
- package/dist/compiled-execution.js +184 -0
- package/dist/compiled-execution.js.map +1 -0
- package/dist/compiled-executor.d.ts +9 -7
- package/dist/compiled-executor.d.ts.map +1 -1
- package/dist/compiled-executor.js +82 -37
- package/dist/compiled-executor.js.map +1 -1
- package/dist/config-file.d.ts +3 -0
- package/dist/config-file.d.ts.map +1 -1
- package/dist/config-file.js +22 -4
- package/dist/config-file.js.map +1 -1
- package/dist/config.d.ts +66 -15
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +115 -49
- package/dist/config.js.map +1 -1
- package/dist/phase-runner.d.ts +9 -2
- package/dist/phase-runner.d.ts.map +1 -1
- package/dist/phase-runner.js +3 -1
- package/dist/phase-runner.js.map +1 -1
- package/dist/pin-generate.d.ts.map +1 -1
- package/dist/pin-generate.js +10 -2
- package/dist/pin-generate.js.map +1 -1
- package/dist/playbook-contract.d.ts +18 -22
- package/dist/playbook-contract.d.ts.map +1 -1
- package/dist/playbook-contract.js.map +1 -1
- package/dist/runner.d.ts +1 -1
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +30 -8
- package/dist/runner.js.map +1 -1
- package/dist/runtime-contract.d.ts +17 -0
- package/dist/runtime-contract.d.ts.map +1 -0
- package/dist/runtime-contract.js +114 -0
- package/dist/runtime-contract.js.map +1 -0
- package/dist/slc.config.template.yaml +7 -2
- package/dist/verify.d.ts +44 -2
- package/dist/verify.d.ts.map +1 -1
- package/dist/verify.js +65 -14
- package/dist/verify.js.map +1 -1
- package/package.json +3 -3
- package/dist/host-capabilities.d.ts +0 -115
- package/dist/host-capabilities.d.ts.map +0 -1
- package/dist/host-capabilities.js +0 -507
- package/dist/host-capabilities.js.map +0 -1
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
/** Minimal structural view of the engine-owned boundary seed. */
|
|
2
|
-
export interface EffectBoundarySeed {
|
|
3
|
-
readonly boundaryId: string;
|
|
4
|
-
readonly runtimeSessionId: string;
|
|
5
|
-
readonly sourceStateId: string;
|
|
6
|
-
readonly sourceOutcomeSchema: unknown;
|
|
7
|
-
/** Repository dispositions declared by the boundary's outcome arms. */
|
|
8
|
-
readonly dispositions?: readonly string[];
|
|
9
|
-
readonly [key: string]: unknown;
|
|
10
|
-
}
|
|
11
|
-
export type RepositoryReceiptClassification = 'unchanged' | 'one-descendant-commit' | 'multiple-commits' | 'rewritten-or-non-descendant' | 'worktree-only-change' | 'concurrent-or-foreign-change' | 'observation-ambiguous';
|
|
12
|
-
export interface RepositoryObservation {
|
|
13
|
-
readonly worktree: string;
|
|
14
|
-
readonly gitDir: string;
|
|
15
|
-
readonly head: string;
|
|
16
|
-
readonly projection: Readonly<Record<string, unknown>>;
|
|
17
|
-
readonly projectionDigest: string;
|
|
18
|
-
}
|
|
19
|
-
export interface RepositoryReceipt {
|
|
20
|
-
readonly classification: RepositoryReceiptClassification;
|
|
21
|
-
readonly baseline: RepositoryObservation;
|
|
22
|
-
readonly after?: RepositoryObservation;
|
|
23
|
-
readonly commitOid?: string;
|
|
24
|
-
}
|
|
25
|
-
/** The engine's ordered effect ledger; revision is zero exactly when empty. */
|
|
26
|
-
export interface EffectLedgerSnapshot {
|
|
27
|
-
readonly schemaVersion: 1;
|
|
28
|
-
readonly revision: number;
|
|
29
|
-
readonly boundaries: readonly unknown[];
|
|
30
|
-
readonly logicalOperations: readonly unknown[];
|
|
31
|
-
}
|
|
32
|
-
export interface HostCapabilities {
|
|
33
|
-
readonly repository: unknown;
|
|
34
|
-
readonly effectLedger: unknown;
|
|
35
|
-
}
|
|
36
|
-
/** Runs one Git command and returns its stdout; throws on nonzero exit. */
|
|
37
|
-
export type GitRunner = (args: readonly string[]) => string;
|
|
38
|
-
/** The null Git OID, reported before a repository has its first commit. */
|
|
39
|
-
export declare const NULL_GIT_OID: string;
|
|
40
|
-
/**
|
|
41
|
-
* Builds a repository observation whose digest matches the engine's rule
|
|
42
|
-
* exactly: `sha256:` over `JSON.stringify(projection)`. Callers supply the
|
|
43
|
-
* worktree paths, HEAD, and the dirty-state projection; a repository with no
|
|
44
|
-
* commit yet reports the null OID, which is what the engine's canonical-OID
|
|
45
|
-
* check expects. The projection is required: an empty projection asserts a
|
|
46
|
-
* clean worktree, so it must come from a real status observation such as
|
|
47
|
-
* {@link observeGitWorktree}, never from a default.
|
|
48
|
-
*/
|
|
49
|
-
export declare function observeWorktree(opts: {
|
|
50
|
-
readonly worktree: string;
|
|
51
|
-
readonly gitDir: string;
|
|
52
|
-
readonly head: string;
|
|
53
|
-
readonly projection: Readonly<Record<string, unknown>>;
|
|
54
|
-
}): RepositoryObservation;
|
|
55
|
-
/**
|
|
56
|
-
* Observes one Git worktree: HEAD plus a path-keyed projection of every
|
|
57
|
-
* dirty or untracked entry, derived from `git status --porcelain` with
|
|
58
|
-
* content identities so a change is visible even when the status code alone
|
|
59
|
-
* would not move. Mirrors the reference host's status-derived projection in
|
|
60
|
-
* reduced form: one sample, index identities from `ls-files -s`, worktree
|
|
61
|
-
* identities from `hash-object`.
|
|
62
|
-
*/
|
|
63
|
-
export declare function observeGitWorktree(opts: {
|
|
64
|
-
readonly worktree: string;
|
|
65
|
-
readonly gitDir: string;
|
|
66
|
-
readonly run: GitRunner;
|
|
67
|
-
}): RepositoryObservation;
|
|
68
|
-
/**
|
|
69
|
-
* Classifies what one governed operation did to a repository, which is the
|
|
70
|
-
* judgement the engine matches against the state's declared
|
|
71
|
-
* `repositoryDisposition`. Mirrors the engine reference's
|
|
72
|
-
* `classifyRepositoryReceipt` decision order: an identical observation is
|
|
73
|
-
* `unchanged`; any change under all-`unchanged` dispositions is
|
|
74
|
-
* `concurrent-or-foreign-change`; a same-HEAD change is `worktree-only-change`
|
|
75
|
-
* only when it preserves every baseline entry and a commit arm is declared;
|
|
76
|
-
* a moved HEAD is one descendant commit only when ancestry proves exactly one
|
|
77
|
-
* new commit and the dirty projection is preserved; everything the observation
|
|
78
|
-
* cannot prove is `observation-ambiguous`.
|
|
79
|
-
*/
|
|
80
|
-
export declare function classifyGitChange(opts: {
|
|
81
|
-
readonly baseline: RepositoryObservation;
|
|
82
|
-
readonly after: RepositoryObservation;
|
|
83
|
-
/** The boundary's declared dispositions; assume every arm when omitted. */
|
|
84
|
-
readonly dispositions?: readonly string[];
|
|
85
|
-
readonly run: GitRunner;
|
|
86
|
-
}): RepositoryReceiptClassification;
|
|
87
|
-
/** An empty ledger: revision zero exactly when both ordered ledgers are empty. */
|
|
88
|
-
export declare function emptyEffectLedger(): EffectLedgerSnapshot;
|
|
89
|
-
/**
|
|
90
|
-
* Capabilities whose repository and effect-mutation seams reject. Correct
|
|
91
|
-
* wherever the artifact declares no governed player state (DR-024).
|
|
92
|
-
*/
|
|
93
|
-
export declare function failClosedHostCapabilities(): HostCapabilities;
|
|
94
|
-
/**
|
|
95
|
-
* Capabilities that run governed operations against a real worktree, observing
|
|
96
|
-
* it before and after so the engine receives a classified receipt. The engine
|
|
97
|
-
* owns each boundary's identity — it re-checks the source state and outcome
|
|
98
|
-
* schema on completion — so the seed it supplies is completed, never replaced.
|
|
99
|
-
*
|
|
100
|
-
* The boundary is recorded in the ledger when the operation starts, before the
|
|
101
|
-
* completion callback runs, so the engine's semantic correction budget can
|
|
102
|
-
* find and spend it through `writeAhead` mid-completion (DR-025, DR-028); the
|
|
103
|
-
* settlement then replaces the started record with the receipt and exactly the
|
|
104
|
-
* evidence the completion callback returned. A completion carrying a deferred
|
|
105
|
-
* Boss-question binding appends the reciprocal logical operation and settles
|
|
106
|
-
* `deferredStatus: 'bound'` (DR-005, DR-040).
|
|
107
|
-
*/
|
|
108
|
-
export declare function worktreeHostCapabilities(opts: {
|
|
109
|
-
readonly playbookId: string;
|
|
110
|
-
readonly observe: () => RepositoryObservation;
|
|
111
|
-
readonly classify?: (baseline: RepositoryObservation, after: RepositoryObservation, context: {
|
|
112
|
-
readonly dispositions?: readonly string[];
|
|
113
|
-
}) => RepositoryReceiptClassification;
|
|
114
|
-
}): HostCapabilities;
|
|
115
|
-
//# sourceMappingURL=host-capabilities.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"host-capabilities.d.ts","sourceRoot":"","sources":["../src/host-capabilities.ts"],"names":[],"mappings":"AAgCA,iEAAiE;AACjE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,mBAAmB,EAAE,OAAO,CAAC;IACtC,uEAAuE;IACvE,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACjC;AAED,MAAM,MAAM,+BAA+B,GACvC,WAAW,GACX,uBAAuB,GACvB,kBAAkB,GAClB,6BAA6B,GAC7B,sBAAsB,GACtB,8BAA8B,GAC9B,uBAAuB,CAAC;AAE5B,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACvD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;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C,GAAG,EAAE,SAAS,CAAC;CACzB,GAAG,qBAAqB,CAqFxB;AAUD;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE;IACtC,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,CAAC;IACzC,QAAQ,CAAC,KAAK,EAAE,qBAAqB,CAAC;IACtC,2EAA2E;IAC3E,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC;CACzB,GAAG,+BAA+B,CA+ClC;AAED,kFAAkF;AAClF,wBAAgB,iBAAiB,IAAI,oBAAoB,CAOxD;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,IAAI,gBAAgB,CAe7D;AAmCD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE;IAC7C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,qBAAqB,CAAC;IAC9C,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAClB,QAAQ,EAAE,qBAAqB,EAC/B,KAAK,EAAE,qBAAqB,EAC5B,OAAO,EAAE;QAAE,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,KACnD,+BAA+B,CAAC;CACtC,GAAG,gBAAgB,CA6RnB"}
|
|
@@ -1,507 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"host-capabilities.js","sourceRoot":"","sources":["../src/host-capabilities.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,0EAA0E;AAE1E;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAqD9C,MAAM,sBAAsB,GAC1B,wEAAwE,CAAC;AAC3E,MAAM,kBAAkB,GACtB,uEAAuE,CAAC;AAE1E,2EAA2E;AAC3E,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAE3C,SAAS,SAAS,CAAC,IAAY;IAC7B,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACzD,CAAC;AAED,SAAS,cAAc,CAAC,UAA6C;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