@hmharness/cognitive 0.23.33 → 0.23.35
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/dist/rlm-sandbox.js +17 -17
- package/dist/world-model.d.ts +9 -1
- package/dist/world-model.js +9 -1
- package/package.json +31 -31
package/dist/rlm-sandbox.js
CHANGED
|
@@ -29,23 +29,23 @@ import { Worker } from 'node:worker_threads';
|
|
|
29
29
|
* spawn). What remains impossible to block without a per-worker
|
|
30
30
|
* permission model is declared in SANDBOX_BYPASS_VECTORS below — pinned
|
|
31
31
|
* by the red-team test so a silent hole can never masquerade as covered. */
|
|
32
|
-
const WORKER_SOURCE = `
|
|
33
|
-
const { parentPort, workerData } = require('node:worker_threads');
|
|
34
|
-
(async () => {
|
|
35
|
-
// hardening pass: strip escape globals BEFORE evaluating any user code
|
|
36
|
-
try { delete globalThis.process; } catch { /* non-configurable: shadow instead below */ }
|
|
37
|
-
try { globalThis.Worker = undefined; } catch { }
|
|
38
|
-
try { globalThis.fetch = undefined; } catch { }
|
|
39
|
-
try { globalThis.WebSocket = undefined; } catch { }
|
|
40
|
-
const ctx = Object.freeze({ vars: Object.freeze({ ...workerData.vars }), meta: Object.freeze({ ...workerData.meta }) });
|
|
41
|
-
try {
|
|
42
|
-
const fn = new Function('ctx', 'process', 'require', 'fetch', 'Worker', 'WebSocket', '"use strict";return (async()=>{' + workerData.code + '})();');
|
|
43
|
-
const value = await fn(ctx, undefined, undefined, undefined, undefined, undefined);
|
|
44
|
-
parentPort.postMessage({ ok: true, value });
|
|
45
|
-
} catch (err) {
|
|
46
|
-
parentPort.postMessage({ ok: false, error: { code: 'E_EVAL', message: err && err.message ? String(err.message).slice(0, 500) : String(err).slice(0, 500) } });
|
|
47
|
-
}
|
|
48
|
-
})();
|
|
32
|
+
const WORKER_SOURCE = `
|
|
33
|
+
const { parentPort, workerData } = require('node:worker_threads');
|
|
34
|
+
(async () => {
|
|
35
|
+
// hardening pass: strip escape globals BEFORE evaluating any user code
|
|
36
|
+
try { delete globalThis.process; } catch { /* non-configurable: shadow instead below */ }
|
|
37
|
+
try { globalThis.Worker = undefined; } catch { }
|
|
38
|
+
try { globalThis.fetch = undefined; } catch { }
|
|
39
|
+
try { globalThis.WebSocket = undefined; } catch { }
|
|
40
|
+
const ctx = Object.freeze({ vars: Object.freeze({ ...workerData.vars }), meta: Object.freeze({ ...workerData.meta }) });
|
|
41
|
+
try {
|
|
42
|
+
const fn = new Function('ctx', 'process', 'require', 'fetch', 'Worker', 'WebSocket', '"use strict";return (async()=>{' + workerData.code + '})();');
|
|
43
|
+
const value = await fn(ctx, undefined, undefined, undefined, undefined, undefined);
|
|
44
|
+
parentPort.postMessage({ ok: true, value });
|
|
45
|
+
} catch (err) {
|
|
46
|
+
parentPort.postMessage({ ok: false, error: { code: 'E_EVAL', message: err && err.message ? String(err.message).slice(0, 500) : String(err).slice(0, 500) } });
|
|
47
|
+
}
|
|
48
|
+
})();
|
|
49
49
|
`;
|
|
50
50
|
/**
|
|
51
51
|
* HONEST threat model: escape vectors the worker CANNOT block today (they
|
package/dist/world-model.d.ts
CHANGED
|
@@ -194,7 +194,15 @@ export declare class WorldModel {
|
|
|
194
194
|
get transitionsStore(): TransitionStore;
|
|
195
195
|
/** WM checkpoint: a serializable snapshot that fromCheckpoint() can restore
|
|
196
196
|
* exactly — the state, the rolling accuracy counters, and the transitions
|
|
197
|
-
* (the replay/revision evidence, capped to the most recent N).
|
|
197
|
+
* (the replay/revision evidence, capped to the most recent N).
|
|
198
|
+
*
|
|
199
|
+
* RESUME CURSOR CONTRACT (v0.29 soak finding, 2026-10-15): the restoring
|
|
200
|
+
* runtime must replay the durable log FROM THE CHECKPOINT POSITION, never
|
|
201
|
+
* from zero — replaying already-applied updates double-counts evidence and
|
|
202
|
+
* drifts beliefs (measured: confidence 0.8055 vs 0.8571 after one
|
|
203
|
+
* crash+full-replay cycle; scripts/longrun-soak.mts F1/F2 pins both the
|
|
204
|
+
* trap and the guarded-equivalence proof). `state.version` is a usable
|
|
205
|
+
* cursor: updates applied since snapshot = version - checkpointed version. */
|
|
198
206
|
checkpoint(maxTransitions?: number): string;
|
|
199
207
|
static fromCheckpoint(json: string): WorldModel;
|
|
200
208
|
/** Stale-belief detection (0.30): beliefs whose last confirming evidence is
|
package/dist/world-model.js
CHANGED
|
@@ -302,7 +302,15 @@ export class WorldModel {
|
|
|
302
302
|
/* -------- Long-running sessions (weekly pack 0.30 P2 infrastructure) -------- */
|
|
303
303
|
/** WM checkpoint: a serializable snapshot that fromCheckpoint() can restore
|
|
304
304
|
* exactly — the state, the rolling accuracy counters, and the transitions
|
|
305
|
-
* (the replay/revision evidence, capped to the most recent N).
|
|
305
|
+
* (the replay/revision evidence, capped to the most recent N).
|
|
306
|
+
*
|
|
307
|
+
* RESUME CURSOR CONTRACT (v0.29 soak finding, 2026-10-15): the restoring
|
|
308
|
+
* runtime must replay the durable log FROM THE CHECKPOINT POSITION, never
|
|
309
|
+
* from zero — replaying already-applied updates double-counts evidence and
|
|
310
|
+
* drifts beliefs (measured: confidence 0.8055 vs 0.8571 after one
|
|
311
|
+
* crash+full-replay cycle; scripts/longrun-soak.mts F1/F2 pins both the
|
|
312
|
+
* trap and the guarded-equivalence proof). `state.version` is a usable
|
|
313
|
+
* cursor: updates applied since snapshot = version - checkpointed version. */
|
|
306
314
|
checkpoint(maxTransitions = 1000) {
|
|
307
315
|
return JSON.stringify({
|
|
308
316
|
kind: 'hmharness-world-model-checkpoint',
|
package/package.json
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@hmharness/cognitive",
|
|
3
|
-
"version": "0.23.
|
|
4
|
-
"description": "hmharness Cognitive OS core: Environment protocol, World Model, Goal system, Exploration, RLM runtime, five-layer memory, Skill Compiler, Continual Learning control plane, Evolution 2.0 governance, Multi-Agent topology, Transfer lab and GeneralBench schema. Cognitive strategy layer per the HMH Cognitive OS blueprint (2026-09).",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "dist/index.js",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": {
|
|
9
|
-
"types": "./dist/index.d.ts",
|
|
10
|
-
"default": "./dist/index.js"
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
"types": "dist/index.d.ts",
|
|
14
|
-
"scripts": {
|
|
15
|
-
"build": "tsc -p tsconfig.build.json"
|
|
16
|
-
},
|
|
17
|
-
"files": [
|
|
18
|
-
"dist"
|
|
19
|
-
],
|
|
20
|
-
"license": "MIT",
|
|
21
|
-
"repository": {
|
|
22
|
-
"type": "git",
|
|
23
|
-
"url": "git+https://github.com/swsgbl/hmharness.git"
|
|
24
|
-
},
|
|
25
|
-
"engines": {
|
|
26
|
-
"node": ">=22"
|
|
27
|
-
},
|
|
28
|
-
"dependencies": {
|
|
29
|
-
"@hmharness/kernel": "0.23.
|
|
30
|
-
}
|
|
31
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@hmharness/cognitive",
|
|
3
|
+
"version": "0.23.35",
|
|
4
|
+
"description": "hmharness Cognitive OS core: Environment protocol, World Model, Goal system, Exploration, RLM runtime, five-layer memory, Skill Compiler, Continual Learning control plane, Evolution 2.0 governance, Multi-Agent topology, Transfer lab and GeneralBench schema. Cognitive strategy layer per the HMH Cognitive OS blueprint (2026-09).",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"default": "./dist/index.js"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"types": "dist/index.d.ts",
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc -p tsconfig.build.json"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/swsgbl/hmharness.git"
|
|
24
|
+
},
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=22"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@hmharness/kernel": "0.23.35"
|
|
30
|
+
}
|
|
31
|
+
}
|