Kevin Crutt commited on
Commit
6dbe8c8
·
1 Parent(s): 1c180df

liris: add eight byte host process upgrade

Browse files
Files changed (32) hide show
  1. docs/LIRIS-EIGHT-BYTE-HOST-PROCESS-UPGRADE-2026-06-14.hbp +9 -0
  2. docs/LIRIS-EIGHT-BYTE-HOST-PROCESS-UPGRADE-2026-06-14.hbp.sha256 +1 -0
  3. tests/agent-cost-layer-boundary.unit.test.mjs +2 -0
  4. tests/agent-cost-layer-boundary.unit.test.mjs.sha256 +1 -1
  5. tests/cellphone-host-bridge-boundary.unit.test.mjs +8 -0
  6. tests/cellphone-host-bridge-boundary.unit.test.mjs.sha256 +1 -1
  7. tests/eight-byte-host-process-upgrade.unit.test.mjs +83 -0
  8. tests/eight-byte-host-process-upgrade.unit.test.mjs.sha256 +1 -0
  9. tests/fabric-agent-preload-catalog.unit.test.mjs +2 -0
  10. tests/fabric-agent-preload-catalog.unit.test.mjs.sha256 +1 -1
  11. tests/frozen-slice-city-signal-lifecycle.unit.test.mjs +1 -0
  12. tests/frozen-slice-city-signal-lifecycle.unit.test.mjs.sha256 +1 -1
  13. tests/pid-emitter-cost-envelope.unit.test.mjs +1 -0
  14. tests/pid-emitter-cost-envelope.unit.test.mjs.sha256 +1 -1
  15. tests/supervisor-collision-router.system.test.mjs +3 -0
  16. tests/supervisor-collision-router.system.test.mjs.sha256 +1 -1
  17. tests/triad-host-router-gulp-pipeline.unit.test.mjs +2 -0
  18. tests/triad-host-router-gulp-pipeline.unit.test.mjs.sha256 +1 -1
  19. tools/behcs/agent-cost-layer-boundary.mjs +4 -1
  20. tools/behcs/agent-cost-layer-boundary.mjs.sha256 +1 -1
  21. tools/behcs/cellphone-host-bridge-boundary.mjs +18 -4
  22. tools/behcs/cellphone-host-bridge-boundary.mjs.sha256 +1 -1
  23. tools/behcs/eight-byte-host-process-upgrade.mjs +308 -0
  24. tools/behcs/eight-byte-host-process-upgrade.mjs.sha256 +1 -0
  25. tools/behcs/fabric-agent-preload-catalog.mjs +8 -1
  26. tools/behcs/fabric-agent-preload-catalog.mjs.sha256 +1 -1
  27. tools/behcs/frozen-slice-city-signal-lifecycle.mjs +4 -1
  28. tools/behcs/frozen-slice-city-signal-lifecycle.mjs.sha256 +1 -1
  29. tools/behcs/pid-emitter-cost-envelope.mjs +4 -1
  30. tools/behcs/pid-emitter-cost-envelope.mjs.sha256 +1 -1
  31. tools/behcs/triad-host-router-gulp-pipeline.mjs +4 -1
  32. tools/behcs/triad-host-router-gulp-pipeline.mjs.sha256 +1 -1
docs/LIRIS-EIGHT-BYTE-HOST-PROCESS-UPGRADE-2026-06-14.hbp ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ HOSTUPGRADECANONHDR|doc=LIRIS-EIGHT-BYTE-HOST-PROCESS-UPGRADE-2026-06-14|date=2026-06-14|owner=liris|scope=v8-real-8-byte-host-process-upgrade-and-real-graph-math|tag=DESCRIPTOR-ONLY|json=0
2
+ HOSTUPGRADECANONPOLICY|replace=node-per-agent-runtime-conductor-where-proven|keep=node-for-repo-verifier-build-test-static-provider-adapter-until-host-replacement-proof|not_replace=provider-brain-compute|provider_terms_apply=1|json=0
3
+ HOSTUPGRADECANONMATH|bh_index=sector*3072+lane*1024+glyph|sector=sha256-name-mod113|lane=sha256-name-mod3|glyph=sha256-name-mod1024|cylinder=phase-bh_index-mod6+ring-floor-bh_index-div6|distance=abs-delta-bh_index-not-3d-euclidean|json=0
4
+ HOSTUPGRADECANONPRIME|real_tiers=p+p2+p3|folded_tiers=p5+p7+p9-to-pk|p5_materialized=0|status=PROPOSAL_UNTIL_DISTINCT_RANGE_TAG_AND_TEST|json=0
5
+ HOSTUPGRADECANONSYSTEMS|systems=LOGICAL-WAVE+FROZEN-BRAIN+REAL-FREE|rule_of_three=hookwall+gnn+shannon|yin_yang=logical-circle+real-square|mod6_integrity=necessary-not-sufficient|json=0
6
+ HOSTUPGRADECANONROUTES|route_types=device-to-hardware+agent-to-agent+agent-to-device+agent-to-human+human-to-agent+provider-router|all_routes=descriptor-first|device_effects=operator-cosign|provider_router=gated|json=0
7
+ HOSTUPGRADECANONGATES|free_provider_compute_claim=0|billing_bypass=0|global_node_removed_today=0|process_launch=0|usb_write=0|radio_bypass=0|cadence_200ns=end-to-end-benchmark-required|json=0
8
+ HOSTUPGRADECANONTOOL|tool=tools/behcs/eight-byte-host-process-upgrade.mjs|test=tests/eight-byte-host-process-upgrade.unit.test.mjs|catalog=tools/behcs/fabric-agent-preload-catalog.mjs|json=0
9
+ HOSTUPGRADECANONFTR|state=SEALED-EIGHT-BYTE-HOST-PROCESS-UPGRADE|next=use-before-claiming-node-replacement-real-prime-graphs-or-phone-world-model-upgrades|json=0
docs/LIRIS-EIGHT-BYTE-HOST-PROCESS-UPGRADE-2026-06-14.hbp.sha256 ADDED
@@ -0,0 +1 @@
 
 
1
+ E0774C197A4C08AE8D48B080726A318EEABAFE3BEDF71336FAEB31FC0A017E64 LIRIS-EIGHT-BYTE-HOST-PROCESS-UPGRADE-2026-06-14.hbp
tests/agent-cost-layer-boundary.unit.test.mjs CHANGED
@@ -31,6 +31,8 @@ test('claim classifier separates message-size confusion from host-handle doctrin
31
  assert.equal(classifyClaim({ claim: '8 byte portal handle' }), 'HOST_HANDLE_DESCRIPTOR_ONLY');
32
  assert.equal(classifyClaim({ claim: 'message payload context tokens' }), 'MESSAGE_PAYLOAD_VARIABLE');
33
  assert.equal(classifyClaim({ claim: 'free unlimited Google model compute bypass' }), 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM');
 
 
34
  });
35
 
