@githolon/testing 0.46.0 → 0.47.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/package.json +1 -1
- package/vendor/engine/engine.mjs +12 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@githolon/testing",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.47.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "@githolon/testing — law TDD for Nomos domains: boot the REAL engine plane in-process (the exact machinery every cloud DO, heavy container and web client runs), dispatch directives, assert rows, assert TYPED REFUSALS, fork for what-ifs — fully offline inside vitest.",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
package/vendor/engine/engine.mjs
CHANGED
|
@@ -129,7 +129,8 @@ export async function createEngine({ wasmModule, bootstrapPkg, nomosPkg, replica
|
|
|
129
129
|
root.set("ws", new Directory(new Map()));
|
|
130
130
|
const preopen = new PreopenDirectory("/work", root);
|
|
131
131
|
const STDERR = [];
|
|
132
|
-
const
|
|
132
|
+
const pushStderr = (l) => { if (STDERR.length >= 500) STDERR.splice(0, STDERR.length - 499); STDERR.push(l); };
|
|
133
|
+
const fds = [new OpenFile(new File([])), ConsoleStdout.lineBuffered(() => {}), ConsoleStdout.lineBuffered(pushStderr), preopen];
|
|
133
134
|
const wasi = new WASI(["wasm_git_holon", "reactor"], [], fds, { debug: false });
|
|
134
135
|
const inst = await WebAssembly.instantiate(wasmModule, { wasi_snapshot_preview1: wasi.wasiImport });
|
|
135
136
|
const code = wasi.start(inst);
|
|
@@ -1346,6 +1347,16 @@ export function currentLaw(eng, ws) {
|
|
|
1346
1347
|
return out.keyMap || {};
|
|
1347
1348
|
}
|
|
1348
1349
|
|
|
1350
|
+
/** INSTALLED-LAW META-READ — kernel-folded control-plane state, not tenant projection. */
|
|
1351
|
+
export function installedLaw(eng, ws) {
|
|
1352
|
+
return JSON.parse(call(eng.ex, "query", { repoArg: repoArgOf(ws), workspace: ws, queryBytes: b64Json({ op: "installedLaw" }), branch: BRANCH }, eng.STDERR));
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
/** INSTALLED PACKAGE META-READ — package bytes from folded policy/domain-installation state. */
|
|
1356
|
+
export function domainPackage(eng, ws, hash) {
|
|
1357
|
+
return JSON.parse(call(eng.ex, "query", { repoArg: repoArgOf(ws), workspace: ws, queryBytes: b64Json({ op: "domainPackage", hash }), branch: BRANCH }, eng.STDERR));
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1349
1360
|
/** THE CAPABILITY DECLARATION READ (Full-A — capability_marketplace.md §4): the holon
|
|
1350
1361
|
* surfaces every CURRENTLY-INSTALLED domain's `nomosCapabilities` law key (the impure-
|
|
1351
1362
|
* capability quartets sealed into the law). The deploy lane relays these as a "declared —
|