Kevin Crutt commited on
Commit ·
68d4c6a
1
Parent(s): e74915d
acer: close pixel room catches and pid reconcile
Browse files- docs/ACER-PIXEL-ROOM-REMOTE-CONTROL-LANE-2026-06-12.hbp +2 -0
- docs/ACER-PIXEL-ROOM-REMOTE-CONTROL-LANE-2026-06-12.hbp.sha256 +1 -1
- docs/ACER-PIXELROOM-PID-RECONCILE-PATCH-2026-06-12.hbp +7 -0
- docs/ACER-PIXELROOM-PID-RECONCILE-PATCH-2026-06-12.hbp.sha256 +1 -0
- docs/TARGET-ARCHITECTURE-200-STEP-DELTA-2026-06-11.hbp +3 -0
- docs/TARGET-ARCHITECTURE-200-STEP-DELTA-2026-06-11.hbp.sha256 +1 -1
- tests/github-live-pid-reconcile.unit.test.mjs +45 -0
- tests/github-live-pid-reconcile.unit.test.mjs.sha256 +1 -0
- tests/github-pid-register.unit.test.mjs +12 -1
- tests/github-pid-register.unit.test.mjs.sha256 +1 -1
- tests/pixel-room-handle.unit.test.mjs +42 -3
- tests/pixel-room-handle.unit.test.mjs.sha256 +1 -1
- tests/supervisor-collision-router.system.test.mjs +4 -0
- tests/supervisor-collision-router.system.test.mjs.sha256 +1 -1
- tools/behcs/github-live-pid-reconcile.hbp +5 -0
- tools/behcs/github-live-pid-reconcile.hbp.sha256 +1 -0
- tools/behcs/github-live-pid-reconcile.mjs +132 -0
- tools/behcs/github-live-pid-reconcile.mjs.sha256 +1 -0
- tools/behcs/github-pid-register.mjs +26 -2
- tools/behcs/github-pid-register.mjs.sha256 +1 -1
- tools/behcs/pixel-room-handle.hbp +2 -0
- tools/behcs/pixel-room-handle.hbp.sha256 +1 -1
- tools/behcs/pixel-room-handle.mjs +89 -11
- tools/behcs/pixel-room-handle.mjs.sha256 +1 -1
docs/ACER-PIXEL-ROOM-REMOTE-CONTROL-LANE-2026-06-12.hbp
CHANGED
|
@@ -4,6 +4,8 @@ PIXROOMLANETHREE|systems=LOGICAL-WAVE+FROZEN-BRAIN+REAL-FREE|regulator=law-of-th
|
|
| 4 |
PIXROOMLANECOST|REAL_FREE=wide-deterministic-sweep-is-cheap|LOGICAL_WAVE=actual-model-judgment-uses-token-thrift-through-room-handle+pixel-diff-sha16+row-sha16|rule=do-not-call-smart-inference-free|json=0
|
| 5 |
PIXROOMLANEGNN|message_stream=can-feed-edge-ledger-and-loop-ticks|status=ingest-loop-PARTIAL-full-inference-not-claimed|gate=wire-live-inference-only-after-receipted-route-baseline|json=0
|
| 6 |
PIXROOMLANETOOL|tool=tools/behcs/pixel-room-handle.mjs|descriptor=tools/behcs/pixel-room-handle.hbp|tests=tests/pixel-room-handle.unit.test.mjs|contract=deterministic-handle+proof-hashes+control-gates|json=0
|
|
|
|
|
|
|
| 7 |
PIXROOMLANELIVEGATE|live_control=TYPE+CLICK+ENTER+REMOTE_ACT+SHELL+OPEN+LAUNCH+MINT-all-DEFER_TO_OPERATOR|nothing_launched=1|nothing_minted=1|json=0
|
| 8 |
PIXROOMLANELIRIS|ask=liris-attack-contract-against-her-live-room-surfaces-and-supervisor-council|compare=acer-fuller-local-dashboard-registry-hard-drive-truth-before-promotion|json=0
|
| 9 |
PIXROOMLANEFTR|state=READY-FOR-BILATERAL-ATTACK|next=fix-github-PID-preimage+map-github-to-live-office+bind-room-handles-to-Hermes-spindle-task-rows-after-fabric-stable|json=0
|
|
|
|
| 4 |
PIXROOMLANECOST|REAL_FREE=wide-deterministic-sweep-is-cheap|LOGICAL_WAVE=actual-model-judgment-uses-token-thrift-through-room-handle+pixel-diff-sha16+row-sha16|rule=do-not-call-smart-inference-free|json=0
|
| 5 |
PIXROOMLANEGNN|message_stream=can-feed-edge-ledger-and-loop-ticks|status=ingest-loop-PARTIAL-full-inference-not-claimed|gate=wire-live-inference-only-after-receipted-route-baseline|json=0
|
| 6 |
PIXROOMLANETOOL|tool=tools/behcs/pixel-room-handle.mjs|descriptor=tools/behcs/pixel-room-handle.hbp|tests=tests/pixel-room-handle.unit.test.mjs|contract=deterministic-handle+proof-hashes+control-gates|json=0
|
| 7 |
+
PIXROOMLANEPATCH|closes=PIXATKC1+PIXATKC2+PIXATKC3+PIXATKC4|surface_tier_gate=restricted-operator-owner-hidden-defer-to-supervisor-live-control-1|fail_closed=unknown-action-live-control-1|identity=handle8-plus-identity16|room_lane=prime-mod3-L0-L1-L2|tag=PROVEN+tool-level|json=0
|
| 8 |
+
PIXFOLDERLANE|contract=agent-folder-dashboard-can-call-the-level-below-as-a-row-only-host-process-delegation|physical_level_cap=16|logical_nesting=row-chain-unbounded|process_launch=0|cost_model=thin-reasoning-plus-deterministic-host-row|tag=PROPOSAL|json=0
|
| 9 |
PIXROOMLANELIVEGATE|live_control=TYPE+CLICK+ENTER+REMOTE_ACT+SHELL+OPEN+LAUNCH+MINT-all-DEFER_TO_OPERATOR|nothing_launched=1|nothing_minted=1|json=0
|
| 10 |
PIXROOMLANELIRIS|ask=liris-attack-contract-against-her-live-room-surfaces-and-supervisor-council|compare=acer-fuller-local-dashboard-registry-hard-drive-truth-before-promotion|json=0
|
| 11 |
PIXROOMLANEFTR|state=READY-FOR-BILATERAL-ATTACK|next=fix-github-PID-preimage+map-github-to-live-office+bind-room-handles-to-Hermes-spindle-task-rows-after-fabric-stable|json=0
|
docs/ACER-PIXEL-ROOM-REMOTE-CONTROL-LANE-2026-06-12.hbp.sha256
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
9B632F04C54E4DB6EA5845627BDBDEA172519F8BB77B5BBE6C5E8F40A70A9B9F ACER-PIXEL-ROOM-REMOTE-CONTROL-LANE-2026-06-12.hbp
|
docs/ACER-PIXELROOM-PID-RECONCILE-PATCH-2026-06-12.hbp
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
PIXRECPATCHHDR|host=acer|date=2026-06-12|topic=close-pixel-room-attack-catches-plus-github-pid-preimage-plus-live-reconcile|source_bridge=e74915d|mode=repo-side-contract-no-live-launch|json=0
|
| 2 |
+
PIXRECPATCHPIX|closes=PIXATKC1+PIXATKC2+PIXATKC3+PIXATKC4|surface_tiers=public+agent+supervisor+operator+owner+hidden|restricted=operator+owner+hidden|unknown_action=fail-closed-live_control-1|identity=handle8-plus-identity16|room_lane=prime-mod3-L0-L1-L2|tag=PROVEN+tool-level|json=0
|
| 3 |
+
PIXRECPATCHFOLDER|operator_idea=folder-dashboard-calls-level-below-host-process|contract=PIXFOLDERHOST+PIXFOLDERLEVEL+PIXFOLDERGATE|physical_level_cap=16|logical_nesting=row-chain-unbounded|process_launch=0|cost_model=thin-reasoning-plus-deterministic-host-row|tag=PROPOSAL|json=0
|
| 4 |
+
PIXRECPATCHPID|closes=PIDADVCATCH1COLLISION|fix=registerAgent-uses-versioned-length-prefixed-0x1F-tuple-identity-and-Gxxxxxxxx-suffix-before-mintPid|keeps=mintPid-plus-LAW-triad-stable|test=previous-claude-vs-claude-logical-wave-alias-now-distinct|tag=PROVEN+tool-level|json=0
|
| 5 |
+
PIXRECPATCHRECONCILE|closes=PIDADVCATCH2DIVERGENCE-contract-level|tool=tools/behcs/github-live-pid-reconcile.mjs|snapshot=shannon-HD16C+hermes-HD17C+deepseek-HD15C-from-supervisors-HBP-count41|corrected=deepseek-github-H4DAC-not-HB5EC|unknown=PENDING-OFFICE-SNAPSHOT|tag=PROVEN+snapshot-limited|json=0
|
| 6 |
+
PIXRECPATCHFABRIC|mcp_health=4944-liris-mirror-UP|supervisors_hbp=count41+hidden-layer+operator-profile+shannon+hermes+deepseek-present|bus_health=stale-all-bases-unavailable-for-acer-4949|effect=surface-tier-gate-is-grounded-but-acer-full-office-705-still-pending|tag=PARTIAL+live-read-lane|json=0
|
| 7 |
+
PIXRECPATCHFTR|state=PIXELROOM-CATCHES-CLOSED-AND-PID-RECONCILE-SEEDED|next=liris-attack-this-patch+extend-live-office-snapshot-when-4949-or-office-705-readable|nothing_minted=1|nothing_launched=1|json=0
|
docs/ACER-PIXELROOM-PID-RECONCILE-PATCH-2026-06-12.hbp.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
67933D9AC3AABB790437CD5F1181F5A07B1DEA619F99087C47BD4A153B078BEB ACER-PIXELROOM-PID-RECONCILE-PATCH-2026-06-12.hbp
|
docs/TARGET-ARCHITECTURE-200-STEP-DELTA-2026-06-11.hbp
CHANGED
|
@@ -105,3 +105,6 @@ PIXELROOMHANDLETOOL|insert_after_step=174|tool=tools/behcs/pixel-room-handle.mjs
|
|
| 105 |
THREESYSTEMREMOTE|insert_after_step=174|systems=LOGICAL-WAVE+FROZEN-BRAIN+REAL-FREE|regulator=law-of-three-mod3+yin-yang-mod2+prime-parity+all-pid|remote_control=read-and-draft-actions-can-be-proof-rowed-live-control-actions-defer-to-operator|tag=PROPOSAL-to-live+PROVEN-contract|json=0
|
| 106 |
PIXELROOMTOKENLAW|insert_after_step=102|rule=REAL-FREE-sweeps-wide-deterministically-while-LOGICAL-WAVE-uses-model-judgment-with-token-thrift-via-room-handle+pixel-diff-sha16+row-sha16|forbidden_claim=smart-inference-is-free|tag=DESIGN-VERDICT|json=0
|
| 107 |
SPINEPIXELROOMATTACKREF|insert_after_step=198|artifact=docs/ACER-ATTACK-SPINE-PIXELROOM-READBACK-2026-06-12.hbp|effect=accepts-the-consistency-regulator-spine-with-ClaimsGate-tag-syntax-fix-and-pixel-room-contract-narrowing|tag=PROVEN+readback|json=0
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
THREESYSTEMREMOTE|insert_after_step=174|systems=LOGICAL-WAVE+FROZEN-BRAIN+REAL-FREE|regulator=law-of-three-mod3+yin-yang-mod2+prime-parity+all-pid|remote_control=read-and-draft-actions-can-be-proof-rowed-live-control-actions-defer-to-operator|tag=PROPOSAL-to-live+PROVEN-contract|json=0
|
| 106 |
PIXELROOMTOKENLAW|insert_after_step=102|rule=REAL-FREE-sweeps-wide-deterministically-while-LOGICAL-WAVE-uses-model-judgment-with-token-thrift-via-room-handle+pixel-diff-sha16+row-sha16|forbidden_claim=smart-inference-is-free|tag=DESIGN-VERDICT|json=0
|
| 107 |
SPINEPIXELROOMATTACKREF|insert_after_step=198|artifact=docs/ACER-ATTACK-SPINE-PIXELROOM-READBACK-2026-06-12.hbp|effect=accepts-the-consistency-regulator-spine-with-ClaimsGate-tag-syntax-fix-and-pixel-room-contract-narrowing|tag=PROVEN+readback|json=0
|
| 108 |
+
PIXELROOMPIDPATCHREF|insert_after_step=174|artifact=docs/ACER-PIXELROOM-PID-RECONCILE-PATCH-2026-06-12.hbp|effect=closes-pixel-room-attack-catches+adds-folder-host-lower-level-delegation+fixes-registerAgent-tuple-collision+seeds-github-to-live-PID-reconcile-map|tag=PROVEN+tool-level|json=0
|
| 109 |
+
FOLDERHOSTNESTLAW|insert_after_step=174|rule=agent-folder-dashboards-may-call-the-level-below-by-PIXFOLDERHOST-rows-with-process_launch-0-physical-level-cap-16-and-logical-row-chain-nesting|cost=thin-reasoning-plus-deterministic-host-row-not-full-harness-context|tag=PROPOSAL|json=0
|
| 110 |
+
GITHUBLIVEPIDRECONCILE|insert_after_step=198|tool=tools/behcs/github-live-pid-reconcile.mjs|rule=github-PIDs-remain-PROPOSED-until-live-office-assignment-or-alias-map-byte-receipted|seed=shannon+hermes+deepseek-only-from-supervisors-HBP-count41|unknown=PENDING-OFFICE-SNAPSHOT|tag=PROVEN+snapshot-limited|json=0
|
docs/TARGET-ARCHITECTURE-200-STEP-DELTA-2026-06-11.hbp.sha256
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
0DE8CA8937C725A24A9CD333058B72B5AF4B7422B3B1FFC577B7813C3CA28BDB TARGET-ARCHITECTURE-200-STEP-DELTA-2026-06-11.hbp
|
tests/github-live-pid-reconcile.unit.test.mjs
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import assert from 'node:assert/strict';
|
| 2 |
+
import test from 'node:test';
|
| 3 |
+
|
| 4 |
+
import {
|
| 5 |
+
LIVE_SNAPSHOT, RECONCILE_STATUS, SNAPSHOT_SOURCE,
|
| 6 |
+
emitReconcileRow, emitSnapshotRows, reconcile, selfTest,
|
| 7 |
+
} from '../tools/behcs/github-live-pid-reconcile.mjs';
|
| 8 |
+
|
| 9 |
+
test('self-test passes', () => {
|
| 10 |
+
assert.equal(selfTest().ok, true);
|
| 11 |
+
});
|
| 12 |
+
|
| 13 |
+
test('known live office snapshot entries reconcile as divergent, not equal', () => {
|
| 14 |
+
const shannon = reconcile({ name: 'shannon' });
|
| 15 |
+
assert.equal(shannon.github_hex, 'HE2EC');
|
| 16 |
+
assert.equal(shannon.live_hex, 'HD16C');
|
| 17 |
+
assert.equal(shannon.status, RECONCILE_STATUS.DIVERGENT);
|
| 18 |
+
const hermes = reconcile({ name: 'hermes' });
|
| 19 |
+
assert.equal(hermes.github_hex, 'HDFEC');
|
| 20 |
+
assert.equal(hermes.live_hex, 'HD17C');
|
| 21 |
+
assert.equal(hermes.status, RECONCILE_STATUS.DIVERGENT);
|
| 22 |
+
});
|
| 23 |
+
|
| 24 |
+
test('deepseek uses the corrected github hex H4DAC, not the stale HB5EC typo', () => {
|
| 25 |
+
const deepseek = reconcile({ name: 'deepseek' });
|
| 26 |
+
assert.equal(deepseek.github_hex, 'H4DAC');
|
| 27 |
+
assert.notEqual(deepseek.github_hex, 'HB5EC');
|
| 28 |
+
assert.equal(deepseek.live_hex, 'HD15C');
|
| 29 |
+
assert.equal(deepseek.status, RECONCILE_STATUS.DIVERGENT);
|
| 30 |
+
});
|
| 31 |
+
|
| 32 |
+
test('unknown names remain pending instead of fabricating a live office assignment', () => {
|
| 33 |
+
const r = reconcile({ name: 'future-agent' });
|
| 34 |
+
assert.equal(r.status, RECONCILE_STATUS.PENDING);
|
| 35 |
+
assert.equal(r.live_pid, 'none');
|
| 36 |
+
assert.equal(r.snapshot_source, SNAPSHOT_SOURCE);
|
| 37 |
+
});
|
| 38 |
+
|
| 39 |
+
test('snapshot rows are HBP-only and include source metadata', () => {
|
| 40 |
+
assert.equal(Object.keys(LIVE_SNAPSHOT).length, 3);
|
| 41 |
+
const rows = emitSnapshotRows();
|
| 42 |
+
assert.ok(rows.every((row) => row.endsWith('|json=0') && !row.includes('\n')));
|
| 43 |
+
assert.ok(rows.some((row) => row.includes('snapshot_source=') && row.includes('count41')));
|
| 44 |
+
assert.ok(emitReconcileRow(reconcile({ name: 'shannon' })).includes('status=DIVERGENT'));
|
| 45 |
+
});
|
tests/github-live-pid-reconcile.unit.test.mjs.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
6B3A81C02F0E3E263C0740FCD70C0DBF501E29D6618F2B4351ADA808CFDD7110 github-live-pid-reconcile.unit.test.mjs
|
tests/github-pid-register.unit.test.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import test from 'node:test';
|
|
| 3 |
|
| 4 |
import {
|
| 5 |
AGENT_TYPES, KIND_BITS, KINDS, ROLES, RUNTIMES, SECTORS,
|
| 6 |
-
classifyAgentType, emitAgentRow, emitRegistrationRows, mintPid, mintTriad, registerAgent, selfTest,
|
| 7 |
} from '../tools/behcs/github-pid-register.mjs';
|
| 8 |
|
| 9 |
test('self-test passes', () => {
|
|
@@ -72,3 +72,14 @@ test('kind is load-bearing for agent PID identity', () => {
|
|
| 72 |
assert.equal(frozen.agent_type, 'FROZEN-BRAIN');
|
| 73 |
assert.equal(realFree.agent_type, 'REAL-FREE');
|
| 74 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
import {
|
| 5 |
AGENT_TYPES, KIND_BITS, KINDS, ROLES, RUNTIMES, SECTORS,
|
| 6 |
+
classifyAgentType, emitAgentRow, emitRegistrationRows, mintPid, mintTriad, registerAgent, selfTest, tuplePreimage,
|
| 7 |
} from '../tools/behcs/github-pid-register.mjs';
|
| 8 |
|
| 9 |
test('self-test passes', () => {
|
|
|
|
| 72 |
assert.equal(frozen.agent_type, 'FROZEN-BRAIN');
|
| 73 |
assert.equal(realFree.agent_type, 'REAL-FREE');
|
| 74 |
});
|
| 75 |
+
|
| 76 |
+
test('registerAgent uses unambiguous tuple identity and closes hyphen split alias', () => {
|
| 77 |
+
const a = registerAgent({ runtime: 'claude', name: 'LOGICAL-WAVE-WORKER', kind: 'logical' });
|
| 78 |
+
const b = registerAgent({ runtime: 'claude-logical-wave', name: 'WORKER', kind: 'logical' });
|
| 79 |
+
assert.notEqual(a.pid, b.pid);
|
| 80 |
+
assert.match(a.register_identity_sha16, /^[0-9a-f]{16}$/);
|
| 81 |
+
assert.match(b.register_identity_sha16, /^[0-9a-f]{16}$/);
|
| 82 |
+
assert.notEqual(tuplePreimage(['REGISTER_AGENT', 'claude', 'LOGICAL-WAVE', 'LOGICAL-WAVE-WORKER', 'logical', '0']),
|
| 83 |
+
tuplePreimage(['REGISTER_AGENT', 'claude-logical-wave', 'LOGICAL-WAVE', 'WORKER', 'logical', '0']));
|
| 84 |
+
assert.ok(emitAgentRow(a).includes(`register_identity_sha16=${a.register_identity_sha16}`));
|
| 85 |
+
});
|
tests/github-pid-register.unit.test.mjs.sha256
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
4F523A3BECDED6CC6DEEC9327D851789A1998DAF9AEABCFE849B3C0472FB85F3 github-pid-register.unit.test.mjs
|
tests/pixel-room-handle.unit.test.mjs
CHANGED
|
@@ -3,7 +3,9 @@ import test from 'node:test';
|
|
| 3 |
|
| 4 |
import {
|
| 5 |
classifyRoomAction,
|
|
|
|
| 6 |
createPixelRoomTask,
|
|
|
|
| 7 |
emitPixelRoomRows,
|
| 8 |
mintPixelRoom,
|
| 9 |
normalizeSha16,
|
|
@@ -31,6 +33,8 @@ test('mints deterministic 8-byte room handles', () => {
|
|
| 31 |
const b = mintPixelRoom(base);
|
| 32 |
assert.match(a.handle, /^[0-9a-f]{16}$/);
|
| 33 |
assert.equal(a.handle_bytes, 8);
|
|
|
|
|
|
|
| 34 |
assert.equal(a.handle, b.handle);
|
| 35 |
});
|
| 36 |
|
|
@@ -45,12 +49,27 @@ test('three systems are regulated by yin-yang and prime parity', () => {
|
|
| 45 |
assert.equal(createPixelRoomTask({ ...base, kind: 'real', prime: 0 }).agent_type, 'FROZEN-BRAIN');
|
| 46 |
assert.equal(createPixelRoomTask({ ...base, kind: 'real', prime: 1 }).agent_type, 'REAL-FREE');
|
| 47 |
assert.equal(createPixelRoomTask({ ...base, kind: 'real', prime: 4 }).prime_mod3, 1);
|
|
|
|
| 48 |
});
|
| 49 |
|
| 50 |
test('control actions are gated; read and draft actions are not live control', () => {
|
| 51 |
-
assert.
|
| 52 |
-
assert.
|
| 53 |
-
assert.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
});
|
| 55 |
|
| 56 |
test('proof rows carry hashes only, not raw pixel payloads or DOM authority', () => {
|
|
@@ -80,3 +99,23 @@ test('emitted rows include MCP token-thrift and no live launch', () => {
|
|
| 80 |
assert.ok(rows.some((row) => row.includes('mcp_payload=sha16-row-handles-not-full-context')));
|
| 81 |
assert.ok(rows.some((row) => row.includes('nothing_launched=1')));
|
| 82 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
import {
|
| 5 |
classifyRoomAction,
|
| 6 |
+
createFolderHostCall,
|
| 7 |
createPixelRoomTask,
|
| 8 |
+
emitFolderHostRows,
|
| 9 |
emitPixelRoomRows,
|
| 10 |
mintPixelRoom,
|
| 11 |
normalizeSha16,
|
|
|
|
| 33 |
const b = mintPixelRoom(base);
|
| 34 |
assert.match(a.handle, /^[0-9a-f]{16}$/);
|
| 35 |
assert.equal(a.handle_bytes, 8);
|
| 36 |
+
assert.match(a.identity16, /^[0-9a-f]{32}$/);
|
| 37 |
+
assert.equal(a.identity_bytes, 16);
|
| 38 |
assert.equal(a.handle, b.handle);
|
| 39 |
});
|
| 40 |
|
|
|
|
| 49 |
assert.equal(createPixelRoomTask({ ...base, kind: 'real', prime: 0 }).agent_type, 'FROZEN-BRAIN');
|
| 50 |
assert.equal(createPixelRoomTask({ ...base, kind: 'real', prime: 1 }).agent_type, 'REAL-FREE');
|
| 51 |
assert.equal(createPixelRoomTask({ ...base, kind: 'real', prime: 4 }).prime_mod3, 1);
|
| 52 |
+
assert.equal(createPixelRoomTask({ ...base, kind: 'real', prime: 4 }).room_lane, 'L1');
|
| 53 |
});
|
| 54 |
|
| 55 |
test('control actions are gated; read and draft actions are not live control', () => {
|
| 56 |
+
assert.equal(classifyRoomAction('LOOK').verdict, 'READ_READY');
|
| 57 |
+
assert.equal(classifyRoomAction('LOOK').live_control, 0);
|
| 58 |
+
assert.equal(classifyRoomAction('PREDICT').verdict, 'DRAFT_READY');
|
| 59 |
+
assert.equal(classifyRoomAction('PREDICT').live_control, 0);
|
| 60 |
+
assert.equal(classifyRoomAction('TYPE').verdict, 'DEFER_TO_OPERATOR');
|
| 61 |
+
assert.equal(classifyRoomAction('TYPE').live_control, 1);
|
| 62 |
+
});
|
| 63 |
+
|
| 64 |
+
test('surface-tier gates fail closed for hidden or unknown actions', () => {
|
| 65 |
+
const hidden = createPixelRoomTask({ ...base, surface_tier: 'hidden', action: 'LOOK' });
|
| 66 |
+
assert.equal(hidden.verdict, 'DEFER_TO_SUPERVISOR');
|
| 67 |
+
assert.equal(hidden.live_control, 1);
|
| 68 |
+
assert.equal(hidden.access_gate, 'restricted-surface');
|
| 69 |
+
const typo = createPixelRoomTask({ ...base, action: 'typ' });
|
| 70 |
+
assert.equal(typo.verdict, 'DEFER_TO_SUPERVISOR');
|
| 71 |
+
assert.equal(typo.live_control, 1);
|
| 72 |
+
assert.equal(typo.access_gate, 'unknown-action-fail-closed');
|
| 73 |
});
|
| 74 |
|
| 75 |
test('proof rows carry hashes only, not raw pixel payloads or DOM authority', () => {
|
|
|
|
| 99 |
assert.ok(rows.some((row) => row.includes('mcp_payload=sha16-row-handles-not-full-context')));
|
| 100 |
assert.ok(rows.some((row) => row.includes('nothing_launched=1')));
|
| 101 |
});
|
| 102 |
+
|
| 103 |
+
test('folder dashboard can delegate to a lower-level host row without launching it', () => {
|
| 104 |
+
const call = createFolderHostCall({
|
| 105 |
+
...base,
|
| 106 |
+
folder: 'dashboards/A08',
|
| 107 |
+
host_process: 'child-host.mjs',
|
| 108 |
+
child_room: 'A09-child-room',
|
| 109 |
+
child_route: '/api/child/room',
|
| 110 |
+
child_action: 'PLAN',
|
| 111 |
+
});
|
| 112 |
+
assert.equal(call.parent.tier, 'A08');
|
| 113 |
+
assert.equal(call.child.tier, 'A09');
|
| 114 |
+
assert.equal(call.process_launch, 0);
|
| 115 |
+
assert.equal(call.process_gate, 'HBP_ROW_ONLY');
|
| 116 |
+
assert.equal(call.logical_nesting, 'row-chain-unbounded');
|
| 117 |
+
const rows = emitFolderHostRows(call);
|
| 118 |
+
assert.ok(rows.every((row) => row.endsWith('|json=0') && !row.includes('\n')));
|
| 119 |
+
assert.ok(rows.some((row) => row.includes('PIXFOLDERHOST|')));
|
| 120 |
+
assert.ok(rows.some((row) => row.includes('process_launch=0')));
|
| 121 |
+
});
|
tests/pixel-room-handle.unit.test.mjs.sha256
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
A436F1511F3B0581F73C3F15CFAD6C468935067EC6C59481EBC2450F49D9B4C3 pixel-room-handle.unit.test.mjs
|
tests/supervisor-collision-router.system.test.mjs
CHANGED
|
@@ -51,6 +51,7 @@ const sealedFiles = [
|
|
| 51 |
'docs/ACER-PIXEL-ROOM-REMOTE-CONTROL-LANE-2026-06-12.hbp',
|
| 52 |
'docs/ACER-ATTACK-SPINE-PIXELROOM-READBACK-2026-06-12.hbp',
|
| 53 |
'docs/ACER-ATTACK-PIXELROOM-CONTRACT-2026-06-12.hbp',
|
|
|
|
| 54 |
'docs/acer-ecosystem-fullbody-receipt-20260612.hbp',
|
| 55 |
'docs/CLAIMSLEDGER-2026-06-12.hbp',
|
| 56 |
'docs/CLAIMSGATE-PARITY-BASELINE-2026-06-12.hbp',
|
|
@@ -173,6 +174,8 @@ const sealedFiles = [
|
|
| 173 |
'tools/behcs/kimi-desktop-surface-scan.mjs',
|
| 174 |
'tools/behcs/kimi-desktop-surface-scan.hbp',
|
| 175 |
'tools/behcs/github-pid-register.mjs',
|
|
|
|
|
|
|
| 176 |
'tools/behcs/pixel-room-handle.mjs',
|
| 177 |
'tools/behcs/pixel-room-handle.hbp',
|
| 178 |
'tools/omni-processor/omnitranslator-v0.js',
|
|
@@ -186,6 +189,7 @@ const sealedFiles = [
|
|
| 186 |
'tests/answer-producer.unit.test.mjs',
|
| 187 |
'tests/kimi-desktop-surface-scan.unit.test.mjs',
|
| 188 |
'tests/github-pid-register.unit.test.mjs',
|
|
|
|
| 189 |
'tests/pixel-room-handle.unit.test.mjs',
|
| 190 |
'tests/d22-verb-adapter.unit.test.mjs',
|
| 191 |
'tests/d22-parity-probe.unit.test.mjs',
|
|
|
|
| 51 |
'docs/ACER-PIXEL-ROOM-REMOTE-CONTROL-LANE-2026-06-12.hbp',
|
| 52 |
'docs/ACER-ATTACK-SPINE-PIXELROOM-READBACK-2026-06-12.hbp',
|
| 53 |
'docs/ACER-ATTACK-PIXELROOM-CONTRACT-2026-06-12.hbp',
|
| 54 |
+
'docs/ACER-PIXELROOM-PID-RECONCILE-PATCH-2026-06-12.hbp',
|
| 55 |
'docs/acer-ecosystem-fullbody-receipt-20260612.hbp',
|
| 56 |
'docs/CLAIMSLEDGER-2026-06-12.hbp',
|
| 57 |
'docs/CLAIMSGATE-PARITY-BASELINE-2026-06-12.hbp',
|
|
|
|
| 174 |
'tools/behcs/kimi-desktop-surface-scan.mjs',
|
| 175 |
'tools/behcs/kimi-desktop-surface-scan.hbp',
|
| 176 |
'tools/behcs/github-pid-register.mjs',
|
| 177 |
+
'tools/behcs/github-live-pid-reconcile.mjs',
|
| 178 |
+
'tools/behcs/github-live-pid-reconcile.hbp',
|
| 179 |
'tools/behcs/pixel-room-handle.mjs',
|
| 180 |
'tools/behcs/pixel-room-handle.hbp',
|
| 181 |
'tools/omni-processor/omnitranslator-v0.js',
|
|
|
|
| 189 |
'tests/answer-producer.unit.test.mjs',
|
| 190 |
'tests/kimi-desktop-surface-scan.unit.test.mjs',
|
| 191 |
'tests/github-pid-register.unit.test.mjs',
|
| 192 |
+
'tests/github-live-pid-reconcile.unit.test.mjs',
|
| 193 |
'tests/pixel-room-handle.unit.test.mjs',
|
| 194 |
'tests/d22-verb-adapter.unit.test.mjs',
|
| 195 |
'tests/d22-parity-probe.unit.test.mjs',
|
tests/supervisor-collision-router.system.test.mjs.sha256
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
E3F6362D2C1D3337995B12EC8149320CB66D36E62B4802AE4EC2EF9CB8B1CE0E supervisor-collision-router.system.test.mjs
|
tools/behcs/github-live-pid-reconcile.hbp
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
PIDRECONCILETOOLHDR|tool=github-live-pid-reconcile.v1|purpose=compare-github-proposed-PIDs-to-live-office-snapshot-without-pretending-they-are-equal|snapshot=liris-supervisors-hbp-count41-acer-office-pending|json=0
|
| 2 |
+
PIDRECONCILELAW|github_pid=PROPOSED-address|live_pid=office-assigned-sequential-Hilbert-address|status=MATCH+DIVERGENT+PENDING-OFFICE-SNAPSHOT|unknown=never-fabricate-live-PID|json=0
|
| 3 |
+
PIDRECONCILESEED|entries=shannon-HD16C+hermes-HD17C+deepseek-HD15C|corrected=deepseek-github-H4DAC-not-HB5EC|source=supervisors-hbp-live-read-lane|tag=PROVEN+snapshot-limited|json=0
|
| 4 |
+
PIDRECONCILEGATE|next=extend-snapshot-only-from-byte-receipted-live-office-or-supervisor-HBP-feed|acer_office_705=not-visible-through-current-MCP-lane|json=0
|
| 5 |
+
PIDRECONCILEFTR|state=SEALED-RECONCILE-CONTRACT|nothing_minted=1|nothing_launched=1|json=0
|
tools/behcs/github-live-pid-reconcile.hbp.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
3E2A400735155A5FA5B010ECE3449186621F0589311B4BD668EB2EEB1BBF7616 github-live-pid-reconcile.hbp
|
tools/behcs/github-live-pid-reconcile.mjs
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { resolve } from 'node:path';
|
| 2 |
+
import { fileURLToPath } from 'node:url';
|
| 3 |
+
|
| 4 |
+
import { mintPid } from './github-pid-register.mjs';
|
| 5 |
+
|
| 6 |
+
export const RECONCILE_ID = 'github-live-pid-reconcile.v1';
|
| 7 |
+
export const SNAPSHOT_SOURCE = 'liris-supervisors-hbp-2026-06-12-count41-acer-office-pending';
|
| 8 |
+
export const RECONCILE_STATUS = Object.freeze({
|
| 9 |
+
MATCH: 'MATCH',
|
| 10 |
+
DIVERGENT: 'DIVERGENT',
|
| 11 |
+
PENDING: 'PENDING-OFFICE-SNAPSHOT',
|
| 12 |
+
});
|
| 13 |
+
|
| 14 |
+
export const LIVE_SNAPSHOT = Object.freeze({
|
| 15 |
+
shannon: Object.freeze({
|
| 16 |
+
name: 'shannon',
|
| 17 |
+
role: 'AGT',
|
| 18 |
+
tier: 4,
|
| 19 |
+
prime: 1,
|
| 20 |
+
nest: 1,
|
| 21 |
+
live_pid: 'AGT-SHANNON-PID-HD16C-A04-W1024-P01-N00001',
|
| 22 |
+
live_hex: 'HD16C',
|
| 23 |
+
live_source: 'AGT-SHANNON-PID-HD16C-A04-W1024-P01-N00001',
|
| 24 |
+
}),
|
| 25 |
+
hermes: Object.freeze({
|
| 26 |
+
name: 'hermes',
|
| 27 |
+
role: 'AGT',
|
| 28 |
+
tier: 4,
|
| 29 |
+
prime: 1,
|
| 30 |
+
nest: 1,
|
| 31 |
+
live_pid: 'AGT-HERMES-PID-HD17C-A04-W1024-P01-N00001',
|
| 32 |
+
live_hex: 'HD17C',
|
| 33 |
+
live_source: 'AGT-HERMES-PID-HD17C-A04-W1024-P01-N00001',
|
| 34 |
+
}),
|
| 35 |
+
deepseek: Object.freeze({
|
| 36 |
+
name: 'deepseek',
|
| 37 |
+
role: 'AGT',
|
| 38 |
+
tier: 4,
|
| 39 |
+
prime: 67,
|
| 40 |
+
nest: 67,
|
| 41 |
+
live_pid: 'AGT-DEEPSEEK-TUI-PID-HD15C-A04-W1024-P67-N00067',
|
| 42 |
+
live_hex: 'HD15C',
|
| 43 |
+
live_source: 'AGT-DEEPSEEK-TUI-PID-HD15C-A04-W1024-P67-N00067',
|
| 44 |
+
}),
|
| 45 |
+
});
|
| 46 |
+
|
| 47 |
+
function keyFor(name) {
|
| 48 |
+
const k = String(name || '').toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '');
|
| 49 |
+
if (!k) throw new Error('name-required');
|
| 50 |
+
return k;
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
function hbpValue(field, value) {
|
| 54 |
+
const s = String(value ?? '');
|
| 55 |
+
if (!s || /[|\r\n]/.test(s)) throw new Error(`${field}-invalid`);
|
| 56 |
+
return s.replace(/[^A-Za-z0-9._:/-]+/g, '-').replace(/^-|-$/g, '') || 'empty';
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
export function reconcile({ name, role = 'AGT', tier, prime, nest } = {}) {
|
| 60 |
+
const key = keyFor(name);
|
| 61 |
+
const snap = LIVE_SNAPSHOT[key];
|
| 62 |
+
const p = mintPid({
|
| 63 |
+
role: snap?.role || role,
|
| 64 |
+
name: key,
|
| 65 |
+
tier: tier ?? snap?.tier ?? 4,
|
| 66 |
+
prime: prime ?? snap?.prime ?? 1,
|
| 67 |
+
nest: nest ?? snap?.nest ?? 1,
|
| 68 |
+
});
|
| 69 |
+
if (!snap) {
|
| 70 |
+
return {
|
| 71 |
+
name: key,
|
| 72 |
+
status: RECONCILE_STATUS.PENDING,
|
| 73 |
+
snapshot_source: SNAPSHOT_SOURCE,
|
| 74 |
+
github_pid: p.pid,
|
| 75 |
+
github_hex: p.hex,
|
| 76 |
+
github_sha16: p.sha16,
|
| 77 |
+
live_pid: 'none',
|
| 78 |
+
live_hex: 'none',
|
| 79 |
+
live_source: 'none',
|
| 80 |
+
};
|
| 81 |
+
}
|
| 82 |
+
const status = p.hex === snap.live_hex ? RECONCILE_STATUS.MATCH : RECONCILE_STATUS.DIVERGENT;
|
| 83 |
+
return {
|
| 84 |
+
name: key,
|
| 85 |
+
status,
|
| 86 |
+
snapshot_source: SNAPSHOT_SOURCE,
|
| 87 |
+
github_pid: p.pid,
|
| 88 |
+
github_hex: p.hex,
|
| 89 |
+
github_sha16: p.sha16,
|
| 90 |
+
live_pid: snap.live_pid,
|
| 91 |
+
live_hex: snap.live_hex,
|
| 92 |
+
live_source: snap.live_source,
|
| 93 |
+
};
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
export function emitReconcileRow(r) {
|
| 97 |
+
const x = r.status ? r : reconcile(r);
|
| 98 |
+
return `PIDRECONCILE|name=${hbpValue('name', x.name)}|status=${x.status}|github_pid=${hbpValue('github_pid', x.github_pid)}|github_hex=${x.github_hex}|github_sha16=${x.github_sha16}|live_pid=${hbpValue('live_pid', x.live_pid)}|live_hex=${x.live_hex}|snapshot_source=${SNAPSHOT_SOURCE}|json=0`;
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
export function emitSnapshotRows() {
|
| 102 |
+
const rows = [`PIDRECONCILEHDR|tool=${RECONCILE_ID}|snapshot_source=${SNAPSHOT_SOURCE}|entries=${Object.keys(LIVE_SNAPSHOT).length}|mode=github-proposed-vs-live-office-snapshot|json=0`];
|
| 103 |
+
for (const name of Object.keys(LIVE_SNAPSHOT).sort()) rows.push(emitReconcileRow(reconcile({ name })));
|
| 104 |
+
rows.push('PIDRECONCILEFTR|rule=github-pid-is-PROPOSED-until-live-office-assignment-or-alias-map-byte-receipted|unknown=PENDING-OFFICE-SNAPSHOT-not-fabricated|json=0');
|
| 105 |
+
return rows;
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
export function selfTest() {
|
| 109 |
+
const checks = [];
|
| 110 |
+
const add = (name, ok) => checks.push({ name, ok: Boolean(ok) });
|
| 111 |
+
const shannon = reconcile({ name: 'shannon' });
|
| 112 |
+
const hermes = reconcile({ name: 'hermes' });
|
| 113 |
+
const deepseek = reconcile({ name: 'deepseek' });
|
| 114 |
+
add('shannon-divergent', shannon.github_hex === 'HE2EC' && shannon.live_hex === 'HD16C' && shannon.status === RECONCILE_STATUS.DIVERGENT);
|
| 115 |
+
add('hermes-divergent', hermes.github_hex === 'HDFEC' && hermes.live_hex === 'HD17C' && hermes.status === RECONCILE_STATUS.DIVERGENT);
|
| 116 |
+
add('deepseek-corrected-h4dac', deepseek.github_hex === 'H4DAC' && deepseek.live_hex === 'HD15C' && deepseek.status === RECONCILE_STATUS.DIVERGENT);
|
| 117 |
+
add('no-stale-hb5ec', deepseek.github_hex !== 'HB5EC');
|
| 118 |
+
add('unknown-pending', reconcile({ name: 'new-model' }).status === RECONCILE_STATUS.PENDING);
|
| 119 |
+
add('rows-hbp-only', emitSnapshotRows().every((row) => row.endsWith('|json=0') && !row.includes('\n')));
|
| 120 |
+
add('source-named', SNAPSHOT_SOURCE.includes('count41'));
|
| 121 |
+
return { ok: checks.every((c) => c.ok), checks };
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
const isMain = process.argv[1] && fileURLToPath(import.meta.url) === resolve(process.argv[1]);
|
| 125 |
+
if (isMain) {
|
| 126 |
+
if (process.argv[2] === '--self-test') {
|
| 127 |
+
const r = selfTest();
|
| 128 |
+
for (const c of r.checks) console.log(`${c.ok ? 'PASS' : 'FAIL'} ${c.name}`);
|
| 129 |
+
process.exit(r.ok ? 0 : 1);
|
| 130 |
+
}
|
| 131 |
+
for (const row of emitSnapshotRows()) console.log(row);
|
| 132 |
+
}
|
tools/behcs/github-live-pid-reconcile.mjs.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
A852E9A292ABE319DE59292DEDA91EB04568F1FAA6083776492F6897CED7940A github-live-pid-reconcile.mjs
|
tools/behcs/github-pid-register.mjs
CHANGED
|
@@ -19,9 +19,24 @@ export const KINDS = Object.freeze(['real', 'logical']);
|
|
| 19 |
export const KIND_BITS = Object.freeze({ logical: 0, real: 1 });
|
| 20 |
export const RUNTIMES = Object.freeze(['claude', 'codex', 'deepseek', 'opencode', 'gemini']);
|
| 21 |
export const AGENT_TYPES = Object.freeze(['LOGICAL-WAVE', 'FROZEN-BRAIN', 'REAL-FREE']);
|
|
|
|
|
|
|
| 22 |
|
| 23 |
const sha256 = (t) => createHash('sha256').update(String(t), 'utf8').digest('hex');
|
| 24 |
const u32 = (hex8) => parseInt(hex8, 16);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
// mint ONE deterministic live-format PID for (role, name) at access-tier + nest.
|
| 27 |
export function mintPid({ role, name, tier = 4, nest = 1, kind = 'logical', prime = 0 }) {
|
|
@@ -85,18 +100,24 @@ export function classifyAgentType({ yin_yang, prime }) {
|
|
| 85 |
export function registerAgent({ runtime, name, role = 'AGT', tier = 4, kind = 'logical', prime = 0, nest = 1 }) {
|
| 86 |
const rt = String(runtime || '').toLowerCase().replace(/[^a-z0-9.-]+/g, '-').replace(/^-|-$/g, '');
|
| 87 |
if (!rt) throw new Error('runtime-required-accepts-any-model-name');
|
|
|
|
|
|
|
|
|
|
| 88 |
const agentType = classifyAgentType({ yin_yang: kind, prime });
|
| 89 |
-
const
|
|
|
|
|
|
|
| 90 |
return {
|
| 91 |
...p,
|
| 92 |
runtime: rt,
|
| 93 |
known_runtime: RUNTIMES.includes(rt),
|
| 94 |
agent_type: agentType,
|
|
|
|
| 95 |
};
|
| 96 |
}
|
| 97 |
|
| 98 |
export function emitAgentRow(a) {
|
| 99 |
-
return `AGENTPID|runtime=${a.runtime}|known_runtime=${a.known_runtime ? 1 : 0}|agent_type=${a.agent_type}|pid=${a.pid}|tier=${a.tier}|yin_yang=${a.yin_yang}|yin_yang_bit=${a.yin_yang_bit}|lane_mod3=${a.lane}|quad_mod4=${a.quad}|sector=${a.sector}|cube_bh=${a.cube_bh}|json=0`;
|
| 100 |
}
|
| 101 |
|
| 102 |
export function selfTest() {
|
|
@@ -126,6 +147,9 @@ export function selfTest() {
|
|
| 126 |
})());
|
| 127 |
add('kind-load-bearing-in-agent-pid', registerAgent({ runtime: 'claude', name: 'worker', kind: 'logical' }).pid
|
| 128 |
!== registerAgent({ runtime: 'claude', name: 'worker', kind: 'real' }).pid);
|
|
|
|
|
|
|
|
|
|
| 129 |
add('empty-runtime-rejected', (() => { try { registerAgent({ runtime: '', name: 'x' }); return false; } catch { return true; } })());
|
| 130 |
add('agent-row-hbp', emitAgentRow(registerAgent({ runtime: 'claude', name: 'x' })).endsWith('|json=0'));
|
| 131 |
return { ok: checks.every((c) => c.ok), checks };
|
|
|
|
| 19 |
export const KIND_BITS = Object.freeze({ logical: 0, real: 1 });
|
| 20 |
export const RUNTIMES = Object.freeze(['claude', 'codex', 'deepseek', 'opencode', 'gemini']);
|
| 21 |
export const AGENT_TYPES = Object.freeze(['LOGICAL-WAVE', 'FROZEN-BRAIN', 'REAL-FREE']);
|
| 22 |
+
export const REGISTER_AGENT_TUPLE_ID = 'github-pid-register-agent-tuple.v1';
|
| 23 |
+
export const UNIT_SEPARATOR = '\x1f';
|
| 24 |
|
| 25 |
const sha256 = (t) => createHash('sha256').update(String(t), 'utf8').digest('hex');
|
| 26 |
const u32 = (hex8) => parseInt(hex8, 16);
|
| 27 |
+
const safeTuplePart = (field, value) => {
|
| 28 |
+
const s = String(value ?? '');
|
| 29 |
+
if (!s) throw new Error(`${field}-required`);
|
| 30 |
+
if (/[|\r\n\x1f]/.test(s)) throw new Error(`${field}-contains-hbp-or-tuple-delimiter`);
|
| 31 |
+
return s;
|
| 32 |
+
};
|
| 33 |
+
|
| 34 |
+
export function tuplePreimage(parts) {
|
| 35 |
+
return [REGISTER_AGENT_TUPLE_ID, ...parts].map((part, i) => {
|
| 36 |
+
const s = safeTuplePart(`tuple_${i}`, part);
|
| 37 |
+
return `${Buffer.byteLength(s, 'utf8')}:${s}`;
|
| 38 |
+
}).join(UNIT_SEPARATOR);
|
| 39 |
+
}
|
| 40 |
|
| 41 |
// mint ONE deterministic live-format PID for (role, name) at access-tier + nest.
|
| 42 |
export function mintPid({ role, name, tier = 4, nest = 1, kind = 'logical', prime = 0 }) {
|
|
|
|
| 100 |
export function registerAgent({ runtime, name, role = 'AGT', tier = 4, kind = 'logical', prime = 0, nest = 1 }) {
|
| 101 |
const rt = String(runtime || '').toLowerCase().replace(/[^a-z0-9.-]+/g, '-').replace(/^-|-$/g, '');
|
| 102 |
if (!rt) throw new Error('runtime-required-accepts-any-model-name');
|
| 103 |
+
const rawName = safeTuplePart('name', name);
|
| 104 |
+
const safeName = rawName.toUpperCase().replace(/[^A-Z0-9]+/g, '-').replace(/^-|-$/g, '');
|
| 105 |
+
if (!safeName) throw new Error('name-required-after-sanitize');
|
| 106 |
const agentType = classifyAgentType({ yin_yang: kind, prime });
|
| 107 |
+
const identityPreimage = tuplePreimage(['REGISTER_AGENT', rt, agentType, rawName, kind, String(prime)]);
|
| 108 |
+
const identitySha16 = sha256(identityPreimage).slice(0, 16);
|
| 109 |
+
const p = mintPid({ role, name: `${rt.toUpperCase()}-${agentType}-${safeName}-G${identitySha16.slice(0, 8).toUpperCase()}`, tier, kind, prime, nest });
|
| 110 |
return {
|
| 111 |
...p,
|
| 112 |
runtime: rt,
|
| 113 |
known_runtime: RUNTIMES.includes(rt),
|
| 114 |
agent_type: agentType,
|
| 115 |
+
register_identity_sha16: identitySha16,
|
| 116 |
};
|
| 117 |
}
|
| 118 |
|
| 119 |
export function emitAgentRow(a) {
|
| 120 |
+
return `AGENTPID|runtime=${a.runtime}|known_runtime=${a.known_runtime ? 1 : 0}|agent_type=${a.agent_type}|pid=${a.pid}|register_identity_sha16=${a.register_identity_sha16 || 'none'}|tier=${a.tier}|yin_yang=${a.yin_yang}|yin_yang_bit=${a.yin_yang_bit}|lane_mod3=${a.lane}|quad_mod4=${a.quad}|sector=${a.sector}|cube_bh=${a.cube_bh}|json=0`;
|
| 121 |
}
|
| 122 |
|
| 123 |
export function selfTest() {
|
|
|
|
| 147 |
})());
|
| 148 |
add('kind-load-bearing-in-agent-pid', registerAgent({ runtime: 'claude', name: 'worker', kind: 'logical' }).pid
|
| 149 |
!== registerAgent({ runtime: 'claude', name: 'worker', kind: 'real' }).pid);
|
| 150 |
+
add('register-agent-preimage-no-hyphen-collision', registerAgent({ runtime: 'claude', name: 'LOGICAL-WAVE-WORKER', kind: 'logical' }).pid
|
| 151 |
+
!== registerAgent({ runtime: 'claude-logical-wave', name: 'WORKER', kind: 'logical' }).pid);
|
| 152 |
+
add('register-identity-sha16', /^[0-9a-f]{16}$/.test(registerAgent({ runtime: 'claude', name: 'worker' }).register_identity_sha16));
|
| 153 |
add('empty-runtime-rejected', (() => { try { registerAgent({ runtime: '', name: 'x' }); return false; } catch { return true; } })());
|
| 154 |
add('agent-row-hbp', emitAgentRow(registerAgent({ runtime: 'claude', name: 'x' })).endsWith('|json=0'));
|
| 155 |
return { ok: checks.every((c) => c.ok), checks };
|
tools/behcs/github-pid-register.mjs.sha256
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
49B1DA933EDAD721C18C43AB433EA78AB0F1A5A9EE3EB9E75AE51B08AF059DDF github-pid-register.mjs
|
tools/behcs/pixel-room-handle.hbp
CHANGED
|
@@ -3,5 +3,7 @@ PIXROOMTUPLE|preimage=versioned-length-prefixed-fields-joined-by-0x1F|rejects=li
|
|
| 3 |
PIXROOMLAW|systems=LOGICAL-WAVE+FROZEN-BRAIN+REAL-FREE|regulator=yin-yang-bit+prime-mod3+prime-parity+all-pid|human_front=watched-shell|agent_back=HBP-HBI-proof-rows-not-DOM-authority|json=0
|
| 4 |
PIXROOMPROOF|proof=pixel_sha16+pixel_delta_sha16+world_rollout_sha16+correction_sha16+target_sha16|never=raw-pixels-or-private-screen-dump-in-HBP|route=room-handle-plus-sha16-row-references|json=0
|
| 5 |
PIXROOMGATE|read_actions=LOOK+READ+PROBE+DIFF+HASH+INDEX+CAPTURE|draft_actions=PLAN+PREDICT+CORRECT+ROLL_OUT+REVIEW|control_actions=TYPE+CLICK+ENTER+DRAG+SCROLL+HOTKEY+REMOTE_ACT+SHELL+WRITE+DELETE+SUBMIT+OPEN+LAUNCH+MINT|control_verdict=DEFER_TO_OPERATOR|json=0
|
|
|
|
|
|
|
| 6 |
PIXROOMECONOMY|REAL_FREE=deterministic-wide-sweep|LOGICAL_WAVE=model-judgment-token-thrift-through-8-byte-handles-and-sha16-rows|FROZEN_BRAIN=deterministic-local-slice-requires-double-run-receipt|no_claim=smart-agent-work-is-free|tag=PROPOSAL|json=0
|
| 7 |
PIXROOMFTR|state=SEALED-ROOM-HANDLE-CONTRACT|nothing_launched=1|nothing_minted=1|next=liris-attack-plus-bind-to-Hermes-spindle-rooms-after-fabric-route-baselines|json=0
|
|
|
|
| 3 |
PIXROOMLAW|systems=LOGICAL-WAVE+FROZEN-BRAIN+REAL-FREE|regulator=yin-yang-bit+prime-mod3+prime-parity+all-pid|human_front=watched-shell|agent_back=HBP-HBI-proof-rows-not-DOM-authority|json=0
|
| 4 |
PIXROOMPROOF|proof=pixel_sha16+pixel_delta_sha16+world_rollout_sha16+correction_sha16+target_sha16|never=raw-pixels-or-private-screen-dump-in-HBP|route=room-handle-plus-sha16-row-references|json=0
|
| 5 |
PIXROOMGATE|read_actions=LOOK+READ+PROBE+DIFF+HASH+INDEX+CAPTURE|draft_actions=PLAN+PREDICT+CORRECT+ROLL_OUT+REVIEW|control_actions=TYPE+CLICK+ENTER+DRAG+SCROLL+HOTKEY+REMOTE_ACT+SHELL+WRITE+DELETE+SUBMIT+OPEN+LAUNCH+MINT|control_verdict=DEFER_TO_OPERATOR|json=0
|
| 6 |
+
PIXROOMACCESS|surface_tiers=public+agent+supervisor+operator+owner+hidden|restricted=operator+owner+hidden|unknown_action=DEFER_TO_SUPERVISOR-live_control-1|identity=handle8-plus-identity16|room_lane=prime-mod3-load-bearing|tag=PROVEN+tool-level|json=0
|
| 7 |
+
PIXFOLDERHOST|contract=folder-dashboard-may-delegate-to-lower-level-host-row|physical_level_cap=16|logical_nesting=row-chain-unbounded|process_launch=0|process_gate=HBP_ROW_ONLY-or-DEFER|tag=PROPOSAL+contract|json=0
|
| 8 |
PIXROOMECONOMY|REAL_FREE=deterministic-wide-sweep|LOGICAL_WAVE=model-judgment-token-thrift-through-8-byte-handles-and-sha16-rows|FROZEN_BRAIN=deterministic-local-slice-requires-double-run-receipt|no_claim=smart-agent-work-is-free|tag=PROPOSAL|json=0
|
| 9 |
PIXROOMFTR|state=SEALED-ROOM-HANDLE-CONTRACT|nothing_launched=1|nothing_minted=1|next=liris-attack-plus-bind-to-Hermes-spindle-rooms-after-fabric-route-baselines|json=0
|
tools/behcs/pixel-room-handle.hbp.sha256
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
001674EDB3BB52EC40052588864BFFBA0EA1035667DBA61680FC43D0B46630EB pixel-room-handle.hbp
|
tools/behcs/pixel-room-handle.mjs
CHANGED
|
@@ -10,6 +10,8 @@ export const UNIT_SEPARATOR = '\x1f';
|
|
| 10 |
export const READ_ACTIONS = Object.freeze(['LOOK', 'READ', 'PROBE', 'DIFF', 'HASH', 'INDEX', 'CAPTURE']);
|
| 11 |
export const DRAFT_ACTIONS = Object.freeze(['PLAN', 'PREDICT', 'CORRECT', 'ROLL_OUT', 'REVIEW']);
|
| 12 |
export const CONTROL_ACTIONS = Object.freeze(['TYPE', 'CLICK', 'ENTER', 'DRAG', 'SCROLL', 'HOTKEY', 'REMOTE_ACT', 'SHELL', 'WRITE', 'DELETE', 'SUBMIT', 'OPEN', 'LAUNCH', 'MINT']);
|
|
|
|
|
|
|
| 13 |
|
| 14 |
const sha256 = (text) => createHash('sha256').update(String(text), 'utf8').digest('hex');
|
| 15 |
const sha16 = (text) => sha256(text).slice(0, 16);
|
|
@@ -34,6 +36,12 @@ function safeKind(kind) {
|
|
| 34 |
return k;
|
| 35 |
}
|
| 36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
function intInRange(field, value, min, max) {
|
| 38 |
const n = Number.parseInt(String(value), 10);
|
| 39 |
if (!Number.isInteger(n) || n < min || n > max) throw new Error(`${field}-out-of-range:${value}`);
|
|
@@ -60,12 +68,16 @@ export function normalizeSha16(field, value = 'none') {
|
|
| 60 |
return s;
|
| 61 |
}
|
| 62 |
|
| 63 |
-
export function classifyRoomAction(action) {
|
| 64 |
const a = hbpToken('action', String(action || 'LOOK').toUpperCase()).replace(/-/g, '_');
|
| 65 |
-
|
| 66 |
-
if (
|
| 67 |
-
if (
|
| 68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
}
|
| 70 |
|
| 71 |
export function mintPixelRoom({
|
|
@@ -73,6 +85,7 @@ export function mintPixelRoom({
|
|
| 73 |
pid = 'PROPOSED',
|
| 74 |
room,
|
| 75 |
surface,
|
|
|
|
| 76 |
route,
|
| 77 |
tier = 8,
|
| 78 |
kind = 'logical',
|
|
@@ -88,16 +101,21 @@ export function mintPixelRoom({
|
|
| 88 |
const pidValue = safeScalar('pid', pid);
|
| 89 |
const roomValue = safeScalar('room', room);
|
| 90 |
const surfaceValue = safeScalar('surface', surface);
|
|
|
|
| 91 |
const routeValue = safeScalar('route', route);
|
| 92 |
-
const
|
|
|
|
| 93 |
const h = sha256(preimage);
|
| 94 |
return {
|
| 95 |
handle: h.slice(0, HANDLE_BYTES * 2),
|
| 96 |
handle_bytes: HANDLE_BYTES,
|
|
|
|
|
|
|
| 97 |
runtime: rt,
|
| 98 |
pid: pidValue,
|
| 99 |
room: roomValue,
|
| 100 |
surface: surfaceValue,
|
|
|
|
| 101 |
route: routeValue,
|
| 102 |
route_sha16: sha16(routeValue),
|
| 103 |
room_sha16: sha16(roomValue),
|
|
@@ -108,6 +126,7 @@ export function mintPixelRoom({
|
|
| 108 |
yin_yang_bit: KIND_BITS[k],
|
| 109 |
prime: String(p).padStart(2, '0'),
|
| 110 |
prime_mod3: p % 3,
|
|
|
|
| 111 |
prime_parity: p % 2 === 0 ? 'even' : 'odd',
|
| 112 |
agent_type: agentType,
|
| 113 |
preimage_sha16: h.slice(16, 32),
|
|
@@ -116,7 +135,7 @@ export function mintPixelRoom({
|
|
| 116 |
|
| 117 |
export function createPixelRoomTask(input = {}) {
|
| 118 |
const room = mintPixelRoom(input);
|
| 119 |
-
const a = classifyRoomAction(input.action || 'LOOK');
|
| 120 |
return {
|
| 121 |
...room,
|
| 122 |
...a,
|
|
@@ -128,13 +147,63 @@ export function createPixelRoomTask(input = {}) {
|
|
| 128 |
};
|
| 129 |
}
|
| 130 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
export function emitPixelRoomRows(input = {}) {
|
| 132 |
const task = input.handle ? input : createPixelRoomTask(input);
|
| 133 |
return [
|
| 134 |
-
`PIXROOMHDR|tool=${PIXEL_ROOM_ID}|handle=${task.handle}|handle_bytes=${task.handle_bytes}|pid=${hbpToken('pid', task.pid)}|runtime=${task.runtime}|agent_type=${task.agent_type}|tier=${task.tier}|room=${hbpToken('room', task.room)}|surface=${hbpToken('surface', task.surface)}|route_sha16=${task.route_sha16}|json=0`,
|
| 135 |
-
`PIXROOMDIV|handle=${task.handle}|three_system=${task.agent_type}|yin_yang=${task.yin_yang}|yin_yang_bit=${task.yin_yang_bit}|prime=${task.prime}|prime_mod3=${task.prime_mod3}|prime_parity=${task.prime_parity}|nest=${task.nest}|rule=three-systems-three-rules-yin-yang-primes-all-pid|json=0`,
|
| 136 |
-
`PIXROOMPROOF|handle=${task.handle}|action=${task.action}|verdict=${task.verdict}|pixel_sha16=${task.pixel_sha16}|pixel_delta_sha16=${task.pixel_delta_sha16}|world_rollout_sha16=${task.world_rollout_sha16}|correction_sha16=${task.correction_sha16}|target_sha16=${task.target_sha16}|raw_pixels=0|dom_authority=0|json=0`,
|
| 137 |
-
`PIXROOMGATE|handle=${task.handle}|live_control=${task.live_control}|control_gate=${task.live_control ?
|
| 138 |
];
|
| 139 |
}
|
| 140 |
|
|
@@ -153,12 +222,20 @@ export function selfTest() {
|
|
| 153 |
};
|
| 154 |
const t = createPixelRoomTask({ ...base, action: 'LOOK', pixel_sha16: '0123456789abcdef' });
|
| 155 |
add('handle-shape', /^[0-9a-f]{16}$/.test(t.handle));
|
|
|
|
| 156 |
add('deterministic', createPixelRoomTask({ ...base, action: 'LOOK' }).handle === createPixelRoomTask({ ...base, action: 'LOOK' }).handle);
|
| 157 |
add('tuple-split-no-collision', sha16(tuplePreimage(['a', 'b-c'])) !== sha16(tuplePreimage(['a-b', 'c'])));
|
| 158 |
add('separation-logical', createPixelRoomTask({ ...base, kind: 'logical', prime: 0 }).agent_type === 'LOGICAL-WAVE');
|
| 159 |
add('separation-frozen', createPixelRoomTask({ ...base, kind: 'real', prime: 0 }).agent_type === 'FROZEN-BRAIN');
|
| 160 |
add('separation-real-free', createPixelRoomTask({ ...base, kind: 'real', prime: 1 }).agent_type === 'REAL-FREE');
|
| 161 |
add('control-deferred', createPixelRoomTask({ ...base, action: 'TYPE' }).verdict === 'DEFER_TO_OPERATOR');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
add('no-raw-pixels-row', emitPixelRoomRows(t).some((row) => row.includes('raw_pixels=0') && row.includes('pixel_sha16=0123456789abcdef')));
|
| 163 |
add('rows-hbp-only', emitPixelRoomRows(t).every((row) => row.endsWith('|json=0') && !row.includes('\n')));
|
| 164 |
add('hbp-injection-rejected', (() => { try { createPixelRoomTask({ ...base, room: 'bad|room' }); return false; } catch { return true; } })());
|
|
@@ -179,6 +256,7 @@ if (isMain) {
|
|
| 179 |
surface: process.argv[5] || 'backend-pixels',
|
| 180 |
route: process.argv[6] || '/api/omniscrcpy/status',
|
| 181 |
action: process.argv[7] || 'LOOK',
|
|
|
|
| 182 |
kind: 'logical',
|
| 183 |
prime: 1,
|
| 184 |
})) console.log(row);
|
|
|
|
| 10 |
export const READ_ACTIONS = Object.freeze(['LOOK', 'READ', 'PROBE', 'DIFF', 'HASH', 'INDEX', 'CAPTURE']);
|
| 11 |
export const DRAFT_ACTIONS = Object.freeze(['PLAN', 'PREDICT', 'CORRECT', 'ROLL_OUT', 'REVIEW']);
|
| 12 |
export const CONTROL_ACTIONS = Object.freeze(['TYPE', 'CLICK', 'ENTER', 'DRAG', 'SCROLL', 'HOTKEY', 'REMOTE_ACT', 'SHELL', 'WRITE', 'DELETE', 'SUBMIT', 'OPEN', 'LAUNCH', 'MINT']);
|
| 13 |
+
export const SURFACE_TIERS = Object.freeze(['public', 'agent', 'supervisor', 'operator', 'owner', 'hidden']);
|
| 14 |
+
export const RESTRICTED_SURFACE_TIERS = Object.freeze(['operator', 'owner', 'hidden']);
|
| 15 |
|
| 16 |
const sha256 = (text) => createHash('sha256').update(String(text), 'utf8').digest('hex');
|
| 17 |
const sha16 = (text) => sha256(text).slice(0, 16);
|
|
|
|
| 36 |
return k;
|
| 37 |
}
|
| 38 |
|
| 39 |
+
function safeSurfaceTier(surfaceTier = 'agent') {
|
| 40 |
+
const tier = safeScalar('surface_tier', surfaceTier || 'agent').toLowerCase();
|
| 41 |
+
if (!SURFACE_TIERS.includes(tier)) throw new Error(`surface-tier-invalid:${surfaceTier}`);
|
| 42 |
+
return tier;
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
function intInRange(field, value, min, max) {
|
| 46 |
const n = Number.parseInt(String(value), 10);
|
| 47 |
if (!Number.isInteger(n) || n < min || n > max) throw new Error(`${field}-out-of-range:${value}`);
|
|
|
|
| 68 |
return s;
|
| 69 |
}
|
| 70 |
|
| 71 |
+
export function classifyRoomAction(action, { surface_tier = 'agent' } = {}) {
|
| 72 |
const a = hbpToken('action', String(action || 'LOOK').toUpperCase()).replace(/-/g, '_');
|
| 73 |
+
const tier = safeSurfaceTier(surface_tier);
|
| 74 |
+
if (CONTROL_ACTIONS.includes(a)) return { action: a, verdict: 'DEFER_TO_OPERATOR', live_control: 1, surface_tier: tier, access_gate: 'live-control' };
|
| 75 |
+
if (RESTRICTED_SURFACE_TIERS.includes(tier) && (READ_ACTIONS.includes(a) || DRAFT_ACTIONS.includes(a))) {
|
| 76 |
+
return { action: a, verdict: 'DEFER_TO_SUPERVISOR', live_control: 1, surface_tier: tier, access_gate: 'restricted-surface' };
|
| 77 |
+
}
|
| 78 |
+
if (READ_ACTIONS.includes(a)) return { action: a, verdict: 'READ_READY', live_control: 0, surface_tier: tier, access_gate: 'read-ok' };
|
| 79 |
+
if (DRAFT_ACTIONS.includes(a)) return { action: a, verdict: 'DRAFT_READY', live_control: 0, surface_tier: tier, access_gate: 'draft-ok' };
|
| 80 |
+
return { action: a, verdict: 'DEFER_TO_SUPERVISOR', live_control: 1, surface_tier: tier, access_gate: 'unknown-action-fail-closed' };
|
| 81 |
}
|
| 82 |
|
| 83 |
export function mintPixelRoom({
|
|
|
|
| 85 |
pid = 'PROPOSED',
|
| 86 |
room,
|
| 87 |
surface,
|
| 88 |
+
surface_tier = 'agent',
|
| 89 |
route,
|
| 90 |
tier = 8,
|
| 91 |
kind = 'logical',
|
|
|
|
| 101 |
const pidValue = safeScalar('pid', pid);
|
| 102 |
const roomValue = safeScalar('room', room);
|
| 103 |
const surfaceValue = safeScalar('surface', surface);
|
| 104 |
+
const surfaceTier = safeSurfaceTier(surface_tier);
|
| 105 |
const routeValue = safeScalar('route', route);
|
| 106 |
+
const roomLane = `L${p % 3}`;
|
| 107 |
+
const preimage = tuplePreimage(['ROOM', rt, agentType, k, String(p), String(t), String(n), pidValue, roomValue, surfaceValue, surfaceTier, routeValue, roomLane]);
|
| 108 |
const h = sha256(preimage);
|
| 109 |
return {
|
| 110 |
handle: h.slice(0, HANDLE_BYTES * 2),
|
| 111 |
handle_bytes: HANDLE_BYTES,
|
| 112 |
+
identity16: h.slice(0, 32),
|
| 113 |
+
identity_bytes: 16,
|
| 114 |
runtime: rt,
|
| 115 |
pid: pidValue,
|
| 116 |
room: roomValue,
|
| 117 |
surface: surfaceValue,
|
| 118 |
+
surface_tier: surfaceTier,
|
| 119 |
route: routeValue,
|
| 120 |
route_sha16: sha16(routeValue),
|
| 121 |
room_sha16: sha16(roomValue),
|
|
|
|
| 126 |
yin_yang_bit: KIND_BITS[k],
|
| 127 |
prime: String(p).padStart(2, '0'),
|
| 128 |
prime_mod3: p % 3,
|
| 129 |
+
room_lane: roomLane,
|
| 130 |
prime_parity: p % 2 === 0 ? 'even' : 'odd',
|
| 131 |
agent_type: agentType,
|
| 132 |
preimage_sha16: h.slice(16, 32),
|
|
|
|
| 135 |
|
| 136 |
export function createPixelRoomTask(input = {}) {
|
| 137 |
const room = mintPixelRoom(input);
|
| 138 |
+
const a = classifyRoomAction(input.action || 'LOOK', { surface_tier: room.surface_tier });
|
| 139 |
return {
|
| 140 |
...room,
|
| 141 |
...a,
|
|
|
|
| 147 |
};
|
| 148 |
}
|
| 149 |
|
| 150 |
+
export function createFolderHostCall(input = {}) {
|
| 151 |
+
const parent = createPixelRoomTask(input.parent || input);
|
| 152 |
+
const parentTier = Number.parseInt(parent.tier.slice(1), 10);
|
| 153 |
+
const childTier = input.child_tier ?? input.childTier ?? Math.min(15, parentTier + 1);
|
| 154 |
+
const childNest = input.child_nest ?? input.childNest ?? Math.min(99999, Number.parseInt(parent.nest, 10) + 1);
|
| 155 |
+
const child = createPixelRoomTask({
|
| 156 |
+
runtime: input.child_runtime ?? input.childRuntime ?? parent.runtime,
|
| 157 |
+
pid: input.child_pid ?? input.childPid ?? parent.pid,
|
| 158 |
+
room: input.child_room ?? input.childRoom ?? `${parent.room}/child-${childNest}`,
|
| 159 |
+
surface: input.child_surface ?? input.childSurface ?? parent.surface,
|
| 160 |
+
surface_tier: input.child_surface_tier ?? input.childSurfaceTier ?? parent.surface_tier,
|
| 161 |
+
route: input.child_route ?? input.childRoute ?? parent.route,
|
| 162 |
+
tier: childTier,
|
| 163 |
+
kind: input.child_kind ?? input.childKind ?? parent.yin_yang,
|
| 164 |
+
prime: input.child_prime ?? input.childPrime ?? Number.parseInt(parent.prime, 10),
|
| 165 |
+
nest: childNest,
|
| 166 |
+
action: input.child_action ?? input.childAction ?? input.action ?? 'PLAN',
|
| 167 |
+
pixel_sha16: input.child_pixel_sha16 ?? input.childPixelSha16 ?? input.pixel_sha16 ?? 'none',
|
| 168 |
+
pixel_delta_sha16: input.child_pixel_delta_sha16 ?? input.childPixelDeltaSha16 ?? input.pixel_delta_sha16 ?? 'none',
|
| 169 |
+
world_rollout_sha16: input.child_world_rollout_sha16 ?? input.childWorldRolloutSha16 ?? input.world_rollout_sha16 ?? 'none',
|
| 170 |
+
correction_sha16: input.child_correction_sha16 ?? input.childCorrectionSha16 ?? input.correction_sha16 ?? 'none',
|
| 171 |
+
target_sha16: input.child_target_sha16 ?? input.childTargetSha16 ?? input.target_sha16 ?? 'none',
|
| 172 |
+
});
|
| 173 |
+
const folder = safeScalar('folder', input.folder ?? input.child_folder ?? child.room);
|
| 174 |
+
const hostProcess = safeScalar('host_process', input.host_process ?? input.hostProcess ?? 'HBP-ROW-ONLY');
|
| 175 |
+
const depth = intInRange('depth', input.depth ?? childNest, 1, 99999);
|
| 176 |
+
const preimage = tuplePreimage(['FOLDER_HOST', parent.identity16, child.identity16, folder, hostProcess, String(depth)]);
|
| 177 |
+
return {
|
| 178 |
+
parent,
|
| 179 |
+
child,
|
| 180 |
+
folder,
|
| 181 |
+
host_process: hostProcess,
|
| 182 |
+
depth,
|
| 183 |
+
delegation_sha16: sha16(preimage),
|
| 184 |
+
physical_level_cap: 16,
|
| 185 |
+
logical_nesting: 'row-chain-unbounded',
|
| 186 |
+
process_launch: 0,
|
| 187 |
+
process_gate: child.live_control ? child.verdict : 'HBP_ROW_ONLY',
|
| 188 |
+
};
|
| 189 |
+
}
|
| 190 |
+
|
| 191 |
+
export function emitFolderHostRows(input = {}) {
|
| 192 |
+
const c = input.parent && input.child && input.delegation_sha16 ? input : createFolderHostCall(input);
|
| 193 |
+
return [
|
| 194 |
+
`PIXFOLDERHOST|delegation_sha16=${c.delegation_sha16}|parent_handle=${c.parent.handle}|child_handle=${c.child.handle}|parent_identity16=${c.parent.identity16}|child_identity16=${c.child.identity16}|folder=${hbpToken('folder', c.folder)}|host_process=${hbpToken('host_process', c.host_process)}|json=0`,
|
| 195 |
+
`PIXFOLDERLEVEL|delegation_sha16=${c.delegation_sha16}|parent_tier=${c.parent.tier}|child_tier=${c.child.tier}|depth=${c.depth}|physical_level_cap=${c.physical_level_cap}|logical_nesting=${c.logical_nesting}|room_lane=${c.child.room_lane}|json=0`,
|
| 196 |
+
`PIXFOLDERGATE|delegation_sha16=${c.delegation_sha16}|child_action=${c.child.action}|child_verdict=${c.child.verdict}|child_surface_tier=${c.child.surface_tier}|process_launch=${c.process_launch}|process_gate=${c.process_gate}|cost_model=thin-reasoning-plus-deterministic-host-row|nothing_launched=1|json=0`,
|
| 197 |
+
];
|
| 198 |
+
}
|
| 199 |
+
|
| 200 |
export function emitPixelRoomRows(input = {}) {
|
| 201 |
const task = input.handle ? input : createPixelRoomTask(input);
|
| 202 |
return [
|
| 203 |
+
`PIXROOMHDR|tool=${PIXEL_ROOM_ID}|handle=${task.handle}|handle_bytes=${task.handle_bytes}|identity16=${task.identity16}|identity_bytes=${task.identity_bytes}|pid=${hbpToken('pid', task.pid)}|runtime=${task.runtime}|agent_type=${task.agent_type}|tier=${task.tier}|room=${hbpToken('room', task.room)}|surface=${hbpToken('surface', task.surface)}|surface_tier=${task.surface_tier}|route_sha16=${task.route_sha16}|json=0`,
|
| 204 |
+
`PIXROOMDIV|handle=${task.handle}|three_system=${task.agent_type}|yin_yang=${task.yin_yang}|yin_yang_bit=${task.yin_yang_bit}|prime=${task.prime}|prime_mod3=${task.prime_mod3}|room_lane=${task.room_lane}|prime_parity=${task.prime_parity}|nest=${task.nest}|rule=three-systems-three-rules-yin-yang-primes-all-pid|json=0`,
|
| 205 |
+
`PIXROOMPROOF|handle=${task.handle}|action=${task.action}|verdict=${task.verdict}|surface_tier=${task.surface_tier}|access_gate=${task.access_gate}|pixel_sha16=${task.pixel_sha16}|pixel_delta_sha16=${task.pixel_delta_sha16}|world_rollout_sha16=${task.world_rollout_sha16}|correction_sha16=${task.correction_sha16}|target_sha16=${task.target_sha16}|raw_pixels=0|dom_authority=0|json=0`,
|
| 206 |
+
`PIXROOMGATE|handle=${task.handle}|live_control=${task.live_control}|control_gate=${task.live_control ? task.verdict : 'not-live-control'}|economy=REAL-FREE-deterministic-sweep-plus-LOGICAL-WAVE-token-thrift-via-handles|mcp_payload=sha16-row-handles-not-full-context|nothing_launched=1|json=0`,
|
| 207 |
];
|
| 208 |
}
|
| 209 |
|
|
|
|
| 222 |
};
|
| 223 |
const t = createPixelRoomTask({ ...base, action: 'LOOK', pixel_sha16: '0123456789abcdef' });
|
| 224 |
add('handle-shape', /^[0-9a-f]{16}$/.test(t.handle));
|
| 225 |
+
add('identity16-shape', /^[0-9a-f]{32}$/.test(t.identity16) && t.identity_bytes === 16);
|
| 226 |
add('deterministic', createPixelRoomTask({ ...base, action: 'LOOK' }).handle === createPixelRoomTask({ ...base, action: 'LOOK' }).handle);
|
| 227 |
add('tuple-split-no-collision', sha16(tuplePreimage(['a', 'b-c'])) !== sha16(tuplePreimage(['a-b', 'c'])));
|
| 228 |
add('separation-logical', createPixelRoomTask({ ...base, kind: 'logical', prime: 0 }).agent_type === 'LOGICAL-WAVE');
|
| 229 |
add('separation-frozen', createPixelRoomTask({ ...base, kind: 'real', prime: 0 }).agent_type === 'FROZEN-BRAIN');
|
| 230 |
add('separation-real-free', createPixelRoomTask({ ...base, kind: 'real', prime: 1 }).agent_type === 'REAL-FREE');
|
| 231 |
add('control-deferred', createPixelRoomTask({ ...base, action: 'TYPE' }).verdict === 'DEFER_TO_OPERATOR');
|
| 232 |
+
add('unknown-action-fail-closed', createPixelRoomTask({ ...base, action: 'typ' }).live_control === 1);
|
| 233 |
+
add('hidden-surface-gated', createPixelRoomTask({ ...base, surface_tier: 'hidden', action: 'LOOK' }).verdict === 'DEFER_TO_SUPERVISOR');
|
| 234 |
+
add('mod3-room-lane-load-bearing', createPixelRoomTask({ ...base, prime: 4 }).room_lane === 'L1');
|
| 235 |
+
add('nested-folder-host-row-only', (() => {
|
| 236 |
+
const c = createFolderHostCall({ ...base, child_room: 'A09-child-room', folder: 'dashboards/A08', host_process: 'child-host.mjs' });
|
| 237 |
+
return c.process_launch === 0 && c.child.tier === 'A09' && c.logical_nesting === 'row-chain-unbounded';
|
| 238 |
+
})());
|
| 239 |
add('no-raw-pixels-row', emitPixelRoomRows(t).some((row) => row.includes('raw_pixels=0') && row.includes('pixel_sha16=0123456789abcdef')));
|
| 240 |
add('rows-hbp-only', emitPixelRoomRows(t).every((row) => row.endsWith('|json=0') && !row.includes('\n')));
|
| 241 |
add('hbp-injection-rejected', (() => { try { createPixelRoomTask({ ...base, room: 'bad|room' }); return false; } catch { return true; } })());
|
|
|
|
| 256 |
surface: process.argv[5] || 'backend-pixels',
|
| 257 |
route: process.argv[6] || '/api/omniscrcpy/status',
|
| 258 |
action: process.argv[7] || 'LOOK',
|
| 259 |
+
surface_tier: 'agent',
|
| 260 |
kind: 'logical',
|
| 261 |
prime: 1,
|
| 262 |
})) console.log(row);
|
tools/behcs/pixel-room-handle.mjs.sha256
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
3A35550662350290CC588CC272AD88E1EFCD1542A981C28A529CAED190923E28 pixel-room-handle.mjs
|