@cotal-ai/lang 0.37.0 → 0.39.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 +6 -4
- package/dist/effects.d.ts +48 -0
- package/dist/effects.d.ts.map +1 -1
- package/dist/effects.js +81 -0
- package/dist/effects.js.map +1 -1
- package/dist/engine/bridge.d.ts.map +1 -1
- package/dist/engine/bridge.js +9 -1
- package/dist/engine/bridge.js.map +1 -1
- package/dist/engine/ctx.js +2 -0
- package/dist/engine/ctx.js.map +1 -1
- package/dist/engine/worker-entry.js +1 -0
- package/dist/engine/worker-entry.js.map +1 -1
- package/dist/engine/worker.d.ts +4 -2
- package/dist/engine/worker.d.ts.map +1 -1
- package/dist/engine/worker.js.map +1 -1
- package/dist/errors.d.ts +2 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +6 -0
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/interpret.d.ts.map +1 -1
- package/dist/interpret.js +2 -1
- package/dist/interpret.js.map +1 -1
- package/dist/journal.d.ts +35 -2
- package/dist/journal.d.ts.map +1 -1
- package/dist/journal.js +56 -2
- package/dist/journal.js.map +1 -1
- package/dist/perform.d.ts.map +1 -1
- package/dist/perform.js +113 -8
- package/dist/perform.js.map +1 -1
- package/dist/sim.d.ts +28 -19
- package/dist/sim.d.ts.map +1 -1
- package/dist/sim.js +104 -30
- package/dist/sim.js.map +1 -1
- package/package.json +2 -2
package/dist/sim.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* simulator that invents a plausible turn result is a simulator that green-lights broken programs,
|
|
11
11
|
* which is worse than having no simulator at all.
|
|
12
12
|
*/
|
|
13
|
-
import { EffectError } from "./effects.js";
|
|
13
|
+
import { Cancelled, EffectError, askSchemaShape, conformsToAskSchema } from "./effects.js";
|
|
14
14
|
import { parseDuration } from "./duration.js";
|
|
15
15
|
import { stepKeyString } from "./keys.js";
|
|
16
16
|
export class SimUnscriptedError extends Error {
|
|
@@ -23,27 +23,15 @@ export class SimUnscriptedError extends Error {
|
|
|
23
23
|
this.name = "SimUnscriptedError";
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
/**
|
|
27
|
-
* The simulation handler.
|
|
28
|
-
*
|
|
29
|
-
* Every effect resolves from the script or fails loudly. Sleeps are instant and advance the
|
|
30
|
-
* virtual clock by the duration the program asked for, so a program that waits four hours is
|
|
31
|
-
* tested in microseconds without pretending the wait did not happen.
|
|
32
|
-
*
|
|
33
|
-
* ONE clock, advanced in ask order — deliberately, and worth saying here because this file is
|
|
34
|
-
* where a reader would conclude otherwise: concurrent branches do NOT get independent virtual
|
|
35
|
-
* time. Two racing sleeps advance the same clock as their requests arrive, so under simulation a
|
|
36
|
-
* race is decided by ask order (then declaration order), not by which duration is shorter. The
|
|
37
|
-
* run clocks (`RunClock`, per branch) sit above this and stay per-branch; it is the TIMEBASE the
|
|
38
|
-
* simulator feeds them that is shared. A live handler with real waiting behaves differently, and
|
|
39
|
-
* `scopes.smoke` section 1b is the cell that pins the difference.
|
|
40
|
-
*/
|
|
41
26
|
export class SimHandler {
|
|
42
27
|
script;
|
|
43
28
|
virtualNow;
|
|
44
29
|
occurrences = new Map();
|
|
45
30
|
consumed = [];
|
|
46
31
|
agents = new Map();
|
|
32
|
+
parked = [];
|
|
33
|
+
parkSeq = 0;
|
|
34
|
+
pumpScheduled = false;
|
|
47
35
|
constructor(script = {}) {
|
|
48
36
|
this.script = script;
|
|
49
37
|
this.virtualNow = script.clock?.start ?? 0;
|
|
@@ -51,12 +39,72 @@ export class SimHandler {
|
|
|
51
39
|
now() {
|
|
52
40
|
return this.virtualNow;
|
|
53
41
|
}
|
|
54
|
-
/** Advance virtual time.
|
|
42
|
+
/** Advance virtual time immediately. The timed effects go through the event queue instead. */
|
|
55
43
|
advance(ms) {
|
|
56
44
|
this.virtualNow += ms;
|
|
57
45
|
}
|
|
58
|
-
|
|
59
|
-
|
|
46
|
+
/**
|
|
47
|
+
* Park a timed effect until the queue delivers its wake. The wake is computed from the clock
|
|
48
|
+
* at dispatch, which by the pump's invariant is the dispatching branch's own time.
|
|
49
|
+
*/
|
|
50
|
+
timed(ms, ctx) {
|
|
51
|
+
return new Promise((resolve, reject) => {
|
|
52
|
+
if (ctx.signal.cancelled) {
|
|
53
|
+
reject(new Cancelled(ctx.signal.reason ?? "cancelled"));
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const event = {
|
|
57
|
+
wake: this.virtualNow + ms,
|
|
58
|
+
seq: this.parkSeq++,
|
|
59
|
+
done: false,
|
|
60
|
+
deliver: () => {
|
|
61
|
+
if (event.done)
|
|
62
|
+
return;
|
|
63
|
+
event.done = true;
|
|
64
|
+
this.virtualNow = Math.max(this.virtualNow, event.wake);
|
|
65
|
+
resolve();
|
|
66
|
+
},
|
|
67
|
+
cancel: (reason) => {
|
|
68
|
+
if (event.done)
|
|
69
|
+
return;
|
|
70
|
+
event.done = true;
|
|
71
|
+
reject(reason);
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
ctx.signal.onCancel((reason) => event.cancel(new Cancelled(reason)));
|
|
75
|
+
this.parked.push(event);
|
|
76
|
+
this.schedulePump();
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* One delivery per macrotask, with the microtask queue drained between: the delivered branch
|
|
81
|
+
* runs to its next park (or its settle) before the next pop, which is what keeps the clock a
|
|
82
|
+
* parking branch reads equal to that branch's own time.
|
|
83
|
+
*/
|
|
84
|
+
schedulePump() {
|
|
85
|
+
if (this.pumpScheduled)
|
|
86
|
+
return;
|
|
87
|
+
this.pumpScheduled = true;
|
|
88
|
+
setImmediate(() => {
|
|
89
|
+
this.pumpScheduled = false;
|
|
90
|
+
let next;
|
|
91
|
+
for (const e of this.parked) {
|
|
92
|
+
if (e.done)
|
|
93
|
+
continue;
|
|
94
|
+
if (next === undefined || e.wake < next.wake || (e.wake === next.wake && e.seq < next.seq))
|
|
95
|
+
next = e;
|
|
96
|
+
}
|
|
97
|
+
next?.deliver();
|
|
98
|
+
for (let i = this.parked.length - 1; i >= 0; i--) {
|
|
99
|
+
if (this.parked[i].done)
|
|
100
|
+
this.parked.splice(i, 1);
|
|
101
|
+
}
|
|
102
|
+
if (this.parked.length > 0)
|
|
103
|
+
this.schedulePump();
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
timedBy(spec, fallback, ctx) {
|
|
107
|
+
return this.timed(parseDuration(spec ?? fallback), ctx);
|
|
60
108
|
}
|
|
61
109
|
/** Which occurrence of this (table, name) we are on, counted per simulated run. */
|
|
62
110
|
nextOccurrence(table, name) {
|
|
@@ -114,14 +162,40 @@ export class SimHandler {
|
|
|
114
162
|
async turn(_req, ctx) {
|
|
115
163
|
const scripted = this.resolve("turns", this.script.turns, ctx);
|
|
116
164
|
await ctx.bind({ simGoal: stepKeyString(ctx.key) });
|
|
117
|
-
this.
|
|
165
|
+
await this.timedBy(this.script.clock?.turn, "5m", ctx);
|
|
118
166
|
return { ...scripted, at: this.virtualNow };
|
|
119
167
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
168
|
+
/**
|
|
169
|
+
* The one effect with a reply contract. The request's schema is read as the shorthand
|
|
170
|
+
* (`askSchemaShape`), and every scripted reply is checked against it: a non-conforming reply
|
|
171
|
+
* consumes one attempt, one scripted occurrence, and one reply's worth of virtual time, and
|
|
172
|
+
* running out of attempts reports L4006, exactly as a production handler must. An unreadable
|
|
173
|
+
* schema is refused (L4022) rather than skipped, because a schema the handler cannot read and
|
|
174
|
+
* silently ignores is a contract the program believes in and nobody checks. To exercise the
|
|
175
|
+
* exhaustion path, script at least as many replies as `attempts`: the simulator still never
|
|
176
|
+
* invents one, so a script that runs out first fails as L6001.
|
|
177
|
+
*/
|
|
178
|
+
async ask(req, ctx) {
|
|
179
|
+
const shape = askSchemaShape(req.schema);
|
|
180
|
+
if (shape === null) {
|
|
181
|
+
this.checkFault(ctx);
|
|
182
|
+
throw new EffectError("L4022", "ask-schema-unreadable", `L4022 Unreadable ask schema\n\n step ${stepKeyString(ctx.key)}\n\nThe schema is not the shorthand a reference handler enforces: a record mapping each field name to one of "string", "number", "boolean", "array", "record", "null".\n\nFix: write the shorthand, for example { steps: "array" }, or pass {} to accept any record.`);
|
|
183
|
+
}
|
|
184
|
+
const attempts = req.attempts ?? 1;
|
|
185
|
+
let bound = false;
|
|
186
|
+
for (let attempt = 1;; attempt++) {
|
|
187
|
+
const value = this.resolve("asks", this.script.asks, ctx);
|
|
188
|
+
if (!bound) {
|
|
189
|
+
await ctx.bind({ simGoal: stepKeyString(ctx.key) });
|
|
190
|
+
bound = true;
|
|
191
|
+
}
|
|
192
|
+
await this.timedBy(this.script.clock?.ask, "1m", ctx);
|
|
193
|
+
if (conformsToAskSchema(value, shape))
|
|
194
|
+
return value;
|
|
195
|
+
if (attempt >= attempts) {
|
|
196
|
+
throw new EffectError("L4006", "ask-nonconforming", `L4006 ask never produced a conforming record\n\n step ${stepKeyString(ctx.key)}\n\n${attempts} repl${attempts === 1 ? "y was" : "ies were"} checked against the schema and none conformed.\n\nFix: script a reply that matches the schema, widen the schema, or raise attempts.`);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
125
199
|
}
|
|
126
200
|
/**
|
|
127
201
|
* Reports WHAT HAPPENED and never whether it throws. A script says `resolved` or `expired`; the
|
|
@@ -131,7 +205,7 @@ export class SimHandler {
|
|
|
131
205
|
async checkpoint(_req, ctx) {
|
|
132
206
|
const scripted = this.resolve("checkpoints", this.script.checkpoints, ctx);
|
|
133
207
|
await ctx.bind({ simCheckpoint: stepKeyString(ctx.key) });
|
|
134
|
-
this.
|
|
208
|
+
await this.timedBy(this.script.clock?.checkpoint, "1m", ctx);
|
|
135
209
|
if (scripted.status === "expired")
|
|
136
210
|
return { outcome: "expired", at: this.virtualNow };
|
|
137
211
|
return {
|
|
@@ -142,19 +216,19 @@ export class SimHandler {
|
|
|
142
216
|
at: this.virtualNow,
|
|
143
217
|
};
|
|
144
218
|
}
|
|
145
|
-
/** Instant: the
|
|
219
|
+
/** Instant in wall time: the sleep parks at its wake and the queue delivers it in order. */
|
|
146
220
|
async sleep(req, ctx) {
|
|
147
221
|
this.checkFault(ctx);
|
|
148
|
-
this.
|
|
222
|
+
await this.timed(parseDuration(req.duration), ctx);
|
|
149
223
|
return null;
|
|
150
224
|
}
|
|
151
225
|
async wait(req, ctx) {
|
|
152
226
|
const value = this.resolve("events", this.script.events, ctx);
|
|
153
227
|
// A scripted null is a timeout, and a timeout consumes the whole timeout budget.
|
|
154
228
|
if (value === null && req.timeout !== undefined)
|
|
155
|
-
this.
|
|
229
|
+
await this.timed(parseDuration(req.timeout), ctx);
|
|
156
230
|
else
|
|
157
|
-
this.
|
|
231
|
+
await this.timedBy(this.script.clock?.wait, "1m", ctx);
|
|
158
232
|
return value;
|
|
159
233
|
}
|
|
160
234
|
async notify(_req, ctx) {
|
package/dist/sim.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sim.js","sourceRoot":"","sources":["../src/sim.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAoBH,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"sim.js","sourceRoot":"","sources":["../src/sim.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAoBH,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAC3F,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AA4C1C,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAEhC;IACA;IAFX,YACW,IAAY,EACZ,OAAe,EACxB,OAAe;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AO,GAAG,CAAC;IACb,CAAC;IAED,wEAAwE;IACxE,SAAS;QACP,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cotal-ai/lang",
|
|
3
3
|
"description": "cotal-lang: the restricted-JS workflow language. Parser and validator, the effect interface, the step journal, the interpreter, and the simulation handler. Depends on nothing else in the repo.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.39.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"scripts": {
|
|
35
35
|
"typecheck": "tsc -p tsconfig.check.json",
|
|
36
36
|
"build": "tsc -p tsconfig.json",
|
|
37
|
-
"test": "pnpm run build:emit && tsx smoke/grammar.smoke.ts && tsx smoke/keys.smoke.ts && tsx smoke/journal.smoke.ts && tsx smoke/pins.smoke.ts && tsx smoke/scopes.smoke.ts && tsx smoke/sim.smoke.ts && tsx smoke/interpret.smoke.ts && tsx smoke/fuel.smoke.ts && tsx smoke/dryrun.smoke.ts && tsx smoke/examples.smoke.ts && tsx smoke/options.smoke.ts && tsx smoke/notify-fact.smoke.ts && tsx smoke/migrate.smoke.ts && tsx smoke/semantics.smoke.ts && tsx smoke/surface.smoke.ts && tsx smoke/transform.smoke.ts && tsx smoke/differential.smoke.ts && tsx smoke/engine.smoke.ts",
|
|
37
|
+
"test": "pnpm run build:emit && tsx smoke/grammar.smoke.ts && tsx smoke/keys.smoke.ts && tsx smoke/journal.smoke.ts && tsx smoke/fuzz-journal.smoke.ts && tsx smoke/pins.smoke.ts && tsx smoke/scopes.smoke.ts && tsx smoke/sim.smoke.ts && tsx smoke/interpret.smoke.ts && tsx smoke/fuel.smoke.ts && tsx smoke/dryrun.smoke.ts && tsx smoke/examples.smoke.ts && tsx smoke/options.smoke.ts && tsx smoke/notify-fact.smoke.ts && tsx smoke/migrate.smoke.ts && tsx smoke/semantics.smoke.ts && tsx smoke/surface.smoke.ts && tsx smoke/transform.smoke.ts && tsx smoke/differential.smoke.ts && tsx smoke/engine.smoke.ts",
|
|
38
38
|
"build:emit": "tsc -p tsconfig.json --noCheck"
|
|
39
39
|
}
|
|
40
40
|
}
|