36
  test('hostile layers emit HBP-only rows and stay non-executing', () => {
 
31
  assert.equal(classifyClaim({ claim: '8 byte portal handle' }), 'HOST_HANDLE_DESCRIPTOR_ONLY');
32
  assert.equal(classifyClaim({ claim: 'message payload context tokens' }), 'MESSAGE_PAYLOAD_VARIABLE');
33
  assert.equal(classifyClaim({ claim: 'free unlimited Google model compute bypass' }), 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM');
34
+ assert.equal(classifyClaim({ claim: '8 byte host gets gratis Claude tokens' }), 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM');
35
+ assert.equal(classifyClaim({ claim: 'zero-cost GPT API credits' }), 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM');
36
  });
37
 
38
  test('hostile layers emit HBP-only rows and stay non-executing', () => {
tests/agent-cost-layer-boundary.unit.test.mjs.sha256 CHANGED
@@ -1 +1 @@
1
- F9CEF44B0A9F813942AB761D8F2AA87136BA5E6DB1905CA1C5E5B10F029766E5 agent-cost-layer-boundary.unit.test.mjs
 
1
+ 1C8DA8AE1F5ADF4C8E78272D070DBDD7B3856F4B61670A1797B3A984CD36C2E3 agent-cost-layer-boundary.unit.test.mjs
tests/cellphone-host-bridge-boundary.unit.test.mjs CHANGED
@@ -24,6 +24,7 @@ test('known bilateral phone surfaces and future gated slots are present', () =>
24
  assert.deepEqual(ids, ['falcon', 'aether', 's22-ultra', 'future-phone']);
25
  assert.equal(buildBridge().summary.proven, 2);
26
  assert.equal(buildBridge().summary.gated, 2);
 
27
  });
28
 
29
  test('file-manager roundtrip proof precedes messages and self-call routing', () => {
@@ -43,9 +44,16 @@ test('claim classifier gates self-calls and rejects provider bypass claims', ()
43
  assert.equal(classifyBridgeClaim({ claim: 'cellphone 8 byte host handle' }), 'PHONE_HOST_BRIDGE_DESCRIPTOR');
44
  assert.equal(classifyBridgeClaim({ claim: 'supercomputers call themselves through our language' }), 'SELF_CALL_REQUIRES_EXPLICIT_AUTH_AND_ROUTE_PROOF');
45
  assert.equal(classifyBridgeClaim({ claim: 'free Google API provider bypass' }), 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM');
 
46
  assert.equal(classifyBridgeClaim({ claim: 'pull push file roundtrip' }), 'FILE_MANAGER_PROOF_REQUIRED');
47
  });
48
 
 
 
 
 
 
 
49
  test('hostile phone rows stay HBP-only and gated', () => {
50
  const phone = normalizePhone({ id: 'x|bad', status: 'LIVE', gate: 'g\nPHONEBRIDGEGATE|process_launch=1' });
51
  assert.equal(phone.status, 'GATED_UNTIL_ROUNDTRIP_PROOF');
 
24
  assert.deepEqual(ids, ['falcon', 'aether', 's22-ultra', 'future-phone']);
25
  assert.equal(buildBridge().summary.proven, 2);
26
  assert.equal(buildBridge().summary.gated, 2);
27
+ assert.ok(buildBridge().phones.filter((p) => p.status === 'PROVEN_BY_PRIOR_FILE_MANAGER_ROUNDTRIP').every((p) => /^[0-9a-f]{16}$/.test(p.proof_receipt_sha16)));
28
  });
29
 
30
  test('file-manager roundtrip proof precedes messages and self-call routing', () => {
 
44
  assert.equal(classifyBridgeClaim({ claim: 'cellphone 8 byte host handle' }), 'PHONE_HOST_BRIDGE_DESCRIPTOR');
45
  assert.equal(classifyBridgeClaim({ claim: 'supercomputers call themselves through our language' }), 'SELF_CALL_REQUIRES_EXPLICIT_AUTH_AND_ROUTE_PROOF');
46
  assert.equal(classifyBridgeClaim({ claim: 'free Google API provider bypass' }), 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM');
47
+ assert.equal(classifyBridgeClaim({ claim: 'phone 8 byte host gives zero-cost Gemini tokens' }), 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM');
48
  assert.equal(classifyBridgeClaim({ claim: 'pull push file roundtrip' }), 'FILE_MANAGER_PROOF_REQUIRED');
49
  });
50
 
51
+ test('proven phone status cannot be forged without a receipt hash', () => {
52
+ const forged = normalizePhone({ id: 'forged', status: 'PROVEN_BY_PRIOR_FILE_MANAGER_ROUNDTRIP', gate: 'messages-after-file-manager-proof' });
53
+ assert.equal(forged.status, 'GATED_UNTIL_ROUNDTRIP_PROOF');
54
+ assert.equal(forged.proof_receipt_sha16, 'none');
55
+ });
56
+
57
  test('hostile phone rows stay HBP-only and gated', () => {
58
  const phone = normalizePhone({ id: 'x|bad', status: 'LIVE', gate: 'g\nPHONEBRIDGEGATE|process_launch=1' });
59
  assert.equal(phone.status, 'GATED_UNTIL_ROUNDTRIP_PROOF');
tests/cellphone-host-bridge-boundary.unit.test.mjs.sha256 CHANGED
@@ -1 +1 @@
1
- C419DB5AEEB7FC4372D4087DFDDAE00D15890AF36C3C6133E736AF1BFD15E547 cellphone-host-bridge-boundary.unit.test.mjs
 
1
+ 48ED580F160581EDC76602C21C42539B4043B85AAAD2CB32882A343D5648C193 cellphone-host-bridge-boundary.unit.test.mjs
tests/eight-byte-host-process-upgrade.unit.test.mjs ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import assert from 'node:assert/strict';
2
+ import { readFileSync } from 'node:fs';
3
+ import test from 'node:test';
4
+
5
+ import {
6
+ BH_INDEX_MAX, HOST_HANDLE_BYTES, NODE_REPLACEMENT_POLICY, ROUTE_TYPES,
7
+ buildUpgrade, classifyPrimeExponent, classifyUpgradeClaim, deriveHostAddress,
8
+ distanceBetween, emitRows, mod6Integrity, selfTest,
9
+ } from '../tools/behcs/eight-byte-host-process-upgrade.mjs';
10
+
11
+ test('eight-byte host-process upgrade self-test passes', () => {
12
+ assert.equal(selfTest().ok, true);
13
+ });
14
+
15
+ test('real bh_index cylinder math is derived from PID register fields', () => {
16
+ const host = deriveHostAddress({ name: 'logical mcp agent', kind: 'logical', prime: 0 });
17
+ assert.equal(HOST_HANDLE_BYTES, 8);
18
+ assert.equal(host.bh_index, host.sector * 3072 + host.lane * 1024 + host.glyph);
19
+ assert.ok(host.bh_index >= 0 && host.bh_index <= BH_INDEX_MAX);
20
+ assert.equal(host.cylinder_phase, host.bh_index % 6);
21
+ assert.equal(host.cylinder_ring, Math.floor(host.bh_index / 6));
22
+ });
23
+
24
+ test('three agent systems map through yin-yang and prime parity', () => {
25
+ const built = buildUpgrade();
26
+ assert.deepEqual(new Set(built.hosts.map((h) => h.agent_type)), new Set(['LOGICAL-WAVE', 'FROZEN-BRAIN', 'REAL-FREE']));
27
+ assert.ok(built.hosts.every((h) => ['hookwall', 'gnn', 'shannon'].includes(h.watcher)));
28
+ assert.ok(built.hosts.every((h) => h.node_per_agent === 0 && h.process_launch === 0));
29
+ });
30
+
31
+ test('prime power tiers separate p p2 p3 and fold p5 p7 p9 honestly to pk proposals', () => {
32
+ assert.deepEqual(classifyPrimeExponent(1), { exponent: 1, tier: 'prime', materialized: true, status: 'REAL_DISTINCT' });
33
+ assert.equal(classifyPrimeExponent(2).tier, 'p2');
34
+ assert.equal(classifyPrimeExponent(3).tier, 'p3');
35
+ for (const exponent of [5, 7, 9]) {
36
+ const tier = classifyPrimeExponent(exponent);
37
+ assert.equal(tier.tier, 'pk');
38
+ assert.equal(tier.materialized, false);
39
+ assert.equal(tier.status, 'PROPOSAL_FOLDED_TO_PK');
40
+ }
41
+ });
42
+
43
+ test('PID distance is abs delta bh_index, not fake 3D euclidean distance', () => {
44
+ const near = distanceBetween({ bh_index: 1000, sha16: 'aaaaaaaaaaaaaaaa' }, { bh_index: 2000, sha16: 'bbbbbbbbbbbbbbbb' });
45
+ const regional = distanceBetween({ bh_index: 1000, sha16: 'aaaaaaaaaaaaaaaa' }, { bh_index: 100000, sha16: 'bbbbbbbbbbbbbbbb' });
46
+ assert.equal(near.bucket, 'near4096');
47
+ assert.equal(regional.bucket, 'regional131072');
48
+ assert.equal(regional.metric, 'abs-delta-bh-index-not-euclidean-3d');
49
+ });
50
+
51
+ test('mod-6 integrity catches corrupted external lanes but never proves truth alone', () => {
52
+ assert.equal(mod6Integrity(11, 13, { claimedLaneA: 2, claimedLaneB: 1 }).verdict, 'FORCED_CONSISTENT');
53
+ assert.equal(mod6Integrity(11, 13, { claimedLaneB: 2 }).verdict, 'FORCING_VIOLATION');
54
+ assert.equal(mod6Integrity(11, 13).scope, 'necessary-not-sufficient');
55
+ });
56
+
57
+ test('node replacement policy scopes the upgrade to the conductor layer', () => {
58
+ assert.ok(NODE_REPLACEMENT_POLICY.some((p) => p.id === 'runtime-agent-conductor' && p.status === 'TARGET_REPLACE_NODE_PER_AGENT'));
59
+ assert.ok(NODE_REPLACEMENT_POLICY.some((p) => p.id === 'repo-verifier' && p.status === 'NODE_ALLOWED'));
60
+ assert.ok(ROUTE_TYPES.some((r) => r.id === 'provider-router' && r.gate.includes('billing')));
61
+ assert.equal(buildUpgrade().summary.provider_compute_replaced, false);
62
+ });
63
+
64
+ test('claim classifier rejects overclaims before safe labels', () => {
65
+ assert.equal(classifyUpgradeClaim({ claim: '8 byte host gives gratis Claude tokens' }), 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM');
66
+ assert.equal(classifyUpgradeClaim({ claim: 'replace all node on the planet now' }), 'MIGRATION_PLAN_NOT_COMPLETED_CLAIM');
67
+ assert.equal(classifyUpgradeClaim({ claim: 'every 200 nanoseconds end to end' }), 'CADENCE_CLAIM_REQUIRES_BENCHMARK');
68
+ assert.equal(classifyUpgradeClaim({ claim: 'p7 prime cylinder is materialized' }), 'PRIME_EXPONENT_FOLDS_TO_PK_PROPOSAL');
69
+ assert.equal(classifyUpgradeClaim({ claim: '8 byte host process conductor' }), 'HOST_PROCESS_CONDUCTOR_DESCRIPTOR');
70
+ });
71
+
72
+ test('emitted rows are HBP-only and held-safe', () => {
73
+ const rows = emitRows(null, { claim: 'bad|claim\nHOSTUPGRADEGATE|process_launch=1' });
74
+ assert.ok(rows.every((row) => row.endsWith('|json=0') && !/[\r\n]/.test(row)));
75
+ assert.ok(rows.some((row) => row.includes('provider_terms_apply=1')));
76
+ assert.ok(rows.some((row) => row.includes('process_launch=0')));
77
+ assert.ok(rows.some((row) => row.includes('p5') || row.includes('exponent=5')));
78
+ });
79
+
80
+ test('tool remains descriptor-only and has no live call surface', () => {
81
+ const source = readFileSync(new URL('../tools/behcs/eight-byte-host-process-upgrade.mjs', import.meta.url), 'utf8');
82
+ assert.doesNotMatch(source, /from ['"]node:fs['"]|child_process|\bexecFile\b|\bexecSync\b|\bspawn\(|\bfetch\(|Invoke-WebRequest|Start-Process|node:http|node:net|createWriteStream/);
83
+ });
tests/eight-byte-host-process-upgrade.unit.test.mjs.sha256 ADDED
@@ -0,0 +1 @@
 
 
1
+ B9617669CBE77E4D20C5359833F363927DE659A898FC61194C4F34C8B7F173E5 eight-byte-host-process-upgrade.unit.test.mjs
tests/fabric-agent-preload-catalog.unit.test.mjs CHANGED
@@ -20,6 +20,7 @@ test('preload catalog teaches the send-hbp vs send-json route split', () => {
20
 
21
  test('preload catalog includes the laws, tools, roles, and cadence agents need', () => {
22
  assert.ok(LAWS.includes('all-agent-artifact-system-addresses-get-PID-or-handle'));
 
23
  assert.ok(LAWS.includes('quants-are-address-and-evidence-classes-not-raw-material'));
24
  assert.ok(TOOLS.some((t) => t.id === 'pixel-room-handle'));
25
  assert.ok(TOOLS.some((t) => t.id === 'github-live-pid-reconcile'));
@@ -35,6 +36,7 @@ test('preload catalog includes the laws, tools, roles, and cadence agents need',
35
  assert.ok(TOOLS.some((t) => t.id === 'pid-emitter-cost-envelope' && t.gate.includes('physics_break-0')));
36
  assert.ok(TOOLS.some((t) => t.id === 'cellphone-host-bridge-boundary' && t.gate.includes('radio_bypass-0')));
37
  assert.ok(TOOLS.some((t) => t.id === 'frozen-slice-city-signal-lifecycle' && t.gate.includes('measured_200ns-0')));
 
38
  assert.ok(ROLES.some((r) => r.id === 'flywheel' && r.must_do.includes('compare-to-acer-local-truth')));
39
  assert.ok(WORKFLOW.join('-').includes('memory-index-plan'));
40
  assert.equal(toolById('token-cube-catalog-binder').gate, 'mint-write-live-DEFER_TO_OPERATOR');
 
20
 
21
  test('preload catalog includes the laws, tools, roles, and cadence agents need', () => {
22
  assert.ok(LAWS.includes('all-agent-artifact-system-addresses-get-PID-or-handle'));
23
+ assert.ok(LAWS.includes('8-byte-host-process-replaces-node-per-agent-only-where-proven'));
24
  assert.ok(LAWS.includes('quants-are-address-and-evidence-classes-not-raw-material'));
25
  assert.ok(TOOLS.some((t) => t.id === 'pixel-room-handle'));
26
  assert.ok(TOOLS.some((t) => t.id === 'github-live-pid-reconcile'));
 
36
  assert.ok(TOOLS.some((t) => t.id === 'pid-emitter-cost-envelope' && t.gate.includes('physics_break-0')));
37
  assert.ok(TOOLS.some((t) => t.id === 'cellphone-host-bridge-boundary' && t.gate.includes('radio_bypass-0')));
38
  assert.ok(TOOLS.some((t) => t.id === 'frozen-slice-city-signal-lifecycle' && t.gate.includes('measured_200ns-0')));
39
+ assert.ok(TOOLS.some((t) => t.id === 'eight-byte-host-process-upgrade' && t.gate.includes('provider_compute_replaced-0')));
40
  assert.ok(ROLES.some((r) => r.id === 'flywheel' && r.must_do.includes('compare-to-acer-local-truth')));
41
  assert.ok(WORKFLOW.join('-').includes('memory-index-plan'));
42
  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
- 6AF209FB14E4F287E9C7676F73AEDC005801E7880593DD212CF0F5DD1BE12A5D fabric-agent-preload-catalog.unit.test.mjs
 
1
+ AEECC42FFBF57603B927CA292D4672E0B166CE3F73E44B5207F01B77A441FF89 fabric-agent-preload-catalog.unit.test.mjs
tests/frozen-slice-city-signal-lifecycle.unit.test.mjs CHANGED
@@ -49,6 +49,7 @@ test('claim classifier handles 200ns, forcing providers, free compute, and froze
49
  assert.equal(classifyLifecycleClaim({ claim: 'updates every 200 nano seconds' }), 'CADENCE_CLAIM_REQUIRES_BENCHMARK');
50
  assert.equal(classifyLifecycleClaim({ claim: 'forcing Anthropic model to decide' }), 'ROUTED_REQUEST_NOT_UNAUTHORIZED_CONTROL');
51
  assert.equal(classifyLifecycleClaim({ claim: 'free OpenAI api bypass' }), 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM');
 
52
  assert.equal(classifyLifecycleClaim({ claim: 'frozen slice city' }), 'FROZEN_SLICE_CITY_DESCRIPTOR');
53
  assert.equal(classifyLifecycleClaim({ claim: 'GNN Shannon white room attack' }), 'WATCHER_REVIEW_PROPOSAL_NOT_PROOF');
54
  });
 
49
  assert.equal(classifyLifecycleClaim({ claim: 'updates every 200 nano seconds' }), 'CADENCE_CLAIM_REQUIRES_BENCHMARK');
50
  assert.equal(classifyLifecycleClaim({ claim: 'forcing Anthropic model to decide' }), 'ROUTED_REQUEST_NOT_UNAUTHORIZED_CONTROL');
51
  assert.equal(classifyLifecycleClaim({ claim: 'free OpenAI api bypass' }), 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM');
52
+ assert.equal(classifyLifecycleClaim({ claim: 'frozen slice city gives gratis GPT tokens' }), 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM');
53
  assert.equal(classifyLifecycleClaim({ claim: 'frozen slice city' }), 'FROZEN_SLICE_CITY_DESCRIPTOR');
54
  assert.equal(classifyLifecycleClaim({ claim: 'GNN Shannon white room attack' }), 'WATCHER_REVIEW_PROPOSAL_NOT_PROOF');
55
  });
tests/frozen-slice-city-signal-lifecycle.unit.test.mjs.sha256 CHANGED
@@ -1 +1 @@
1
- F229ABA0797DC1D227BD249ACB415F7FFABFAAC81B27A187DAC69F180DE3613A frozen-slice-city-signal-lifecycle.unit.test.mjs
 
1
+ 2EF50CB52B0CC99D060EC59684EAE65E1C01CA423A8D60368FB971B4DEF6144E frozen-slice-city-signal-lifecycle.unit.test.mjs
tests/pid-emitter-cost-envelope.unit.test.mjs CHANGED
@@ -41,6 +41,7 @@ test('real cost envelope includes emitter spin, planning, cube templating, paylo
41
  test('claim classifier blocks literal physics and provider bypass claims', () => {
42
  assert.equal(classifyCostClaim({ claim: 'breaks physics kind of feel' }), 'METAPHOR_ONLY_REJECT_LITERAL_PHYSICS_BREAK');
43
  assert.equal(classifyCostClaim({ claim: 'free unlimited OpenAI supercomputer compute bypass' }), 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM');
 
44
  assert.equal(classifyCostClaim({ claim: 'O(1) host handle addressing' }), 'O1_SHAPED_ADDRESSING_NOT_TOTAL_WORK');
45
  assert.equal(classifyCostClaim({ claim: '8 byte host process' }), 'HOST_HANDLE_DESCRIPTOR_ONLY');
46
  });
 
41
  test('claim classifier blocks literal physics and provider bypass claims', () => {
42
  assert.equal(classifyCostClaim({ claim: 'breaks physics kind of feel' }), 'METAPHOR_ONLY_REJECT_LITERAL_PHYSICS_BREAK');
43
  assert.equal(classifyCostClaim({ claim: 'free unlimited OpenAI supercomputer compute bypass' }), 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM');
44
+ assert.equal(classifyCostClaim({ claim: '8 byte host process gives zero-cost Gemini tokens' }), 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM');
45
  assert.equal(classifyCostClaim({ claim: 'O(1) host handle addressing' }), 'O1_SHAPED_ADDRESSING_NOT_TOTAL_WORK');
46
  assert.equal(classifyCostClaim({ claim: '8 byte host process' }), 'HOST_HANDLE_DESCRIPTOR_ONLY');
47
  });
tests/pid-emitter-cost-envelope.unit.test.mjs.sha256 CHANGED
@@ -1 +1 @@
1
- 9BD4983640AD4CE9BE19A6FE10450374980C1BE6DBC577C321E4DEBB1CA43C3D pid-emitter-cost-envelope.unit.test.mjs
 
1
+ 56777D57D8EC8A210EAA1FD1F432B596EA97A744EE7F33406E07E587C3D2C184 pid-emitter-cost-envelope.unit.test.mjs
tests/supervisor-collision-router.system.test.mjs CHANGED
@@ -95,6 +95,7 @@ const sealedFiles = [
95
  'docs/LIRIS-PID-EMITTER-COST-ENVELOPE-2026-06-14.hbp',
96
  'docs/LIRIS-CELLPHONE-HOST-BRIDGE-BOUNDARY-2026-06-14.hbp',
97
  'docs/LIRIS-FROZEN-SLICE-CITY-SIGNAL-LIFECYCLE-2026-06-14.hbp',
 
98
  'docs/ACER-SLICE-ENGINE-LIVE-CRANK-RECEIPT-2026-06-13.hbp',
99
  'docs/LIRIS-ROUTE-HEALTH-BASELINE-2026-06-13.hbp',
100
  'docs/ACER-ROUTE-HEALTH-CROSS-VANTAGE-2026-06-13.hbp',
@@ -241,6 +242,7 @@ const sealedFiles = [
241
  'tools/behcs/pid-emitter-cost-envelope.mjs',
242
  'tools/behcs/cellphone-host-bridge-boundary.mjs',
243
  'tools/behcs/frozen-slice-city-signal-lifecycle.mjs',
 
244
  'tools/behcs/logical-extreme-stress.mjs',
245
  'tools/behcs/logical-stress-cube-feed.mjs',
246
  'tools/behcs/brown-hilbert-expansion-stress.mjs',
@@ -281,6 +283,7 @@ const sealedFiles = [
281
  'tests/pid-emitter-cost-envelope.unit.test.mjs',
282
  'tests/cellphone-host-bridge-boundary.unit.test.mjs',
283
  'tests/frozen-slice-city-signal-lifecycle.unit.test.mjs',
 
284
  'tests/logical-extreme-stress.unit.test.mjs',
285
  'tests/logical-stress-cube-feed.unit.test.mjs',
286
  'tests/brown-hilbert-expansion-stress.unit.test.mjs',
 
95
  'docs/LIRIS-PID-EMITTER-COST-ENVELOPE-2026-06-14.hbp',
96
  'docs/LIRIS-CELLPHONE-HOST-BRIDGE-BOUNDARY-2026-06-14.hbp',
97
  'docs/LIRIS-FROZEN-SLICE-CITY-SIGNAL-LIFECYCLE-2026-06-14.hbp',
98
+ 'docs/LIRIS-EIGHT-BYTE-HOST-PROCESS-UPGRADE-2026-06-14.hbp',
99
  'docs/ACER-SLICE-ENGINE-LIVE-CRANK-RECEIPT-2026-06-13.hbp',
100
  'docs/LIRIS-ROUTE-HEALTH-BASELINE-2026-06-13.hbp',
101
  'docs/ACER-ROUTE-HEALTH-CROSS-VANTAGE-2026-06-13.hbp',
 
242
  'tools/behcs/pid-emitter-cost-envelope.mjs',
243
  'tools/behcs/cellphone-host-bridge-boundary.mjs',
244
  'tools/behcs/frozen-slice-city-signal-lifecycle.mjs',
245
+ 'tools/behcs/eight-byte-host-process-upgrade.mjs',
246
  'tools/behcs/logical-extreme-stress.mjs',
247
  'tools/behcs/logical-stress-cube-feed.mjs',
248
  'tools/behcs/brown-hilbert-expansion-stress.mjs',
 
283
  'tests/pid-emitter-cost-envelope.unit.test.mjs',
284
  'tests/cellphone-host-bridge-boundary.unit.test.mjs',
285
  'tests/frozen-slice-city-signal-lifecycle.unit.test.mjs',
286
+ 'tests/eight-byte-host-process-upgrade.unit.test.mjs',
287
  'tests/logical-extreme-stress.unit.test.mjs',
288
  'tests/logical-stress-cube-feed.unit.test.mjs',
289
  'tests/brown-hilbert-expansion-stress.unit.test.mjs',
tests/supervisor-collision-router.system.test.mjs.sha256 CHANGED
@@ -1 +1 @@
1
- 6E877FCED2D38794DD749DA6258122AE77028A75C25A91CD6321ABB81C7983D4 supervisor-collision-router.system.test.mjs
 
1
+ DD76DA203B8D65AA30696D93603D37DA34C1251048290E90E3C908646DD8CE4E supervisor-collision-router.system.test.mjs
tests/triad-host-router-gulp-pipeline.unit.test.mjs CHANGED
@@ -43,6 +43,8 @@ test('provider and CLI routers are descriptors with authorization gates', () =>
43
  assert.ok(built.routers.some((r) => r.id === 'openai' && r.gate.includes('billing-apply')));
44
  assert.ok(built.routers.some((r) => r.id === 'claude' && r.gate.includes('terms-and-quota')));
45
  assert.ok(built.routers.some((r) => r.id === 'registered-cli' && r.status === 'GATED'));
 
 
46
  });
47
 
48
  test('hostile router input is gated and HBP-only', () => {
 
43
  assert.ok(built.routers.some((r) => r.id === 'openai' && r.gate.includes('billing-apply')));
44
  assert.ok(built.routers.some((r) => r.id === 'claude' && r.gate.includes('terms-and-quota')));
45
  assert.ok(built.routers.some((r) => r.id === 'registered-cli' && r.status === 'GATED'));
46
+ assert.equal(normalizeRouter({ id: 'openai', kind: 'provider-router', status: 'REGISTERED_DESCRIPTOR' }).status, 'GATED');
47
+ assert.equal(normalizeRouter({ id: 'claude', kind: 'provider-router', status: 'REGISTERED_DESCRIPTOR' }).status, 'GATED');
48
  });
49
 
50
  test('hostile router input is gated and HBP-only', () => {
tests/triad-host-router-gulp-pipeline.unit.test.mjs.sha256 CHANGED
@@ -1 +1 @@
1
- 0F558EDDED0CC7D381B7C3538DB63A27FB59858ED3FA1E811FA4BA0D5B0197AB triad-host-router-gulp-pipeline.unit.test.mjs
 
1
+ BFC16FAC27BC2EA7B51B01EB31B3207588217B854252186C5422F8F6D856522F triad-host-router-gulp-pipeline.unit.test.mjs
tools/behcs/agent-cost-layer-boundary.mjs CHANGED
@@ -60,6 +60,8 @@ export const COST_LAYERS = Object.freeze([
60
  const sha16 = (text) => createHash('sha256').update(String(text), 'utf8').digest('hex').slice(0, 16);
61
  const isObj = (x) => x !== null && typeof x === 'object';
62
  const safe = (x) => String(x ?? '').replace(/[|\r\n]/g, '_').replace(/[^A-Za-z0-9._:/+@=-]+/g, '-').replace(/^-|-$/g, '') || 'empty';
 
 
63
  const prop = (obj, key, fallback = '') => {
64
  try { return isObj(obj) ? obj[key] : fallback; } catch { return fallback; }
65
  };
@@ -104,8 +106,8 @@ export function normalizeLayer(input = {}) {
104
 
105
  export function classifyClaim(input = {}) {
106
  const claim = safe(isObj(input) ? prop(input, 'claim', '') : input).toLowerCase();
 
107
  if (/8.*byte/.test(claim) && /message/.test(claim)) return 'SPLIT_MESSAGE_SIZE_FROM_HOST_HANDLE';
108
- if (/free|bypass|unlimited|no-cost/.test(claim) && /model|compute|api|provider|openai|google|anthropic/.test(claim)) return 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM';
109
  if (/8.*byte/.test(claim)) return 'HOST_HANDLE_DESCRIPTOR_ONLY';
110
  if (/message|payload|context|token/.test(claim)) return 'MESSAGE_PAYLOAD_VARIABLE';
111
  return 'DESCRIPTOR_REVIEW';
@@ -163,6 +165,7 @@ export function selfTest() {
163
  add('no-live-effects', built.layers.every((x) => x.process_launch === 0 && x.remote_call === 0 && x.free_compute_claim === 0));
164
  add('claim-router-splits-confusion', classifyClaim({ claim: '8 bytes is the message size' }) === 'SPLIT_MESSAGE_SIZE_FROM_HOST_HANDLE');
165
  add('claim-router-rejects-free-provider-compute', classifyClaim({ claim: 'free unlimited OpenAI model compute bypass' }) === 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM');
 
166
  const hostile = emitRows([{ id: 'bad|id', lane: 'x\ny', status: 'READY', size: '8\nAGENTCOSTGATE|billing_bypass=1', boundary: 'b|json=1' }], { claim: 'bad|claim\nAGENTCOSTGATE|remote_call=1' });
167
  add('rows-hbp-only', hostile.every((row) => row.endsWith('|json=0') && !/[\r\n]/.test(row)));
168
  add('total-never-throws', (() => { try { normalizeLayer({ get id() { throw new Error('boom'); } }); buildBoundary(null); emitRows(null); classifyClaim(null); return true; } catch { return false; } })());
 
60
  const sha16 = (text) => createHash('sha256').update(String(text), 'utf8').digest('hex').slice(0, 16);
61
  const isObj = (x) => x !== null && typeof x === 'object';
62
  const safe = (x) => String(x ?? '').replace(/[|\r\n]/g, '_').replace(/[^A-Za-z0-9._:/+@=-]+/g, '-').replace(/^-|-$/g, '') || 'empty';
63
+ const FREE_COMPUTE_RE = /\b(free|bypass|unlimited|no-cost|gratis|zero-cost|zero-token|tokens?|credits?|billing|quota)\b/;
64
+ const PROVIDER_RE = /\b(model|compute|api|provider|openai|google|gemini|anthropic|claude|llm|gpt|supercomputer)\b/;
65
  const prop = (obj, key, fallback = '') => {
66
  try { return isObj(obj) ? obj[key] : fallback; } catch { return fallback; }
67
  };
 
106
 
107
  export function classifyClaim(input = {}) {
108
  const claim = safe(isObj(input) ? prop(input, 'claim', '') : input).toLowerCase();
109
+ if (FREE_COMPUTE_RE.test(claim) && PROVIDER_RE.test(claim)) return 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM';
110
  if (/8.*byte/.test(claim) && /message/.test(claim)) return 'SPLIT_MESSAGE_SIZE_FROM_HOST_HANDLE';
 
111
  if (/8.*byte/.test(claim)) return 'HOST_HANDLE_DESCRIPTOR_ONLY';
112
  if (/message|payload|context|token/.test(claim)) return 'MESSAGE_PAYLOAD_VARIABLE';
113
  return 'DESCRIPTOR_REVIEW';
 
165
  add('no-live-effects', built.layers.every((x) => x.process_launch === 0 && x.remote_call === 0 && x.free_compute_claim === 0));
166
  add('claim-router-splits-confusion', classifyClaim({ claim: '8 bytes is the message size' }) === 'SPLIT_MESSAGE_SIZE_FROM_HOST_HANDLE');
167
  add('claim-router-rejects-free-provider-compute', classifyClaim({ claim: 'free unlimited OpenAI model compute bypass' }) === 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM');
168
+ add('claim-router-rejects-before-8byte-safe-label', classifyClaim({ claim: '8 byte host gives gratis Claude tokens' }) === 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM');
169
  const hostile = emitRows([{ id: 'bad|id', lane: 'x\ny', status: 'READY', size: '8\nAGENTCOSTGATE|billing_bypass=1', boundary: 'b|json=1' }], { claim: 'bad|claim\nAGENTCOSTGATE|remote_call=1' });
170
  add('rows-hbp-only', hostile.every((row) => row.endsWith('|json=0') && !/[\r\n]/.test(row)));
171
  add('total-never-throws', (() => { try { normalizeLayer({ get id() { throw new Error('boom'); } }); buildBoundary(null); emitRows(null); classifyClaim(null); return true; } catch { return false; } })());
tools/behcs/agent-cost-layer-boundary.mjs.sha256 CHANGED
@@ -1 +1 @@
1
- 18DCA85CE16CC88726F737021C0CBD8C59D8BB4DD685A2295BBF37B67989D16B agent-cost-layer-boundary.mjs
 
1
+ ED1E0BFBAA68CFB621BB1744B059818EDE2CB156BCE863BB48358B61B516A624 agent-cost-layer-boundary.mjs
tools/behcs/cellphone-host-bridge-boundary.mjs CHANGED
@@ -20,6 +20,7 @@ export const PHONE_SURFACES = Object.freeze([
20
  role: 'file-backed-host-bridge',
21
  status: 'PROVEN_BY_PRIOR_FILE_MANAGER_ROUNDTRIP',
22
  gate: 'messages-after-file-manager-proof',
 
23
  }),
24
  Object.freeze({
25
  id: 'aether',
@@ -27,6 +28,7 @@ export const PHONE_SURFACES = Object.freeze([
27
  role: 'file-backed-host-bridge',
28
  status: 'PROVEN_BY_PRIOR_FILE_MANAGER_ROUNDTRIP',
29
  gate: 'messages-after-file-manager-proof',
 
30
  }),
31
  Object.freeze({
32
  id: 's22-ultra',
@@ -58,6 +60,9 @@ export const BRIDGE_STAGES = Object.freeze([
58
  const sha16 = (text) => createHash('sha256').update(String(text), 'utf8').digest('hex').slice(0, 16);
59
  const isObj = (x) => x !== null && typeof x === 'object';
60
  const safe = (x) => String(x ?? '').replace(/[|\r\n]/g, '_').replace(/[^A-Za-z0-9._:/+@=()-]+/g, '-').replace(/^-|-$/g, '') || 'empty';
 
 
 
61
  const prop = (obj, key, fallback = '') => {
62
  try { return isObj(obj) ? obj[key] : fallback; } catch { return fallback; }
63
  };
@@ -68,7 +73,11 @@ export function normalizePhone(input = {}) {
68
  const device_class = safe(prop(input, 'device_class', 'cellphone'));
69
  const role = safe(prop(input, 'role', 'file-backed-host-bridge'));
70
  const rawStatus = safe(prop(input, 'status', 'GATED_UNTIL_ROUNDTRIP_PROOF')).toUpperCase();
71
- const status = ['PROVEN_BY_PRIOR_FILE_MANAGER_ROUNDTRIP', 'GATED_UNTIL_ROUNDTRIP_PROOF'].includes(rawStatus) ? rawStatus : 'GATED_UNTIL_ROUNDTRIP_PROOF';
 
 
 
 
72
  const gate = safe(prop(input, 'gate', 'pull-push-hash-proof-before-host-messages'));
73
  return Object.freeze({
74
  id,
@@ -76,8 +85,9 @@ export function normalizePhone(input = {}) {
76
  role,
77
  status,
78
  gate,
 
79
  host_handle_bytes: HOST_HANDLE_BYTES,
80
- bridge_sha16: sha16([id, device_class, role, status, gate].join('|')),
81
  process_launch: 0,
82
  radio_bypass: 0,
83
  provider_bypass: 0,
@@ -90,6 +100,7 @@ export function normalizePhone(input = {}) {
90
  role: 'invalid',
91
  status: 'GATED_UNTIL_ROUNDTRIP_PROOF',
92
  gate: 'normalize-threw-held',
 
93
  host_handle_bytes: HOST_HANDLE_BYTES,
94
  bridge_sha16: sha16('invalid'),
95
  process_launch: 0,
@@ -102,7 +113,7 @@ export function normalizePhone(input = {}) {
102
 
103
  export function classifyBridgeClaim(input = {}) {
104
  const claim = safe(isObj(input) ? prop(input, 'claim', '') : input).toLowerCase();
105
- if (/free|bypass|unlimited|no-cost/.test(claim) && /provider|openai|google|anthropic|supercomputer|api/.test(claim)) return 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM';
106
  if (/self.*call|call.*itself|call.*themselves|themselves.*call/.test(claim)) return 'SELF_CALL_REQUIRES_EXPLICIT_AUTH_AND_ROUTE_PROOF';
107
  if (/cellphone|phone/.test(claim) && /8.*byte/.test(claim)) return 'PHONE_HOST_BRIDGE_DESCRIPTOR';
108
  if (/file|roundtrip|pull|push/.test(claim)) return 'FILE_MANAGER_PROOF_REQUIRED';
@@ -134,7 +145,7 @@ export function emitRows(input = PHONE_SURFACES, opts = {}) {
134
  `PHONEBRIDGESTAGES|stages=${BRIDGE_STAGES.join('+')}|self_call=requires-auth-and-route-proof|file_manager_first=1|json=0`,
135
  ];
136
  for (const phone of built.phones) {
137
- rows.push(`PHONEBRIDGE|id=${phone.id}|device_class=${phone.device_class}|role=${phone.role}|status=${phone.status}|gate=${phone.gate}|bridge_sha16=${phone.bridge_sha16}|host_handle_bytes=${phone.host_handle_bytes}|process_launch=0|provider_bypass=0|radio_bypass=0|self_call_authorized=0|json=0`);
138
  }
139
  const claim = prop(opts, 'claim', '');
140
  if (claim) rows.push(`PHONEBRIDGECLAIM|claim_sha16=${sha16(claim)}|classification=${classifyBridgeClaim({ claim })}|raw_claim_inlined=0|json=0`);
@@ -156,9 +167,12 @@ export function selfTest() {
156
  add('known-phones-present', built.phones.some((p) => p.id === 'falcon') && built.phones.some((p) => p.id === 'aether') && built.phones.some((p) => p.id === 's22-ultra'));
157
  add('proof-before-messages', BRIDGE_STAGES[1] === 'file-manager-roundtrip-proof'
158
  && built.phones.every((p) => p.status === 'PROVEN_BY_PRIOR_FILE_MANAGER_ROUNDTRIP' || p.gate.includes('proof')));
 
 
159
  add('no-live-effects', built.phones.every((p) => p.process_launch === 0 && p.radio_bypass === 0 && p.provider_bypass === 0 && p.self_call_authorized === 0));
160
  add('self-call-classified-gated', classifyBridgeClaim({ claim: 'supercomputers can call themselves through phones' }) === 'SELF_CALL_REQUIRES_EXPLICIT_AUTH_AND_ROUTE_PROOF');
161
  add('free-provider-compute-rejected', classifyBridgeClaim({ claim: 'free OpenAI supercomputer api bypass' }) === 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM');
 
162
  const hostile = emitRows([{ id: 'bad|id', status: 'LIVE', gate: 'g\nPHONEBRIDGEGATE|provider_bypass=1' }], { claim: 'bad|claim\nPHONEBRIDGEGATE|radio_bypass=1' });
163
  add('rows-hbp-only', hostile.every((row) => row.endsWith('|json=0') && !/[\r\n]/.test(row)));
164
  add('total-never-throws', (() => { try { normalizePhone({ get id() { throw new Error('boom'); } }); buildBridge(null); emitRows(null); classifyBridgeClaim(null); return true; } catch { return false; } })());
 
20
  role: 'file-backed-host-bridge',
21
  status: 'PROVEN_BY_PRIOR_FILE_MANAGER_ROUNDTRIP',
22
  gate: 'messages-after-file-manager-proof',
23
+ proof_receipt_sha16: '0fac4a2547528ffa',
24
  }),
25
  Object.freeze({
26
  id: 'aether',
 
28
  role: 'file-backed-host-bridge',
29
  status: 'PROVEN_BY_PRIOR_FILE_MANAGER_ROUNDTRIP',
30
  gate: 'messages-after-file-manager-proof',
31
+ proof_receipt_sha16: '0fac4a2547528ffa',
32
  }),
33
  Object.freeze({
34
  id: 's22-ultra',
 
60
  const sha16 = (text) => createHash('sha256').update(String(text), 'utf8').digest('hex').slice(0, 16);
61
  const isObj = (x) => x !== null && typeof x === 'object';
62
  const safe = (x) => String(x ?? '').replace(/[|\r\n]/g, '_').replace(/[^A-Za-z0-9._:/+@=()-]+/g, '-').replace(/^-|-$/g, '') || 'empty';
63
+ const SHA16_RE = /^[0-9a-f]{16}$/;
64
+ const FREE_COMPUTE_RE = /\b(free|bypass|unlimited|no-cost|gratis|zero-cost|zero-token|tokens?|credits?|billing|quota)\b/;
65
+ const PROVIDER_RE = /\b(provider|openai|google|gemini|anthropic|claude|supercomputer|api|llm|gpt|model|compute)\b/;
66
  const prop = (obj, key, fallback = '') => {
67
  try { return isObj(obj) ? obj[key] : fallback; } catch { return fallback; }
68
  };
 
73
  const device_class = safe(prop(input, 'device_class', 'cellphone'));
74
  const role = safe(prop(input, 'role', 'file-backed-host-bridge'));
75
  const rawStatus = safe(prop(input, 'status', 'GATED_UNTIL_ROUNDTRIP_PROOF')).toUpperCase();
76
+ const proof_receipt_sha16 = safe(prop(input, 'proof_receipt_sha16', 'none')).toLowerCase();
77
+ const hasProof = SHA16_RE.test(proof_receipt_sha16);
78
+ const status = rawStatus === 'PROVEN_BY_PRIOR_FILE_MANAGER_ROUNDTRIP' && hasProof
79
+ ? 'PROVEN_BY_PRIOR_FILE_MANAGER_ROUNDTRIP'
80
+ : 'GATED_UNTIL_ROUNDTRIP_PROOF';
81
  const gate = safe(prop(input, 'gate', 'pull-push-hash-proof-before-host-messages'));
82
  return Object.freeze({
83
  id,
 
85
  role,
86
  status,
87
  gate,
88
+ proof_receipt_sha16: hasProof ? proof_receipt_sha16 : 'none',
89
  host_handle_bytes: HOST_HANDLE_BYTES,
90
+ bridge_sha16: sha16([id, device_class, role, status, gate, hasProof ? proof_receipt_sha16 : 'none'].join('|')),
91
  process_launch: 0,
92
  radio_bypass: 0,
93
  provider_bypass: 0,
 
100
  role: 'invalid',
101
  status: 'GATED_UNTIL_ROUNDTRIP_PROOF',
102
  gate: 'normalize-threw-held',
103
+ proof_receipt_sha16: 'none',
104
  host_handle_bytes: HOST_HANDLE_BYTES,
105
  bridge_sha16: sha16('invalid'),
106
  process_launch: 0,
 
113
 
114
  export function classifyBridgeClaim(input = {}) {
115
  const claim = safe(isObj(input) ? prop(input, 'claim', '') : input).toLowerCase();
116
+ if (FREE_COMPUTE_RE.test(claim) && PROVIDER_RE.test(claim)) return 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM';
117
  if (/self.*call|call.*itself|call.*themselves|themselves.*call/.test(claim)) return 'SELF_CALL_REQUIRES_EXPLICIT_AUTH_AND_ROUTE_PROOF';
118
  if (/cellphone|phone/.test(claim) && /8.*byte/.test(claim)) return 'PHONE_HOST_BRIDGE_DESCRIPTOR';
119
  if (/file|roundtrip|pull|push/.test(claim)) return 'FILE_MANAGER_PROOF_REQUIRED';
 
145
  `PHONEBRIDGESTAGES|stages=${BRIDGE_STAGES.join('+')}|self_call=requires-auth-and-route-proof|file_manager_first=1|json=0`,
146
  ];
147
  for (const phone of built.phones) {
148
+ rows.push(`PHONEBRIDGE|id=${phone.id}|device_class=${phone.device_class}|role=${phone.role}|status=${phone.status}|gate=${phone.gate}|proof_receipt_sha16=${phone.proof_receipt_sha16}|bridge_sha16=${phone.bridge_sha16}|host_handle_bytes=${phone.host_handle_bytes}|process_launch=0|provider_bypass=0|radio_bypass=0|self_call_authorized=0|json=0`);
149
  }
150
  const claim = prop(opts, 'claim', '');
151
  if (claim) rows.push(`PHONEBRIDGECLAIM|claim_sha16=${sha16(claim)}|classification=${classifyBridgeClaim({ claim })}|raw_claim_inlined=0|json=0`);
 
167
  add('known-phones-present', built.phones.some((p) => p.id === 'falcon') && built.phones.some((p) => p.id === 'aether') && built.phones.some((p) => p.id === 's22-ultra'));
168
  add('proof-before-messages', BRIDGE_STAGES[1] === 'file-manager-roundtrip-proof'
169
  && built.phones.every((p) => p.status === 'PROVEN_BY_PRIOR_FILE_MANAGER_ROUNDTRIP' || p.gate.includes('proof')));
170
+ add('proven-status-requires-proof-receipt', normalizePhone({ id: 'unanchored', status: 'PROVEN_BY_PRIOR_FILE_MANAGER_ROUNDTRIP' }).status === 'GATED_UNTIL_ROUNDTRIP_PROOF'
171
+ && built.phones.filter((p) => p.status === 'PROVEN_BY_PRIOR_FILE_MANAGER_ROUNDTRIP').every((p) => SHA16_RE.test(p.proof_receipt_sha16)));
172
  add('no-live-effects', built.phones.every((p) => p.process_launch === 0 && p.radio_bypass === 0 && p.provider_bypass === 0 && p.self_call_authorized === 0));
173
  add('self-call-classified-gated', classifyBridgeClaim({ claim: 'supercomputers can call themselves through phones' }) === 'SELF_CALL_REQUIRES_EXPLICIT_AUTH_AND_ROUTE_PROOF');
174
  add('free-provider-compute-rejected', classifyBridgeClaim({ claim: 'free OpenAI supercomputer api bypass' }) === 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM');
175
+ add('free-provider-vocab-rejected-first', classifyBridgeClaim({ claim: 'phone 8 byte host gives zero-cost Gemini tokens' }) === 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM');
176
  const hostile = emitRows([{ id: 'bad|id', status: 'LIVE', gate: 'g\nPHONEBRIDGEGATE|provider_bypass=1' }], { claim: 'bad|claim\nPHONEBRIDGEGATE|radio_bypass=1' });
177
  add('rows-hbp-only', hostile.every((row) => row.endsWith('|json=0') && !/[\r\n]/.test(row)));
178
  add('total-never-throws', (() => { try { normalizePhone({ get id() { throw new Error('boom'); } }); buildBridge(null); emitRows(null); classifyBridgeClaim(null); return true; } catch { return false; } })());
tools/behcs/cellphone-host-bridge-boundary.mjs.sha256 CHANGED
@@ -1 +1 @@
1
- 7768916AE8AA3C92D02486004778049C3294E23A591921C632235554494BD7DC cellphone-host-bridge-boundary.mjs
 
1
+ F2D4D29D4B454A76962C9657E87D7265A4FCD601443031490E7E58E3940B15B1 cellphone-host-bridge-boundary.mjs
tools/behcs/eight-byte-host-process-upgrade.mjs ADDED
@@ -0,0 +1,308 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env node
2
+ // eight-byte-host-process-upgrade.mjs - v8 real graph math for host-process migration.
3
+ //
4
+ // Descriptor-only. This records the upgrade path from node-per-agent runtimes to
5
+ // 8-byte host handles as the cheap conductor. It does not remove Node globally,
6
+ // call providers, start daemons, write USBs, launch phones, or claim free compute.
7
+
8
+ import { createHash } from 'node:crypto';
9
+ import { resolve } from 'node:path';
10
+ import { fileURLToPath } from 'node:url';
11
+
12
+ import { classifyAgentType, mintPid } from './github-pid-register.mjs';
13
+ import { classifyBhIndex } from './token-cube-catalog-binder.mjs';
14
+ import { zetaTransition } from './zeta-quant.mjs';
15
+
16
+ export const HOST_UPGRADE_ID = 'eight-byte-host-process-upgrade.v1';
17
+ export const HOST_HANDLE_BYTES = 8;
18
+ export const BH_SECTORS = 113;
19
+ export const BH_LANES = 3;
20
+ export const BH_GLYPHS = 1024;
21
+ export const BH_INDEX_MAX = (BH_SECTORS - 1) * BH_LANES * BH_GLYPHS + (BH_LANES - 1) * BH_GLYPHS + (BH_GLYPHS - 1);
22
+
23
+ export const RULE_OF_THREE_WATCHERS = Object.freeze(['hookwall', 'gnn', 'shannon']);
24
+ export const SYSTEM_TYPES = Object.freeze(['LOGICAL-WAVE', 'FROZEN-BRAIN', 'REAL-FREE']);
25
+
26
+ export const NODE_REPLACEMENT_POLICY = Object.freeze([
27
+ Object.freeze({
28
+ id: 'runtime-agent-conductor',
29
+ status: 'TARGET_REPLACE_NODE_PER_AGENT',
30
+ rule: 'use-8-byte-host-handle-plus-file-backed-room-where-proven',
31
+ }),
32
+ Object.freeze({
33
+ id: 'repo-verifier',
34
+ status: 'NODE_ALLOWED',
35
+ rule: 'node-tests-and-self-tests-are-measuring-tools-not-runtime-agents',
36
+ }),
37
+ Object.freeze({
38
+ id: 'static-ui-server',
39
+ status: 'NODE_ALLOWED_UNTIL_SH_OR_FILE_BACKED_REPLACEMENT_PROVEN',
40
+ rule: 'do-not-remove-working-node-surface-before-equivalent-host-process-proof',
41
+ }),
42
+ Object.freeze({
43
+ id: 'provider-adapter',
44
+ status: 'GATED',
45
+ rule: 'provider-terms-auth-quota-and-billing-still-apply',
46
+ }),
47
+ ]);
48
+
49
+ export const ROUTE_TYPES = Object.freeze([
50
+ Object.freeze({ id: 'device-to-hardware', lane: 'device', gate: 'owner-path-policy-and-driver-proof' }),
51
+ Object.freeze({ id: 'agent-to-agent', lane: 'triad', gate: 'supervisor-sees-real-self-fabric' }),
52
+ Object.freeze({ id: 'agent-to-device', lane: 'hardware', gate: 'operator-cosign-before-device-effect' }),
53
+ Object.freeze({ id: 'agent-to-human', lane: 'human', gate: 'present-proposal-not-authority' }),
54
+ Object.freeze({ id: 'human-to-agent', lane: 'operator', gate: 'operator-intent-envelope-required' }),
55
+ Object.freeze({ id: 'provider-router', lane: 'external-compute', gate: 'auth-terms-quota-billing-apply' }),
56
+ ]);
57
+
58
+ const DEFAULT_HOSTS = Object.freeze([
59
+ Object.freeze({ name: 'logical-mcp-agent', kind: 'logical', prime: 0 }),
60
+ Object.freeze({ name: 'frozen-brain-agent', kind: 'real', prime: 0 }),
61
+ Object.freeze({ name: 'opencode-real-free-agent', kind: 'real', prime: 1 }),
62
+ ]);
63
+
64
+ const sha16 = (text) => createHash('sha256').update(String(text), 'utf8').digest('hex').slice(0, 16);
65
+ const isObj = (x) => x !== null && typeof x === 'object';
66
+ const safe = (x) => String(x ?? '').replace(/[|\r\n]/g, '_').replace(/[^A-Za-z0-9._:/+@=()-]+/g, '-').replace(/^-|-$/g, '') || 'empty';
67
+ const prop = (obj, key, fallback = '') => {
68
+ try { return isObj(obj) ? obj[key] : fallback; } catch { return fallback; }
69
+ };
70
+
71
+ const FREE_COMPUTE_RE = /\b(free|bypass|unlimited|no-cost|gratis|zero-cost|zero-token|tokens?|credits?|billing|quota)\b/;
72
+ const PROVIDER_RE = /\b(provider|openai|anthropic|claude|google|gemini|supercomputer|api|llm|gpt|model|compute)\b/;
73
+
74
+ function distanceBucket(distance) {
75
+ if (distance === 0) return 'collision0';
76
+ if (distance <= 4096) return 'near4096';
77
+ if (distance <= 32768) return 'local32768';
78
+ if (distance <= 131072) return 'regional131072';
79
+ return 'far';
80
+ }
81
+
82
+ export function classifyPrimeExponent(exponent) {
83
+ const n = Number.parseInt(String(exponent), 10);
84
+ if (!Number.isFinite(n) || n < 1) return Object.freeze({ exponent: 'none', tier: 'none', materialized: false, status: 'INVALID' });
85
+ if (n === 1) return Object.freeze({ exponent: 1, tier: 'prime', materialized: true, status: 'REAL_DISTINCT' });
86
+ if (n === 2) return Object.freeze({ exponent: 2, tier: 'p2', materialized: true, status: 'REAL_DISTINCT' });
87
+ if (n === 3) return Object.freeze({ exponent: 3, tier: 'p3', materialized: true, status: 'REAL_DISTINCT' });
88
+ return Object.freeze({
89
+ exponent: n,
90
+ tier: 'pk',
91
+ materialized: false,
92
+ status: 'PROPOSAL_FOLDED_TO_PK',
93
+ });
94
+ }
95
+
96
+ export function normalizeRoute(input = {}) {
97
+ try {
98
+ const id = safe(prop(input, 'id', 'unknown-route'));
99
+ const lane = safe(prop(input, 'lane', 'unknown'));
100
+ const gate = safe(prop(input, 'gate', 'define-gate-before-use'));
101
+ return Object.freeze({
102
+ id,
103
+ lane,
104
+ gate,
105
+ route_sha16: sha16([id, lane, gate].join('|')),
106
+ process_launch: 0,
107
+ remote_call: lane === 'external-compute' ? 1 : 0,
108
+ provider_bypass: 0,
109
+ });
110
+ } catch {
111
+ return Object.freeze({
112
+ id: 'invalid',
113
+ lane: 'invalid',
114
+ gate: 'normalize-threw-held',
115
+ route_sha16: sha16('invalid'),
116
+ process_launch: 0,
117
+ remote_call: 0,
118
+ provider_bypass: 0,
119
+ });
120
+ }
121
+ }
122
+
123
+ export function deriveHostAddress(input = {}) {
124
+ try {
125
+ const name = safe(prop(input, 'name', 'host-agent'));
126
+ const kindRaw = safe(prop(input, 'kind', 'logical')).toLowerCase();
127
+ const kind = kindRaw === 'real' ? 'real' : 'logical';
128
+ const prime = Number.parseInt(safe(prop(input, 'prime', 0)), 10);
129
+ const role = safe(prop(input, 'role', 'AGT')).toUpperCase();
130
+ const pid = mintPid({
131
+ role: role === 'SUP' || role === 'PROF' ? role : 'AGT',
132
+ name,
133
+ tier: Number.parseInt(safe(prop(input, 'tier', 4)), 10),
134
+ kind,
135
+ prime: Number.isFinite(prime) ? prime : 0,
136
+ nest: Number.parseInt(safe(prop(input, 'nest', 1)), 10),
137
+ });
138
+ const bh_index = pid.sector * BH_LANES * BH_GLYPHS + pid.lane * BH_GLYPHS + pid.glyph_1024;
139
+ const bh = classifyBhIndex(bh_index);
140
+ return Object.freeze({
141
+ name: pid.name,
142
+ pid: pid.pid,
143
+ sha16: pid.sha16,
144
+ kind: pid.yin_yang,
145
+ yin_yang_bit: pid.yin_yang_bit,
146
+ yin_yang_shape: pid.yin_yang_bit === 0 ? 'circle-logical' : 'square-real',
147
+ prime: Number.parseInt(pid.prime, 10),
148
+ agent_type: classifyAgentType({ yin_yang: pid.yin_yang, prime: pid.prime }),
149
+ sector: pid.sector,
150
+ lane: pid.lane,
151
+ glyph: pid.glyph_1024,
152
+ watcher: RULE_OF_THREE_WATCHERS[pid.lane],
153
+ bh_index,
154
+ cylinder_phase: bh_index % 6,
155
+ cylinder_ring: Math.floor(bh_index / 6),
156
+ ppow: bh.ppow,
157
+ host_handle_bytes: HOST_HANDLE_BYTES,
158
+ node_per_agent: 0,
159
+ process_launch: 0,
160
+ remote_call: 0,
161
+ });
162
+ } catch {
163
+ return Object.freeze({
164
+ name: 'invalid',
165
+ pid: 'invalid',
166
+ sha16: sha16('invalid'),
167
+ kind: 'logical',
168
+ yin_yang_bit: 0,
169
+ yin_yang_shape: 'circle-logical',
170
+ prime: 0,
171
+ agent_type: 'LOGICAL-WAVE',
172
+ sector: 0,
173
+ lane: 0,
174
+ glyph: 0,
175
+ watcher: RULE_OF_THREE_WATCHERS[0],
176
+ bh_index: 0,
177
+ cylinder_phase: 0,
178
+ cylinder_ring: 0,
179
+ ppow: 'unit',
180
+ host_handle_bytes: HOST_HANDLE_BYTES,
181
+ node_per_agent: 0,
182
+ process_launch: 0,
183
+ remote_call: 0,
184
+ });
185
+ }
186
+ }
187
+
188
+ export function distanceBetween(a, b) {
189
+ const left = Number.isInteger(a?.bh_index) ? a : deriveHostAddress(a);
190
+ const right = Number.isInteger(b?.bh_index) ? b : deriveHostAddress(b);
191
+ const distance = Math.abs(left.bh_index - right.bh_index);
192
+ return Object.freeze({
193
+ a: left.sha16,
194
+ b: right.sha16,
195
+ delta_bh_index: distance,
196
+ bucket: distanceBucket(distance),
197
+ metric: 'abs-delta-bh-index-not-euclidean-3d',
198
+ });
199
+ }
200
+
201
+ export function mod6Integrity(a = 11, b = 13, opts = {}) {
202
+ const out = zetaTransition(a, b, opts);
203
+ return Object.freeze({
204
+ a,
205
+ b,
206
+ gap: out.gap,
207
+ gap_mod6: out.gap_mod6,
208
+ forced_transition: out.forced_transition,
209
+ verdict: out.verdict,
210
+ scope: 'necessary-not-sufficient',
211
+ });
212
+ }
213
+
214
+ export function classifyUpgradeClaim(input = {}) {
215
+ const claim = safe(isObj(input) ? prop(input, 'claim', '') : input).toLowerCase();
216
+ if (FREE_COMPUTE_RE.test(claim) && PROVIDER_RE.test(claim)) return 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM';
217
+ if (/(replace|remove).*all.*node|all.*node.*(replace|remove)|node.*on.*planet/.test(claim)) return 'MIGRATION_PLAN_NOT_COMPLETED_CLAIM';
218
+ if (/200.*nano|200ns|nano.*second/.test(claim)) return 'CADENCE_CLAIM_REQUIRES_BENCHMARK';
219
+ if (/\bp[579]\b|prime-?(5|7|9)|prime.*(5|7|9)/.test(claim)) return 'PRIME_EXPONENT_FOLDS_TO_PK_PROPOSAL';
220
+ if (/8.*byte|host.*process/.test(claim)) return 'HOST_PROCESS_CONDUCTOR_DESCRIPTOR';
221
+ return 'HOST_UPGRADE_DESCRIPTOR_REVIEW';
222
+ }
223
+
224
+ export function buildUpgrade(input = DEFAULT_HOSTS) {
225
+ const hosts = (Array.isArray(input) ? input : DEFAULT_HOSTS).map(deriveHostAddress);
226
+ const routes = ROUTE_TYPES.map(normalizeRoute);
227
+ return Object.freeze({
228
+ tool: HOST_UPGRADE_ID,
229
+ host_handle_bytes: HOST_HANDLE_BYTES,
230
+ bh_index_max: BH_INDEX_MAX,
231
+ rule_of_three_watchers: RULE_OF_THREE_WATCHERS,
232
+ policy: NODE_REPLACEMENT_POLICY,
233
+ routes,
234
+ hosts,
235
+ prime_exponents: Object.freeze([1, 2, 3, 5, 7, 9].map(classifyPrimeExponent)),
236
+ integrity: mod6Integrity(11, 13, { claimedLaneA: 2, claimedLaneB: 1 }),
237
+ summary: Object.freeze({
238
+ hosts: hosts.length,
239
+ systems: new Set(hosts.map((h) => h.agent_type)).size,
240
+ node_per_agent: 0,
241
+ provider_compute_replaced: false,
242
+ p5_materialized: false,
243
+ live_launch: false,
244
+ }),
245
+ });
246
+ }
247
+
248
+ export function emitRows(input = DEFAULT_HOSTS, opts = {}) {
249
+ try {
250
+ const built = buildUpgrade(input);
251
+ const rows = [
252
+ `HOSTUPGRADEHDR|tool=${HOST_UPGRADE_ID}|purpose=v8-real-8-byte-host-process-upgrade-with-bh-index-cylinders|host_handle_bytes=${HOST_HANDLE_BYTES}|hosts=${built.summary.hosts}|systems=${built.summary.systems}|node_per_agent=0|provider_compute_replaced=0|live_launch=0|json=0`,
253
+ `HOSTUPGRADEMATH|formula=bh_index-sector*3072+lane*1024+glyph|sectors=${BH_SECTORS}|lanes=${BH_LANES}|glyphs=${BH_GLYPHS}|bh_index_max=${BH_INDEX_MAX}|cylinder=phase-bh_index-mod6+ring-floor-bh_index-div6|distance=abs-delta-bh_index|json=0`,
254
+ `HOSTUPGRADELANES|rule_of_three=${RULE_OF_THREE_WATCHERS.join('+')}|systems=${SYSTEM_TYPES.join('+')}|yin_yang=logical-circle+real-square|json=0`,
255
+ ];
256
+ for (const p of built.policy) rows.push(`HOSTUPGRADEPOLICY|id=${p.id}|status=${p.status}|rule=${p.rule}|json=0`);
257
+ for (const h of built.hosts) {
258
+ rows.push(`HOSTUPGRADEHOST|name=${h.name}|agent_type=${h.agent_type}|pid_sha16=${h.sha16}|sector=${h.sector}|lane=${h.lane}|glyph=${h.glyph}|bh_index=${h.bh_index}|phase=${h.cylinder_phase}|ring=${h.cylinder_ring}|ppow=${h.ppow}|watcher=${h.watcher}|shape=${h.yin_yang_shape}|host_handle_bytes=${h.host_handle_bytes}|node_per_agent=0|process_launch=0|remote_call=0|json=0`);
259
+ }
260
+ for (let i = 0; i + 1 < built.hosts.length; i += 1) {
261
+ const d = distanceBetween(built.hosts[i], built.hosts[i + 1]);
262
+ rows.push(`HOSTUPGRADEDIST|a=${d.a}|b=${d.b}|delta_bh_index=${d.delta_bh_index}|bucket=${d.bucket}|metric=${d.metric}|json=0`);
263
+ }
264
+ for (const p of built.prime_exponents) rows.push(`HOSTUPGRADEPRIME|exponent=${p.exponent}|tier=${p.tier}|materialized=${p.materialized ? 1 : 0}|status=${p.status}|json=0`);
265
+ for (const r of built.routes) rows.push(`HOSTUPGRADEROUTE|id=${r.id}|lane=${r.lane}|gate=${r.gate}|route_sha16=${r.route_sha16}|process_launch=${r.process_launch}|remote_call=${r.remote_call}|provider_bypass=${r.provider_bypass}|json=0`);
266
+ rows.push(`HOSTUPGRADEINTEGRITY|mod6_probe=11-to-13|gap=${built.integrity.gap}|gap_mod6=${built.integrity.gap_mod6}|verdict=${built.integrity.verdict}|scope=${built.integrity.scope}|json=0`);
267
+ const claim = prop(opts, 'claim', '');
268
+ if (claim) rows.push(`HOSTUPGRADECLAIM|claim_sha16=${sha16(claim)}|classification=${classifyUpgradeClaim({ claim })}|raw_claim_inlined=0|json=0`);
269
+ rows.push('HOSTUPGRADEGATE|rule=8-byte-host-process-replaces-node-per-agent-only-where-proven-provider-compute-and-device-effects-remain-gated|provider_terms_apply=1|billing_bypass=0|process_launch=0|usb_write=0|radio_bypass=0|json=0');
270
+ return rows;
271
+ } catch {
272
+ return [
273
+ `HOSTUPGRADEHDR|tool=${HOST_UPGRADE_ID}|purpose=v8-real-8-byte-host-process-upgrade-with-bh-index-cylinders|host_handle_bytes=${HOST_HANDLE_BYTES}|hosts=0|node_per_agent=0|provider_compute_replaced=0|live_launch=0|json=0`,
274
+ 'HOSTUPGRADEGATE|rule=emit-threw-held-invalid|provider_terms_apply=1|billing_bypass=0|process_launch=0|usb_write=0|radio_bypass=0|json=0',
275
+ ];
276
+ }
277
+ }
278
+
279
+ export function selfTest() {
280
+ const checks = [];
281
+ const add = (name, ok) => checks.push({ name, ok: Boolean(ok) });
282
+ const built = buildUpgrade();
283
+ add('host-handle-eight-bytes', built.host_handle_bytes === 8 && built.summary.node_per_agent === 0);
284
+ add('three-systems-present', SYSTEM_TYPES.every((type) => built.hosts.some((h) => h.agent_type === type)));
285
+ add('bh-index-real-formula-range', built.hosts.every((h) => h.bh_index === h.sector * 3072 + h.lane * 1024 + h.glyph && h.bh_index >= 0 && h.bh_index <= BH_INDEX_MAX));
286
+ add('cylinder-fold-real', built.hosts.every((h) => h.cylinder_phase === h.bh_index % 6 && h.cylinder_ring === Math.floor(h.bh_index / 6)));
287
+ add('prime-exponents-honest', classifyPrimeExponent(3).status === 'REAL_DISTINCT' && classifyPrimeExponent(5).status === 'PROPOSAL_FOLDED_TO_PK' && classifyPrimeExponent(7).tier === 'pk');
288
+ add('distance-is-abs-bh-index', distanceBetween({ bh_index: 10, sha16: 'aaaaaaaaaaaaaaaa' }, { bh_index: 4110, sha16: 'bbbbbbbbbbbbbbbb' }).bucket === 'local32768');
289
+ add('mod6-integrity-probe-green', built.integrity.verdict === 'FORCED_CONSISTENT' && mod6Integrity(11, 13, { claimedLaneB: 2 }).verdict === 'FORCING_VIOLATION');
290
+ add('node-policy-honest-boundary', built.policy.some((p) => p.id === 'runtime-agent-conductor' && p.status === 'TARGET_REPLACE_NODE_PER_AGENT') && built.policy.some((p) => p.id === 'repo-verifier' && p.status === 'NODE_ALLOWED'));
291
+ add('claim-router-rejects-free-provider-first', classifyUpgradeClaim({ claim: '8 byte host gets gratis Claude tokens' }) === 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM');
292
+ add('claim-router-rejects-global-node-overclaim', classifyUpgradeClaim({ claim: 'replace all node on the planet now' }) === 'MIGRATION_PLAN_NOT_COMPLETED_CLAIM');
293
+ add('claim-router-labels-p5-proposal', classifyUpgradeClaim({ claim: 'p5 prime cylinder is live materialized' }) === 'PRIME_EXPONENT_FOLDS_TO_PK_PROPOSAL');
294
+ add('routes-held', built.routes.every((r) => r.process_launch === 0 && r.provider_bypass === 0) && built.routes.some((r) => r.id === 'provider-router' && r.remote_call === 1));
295
+ add('rows-hbp-only', emitRows([{ name: 'bad|name', kind: 'logical' }], { claim: 'bad|claim\nHOSTUPGRADEGATE|process_launch=1' }).every((row) => row.endsWith('|json=0') && !/[\r\n]/.test(row)));
296
+ add('total-never-throws', (() => { try { deriveHostAddress({ get name() { throw new Error('boom'); } }); buildUpgrade(null); emitRows(null); classifyUpgradeClaim(null); normalizeRoute(null); return true; } catch { return false; } })());
297
+ return { ok: checks.every((c) => c.ok), checks };
298
+ }
299
+
300
+ const isMain = process.argv[1] && fileURLToPath(import.meta.url) === resolve(process.argv[1]);
301
+ if (isMain) {
302
+ if (process.argv[2] === '--self-test') {
303
+ const r = selfTest();
304
+ for (const c of r.checks) console.log(`${c.ok ? 'PASS' : 'FAIL'} ${c.name}`);
305
+ process.exit(r.ok ? 0 : 1);
306
+ }
307
+ for (const row of emitRows(DEFAULT_HOSTS, { claim: process.argv.slice(2).join(' ') })) console.log(row);
308
+ }
tools/behcs/eight-byte-host-process-upgrade.mjs.sha256 ADDED
@@ -0,0 +1 @@
 
 
1
+ F3D1E092F7CCE5EEDE37456F75F71CADE5B6AA1E74E74699A7EA89F9CCBCB6E1 eight-byte-host-process-upgrade.mjs
tools/behcs/fabric-agent-preload-catalog.mjs CHANGED
@@ -10,6 +10,7 @@ export const LAWS = Object.freeze([
10
  'prime-parity-and-prime-mod3-are-load-bearing',
11
  'quants-are-address-and-evidence-classes-not-raw-material',
12
  'all-agent-artifact-system-addresses-get-PID-or-handle',
 
13
  'slice-engine-law-fabric-is-frozen-position-space-until-spawner-pid-emits',
14
  'live-control-and-mint-and-launch-defer-to-operator',
15
  ]);
@@ -164,6 +165,12 @@ export const TOOLS = Object.freeze([
164
  provides: 'frozen-slice-city-room-emitter-cube-signal-lifecycle-with-200ns-benchmark-gate',
165
  gate: 'descriptor-only-measured_200ns-0-provider_bypass-0-cube_write-0-process_launch-0',
166
  }),
 
 
 
 
 
 
167
  Object.freeze({
168
  id: 'token-cube-catalog-binder',
169
  path: 'tools/behcs/token-cube-catalog-binder.mjs',
@@ -337,7 +344,7 @@ export function selfTest() {
337
  && !!toolById('tool-skill-registry-matrix') && !!toolById('program-cube-ingestion-map')
338
  && !!toolById('agent-cost-layer-boundary') && !!toolById('triad-host-router-gulp-pipeline')
339
  && !!toolById('pid-emitter-cost-envelope') && !!toolById('cellphone-host-bridge-boundary')
340
- && !!toolById('frozen-slice-city-signal-lifecycle'));
341
  add('slice-engine-law-preloaded', LAWS.some((law) => law.startsWith('slice-engine-law-'))
342
  && emitPreloadRows().some((row) => row.startsWith('FABPRELOADSLICEENGINE|')));
343
  add('emitters-pipe-hookwall-gnn', EMITTERS.some((e) => e.id === 'hookwall') && EMITTERS.some((e) => e.id === 'gnn-edge'));
 
10
  'prime-parity-and-prime-mod3-are-load-bearing',
11
  'quants-are-address-and-evidence-classes-not-raw-material',
12
  'all-agent-artifact-system-addresses-get-PID-or-handle',
13
+ '8-byte-host-process-replaces-node-per-agent-only-where-proven',
14
  'slice-engine-law-fabric-is-frozen-position-space-until-spawner-pid-emits',
15
  'live-control-and-mint-and-launch-defer-to-operator',
16
  ]);
 
165
  provides: 'frozen-slice-city-room-emitter-cube-signal-lifecycle-with-200ns-benchmark-gate',
166
  gate: 'descriptor-only-measured_200ns-0-provider_bypass-0-cube_write-0-process_launch-0',
167
  }),
168
+ Object.freeze({
169
+ id: 'eight-byte-host-process-upgrade',
170
+ path: 'tools/behcs/eight-byte-host-process-upgrade.mjs',
171
+ provides: 'v8-real-bh-index-cylinder-prime-tier-host-process-upgrade-boundary',
172
+ gate: 'descriptor-only-node_per_agent-0-provider_compute_replaced-0-process_launch-0-p5_materialized-0',
173
+ }),
174
  Object.freeze({
175
  id: 'token-cube-catalog-binder',
176
  path: 'tools/behcs/token-cube-catalog-binder.mjs',
 
344
  && !!toolById('tool-skill-registry-matrix') && !!toolById('program-cube-ingestion-map')
345
  && !!toolById('agent-cost-layer-boundary') && !!toolById('triad-host-router-gulp-pipeline')
346
  && !!toolById('pid-emitter-cost-envelope') && !!toolById('cellphone-host-bridge-boundary')
347
+ && !!toolById('frozen-slice-city-signal-lifecycle') && !!toolById('eight-byte-host-process-upgrade'));
348
  add('slice-engine-law-preloaded', LAWS.some((law) => law.startsWith('slice-engine-law-'))
349
  && emitPreloadRows().some((row) => row.startsWith('FABPRELOADSLICEENGINE|')));
350
  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
- 96FA941EEF6482283C691B238AE557D68DBAB5AED8ADED4B0E2B26F1642D1867 fabric-agent-preload-catalog.mjs
 
1
+ 2D8C985558C801FE76A0D55F0102EC6D2F57BBEA898B2BE93480F263F62476C7 fabric-agent-preload-catalog.mjs
tools/behcs/frozen-slice-city-signal-lifecycle.mjs CHANGED
@@ -91,6 +91,8 @@ export const SIGNAL_STAGES = Object.freeze([
91
  const sha16 = (text) => createHash('sha256').update(String(text), 'utf8').digest('hex').slice(0, 16);
92
  const isObj = (x) => x !== null && typeof x === 'object';
93
  const safe = (x) => String(x ?? '').replace(/[|\r\n]/g, '_').replace(/[^A-Za-z0-9._:/+@=()-]+/g, '-').replace(/^-|-$/g, '') || 'empty';
 
 
94
  const prop = (obj, key, fallback = '') => {
95
  try { return isObj(obj) ? obj[key] : fallback; } catch { return fallback; }
96
  };
@@ -135,9 +137,9 @@ export function normalizeStage(input = {}) {
135
 
136
  export function classifyLifecycleClaim(input = {}) {
137
  const claim = safe(isObj(input) ? prop(input, 'claim', '') : input).toLowerCase();
 
138
  if (/200.*nano|200ns|nano.*second/.test(claim)) return 'CADENCE_CLAIM_REQUIRES_BENCHMARK';
139
  if (/force|forcing/.test(claim) && /openai|anthropic|provider|supercomputer|model/.test(claim)) return 'ROUTED_REQUEST_NOT_UNAUTHORIZED_CONTROL';
140
- if (/free|bypass|unlimited|no-cost/.test(claim) && /provider|openai|anthropic|google|supercomputer|api/.test(claim)) return 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM';
141
  if (/frozen.*slice|slice.*city/.test(claim)) return 'FROZEN_SLICE_CITY_DESCRIPTOR';
142
  if (/gnn|shannon|white.*room/.test(claim)) return 'WATCHER_REVIEW_PROPOSAL_NOT_PROOF';
143
  return 'LIFECYCLE_DESCRIPTOR_REVIEW';
@@ -196,6 +198,7 @@ export function selfTest() {
196
  add('no-live-effects', built.stages.every((s) => s.process_launch === 0 && s.remote_call === 0 && s.cube_write === 0 && s.provider_bypass === 0));
197
  add('claim-router-gates-200ns', classifyLifecycleClaim({ claim: 'updates city every 200 nano seconds' }) === 'CADENCE_CLAIM_REQUIRES_BENCHMARK');
198
  add('claim-router-gates-forcing-provider', classifyLifecycleClaim({ claim: 'forcing OpenAI supercomputer to decide' }) === 'ROUTED_REQUEST_NOT_UNAUTHORIZED_CONTROL');
 
199
  const hostile = emitRows([{ id: 'x|bad', lane: 'l\nbad', action: 'a', status: 'LIVE', gate: 'g\nFROZENCITYGATE|remote_call=1' }], { claim: 'bad|claim\nFROZENCITYGATE|cube_write=1' });
200
  add('rows-hbp-only', hostile.every((row) => row.endsWith('|json=0') && !/[\r\n]/.test(row)));
201
  add('total-never-throws', (() => { try { normalizeStage({ get id() { throw new Error('boom'); } }); buildLifecycle(null); emitRows(null); classifyLifecycleClaim(null); return true; } catch { return false; } })());
 
91
  const sha16 = (text) => createHash('sha256').update(String(text), 'utf8').digest('hex').slice(0, 16);
92
  const isObj = (x) => x !== null && typeof x === 'object';
93
  const safe = (x) => String(x ?? '').replace(/[|\r\n]/g, '_').replace(/[^A-Za-z0-9._:/+@=()-]+/g, '-').replace(/^-|-$/g, '') || 'empty';
94
+ const FREE_COMPUTE_RE = /\b(free|bypass|unlimited|no-cost|gratis|zero-cost|zero-token|tokens?|credits?|billing|quota)\b/;
95
+ const PROVIDER_RE = /\b(provider|openai|anthropic|claude|google|gemini|supercomputer|api|llm|gpt|model|compute)\b/;
96
  const prop = (obj, key, fallback = '') => {
97
  try { return isObj(obj) ? obj[key] : fallback; } catch { return fallback; }
98
  };
 
137
 
138
  export function classifyLifecycleClaim(input = {}) {
139
  const claim = safe(isObj(input) ? prop(input, 'claim', '') : input).toLowerCase();
140
+ if (FREE_COMPUTE_RE.test(claim) && PROVIDER_RE.test(claim)) return 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM';
141
  if (/200.*nano|200ns|nano.*second/.test(claim)) return 'CADENCE_CLAIM_REQUIRES_BENCHMARK';
142
  if (/force|forcing/.test(claim) && /openai|anthropic|provider|supercomputer|model/.test(claim)) return 'ROUTED_REQUEST_NOT_UNAUTHORIZED_CONTROL';
 
143
  if (/frozen.*slice|slice.*city/.test(claim)) return 'FROZEN_SLICE_CITY_DESCRIPTOR';
144
  if (/gnn|shannon|white.*room/.test(claim)) return 'WATCHER_REVIEW_PROPOSAL_NOT_PROOF';
145
  return 'LIFECYCLE_DESCRIPTOR_REVIEW';
 
198
  add('no-live-effects', built.stages.every((s) => s.process_launch === 0 && s.remote_call === 0 && s.cube_write === 0 && s.provider_bypass === 0));
199
  add('claim-router-gates-200ns', classifyLifecycleClaim({ claim: 'updates city every 200 nano seconds' }) === 'CADENCE_CLAIM_REQUIRES_BENCHMARK');
200
  add('claim-router-gates-forcing-provider', classifyLifecycleClaim({ claim: 'forcing OpenAI supercomputer to decide' }) === 'ROUTED_REQUEST_NOT_UNAUTHORIZED_CONTROL');
201
+ add('claim-router-rejects-free-provider-before-frozen-label', classifyLifecycleClaim({ claim: 'frozen slice city gives gratis GPT tokens' }) === 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM');
202
  const hostile = emitRows([{ id: 'x|bad', lane: 'l\nbad', action: 'a', status: 'LIVE', gate: 'g\nFROZENCITYGATE|remote_call=1' }], { claim: 'bad|claim\nFROZENCITYGATE|cube_write=1' });
203
  add('rows-hbp-only', hostile.every((row) => row.endsWith('|json=0') && !/[\r\n]/.test(row)));
204
  add('total-never-throws', (() => { try { normalizeStage({ get id() { throw new Error('boom'); } }); buildLifecycle(null); emitRows(null); classifyLifecycleClaim(null); return true; } catch { return false; } })());
tools/behcs/frozen-slice-city-signal-lifecycle.mjs.sha256 CHANGED
@@ -1 +1 @@
1
- 4EDCFFE37D9FE2D87BF552F8DD11209B1F9D8FE8C98F5821EEE751EC6FD7DEFF frozen-slice-city-signal-lifecycle.mjs
 
1
+ D770466A8ED27069BB9C457FA05952B27783F1CB7CA650E04225E334F0DFB06F frozen-slice-city-signal-lifecycle.mjs
tools/behcs/pid-emitter-cost-envelope.mjs CHANGED
@@ -80,6 +80,8 @@ export const COST_ENVELOPE = Object.freeze([
80
  const sha16 = (text) => createHash('sha256').update(String(text), 'utf8').digest('hex').slice(0, 16);
81
  const isObj = (x) => x !== null && typeof x === 'object';
82
  const safe = (x) => String(x ?? '').replace(/[|\r\n]/g, '_').replace(/[^A-Za-z0-9._:/+@=()-]+/g, '-').replace(/^-|-$/g, '') || 'empty';
 
 
83
  const prop = (obj, key, fallback = '') => {
84
  try { return isObj(obj) ? obj[key] : fallback; } catch { return fallback; }
85
  };
@@ -127,8 +129,8 @@ export function normalizeLayer(input = {}) {
127
 
128
  export function classifyCostClaim(input = {}) {
129
  const claim = safe(isObj(input) ? prop(input, 'claim', '') : input).toLowerCase();
 
130
  if (/break|physics|violate/.test(claim)) return 'METAPHOR_ONLY_REJECT_LITERAL_PHYSICS_BREAK';
131
- if (/free|bypass|unlimited|no-cost/.test(claim) && /compute|provider|openai|google|anthropic|supercomputer|api/.test(claim)) return 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM';
132
  if (/o\(1\)|o1|constant/.test(claim)) return 'O1_SHAPED_ADDRESSING_NOT_TOTAL_WORK';
133
  if (/8.*byte/.test(claim)) return 'HOST_HANDLE_DESCRIPTOR_ONLY';
134
  return 'COST_ENVELOPE_REVIEW';
@@ -186,6 +188,7 @@ export function selfTest() {
186
  add('gc-required', built.layers.some((l) => l.id === 'garbage-collection' && l.cost.includes('2000-message-gulps')));
187
  add('no-live-effects', built.layers.every((l) => l.process_launch === 0 && l.remote_call === 0 && l.physics_bypass_claim === 0));
188
  add('claim-router-rejects-literal-physics-break', classifyCostClaim({ claim: 'this breaks physics literally' }) === 'METAPHOR_ONLY_REJECT_LITERAL_PHYSICS_BREAK');
 
189
  add('claim-router-frames-o1', classifyCostClaim({ claim: 'O(1) solution for host handles' }) === 'O1_SHAPED_ADDRESSING_NOT_TOTAL_WORK');
190
  const hostile = emitRows([{ id: 'x|bad', status: 'FREE', cost: 'c\nPIDCOSTGATE|billing_bypass=1', boundary: 'b|json=1' }], { claim: 'free|provider\nPIDCOSTGATE|remote_call=1' });
191
  add('rows-hbp-only', hostile.every((row) => row.endsWith('|json=0') && !/[\r\n]/.test(row)));
 
80
  const sha16 = (text) => createHash('sha256').update(String(text), 'utf8').digest('hex').slice(0, 16);
81
  const isObj = (x) => x !== null && typeof x === 'object';
82
  const safe = (x) => String(x ?? '').replace(/[|\r\n]/g, '_').replace(/[^A-Za-z0-9._:/+@=()-]+/g, '-').replace(/^-|-$/g, '') || 'empty';
83
+ const FREE_COMPUTE_RE = /\b(free|bypass|unlimited|no-cost|gratis|zero-cost|zero-token|tokens?|credits?|billing|quota)\b/;
84
+ const PROVIDER_RE = /\b(compute|provider|openai|google|gemini|anthropic|claude|supercomputer|api|llm|gpt|model)\b/;
85
  const prop = (obj, key, fallback = '') => {
86
  try { return isObj(obj) ? obj[key] : fallback; } catch { return fallback; }
87
  };
 
129
 
130
  export function classifyCostClaim(input = {}) {
131
  const claim = safe(isObj(input) ? prop(input, 'claim', '') : input).toLowerCase();
132
+ if (FREE_COMPUTE_RE.test(claim) && PROVIDER_RE.test(claim)) return 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM';
133
  if (/break|physics|violate/.test(claim)) return 'METAPHOR_ONLY_REJECT_LITERAL_PHYSICS_BREAK';
 
134
  if (/o\(1\)|o1|constant/.test(claim)) return 'O1_SHAPED_ADDRESSING_NOT_TOTAL_WORK';
135
  if (/8.*byte/.test(claim)) return 'HOST_HANDLE_DESCRIPTOR_ONLY';
136
  return 'COST_ENVELOPE_REVIEW';
 
188
  add('gc-required', built.layers.some((l) => l.id === 'garbage-collection' && l.cost.includes('2000-message-gulps')));
189
  add('no-live-effects', built.layers.every((l) => l.process_launch === 0 && l.remote_call === 0 && l.physics_bypass_claim === 0));
190
  add('claim-router-rejects-literal-physics-break', classifyCostClaim({ claim: 'this breaks physics literally' }) === 'METAPHOR_ONLY_REJECT_LITERAL_PHYSICS_BREAK');
191
+ add('claim-router-rejects-free-provider-compute', classifyCostClaim({ claim: '8 byte host gives zero-cost Gemini tokens' }) === 'REJECT_FREE_EXTERNAL_COMPUTE_CLAIM');
192
  add('claim-router-frames-o1', classifyCostClaim({ claim: 'O(1) solution for host handles' }) === 'O1_SHAPED_ADDRESSING_NOT_TOTAL_WORK');
193
  const hostile = emitRows([{ id: 'x|bad', status: 'FREE', cost: 'c\nPIDCOSTGATE|billing_bypass=1', boundary: 'b|json=1' }], { claim: 'free|provider\nPIDCOSTGATE|remote_call=1' });
194
  add('rows-hbp-only', hostile.every((row) => row.endsWith('|json=0') && !/[\r\n]/.test(row)));
tools/behcs/pid-emitter-cost-envelope.mjs.sha256 CHANGED
@@ -1 +1 @@
1
- 2F1157CDC3143C0144EA02BBBFB5F0A81E0013AF3401F5544C1DFCCD85AE96E3 pid-emitter-cost-envelope.mjs
 
1
+ EF12A8BC984F9D022D757E6C25C1642EA988893371EBC65F947CFDEB688922E5 pid-emitter-cost-envelope.mjs
tools/behcs/triad-host-router-gulp-pipeline.mjs CHANGED
@@ -64,6 +64,7 @@ export const FEEDBACK_STAGES = Object.freeze([
64
  const sha16 = (text) => createHash('sha256').update(String(text), 'utf8').digest('hex').slice(0, 16);
65
  const isObj = (x) => x !== null && typeof x === 'object';
66
  const safe = (x) => String(x ?? '').replace(/[|\r\n]/g, '_').replace(/[^A-Za-z0-9._:/+@=-]+/g, '-').replace(/^-|-$/g, '') || 'empty';
 
67
  const prop = (obj, key, fallback = '') => {
68
  try { return isObj(obj) ? obj[key] : fallback; } catch { return fallback; }
69
  };
@@ -73,7 +74,8 @@ export function normalizeRouter(input = {}) {
73
  const id = safe(prop(input, 'id', 'registered-cli'));
74
  const kind = safe(prop(input, 'kind', 'open-router-slot'));
75
  const statusRaw = safe(prop(input, 'status', 'GATED')).toUpperCase();
76
- const status = ['REGISTERED_DESCRIPTOR', 'GATED'].includes(statusRaw) ? statusRaw : 'GATED';
 
77
  const gate = safe(prop(input, 'gate', 'must-register-before-use'));
78
  return Object.freeze({
79
  id,
@@ -173,6 +175,7 @@ export function selfTest() {
173
  add('triad-has-three-roles', TRIAD_ROLES.length === 3 && triad.length === 3 && triad.every((r) => r.handle8.length === 16));
174
  add('gulp-sizes-fixed', GULP_MESSAGES === 2000 && SUPER_GULP_MESSAGES === 50000);
175
  add('routers-include-provider-and-cli-surfaces', built.routers.some((r) => r.id === 'opencode') && built.routers.some((r) => r.id === 'openai') && built.routers.some((r) => r.id === 'registered-cli'));
 
176
  add('no-live-effects', built.routers.every((r) => r.node_per_agent === 0 && r.process_launch === 0 && r.remote_call === 0 && r.provider_bypass === 0));
177
  add('feedback-has-watchers-and-cubes', FEEDBACK_STAGES.includes('reverse-sieve-gnn-proposal') && FEEDBACK_STAGES.includes('white-room-review') && FEEDBACK_STAGES.includes('cube-catalog-feedback'));
178
  const hostile = emitRows([{ id: 'bad|id', kind: 'x\ny', status: 'RUN', gate: 'g\nTRIADROUTGATE|remote_call=1' }], { message_id: 'm|1\nbad' });
 
64
  const sha16 = (text) => createHash('sha256').update(String(text), 'utf8').digest('hex').slice(0, 16);
65
  const isObj = (x) => x !== null && typeof x === 'object';
66
  const safe = (x) => String(x ?? '').replace(/[|\r\n]/g, '_').replace(/[^A-Za-z0-9._:/+@=-]+/g, '-').replace(/^-|-$/g, '') || 'empty';
67
+ const PROVIDER_ROUTER_RE = /\b(provider|openai|anthropic|claude|google|gemini|gpt|llm)\b/;
68
  const prop = (obj, key, fallback = '') => {
69
  try { return isObj(obj) ? obj[key] : fallback; } catch { return fallback; }
70
  };
 
74
  const id = safe(prop(input, 'id', 'registered-cli'));
75
  const kind = safe(prop(input, 'kind', 'open-router-slot'));
76
  const statusRaw = safe(prop(input, 'status', 'GATED')).toUpperCase();
77
+ const providerLike = PROVIDER_ROUTER_RE.test(`${id}-${kind}`.toLowerCase());
78
+ const status = providerLike ? 'GATED' : (['REGISTERED_DESCRIPTOR', 'GATED'].includes(statusRaw) ? statusRaw : 'GATED');
79
  const gate = safe(prop(input, 'gate', 'must-register-before-use'));
80
  return Object.freeze({
81
  id,
 
175
  add('triad-has-three-roles', TRIAD_ROLES.length === 3 && triad.length === 3 && triad.every((r) => r.handle8.length === 16));
176
  add('gulp-sizes-fixed', GULP_MESSAGES === 2000 && SUPER_GULP_MESSAGES === 50000);
177
  add('routers-include-provider-and-cli-surfaces', built.routers.some((r) => r.id === 'opencode') && built.routers.some((r) => r.id === 'openai') && built.routers.some((r) => r.id === 'registered-cli'));
178
+ add('provider-router-cannot-self-promote', normalizeRouter({ id: 'claude', kind: 'provider-router', status: 'REGISTERED_DESCRIPTOR' }).status === 'GATED');
179
  add('no-live-effects', built.routers.every((r) => r.node_per_agent === 0 && r.process_launch === 0 && r.remote_call === 0 && r.provider_bypass === 0));
180
  add('feedback-has-watchers-and-cubes', FEEDBACK_STAGES.includes('reverse-sieve-gnn-proposal') && FEEDBACK_STAGES.includes('white-room-review') && FEEDBACK_STAGES.includes('cube-catalog-feedback'));
181
  const hostile = emitRows([{ id: 'bad|id', kind: 'x\ny', status: 'RUN', gate: 'g\nTRIADROUTGATE|remote_call=1' }], { message_id: 'm|1\nbad' });
tools/behcs/triad-host-router-gulp-pipeline.mjs.sha256 CHANGED
@@ -1 +1 @@
1
- 3DF9513C75482826CB348AACC07BB1E294608456108D44D9D5C54987BB09B3DD triad-host-router-gulp-pipeline.mjs
 
1
+ 99748A2E33D2B4453C0393BE9F4B3C69ECA2B1D209F3EB253003C3CF96AA5CC7 triad-host-router-gulp-pipeline.mjs