githolon 0.98.3 → 0.100.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +179 -148
- package/package.json +3 -3
package/dist/cli.mjs
CHANGED
|
@@ -2819,10 +2819,12 @@ async function fetchJsonCached(url, cacheFile) {
|
|
|
2819
2819
|
throw e;
|
|
2820
2820
|
}
|
|
2821
2821
|
}
|
|
2822
|
-
async function fetchRuntime(cloud) {
|
|
2822
|
+
async function fetchRuntime(cloud, kind = "production") {
|
|
2823
2823
|
const cache = join2(configDir(), "runtime");
|
|
2824
2824
|
let wasmBytes;
|
|
2825
|
-
const
|
|
2825
|
+
const wasmName = kind === "test-mint" ? "holon-testmint.wasm" : "holon.wasm";
|
|
2826
|
+
const wasmUrl = kind === "test-mint" ? "holon-testmint.wasm" : "holon.wasm";
|
|
2827
|
+
const wasmCache = join2(cache, wasmName);
|
|
2826
2828
|
const localWasm = process.env["NOMOS_LOCAL_WASM"];
|
|
2827
2829
|
if (localWasm) {
|
|
2828
2830
|
const bytes = readFileSync(localWasm);
|
|
@@ -2830,7 +2832,7 @@ async function fetchRuntime(cloud) {
|
|
|
2830
2832
|
return { wasmBytes: bytes, packages: packages2 };
|
|
2831
2833
|
}
|
|
2832
2834
|
try {
|
|
2833
|
-
const r = await fetch(`${cloud}/v1/runtime
|
|
2835
|
+
const r = await fetch(`${cloud}/v1/runtime/${wasmUrl}`);
|
|
2834
2836
|
if (!r.ok) throw new Error(`runtime wasm \u2192 ${r.status}`);
|
|
2835
2837
|
wasmBytes = new Uint8Array(await r.arrayBuffer());
|
|
2836
2838
|
mkdirSync2(cache, { recursive: true });
|
|
@@ -2896,8 +2898,8 @@ function readTreeFromDisk(diskPath) {
|
|
|
2896
2898
|
}
|
|
2897
2899
|
return new Directory2(contents);
|
|
2898
2900
|
}
|
|
2899
|
-
async function holonEngine(cloud, overlay, installedBy) {
|
|
2900
|
-
const runtime = await fetchRuntime(cloud);
|
|
2901
|
+
async function holonEngine(cloud, overlay, installedBy, runtimeKind = "production") {
|
|
2902
|
+
const runtime = await fetchRuntime(cloud, runtimeKind);
|
|
2901
2903
|
const replica = BigInt(`0x${randomBytes(8).toString("hex")}`) & (1n << 63n) - 1n;
|
|
2902
2904
|
const eng = await createEngine({
|
|
2903
2905
|
wasmModule: await WebAssembly.compile(runtime.wasmBytes),
|
|
@@ -5844,7 +5846,7 @@ async function runOfflineLegs(eng, ws, lawHash, legs, frameworkHash, deployUsda)
|
|
|
5844
5846
|
if (i > 0 && deployUsda !== void 0) {
|
|
5845
5847
|
cbWs = await mountIsolatedProofWs(eng, ws, lawHash, deployUsda);
|
|
5846
5848
|
}
|
|
5847
|
-
const v = runChildBirthLeg(eng, cbWs, lawHash, birthLeg, frameworkHash);
|
|
5849
|
+
const v = await runChildBirthLeg(eng, cbWs, lawHash, birthLeg, frameworkHash);
|
|
5848
5850
|
lines.push(...v.legs);
|
|
5849
5851
|
if (!v.ok) return done(false, lines, v.error);
|
|
5850
5852
|
}
|
|
@@ -5872,25 +5874,72 @@ function warrantParentForBirth(eng, parentWs, parentDomain, lawHash, genesisOwne
|
|
|
5872
5874
|
return { ok: false, error: `no directive registered for '${directiveId}' under '${parentDomain}' or 'nomos'` };
|
|
5873
5875
|
};
|
|
5874
5876
|
for (const principal of birthActor === genesisOwner ? [genesisOwner] : [genesisOwner, birthActor]) {
|
|
5875
|
-
const en = authorFrameworkAs("enrollSigner", {
|
|
5877
|
+
const en = authorFrameworkAs("enrollSigner", {
|
|
5878
|
+
keyHash: keyHashOf(dev2.public),
|
|
5879
|
+
grantedBy: principal,
|
|
5880
|
+
grantedAt: 1,
|
|
5881
|
+
// The offline harness runs the explicit test-mint kernel. Give its synthetic founder the same
|
|
5882
|
+
// on-chain provenance a real login's IdP-backed enrollment carries, so a child law that correctly
|
|
5883
|
+
// requires a VERIFIED parent attestation can be proven without weakening that production rule.
|
|
5884
|
+
verifiedVia: OFFLINE_PROOF_VERIFIER
|
|
5885
|
+
}, principal);
|
|
5876
5886
|
if (en.ok === false && !/already|create-once|enrolled/i.test(en.error ?? "")) return { ok: false, error: `enrollSigner(${principal}) refused: ${en.error}` };
|
|
5877
5887
|
}
|
|
5878
|
-
const
|
|
5888
|
+
const root = authorKeygen(eng);
|
|
5889
|
+
setTestKRoot(eng, root.public);
|
|
5890
|
+
const parentCert = certSign(eng, {
|
|
5891
|
+
child: parentWs,
|
|
5892
|
+
founder: genesisOwner,
|
|
5893
|
+
verified: true,
|
|
5894
|
+
parentKey: dev2.public,
|
|
5895
|
+
parentId: "root",
|
|
5896
|
+
epoch: 0,
|
|
5897
|
+
secret: dev2.secret
|
|
5898
|
+
});
|
|
5899
|
+
const rootDelegation = certSign(eng, {
|
|
5900
|
+
child: parentWs,
|
|
5901
|
+
founder: genesisOwner,
|
|
5902
|
+
verified: true,
|
|
5903
|
+
parentKey: dev2.public,
|
|
5904
|
+
parentId: "root",
|
|
5905
|
+
epoch: 0,
|
|
5906
|
+
secret: root.secret
|
|
5907
|
+
});
|
|
5908
|
+
const childDelegation = certSign(eng, {
|
|
5909
|
+
child: parentWs,
|
|
5910
|
+
founder: birthActor,
|
|
5911
|
+
verified: true,
|
|
5912
|
+
parentKey: dev2.public,
|
|
5913
|
+
parentId: parentWs,
|
|
5914
|
+
epoch: 0,
|
|
5915
|
+
secret: dev2.secret
|
|
5916
|
+
});
|
|
5917
|
+
const ed = authorFrameworkAs("enrollDelegation", {
|
|
5918
|
+
user: birthActor,
|
|
5919
|
+
deviceKey: dev2.public,
|
|
5920
|
+
certJson: JSON.stringify(childDelegation),
|
|
5921
|
+
enrolledAt: stamp
|
|
5922
|
+
}, birthActor);
|
|
5923
|
+
const hasDelegation = !(ed.ok === false && /no directive registered/i.test(ed.error ?? ""));
|
|
5924
|
+
if (ed.ok === false && !/already|create-once|enrolled|no directive registered/i.test(ed.error ?? "")) {
|
|
5925
|
+
return { ok: false, error: `enrollDelegation(${birthActor}) refused: ${ed.error}` };
|
|
5926
|
+
}
|
|
5879
5927
|
const sba = authorFrameworkAs("seedBirthAttestation", {
|
|
5880
5928
|
child: parentWs,
|
|
5881
5929
|
founder: genesisOwner,
|
|
5882
|
-
verified: "
|
|
5930
|
+
verified: "true",
|
|
5883
5931
|
parentId: parentWs,
|
|
5884
5932
|
parentKey: dev2.public,
|
|
5885
5933
|
epoch: 0,
|
|
5886
|
-
certChain: JSON.stringify({ links: [
|
|
5934
|
+
certChain: JSON.stringify({ links: [parentCert, rootDelegation] })
|
|
5887
5935
|
}, genesisOwner);
|
|
5888
|
-
|
|
5936
|
+
const hasParentAttestation = !(sba.ok === false && /no directive registered/i.test(sba.error ?? ""));
|
|
5937
|
+
if (sba.ok === false && !/already|create-once|attest|no directive registered/i.test(sba.error ?? "")) return { ok: false, error: `seedBirthAttestation refused: ${sba.error}` };
|
|
5889
5938
|
const sg = authorFrameworkAs("seedGenesis", { principal: genesisOwner, workspaceId: parentWs, bornAt: stamp }, genesisOwner);
|
|
5890
5939
|
if (sg.ok === false && !/already|create-once|warrant/i.test(sg.error ?? "")) return { ok: false, error: `seedGenesis refused: ${sg.error}` };
|
|
5891
|
-
return { ok: true };
|
|
5940
|
+
return { ok: true, attestationVerified: hasDelegation && hasParentAttestation };
|
|
5892
5941
|
}
|
|
5893
|
-
function attestedBirthOffer(eng, parentWs, parentDomain, directiveId, payloadNoCert, lawHash, founder, dev2) {
|
|
5942
|
+
function attestedBirthOffer(eng, parentWs, parentDomain, directiveId, payloadNoCert, lawHash, founder, dev2, verified = true) {
|
|
5894
5943
|
const probe = author(eng, parentWs, parentDomain, directiveId, payloadNoCert, lawHash, { actor: founder });
|
|
5895
5944
|
if (probe.ok !== false) {
|
|
5896
5945
|
return { res: probe };
|
|
@@ -5903,7 +5952,7 @@ function attestedBirthOffer(eng, parentWs, parentDomain, directiveId, payloadNoC
|
|
|
5903
5952
|
const signed = certSign(eng, {
|
|
5904
5953
|
child: childName,
|
|
5905
5954
|
founder,
|
|
5906
|
-
verified
|
|
5955
|
+
verified,
|
|
5907
5956
|
parentKey: dev2.public,
|
|
5908
5957
|
parentId: parentWs,
|
|
5909
5958
|
epoch: 0,
|
|
@@ -5913,7 +5962,7 @@ function attestedBirthOffer(eng, parentWs, parentDomain, directiveId, payloadNoC
|
|
|
5913
5962
|
const res = author(eng, parentWs, parentDomain, directiveId, payload, lawHash, { actor: founder, authorSecret: dev2.secret });
|
|
5914
5963
|
return { res, childName };
|
|
5915
5964
|
}
|
|
5916
|
-
function runChildBirthLeg(eng, ws, lawHash, cb, frameworkHash) {
|
|
5965
|
+
async function runChildBirthLeg(eng, ws, lawHash, cb, frameworkHash) {
|
|
5917
5966
|
const t0 = performance.now();
|
|
5918
5967
|
const lines = [];
|
|
5919
5968
|
const done = (ok, error) => ({ ok, ms: performance.now() - t0, legs: lines, ...error !== void 0 ? { error } : {} });
|
|
@@ -5973,7 +6022,8 @@ function runChildBirthLeg(eng, ws, lawHash, cb, frameworkHash) {
|
|
|
5973
6022
|
setupPayload,
|
|
5974
6023
|
lawHash,
|
|
5975
6024
|
founder,
|
|
5976
|
-
dev2
|
|
6025
|
+
dev2,
|
|
6026
|
+
true
|
|
5977
6027
|
);
|
|
5978
6028
|
if (setupRes.ok === false) {
|
|
5979
6029
|
return done(false, `parent setup ${setup.parentDomain}/${setup.birthDirectiveId} refused: ${setupErr ?? setupRes.error ?? "unknown"} \u2014 the proof could not birth the parent workspace needed before gated child birth`);
|
|
@@ -5993,7 +6043,17 @@ function runChildBirthLeg(eng, ws, lawHash, cb, frameworkHash) {
|
|
|
5993
6043
|
return done(true);
|
|
5994
6044
|
}
|
|
5995
6045
|
}
|
|
5996
|
-
const { res } = attestedBirthOffer(
|
|
6046
|
+
const { res } = attestedBirthOffer(
|
|
6047
|
+
eng,
|
|
6048
|
+
parentWs,
|
|
6049
|
+
cb.parentDomain,
|
|
6050
|
+
cb.birthDirectiveId,
|
|
6051
|
+
payload,
|
|
6052
|
+
lawHash,
|
|
6053
|
+
founder,
|
|
6054
|
+
dev2,
|
|
6055
|
+
cb.parentSetup === void 0 || warrant.attestationVerified === true
|
|
6056
|
+
);
|
|
5997
6057
|
if (res.ok === false) {
|
|
5998
6058
|
return done(false, `child birth ${cb.parentDomain}/${cb.birthDirectiveId} refused: ${res.error ?? "unknown"} \u2014 the parent's own gate rejected the birth offer (check the .births() plan + payload)`);
|
|
5999
6059
|
}
|
|
@@ -6023,7 +6083,11 @@ function runChildBirthLeg(eng, ws, lawHash, cb, frameworkHash) {
|
|
|
6023
6083
|
const checks = downgraded.certChecks !== void 0 ? ` certChecks=${JSON.stringify(downgraded.certChecks)}` : "";
|
|
6024
6084
|
lines.push(`\u26A0 child ${childWs} was born UNWARRANTED \u2014 ${String(downgraded.reason ?? "cert not seeded")}${checks}`);
|
|
6025
6085
|
}
|
|
6026
|
-
|
|
6086
|
+
if (cb.businessAggregateId !== void 0) {
|
|
6087
|
+
lines.push(`\u2713 birth(${cb.businessAggregateId}) \u2014 business facts became a durable holon`);
|
|
6088
|
+
} else {
|
|
6089
|
+
lines.push(`\u2713 child birth ${cb.parentDomain}/${cb.birthDirectiveId} \u2014 ${childWs} born (the offer-effect folded the child genesis through the child's OWN gate)`);
|
|
6090
|
+
}
|
|
6027
6091
|
const installed = (hash) => {
|
|
6028
6092
|
try {
|
|
6029
6093
|
return qById(eng, childWs, `domain-installation:${hash}`).length > 0;
|
|
@@ -6037,7 +6101,11 @@ function runChildBirthLeg(eng, ws, lawHash, cb, frameworkHash) {
|
|
|
6037
6101
|
if (!installed(lawHash)) {
|
|
6038
6102
|
return done(false, `the born child ${childWs} did not install the child law in-chain (domain-installation:${lawHash.slice(0, 12)}\u2026 absent) \u2014 the genesis nomos/installDomain did not fold (by-hash byte routing failed: does the parent fold this law?)`);
|
|
6039
6103
|
}
|
|
6040
|
-
|
|
6104
|
+
if (cb.businessAggregateId !== void 0) {
|
|
6105
|
+
lines.push(`\u2713 law travelled with ${cb.businessAggregateId} and admitted its first business fact`);
|
|
6106
|
+
} else {
|
|
6107
|
+
lines.push(`\u2713 the born child installed the framework + child law IN-CHAIN (the genesis installDomain\xD72 folded)`);
|
|
6108
|
+
}
|
|
6041
6109
|
let seedRows = [];
|
|
6042
6110
|
if (cb.childSeedInstanceId !== void 0) {
|
|
6043
6111
|
try {
|
|
@@ -6056,7 +6124,9 @@ function runChildBirthLeg(eng, ws, lawHash, cb, frameworkHash) {
|
|
|
6056
6124
|
if ((cb.childSeedInstanceId !== void 0 || cb.childQuery !== void 0) && seedRows.length < 1) {
|
|
6057
6125
|
return done(false, `the born child ${childWs} did not seed ${cb.childSeedAggregateId ?? "its genesis record"} (${cb.childSeedDirectiveId} produced no readable row) \u2014 the child genesis seed did not run`);
|
|
6058
6126
|
}
|
|
6059
|
-
|
|
6127
|
+
if (cb.businessAggregateId === void 0) {
|
|
6128
|
+
lines.push(`\u2713 the born child's genesis seed ran \u2014 ${cb.childSeedDirectiveId} produced ${seedRows.length} readable ${cb.childSeedAggregateId ?? "row"}(s) in ${childWs}`);
|
|
6129
|
+
}
|
|
6060
6130
|
let verdict;
|
|
6061
6131
|
try {
|
|
6062
6132
|
verdict = verifyChainLocal(eng, childWs);
|
|
@@ -6066,7 +6136,37 @@ function runChildBirthLeg(eng, ws, lawHash, cb, frameworkHash) {
|
|
|
6066
6136
|
if (verdict.valid !== true) {
|
|
6067
6137
|
return done(false, `the born child ${childWs} FAILED verify_chain at ${verdict.check ?? "?"}${verdict.atIndex !== void 0 ? ` (intent ${verdict.atIndex})` : ""}: ${verdict.error ?? "invalid"} \u2014 the child's own gate refused its genesis`);
|
|
6068
6138
|
}
|
|
6069
|
-
|
|
6139
|
+
if (cb.businessAggregateId !== void 0) {
|
|
6140
|
+
lines.push(`\u2713 full history replayed green locally (${verdict.plansRerun ?? "?"} plans re-run)`);
|
|
6141
|
+
} else {
|
|
6142
|
+
lines.push(`\u2713 verify_chain GREEN on the born child ${childWs} (${verdict.plansRerun ?? "?"} plans re-run \u2014 it self-validates from intent 0 through its OWN gate)`);
|
|
6143
|
+
}
|
|
6144
|
+
const bornEntry = (res.born ?? []).find((b) => b?.workspace === childWs);
|
|
6145
|
+
const packed = packBornChildren(eng, bornEntry === void 0 ? [] : [bornEntry]);
|
|
6146
|
+
const childPack = packed.find((b) => b.workspace === childWs);
|
|
6147
|
+
if (!childPack?.packB64 || !childPack.head) {
|
|
6148
|
+
return done(false, `the born child ${childWs} could not be packed for its own custody \u2014 persistence would be masked by the parent engine`);
|
|
6149
|
+
}
|
|
6150
|
+
try {
|
|
6151
|
+
await ingestPackAsCustody(eng, childWs, new Uint8Array(Buffer.from(childPack.packB64, "base64")), childPack.head);
|
|
6152
|
+
} catch (e) {
|
|
6153
|
+
return done(false, `recovering ${childWs} from its custody pack failed: ${e.message}`);
|
|
6154
|
+
}
|
|
6155
|
+
const recoveredVerify = verifyChainLocal(eng, childWs);
|
|
6156
|
+
if (recoveredVerify.valid !== true) {
|
|
6157
|
+
return done(false, `the recovered child ${childWs} FAILED verify_chain from its own custody: ${recoveredVerify.error ?? "invalid"}`);
|
|
6158
|
+
}
|
|
6159
|
+
if (cb.childSeedInstanceId !== void 0) {
|
|
6160
|
+
const recoveredRows = qById(eng, childWs, cb.childSeedInstanceId);
|
|
6161
|
+
if (recoveredRows.length < 1) {
|
|
6162
|
+
return done(false, `the recovered child ${childWs} verified but its business root ${cb.childSeedInstanceId} was missing`);
|
|
6163
|
+
}
|
|
6164
|
+
}
|
|
6165
|
+
if (cb.businessAggregateId !== void 0) {
|
|
6166
|
+
lines.push(`\u2713 persistence + recovery \u2014 evicted, restored from durable custody, and ${cb.businessAggregateId} read back`);
|
|
6167
|
+
} else {
|
|
6168
|
+
lines.push(`\u2713 persistence + recovery \u2014 child custody packed, resident copy discarded, verify_chain GREEN and ${cb.childSeedInstanceId ?? cb.childSeedAggregateId ?? "the business root"} readable after reopen`);
|
|
6169
|
+
}
|
|
6070
6170
|
return done(true);
|
|
6071
6171
|
}
|
|
6072
6172
|
function seatRelationAuthority(eng, ws, lawHash, rb, actor, stamp, lines, authorSecret, subjectActor = actor) {
|
|
@@ -6236,7 +6336,17 @@ function runBornContextLeg(eng, ws, lawHash, rb, ACTOR, stamp) {
|
|
|
6236
6336
|
if (bc.frameworkHashField !== void 0) birthPayload[bc.frameworkHashField] = fw;
|
|
6237
6337
|
if (bc.lawHashField !== void 0) birthPayload[bc.lawHashField] = lawHash;
|
|
6238
6338
|
for (const f of bc.birthAutoStamped) birthPayload[f] = stamp;
|
|
6239
|
-
const { res: birthRes } = attestedBirthOffer(
|
|
6339
|
+
const { res: birthRes } = attestedBirthOffer(
|
|
6340
|
+
eng,
|
|
6341
|
+
ws,
|
|
6342
|
+
rb.domain,
|
|
6343
|
+
bc.birthDirectiveId,
|
|
6344
|
+
birthPayload,
|
|
6345
|
+
lawHash,
|
|
6346
|
+
founder,
|
|
6347
|
+
dev2,
|
|
6348
|
+
true
|
|
6349
|
+
);
|
|
6240
6350
|
if (birthRes.ok === false) {
|
|
6241
6351
|
lines.push(`\u2013 relation-bootstrap leg SKIPPED (layer-4 born-context) \u2014 the self-birth ${rb.domain}/${bc.birthDirectiveId} refused (${birthRes.error ?? "refused"}); could not establish born-genesis authority for "${rb.relation}"`);
|
|
6242
6352
|
return done(true);
|
|
@@ -6296,8 +6406,9 @@ async function runOfflineProofStandalone(proofPath, cloud, domain) {
|
|
|
6296
6406
|
}
|
|
6297
6407
|
const deployBody = JSON.parse(readFileSync7(deployFile, "utf8"));
|
|
6298
6408
|
const lawHash = await sha256hex(deployBody.packageUsda);
|
|
6299
|
-
console.log(`githolon proof \u2014
|
|
6300
|
-
const
|
|
6409
|
+
console.log(`githolon proof \u2014 generated business proof in the real local engine`);
|
|
6410
|
+
const runtimeKind = legs.childBirth !== void 0 || (legs.childBirths?.length ?? 0) > 0 ? "test-mint" : "production";
|
|
6411
|
+
const { eng } = await holonEngine(cloud, deployBody, "githolon-proof", runtimeKind);
|
|
6301
6412
|
const ws = "proof-offline";
|
|
6302
6413
|
await mountFresh(eng, ws);
|
|
6303
6414
|
author(eng, ws, "bootstrap", "installDomain", installPayload(eng.hashes.nomos, eng.nomosPkg, "githolon-proof"), "");
|
|
@@ -6310,16 +6421,17 @@ async function runOfflineProofStandalone(proofPath, cloud, domain) {
|
|
|
6310
6421
|
}
|
|
6311
6422
|
console.log(`
|
|
6312
6423
|
OFFLINE PROOF GREEN (${Math.round(v.ms)}ms) \u2014 the same legs rerun on every save in \`githolon dev\`.`);
|
|
6313
|
-
console.log(`
|
|
6424
|
+
console.log(`Run the same generated business proof against Nomos Cloud when ready: githolon proof --live`);
|
|
6314
6425
|
return 0;
|
|
6315
6426
|
}
|
|
6316
|
-
var keyHashOf;
|
|
6427
|
+
var keyHashOf, OFFLINE_PROOF_VERIFIER;
|
|
6317
6428
|
var init_proof_offline = __esm({
|
|
6318
6429
|
"src/proof_offline.ts"() {
|
|
6319
6430
|
"use strict";
|
|
6320
6431
|
init_engine();
|
|
6321
6432
|
init_local_holon();
|
|
6322
6433
|
keyHashOf = (pubB64) => createHash4("sha256").update(Buffer.from(pubB64, "base64")).digest("hex");
|
|
6434
|
+
OFFLINE_PROOF_VERIFIER = "nomos:test-mint";
|
|
6323
6435
|
}
|
|
6324
6436
|
});
|
|
6325
6437
|
|
|
@@ -8729,7 +8841,7 @@ var HELP = {
|
|
|
8729
8841
|
},
|
|
8730
8842
|
proof: {
|
|
8731
8843
|
usage: "githolon proof [build/<name>.proof.mts] [--domain <key>] [--live] [--keep]",
|
|
8732
|
-
what: "Run the proof GENERATED from your law.
|
|
8844
|
+
what: "Run the proof GENERATED from your business law. By default it drives the real local engine:\nbirth, full-history verification, durable custody, eviction, restore, and read-back. --live runs the\nsame business proof against Nomos Cloud; identity, provisioning, persistence, and cleanup remain\ninside Nomos. --domain selects one domain in a multi-domain package. ALL GREEN or it names the jam.",
|
|
8733
8845
|
examples: ["githolon proof", "githolon proof --domain co2_platform", "githolon proof --live", "githolon proof --live --keep"]
|
|
8734
8846
|
},
|
|
8735
8847
|
dev: {
|
|
@@ -8817,7 +8929,7 @@ var HELP = {
|
|
|
8817
8929
|
},
|
|
8818
8930
|
login: {
|
|
8819
8931
|
usage: "githolon login --agent | --token <refresh_token>",
|
|
8820
|
-
what: "Establish the
|
|
8932
|
+
what: "Establish the identity Nomos uses beneath birth. --agent creates a verified development identity\n(no browser; linkable later); --token adopts an existing session. Credentials auto-refresh.",
|
|
8821
8933
|
examples: ["githolon login --agent", "githolon login --token <refresh_token>"]
|
|
8822
8934
|
},
|
|
8823
8935
|
whoami: {
|
|
@@ -8838,16 +8950,14 @@ var HELP = {
|
|
|
8838
8950
|
what: "Clear the session. Stored workspace secrets are KEPT."
|
|
8839
8951
|
},
|
|
8840
8952
|
ws: {
|
|
8841
|
-
usage: "githolon ws <
|
|
8842
|
-
what: "
|
|
8953
|
+
usage: "githolon ws <status|retire|reclaim> [<name>] [--parent <ws>] [--cloud <url>] [--target <name>]",
|
|
8954
|
+
what: "Operator inspection and disposal of existing cloud custody. Application creation is not here:\ndeclare birth(Aggregate, spec) and call the generated app.birth(businessFacts). `status` inspects\nlineage and verdicts; `retire` withdraws law while retaining data; `reclaim` discards custody only\nafter retirement.",
|
|
8843
8955
|
flags: [
|
|
8844
|
-
["--principal <p>", "the birth's principal (uid or access token; remembered as the default)"],
|
|
8845
|
-
["--via <parent>", "ws create: sign a createWorkspace offer at <parent> instead of the raw birth"],
|
|
8846
8956
|
["--parent <ws>", "retire/reclaim: the governance workspace to sign against (default root)"],
|
|
8847
8957
|
["--cloud <url>", "target cloud (default: $NOMOS_CLOUD or the public cloud)"],
|
|
8848
8958
|
["--target <name>", "ws status: pick among the project's named workspace targets"]
|
|
8849
8959
|
],
|
|
8850
|
-
examples: ["githolon ws
|
|
8960
|
+
examples: ["githolon ws status", "githolon ws retire my-guestbook"]
|
|
8851
8961
|
},
|
|
8852
8962
|
key: {
|
|
8853
8963
|
usage: "githolon key <enroll|show|import|export> [--principal <uid>] [--secret <key>] [--sha256] [--format hex|base64] [--parent <ws>] [--yes]",
|
|
@@ -8883,9 +8993,8 @@ var HELP = {
|
|
|
8883
8993
|
],
|
|
8884
8994
|
examples: [
|
|
8885
8995
|
`githolon gov root grantCreation --payload '{"principal":"d205ca94-\u2026"}' --as 32c7100e-\u2026 --stamp`,
|
|
8886
|
-
"githolon gov
|
|
8887
|
-
"githolon gov root
|
|
8888
|
-
"githolon gov relay root co2.offer.json"
|
|
8996
|
+
"githolon gov root setGovernancePosture --payload-file posture.json --as 32c7100e-\u2026 --save posture.offer.json",
|
|
8997
|
+
"githolon gov relay root posture.offer.json"
|
|
8889
8998
|
]
|
|
8890
8999
|
},
|
|
8891
9000
|
rebirth: {
|
|
@@ -8956,12 +9065,12 @@ var HELP = {
|
|
|
8956
9065
|
},
|
|
8957
9066
|
git: {
|
|
8958
9067
|
usage: "githolon git <setup | remote [<ws>] [<remoteName>]> [--cloud <url>] [--target <name>]",
|
|
8959
|
-
what: "
|
|
9068
|
+
what: "Operator transport plumbing for existing holons. `setup` installs the credential helper;\n`remote` wires a local repo to existing cloud custody. Application code does not use git to\ncreate business things; it calls the generated birth(businessFacts).",
|
|
8960
9069
|
examples: ["githolon git setup", "githolon git remote my-guestbook", "git push nomos refs/heads/session/dev"]
|
|
8961
9070
|
},
|
|
8962
9071
|
ledger: {
|
|
8963
9072
|
usage: "githolon ledger <init|verify> <dir> [--file <deploy.json>] [--cloud <url>]",
|
|
8964
|
-
what: "
|
|
9073
|
+
what: "Low-level local custody and verification for framework development. `init` writes compiled\nlaw into a git-backed holon; `verify` replays its full history. Application packages use the\ngenerated birth(businessFacts) surface instead.",
|
|
8965
9074
|
examples: ["githolon ledger init ./my-holon", "githolon ledger verify ./my-holon"]
|
|
8966
9075
|
}
|
|
8967
9076
|
};
|
|
@@ -9461,117 +9570,37 @@ async function status(wsArg, opts) {
|
|
|
9461
9570
|
// src/cli.ts
|
|
9462
9571
|
var KINDS = ["domain", "aggregate", "intent"];
|
|
9463
9572
|
var DEFAULT_OUT = "domains";
|
|
9464
|
-
var USAGE = `githolon \u2014
|
|
9573
|
+
var USAGE = `githolon \u2014 model a business; Nomos owns the compute science
|
|
9465
9574
|
|
|
9466
|
-
|
|
9467
|
-
githolon
|
|
9468
|
-
|
|
9469
|
-
|
|
9470
|
-
githolon
|
|
9471
|
-
githolon replay <ws|dir> the ledger as film: step the chain intent-by-
|
|
9472
|
-
intent; finale = the verify_chain verdict
|
|
9473
|
-
githolon scene <ws|dir> [--out <dir>] the ledger as a PORTABLE USD scene: verify_chain-
|
|
9474
|
-
gated chain\u2192USD projection (.usda + .usdz, loads
|
|
9475
|
-
in three.js/usdview/QuickLook; timeCode = index)
|
|
9476
|
-
githolon decrypt <ws> --as <p> --secret <b64> clone + decrypt as a principal: unwrap their scope
|
|
9477
|
-
--query <id> [--param k=v] keys from the chain, read private fields in cleartext
|
|
9575
|
+
Start here:
|
|
9576
|
+
githolon compile compile aggregates, birth, directives, and reads into law + a typed client
|
|
9577
|
+
githolon proof run the generated business proof in the real local engine
|
|
9578
|
+
githolon dev watch, compile, and rerun that proof on every save
|
|
9579
|
+
githolon check explain anything the law can already prove it would refuse
|
|
9478
9580
|
|
|
9479
|
-
|
|
9480
|
-
|
|
9481
|
-
./nomos.package.mjs \u2014 the unified report; exits
|
|
9482
|
-
non-zero on any REFUSE (compile runs it implicitly).
|
|
9483
|
-
--json emits the findings (with file:line) as an array
|
|
9484
|
-
githolon compat <ws-url|deploy.json|dir> [--json] THE CI GATE: compare the current build's interface
|
|
9485
|
-
against a target's installed law, PER MEMBER (#72
|
|
9486
|
-
subtyping); exits non-zero on any incompatible member
|
|
9487
|
-
githolon lsp the author-time gate as a stdio Language Server:
|
|
9488
|
-
red squiggles while you write law (VS Code/Neovim/\u2026)
|
|
9489
|
-
githolon mcp the author-time gate as a stdio MCP server for AI
|
|
9490
|
-
agents (Codex/Claude): tools nomos_check +
|
|
9491
|
-
nomos_evolve_preview. Setup: codex mcp add nomos -- githolon mcp
|
|
9492
|
-
githolon compile [compiler args] compile the package by ./nomos.package.mjs
|
|
9493
|
-
githolon init-editor write .vscode/extensions.json recommending the
|
|
9494
|
-
Nomos Law extension \u2014 the check gate as red
|
|
9495
|
-
squiggles while you type (idempotent)
|
|
9496
|
-
githolon proof [build/<name>.proof.mts] run the proof GENERATED from your law, live
|
|
9497
|
-
(every compile emits it; ALL GREEN or it names the jam)
|
|
9498
|
-
githolon harness-install --deploy <deploy.json[,...]> offline install for the headless TEST HARNESS:
|
|
9499
|
-
--workspace <ws> --out <snapshot> install tenant law IN-CHAIN (no cloud), write the
|
|
9500
|
-
restore snapshot, print { ok, snapshot, lawHashes }
|
|
9501
|
-
githolon generate <domain|aggregate|intent> <name> [options]
|
|
9502
|
-
githolon g <domain|aggregate|intent> <name> [options]
|
|
9581
|
+
The application surface is one idea:
|
|
9582
|
+
const thing = await app.birth(businessFacts)
|
|
9503
9583
|
|
|
9504
|
-
|
|
9505
|
-
|
|
9506
|
-
|
|
9507
|
-
githolon whoami show the principal births will ride + keys on file
|
|
9508
|
-
githolon use [<uid>] [--clear] set/show/clear the ACTIVE signing principal: the one
|
|
9509
|
-
deploy/gov/grant/key author as (--as overrides per-cmd)
|
|
9510
|
-
githolon logout clear the session (workspace secrets kept)
|
|
9511
|
-
githolon key enroll [--principal <uid>] [--parent <ws>] [--domain <d>] [--directive <id>] mint a signing device key + enroll it on-chain (the signing directive is DISCOVERED from the parent's installed law; the flags override)
|
|
9512
|
-
(secret stays local; warrants SIGNED governance)
|
|
9513
|
-
githolon key import --principal <uid> --secret <key> bring an EXISTING admin key into ~/.holon (accepts
|
|
9514
|
-
hex / base64 seed, or --sha256 <passphrase>)
|
|
9515
|
-
githolon key show | export [--principal <uid>] the device key's public identity (export --yes: secret)
|
|
9584
|
+
A born aggregate is a holon: its law, facts, and history travel together. Nomos owns durable identity,
|
|
9585
|
+
authorship, local execution, validation, persistence, synchronisation, provenance, and recovery beneath
|
|
9586
|
+
that call. Those mechanisms are not separate application workflows.
|
|
9516
9587
|
|
|
9517
|
-
|
|
9518
|
-
githolon
|
|
9519
|
-
|
|
9520
|
-
|
|
9521
|
-
githolon
|
|
9522
|
-
githolon
|
|
9523
|
-
[--dry-run [--json]] [--yes] scarred chain; --dry-run = READ-ONLY impact report
|
|
9524
|
-
githolon rebirth plan <ws> [--reason <text>] [--out D] write a stable plan.json + impact.md (rebirths-as-code)
|
|
9525
|
-
githolon rebirth apply --plan <plan.json> drift-pinned apply of a reviewed plan \u2192 certificate.json
|
|
9526
|
-
--gcp-secret nomos-root-custodian-key [--yes] (apply needs the ROOT CUSTODIAN seed; --gcp-secret is blessed)
|
|
9527
|
-
githolon replay <ws> --repair execute the repair matching a red verify (\u2192 certificate)
|
|
9528
|
-
githolon grant <admin|creation> <principal> [--label L] grant authority at the parent (default root)
|
|
9529
|
-
githolon grant quota <principal> --max <N> grant a per-principal workspace allowance
|
|
9530
|
-
githolon revoke <admin|creation> <principal> revoke it (the revoked fact rides the chain)
|
|
9531
|
-
(all gated by the parent's law: only an admin's
|
|
9532
|
-
signature is admitted; --parent <p> targets a platform)
|
|
9588
|
+
Useful authoring commands:
|
|
9589
|
+
githolon generate <domain|aggregate|intent> <name>
|
|
9590
|
+
githolon compat <target>
|
|
9591
|
+
githolon lsp
|
|
9592
|
+
githolon mcp
|
|
9593
|
+
githolon login --agent
|
|
9533
9594
|
|
|
9534
|
-
|
|
9535
|
-
|
|
9536
|
-
githolon ws create <name> [--principal <uid|token>] birth a workspace (no host secret is issued)
|
|
9537
|
-
(no identity on file? it self-onboards an agent login)
|
|
9538
|
-
githolon ws create <name> --via <parent> request it as a SIGNED createWorkspace governance
|
|
9539
|
-
offer at the parent
|
|
9540
|
-
githolon ws status [<name>] workspace status (lineage, phase, verdicts)
|
|
9541
|
-
githolon ws retire <name> [--parent <ws>] retire a workspace via a SIGNED governance offer;
|
|
9542
|
-
quota freed; data retained; reads keep serving
|
|
9543
|
-
githolon ws reclaim <name> [--parent <ws>] lawful custody discard via a SIGNED governance offer
|
|
9544
|
-
(only a retired workspace; never root)
|
|
9545
|
-
githolon deploy [<ws>] [--file <deploy.json>] deploy build/*.deploy.json \u2014 DEFAULT replace-current:
|
|
9546
|
-
[--keep-beside] [--retire-replaced] new law becomes active; prior install is superseded
|
|
9547
|
-
per domain key (prints what moved). --keep-beside
|
|
9548
|
-
installs beside; --retire-replaced marks retired
|
|
9549
|
-
githolon domains status <ws> per domain key: active law plus superseded/retired
|
|
9550
|
-
[--explain-current-interface] lineage (active = served now)
|
|
9551
|
-
githolon domains retire <ws> <hashOrKey> retire an install (marks it retired \u2014 replayable,
|
|
9552
|
-
[--with <hashOrKey>] no longer served) via a signed installDomain offer
|
|
9553
|
-
githolon dlq sweep <ws> [--depth <n>] [--full] sweep a platform subtree's dead-letter queues
|
|
9554
|
-
(registry-enumerated; exit 2 when jams exist)
|
|
9555
|
-
githolon secret set <ws> <push-password> store a git push password (authenticated git sync)
|
|
9556
|
-
githolon secret rotate <ws> RETIRED \u2014 host holds no ownership credential (410)
|
|
9557
|
-
|
|
9558
|
-
Git lane (stock git as the sync transport \u2014 main is not push-writable; a workspace is born by its parent):
|
|
9559
|
-
githolon git setup install the credential helper for the cloud host
|
|
9560
|
-
githolon git remote [<ws>] [<remoteName>] wire this repo to a workspace (default name: nomos)
|
|
9561
|
-
then: git push nomos refs/heads/session/<id>
|
|
9562
|
-
|
|
9563
|
-
The local-first lane (mint + assert a holon on YOUR machine, under YOUR identity):
|
|
9564
|
-
githolon ledger init <dir> genesis + your compiled law, verified by the SAME
|
|
9565
|
-
wasm gate the cloud runs, written as a git repo
|
|
9566
|
-
githolon ledger verify <dir> re-run the chain's self-verification from disk
|
|
9595
|
+
Operational and inspection commands remain available to maintain Nomos itself. Ask any command for its
|
|
9596
|
+
focused screen: githolon <command> --help (for example: status, replay, scene, deploy, domains, or gov).
|
|
9567
9597
|
|
|
9568
9598
|
Options:
|
|
9569
|
-
--cloud <url> target cloud
|
|
9570
|
-
--
|
|
9571
|
-
--
|
|
9572
|
-
--
|
|
9573
|
-
|
|
9574
|
-
-h, --help top level here; \`githolon <command> --help\` for that command's flags + examples
|
|
9599
|
+
--cloud <url> target cloud
|
|
9600
|
+
--out <dir> generate into a different directory (default: ${DEFAULT_OUT})
|
|
9601
|
+
--force overwrite generated source
|
|
9602
|
+
--dry-run print generated source without writing it
|
|
9603
|
+
-h, --help show this page; githolon <command> --help shows one focused command
|
|
9575
9604
|
`;
|
|
9576
9605
|
function cloudArgs(rest) {
|
|
9577
9606
|
const pos = [];
|
|
@@ -9745,7 +9774,7 @@ async function runProof(args) {
|
|
|
9745
9774
|
const tsxPkg = JSON.parse(readFileSync16(join17(tsxDir, "package.json"), "utf8"));
|
|
9746
9775
|
const tsxBinRel = typeof tsxPkg.bin === "string" ? tsxPkg.bin : tsxPkg.bin?.["tsx"];
|
|
9747
9776
|
const tsxCli = join17(tsxDir, tsxBinRel ?? "dist/cli.mjs");
|
|
9748
|
-
console.log("githolon proof --live \u2014 the
|
|
9777
|
+
console.log("githolon proof --live \u2014 the generated business proof against Nomos Cloud" + (keep ? " (--keep preserves its temporary custody)" : ""));
|
|
9749
9778
|
const { wsCreate: wsCreate2, wsRetire: wsRetire2 } = await Promise.resolve().then(() => (init_cloud(), cloud_exports));
|
|
9750
9779
|
const { resolveGovernancePrincipal: resolveGovernancePrincipal2 } = await Promise.resolve().then(() => (init_governance(), governance_exports));
|
|
9751
9780
|
const { login: login2, activePrincipal: activePrincipal2 } = await Promise.resolve().then(() => (init_cloud(), cloud_exports));
|
|
@@ -9765,11 +9794,7 @@ async function runProof(args) {
|
|
|
9765
9794
|
const cr = await wsCreate2(ws, { via: "root", principal });
|
|
9766
9795
|
if (cr !== 0) {
|
|
9767
9796
|
return refuse(
|
|
9768
|
-
`proof --live:
|
|
9769
|
-
remedies:
|
|
9770
|
-
\u2022 ask an operator: githolon grant creation ${principal} (then rerun)
|
|
9771
|
-
\u2022 or pre-create a REGISTERED workspace yourself and hand it over: NOMOS_WS=<ws> githolon proof --live
|
|
9772
|
-
\u2022 or develop offline (no cloud workspace at all): githolon proof`
|
|
9797
|
+
`proof --live: Nomos could not establish safe custody for birth as ${principal}. This is a framework failure: no manual grant, key, parent, or provisioning step is part of the application contract. The local business proof remains available with: githolon proof`
|
|
9773
9798
|
);
|
|
9774
9799
|
}
|
|
9775
9800
|
}
|
|
@@ -10082,6 +10107,12 @@ ${commandHelp("status")}`);
|
|
|
10082
10107
|
}
|
|
10083
10108
|
return status(pos[0], opts);
|
|
10084
10109
|
}
|
|
10110
|
+
if (argv[0] === "ws" && argv[1] === "create") {
|
|
10111
|
+
process.stderr.write(
|
|
10112
|
+
"error: `githolon ws create` is not an application birth API. Declare birth(Aggregate, spec) and call the generated app.birth(businessFacts); Nomos owns custody beneath it.\n"
|
|
10113
|
+
);
|
|
10114
|
+
return 1;
|
|
10115
|
+
}
|
|
10085
10116
|
if (argv[0] === "ws" || argv[0] === "deploy" || argv[0] === "secret") {
|
|
10086
10117
|
return runCloud(argv);
|
|
10087
10118
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "githolon",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.100.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "githolon — the Nomos developer CLI: Rails-style generators for @githolon/dsl domains + the package compiler. Kernel-independent.",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@bjorn3/browser_wasi_shim": "0.4.2",
|
|
32
|
-
"@githolon/client": "^0.
|
|
33
|
-
"@githolon/dsl": "^0.
|
|
32
|
+
"@githolon/client": "^0.100.0",
|
|
33
|
+
"@githolon/dsl": "^0.100.0",
|
|
34
34
|
"isomorphic-git": "^1.38.4"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|