Kevin Crutt commited on
Commit
95bc522
·
1 Parent(s): e2f67ff

liris: add mlc engine wiring increment

Browse files
docs/LIRIS-MLC-ENGINE-WIRING-INCREMENT-2026-06-14.hbp ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ LIRISMLCEWIREHDR|host=liris|date=2026-06-14|topic=C036-live-engine-wiring-increment-1-descriptor-matrix|responds_to=OP-JESSE-continue-ask-fabric-drive-engine-wiring-incrementally+acer-e2f67ff-LAW-SLICE-ENGINE-cosign-seal|fabric_request=council-q-1781430832486-2x1l0p|tag=PROVEN-HELD-SAFE|json=0
2
+ LIRISMLCEWIREBOUNDARY|fabric_answer=bus-ack-received-verdict-not-yet-ranked-at-build-time|rule=no-blind-process-launch-no-live-engine-call|C036_state=OPEN-live-engine-not-launched|increment=descriptor-only-wiring-matrix-over-existing-MLC-lines|process_launch=0|tag=HELD-SAFE|json=0
3
+ LIRISMLCEWIRETOOL|tool=tools/behcs/mlc-engine-wiring-increment.mjs|source=tools/behcs/mlc-line-watcher.mjs|maps=MLCLINE-to-MTP+HRM+GNN+Fischer+DRAFT_STANDIN+Mamba-sequence-block+AoT-path-handles|gate=DEFER_TO_FABRIC_VERDICT_AND_DAEMON_CONTRACT|tag=PROVEN-CODE|json=0
4
+ LIRISMLCEWIRELANES|mtp=MTP_FIELD_PROXY-descriptor|hrm=HRM_RECURRENCE_ROUTER-descriptor|gnn=GNN_EDGE_HANDLE-descriptor|fischer=DRAFT_STANDIN_NOT_FISCHER-no-live-4794|mamba=SEQUENCE_BLOCK_HANDLE-only|aot=PATH_DECOMPOSITION_HANDLE-only|json=0
5
+ LIRISMLCEWIREPROOF|selftest=8of8|unit=7of7|catalog=7of7|lattice=9of9|suite=282of282|catalog_wired=tools/behcs/fabric-agent-preload-catalog.mjs|safety=no_spawn+no_fetch+no_write+no_mint+no_live_engine+process_launch_0|tag=PROVEN-LOCAL|json=0
6
+ LIRISMLCEWIREFTR|next=ask-fabric-again-for-ranked-live-daemon-contract-or-next-held-safe-frontier|if-fabric-unavailable=do-not-launch-engines-invented-from-plan|C036_remaining=live-MTP-HRM-Fischer-Mamba-engine-crank-still-open|json=0
docs/LIRIS-MLC-ENGINE-WIRING-INCREMENT-2026-06-14.hbp.sha256 ADDED
@@ -0,0 +1 @@
 
 
1
+ 2A2AF8BAF02B3B993CC3FC535DC91CA7012DF5CB1E6830695C906AF90F0FCAB2 LIRIS-MLC-ENGINE-WIRING-INCREMENT-2026-06-14.hbp
tests/fabric-agent-preload-catalog.unit.test.mjs CHANGED
@@ -24,6 +24,7 @@ test('preload catalog includes the laws, tools, roles, and cadence agents need',
24
  assert.ok(TOOLS.some((t) => t.id === 'pixel-room-handle'));
25
  assert.ok(TOOLS.some((t) => t.id === 'github-live-pid-reconcile'));
26
  assert.ok(TOOLS.some((t) => t.id === 'catch-count-ledger' && t.gate.includes('md-final-release-claims-held')));
 
27
  assert.ok(ROLES.some((r) => r.id === 'flywheel' && r.must_do.includes('compare-to-acer-local-truth')));
28
  assert.ok(WORKFLOW.join('-').includes('memory-index-plan'));
29
  assert.equal(toolById('token-cube-catalog-binder').gate, 'mint-write-live-DEFER_TO_OPERATOR');
 
24
  assert.ok(TOOLS.some((t) => t.id === 'pixel-room-handle'));
25
  assert.ok(TOOLS.some((t) => t.id === 'github-live-pid-reconcile'));
26
  assert.ok(TOOLS.some((t) => t.id === 'catch-count-ledger' && t.gate.includes('md-final-release-claims-held')));
27
+ assert.ok(TOOLS.some((t) => t.id === 'mlc-engine-wiring-increment' && t.gate.includes('process_launch-0')));
28
  assert.ok(ROLES.some((r) => r.id === 'flywheel' && r.must_do.includes('compare-to-acer-local-truth')));
29
  assert.ok(WORKFLOW.join('-').includes('memory-index-plan'));
30
  assert.equal(toolById('token-cube-catalog-binder').gate, 'mint-write-live-DEFER_TO_OPERATOR');
tests/fabric-agent-preload-catalog.unit.test.mjs.sha256 CHANGED
@@ -1 +1 @@
1
- 0880485F93557EB95DF270F9519653B3B27BDFFB50A9F8AB8FB0ED23019C25AF fabric-agent-preload-catalog.unit.test.mjs
 
1
+ 3282D2D966E604DCFD640D70144C1629735B1C19F1464E2A133D75206C4C14B2 fabric-agent-preload-catalog.unit.test.mjs
tests/mlc-engine-wiring-increment.unit.test.mjs ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import assert from 'node:assert/strict';
2
+ import { readFileSync } from 'node:fs';
3
+ import { dirname, join } from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+ import test from 'node:test';
6
+
7
+ import {
8
+ ENGINE_LANES,
9
+ FISCHER_SCORE_KIND,
10
+ LIVE_GATE,
11
+ WIRING_ID,
12
+ buildWiring,
13
+ emitRows,
14
+ selfTest,
15
+ wireLine,
16
+ } from '../tools/behcs/mlc-engine-wiring-increment.mjs';
17
+
18
+ const repo = dirname(dirname(fileURLToPath(import.meta.url)));
19
+
20
+ test('self-test passes', () => {
21
+ assert.equal(selfTest().ok, true);
22
+ });
23
+
24
+ test('engine lanes cover MTP, HRM, GNN, Fischer, Mamba, and AoT', () => {
25
+ assert.deepEqual(ENGINE_LANES.map((lane) => lane.id), ['mtp', 'hrm', 'gnn', 'fischer', 'mamba', 'aot']);
26
+ assert.ok(ENGINE_LANES.every((lane) => lane.state && lane.source));
27
+ });
28
+
29
+ test('descriptor build maps MLC lines without launching live engines', () => {
30
+ const built = buildWiring({ nodes: 18, strides: [1, 2], prefix: 'WIRETEST' });
31
+ assert.equal(built.tool, WIRING_ID);
32
+ assert.equal(built.summary.entries, 33);
33
+ assert.equal(built.summary.all_no_launch, true);
34
+ assert.equal(built.summary.c036_status, 'OPEN_LIVE_ENGINE_NOT_LAUNCHED');
35
+ assert.ok(built.entries.every((entry) => entry.process_launch === 0 && entry.live_launch_gate === LIVE_GATE));
36
+ });
37
+
38
+ test('Fischer/Mamba/AoT are handles only, not live execution', () => {
39
+ const built = buildWiring({ nodes: 14, strides: [1] });
40
+ assert.equal(FISCHER_SCORE_KIND, 'DRAFT_STANDIN_NOT_FISCHER');
41
+ assert.ok(built.entries.every((entry) => entry.fischer_score_kind === 'DRAFT_STANDIN_NOT_FISCHER'));
42
+ assert.ok(built.entries.every((entry) => entry.mamba_sequence_block.startsWith('block_')));
43
+ assert.ok(built.entries.every((entry) => ['OBSERVE_NEXT', 'RECURSE_LOCAL', 'DECOMPOSE_PATH', 'HOLD_FOR_SUPERVISOR'].includes(entry.aot_step)));
44
+ });
45
+
46
+ test('wireLine is total and sanitizes HBP delimiters', () => {
47
+ const hostile = {
48
+ from: { pid: 'from|bad\nrow' },
49
+ to: { pid: 'to\rbad' },
50
+ watcher: 'mtp_field_proxy',
51
+ fischer_move: 'BRIDGE|INJECT',
52
+ sequence_block: 'block_0\nX',
53
+ aot_step: 'DECOMPOSE_PATH',
54
+ };
55
+ const wired = wireLine(hostile);
56
+ assert.equal(wired.primary_engine, 'mtp');
57
+ assert.equal(/[|\r\n]/.test(wired.from_pid), false);
58
+ assert.doesNotThrow(() => wireLine(null));
59
+ assert.doesNotThrow(() => wireLine({ get from() { throw new Error('boom'); } }));
60
+ });
61
+
62
+ test('emitted rows are HBP-only and carry the live-launch gate', () => {
63
+ const rows = emitRows({ nodes: 12, cap: 5, fabric_request_id: 'council-q-1781430832486-2x1l0p' });
64
+ assert.ok(rows.every((row) => row.endsWith('|json=0') && !/[{\r\n]/.test(row)));
65
+ assert.ok(rows.some((row) => row.startsWith('MLCEWIREGATE|') && row.includes('C036_status=OPEN_LIVE_ENGINE_NOT_LAUNCHED')));
66
+ assert.ok(rows.some((row) => row.startsWith('MLCEWIRELANES|') && row.includes('fischer_score_kind=DRAFT_STANDIN_NOT_FISCHER')));
67
+ });
68
+
69
+ test('tool imports no spawn/write/network/live engine capability', () => {
70
+ const src = readFileSync(join(repo, 'tools/behcs/mlc-engine-wiring-increment.mjs'), 'utf8');
71
+ assert.equal(/child_process|spawnSync|\.spawn\(|execSync|writeFileSync|appendFileSync|fetch\(|http\.request|https\.request|Start-Process|Stop-Process/.test(src), false);
72
+ });
tests/mlc-engine-wiring-increment.unit.test.mjs.sha256 ADDED
@@ -0,0 +1 @@
 
 
1
+ 8FDB0D945FEC7462F6B56754AB8D51B777C85955CA7CFE2C206722EDA9185537 mlc-engine-wiring-increment.unit.test.mjs
tests/supervisor-collision-router.system.test.mjs CHANGED
@@ -97,6 +97,7 @@ const sealedFiles = [
97
  'docs/ACER-ATTACK-LIRIS-RECONCILE-EXPANSION-2026-06-13.hbp',
98
  'docs/LIRIS-CATCH-COUNT-LEDGER-2026-06-14.hbp',
99
  'docs/ACER-SLICE-ENGINE-COSIGN-MINT-2026-06-14.hbp',
 
100
  'docs/acer-ecosystem-fullbody-receipt-20260612.hbp',
101
  'docs/CLAIMSLEDGER-2026-06-12.hbp',
102
  'docs/CLAIMSGATE-PARITY-BASELINE-2026-06-12.hbp',
@@ -213,6 +214,7 @@ const sealedFiles = [
213
  'tools/behcs/pre-existence-graph-exporter.mjs',
214
  'tools/behcs/triad-nest-reference.mjs',
215
  'tools/behcs/mlc-line-watcher.mjs',
 
216
  'tools/behcs/omni-engine-loop.mjs',
217
  'tools/behcs/heal-envelope-emitter.mjs',
218
  'tools/behcs/route-health-baseline.mjs',
@@ -242,6 +244,7 @@ const sealedFiles = [
242
  'tests/pre-existence-graph-exporter.unit.test.mjs',
243
  'tests/triad-nest-reference.unit.test.mjs',
244
  'tests/mlc-line-watcher.unit.test.mjs',
 
245
  'tests/omni-engine-loop.unit.test.mjs',
246
  'tests/heal-envelope-emitter.unit.test.mjs',
247
  'tests/route-health-baseline.unit.test.mjs',
 
97
  'docs/ACER-ATTACK-LIRIS-RECONCILE-EXPANSION-2026-06-13.hbp',
98
  'docs/LIRIS-CATCH-COUNT-LEDGER-2026-06-14.hbp',
99
  'docs/ACER-SLICE-ENGINE-COSIGN-MINT-2026-06-14.hbp',
100
+ 'docs/LIRIS-MLC-ENGINE-WIRING-INCREMENT-2026-06-14.hbp',
101
  'docs/acer-ecosystem-fullbody-receipt-20260612.hbp',
102
  'docs/CLAIMSLEDGER-2026-06-12.hbp',
103
  'docs/CLAIMSGATE-PARITY-BASELINE-2026-06-12.hbp',
 
214
  'tools/behcs/pre-existence-graph-exporter.mjs',
215
  'tools/behcs/triad-nest-reference.mjs',
216
  'tools/behcs/mlc-line-watcher.mjs',
217
+ 'tools/behcs/mlc-engine-wiring-increment.mjs',
218
  'tools/behcs/omni-engine-loop.mjs',
219
  'tools/behcs/heal-envelope-emitter.mjs',
220
  'tools/behcs/route-health-baseline.mjs',
 
244
  'tests/pre-existence-graph-exporter.unit.test.mjs',
245
  'tests/triad-nest-reference.unit.test.mjs',
246
  'tests/mlc-line-watcher.unit.test.mjs',
247
+ 'tests/mlc-engine-wiring-increment.unit.test.mjs',
248
  'tests/omni-engine-loop.unit.test.mjs',
249
  'tests/heal-envelope-emitter.unit.test.mjs',
250
  'tests/route-health-baseline.unit.test.mjs',
tests/supervisor-collision-router.system.test.mjs.sha256 CHANGED
@@ -1 +1 @@
1
- 31E79A504AB11CECAF4C0A69BB697D38F15FDB7988E69CD10850EF8E95E19949 supervisor-collision-router.system.test.mjs
 
1
+ D661EEE6012782CDE87C9EE08335C539900569862E129A846164CE05ECFA7FA8 supervisor-collision-router.system.test.mjs
tools/behcs/fabric-agent-preload-catalog.hbp CHANGED
@@ -1,4 +1,4 @@
1
- FABPRELOADHDR|tool=fabric-agent-preload-catalog.v1|purpose=preload-agents-with-laws-routes-tools-gates-and-workflow-before-fabric-use|laws=8|routes=6|tools=6|emitters=3|levels=16|roles=4|json=0
2
  FABPRELOADLAW|laws=three-systems-LOGICAL-WAVE-FROZEN-BRAIN-REAL-FREE+law-of-three-mod3-lanes+yin-yang-mod2-real-logical+prime-parity-and-prime-mod3-are-load-bearing+quants-are-address-and-evidence-classes-not-raw-material+all-agent-artifact-system-addresses-get-PID-or-handle+slice-engine-law-fabric-is-frozen-position-space-until-spawner-pid-emits+live-control-and-mint-and-launch-defer-to-operator|json=0
3
  FABPRELOADWORKFLOW|cadence=memory-index-plan-memory-index-respond-execute-memory-index|operator_rule=respond-before-live-control-and-log-after-execute|json=0
4
  FABPRELOADSLICEENGINE|law=SLICE-ENGINE-LAW|scope=all-supervisor-operator-level-agents+SUP-HELM-AGT-L3-H8EF7+ASOLARIA-root-profile|rule=fabric-is-frozen-positional-slice-field-engine-drive-is-the-only-mover|materialization=spawner-PID-emits-then-PID_SIGNAL-to-AGENT_ROOM-to-GULP-to-ERASE|pid_registration=repo-side-HBP-receipt-until-live-office-ingest|cube_mint=operator-gated-runtime-action-not-implied-by-doc|engine_crank=operator-gated-RUN_HERMES_SPINDLE-or-equivalent|json=0
@@ -13,6 +13,7 @@ FABPRELOADTOOL|id=github-pid-register|path=tools/behcs/github-pid-register.mjs|p
13
  FABPRELOADTOOL|id=github-live-pid-reconcile|path=tools/behcs/github-live-pid-reconcile.mjs|provides=github-vs-live-office-snapshot-status|gate=unknown-PENDING-OFFICE-SNAPSHOT|tag=PROVEN+tool-level|json=0
14
  FABPRELOADTOOL|id=github-live-office-reconcile-expansion|path=tools/behcs/github-live-office-reconcile-expansion.mjs|provides=github-vs-live-726-office-alias-map|gate=descriptor-only-no-mint-no-cutover|tag=PROVEN+tool-level|json=0
15
  FABPRELOADTOOL|id=catch-count-ledger|path=tools/behcs/catch-count-ledger.mjs|provides=enumerable-bilateral-catch-ledger-open-closed-owner-status|gate=md-final-release-claims-held-until-open-partial-catches-close|tag=PROVEN+tool-level|json=0
 
16
  FABPRELOADTOOL|id=token-cube-catalog-binder|path=tools/behcs/token-cube-catalog-binder.mjs|provides=sha16-token-to-BH-address-draft-binding|gate=mint-write-live-DEFER_TO_OPERATOR|tag=PROVEN+tool-level|json=0
17
  FABPRELOADEMITTER|id=pid-emitter|process=PID-specific-emitter-envelope|route=send-json|before=preload-catalog+law-ack+connection-label|after=hookwall+gnn+ack-log|connection_label=PID-specific|json=0
18
  FABPRELOADEMITTER|id=hookwall|process=risk-and-governance-gate|route=send-json|before=operator-gates+role-forbidden-list|after=allow-or-defer-row|connection_label=PID-specific|json=0
 
1
+ FABPRELOADHDR|tool=fabric-agent-preload-catalog.v1|purpose=preload-agents-with-laws-routes-tools-gates-and-workflow-before-fabric-use|laws=8|routes=6|tools=7|emitters=3|levels=16|roles=4|json=0
2
  FABPRELOADLAW|laws=three-systems-LOGICAL-WAVE-FROZEN-BRAIN-REAL-FREE+law-of-three-mod3-lanes+yin-yang-mod2-real-logical+prime-parity-and-prime-mod3-are-load-bearing+quants-are-address-and-evidence-classes-not-raw-material+all-agent-artifact-system-addresses-get-PID-or-handle+slice-engine-law-fabric-is-frozen-position-space-until-spawner-pid-emits+live-control-and-mint-and-launch-defer-to-operator|json=0
3
  FABPRELOADWORKFLOW|cadence=memory-index-plan-memory-index-respond-execute-memory-index|operator_rule=respond-before-live-control-and-log-after-execute|json=0
4
  FABPRELOADSLICEENGINE|law=SLICE-ENGINE-LAW|scope=all-supervisor-operator-level-agents+SUP-HELM-AGT-L3-H8EF7+ASOLARIA-root-profile|rule=fabric-is-frozen-positional-slice-field-engine-drive-is-the-only-mover|materialization=spawner-PID-emits-then-PID_SIGNAL-to-AGENT_ROOM-to-GULP-to-ERASE|pid_registration=repo-side-HBP-receipt-until-live-office-ingest|cube_mint=operator-gated-runtime-action-not-implied-by-doc|engine_crank=operator-gated-RUN_HERMES_SPINDLE-or-equivalent|json=0
 
13
  FABPRELOADTOOL|id=github-live-pid-reconcile|path=tools/behcs/github-live-pid-reconcile.mjs|provides=github-vs-live-office-snapshot-status|gate=unknown-PENDING-OFFICE-SNAPSHOT|tag=PROVEN+tool-level|json=0
14
  FABPRELOADTOOL|id=github-live-office-reconcile-expansion|path=tools/behcs/github-live-office-reconcile-expansion.mjs|provides=github-vs-live-726-office-alias-map|gate=descriptor-only-no-mint-no-cutover|tag=PROVEN+tool-level|json=0
15
  FABPRELOADTOOL|id=catch-count-ledger|path=tools/behcs/catch-count-ledger.mjs|provides=enumerable-bilateral-catch-ledger-open-closed-owner-status|gate=md-final-release-claims-held-until-open-partial-catches-close|tag=PROVEN+tool-level|json=0
16
+ FABPRELOADTOOL|id=mlc-engine-wiring-increment|path=tools/behcs/mlc-engine-wiring-increment.mjs|provides=C036-increment-1-MTP-HRM-GNN-Fischer-Mamba-AoT-descriptor-wiring-matrix|gate=descriptor-only-process_launch-0-live-engine-launch-defer-to-fabric-verdict|tag=PROVEN+tool-level|json=0
17
  FABPRELOADTOOL|id=token-cube-catalog-binder|path=tools/behcs/token-cube-catalog-binder.mjs|provides=sha16-token-to-BH-address-draft-binding|gate=mint-write-live-DEFER_TO_OPERATOR|tag=PROVEN+tool-level|json=0
18
  FABPRELOADEMITTER|id=pid-emitter|process=PID-specific-emitter-envelope|route=send-json|before=preload-catalog+law-ack+connection-label|after=hookwall+gnn+ack-log|connection_label=PID-specific|json=0
19
  FABPRELOADEMITTER|id=hookwall|process=risk-and-governance-gate|route=send-json|before=operator-gates+role-forbidden-list|after=allow-or-defer-row|connection_label=PID-specific|json=0
tools/behcs/fabric-agent-preload-catalog.hbp.sha256 CHANGED
@@ -1 +1 @@
1
- F90947DA57548F51D3D52D0875735E95C18262532679EBCABF6061FF3B53D418 fabric-agent-preload-catalog.hbp
 
1
+ 576201ECB4042CED15B74241825CA7CC692CFFDBD9CF2E3FA69EB134CCE8BCE0 fabric-agent-preload-catalog.hbp
tools/behcs/fabric-agent-preload-catalog.mjs CHANGED
@@ -98,6 +98,12 @@ export const TOOLS = Object.freeze([
98
  provides: 'enumerable-bilateral-catch-ledger-open-closed-owner-status',
99
  gate: 'md-final-release-claims-held-until-open-partial-catches-close',
100
  }),
 
 
 
 
 
 
101
  Object.freeze({
102
  id: 'token-cube-catalog-binder',
103
  path: 'tools/behcs/token-cube-catalog-binder.mjs',
@@ -265,7 +271,8 @@ export function selfTest() {
265
  add('packet-lines-use-json-envelope', classifyPayloadForRoute({ route_id: 'send-json', payload_kind: 'operator-packet-lines' }) === 'ACCEPT_JSON_ENVELOPE');
266
  add('packet-lines-rejected-on-hbp-lane', classifyPayloadForRoute({ route_id: 'send-hbp', payload_kind: 'operator-packet-lines' }) === 'REJECT_WRONG_ROUTE');
267
  add('tools-include-room-and-pid', !!toolById('pixel-room-handle') && !!toolById('github-live-pid-reconcile')
268
- && !!toolById('github-live-office-reconcile-expansion') && !!toolById('catch-count-ledger'));
 
269
  add('slice-engine-law-preloaded', LAWS.some((law) => law.startsWith('slice-engine-law-'))
270
  && emitPreloadRows().some((row) => row.startsWith('FABPRELOADSLICEENGINE|')));
271
  add('emitters-pipe-hookwall-gnn', EMITTERS.some((e) => e.id === 'hookwall') && EMITTERS.some((e) => e.id === 'gnn-edge'));
 
98
  provides: 'enumerable-bilateral-catch-ledger-open-closed-owner-status',
99
  gate: 'md-final-release-claims-held-until-open-partial-catches-close',
100
  }),
101
+ Object.freeze({
102
+ id: 'mlc-engine-wiring-increment',
103
+ path: 'tools/behcs/mlc-engine-wiring-increment.mjs',
104
+ provides: 'C036-increment-1-MTP-HRM-GNN-Fischer-Mamba-AoT-descriptor-wiring-matrix',
105
+ gate: 'descriptor-only-process_launch-0-live-engine-launch-defer-to-fabric-verdict',
106
+ }),
107
  Object.freeze({
108
  id: 'token-cube-catalog-binder',
109
  path: 'tools/behcs/token-cube-catalog-binder.mjs',
 
271
  add('packet-lines-use-json-envelope', classifyPayloadForRoute({ route_id: 'send-json', payload_kind: 'operator-packet-lines' }) === 'ACCEPT_JSON_ENVELOPE');
272
  add('packet-lines-rejected-on-hbp-lane', classifyPayloadForRoute({ route_id: 'send-hbp', payload_kind: 'operator-packet-lines' }) === 'REJECT_WRONG_ROUTE');
273
  add('tools-include-room-and-pid', !!toolById('pixel-room-handle') && !!toolById('github-live-pid-reconcile')
274
+ && !!toolById('github-live-office-reconcile-expansion') && !!toolById('catch-count-ledger')
275
+ && !!toolById('mlc-engine-wiring-increment'));
276
  add('slice-engine-law-preloaded', LAWS.some((law) => law.startsWith('slice-engine-law-'))
277
  && emitPreloadRows().some((row) => row.startsWith('FABPRELOADSLICEENGINE|')));
278
  add('emitters-pipe-hookwall-gnn', EMITTERS.some((e) => e.id === 'hookwall') && EMITTERS.some((e) => e.id === 'gnn-edge'));
tools/behcs/fabric-agent-preload-catalog.mjs.sha256 CHANGED
@@ -1 +1 @@
1
- 9FC6D4FC0C8C967281E337E7766C862EB4F2896BEC7311E835BBE117768A1F71 fabric-agent-preload-catalog.mjs
 
1
+ 43DDB785DEB6E5F161E22697FDC3FB713D332E2CB2577A9BCE10AD75BE7EBD7C fabric-agent-preload-catalog.mjs
tools/behcs/mlc-engine-wiring-increment.mjs ADDED
@@ -0,0 +1,252 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env node
2
+ // mlc-engine-wiring-increment.mjs - C036 increment-1 descriptor wiring matrix.
3
+ //
4
+ // This is not live engine launch. It reads the existing MLC line watcher output and
5
+ // maps each observed line into the engine lanes that will eventually be cranked:
6
+ // MTP, HRM, GNN, Fischer draft-standin, Mamba sequence handle, and AoT path handle.
7
+ //
8
+ // Safety: HBP rows only, no spawn, no fetch, no file write, no mint, no process launch.
9
+ // Live MTP/HRM/Fischer/Mamba/AoT remain behind the fabric verdict/daemon contract.
10
+
11
+ import { createHash } from 'node:crypto';
12
+ import { resolve } from 'node:path';
13
+ import { fileURLToPath } from 'node:url';
14
+
15
+ import {
16
+ FISCHER_SCORE_KIND,
17
+ WATCHER_ID,
18
+ runLineWatcher,
19
+ } from './mlc-line-watcher.mjs';
20
+
21
+ export const WIRING_ID = 'mlc-engine-wiring-increment.v1';
22
+ export { FISCHER_SCORE_KIND };
23
+ export const DEFAULT_WIRING_NODES = 18;
24
+ export const DEFAULT_WIRING_STRIDES = Object.freeze([1, 2]);
25
+ export const LIVE_GATE = 'DEFER_TO_FABRIC_VERDICT_AND_DAEMON_CONTRACT';
26
+
27
+ export const ENGINE_LANES = Object.freeze([
28
+ Object.freeze({
29
+ id: 'mtp',
30
+ engine: 'MTP_FIELD_PROXY',
31
+ source: 'watcher=mtp_field_proxy',
32
+ state: 'DESCRIPTOR_READY_NO_LAUNCH',
33
+ }),
34
+ Object.freeze({
35
+ id: 'hrm',
36
+ engine: 'HRM_RECURRENCE_ROUTER',
37
+ source: 'watcher=hrm_recurrence',
38
+ state: 'DESCRIPTOR_READY_NO_LAUNCH',
39
+ }),
40
+ Object.freeze({
41
+ id: 'gnn',
42
+ engine: 'GNN_EDGE_HANDLE',
43
+ source: 'watcher=gnn_edge',
44
+ state: 'DESCRIPTOR_READY_NO_LAUNCH',
45
+ }),
46
+ Object.freeze({
47
+ id: 'fischer',
48
+ engine: 'FISCHER_DRAFT_STANDIN_SCORER',
49
+ source: 'fischer_move+score_kind',
50
+ state: 'DRAFT_STANDIN_ONLY_NO_LIVE_4794',
51
+ }),
52
+ Object.freeze({
53
+ id: 'mamba',
54
+ engine: 'MAMBA_SEQUENCE_BLOCK_HANDLE',
55
+ source: 'sequence_block',
56
+ state: 'HANDLE_ONLY_NO_EXECUTE',
57
+ }),
58
+ Object.freeze({
59
+ id: 'aot',
60
+ engine: 'AOT_PATH_DECOMPOSITION_HANDLE',
61
+ source: 'aot_step',
62
+ state: 'HANDLE_ONLY_NO_EXECUTE',
63
+ }),
64
+ ]);
65
+
66
+ const sha16 = (text) => createHash('sha256').update(String(text), 'utf8').digest('hex').slice(0, 16);
67
+ const isObj = (x) => x !== null && typeof x === 'object';
68
+ const safe = (x) => { try { return String(x == null ? '' : x).replace(/[|\r\n]/g, '_'); } catch { return '_'; } };
69
+ const prop = (obj, key, fallback = '') => {
70
+ try { return isObj(obj) ? obj[key] : fallback; } catch { return fallback; }
71
+ };
72
+
73
+ function laneForWatcher(watcher) {
74
+ if (watcher === 'mtp_field_proxy') return 'mtp';
75
+ if (watcher === 'hrm_recurrence') return 'hrm';
76
+ if (watcher === 'gnn_edge') return 'gnn';
77
+ return 'gnn';
78
+ }
79
+
80
+ function lineSignature(line) {
81
+ const sig = prop(line, 'signature', '');
82
+ if (/^[a-f0-9]{16}$/i.test(String(sig))) return String(sig).toLowerCase();
83
+ return sha16([
84
+ prop(line, 'watcher', ''),
85
+ prop(line, 'relation', ''),
86
+ prop(line, 'fischer_move', ''),
87
+ prop(line, 'aot_step', ''),
88
+ prop(line, 'sequence_block', ''),
89
+ ].join('|'));
90
+ }
91
+
92
+ export function wireLine(input) {
93
+ try {
94
+ const line = isObj(input) ? input : {};
95
+ const from = prop(line, 'from', {});
96
+ const to = prop(line, 'to', {});
97
+ const watcher = safe(prop(line, 'watcher', 'gnn_edge'));
98
+ const primary_engine = laneForWatcher(watcher);
99
+ const lanes = [
100
+ primary_engine,
101
+ 'fischer',
102
+ 'mamba',
103
+ 'aot',
104
+ ];
105
+ return {
106
+ signature: lineSignature(line),
107
+ from_pid: safe(prop(from, 'pid', '')),
108
+ to_pid: safe(prop(to, 'pid', '')),
109
+ relation: safe(prop(line, 'relation', 'unknown')),
110
+ bucket: safe(prop(line, 'bucket', 'unknown')),
111
+ watcher,
112
+ primary_engine,
113
+ fischer_move: safe(prop(line, 'fischer_move', 'WATCH')),
114
+ fischer_score_kind: FISCHER_SCORE_KIND,
115
+ mamba_sequence_block: safe(prop(line, 'sequence_block', 'block_unknown')),
116
+ aot_step: safe(prop(line, 'aot_step', 'OBSERVE_NEXT')),
117
+ lanes,
118
+ live_launch_gate: LIVE_GATE,
119
+ process_launch: 0,
120
+ };
121
+ } catch {
122
+ return {
123
+ signature: sha16('invalid-line'),
124
+ from_pid: '',
125
+ to_pid: '',
126
+ relation: 'invalid',
127
+ bucket: 'invalid',
128
+ watcher: 'invalid',
129
+ primary_engine: 'gnn',
130
+ fischer_move: 'WATCH',
131
+ fischer_score_kind: FISCHER_SCORE_KIND,
132
+ mamba_sequence_block: 'block_unknown',
133
+ aot_step: 'OBSERVE_NEXT',
134
+ lanes: ['gnn', 'fischer', 'mamba', 'aot'],
135
+ live_launch_gate: LIVE_GATE,
136
+ process_launch: 0,
137
+ };
138
+ }
139
+ }
140
+
141
+ export function buildWiring(input = {}) {
142
+ const opts = isObj(input) ? input : {};
143
+ let run;
144
+ let source_error = '';
145
+ try {
146
+ run = runLineWatcher({
147
+ nodes: prop(opts, 'nodes', DEFAULT_WIRING_NODES),
148
+ strides: prop(opts, 'strides', DEFAULT_WIRING_STRIDES),
149
+ prefix: prop(opts, 'prefix', 'MLCWIRE'),
150
+ });
151
+ } catch {
152
+ source_error = 'mlc-line-watcher-threw';
153
+ run = { lines: [], summary: { nodes: 0, lines: 0, strides: [] } };
154
+ }
155
+ const entries = (Array.isArray(run.lines) ? run.lines : []).map(wireLine);
156
+ const engine_counts = Object.fromEntries(ENGINE_LANES.map((lane) => [lane.id, 0]));
157
+ for (const entry of entries) {
158
+ for (const lane of entry.lanes) engine_counts[lane] = (engine_counts[lane] || 0) + 1;
159
+ }
160
+ const all_no_launch = entries.every((entry) => entry.process_launch === 0 && entry.live_launch_gate === LIVE_GATE);
161
+ return {
162
+ tool: WIRING_ID,
163
+ source_watcher: WATCHER_ID,
164
+ fabric_request_id: safe(prop(opts, 'fabric_request_id', '')),
165
+ source_error,
166
+ entries,
167
+ summary: {
168
+ nodes: prop(run.summary, 'nodes', 0),
169
+ lines: prop(run.summary, 'lines', entries.length),
170
+ entries: entries.length,
171
+ engine_counts,
172
+ all_no_launch,
173
+ fischer_score_kind: FISCHER_SCORE_KIND,
174
+ c036_status: 'OPEN_LIVE_ENGINE_NOT_LAUNCHED',
175
+ },
176
+ };
177
+ }
178
+
179
+ export function emitRows(input = {}) {
180
+ try {
181
+ const opts = isObj(input) ? input : {};
182
+ const cap = Math.max(0, Math.min(Number.parseInt(String(prop(opts, 'cap', 12)), 10) || 12, 64));
183
+ const built = buildWiring(opts);
184
+ const counts = built.summary.engine_counts;
185
+ const rows = [
186
+ `MLCEWIREHDR|tool=${WIRING_ID}|source=${WATCHER_ID}|stage=C036-increment-1-descriptor-matrix|fabric_request_id=${safe(built.fabric_request_id)}|read_only=1|hbp_rows_only=1|process_launch=0|no_spawn=1|no_fetch=1|no_write=1|no_mint=1|no_live_engine=1|json=0`,
187
+ `MLCEWIRELANES|mtp=${safe(counts.mtp)}|hrm=${safe(counts.hrm)}|gnn=${safe(counts.gnn)}|fischer=${safe(counts.fischer)}|mamba=${safe(counts.mamba)}|aot=${safe(counts.aot)}|fischer_score_kind=${FISCHER_SCORE_KIND}|json=0`,
188
+ `MLCEWIREGATE|C036_status=OPEN_LIVE_ENGINE_NOT_LAUNCHED|live_launch=${LIVE_GATE}|reason=descriptor-matrix-only-until-fabric-ranks-daemon-contract|process_launch=0|json=0`,
189
+ ];
190
+ for (const entry of built.entries.slice(0, cap)) {
191
+ rows.push(
192
+ `MLCEWIRE|signature=${safe(entry.signature)}|from_pid=${safe(entry.from_pid)}|to_pid=${safe(entry.to_pid)}`
193
+ + `|relation=${safe(entry.relation)}|bucket=${safe(entry.bucket)}|watcher=${safe(entry.watcher)}`
194
+ + `|primary_engine=${safe(entry.primary_engine)}|lanes=${entry.lanes.map(safe).join('+')}`
195
+ + `|fischer_move=${safe(entry.fischer_move)}|fischer_score_kind=${safe(entry.fischer_score_kind)}`
196
+ + `|mamba_sequence_block=${safe(entry.mamba_sequence_block)}|aot_step=${safe(entry.aot_step)}`
197
+ + `|live_launch_gate=${safe(entry.live_launch_gate)}|process_launch=${safe(entry.process_launch)}|json=0`,
198
+ );
199
+ }
200
+ rows.push(
201
+ `MLCEWIRESUM|nodes=${safe(built.summary.nodes)}|lines=${safe(built.summary.lines)}|entries=${safe(built.summary.entries)}`
202
+ + `|emitted=${Math.min(cap, built.entries.length)}|all_no_launch=${built.summary.all_no_launch ? 1 : 0}`
203
+ + `|source_error=${safe(built.source_error)}|json=0`,
204
+ );
205
+ return rows;
206
+ } catch {
207
+ return [
208
+ `MLCEWIREHDR|tool=${WIRING_ID}|source=${WATCHER_ID}|stage=C036-increment-1-descriptor-matrix|read_only=1|hbp_rows_only=1|process_launch=0|no_live_engine=1|json=0`,
209
+ `MLCEWIREGATE|C036_status=OPEN_LIVE_ENGINE_NOT_LAUNCHED|live_launch=${LIVE_GATE}|reason=emit-threw-held-invalid|process_launch=0|json=0`,
210
+ ];
211
+ }
212
+ }
213
+
214
+ export function selfTest() {
215
+ const checks = [];
216
+ const add = (name, ok) => checks.push({ name, ok: Boolean(ok) });
217
+ const a = buildWiring({ nodes: 18, strides: [1, 2], prefix: 'WIRESELF', fabric_request_id: 'council-q-test' });
218
+ const b = buildWiring({ nodes: 18, strides: [1, 2], prefix: 'WIRESELF', fabric_request_id: 'council-q-test' });
219
+ add('deterministic-wiring', JSON.stringify(a.entries) === JSON.stringify(b.entries));
220
+ add('entries-produced-from-lines', a.summary.entries === 33 && a.summary.lines === 33);
221
+ add('all-lanes-present', ENGINE_LANES.every((lane) => Number.isInteger(a.summary.engine_counts[lane.id])));
222
+ add('all-no-launch', a.summary.all_no_launch === true && a.entries.every((entry) => entry.process_launch === 0));
223
+ add('fischer-stays-draft-standin', a.summary.fischer_score_kind === 'DRAFT_STANDIN_NOT_FISCHER' && a.entries.every((entry) => entry.fischer_score_kind === FISCHER_SCORE_KIND));
224
+ add('c036-remains-open', a.summary.c036_status === 'OPEN_LIVE_ENGINE_NOT_LAUNCHED');
225
+ add('rows-hbp-only', emitRows({ nodes: 12, cap: 6 }).every((row) => row.endsWith('|json=0') && !/[{\r\n]/.test(row)));
226
+ let threw = false;
227
+ try { wireLine(null); buildWiring(null); emitRows(null); wireLine({ get from() { throw new Error('boom'); } }); } catch { threw = true; }
228
+ add('total-never-throws', threw === false);
229
+ return { ok: checks.every((c) => c.ok), checks };
230
+ }
231
+
232
+ const isMain = process.argv[1] && fileURLToPath(import.meta.url) === resolve(process.argv[1]);
233
+ if (isMain) {
234
+ const cmd = process.argv[2] || '--pilot';
235
+ if (cmd === '--self-test') {
236
+ const r = selfTest();
237
+ for (const c of r.checks) console.log(`${c.ok ? 'PASS' : 'FAIL'} ${c.name}`);
238
+ process.exit(r.ok ? 0 : 1);
239
+ }
240
+ if (cmd === '--pilot') {
241
+ const nodeArg = process.argv.find((a) => a.startsWith('--nodes='));
242
+ const capArg = process.argv.find((a) => a.startsWith('--cap='));
243
+ const fabricArg = process.argv.find((a) => a.startsWith('--fabric-request-id='));
244
+ const nodes = nodeArg ? Number.parseInt(nodeArg.slice(8), 10) : DEFAULT_WIRING_NODES;
245
+ const cap = capArg ? Number.parseInt(capArg.slice(6), 10) : 12;
246
+ const fabric_request_id = fabricArg ? fabricArg.slice(20) : '';
247
+ process.stdout.write(emitRows({ nodes, cap, fabric_request_id }).join('\n') + '\n');
248
+ process.exit(0);
249
+ }
250
+ console.error('usage: mlc-engine-wiring-increment.mjs --pilot [--nodes=N] [--cap=N] [--fabric-request-id=ID] | --self-test');
251
+ process.exit(1);
252
+ }
tools/behcs/mlc-engine-wiring-increment.mjs.sha256 ADDED
@@ -0,0 +1 @@
 
 
1
+ F28A6371CDAE51F759977D149A053999E0DEA1D5CBAC8E52CD47AA20CFCDED81 mlc-engine-wiring-increment.mjs