Kevin Crutt commited on
Commit ·
81a6e82
1
Parent(s): 2789d14
harden nnest proxy and canonical depth
Browse files- docs/LIRIS-NNEST-GATE-HARDEN-READBACK-2026-06-11.hbp +8 -0
- docs/LIRIS-NNEST-GATE-HARDEN-READBACK-2026-06-11.hbp.sha256 +1 -0
- docs/NNEST-WATCHER-GATE-PARITY-BASELINE-2026-06-11.hbp +5 -2
- docs/NNEST-WATCHER-GATE-PARITY-BASELINE-2026-06-11.hbp.sha256 +1 -1
- docs/TARGET-ARCHITECTURE-200-STEP-DELTA-2026-06-11.hbp +1 -1
- docs/TARGET-ARCHITECTURE-200-STEP-DELTA-2026-06-11.hbp.sha256 +1 -1
- docs/TARGET-ARCHITECTURE-VISION-2026-06-10.hbp +1 -1
- docs/TARGET-ARCHITECTURE-VISION-2026-06-10.hbp.sha256 +1 -1
- tests/nnest-watcher-gate.unit.test.mjs +33 -0
- tests/nnest-watcher-gate.unit.test.mjs.sha256 +1 -1
- tests/supervisor-collision-router.system.test.mjs +1 -0
- tests/supervisor-collision-router.system.test.mjs.sha256 +1 -1
- tools/behcs/nnest-watcher-gate.hbi +7 -6
- tools/behcs/nnest-watcher-gate.hbi.sha256 +1 -1
- tools/behcs/nnest-watcher-gate.hbp +5 -4
- tools/behcs/nnest-watcher-gate.hbp.sha256 +1 -1
- tools/behcs/nnest-watcher-gate.mjs +56 -25
- tools/behcs/nnest-watcher-gate.mjs.sha256 +1 -1
docs/LIRIS-NNEST-GATE-HARDEN-READBACK-2026-06-11.hbp
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
LIRISNNESTHARDENRBHDR|host=liris|date=2026-06-11|pulled_commit=2789d14|topic=component-4-counter-verify-of-acer-single-read-snapshot-hardening-plus-200-step-delta-precision|json=0
|
| 2 |
+
LIRISNNESTHARDENRBVERIFY|blob_level_sidecars=ALL_OK|pyramid_at_pull=105of105_PASS|acer_delta_precision=ACCEPTED(two-real-doc-fixes)|acer_harden_receipt=READ|json=0
|
| 3 |
+
LIRISNNESTHARDENRBACCEPT|acer_three_findings_against-liris-exact-tuple-patch=REAL|accessor-toctou+non-enumerable-own+symbol-keyed=correctly-caught|single-read-snapshot-doctrine=RIGHT_DIRECTION|json=0
|
| 4 |
+
LIRISNNESTHARDENRBFINDINGS|liris_two_new_edges_after-acer-hardening=TWO_REAL|F1=revoked-proxy-chain-or-tuple-threw-TypeError-instead-of-emitting-CHILD_HELD-row|F2=negative-zero-depth-aliased-to-canonical-zero-and-could-CHILD_MAY_ACT|verdict=TWO_REAL_PATCHED|json=0
|
| 5 |
+
LIRISNNESTHARDENRBPATCH|F1=materializeChain+snapshotTuple-now-catch-hostile-proxy-traps-and-return-null-or-empty-materialization|F2=isCanonicalDepth-rejects-negative-zero-for-max_depth-and-tuple-depth|also=descriptor-value-snapshot-used-instead-of-later-property-get|json=0
|
| 6 |
+
LIRISNNESTHARDENRBPROBES|extended=5of5_PASS|revoked-proxy-tuple=CHILD_HELD-chain-topology-invalid@1|revoked-proxy-chain=CHILD_HELD-empty-or-missing-chain|tuple-depth-negative-zero=CHILD_HELD-chain-topology-invalid@0|max-depth-negative-zero=CHILD_HELD-invalid-max-depth|proxy-descriptor-get-split=CHILD_MAY_ACT-on-descriptor-snapshot-no-verdict-digest-split|json=0
|
| 7 |
+
LIRISNNESTHARDENRBSAFETY|repo_side_only=1|untouched=process-spawn+real-agent-recursion+harness-edits+mint+USB+engine+apex-T0|mutates=component4-tool+tests+descriptor+parity+receipt-only|json=0
|
| 8 |
+
LIRISNNESTHARDENRBFTR|state=COMPONENT_4_LIRIS_PROXY_DEPTH_COUNTERHARDENING_READY_FOR_ACER_PULL|json=0
|
docs/LIRIS-NNEST-GATE-HARDEN-READBACK-2026-06-11.hbp.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
FA61742BF2DACD7BCA3630998EEFFA46061D73F37AD682BF66EC77F44EA05027 LIRIS-NNEST-GATE-HARDEN-READBACK-2026-06-11.hbp
|
docs/NNEST-WATCHER-GATE-PARITY-BASELINE-2026-06-11.hbp
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
NNESTGATEPARITYHDR|component=4|cases=
|
| 2 |
NNESTGATEPARITY|case=01|agent=AGT-NNEST-PROBE-0001|action=report-up|max_depth=3|chain_len=4|chain_sha16=502e00a9b19e839d|verdict=CHILD_MAY_ACT|first_bad_depth=none|gate=none|executable=0|json=0
|
| 3 |
NNESTGATEPARITY|case=02|agent=AGT-NNEST-PROBE-0001|action=report-up|max_depth=16|chain_len=17|chain_sha16=58b859999d5e364a|verdict=CHILD_MAY_ACT|first_bad_depth=none|gate=none|executable=0|json=0
|
| 4 |
NNESTGATEPARITY|case=03|agent=AGT-NNEST-PROBE-0001|action=report-up|max_depth=3|chain_len=4|chain_sha16=f4579dd9c63399f5|verdict=CHILD_HELD|first_bad_depth=2|gate=hash-divergence|executable=0|json=0
|
|
@@ -20,4 +20,7 @@ NNESTGATEPARITY|case=18|agent=AGT-NNEST-PROBE-0001|action=report-up|max_depth=3|
|
|
| 20 |
NNESTGATEPARITY|case=19|agent=AGT-NNEST-PROBE-0001|action=report-up|max_depth=3|chain_len=4|chain_sha16=none|verdict=CHILD_HELD|first_bad_depth=1|gate=chain-topology-invalid|executable=0|json=0
|
| 21 |
NNESTGATEPARITY|case=20|agent=AGT-NNEST-PROBE-0001|action=report-up|max_depth=3|chain_len=4|chain_sha16=none|verdict=CHILD_HELD|first_bad_depth=2|gate=chain-topology-invalid|executable=0|json=0
|
| 22 |
NNESTGATEPARITY|case=21|agent=AGT-NNEST-PROBE-0001|action=report-up|max_depth=3|chain_len=4|chain_sha16=none|verdict=CHILD_HELD|first_bad_depth=0|gate=chain-topology-invalid|executable=0|json=0
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
NNESTGATEPARITYHDR|component=4|cases=24|clock=none-time-free-contract|rule=rows-byte-identical-on-every-machine|json=0
|
| 2 |
NNESTGATEPARITY|case=01|agent=AGT-NNEST-PROBE-0001|action=report-up|max_depth=3|chain_len=4|chain_sha16=502e00a9b19e839d|verdict=CHILD_MAY_ACT|first_bad_depth=none|gate=none|executable=0|json=0
|
| 3 |
NNESTGATEPARITY|case=02|agent=AGT-NNEST-PROBE-0001|action=report-up|max_depth=16|chain_len=17|chain_sha16=58b859999d5e364a|verdict=CHILD_MAY_ACT|first_bad_depth=none|gate=none|executable=0|json=0
|
| 4 |
NNESTGATEPARITY|case=03|agent=AGT-NNEST-PROBE-0001|action=report-up|max_depth=3|chain_len=4|chain_sha16=f4579dd9c63399f5|verdict=CHILD_HELD|first_bad_depth=2|gate=hash-divergence|executable=0|json=0
|
|
|
|
| 20 |
NNESTGATEPARITY|case=19|agent=AGT-NNEST-PROBE-0001|action=report-up|max_depth=3|chain_len=4|chain_sha16=none|verdict=CHILD_HELD|first_bad_depth=1|gate=chain-topology-invalid|executable=0|json=0
|
| 21 |
NNESTGATEPARITY|case=20|agent=AGT-NNEST-PROBE-0001|action=report-up|max_depth=3|chain_len=4|chain_sha16=none|verdict=CHILD_HELD|first_bad_depth=2|gate=chain-topology-invalid|executable=0|json=0
|
| 22 |
NNESTGATEPARITY|case=21|agent=AGT-NNEST-PROBE-0001|action=report-up|max_depth=3|chain_len=4|chain_sha16=none|verdict=CHILD_HELD|first_bad_depth=0|gate=chain-topology-invalid|executable=0|json=0
|
| 23 |
+
NNESTGATEPARITY|case=22|agent=AGT-NNEST-PROBE-0001|action=report-up|max_depth=3|chain_len=4|chain_sha16=none|verdict=CHILD_HELD|first_bad_depth=1|gate=chain-topology-invalid|executable=0|json=0
|
| 24 |
+
NNESTGATEPARITY|case=23|agent=AGT-NNEST-PROBE-0001|action=report-up|max_depth=invalid|chain_len=1|chain_sha16=8f6d8d4eca0f9e07|verdict=CHILD_HELD|first_bad_depth=none|gate=invalid-max-depth|executable=0|json=0
|
| 25 |
+
NNESTGATEPARITY|case=24|agent=AGT-NNEST-PROBE-0001|action=report-up|max_depth=3|chain_len=4|chain_sha16=none|verdict=CHILD_HELD|first_bad_depth=0|gate=chain-topology-invalid|executable=0|json=0
|
| 26 |
+
NNESTGATEPARITYFTR|cases=24|exit=byte-match-when-regenerated-file-equals-sealed-baseline|json=0
|
docs/NNEST-WATCHER-GATE-PARITY-BASELINE-2026-06-11.hbp.sha256
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
CBB5F7F0CC5AC8EA629B3ED42C709A30F1EAFCE3A321DD949D6D78C4E3E23419 NNEST-WATCHER-GATE-PARITY-BASELINE-2026-06-11.hbp
|
docs/TARGET-ARCHITECTURE-200-STEP-DELTA-2026-06-11.hbp
CHANGED
|
@@ -10,7 +10,7 @@ PTPTEST|required=classify-prime-power-49-p2+transition-allowed-5-7+disputed-band
|
|
| 10 |
COMP3DELTA|insert_after_step=60|adds=bh_lane-extraction+bh_ppow-classification+p3-collision-reserve-proposal+blocked-row-skip-classification+frozen-slice-manifest-rebind|current_status=PARTIAL-bh_lane-bh_ppow-and-blocked-redaction-proven-manifest-rebind-and-p3-mint-pending|verification=component3-lattice-test-1e6-random-addresses-required|json=0
|
| 11 |
FROZSEQ|insert_after_step=80|sequence=fill-frozen-model-socket+hash-manifest-bytes+bind-frozen-slice-to-BH+attach-geospatial-MTP-route+watcher-emits-suggestion-row+supervisor-validates-topology+fischer-scores-output+shannon-gates-novelty+whiteroom-mint-promotes-with-operator-cosign|status=DRAFT-and-OPERATOR_GATED-where-live-or-minting|json=0
|
| 12 |
ORGANMAP|insert_after_step=90|fischer=judge-score-kernel|omnishannon=novelty-gate|hermes-hyperhermes-spindles=transport-pulse|gnn=edge-wiring|whiteroom=quarantine-promote-chamber|mint=canon-promotion|hookwall=pass-block-policy|nnest=recursive-watcher-gate|rule=each-organ-carries-current-proof-plus-gap-plus-next-step-number|json=0
|
| 13 |
-
COMP4DELTA|insert_after_step=115|liris_readback=docs/LIRIS-NNEST-GATE-READBACK-2026-06-11.hbp|acer_harden=docs/ACER-NNEST-GATE-HARDEN-2026-06-11.hbp|patch_stack=exact-own-field-plain-object-tuples+chain_sha16-none-for-invalid-or-noncanonical-chains+single-read-frozen-data-tuple-snapshot+reject-accessors-nonenum-symbol-keys|state=
|
| 14 |
TUPLESHAPELAW|rule=verification-inputs-must-be-single-read-frozen-snapshots|reject=accessors+setters+non-enumerable-own-fields+symbol-keys+prototype-inherited-fields+extra-fields+proxy-TOCTOU-splits|applies_to=nnest-now+fischer-shannon-binder-future|source=ACER-NNEST-GATE-HARDEN-2026-06-11|json=0
|
| 15 |
TAGLAW|replace_free_text_hype_with_tags=PROVEN+PARTIAL+DRAFT+PROPOSAL+OPERATOR_GATED+ASPIRATIONAL|rule=every-grand-claim-in-plan-must-carry-one-tag|example=ASI-on-16GB-stick-rewrites-to-ASPIRATIONAL-logical-agent-addressability-with-PROVEN-tests-only-where-present|json=0
|
| 16 |
CLAIMSLEDGER|required=extraordinary-number-and-language-ledger|tracks=0.3-bytes+pico-second+1e200+100B-agents+sub-BIOS+ASI|rule=each-claim-gets-tag+evidence+critic-proof-restatement|json=0
|
|
|
|
| 10 |
COMP3DELTA|insert_after_step=60|adds=bh_lane-extraction+bh_ppow-classification+p3-collision-reserve-proposal+blocked-row-skip-classification+frozen-slice-manifest-rebind|current_status=PARTIAL-bh_lane-bh_ppow-and-blocked-redaction-proven-manifest-rebind-and-p3-mint-pending|verification=component3-lattice-test-1e6-random-addresses-required|json=0
|
| 11 |
FROZSEQ|insert_after_step=80|sequence=fill-frozen-model-socket+hash-manifest-bytes+bind-frozen-slice-to-BH+attach-geospatial-MTP-route+watcher-emits-suggestion-row+supervisor-validates-topology+fischer-scores-output+shannon-gates-novelty+whiteroom-mint-promotes-with-operator-cosign|status=DRAFT-and-OPERATOR_GATED-where-live-or-minting|json=0
|
| 12 |
ORGANMAP|insert_after_step=90|fischer=judge-score-kernel|omnishannon=novelty-gate|hermes-hyperhermes-spindles=transport-pulse|gnn=edge-wiring|whiteroom=quarantine-promote-chamber|mint=canon-promotion|hookwall=pass-block-policy|nnest=recursive-watcher-gate|rule=each-organ-carries-current-proof-plus-gap-plus-next-step-number|json=0
|
| 13 |
+
COMP4DELTA|insert_after_step=115|liris_readback=docs/LIRIS-NNEST-GATE-READBACK-2026-06-11.hbp|acer_harden=docs/ACER-NNEST-GATE-HARDEN-2026-06-11.hbp|liris_counter_harden=docs/LIRIS-NNEST-GATE-HARDEN-READBACK-2026-06-11.hbp|patch_stack=exact-own-field-plain-object-tuples+chain_sha16-none-for-invalid-or-noncanonical-chains+single-read-frozen-data-tuple-snapshot+reject-accessors-nonenum-symbol-keys+hostile-proxy-held-not-thrown+negative-zero-depth-rejected|state=READY_FOR_ACER_READBACK|dry_run_harness_embedding=OPERATOR_GATED|json=0
|
| 14 |
TUPLESHAPELAW|rule=verification-inputs-must-be-single-read-frozen-snapshots|reject=accessors+setters+non-enumerable-own-fields+symbol-keys+prototype-inherited-fields+extra-fields+proxy-TOCTOU-splits|applies_to=nnest-now+fischer-shannon-binder-future|source=ACER-NNEST-GATE-HARDEN-2026-06-11|json=0
|
| 15 |
TAGLAW|replace_free_text_hype_with_tags=PROVEN+PARTIAL+DRAFT+PROPOSAL+OPERATOR_GATED+ASPIRATIONAL|rule=every-grand-claim-in-plan-must-carry-one-tag|example=ASI-on-16GB-stick-rewrites-to-ASPIRATIONAL-logical-agent-addressability-with-PROVEN-tests-only-where-present|json=0
|
| 16 |
CLAIMSLEDGER|required=extraordinary-number-and-language-ledger|tracks=0.3-bytes+pico-second+1e200+100B-agents+sub-BIOS+ASI|rule=each-claim-gets-tag+evidence+critic-proof-restatement|json=0
|
docs/TARGET-ARCHITECTURE-200-STEP-DELTA-2026-06-11.hbp.sha256
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
EAD46448F8B1B2AC501B1703B442E9EB7B5BB6D0E400FBB9971D454C768A0E74 TARGET-ARCHITECTURE-200-STEP-DELTA-2026-06-11.hbp
|
docs/TARGET-ARCHITECTURE-VISION-2026-06-10.hbp
CHANGED
|
@@ -23,7 +23,7 @@ COMPONENT|4|name=INFINITE-NESTED-AGENTS-IN-OS-HARNESSES|vision=infinite-nested-a
|
|
| 23 |
PROVEN|4|N-Nest-Prime(depth-N-watcher-gate-proven-depth-16-over-2732-real-files,planted-confab-caught-at-EVERY-level,131071-nodes)+8-byte-agent-seed(sha256(seed)->glyph/cube/hilbert/prime,35TB/8B~=4.38T-slots)+intelligent-terminal-host-CMD-harness(wta-registry-fills-at-runtime)
|
| 24 |
GAP|4|infinite-nesting-not-yet-wired-into-EVERY-agent-OS-harness|FIX=each-agent-harness-embeds-the-N-Nest-Prime-watcher-gate(child-acts-only-if-reported==recomputed)+consent-anchors-only-at-apex-T0
|
| 25 |
PROGRESS|4|gate_seed=tools/behcs/nnest-watcher-gate.mjs|law=hash-match-every-level-AND-chain-complete-contiguous-unique-ordered(operator-amendment)|topology-violations=CHILD_HELD-with-first_bad_depth|consent=DEFER-at-apex-T0-only-even-on-perfect-chain|depth_bound=16-proven|parity_baseline=NNEST-WATCHER-GATE-PARITY-BASELINE-2026-06-11.hbp|draft_only=1|no_spawn=1|no_harness_edit=1|json=0
|
| 26 |
-
PROGRESS|4|liris_readback=docs/LIRIS-NNEST-GATE-READBACK-2026-06-11.hbp|acer_harden=docs/ACER-NNEST-GATE-HARDEN-2026-06-11.hbp|patch_stack=exact-tuples+chain_sha16-none+snapshotTuple-data-only-single-read|state=
|
| 27 |
|
| 28 |
COMPONENT|5|name=REAL-TIME-SELF-REFLECTION-WATCHER-SUGGESTS-TO-SUPERVISORS|vision=self-reflection-subagent-watches-ANY-agent+suggests-next-steps-to-supervisors-IN-REAL-TIME+supervisors-SEE-it=INFINITE-NEXT-with-self-reflection
|
| 29 |
PROVEN|5|LAW-RECURRENCE-IS-MIND(recurrence+corrective-gate=mind,proven-twice-live)+PROF-AUTOCHRONE(self-reflection-cycle-enforcer-LOOK->TYPE->LOOK->ENTER->LOOK)+self-reflect-daemon(60s-heartbeat-FOUNDATION-V3)+adversarial-verify-pattern(workflows:skeptic-default-refuted-caught-2-real-bugs-this-session)
|
|
|
|
| 23 |
PROVEN|4|N-Nest-Prime(depth-N-watcher-gate-proven-depth-16-over-2732-real-files,planted-confab-caught-at-EVERY-level,131071-nodes)+8-byte-agent-seed(sha256(seed)->glyph/cube/hilbert/prime,35TB/8B~=4.38T-slots)+intelligent-terminal-host-CMD-harness(wta-registry-fills-at-runtime)
|
| 24 |
GAP|4|infinite-nesting-not-yet-wired-into-EVERY-agent-OS-harness|FIX=each-agent-harness-embeds-the-N-Nest-Prime-watcher-gate(child-acts-only-if-reported==recomputed)+consent-anchors-only-at-apex-T0
|
| 25 |
PROGRESS|4|gate_seed=tools/behcs/nnest-watcher-gate.mjs|law=hash-match-every-level-AND-chain-complete-contiguous-unique-ordered(operator-amendment)|topology-violations=CHILD_HELD-with-first_bad_depth|consent=DEFER-at-apex-T0-only-even-on-perfect-chain|depth_bound=16-proven|parity_baseline=NNEST-WATCHER-GATE-PARITY-BASELINE-2026-06-11.hbp|draft_only=1|no_spawn=1|no_harness_edit=1|json=0
|
| 26 |
+
PROGRESS|4|liris_readback=docs/LIRIS-NNEST-GATE-READBACK-2026-06-11.hbp|acer_harden=docs/ACER-NNEST-GATE-HARDEN-2026-06-11.hbp|liris_counter_harden=docs/LIRIS-NNEST-GATE-HARDEN-READBACK-2026-06-11.hbp|patch_stack=exact-tuples+chain_sha16-none+snapshotTuple-data-only-single-read+revoked-proxy-held-not-thrown+negative-zero-depth-rejected|state=READY_FOR_ACER_READBACK|json=0
|
| 27 |
|
| 28 |
COMPONENT|5|name=REAL-TIME-SELF-REFLECTION-WATCHER-SUGGESTS-TO-SUPERVISORS|vision=self-reflection-subagent-watches-ANY-agent+suggests-next-steps-to-supervisors-IN-REAL-TIME+supervisors-SEE-it=INFINITE-NEXT-with-self-reflection
|
| 29 |
PROVEN|5|LAW-RECURRENCE-IS-MIND(recurrence+corrective-gate=mind,proven-twice-live)+PROF-AUTOCHRONE(self-reflection-cycle-enforcer-LOOK->TYPE->LOOK->ENTER->LOOK)+self-reflect-daemon(60s-heartbeat-FOUNDATION-V3)+adversarial-verify-pattern(workflows:skeptic-default-refuted-caught-2-real-bugs-this-session)
|
docs/TARGET-ARCHITECTURE-VISION-2026-06-10.hbp.sha256
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
03B584DBC5D3CF3A6D87325F3A639646D861A0F12B614148CF6A1CECB10B8700 TARGET-ARCHITECTURE-VISION-2026-06-10.hbp
|
tests/nnest-watcher-gate.unit.test.mjs
CHANGED
|
@@ -69,6 +69,39 @@ test('tuple shape is exact: extra fields and inherited fields are topology viola
|
|
| 69 |
assert.equal(protoOut.chain_sha16, 'none');
|
| 70 |
});
|
| 71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
test('mismatch-at-depth-k precision: divergence named at the exact level, every k', () => {
|
| 73 |
for (let k = 0; k <= 5; k += 1) {
|
| 74 |
const chain = goodChain(5);
|
|
|
|
| 69 |
assert.equal(protoOut.chain_sha16, 'none');
|
| 70 |
});
|
| 71 |
|
| 72 |
+
test('hostile proxy inputs are held as rows, never thrown exceptions', () => {
|
| 73 |
+
const tupleProxy = goodChain(3);
|
| 74 |
+
const tupleRevoke = Proxy.revocable(tupleProxy[1], {});
|
| 75 |
+
tupleRevoke.revoke();
|
| 76 |
+
tupleProxy[1] = tupleRevoke.proxy;
|
| 77 |
+
assert.doesNotThrow(() => gateChain({ ...GOOD, chain: tupleProxy }));
|
| 78 |
+
const tupleOut = gateChain({ ...GOOD, chain: tupleProxy });
|
| 79 |
+
assert.equal(tupleOut.verdict, 'CHILD_HELD');
|
| 80 |
+
assert.equal(tupleOut.gate, 'chain-topology-invalid');
|
| 81 |
+
assert.equal(tupleOut.first_bad_depth, 1);
|
| 82 |
+
assert.equal(tupleOut.chain_sha16, 'none');
|
| 83 |
+
|
| 84 |
+
const chainRevoke = Proxy.revocable(goodChain(3), {});
|
| 85 |
+
chainRevoke.revoke();
|
| 86 |
+
assert.doesNotThrow(() => gateChain({ ...GOOD, chain: chainRevoke.proxy }));
|
| 87 |
+
assert.equal(gateChain({ ...GOOD, chain: chainRevoke.proxy }).gate, 'empty-or-missing-chain');
|
| 88 |
+
});
|
| 89 |
+
|
| 90 |
+
test('canonical depths reject negative zero instead of aliasing it to zero', () => {
|
| 91 |
+
const tupleNegativeZero = goodChain(3);
|
| 92 |
+
tupleNegativeZero[0] = { ...tupleNegativeZero[0], depth: -0 };
|
| 93 |
+
const tupleOut = gateChain({ ...GOOD, chain: tupleNegativeZero });
|
| 94 |
+
assert.equal(tupleOut.verdict, 'CHILD_HELD');
|
| 95 |
+
assert.equal(tupleOut.gate, 'chain-topology-invalid');
|
| 96 |
+
assert.equal(tupleOut.first_bad_depth, 0);
|
| 97 |
+
assert.equal(tupleOut.chain_sha16, 'none');
|
| 98 |
+
|
| 99 |
+
const maxOut = gateChain({ ...GOOD, max_depth: -0, chain: goodChain(0) });
|
| 100 |
+
assert.equal(maxOut.verdict, 'CHILD_HELD');
|
| 101 |
+
assert.equal(maxOut.gate, 'invalid-max-depth');
|
| 102 |
+
assert.equal(maxOut.max_depth, 'invalid');
|
| 103 |
+
});
|
| 104 |
+
|
| 105 |
test('mismatch-at-depth-k precision: divergence named at the exact level, every k', () => {
|
| 106 |
for (let k = 0; k <= 5; k += 1) {
|
| 107 |
const chain = goodChain(5);
|
tests/nnest-watcher-gate.unit.test.mjs.sha256
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
86838433939F5AA3EEEC81D42813D777846B3A015DE241FB3FC3CBFE4605C8D8 nnest-watcher-gate.unit.test.mjs
|
tests/supervisor-collision-router.system.test.mjs
CHANGED
|
@@ -42,6 +42,7 @@ const sealedFiles = [
|
|
| 42 |
'docs/ACER-NNEST-GATE-SEED-2026-06-11.hbp',
|
| 43 |
'docs/LIRIS-NNEST-GATE-READBACK-2026-06-11.hbp',
|
| 44 |
'docs/ACER-NNEST-GATE-HARDEN-2026-06-11.hbp',
|
|
|
|
| 45 |
'docs/LIRIS-WATCHER-SUPERVISOR-READBACK-2026-06-11.hbp',
|
| 46 |
'docs/ACER-READBACK-WATCHER-SUPERVISOR-2026-06-11.hbp',
|
| 47 |
'docs/LIRIS-STEP166-PARITY-CONFIRMED-2026-06-11.hbp',
|
|
|
|
| 42 |
'docs/ACER-NNEST-GATE-SEED-2026-06-11.hbp',
|
| 43 |
'docs/LIRIS-NNEST-GATE-READBACK-2026-06-11.hbp',
|
| 44 |
'docs/ACER-NNEST-GATE-HARDEN-2026-06-11.hbp',
|
| 45 |
+
'docs/LIRIS-NNEST-GATE-HARDEN-READBACK-2026-06-11.hbp',
|
| 46 |
'docs/LIRIS-WATCHER-SUPERVISOR-READBACK-2026-06-11.hbp',
|
| 47 |
'docs/ACER-READBACK-WATCHER-SUPERVISOR-2026-06-11.hbp',
|
| 48 |
'docs/LIRIS-STEP166-PARITY-CONFIRMED-2026-06-11.hbp',
|
tests/supervisor-collision-router.system.test.mjs.sha256
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
0BB256FECA79C3CC354A2F20FA8816ECB5559EB96CA91706CD081A88DD088D1E supervisor-collision-router.system.test.mjs
|
tools/behcs/nnest-watcher-gate.hbi
CHANGED
|
@@ -1,13 +1,14 @@
|
|
| 1 |
-
NNESTGATEINDEX|host=
|
| 2 |
INDEXROW|row=1|kind=header|component=architecture-component-4|json=0
|
| 3 |
-
INDEXROW|row=2|kind=law|may_act=hash-match-AND-topology-valid-and-exact-
|
| 4 |
INDEXROW|row=3|kind=scope|repo_side_draft_only=1|no_spawn=1|no_harness_edit=1|json=0
|
| 5 |
INDEXROW|row=4|kind=ladder|rungs=9|topology_before_hashes=1|json=0
|
| 6 |
INDEXROW|row=5|kind=table|actions_free=3|actions_consent=3|consent_cap=DEFER|json=0
|
| 7 |
INDEXROW|row=6|kind=bound|max_depth=16-proven|json=0
|
| 8 |
INDEXROW|row=7|kind=leak|held_rows=first_bad_depth+chain_sha16-only|noncanonical_chain_sha16=none|json=0
|
| 9 |
INDEXROW|row=8|kind=harden|acer-findings=accessor-toctou+non-enumerable-own+symbol-keyed|fix=single-read-snapshot-data-descriptor-only|json=0
|
| 10 |
-
INDEXROW|row=9|kind=
|
| 11 |
-
INDEXROW|row=10|kind=
|
| 12 |
-
INDEXROW|row=11|kind=
|
| 13 |
-
INDEXROW|row=12|kind=
|
|
|
|
|
|
| 1 |
+
NNESTGATEINDEX|host=liris|target=nnest-watcher-gate.hbp|tool=nnest-watcher-gate.mjs|rows=13|json=0
|
| 2 |
INDEXROW|row=1|kind=header|component=architecture-component-4|json=0
|
| 3 |
+
INDEXROW|row=2|kind=law|may_act=hash-match-AND-topology-valid-and-exact-data-snapshot-and-canonical-depth|hashes=necessary-not-sufficient|json=0
|
| 4 |
INDEXROW|row=3|kind=scope|repo_side_draft_only=1|no_spawn=1|no_harness_edit=1|json=0
|
| 5 |
INDEXROW|row=4|kind=ladder|rungs=9|topology_before_hashes=1|json=0
|
| 6 |
INDEXROW|row=5|kind=table|actions_free=3|actions_consent=3|consent_cap=DEFER|json=0
|
| 7 |
INDEXROW|row=6|kind=bound|max_depth=16-proven|json=0
|
| 8 |
INDEXROW|row=7|kind=leak|held_rows=first_bad_depth+chain_sha16-only|noncanonical_chain_sha16=none|json=0
|
| 9 |
INDEXROW|row=8|kind=harden|acer-findings=accessor-toctou+non-enumerable-own+symbol-keyed|fix=single-read-snapshot-data-descriptor-only|json=0
|
| 10 |
+
INDEXROW|row=9|kind=counter-harden|liris-findings=revoked-proxy-throw+negative-zero-depth|fix=held-not-thrown+canonical-depth|json=0
|
| 11 |
+
INDEXROW|row=10|kind=safety|mutates=0|pure_function=1|json=0
|
| 12 |
+
INDEXROW|row=11|kind=verify|required=node-check+node-test+self-test+parity-byte-compare|json=0
|
| 13 |
+
INDEXROW|row=12|kind=sha|fields=gate_sha256+test_sha256|json=0
|
| 14 |
+
INDEXROW|row=13|kind=footer|state=COMPONENT_4_LIRIS_PROXY_DEPTH_COUNTERHARDENING_READY_FOR_ACER_READBACK|json=0
|
tools/behcs/nnest-watcher-gate.hbi.sha256
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
C91A03F5D05AF44965C1E01AA03990683D7CBE013356E62661F5BE40CDBF88AD nnest-watcher-gate.hbi
|
tools/behcs/nnest-watcher-gate.hbp
CHANGED
|
@@ -1,12 +1,13 @@
|
|
| 1 |
-
NNESTGATEHDR|host=
|
| 2 |
-
NNESTGATELAW|may_act_requires=BOTH(hash-match-every-level)AND(chain-complete-contiguous-unique-ordered-depth-0-to-max+exact-3-field-plain-DATA-tuples-single-read-snapshot)|hashes=necessary-but-NOT-sufficient|topology_violations=CHILD_HELD-chain-topology-invalid-with-first_bad_depth(never-merely-malformed)|source=OP-JESSE-amendment-2026-06-11+liris-exact-tuple-patch+acer-tuple-shape-hardening|composes=TARGET-ARCHITECTURE-VISION-2026-06-10(COMPONENT-4)+N-Nest-Prime-proof(depth-16-2732-files-131071-nodes)+LAW-RECURRENCE-IS-MIND|json=0
|
| 3 |
NNESTGATESCOPE_DOC|repo_side_draft_only=1|never=process-spawn+recursion-into-real-agents+harness-edits|gate-emits-verdict-rows-it-never-acts|live_harness_embedding=SEPARATE-GATED-FOLLOW-UP-operator-signoff|json=0
|
| 4 |
NNESTGATELADDER|rungs=9|order=dirty-HELD+malformed-agent-HELD+unknown-action-HELD+invalid-max-depth-HELD+empty-chain-HELD+TOPOLOGY-HELD(first_bad_depth)+hash-format-HELD(first_bad_depth)+hash-divergence-HELD(first_bad_depth)+consent-DEFER+honest-free-CHILD_MAY_ACT|topology_before_hashes=BY-DESIGN|json=0
|
| 5 |
NNESTGATETABLE|actions_free=observe+report-up+draft-row|actions_consent=act-on-world+spawn-child+modify-self|consent_cap=DEFER_TO_OPERATOR-even-on-perfect-chain(consent-anchors-at-apex-T0-only)|membership=DRAFT_ASSUMPTION-bilateral-contest-welcome|json=0
|
| 6 |
NNESTGATEBOUND|max_depth=16|why=the-PROVEN-N-Nest-Prime-depth|beyond=CHILD_HELD-invalid-max-depth|json=0
|
| 7 |
NNESTGATELEAK_DOC|held_rows_carry=first_bad_depth+chain_sha16-only|chain_sha16=none-for-noncanonical-or-invalid-hash-chains|level_hashes=NEVER-echoed-into-rows|catch-at-exact-level=preserved(first_bad_depth-names-the-divergent-depth)|json=0
|
| 8 |
NNESTGATEHARDEN_DOC|acer-findings-2026-06-11=THREE-real-bypasses-of-liris-Object.keys-check|F1=accessor(getter)-tuple-split-check-from-use-TOCTOU-granted-CHILD_MAY_ACT-with-chain_sha16-ne-verified-content|F2=non-enumerable-own-field-smuggled-past-exact-shape|F3=symbol-keyed-field-smuggled|fix=single-read-frozen-snapshot+getOwnPropertyNames+getOwnPropertySymbols+data-descriptor-only|proxy-array=neutralized-by-single-index-read|parity_cases_added=19+20+21|json=0
|
|
|
|
| 9 |
NNESTGATESAFETY|mutates=0|pure_function=1|time_free_contract=1|no_spawn=1|no_recursion_into_real_agents=1|no_harness_edit=1|mints=0|launches=0|usb_writes=0|engine_edits=0|external_calls=0|json=0
|
| 10 |
NNESTGATEVERIFY|required=node-check+node-test+self-test+parity-byte-compare|parity_baseline=docs/NNEST-WATCHER-GATE-PARITY-BASELINE-2026-06-11.hbp|clock=none-time-free|json=0
|
| 11 |
-
NNESTGATESHA|gate_sha256=
|
| 12 |
-
NNESTGATEFTR|state=
|
|
|
|
| 1 |
+
NNESTGATEHDR|host=liris|component=architecture-component-4|tool=tools/behcs/nnest-watcher-gate.mjs|purpose=n-nest-watcher-gate-child-acts-only-if-reported-equals-recomputed-at-every-level|json=0
|
| 2 |
+
NNESTGATELAW|may_act_requires=BOTH(hash-match-every-level)AND(chain-complete-contiguous-unique-ordered-depth-0-to-max+exact-3-field-plain-DATA-tuples-single-read-snapshot+canonical-depths-no-negative-zero)|hashes=necessary-but-NOT-sufficient|topology_violations=CHILD_HELD-chain-topology-invalid-with-first_bad_depth(never-merely-malformed)|source=OP-JESSE-amendment-2026-06-11+liris-exact-tuple-patch+acer-tuple-shape-hardening+liris-proxy-depth-counterhardening|composes=TARGET-ARCHITECTURE-VISION-2026-06-10(COMPONENT-4)+N-Nest-Prime-proof(depth-16-2732-files-131071-nodes)+LAW-RECURRENCE-IS-MIND|json=0
|
| 3 |
NNESTGATESCOPE_DOC|repo_side_draft_only=1|never=process-spawn+recursion-into-real-agents+harness-edits|gate-emits-verdict-rows-it-never-acts|live_harness_embedding=SEPARATE-GATED-FOLLOW-UP-operator-signoff|json=0
|
| 4 |
NNESTGATELADDER|rungs=9|order=dirty-HELD+malformed-agent-HELD+unknown-action-HELD+invalid-max-depth-HELD+empty-chain-HELD+TOPOLOGY-HELD(first_bad_depth)+hash-format-HELD(first_bad_depth)+hash-divergence-HELD(first_bad_depth)+consent-DEFER+honest-free-CHILD_MAY_ACT|topology_before_hashes=BY-DESIGN|json=0
|
| 5 |
NNESTGATETABLE|actions_free=observe+report-up+draft-row|actions_consent=act-on-world+spawn-child+modify-self|consent_cap=DEFER_TO_OPERATOR-even-on-perfect-chain(consent-anchors-at-apex-T0-only)|membership=DRAFT_ASSUMPTION-bilateral-contest-welcome|json=0
|
| 6 |
NNESTGATEBOUND|max_depth=16|why=the-PROVEN-N-Nest-Prime-depth|beyond=CHILD_HELD-invalid-max-depth|json=0
|
| 7 |
NNESTGATELEAK_DOC|held_rows_carry=first_bad_depth+chain_sha16-only|chain_sha16=none-for-noncanonical-or-invalid-hash-chains|level_hashes=NEVER-echoed-into-rows|catch-at-exact-level=preserved(first_bad_depth-names-the-divergent-depth)|json=0
|
| 8 |
NNESTGATEHARDEN_DOC|acer-findings-2026-06-11=THREE-real-bypasses-of-liris-Object.keys-check|F1=accessor(getter)-tuple-split-check-from-use-TOCTOU-granted-CHILD_MAY_ACT-with-chain_sha16-ne-verified-content|F2=non-enumerable-own-field-smuggled-past-exact-shape|F3=symbol-keyed-field-smuggled|fix=single-read-frozen-snapshot+getOwnPropertyNames+getOwnPropertySymbols+data-descriptor-only|proxy-array=neutralized-by-single-index-read|parity_cases_added=19+20+21|json=0
|
| 9 |
+
NNESTGATECOUNTERHARDEN_DOC|liris-findings-2026-06-11=TWO-real-edges-after-acer-hardening|F1=revoked-proxy-chain-or-tuple-threw-TypeError-instead-of-CHILD_HELD-row|F2=negative-zero-depth-aliased-to-canonical-zero|fix=try-catch-materializeChain+descriptor-value-snapshot+isCanonicalDepth-rejects-negative-zero|parity_cases_added=22+23+24|json=0
|
| 10 |
NNESTGATESAFETY|mutates=0|pure_function=1|time_free_contract=1|no_spawn=1|no_recursion_into_real_agents=1|no_harness_edit=1|mints=0|launches=0|usb_writes=0|engine_edits=0|external_calls=0|json=0
|
| 11 |
NNESTGATEVERIFY|required=node-check+node-test+self-test+parity-byte-compare|parity_baseline=docs/NNEST-WATCHER-GATE-PARITY-BASELINE-2026-06-11.hbp|clock=none-time-free|json=0
|
| 12 |
+
NNESTGATESHA|gate_sha256=995BD8A457D7E22865F5FAC1F2E9516C52D014F34F5AF26D2DEDF40D3EFF6008|test_sha256=86838433939F5AA3EEEC81D42813D777846B3A015DE241FB3FC3CBFE4605C8D8|json=0
|
| 13 |
+
NNESTGATEFTR|state=COMPONENT_4_LIRIS_PROXY_DEPTH_COUNTERHARDENING_READY_FOR_ACER_READBACK|json=0
|
tools/behcs/nnest-watcher-gate.hbp.sha256
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
6D56116777EC0298D503D50FEDC8EA97D9B32438DD5A632B0147121DF7F5C756 nnest-watcher-gate.hbp
|
tools/behcs/nnest-watcher-gate.mjs
CHANGED
|
@@ -38,6 +38,10 @@ const HASH_RE = /^[0-9a-f]{16}$/;
|
|
| 38 |
const DIRTY_RE = /[|\r\n]/;
|
| 39 |
const TUPLE_KEYS = Object.freeze(['depth', 'reported_sha16', 'recomputed_sha16']);
|
| 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
function sha16(value) {
|
| 42 |
const text = typeof value === 'string' ? value : JSON.stringify(value);
|
| 43 |
return createHash('sha256').update(text).digest('hex').slice(0, 16);
|
|
@@ -62,20 +66,22 @@ function echoField(value, validator) {
|
|
| 62 |
// exact three-field plain data object. (acer hardening 2026-06-11: liris's
|
| 63 |
// Object.keys check missed accessors, non-enumerable, and symbol own fields.)
|
| 64 |
function snapshotTuple(raw) {
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
const
|
| 72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
}
|
| 74 |
-
return Object.freeze({
|
| 75 |
-
depth: raw.depth,
|
| 76 |
-
reported_sha16: raw.reported_sha16,
|
| 77 |
-
recomputed_sha16: raw.recomputed_sha16,
|
| 78 |
-
});
|
| 79 |
}
|
| 80 |
|
| 81 |
// The reported chain is materialized ONCE: each index is read a single time and
|
|
@@ -83,11 +89,17 @@ function snapshotTuple(raw) {
|
|
| 83 |
// the topology pass, the hash pass, and the digest. Everything downstream reads
|
| 84 |
// only this frozen snapshot, never the caller's original object.
|
| 85 |
function materializeChain(rawChain) {
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
}
|
| 92 |
|
| 93 |
// chain_sha16 is the only chain-derived value a row may carry: a digest of
|
|
@@ -99,7 +111,7 @@ function chainDigest(mat) {
|
|
| 99 |
if (mat.len === 0) return 'none';
|
| 100 |
for (const t of mat.snaps) {
|
| 101 |
if (!t
|
| 102 |
-
|| !
|
| 103 |
|| typeof t.reported_sha16 !== 'string'
|
| 104 |
|| typeof t.recomputed_sha16 !== 'string'
|
| 105 |
|| !HASH_RE.test(t.reported_sha16)
|
|
@@ -112,7 +124,7 @@ function buildResult(inp, verdict, gates, firstBadDepth, mat) {
|
|
| 112 |
const fields = {
|
| 113 |
agent: echoField(inp.agent, (v) => AGENT_ID_RE.test(v)),
|
| 114 |
action: echoField(inp.action, (v) => Object.hasOwn(ACTIONS, v)),
|
| 115 |
-
max_depth:
|
| 116 |
chain_len: mat.len,
|
| 117 |
chain_sha16: chainDigest(mat),
|
| 118 |
verdict,
|
|
@@ -153,12 +165,12 @@ export function gateChain(input) {
|
|
| 153 |
if (!Object.hasOwn(ACTIONS, inp.action ?? '')) return held('unknown-action');
|
| 154 |
|
| 155 |
// Rung 4: depth bound is the proven depth, never beyond.
|
| 156 |
-
if (!
|
| 157 |
return held('invalid-max-depth');
|
| 158 |
}
|
| 159 |
|
| 160 |
// Rung 5: a chain must exist.
|
| 161 |
-
if (!
|
| 162 |
|
| 163 |
// Rung 6: OPERATOR INVARIANT -- topology before hashes, read off the frozen
|
| 164 |
// snapshot. The chain must be complete, contiguous, unique, and ordered:
|
|
@@ -172,7 +184,7 @@ export function gateChain(input) {
|
|
| 172 |
}
|
| 173 |
for (let i = 0; i <= inp.max_depth; i += 1) {
|
| 174 |
const tuple = mat.snaps[i];
|
| 175 |
-
if (!tuple || tuple.depth !== i) {
|
| 176 |
return held('chain-topology-invalid', i);
|
| 177 |
}
|
| 178 |
if (!HASH_RE.test(tuple.reported_sha16 ?? '') || !HASH_RE.test(tuple.recomputed_sha16 ?? '')) {
|
|
@@ -201,13 +213,13 @@ export function gateChain(input) {
|
|
| 201 |
export function statusRows() {
|
| 202 |
const rows = [
|
| 203 |
`NNESTGATEHDR|ok=1|id=${GATE_ID}|component=4|max_depth_bound=${MAX_DEPTH_BOUND}|actions=${Object.keys(ACTIONS).length}|invariant=every-row-executable-0|state=DRAFT_CONTRACT_NO_SPAWN_NO_HARNESS_EDIT|json=0`,
|
| 204 |
-
'NNESTGATELAW|may_act_requires=hash-match-at-every-level-AND-chain-complete-contiguous-unique-ordered|hashes=necessary-but-not-sufficient|topology_violations=CHILD_HELD-chain-topology-invalid-with-first_bad_depth|source=OP-JESSE-amendment-2026-06-11|json=0',
|
| 205 |
'NNESTGATELADDER|rungs=9|order=dirty-HELD+malformed-agent-HELD+unknown-action-HELD+invalid-max-depth-HELD+empty-chain-HELD+topology-HELD(first_bad_depth)+hash-format-HELD(first_bad_depth)+hash-divergence-HELD(first_bad_depth)+consent-DEFER+honest-free-CHILD_MAY_ACT|json=0',
|
| 206 |
];
|
| 207 |
for (const [id, meta] of Object.entries(ACTIONS)) {
|
| 208 |
rows.push(`NNESTGATEACTION|id=${id}|consent=${meta.consent}|max_verdict=${meta.consent ? 'DEFER_TO_OPERATOR' : 'CHILD_MAY_ACT'}|json=0`);
|
| 209 |
}
|
| 210 |
-
rows.push('NNESTGATELEAK|held_rows_carry=first_bad_depth+chain_sha16-only|chain_sha16=none-for-noncanonical-or-invalid-hash-chains|level_hashes=NEVER-echoed|json=0');
|
| 211 |
rows.push('NNESTGATESAFETY|mutates=0|pure_function=1|no_spawn=1|no_recursion_into_real_agents=1|no_harness_edit=1|mints=0|launches=0|usb_writes=0|engine_edits=0|json=0');
|
| 212 |
rows.push('NNESTGATEEND|state=COMPONENT_4_SEED_DRAFT_CONTRACT|json=0');
|
| 213 |
return rows;
|
|
@@ -251,6 +263,11 @@ const PARITY_CASES = Object.freeze([
|
|
| 251 |
{ id: '19', input: { ...BASE, chain: (() => { const c = goodChain(3); c[1] = Object.defineProperty({ depth: 1, recomputed_sha16: level(1) }, 'reported_sha16', { enumerable: true, get() { return level(1); } }); return c; })() } },
|
| 252 |
{ id: '20', input: { ...BASE, chain: (() => { const c = goodChain(3); Object.defineProperty(c[2], 'hidden_own_field', { value: 'smuggled', enumerable: false }); return c; })() } },
|
| 253 |
{ id: '21', input: { ...BASE, chain: (() => { const c = goodChain(3); c[0] = { ...c[0] }; c[0][Symbol.for('nnest-smuggle')] = 'payload'; return c; })() } },
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 254 |
]);
|
| 255 |
|
| 256 |
export function emitParityRows() {
|
|
@@ -304,6 +321,20 @@ export function selfTest() {
|
|
| 304 |
const expected = sha16(JSON.stringify(c.map((t) => [t.depth, t.reported_sha16, t.recomputed_sha16])));
|
| 305 |
return o.verdict === 'CHILD_MAY_ACT' && o.chain_sha16 === expected;
|
| 306 |
})());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 307 |
|
| 308 |
return { ok: checks.every((check) => check.ok), checks };
|
| 309 |
}
|
|
|
|
| 38 |
const DIRTY_RE = /[|\r\n]/;
|
| 39 |
const TUPLE_KEYS = Object.freeze(['depth', 'reported_sha16', 'recomputed_sha16']);
|
| 40 |
|
| 41 |
+
function isCanonicalDepth(value) {
|
| 42 |
+
return Number.isInteger(value) && value >= 0 && value <= MAX_DEPTH_BOUND && !Object.is(value, -0);
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
function sha16(value) {
|
| 46 |
const text = typeof value === 'string' ? value : JSON.stringify(value);
|
| 47 |
return createHash('sha256').update(text).digest('hex').slice(0, 16);
|
|
|
|
| 66 |
// exact three-field plain data object. (acer hardening 2026-06-11: liris's
|
| 67 |
// Object.keys check missed accessors, non-enumerable, and symbol own fields.)
|
| 68 |
function snapshotTuple(raw) {
|
| 69 |
+
try {
|
| 70 |
+
if (!raw || typeof raw !== 'object' || Array.isArray(raw)) return null;
|
| 71 |
+
if (Object.getPrototypeOf(raw) !== Object.prototype) return null;
|
| 72 |
+
if (Object.getOwnPropertySymbols(raw).length !== 0) return null;
|
| 73 |
+
const names = Object.getOwnPropertyNames(raw);
|
| 74 |
+
if (names.length !== TUPLE_KEYS.length) return null;
|
| 75 |
+
const snap = Object.create(null);
|
| 76 |
+
for (const key of TUPLE_KEYS) {
|
| 77 |
+
const desc = Object.getOwnPropertyDescriptor(raw, key);
|
| 78 |
+
if (!desc || !Object.hasOwn(desc, 'value')) return null; // reject accessors
|
| 79 |
+
snap[key] = desc.value;
|
| 80 |
+
}
|
| 81 |
+
return Object.freeze(snap);
|
| 82 |
+
} catch {
|
| 83 |
+
return null;
|
| 84 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
}
|
| 86 |
|
| 87 |
// The reported chain is materialized ONCE: each index is read a single time and
|
|
|
|
| 89 |
// the topology pass, the hash pass, and the digest. Everything downstream reads
|
| 90 |
// only this frozen snapshot, never the caller's original object.
|
| 91 |
function materializeChain(rawChain) {
|
| 92 |
+
try {
|
| 93 |
+
if (!Array.isArray(rawChain)) return { isArray: false, len: 0, snaps: [] };
|
| 94 |
+
const len = rawChain.length;
|
| 95 |
+
if (!Number.isSafeInteger(len) || len < 0) return { isArray: false, len: 0, snaps: [] };
|
| 96 |
+
const snapLen = Math.min(len, MAX_DEPTH_BOUND + 2);
|
| 97 |
+
const snaps = new Array(snapLen);
|
| 98 |
+
for (let i = 0; i < snapLen; i += 1) snaps[i] = snapshotTuple(rawChain[i]);
|
| 99 |
+
return { isArray: true, len, snaps };
|
| 100 |
+
} catch {
|
| 101 |
+
return { isArray: false, len: 0, snaps: [] };
|
| 102 |
+
}
|
| 103 |
}
|
| 104 |
|
| 105 |
// chain_sha16 is the only chain-derived value a row may carry: a digest of
|
|
|
|
| 111 |
if (mat.len === 0) return 'none';
|
| 112 |
for (const t of mat.snaps) {
|
| 113 |
if (!t
|
| 114 |
+
|| !isCanonicalDepth(t.depth)
|
| 115 |
|| typeof t.reported_sha16 !== 'string'
|
| 116 |
|| typeof t.recomputed_sha16 !== 'string'
|
| 117 |
|| !HASH_RE.test(t.reported_sha16)
|
|
|
|
| 124 |
const fields = {
|
| 125 |
agent: echoField(inp.agent, (v) => AGENT_ID_RE.test(v)),
|
| 126 |
action: echoField(inp.action, (v) => Object.hasOwn(ACTIONS, v)),
|
| 127 |
+
max_depth: isCanonicalDepth(inp.max_depth) ? inp.max_depth : 'invalid',
|
| 128 |
chain_len: mat.len,
|
| 129 |
chain_sha16: chainDigest(mat),
|
| 130 |
verdict,
|
|
|
|
| 165 |
if (!Object.hasOwn(ACTIONS, inp.action ?? '')) return held('unknown-action');
|
| 166 |
|
| 167 |
// Rung 4: depth bound is the proven depth, never beyond.
|
| 168 |
+
if (!isCanonicalDepth(inp.max_depth)) {
|
| 169 |
return held('invalid-max-depth');
|
| 170 |
}
|
| 171 |
|
| 172 |
// Rung 5: a chain must exist.
|
| 173 |
+
if (!mat.isArray || mat.len === 0) return held('empty-or-missing-chain');
|
| 174 |
|
| 175 |
// Rung 6: OPERATOR INVARIANT -- topology before hashes, read off the frozen
|
| 176 |
// snapshot. The chain must be complete, contiguous, unique, and ordered:
|
|
|
|
| 184 |
}
|
| 185 |
for (let i = 0; i <= inp.max_depth; i += 1) {
|
| 186 |
const tuple = mat.snaps[i];
|
| 187 |
+
if (!tuple || !isCanonicalDepth(tuple.depth) || tuple.depth !== i) {
|
| 188 |
return held('chain-topology-invalid', i);
|
| 189 |
}
|
| 190 |
if (!HASH_RE.test(tuple.reported_sha16 ?? '') || !HASH_RE.test(tuple.recomputed_sha16 ?? '')) {
|
|
|
|
| 213 |
export function statusRows() {
|
| 214 |
const rows = [
|
| 215 |
`NNESTGATEHDR|ok=1|id=${GATE_ID}|component=4|max_depth_bound=${MAX_DEPTH_BOUND}|actions=${Object.keys(ACTIONS).length}|invariant=every-row-executable-0|state=DRAFT_CONTRACT_NO_SPAWN_NO_HARNESS_EDIT|json=0`,
|
| 216 |
+
'NNESTGATELAW|may_act_requires=hash-match-at-every-level-AND-chain-complete-contiguous-unique-ordered+exact-data-snapshots+canonical-depths(no-negative-zero)|hashes=necessary-but-not-sufficient|topology_violations=CHILD_HELD-chain-topology-invalid-with-first_bad_depth|source=OP-JESSE-amendment-2026-06-11|json=0',
|
| 217 |
'NNESTGATELADDER|rungs=9|order=dirty-HELD+malformed-agent-HELD+unknown-action-HELD+invalid-max-depth-HELD+empty-chain-HELD+topology-HELD(first_bad_depth)+hash-format-HELD(first_bad_depth)+hash-divergence-HELD(first_bad_depth)+consent-DEFER+honest-free-CHILD_MAY_ACT|json=0',
|
| 218 |
];
|
| 219 |
for (const [id, meta] of Object.entries(ACTIONS)) {
|
| 220 |
rows.push(`NNESTGATEACTION|id=${id}|consent=${meta.consent}|max_verdict=${meta.consent ? 'DEFER_TO_OPERATOR' : 'CHILD_MAY_ACT'}|json=0`);
|
| 221 |
}
|
| 222 |
+
rows.push('NNESTGATELEAK|held_rows_carry=first_bad_depth+chain_sha16-only|chain_sha16=none-for-noncanonical-or-invalid-hash-chains|level_hashes=NEVER-echoed|hostile-proxy=HELD-not-thrown|json=0');
|
| 223 |
rows.push('NNESTGATESAFETY|mutates=0|pure_function=1|no_spawn=1|no_recursion_into_real_agents=1|no_harness_edit=1|mints=0|launches=0|usb_writes=0|engine_edits=0|json=0');
|
| 224 |
rows.push('NNESTGATEEND|state=COMPONENT_4_SEED_DRAFT_CONTRACT|json=0');
|
| 225 |
return rows;
|
|
|
|
| 263 |
{ id: '19', input: { ...BASE, chain: (() => { const c = goodChain(3); c[1] = Object.defineProperty({ depth: 1, recomputed_sha16: level(1) }, 'reported_sha16', { enumerable: true, get() { return level(1); } }); return c; })() } },
|
| 264 |
{ id: '20', input: { ...BASE, chain: (() => { const c = goodChain(3); Object.defineProperty(c[2], 'hidden_own_field', { value: 'smuggled', enumerable: false }); return c; })() } },
|
| 265 |
{ id: '21', input: { ...BASE, chain: (() => { const c = goodChain(3); c[0] = { ...c[0] }; c[0][Symbol.for('nnest-smuggle')] = 'payload'; return c; })() } },
|
| 266 |
+
// 22-24 (liris counter-hardening 2026-06-11): revoked proxies must become
|
| 267 |
+
// HELD rows instead of thrown exceptions, and -0 is not canonical depth 0.
|
| 268 |
+
{ id: '22', input: { ...BASE, chain: (() => { const c = goodChain(3); const r = Proxy.revocable(c[1], {}); r.revoke(); c[1] = r.proxy; return c; })() } },
|
| 269 |
+
{ id: '23', input: { ...BASE, max_depth: -0, chain: goodChain(0) } },
|
| 270 |
+
{ id: '24', input: { ...BASE, chain: (() => { const c = goodChain(3); c[0] = { ...c[0], depth: -0 }; return c; })() } },
|
| 271 |
]);
|
| 272 |
|
| 273 |
export function emitParityRows() {
|
|
|
|
| 321 |
const expected = sha16(JSON.stringify(c.map((t) => [t.depth, t.reported_sha16, t.recomputed_sha16])));
|
| 322 |
return o.verdict === 'CHILD_MAY_ACT' && o.chain_sha16 === expected;
|
| 323 |
})());
|
| 324 |
+
add('revoked-proxy-held-not-thrown', (() => {
|
| 325 |
+
const c = goodChain(3);
|
| 326 |
+
const r = Proxy.revocable(c[1], {});
|
| 327 |
+
r.revoke();
|
| 328 |
+
c[1] = r.proxy;
|
| 329 |
+
const o = gateChain({ ...BASE, chain: c });
|
| 330 |
+
return o.verdict === 'CHILD_HELD' && o.gate === 'chain-topology-invalid' && o.chain_sha16 === 'none';
|
| 331 |
+
})());
|
| 332 |
+
add('negative-zero-depth-held', (() => {
|
| 333 |
+
const c = goodChain(3);
|
| 334 |
+
c[0] = { ...c[0], depth: -0 };
|
| 335 |
+
const o = gateChain({ ...BASE, chain: c });
|
| 336 |
+
return o.verdict === 'CHILD_HELD' && o.gate === 'chain-topology-invalid' && o.chain_sha16 === 'none';
|
| 337 |
+
})());
|
| 338 |
|
| 339 |
return { ok: checks.every((check) => check.ok), checks };
|
| 340 |
}
|
tools/behcs/nnest-watcher-gate.mjs.sha256
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
995BD8A457D7E22865F5FAC1F2E9516C52D014F34F5AF26D2DEDF40D3EFF6008 nnest-watcher-gate.mjs
|