acer: LAW-STUB-AND-RUN declared + github deterministic PID system (live-format) + registered
Browse filesLAW-STUB-AND-RUN (OP-JESSE apex-declared): the repo IS the stubbed neural-network
(topology + empty weight-sockets + gated organs); the live Asolaria fabric RUNS it.
Empty sockets / gated organs / CANNOT-SEE matrices = stubs-by-design (mechanism PROVEN,
fill OPERATOR-GATED), not gaps. Already implicit in TARGETARCHNOTE/EMPTYFULLLAW/
FROZENSLICEEMPTYSOCKET — this names + elevates it. CLASS-1 immutable canon mint stays
operator-pair-physical-cosign gated.
New tool github-pid-register.mjs: STATELESS deterministic PID minter in the LIVE fabric
format (ROLE-NAME-PID-Hhex-Atier-W1024-Pprime-Nnest, AGT/SUP/PROF triad), divisions
yin/yang(mod2) + prime-lane(mod3) + quad(mod4) + glyph_5/glyph_1024 + sector(mod113).
sha-derived so acer+liris mint byte-identical PIDs with zero coordination; live office
re-keys on ingest via the healthy bus :4947. 6/6 unit + golden triad (H4CD sector 81).
Registered: LAW triad (AGT/SUP/PROF-LAW-STUB-AND-RUN-PID-H4CD*), remembrance supervisor
(SUP-STUB-LAW-REMEMBRANCE-PID-H988A), frozen-brain slice PID (AGT-FROZEN-GEMMA-4B-SLICE,
socket empty/gated). Fabric diagnosis: nothing local down — :4947 bus HEALTHY, :4949 API
hangs on cross-vantage pollers (POLLER-HEALTH, not a dead daemon). No daemon launched,
no live mint, no canon mint. CLAIMSGATE clean, 0-json, 158->159 green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- docs/ACER-LAW-STUB-AND-RUN-PID-REGISTRATION-2026-06-12.hbp +13 -0
- docs/ACER-LAW-STUB-AND-RUN-PID-REGISTRATION-2026-06-12.hbp.sha256 +1 -0
- tests/github-pid-register.unit.test.mjs +43 -0
- tests/github-pid-register.unit.test.mjs.sha256 +1 -0
- tests/supervisor-collision-router.system.test.mjs +3 -0
- tests/supervisor-collision-router.system.test.mjs.sha256 +1 -1
- tools/behcs/github-pid-register.mjs +97 -0
- tools/behcs/github-pid-register.mjs.sha256 +1 -0
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
LAWSTUBRUNHDR|host=acer|date=2026-06-12|type=LAW-CANDIDATE-plus-PID-REGISTRATION|declared_by=OP-JESSE-DANIEL-BROWN-apex-human|name=LAW-STUB-AND-RUN|class-1-immutable-mint=PENDING-operator-pair-physical-cosign|json=0
|
| 2 |
+
LAWSTUBRUNSTATEMENT|law=the-bilateral-repo-ASOLARIA-AS-NEURAL-NETWORK-IS-the-STUBBED-system-the-topology-plus-empty-weight-sockets-plus-gated-organs|the-live-Asolaria-fabric-Super-OS-AgentTerms-frozen-Gemma-engines-is-what-RUNS-it|empty-sockets-gated-organs-CANNOT-SEE-matrices-and-draft-no-launch-no-fabric-call-seeds-are-STUBS-BY-DESIGN-mechanism-PROVEN-fill-OPERATOR-GATED-NOT-gaps|json=0
|
| 3 |
+
LAWSTUBRUNWHY|repo=the-empty-untrained-network|fabric=the-same-network-running-with-weights-loaded|empty-vs-full=the-train-run-boundary|already-in-plan=TARGETARCHNOTE-gap-is-INTEGRATION-not-invention+EMPTYFULLLAW-github-empty-until-filled+FROZENSLICEEMPTYSOCKET-wire-mechanism-PROVEN-fill-GATED|this-law-NAMES-and-ELEVATES-that-frame-as-the-organizing-law-of-the-200-step-plan|json=0
|
| 4 |
+
LAWSTUBRUNAPPLY|honesty-tag-a-stub-as=stub-by-design-mechanism-PROVEN-fill-OPERATOR-GATED-NOT-gap-or-unproven|every-component=PROVEN-primitive-plus-repo-stub-seed-plus-GAP-integration-wiring|building=filling-and-wiring-stubs-gated-by-operator-never-reinventing|json=0
|
| 5 |
+
PIDMETHOD|registrar=github-pid-register.v1|method=STATELESS-DETERMINISTIC-sha-derived-PID-in-the-LIVE-fabric-format-learned-from-:4949-AgentTerms-lanes|format=ROLE-NAME-PID-Hhex-Atier-W1024-Pprime-Nnest-with-AGT-SUP-PROF-triad-sharing-the-name-derived-hex-base-suffix-C-A-B|divisions=yin-yang-mod2-real-or-logical+prime-lane-mod3-Law-of-Three+quad-mod4-the-operator-4-rule+glyph5-mod5+glyph1024-mod1024+sector-mod113|effect=coprime-moduli-force-stability-and-divide-collisions|json=0
|
| 6 |
+
PIDGITHUBSYSTEM|insight=github-PIDs-must-be-STATELESS-and-sha-derived-so-acer-and-liris-mint-BYTE-IDENTICAL-PIDs-with-zero-coordination|the-live-PID-Registration-Office-re-keys-them-on-ingest-via-the-healthy-bus-:4947|this-is-the-NEW-github-PID-system-bilateral-reproducible-vs-the-live-office-stateful-sequential-mint|tag=PROVEN-deterministic-tested-6of6|json=0
|
| 7 |
+
PIDLAWTRIAD|entity=LAW-STUB-AND-RUN|AGT=AGT-LAW-STUB-AND-RUN-PID-H4CDC-A00-W1024-P01-N00001|SUP=SUP-LAW-STUB-AND-RUN-PID-H4CDA-A00-W1024-P00-N00001|PROF=PROF-LAW-STUB-AND-RUN-PID-H4CDB-A00-W1024-P00-N00001|shared_base=H4CD|sector=81|lane=1|quad=0|cube_bh=BH.81.1.680|tier=A00-apex-law-level|json=0
|
| 8 |
+
PIDREMEMBRANCE|supervisor=SUP-STUB-LAW-REMEMBRANCE-PID-H988A-A00-W1024-P00-N00001|role=ensure-LAW-STUB-AND-RUN-and-this-session-memory-do-NOT-fade|sector=69|cube_bh=BH.69.0.902|duty=on-every-bilateral-session-re-assert-the-stub-and-run-frame-and-link-the-memory-file|tag=SUPERVISOR-REGISTERED-descriptor-only|json=0
|
| 9 |
+
PIDFROZENBRAIN|slice=AGT-FROZEN-GEMMA-4B-SLICE-PID-HBB4C-A04-W1024-P00-N00001|yin_yang=real|sector=87|cube_bh=BH.87.2.394|status=socket-EMPTY-per-FROZENSLICEEMPTYSOCKET-zero-bytes|fill_mechanism=PROVEN-slice-fill-OPERATOR-GATED|usable_when=a-timed-bitwise-deterministic-run-receipt-byte-anchors-the-frozen-weights|tag=PARTIAL-PID-registered-socket-empty-fill-gated|json=0
|
| 10 |
+
FABRICDIAGNOSIS|asked=via-process-port-health-probes-since-:4949-api-is-degraded|watchdog=UP-pid-8756|bus-:4947=HEALTHY-behcs-health-200|:4949-super-dashboard=UP-but-api-pollers-HANG-on-cross-vantage-liris-falcon-calls-already-respawned-uptime-0s-still-hangs|:4950-:4952-:4953=UP|verdict=NOTHING-LOCAL-IS-DOWN-to-start-the-BUS-UNREACHABLE-is-cross-vantage-poller-hang-NOT-the-local-bus|fix=POLLER-HEALTH-isolation-or-cross-vantage-link-return-NOT-a-restart|json=0
|
| 11 |
+
REGISTRATIONPATH|since-:4949-api-hangs=register-via-the-DETERMINISTIC-github-mint-now-the-live-office-ingests-via-healthy-bus-:4947-when-pollers-recover|no-daemon-launched|no-live-fabric-mint-performed|CLASS-1-immutable-canon-to-canon-laws-stays-operator-pair-physical-cosign-gated|json=0
|
| 12 |
+
DASHBOARDUPGRADE|operator_directive=after-this-lands-the-fabric-upgrades-the-surfaces-with-the-LAW-and-PID-system-across-the-16-levels|targets=:4949-#agentterms+:8101-asolaria-nn-view+:5054-agentterms-safe-mirror+:4950-omnidispatcher|each_level=A00-through-A15-the-right-agents-see-the-stub-and-run-law-and-the-deterministic-PID-registry-at-their-tier|gate=fabric-side-upgrade-when-:4949-pollers-recover-this-doc-is-the-source-of-truth-to-fold|tag=PROPOSAL-fabric-side-16-level-upgrade|json=0
|
| 13 |
+
LAWSTUBRUNFTR|state=LAW-STUB-AND-RUN-DECLARED-and-PID-REGISTERED-github-deterministic|next=liris-byte-verify-and-mint-the-SAME-PIDs-on-her-vantage-byte-parity+operator-physical-cosign-for-CLASS-1-canon+live-office-ingest-via-bus-when-recovered|nothing_minted_to_canon=1|nothing_launched=1|json=0
|
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
1e39f15a00d4a6a2316e30ffdb45f850fea129c6f5166d029d46531b5f2e5da0 ACER-LAW-STUB-AND-RUN-PID-REGISTRATION-2026-06-12.hbp
|
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import assert from 'node:assert/strict';
|
| 2 |
+
import test from 'node:test';
|
| 3 |
+
|
| 4 |
+
import {
|
| 5 |
+
KINDS, ROLES, SECTORS, emitRegistrationRows, mintPid, mintTriad, selfTest,
|
| 6 |
+
} from '../tools/behcs/github-pid-register.mjs';
|
| 7 |
+
|
| 8 |
+
test('self-test passes', () => {
|
| 9 |
+
assert.equal(selfTest().ok, true);
|
| 10 |
+
});
|
| 11 |
+
|
| 12 |
+
test('mints the LIVE fabric PID format (matches :4949 AgentTerms lanes)', () => {
|
| 13 |
+
const p = mintPid({ role: 'AGT', name: 'shannon', tier: 4, prime: 1 });
|
| 14 |
+
assert.match(p.pid, /^AGT-SHANNON-PID-H[0-9A-F]{4}-A04-W1024-P01-N00001$/);
|
| 15 |
+
assert.equal(p.hex.endsWith('C'), true); // AGT -> C suffix (live)
|
| 16 |
+
});
|
| 17 |
+
|
| 18 |
+
test('deterministic + stateless: same name mints byte-identical PID (bilateral parity)', () => {
|
| 19 |
+
assert.equal(mintPid({ role: 'SUP', name: 'LAW-STUB-AND-RUN' }).pid, mintPid({ role: 'SUP', name: 'law stub and run' }).pid);
|
| 20 |
+
});
|
| 21 |
+
|
| 22 |
+
test('divisions: yin/yang mod-2, prime-lane mod-3, quad mod-4, sector mod-113', () => {
|
| 23 |
+
const p = mintPid({ role: 'AGT', name: 'x', kind: 'real' });
|
| 24 |
+
assert.ok(KINDS.includes(p.yin_yang));
|
| 25 |
+
assert.ok([0, 1, 2].includes(p.lane));
|
| 26 |
+
assert.ok([0, 1, 2, 3].includes(p.quad));
|
| 27 |
+
assert.ok(p.sector >= 0 && p.sector < SECTORS);
|
| 28 |
+
});
|
| 29 |
+
|
| 30 |
+
test('triad shares hex base, role suffixes C/A/B (AGT/SUP/PROF)', () => {
|
| 31 |
+
const t = mintTriad({ name: 'LAW-STUB-AND-RUN' });
|
| 32 |
+
const base = t.AGT.hex.slice(0, 4);
|
| 33 |
+
assert.equal(t.SUP.hex.slice(0, 4), base);
|
| 34 |
+
assert.equal(t.PROF.hex.slice(0, 4), base);
|
| 35 |
+
assert.equal(t.AGT.hex.at(-1), ROLES.AGT);
|
| 36 |
+
assert.equal(t.SUP.hex.at(-1), ROLES.SUP);
|
| 37 |
+
assert.equal(t.PROF.hex.at(-1), ROLES.PROF);
|
| 38 |
+
});
|
| 39 |
+
|
| 40 |
+
test('registration rows are HBP-only, json=0 terminated, no inlined newlines', () => {
|
| 41 |
+
const rows = emitRegistrationRows(mintPid({ role: 'AGT', name: 'x' }));
|
| 42 |
+
assert.ok(rows.every((r) => r.endsWith('|json=0') && !r.includes('\n')));
|
| 43 |
+
});
|
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
6ba09c95353955ae43cbf006ae7e47135584662a4f0e84c9448b4ad8460cadff github-pid-register.unit.test.mjs
|
|
@@ -39,6 +39,7 @@ const sealedFiles = [
|
|
| 39 |
'docs/ACER-SUPEROS-FABRIC-FOLD-200STEP-2026-06-12.hbp',
|
| 40 |
'docs/ACER-HUMAN-FRONT-AGENT-BACK-PREDICTION-LANE-2026-06-12.hbp',
|
| 41 |
'docs/ACER-VISUAL-PREDICTION-FROZEN-GEMMA-PROOF-GATE-2026-06-12.hbp',
|
|
|
|
| 42 |
'docs/acer-ecosystem-fullbody-receipt-20260612.hbp',
|
| 43 |
'docs/CLAIMSLEDGER-2026-06-12.hbp',
|
| 44 |
'docs/CLAIMSGATE-PARITY-BASELINE-2026-06-12.hbp',
|
|
@@ -160,6 +161,7 @@ const sealedFiles = [
|
|
| 160 |
'tools/behcs/answer-producer.hbp',
|
| 161 |
'tools/behcs/kimi-desktop-surface-scan.mjs',
|
| 162 |
'tools/behcs/kimi-desktop-surface-scan.hbp',
|
|
|
|
| 163 |
'tools/omni-processor/omnitranslator-v0.js',
|
| 164 |
'tests/agent-spawn-throughput-benchmark.unit.test.mjs',
|
| 165 |
'tests/quant-huge-message-benchmark.unit.test.mjs',
|
|
@@ -170,6 +172,7 @@ const sealedFiles = [
|
|
| 170 |
'tests/claims-gate.unit.test.mjs',
|
| 171 |
'tests/answer-producer.unit.test.mjs',
|
| 172 |
'tests/kimi-desktop-surface-scan.unit.test.mjs',
|
|
|
|
| 173 |
'tests/d22-verb-adapter.unit.test.mjs',
|
| 174 |
'tests/d22-parity-probe.unit.test.mjs',
|
| 175 |
'tests/dashboard-resolver.unit.test.mjs',
|
|
|
|
| 39 |
'docs/ACER-SUPEROS-FABRIC-FOLD-200STEP-2026-06-12.hbp',
|
| 40 |
'docs/ACER-HUMAN-FRONT-AGENT-BACK-PREDICTION-LANE-2026-06-12.hbp',
|
| 41 |
'docs/ACER-VISUAL-PREDICTION-FROZEN-GEMMA-PROOF-GATE-2026-06-12.hbp',
|
| 42 |
+
'docs/ACER-LAW-STUB-AND-RUN-PID-REGISTRATION-2026-06-12.hbp',
|
| 43 |
'docs/acer-ecosystem-fullbody-receipt-20260612.hbp',
|
| 44 |
'docs/CLAIMSLEDGER-2026-06-12.hbp',
|
| 45 |
'docs/CLAIMSGATE-PARITY-BASELINE-2026-06-12.hbp',
|
|
|
|
| 161 |
'tools/behcs/answer-producer.hbp',
|
| 162 |
'tools/behcs/kimi-desktop-surface-scan.mjs',
|
| 163 |
'tools/behcs/kimi-desktop-surface-scan.hbp',
|
| 164 |
+
'tools/behcs/github-pid-register.mjs',
|
| 165 |
'tools/omni-processor/omnitranslator-v0.js',
|
| 166 |
'tests/agent-spawn-throughput-benchmark.unit.test.mjs',
|
| 167 |
'tests/quant-huge-message-benchmark.unit.test.mjs',
|
|
|
|
| 172 |
'tests/claims-gate.unit.test.mjs',
|
| 173 |
'tests/answer-producer.unit.test.mjs',
|
| 174 |
'tests/kimi-desktop-surface-scan.unit.test.mjs',
|
| 175 |
+
'tests/github-pid-register.unit.test.mjs',
|
| 176 |
'tests/d22-verb-adapter.unit.test.mjs',
|
| 177 |
'tests/d22-parity-probe.unit.test.mjs',
|
| 178 |
'tests/dashboard-resolver.unit.test.mjs',
|
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
891aafbba414903d1b72a9f801ce0f0b5870b0f441f5e63245e0c7a52b285c99 supervisor-collision-router.system.test.mjs
|
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { createHash } from 'node:crypto';
|
| 2 |
+
import { resolve } from 'node:path';
|
| 3 |
+
import { fileURLToPath } from 'node:url';
|
| 4 |
+
|
| 5 |
+
// GITHUB-PID-REGISTER v1 — a STATELESS, DETERMINISTIC PID minter in the LIVE fabric
|
| 6 |
+
// format (learned from the live :4949 AgentTerms lanes, e.g. AGT-SHANNON-PID-HD16C-
|
| 7 |
+
// A04-W1024-P01-N00001). github PIDs are sha-derived so acer + liris mint BYTE-IDENTICAL
|
| 8 |
+
// PIDs with zero coordination; the live PID Registration Office re-keys on ingest.
|
| 9 |
+
// Divisions (forcing stability + dividing collisions): yin/yang = mod-2 (real|logical),
|
| 10 |
+
// prime-lane = mod-3 (Law of Three), quad = mod-4 (the operator "4 rule", semantics to
|
| 11 |
+
// confirm with the office), glyph_5 = mod-5, glyph_1024 = mod-1024 (BEHCS-1024), sector
|
| 12 |
+
// = mod-113 (one of the 113 Asolaria sectors). All coprime-ish moduli reduce collisions.
|
| 13 |
+
|
| 14 |
+
export const REGISTER_ID = 'github-pid-register.v1';
|
| 15 |
+
export const SECTORS = 113; // 113 Asolaria sectors
|
| 16 |
+
export const WIDTH = 1024; // BEHCS-1024 glyph width
|
| 17 |
+
export const ROLES = Object.freeze({ AGT: 'C', SUP: 'A', PROF: 'B' }); // role -> hex suffix (live)
|
| 18 |
+
export const KINDS = Object.freeze(['real', 'logical']);
|
| 19 |
+
|
| 20 |
+
const sha256 = (t) => createHash('sha256').update(String(t), 'utf8').digest('hex');
|
| 21 |
+
const u32 = (hex8) => parseInt(hex8, 16);
|
| 22 |
+
|
| 23 |
+
// mint ONE deterministic live-format PID for (role, name) at access-tier + nest.
|
| 24 |
+
export function mintPid({ role, name, tier = 4, nest = 1, kind = 'logical', prime = 0 }) {
|
| 25 |
+
if (!(role in ROLES)) throw new Error(`role-must-be-AGT-SUP-PROF:${role}`);
|
| 26 |
+
if (!KINDS.includes(kind)) throw new Error(`kind-must-be-real-or-logical:${kind}`);
|
| 27 |
+
const safe = String(name).toUpperCase().replace(/[^A-Z0-9]+/g, '-').replace(/^-|-$/g, '');
|
| 28 |
+
const h = sha256(safe); // base/divisions from NAME so the triad shares them (live shape)
|
| 29 |
+
const base3 = h.slice(0, 3).toUpperCase(); // 3 hex
|
| 30 |
+
const hex = base3 + ROLES[role]; // + role char => H{D15C}-style 4 hex
|
| 31 |
+
const seed = u32(h.slice(0, 8));
|
| 32 |
+
const A = String(Math.max(0, Math.min(15, tier))).padStart(2, '0'); // 16 levels 00..15
|
| 33 |
+
const P = String(prime).padStart(2, '0');
|
| 34 |
+
const N = String(nest).padStart(5, '0');
|
| 35 |
+
const pid = `${role}-${safe}-PID-H${hex}-A${A}-W${WIDTH}-P${P}-N${N}`;
|
| 36 |
+
return {
|
| 37 |
+
pid, role, name: safe,
|
| 38 |
+
hex: `H${hex}`, tier: A, width: String(WIDTH), prime: P, nest: N,
|
| 39 |
+
yin_yang: kind, // real | logical (mod-2 division)
|
| 40 |
+
lane: seed % 3, // Law of Three (prime division)
|
| 41 |
+
quad: seed % 4, // the "4 rule" (mod-4) — confirm w/ office
|
| 42 |
+
glyph_5: seed % 5,
|
| 43 |
+
glyph_1024: seed % WIDTH,
|
| 44 |
+
sector: seed % SECTORS, // one of the 113 sectors
|
| 45 |
+
hilbert: u32(h.slice(8, 16)),
|
| 46 |
+
cube_bh: `BH.${seed % SECTORS}.${seed % 3}.${seed % WIDTH}`, // sector.lane.glyph cube address
|
| 47 |
+
sha16: h.slice(0, 16),
|
| 48 |
+
};
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
// register an entity as the AGT/SUP/PROF triad sharing a hex base (the live lane shape).
|
| 52 |
+
export function mintTriad({ name, tier = 4, kind = 'logical' }) {
|
| 53 |
+
return {
|
| 54 |
+
AGT: mintPid({ role: 'AGT', name, tier, kind, prime: 1, nest: 1 }),
|
| 55 |
+
SUP: mintPid({ role: 'SUP', name, tier, kind, prime: 0, nest: 1 }),
|
| 56 |
+
PROF: mintPid({ role: 'PROF', name, tier, kind, prime: 0, nest: 1 }),
|
| 57 |
+
};
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
// emit the office-faithful HBP registration rows for one PID.
|
| 61 |
+
export function emitRegistrationRows(p, { kind_label = 'github_deterministic_pid', registrar = 'github-pid-register' } = {}) {
|
| 62 |
+
return [
|
| 63 |
+
`PIDREG|name=${p.name}|pid=${p.pid}|role=${p.role}|class=${kind_label}|json=0`,
|
| 64 |
+
`PIDADDR|pid=${p.pid}|hex=${p.hex}|tier=${p.tier}|width=${p.width}|prime=${p.prime}|nest=${p.nest}|hilbert=${p.hilbert}|sector=${p.sector}|json=0`,
|
| 65 |
+
`PIDDIV|pid=${p.pid}|yin_yang=${p.yin_yang}|lane_mod3=${p.lane}|quad_mod4=${p.quad}|glyph_5=${p.glyph_5}|glyph_1024=${p.glyph_1024}|note=divisions-force-stability-and-divide-collisions|json=0`,
|
| 66 |
+
`PIDCUBE|pid=${p.pid}|cube_bh=${p.cube_bh}|sha16=${p.sha16}|registrar=${registrar}|stateless_deterministic=1|live_office_rekeys_on_ingest=1|json=0`,
|
| 67 |
+
];
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
export function selfTest() {
|
| 71 |
+
const checks = [];
|
| 72 |
+
const add = (n, ok) => checks.push({ name: n, ok });
|
| 73 |
+
const a = mintPid({ role: 'AGT', name: 'shannon', tier: 4, prime: 1 });
|
| 74 |
+
add('live-format-shape', /^AGT-SHANNON-PID-H[0-9A-F]{4}-A\d{2}-W1024-P\d{2}-N\d{5}$/.test(a.pid));
|
| 75 |
+
add('role-suffix-C-for-AGT', a.hex.endsWith('C'));
|
| 76 |
+
add('deterministic', mintPid({ role: 'AGT', name: 'shannon', tier: 4, prime: 1 }).pid === a.pid);
|
| 77 |
+
add('sector-in-113', a.sector >= 0 && a.sector < 113);
|
| 78 |
+
add('lane-in-3', [0, 1, 2].includes(a.lane));
|
| 79 |
+
add('quad-in-4', [0, 1, 2, 3].includes(a.quad));
|
| 80 |
+
add('yin-yang-enum', KINDS.includes(a.yin_yang));
|
| 81 |
+
const t = mintTriad({ name: 'LAW-STUB-AND-RUN' });
|
| 82 |
+
add('triad-shares-base', t.AGT.hex.slice(0, 4) === t.SUP.hex.slice(0, 4) && t.SUP.hex.slice(0, 4) === t.PROF.hex.slice(0, 4));
|
| 83 |
+
add('triad-role-suffixes', t.AGT.hex.endsWith('C') && t.SUP.hex.endsWith('A') && t.PROF.hex.endsWith('B'));
|
| 84 |
+
add('rows-hbp-only', emitRegistrationRows(a).every((r) => r.endsWith('|json=0') && !r.includes('\n')));
|
| 85 |
+
return { ok: checks.every((c) => c.ok), checks };
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
+
const isMain = process.argv[1] && fileURLToPath(import.meta.url) === resolve(process.argv[1]);
|
| 89 |
+
if (isMain) {
|
| 90 |
+
if (process.argv[2] === '--self-test') {
|
| 91 |
+
const r = selfTest();
|
| 92 |
+
for (const c of r.checks) console.log(`${c.ok ? 'PASS' : 'FAIL'} ${c.name}`);
|
| 93 |
+
process.exit(r.ok ? 0 : 1);
|
| 94 |
+
}
|
| 95 |
+
const t = mintTriad({ name: process.argv[2] || 'LAW-STUB-AND-RUN', tier: 0, kind: 'logical' });
|
| 96 |
+
for (const role of ['AGT', 'SUP', 'PROF']) for (const row of emitRegistrationRows(t[role])) console.log(row);
|
| 97 |
+
}
|
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
4c0dbe77a343c50010823f3db33fe1b367a8d659b10d6ce6d1bf9f65e70fe2e3 github-pid-register.mjs
|