@cotal-ai/lang 0.24.0 → 0.26.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 +11 -0
- package/dist/engine/bridge.d.ts +71 -0
- package/dist/engine/bridge.d.ts.map +1 -0
- package/dist/engine/bridge.js +277 -0
- package/dist/engine/bridge.js.map +1 -0
- package/dist/engine/ctx.d.ts +140 -0
- package/dist/engine/ctx.d.ts.map +1 -0
- package/dist/engine/ctx.js +834 -0
- package/dist/engine/ctx.js.map +1 -0
- package/dist/engine/frame.d.ts +69 -0
- package/dist/engine/frame.d.ts.map +1 -0
- package/dist/engine/frame.js +105 -0
- package/dist/engine/frame.js.map +1 -0
- package/dist/engine/host.d.ts +77 -0
- package/dist/engine/host.d.ts.map +1 -0
- package/dist/engine/host.js +134 -0
- package/dist/engine/host.js.map +1 -0
- package/dist/engine/worker-entry.d.ts +26 -0
- package/dist/engine/worker-entry.d.ts.map +1 -0
- package/dist/engine/worker-entry.js +175 -0
- package/dist/engine/worker-entry.js.map +1 -0
- package/dist/engine/worker.d.ts +156 -0
- package/dist/engine/worker.d.ts.map +1 -0
- package/dist/engine/worker.js +123 -0
- package/dist/engine/worker.js.map +1 -0
- package/dist/errors.d.ts +44 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +97 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/interpret.d.ts +7 -38
- package/dist/interpret.d.ts.map +1 -1
- package/dist/interpret.js +45 -1003
- package/dist/interpret.js.map +1 -1
- package/dist/journal.d.ts.map +1 -1
- package/dist/journal.js +75 -1
- package/dist/journal.js.map +1 -1
- package/dist/library.d.ts.map +1 -1
- package/dist/library.js +13 -1
- package/dist/library.js.map +1 -1
- package/dist/perform.d.ts +138 -0
- package/dist/perform.d.ts.map +1 -0
- package/dist/perform.js +1052 -0
- package/dist/perform.js.map +1 -0
- package/dist/pins.d.ts +28 -8
- package/dist/pins.d.ts.map +1 -1
- package/dist/pins.js +31 -11
- package/dist/pins.js.map +1 -1
- package/dist/sim.d.ts +15 -1
- package/dist/sim.d.ts.map +1 -1
- package/dist/sim.js.map +1 -1
- package/dist/transform/emit.d.ts +23 -0
- package/dist/transform/emit.d.ts.map +1 -0
- package/dist/transform/emit.js +934 -0
- package/dist/transform/emit.js.map +1 -0
- package/dist/transform/index.d.ts +34 -0
- package/dist/transform/index.d.ts.map +1 -0
- package/dist/transform/index.js +31 -0
- package/dist/transform/index.js.map +1 -0
- package/dist/transform/scope.d.ts +58 -0
- package/dist/transform/scope.d.ts.map +1 -0
- package/dist/transform/scope.js +500 -0
- package/dist/transform/scope.js.map +1 -0
- package/dist/transform/seam.d.ts +78 -0
- package/dist/transform/seam.d.ts.map +1 -0
- package/dist/transform/seam.js +111 -0
- package/dist/transform/seam.js.map +1 -0
- package/dist/values.d.ts +15 -0
- package/dist/values.d.ts.map +1 -1
- package/dist/values.js +79 -0
- package/dist/values.js.map +1 -1
- package/package.json +9 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ctx.js","sourceRoot":"","sources":["../../src/engine/ctx.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,WAAW,EAAsB,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAA8B,MAAM,eAAe,CAAC;AAGjH,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,IAAI,IAAI,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEpH,OAAO,EAAE,MAAM,EAAkB,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,YAAY,EA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,CAAC,IAAI,CAAC,CAAC;AAC7D,CAAC;AAED,mGAAmG;AACnG,SAAS,cAAc,CAAC,CAAU;IAChC,IAAI,CAAC,YAAY,WAAW,EAAE,CAAC;QAC7B,OAAO,UAAU,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IACjI,CAAC;IACD,IAAI,CAAC,YAAY,YAAY;QAAE,OAAO,UAAU,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IACxG,IAAI,CAAC,YAAY,KAAK;QAAE,OAAO,UAAU,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IAC/F,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The engine's per-branch state, and the AsyncLocalStorage that carries it.
|
|
3
|
+
*
|
|
4
|
+
* The walker threads a `Frame` through every call because it owns every call. The engine does not:
|
|
5
|
+
* the program is native JavaScript inside a Compartment, and the only thing it hands the host is
|
|
6
|
+
* arguments. So the frame travels out-of-band, in an AsyncLocalStorage, and every seam member reads
|
|
7
|
+
* it from there.
|
|
8
|
+
*
|
|
9
|
+
* That this works at all is a measured property of the floor, not an assumption (measured here at
|
|
10
|
+
* ses@2.3.0 on node v26.7.0): a compartment shares the one locked-down realm's
|
|
11
|
+
* intrinsics, so its promises are the host's promises and ALS propagation is native. Two interleaved
|
|
12
|
+
* runs of the same compartment-evaluated program, each awaiting a host timer inside the seam, kept
|
|
13
|
+
* their own frames with no cross-contamination. Node's remaining documented loss cases are callback
|
|
14
|
+
* APIs and custom thenables, and a program value with its own callable `then` is exactly such a
|
|
15
|
+
* thenable, which is why the seam refuses one outright (`born`/`set`/`await`) rather than trusting
|
|
16
|
+
* the frame to survive it.
|
|
17
|
+
*
|
|
18
|
+
* `Signal` and `EngineFrame` are re-authored here rather than imported because the walker's are
|
|
19
|
+
* private to interpret.ts, which the engine does not edit. They are held to the walker's semantics
|
|
20
|
+
* by the differential suite, and the shared `performEffect` in perform.ts takes a STRUCTURAL frame
|
|
21
|
+
* (`EffectFrame`: `keys`, `clock`, `signal`) so the walker's Frame and this one both satisfy it
|
|
22
|
+
* without either importing the other.
|
|
23
|
+
*/
|
|
24
|
+
import type { CancelSignal } from "../effects.js";
|
|
25
|
+
import type { RunClock } from "../journal.js";
|
|
26
|
+
import type { KeyScope, ScopeKind } from "../keys.js";
|
|
27
|
+
/**
|
|
28
|
+
* A branch's cancellation, in the walker's two degrees.
|
|
29
|
+
*
|
|
30
|
+
* `cancelled` is the law: a cancelled branch performs no NEW effect, and every effect boundary
|
|
31
|
+
* refuses it. `cutPure` is the stronger cut a scope applies to an arm that can no longer win, and it
|
|
32
|
+
* is observed only at a fuel yield. Both degrees flow to child signals, and a signal already
|
|
33
|
+
* cancelled softly can be escalated.
|
|
34
|
+
*/
|
|
35
|
+
export declare class Signal implements CancelSignal {
|
|
36
|
+
cancelled: boolean;
|
|
37
|
+
cutPure: boolean;
|
|
38
|
+
reason?: string;
|
|
39
|
+
private readonly listeners;
|
|
40
|
+
onCancel(fn: (reason: string, cutPure: boolean) => void): void;
|
|
41
|
+
cancel(reason: string, opts?: {
|
|
42
|
+
readonly cutPure: boolean;
|
|
43
|
+
}): void;
|
|
44
|
+
child(): Signal;
|
|
45
|
+
}
|
|
46
|
+
/** One branch of execution: its own key namespace, its own clock, its own cancellation signal. */
|
|
47
|
+
export declare class EngineFrame {
|
|
48
|
+
readonly keys: KeyScope;
|
|
49
|
+
readonly clock: RunClock;
|
|
50
|
+
readonly signal: Signal;
|
|
51
|
+
/** How many CONCURRENT scopes deep. L2032's runtime half; `born` stamps with it. */
|
|
52
|
+
readonly depth: number;
|
|
53
|
+
constructor(keys: KeyScope, clock: RunClock, signal: Signal,
|
|
54
|
+
/** How many CONCURRENT scopes deep. L2032's runtime half; `born` stamps with it. */
|
|
55
|
+
depth?: number);
|
|
56
|
+
branch(kind: ScopeKind, name: string | null, occurrence: number, branchKey: string): EngineFrame;
|
|
57
|
+
}
|
|
58
|
+
/** Run `body` with `frame` as the ambient frame. Every seam call inside it reads that frame. */
|
|
59
|
+
export declare function withFrame<T>(frame: EngineFrame, body: () => T): T;
|
|
60
|
+
/**
|
|
61
|
+
* The ambient frame, or a loud failure.
|
|
62
|
+
*
|
|
63
|
+
* No fallback frame, deliberately. A seam call with no frame means the program is running outside
|
|
64
|
+
* any branch (host machinery invoked it), and inventing a root frame there would give it a key
|
|
65
|
+
* namespace, a clock and a depth that belong to no branch, which is how a step lands in the wrong
|
|
66
|
+
* place in the journal instead of failing.
|
|
67
|
+
*/
|
|
68
|
+
export declare function currentFrame(): EngineFrame;
|
|
69
|
+
//# sourceMappingURL=frame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frame.d.ts","sourceRoot":"","sources":["../../src/engine/frame.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEtD;;;;;;;GAOG;AACH,qBAAa,MAAO,YAAW,YAAY;IACzC,SAAS,UAAS;IAClB,OAAO,UAAS;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAsD;IAEhF,QAAQ,CAAC,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI;IAI9D,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI;IAYlE,KAAK,IAAI,MAAM;CAMhB;AAED,kGAAkG;AAClG,qBAAa,WAAW;IAEpB,QAAQ,CAAC,IAAI,EAAE,QAAQ;IACvB,QAAQ,CAAC,KAAK,EAAE,QAAQ;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM;IACvB,oFAAoF;IACpF,QAAQ,CAAC,KAAK,EAAE,MAAM;gBAJb,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,QAAQ,EACf,MAAM,EAAE,MAAM;IACvB,oFAAoF;IAC3E,KAAK,GAAE,MAAU;IAG5B,MAAM,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,WAAW;CAUjG;AAID,gGAAgG;AAChG,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,CAEjE;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI,WAAW,CAS1C"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The engine's per-branch state, and the AsyncLocalStorage that carries it.
|
|
3
|
+
*
|
|
4
|
+
* The walker threads a `Frame` through every call because it owns every call. The engine does not:
|
|
5
|
+
* the program is native JavaScript inside a Compartment, and the only thing it hands the host is
|
|
6
|
+
* arguments. So the frame travels out-of-band, in an AsyncLocalStorage, and every seam member reads
|
|
7
|
+
* it from there.
|
|
8
|
+
*
|
|
9
|
+
* That this works at all is a measured property of the floor, not an assumption (measured here at
|
|
10
|
+
* ses@2.3.0 on node v26.7.0): a compartment shares the one locked-down realm's
|
|
11
|
+
* intrinsics, so its promises are the host's promises and ALS propagation is native. Two interleaved
|
|
12
|
+
* runs of the same compartment-evaluated program, each awaiting a host timer inside the seam, kept
|
|
13
|
+
* their own frames with no cross-contamination. Node's remaining documented loss cases are callback
|
|
14
|
+
* APIs and custom thenables, and a program value with its own callable `then` is exactly such a
|
|
15
|
+
* thenable, which is why the seam refuses one outright (`born`/`set`/`await`) rather than trusting
|
|
16
|
+
* the frame to survive it.
|
|
17
|
+
*
|
|
18
|
+
* `Signal` and `EngineFrame` are re-authored here rather than imported because the walker's are
|
|
19
|
+
* private to interpret.ts, which the engine does not edit. They are held to the walker's semantics
|
|
20
|
+
* by the differential suite, and the shared `performEffect` in perform.ts takes a STRUCTURAL frame
|
|
21
|
+
* (`EffectFrame`: `keys`, `clock`, `signal`) so the walker's Frame and this one both satisfy it
|
|
22
|
+
* without either importing the other.
|
|
23
|
+
*/
|
|
24
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
25
|
+
/**
|
|
26
|
+
* A branch's cancellation, in the walker's two degrees.
|
|
27
|
+
*
|
|
28
|
+
* `cancelled` is the law: a cancelled branch performs no NEW effect, and every effect boundary
|
|
29
|
+
* refuses it. `cutPure` is the stronger cut a scope applies to an arm that can no longer win, and it
|
|
30
|
+
* is observed only at a fuel yield. Both degrees flow to child signals, and a signal already
|
|
31
|
+
* cancelled softly can be escalated.
|
|
32
|
+
*/
|
|
33
|
+
export class Signal {
|
|
34
|
+
cancelled = false;
|
|
35
|
+
cutPure = false;
|
|
36
|
+
reason;
|
|
37
|
+
listeners = [];
|
|
38
|
+
onCancel(fn) {
|
|
39
|
+
this.listeners.push(fn);
|
|
40
|
+
}
|
|
41
|
+
cancel(reason, opts) {
|
|
42
|
+
const cut = opts?.cutPure ?? true;
|
|
43
|
+
const first = !this.cancelled;
|
|
44
|
+
if (first) {
|
|
45
|
+
this.cancelled = true;
|
|
46
|
+
this.reason = reason;
|
|
47
|
+
}
|
|
48
|
+
const escalated = cut && !this.cutPure;
|
|
49
|
+
if (escalated)
|
|
50
|
+
this.cutPure = true;
|
|
51
|
+
if (first || escalated)
|
|
52
|
+
for (const l of this.listeners)
|
|
53
|
+
l(reason, this.cutPure);
|
|
54
|
+
}
|
|
55
|
+
child() {
|
|
56
|
+
const s = new Signal();
|
|
57
|
+
if (this.cancelled)
|
|
58
|
+
s.cancel(this.reason ?? "parent cancelled", { cutPure: this.cutPure });
|
|
59
|
+
this.onCancel((r, cut) => s.cancel(r, { cutPure: cut }));
|
|
60
|
+
return s;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/** One branch of execution: its own key namespace, its own clock, its own cancellation signal. */
|
|
64
|
+
export class EngineFrame {
|
|
65
|
+
keys;
|
|
66
|
+
clock;
|
|
67
|
+
signal;
|
|
68
|
+
depth;
|
|
69
|
+
constructor(keys, clock, signal,
|
|
70
|
+
/** How many CONCURRENT scopes deep. L2032's runtime half; `born` stamps with it. */
|
|
71
|
+
depth = 0) {
|
|
72
|
+
this.keys = keys;
|
|
73
|
+
this.clock = clock;
|
|
74
|
+
this.signal = signal;
|
|
75
|
+
this.depth = depth;
|
|
76
|
+
}
|
|
77
|
+
branch(kind, name, occurrence, branchKey) {
|
|
78
|
+
return new EngineFrame(this.keys.branch(kind, name, occurrence, branchKey), this.clock.fork(), this.signal.child(),
|
|
79
|
+
// `conclave` opens a scope but not a RACE: one body, nothing running beside it, so a write
|
|
80
|
+
// from inside it is as ordered as a write anywhere else and the depth does not move.
|
|
81
|
+
kind === "conclave" ? this.depth : this.depth + 1);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
const FRAMES = new AsyncLocalStorage();
|
|
85
|
+
/** Run `body` with `frame` as the ambient frame. Every seam call inside it reads that frame. */
|
|
86
|
+
export function withFrame(frame, body) {
|
|
87
|
+
return FRAMES.run(frame, body);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* The ambient frame, or a loud failure.
|
|
91
|
+
*
|
|
92
|
+
* No fallback frame, deliberately. A seam call with no frame means the program is running outside
|
|
93
|
+
* any branch (host machinery invoked it), and inventing a root frame there would give it a key
|
|
94
|
+
* namespace, a clock and a depth that belong to no branch, which is how a step lands in the wrong
|
|
95
|
+
* place in the journal instead of failing.
|
|
96
|
+
*/
|
|
97
|
+
export function currentFrame() {
|
|
98
|
+
const f = FRAMES.getStore();
|
|
99
|
+
if (f === undefined) {
|
|
100
|
+
throw new Error("cotal-lang engine: a seam call ran with no frame. The program was reached from outside a branch, " +
|
|
101
|
+
"so there is no key namespace, clock or depth to charge it to.");
|
|
102
|
+
}
|
|
103
|
+
return f;
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=frame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frame.js","sourceRoot":"","sources":["../../src/engine/frame.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAKrD;;;;;;;GAOG;AACH,MAAM,OAAO,MAAM;IACjB,SAAS,GAAG,KAAK,CAAC;IAClB,OAAO,GAAG,KAAK,CAAC;IAChB,MAAM,CAAU;IACC,SAAS,GAAmD,EAAE,CAAC;IAEhF,QAAQ,CAAC,EAA8C;QACrD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1B,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,IAAoC;QACzD,MAAM,GAAG,GAAG,IAAI,EAAE,OAAO,IAAI,IAAI,CAAC;QAClC,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC;QAC9B,IAAI,KAAK,EAAE,CAAC;YACV,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;YACtB,IAAI,CAAC,MAAM,GAAG,MAAM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;QACnB,2FAA2F;QAC3F,qFAAqF;QACrF,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAClD,CAAC;IACJ,CAAC;CACF;AAED,MAAM,MAAM,GAAG,IAAI,iBAAiB,EAAe,CAAC;AAEpD,gGAAgG;AAChG,MAAM,UAAU,SAAS,CAAI,KAAkB,EAAE,IAAa;IAC5D,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACjC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY;IAC1B,MAAM,CAAC,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC5B,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CACb,mGAAmG;YACjG,+DAA+D,CAClE,CAAC;IACJ,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Running a transformed program on the engine, in this process.
|
|
3
|
+
*
|
|
4
|
+
* Same signature and same `RunResult` as the walker's `run()`, so the differential suite can call
|
|
5
|
+
* one and then the other with nothing between them but the engine under test. Everything a run is
|
|
6
|
+
* pinned by (the source's hash, the seed, the logical epoch, the three limits) is resolved by the
|
|
7
|
+
* SAME functions the walker resolves them with, because a second copy of that logic is a second
|
|
8
|
+
* answer to "which run is this".
|
|
9
|
+
*
|
|
10
|
+
* THERE IS NO DEFAULT EVALUATOR, and that is the security posture rather than an inconvenience.
|
|
11
|
+
* Turning a module string into a function is where confinement is either applied or lost, so the
|
|
12
|
+
* caller supplies it: the differential suite hands in a plain evaluator because it is comparing two
|
|
13
|
+
* engines on validator-accepted source in a test process, and the worker hands in one that evaluates
|
|
14
|
+
* inside a locked-down Compartment with zero endowments. A default here would be an unconfined
|
|
15
|
+
* production path that nobody chose and no reviewer would see.
|
|
16
|
+
*/
|
|
17
|
+
import { Journal } from "../journal.js";
|
|
18
|
+
import type { RunOptions, RunResult } from "../interpret.js";
|
|
19
|
+
import { type EngineCtx } from "./ctx.js";
|
|
20
|
+
/**
|
|
21
|
+
* The node below which this engine refuses to start, and the measurement the number comes from.
|
|
22
|
+
*
|
|
23
|
+
* The floor was first set at node 24 for AsyncContextFrame ALS. PROBED, that reason does not
|
|
24
|
+
* reproduce on any path this engine takes, and the probes are the reason this constant is 22:
|
|
25
|
+
* ALS on node 22.23.2 9 of 9 shapes propagate - plain await, across the setTimeout macrotask
|
|
26
|
+
* the fuel yield uses, both arms of a Promise.all, after a CUSTOM
|
|
27
|
+
* THENABLE, across nextTick and setImmediate, and a nested run that
|
|
28
|
+
* restores its parent. Identical on 26.7.0 and on 22 with
|
|
29
|
+
* --experimental-async-context-frame.
|
|
30
|
+
* the seam on 22 the engine suite reaches the same checks it reaches on 26 until it
|
|
31
|
+
* asks for a worker, below.
|
|
32
|
+
* the WORKER from `dist` on node 22: identical answer, identical confinement (Date.now throws,
|
|
33
|
+
* `process` undefined, 0 own globals), identical programHash, 74ms cold
|
|
34
|
+
* against 51ms.
|
|
35
|
+
* So NOTHING IN THE RUNTIME NEEDS 24, and a refusal at 24 would refuse environments this engine is
|
|
36
|
+
* measured to work in. What fails on 22 is only the DEV path: a worker thread there does not apply
|
|
37
|
+
* the parent's ESM loader hooks, so a `.ts` entry's own `../journal.js` is ERR_MODULE_NOT_FOUND -
|
|
38
|
+
* measured three ways, the `.js` spelling, the `.ts` spelling, and an explicit
|
|
39
|
+
* `execArgv: ["--import", "tsx"]` on the Worker, none of which changes it. That is not a runtime
|
|
40
|
+
* bound and is not answered here: the Worker entry is an EXPLICIT INPUT of `runInWorker`, and the
|
|
41
|
+
* engine suite's worker leg names a built artifact. See `worker.ts`.
|
|
42
|
+
*
|
|
43
|
+
* The number is a floor rather than an `engines` line because a package manager's warning is not a
|
|
44
|
+
* refusal, and an engine whose frame plumbing rests on AsyncLocalStorage will not run on untested
|
|
45
|
+
* ground and hope. It matches `engines` today; when a real RUNTIME reason to raise it appears, the
|
|
46
|
+
* constant moves and the reason is written beside these.
|
|
47
|
+
*/
|
|
48
|
+
export declare const NODE_FLOOR = 22;
|
|
49
|
+
/**
|
|
50
|
+
* Refuse a node below the floor, by MAJOR version.
|
|
51
|
+
*
|
|
52
|
+
* Pure in its argument so a suite can ask it about a version it is not running on; `runOnEngine`
|
|
53
|
+
* calls it with the live one, which is the only call site.
|
|
54
|
+
*/
|
|
55
|
+
export declare function assertNodeFloor(version: string): void;
|
|
56
|
+
/** What the transform emits: a closed expression taking the context as its call argument. */
|
|
57
|
+
export type ModuleFactory = (ctx: EngineCtx) => () => Promise<unknown>;
|
|
58
|
+
export interface EngineRunOptions extends RunOptions {
|
|
59
|
+
/**
|
|
60
|
+
* Turn the emitted module string into its factory. See the note above: no default, on purpose.
|
|
61
|
+
* It must return the value of a CLOSED function expression with zero free identifiers.
|
|
62
|
+
*/
|
|
63
|
+
readonly evaluate: (module: string) => ModuleFactory;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Run a transformed program.
|
|
67
|
+
*
|
|
68
|
+
* `source` is the original program: it is validated here and its hash is the run's identity, exactly
|
|
69
|
+
* as on the walker. `module` is the transform's output for that source. They are both taken because
|
|
70
|
+
* the run is pinned to the SOURCE (a run record names the program an author wrote, not the string a
|
|
71
|
+
* compiler produced), and because the validator's refusals must arrive before anything is journalled,
|
|
72
|
+
* whichever engine is about to execute.
|
|
73
|
+
*/
|
|
74
|
+
export declare function runOnEngine(source: string, module: string, options: EngineRunOptions): Promise<RunResult>;
|
|
75
|
+
/** Re-run a transformed program against an existing journal. Journalled effects return recorded results. */
|
|
76
|
+
export declare function resumeOnEngine(source: string, module: string, journal: Journal, options: Omit<EngineRunOptions, "journal">): Promise<RunResult>;
|
|
77
|
+
//# sourceMappingURL=host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../src/engine/host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EAAE,OAAO,EAAY,MAAM,eAAe,CAAC;AAGlD,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAGrE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,UAAU,KAAK,CAAC;AAE7B;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAQrD;AAED,6FAA6F;AAC7F,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,SAAS,KAAK,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;AAEvE,MAAM,WAAW,gBAAiB,SAAQ,UAAU;IAClD;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,aAAa,CAAC;CACtD;AAED;;;;;;;;GAQG;AACH,wBAAsB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,CAAC,CAmE/G;AAED,4GAA4G;AAC5G,wBAAsB,cAAc,CAClC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,GACzC,OAAO,CAAC,SAAS,CAAC,CAGpB"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Running a transformed program on the engine, in this process.
|
|
3
|
+
*
|
|
4
|
+
* Same signature and same `RunResult` as the walker's `run()`, so the differential suite can call
|
|
5
|
+
* one and then the other with nothing between them but the engine under test. Everything a run is
|
|
6
|
+
* pinned by (the source's hash, the seed, the logical epoch, the three limits) is resolved by the
|
|
7
|
+
* SAME functions the walker resolves them with, because a second copy of that logic is a second
|
|
8
|
+
* answer to "which run is this".
|
|
9
|
+
*
|
|
10
|
+
* THERE IS NO DEFAULT EVALUATOR, and that is the security posture rather than an inconvenience.
|
|
11
|
+
* Turning a module string into a function is where confinement is either applied or lost, so the
|
|
12
|
+
* caller supplies it: the differential suite hands in a plain evaluator because it is comparing two
|
|
13
|
+
* engines on validator-accepted source in a test process, and the worker hands in one that evaluates
|
|
14
|
+
* inside a locked-down Compartment with zero endowments. A default here would be an unconfined
|
|
15
|
+
* production path that nobody chose and no reviewer would see.
|
|
16
|
+
*/
|
|
17
|
+
import { validate } from "../grammar.js";
|
|
18
|
+
import { RuntimeFault } from "../errors.js";
|
|
19
|
+
import { Journal, RunClock } from "../journal.js";
|
|
20
|
+
import { KeyScope, programHashOf } from "../keys.js";
|
|
21
|
+
import { bindPins, ENGINE_LANGUAGE_VERSION, resolvePins } from "../pins.js";
|
|
22
|
+
import { EngineFault, createEngine } from "./ctx.js";
|
|
23
|
+
import { EngineFrame, Signal, withFrame } from "./frame.js";
|
|
24
|
+
/**
|
|
25
|
+
* The node below which this engine refuses to start, and the measurement the number comes from.
|
|
26
|
+
*
|
|
27
|
+
* The floor was first set at node 24 for AsyncContextFrame ALS. PROBED, that reason does not
|
|
28
|
+
* reproduce on any path this engine takes, and the probes are the reason this constant is 22:
|
|
29
|
+
* ALS on node 22.23.2 9 of 9 shapes propagate - plain await, across the setTimeout macrotask
|
|
30
|
+
* the fuel yield uses, both arms of a Promise.all, after a CUSTOM
|
|
31
|
+
* THENABLE, across nextTick and setImmediate, and a nested run that
|
|
32
|
+
* restores its parent. Identical on 26.7.0 and on 22 with
|
|
33
|
+
* --experimental-async-context-frame.
|
|
34
|
+
* the seam on 22 the engine suite reaches the same checks it reaches on 26 until it
|
|
35
|
+
* asks for a worker, below.
|
|
36
|
+
* the WORKER from `dist` on node 22: identical answer, identical confinement (Date.now throws,
|
|
37
|
+
* `process` undefined, 0 own globals), identical programHash, 74ms cold
|
|
38
|
+
* against 51ms.
|
|
39
|
+
* So NOTHING IN THE RUNTIME NEEDS 24, and a refusal at 24 would refuse environments this engine is
|
|
40
|
+
* measured to work in. What fails on 22 is only the DEV path: a worker thread there does not apply
|
|
41
|
+
* the parent's ESM loader hooks, so a `.ts` entry's own `../journal.js` is ERR_MODULE_NOT_FOUND -
|
|
42
|
+
* measured three ways, the `.js` spelling, the `.ts` spelling, and an explicit
|
|
43
|
+
* `execArgv: ["--import", "tsx"]` on the Worker, none of which changes it. That is not a runtime
|
|
44
|
+
* bound and is not answered here: the Worker entry is an EXPLICIT INPUT of `runInWorker`, and the
|
|
45
|
+
* engine suite's worker leg names a built artifact. See `worker.ts`.
|
|
46
|
+
*
|
|
47
|
+
* The number is a floor rather than an `engines` line because a package manager's warning is not a
|
|
48
|
+
* refusal, and an engine whose frame plumbing rests on AsyncLocalStorage will not run on untested
|
|
49
|
+
* ground and hope. It matches `engines` today; when a real RUNTIME reason to raise it appears, the
|
|
50
|
+
* constant moves and the reason is written beside these.
|
|
51
|
+
*/
|
|
52
|
+
export const NODE_FLOOR = 22;
|
|
53
|
+
/**
|
|
54
|
+
* Refuse a node below the floor, by MAJOR version.
|
|
55
|
+
*
|
|
56
|
+
* Pure in its argument so a suite can ask it about a version it is not running on; `runOnEngine`
|
|
57
|
+
* calls it with the live one, which is the only call site.
|
|
58
|
+
*/
|
|
59
|
+
export function assertNodeFloor(version) {
|
|
60
|
+
const major = Number(version.split(".")[0]);
|
|
61
|
+
if (Number.isFinite(major) && major < NODE_FLOOR) {
|
|
62
|
+
throw new RuntimeFault("L1000", `the cotal-lang engine requires node ${NODE_FLOOR} or newer and this is node ${version}. That is the floor this repo declares it supports and the lowest this engine was measured on; below it nothing here has been tested, and an engine whose frame plumbing rests on AsyncLocalStorage will not run on untested ground and hope.`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Run a transformed program.
|
|
67
|
+
*
|
|
68
|
+
* `source` is the original program: it is validated here and its hash is the run's identity, exactly
|
|
69
|
+
* as on the walker. `module` is the transform's output for that source. They are both taken because
|
|
70
|
+
* the run is pinned to the SOURCE (a run record names the program an author wrote, not the string a
|
|
71
|
+
* compiler produced), and because the validator's refusals must arrive before anything is journalled,
|
|
72
|
+
* whichever engine is about to execute.
|
|
73
|
+
*/
|
|
74
|
+
export async function runOnEngine(source, module, options) {
|
|
75
|
+
// BEFORE ANYTHING, including the validator: a run that cannot be trusted to carry its frame is not
|
|
76
|
+
// a run whose refusals mean anything either.
|
|
77
|
+
assertNodeFloor(process.versions.node);
|
|
78
|
+
validate(source, options.file);
|
|
79
|
+
const programHash = programHashOf(source);
|
|
80
|
+
// A RESUME MAY NOT DECLINE TO SAY WHICH RUN IT IS RESUMING. Re-resolving the pins for a run handed
|
|
81
|
+
// history but no pins is a different run wearing the same journal: the clock moves to the resuming
|
|
82
|
+
// host and the seed falls back to the runId default, so both the logical epoch and every pure draw
|
|
83
|
+
// change, and nothing refuses, because nothing can: neither is a recorded fact a replay could
|
|
84
|
+
// diverge on. A journal with NO entries is a fresh run being handed a store, and stays allowed.
|
|
85
|
+
if (options.pins === undefined && options.journal !== undefined && options.journal.entries().length > 0) {
|
|
86
|
+
throw new RuntimeFault("L5021", `run ${options.runId} was handed a journal with ${options.journal.entries().length} recorded step(s) but no pins. The pins are what decide `
|
|
87
|
+
+ `the run's logical epoch and its seed, so resolving them again here would make this a different run against a journal that was not `
|
|
88
|
+
+ `written for it — silently, because neither the clock nor a pure draw is a recorded fact the replay could diverge on.\n\n`
|
|
89
|
+
+ `Options\n pass the pins from the run record\n start a fresh run instead of resuming this journal`);
|
|
90
|
+
}
|
|
91
|
+
const pins = options.pins !== undefined
|
|
92
|
+
? bindPins(options.pins, options, ENGINE_LANGUAGE_VERSION)
|
|
93
|
+
: resolvePins(options, options.handler.now(), ENGINE_LANGUAGE_VERSION);
|
|
94
|
+
// The journal and the run must be the same run: request ids derive from the runId while recorded
|
|
95
|
+
// results come from the journal, so a mismatch submits work under one identity and resolves it
|
|
96
|
+
// against another's history.
|
|
97
|
+
if (options.journal !== undefined && options.journal.run !== options.runId) {
|
|
98
|
+
throw new RuntimeFault("L5011", `this run is ${options.runId} but it was handed the journal of run ${options.journal.run}; a run resumes only from its own journal`);
|
|
99
|
+
}
|
|
100
|
+
const journal = options.journal ?? new Journal({ run: options.runId });
|
|
101
|
+
const engine = createEngine({
|
|
102
|
+
runId: options.runId,
|
|
103
|
+
programHash,
|
|
104
|
+
journal,
|
|
105
|
+
handler: options.handler,
|
|
106
|
+
pins,
|
|
107
|
+
...(options.onLog !== undefined ? { onLog: options.onLog } : {}),
|
|
108
|
+
...(options.shouldStop !== undefined ? { shouldStop: options.shouldStop } : {}),
|
|
109
|
+
});
|
|
110
|
+
// The run clock starts at the run's LOGICAL epoch, not at this host's clock: a run resumed on
|
|
111
|
+
// another machine hours later must see the same `now()` before its first effect as the run that
|
|
112
|
+
// wrote the journal, or the branch it takes is a property of when it was resumed.
|
|
113
|
+
const frame = new EngineFrame(new KeyScope(), new RunClock(pins.startedAt), new Signal());
|
|
114
|
+
const factory = options.evaluate(module);
|
|
115
|
+
// THE RUN BOUNDARY IS THE SECOND PLACE A NATIVE ReferenceError CAN SURFACE - the first is an
|
|
116
|
+
// emitted catch, and `caught` refuses it there. A program with no `try` around the bad read has
|
|
117
|
+
// nothing to route it through, so it arrives here, and here it must not look like a program error
|
|
118
|
+
// either. See `EngineFault`: zero free identifiers means this can only be the engine's own bug.
|
|
119
|
+
const value = await withFrame(frame, async () => {
|
|
120
|
+
try {
|
|
121
|
+
return await factory(engine.ctx)();
|
|
122
|
+
}
|
|
123
|
+
catch (e) {
|
|
124
|
+
throw e instanceof ReferenceError ? new EngineFault(e) : e;
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
return { value, journal, programHash, pins, steps: engine.steps() };
|
|
128
|
+
}
|
|
129
|
+
/** Re-run a transformed program against an existing journal. Journalled effects return recorded results. */
|
|
130
|
+
export async function resumeOnEngine(source, module, journal, options) {
|
|
131
|
+
journal.resetConsumed();
|
|
132
|
+
return await runOnEngine(source, module, { ...options, journal });
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=host.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.js","sourceRoot":"","sources":["../../src/engine/host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE5E,OAAO,EAAE,WAAW,EAAE,YAAY,EAAkB,MAAM,UAAU,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,CAAC;AAE7B;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,OAAe;IAC7C,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5C,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,UAAU,EAAE,CAAC;QACjD,MAAM,IAAI,YAAY,CACpB,OAAO,EACP,uCAAuC,UAAU,8BAA8B,OAAO,+OAA+O,CACtU,CAAC;IACJ,CAAC;AACH,CAAC;AAaD;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,MAAc,EA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,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC;AACtE,CAAC;AAED,4GAA4G;AAC5G,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAAc,EACd,MAAc,EACd,OAAgB,EAChB,OAA0C;IAE1C,OAAO,CAAC,aAAa,EAAE,CAAC;IACxB,OAAO,MAAM,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inside the thread: lockdown, one Compartment, and the run.
|
|
3
|
+
*
|
|
4
|
+
* THIS FILE IS THE CONFINEMENT. `lockdown()` runs ONCE, here, at module load and before anything of
|
|
5
|
+
* the run exists - it is irreversible and realm-wide, so it belongs at the top of a realm nobody
|
|
6
|
+
* else owns. Each run then gets a Compartment with ZERO ENDOWMENTS and the transform's module is
|
|
7
|
+
* evaluated in it; the context is the CALL ARGUMENT, not a global, so the program's
|
|
8
|
+
* `globalThis` is empty and the seam is a value it was handed rather than a name it can reach.
|
|
9
|
+
*
|
|
10
|
+
* MEASURED HERE, at ses@2.3.0 on node v26.7.0, rather than assumed:
|
|
11
|
+
* inside a Compartment `Date.now()` and `Math.random()` THROW in secure mode; `process` is
|
|
12
|
+
* undefined; `globalThis` has 0 own keys; and
|
|
13
|
+
* `(function(){}).constructor("return typeof process")()` throws
|
|
14
|
+
* "Function.prototype.constructor is not a valid constructor"
|
|
15
|
+
* confinement, not hiding `({}).constructor === Object` is still true, deliberately: the program
|
|
16
|
+
* shares the realm's intrinsics, it just cannot reach out of it
|
|
17
|
+
* the START compartment KEEPS Date.now, Math.random and process - which is what lets the host
|
|
18
|
+
* half of this thread (the journal, the effect path, the handler) work
|
|
19
|
+
* normally around a program that cannot touch any of them
|
|
20
|
+
*
|
|
21
|
+
* WHAT IS NOT HERE, on purpose: no wall-clock timeout, no `terminate()` on a deadline. A thread
|
|
22
|
+
* killed mid-effect leaves a journal saying a step is pending and nothing that can settle it. The
|
|
23
|
+
* step budget (L4013) and the shared stop flag are the only two things that end a run.
|
|
24
|
+
*/
|
|
25
|
+
import "ses";
|
|
26
|
+
//# sourceMappingURL=worker-entry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker-entry.d.ts","sourceRoot":"","sources":["../../src/engine/worker-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,KAAK,CAAC"}
|