githolon 0.107.3 → 0.107.4
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/full-cli.mjs +337 -143
- package/package.json +2 -2
package/dist/full-cli.mjs
CHANGED
|
@@ -1115,9 +1115,9 @@ function activityKey(kind, slot) {
|
|
|
1115
1115
|
return `activity.${kind}.${slot}`;
|
|
1116
1116
|
}
|
|
1117
1117
|
function templateVars(template) {
|
|
1118
|
-
const
|
|
1119
|
-
for (const m of template.matchAll(/\{([a-zA-Z0-9_]+)\}/g))
|
|
1120
|
-
return
|
|
1118
|
+
const out15 = [];
|
|
1119
|
+
for (const m of template.matchAll(/\{([a-zA-Z0-9_]+)\}/g)) out15.push(m[1]);
|
|
1120
|
+
return out15;
|
|
1121
1121
|
}
|
|
1122
1122
|
function payloadFieldNames(schema) {
|
|
1123
1123
|
const def = schema?._def ?? schema?.def;
|
|
@@ -3020,15 +3020,15 @@ var init_git_fs = __esm({
|
|
|
3020
3020
|
});
|
|
3021
3021
|
|
|
3022
3022
|
// ../cloud/web-client/src/_adapter/tree.ts
|
|
3023
|
-
function flatten(dir, prefix,
|
|
3023
|
+
function flatten(dir, prefix, out15) {
|
|
3024
3024
|
const children2 = [...(dir.contents ?? /* @__PURE__ */ new Map()).entries()].sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0);
|
|
3025
3025
|
for (const [name, inode] of children2) {
|
|
3026
3026
|
const path2 = prefix ? prefix + "/" + name : name;
|
|
3027
3027
|
if (inode.contents instanceof Map) {
|
|
3028
|
-
|
|
3029
|
-
flatten(inode, path2,
|
|
3028
|
+
out15.push({ path: path2, dir: true });
|
|
3029
|
+
flatten(inode, path2, out15);
|
|
3030
3030
|
} else {
|
|
3031
|
-
|
|
3031
|
+
out15.push({ path: path2, dir: false, bytes: inode.data ?? new Uint8Array(0) });
|
|
3032
3032
|
}
|
|
3033
3033
|
}
|
|
3034
3034
|
}
|
|
@@ -3051,13 +3051,13 @@ function serializeTree(workTree) {
|
|
|
3051
3051
|
}
|
|
3052
3052
|
let total = 0;
|
|
3053
3053
|
for (const c of chunks) total += c.length;
|
|
3054
|
-
const
|
|
3054
|
+
const out15 = new Uint8Array(total);
|
|
3055
3055
|
let off = 0;
|
|
3056
3056
|
for (const c of chunks) {
|
|
3057
|
-
|
|
3057
|
+
out15.set(c, off);
|
|
3058
3058
|
off += c.length;
|
|
3059
3059
|
}
|
|
3060
|
-
return
|
|
3060
|
+
return out15;
|
|
3061
3061
|
}
|
|
3062
3062
|
function deserializeTree(bytes, { File: File4, Directory: Directory4 }) {
|
|
3063
3063
|
const u8 = bytes instanceof Uint8Array ? bytes : new Uint8Array(bytes);
|
|
@@ -4042,13 +4042,13 @@ var init_offer_args = __esm({
|
|
|
4042
4042
|
function concatBytes(chunks) {
|
|
4043
4043
|
let n = 0;
|
|
4044
4044
|
for (const c of chunks) n += c.length;
|
|
4045
|
-
const
|
|
4045
|
+
const out15 = new Uint8Array(n);
|
|
4046
4046
|
let o = 0;
|
|
4047
4047
|
for (const c of chunks) {
|
|
4048
|
-
|
|
4048
|
+
out15.set(c, o);
|
|
4049
4049
|
o += c.length;
|
|
4050
4050
|
}
|
|
4051
|
-
return
|
|
4051
|
+
return out15;
|
|
4052
4052
|
}
|
|
4053
4053
|
function pkt(payload) {
|
|
4054
4054
|
const body = typeof payload === "string" ? enc3.encode(payload) : payload;
|
|
@@ -4377,7 +4377,7 @@ function compatible(client, workspace) {
|
|
|
4377
4377
|
return { ok: missing.length === 0 && incompatible.length === 0, missing, incompatible };
|
|
4378
4378
|
}
|
|
4379
4379
|
function memberVerdicts(client, workspace) {
|
|
4380
|
-
const
|
|
4380
|
+
const out15 = {};
|
|
4381
4381
|
const cDirs = client && client.directives || {};
|
|
4382
4382
|
const wDirs = workspace && workspace.directives || {};
|
|
4383
4383
|
const cAggs = client && client.aggregates || {};
|
|
@@ -4385,7 +4385,7 @@ function memberVerdicts(client, workspace) {
|
|
|
4385
4385
|
for (const [did, cShape] of Object.entries(cDirs)) {
|
|
4386
4386
|
const wShape = wDirs[did];
|
|
4387
4387
|
if (!wShape) {
|
|
4388
|
-
|
|
4388
|
+
out15[did] = { ok: false, reason: `directive '${did}' is not installed on the workspace` };
|
|
4389
4389
|
continue;
|
|
4390
4390
|
}
|
|
4391
4391
|
const cf = cShape.fields || {};
|
|
@@ -4400,13 +4400,13 @@ function memberVerdicts(client, workspace) {
|
|
|
4400
4400
|
const w = wf[f];
|
|
4401
4401
|
if (w && w.kind !== c.kind) reasons.push(`field '${f}' kind ${c.kind} \u2260 workspace ${w.kind}`);
|
|
4402
4402
|
}
|
|
4403
|
-
|
|
4403
|
+
out15[did] = reasons.length ? { ok: false, reason: reasons.join("; ") } : { ok: true };
|
|
4404
4404
|
}
|
|
4405
4405
|
for (const [sid, cAgg] of Object.entries(cAggs)) {
|
|
4406
4406
|
const label = cAgg.label || sid;
|
|
4407
4407
|
const wAgg = wAggs[sid];
|
|
4408
4408
|
if (!wAgg) {
|
|
4409
|
-
|
|
4409
|
+
out15[label] = { ok: false, reason: `aggregate '${label}' is not served by the workspace` };
|
|
4410
4410
|
continue;
|
|
4411
4411
|
}
|
|
4412
4412
|
const cFields = cAgg.fields || {};
|
|
@@ -4417,9 +4417,9 @@ function memberVerdicts(client, workspace) {
|
|
|
4417
4417
|
if (!w) reasons.push(`field '${label}.${c.label || fsid}' is not served`);
|
|
4418
4418
|
else if (w.kind !== c.kind) reasons.push(`field '${label}.${c.label || fsid}' read kind ${c.kind} \u2260 workspace ${w.kind}`);
|
|
4419
4419
|
}
|
|
4420
|
-
|
|
4420
|
+
out15[label] = reasons.length ? { ok: false, reason: reasons.join("; ") } : { ok: true };
|
|
4421
4421
|
}
|
|
4422
|
-
return
|
|
4422
|
+
return out15;
|
|
4423
4423
|
}
|
|
4424
4424
|
function interfaceDomains(byDomain) {
|
|
4425
4425
|
const map = byDomain && typeof byDomain === "object" ? byDomain : {};
|
|
@@ -4429,17 +4429,17 @@ function interfaceDomains(byDomain) {
|
|
|
4429
4429
|
);
|
|
4430
4430
|
}
|
|
4431
4431
|
function mergeDomainInterfaces(byDomain, onlyDomains) {
|
|
4432
|
-
const
|
|
4432
|
+
const out15 = { directives: {}, aggregates: {} };
|
|
4433
4433
|
const map = byDomain && typeof byDomain === "object" ? byDomain : {};
|
|
4434
4434
|
const entries = map.directives ? [[String(map.domain ?? "?"), map]] : Object.entries(map);
|
|
4435
4435
|
for (const [domain, value] of entries) {
|
|
4436
4436
|
if (onlyDomains !== void 0 && !onlyDomains.has(domain)) continue;
|
|
4437
4437
|
if (!value || typeof value !== "object") continue;
|
|
4438
4438
|
const di = value;
|
|
4439
|
-
Object.assign(
|
|
4440
|
-
Object.assign(
|
|
4439
|
+
Object.assign(out15.directives, di.directives || {});
|
|
4440
|
+
Object.assign(out15.aggregates, di.aggregates || {});
|
|
4441
4441
|
}
|
|
4442
|
-
return
|
|
4442
|
+
return out15;
|
|
4443
4443
|
}
|
|
4444
4444
|
var init_shape_compat = __esm({
|
|
4445
4445
|
"../cloud/web-client/src/shape_compat.ts"() {
|
|
@@ -5857,13 +5857,13 @@ async function actorForShareQuote(quote) {
|
|
|
5857
5857
|
function osEntropyBuffer(n) {
|
|
5858
5858
|
const bytes = new Uint8Array(n * 8);
|
|
5859
5859
|
crypto.getRandomValues(bytes);
|
|
5860
|
-
const
|
|
5860
|
+
const out15 = new Array(n), T = 2 ** 53;
|
|
5861
5861
|
for (let i = 0; i < n; i++) {
|
|
5862
5862
|
let z6 = 0n;
|
|
5863
5863
|
for (let b = 7; b >= 0; b--) z6 = z6 << 8n | BigInt(bytes[i * 8 + b]);
|
|
5864
|
-
|
|
5864
|
+
out15[i] = Number(z6 >> 11n) / T;
|
|
5865
5865
|
}
|
|
5866
|
-
return
|
|
5866
|
+
return out15;
|
|
5867
5867
|
}
|
|
5868
5868
|
async function replicaIdFromValue(str) {
|
|
5869
5869
|
const b = new Uint8Array(await crypto.subtle.digest("SHA-256", enc4.encode(str)));
|
|
@@ -5875,14 +5875,14 @@ async function routeTagHexOfHomeKey(homeKey) {
|
|
|
5875
5875
|
return (await sha256hex(`nomos-route:${homeKey}`)).slice(0, 12);
|
|
5876
5876
|
}
|
|
5877
5877
|
function installedLawOfRows(rows) {
|
|
5878
|
-
const
|
|
5878
|
+
const out15 = [];
|
|
5879
5879
|
for (const r of rows || []) {
|
|
5880
5880
|
const d = r && r.data;
|
|
5881
5881
|
if (!d || d["status.phase"] !== "Active") continue;
|
|
5882
5882
|
const h = d["spec.domainHash"];
|
|
5883
|
-
if (typeof h === "string" && h && !
|
|
5883
|
+
if (typeof h === "string" && h && !out15.includes(h)) out15.push(h);
|
|
5884
5884
|
}
|
|
5885
|
-
return
|
|
5885
|
+
return out15;
|
|
5886
5886
|
}
|
|
5887
5887
|
function lawStatusOf(installed, clientHash) {
|
|
5888
5888
|
const known = Array.isArray(installed);
|
|
@@ -5907,14 +5907,14 @@ function birthOutcomeFailure(birthOutcomes) {
|
|
|
5907
5907
|
const first = bad[0];
|
|
5908
5908
|
const list = bad.map((o) => `${o.workspace || "?"} [${o.status}${o.code ? `: ${o.code}` : ""}]${o.reason ? ` \u2014 ${o.reason}` : ""}`).join("; ");
|
|
5909
5909
|
const lawUnavailable = bad.some((o) => o.code === "BirthLawPackageUnavailable");
|
|
5910
|
-
const
|
|
5910
|
+
const err15 = new Error(
|
|
5911
5911
|
`birth incomplete: ${bad.length} child workspace(s) did NOT come up \u2014 ${list}. The parent offer admitted, but the child was not fully born, so opening it would poll head:null until timeout. ` + (lawUnavailable ? `The child's law package is not resolvable from the parent's custody \u2014 deploy it to the parent (POST /v2/workspaces/<parent>/domains) BEFORE birthing.` : `See the outcome's reason/code for the cause.`) + ` [birth-failed]`
|
|
5912
5912
|
);
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
return
|
|
5913
|
+
err15.code = first.code || "BirthFailed";
|
|
5914
|
+
err15.status = first.status;
|
|
5915
|
+
err15.failedBirths = bad;
|
|
5916
|
+
err15.birthOutcomes = birthOutcomes;
|
|
5917
|
+
return err15;
|
|
5918
5918
|
}
|
|
5919
5919
|
function isColdFrameworkDescribe(spec) {
|
|
5920
5920
|
if (!spec || typeof spec !== "object") return false;
|
|
@@ -6889,15 +6889,15 @@ ${String(commit).toLowerCase()}`;
|
|
|
6889
6889
|
typeof principal === "string" && principal ? principal : typeof tokenSubject === "string" ? tokenSubject : ""
|
|
6890
6890
|
);
|
|
6891
6891
|
const readAuthFields = (keys, p) => {
|
|
6892
|
-
const
|
|
6892
|
+
const out15 = { nowUnix: Math.floor(Date.now() / 1e3) };
|
|
6893
6893
|
const pr = typeof p === "string" && p ? p : connectionPrincipal;
|
|
6894
|
-
if (pr)
|
|
6894
|
+
if (pr) out15.principal = pr;
|
|
6895
6895
|
if (activeAuthToken) {
|
|
6896
|
-
|
|
6896
|
+
out15.authToken = activeAuthToken;
|
|
6897
6897
|
}
|
|
6898
|
-
if (deviceSecret)
|
|
6899
|
-
if (Array.isArray(keys) && keys.length)
|
|
6900
|
-
return
|
|
6898
|
+
if (deviceSecret) out15.authorSecret = deviceSecret;
|
|
6899
|
+
if (Array.isArray(keys) && keys.length) out15.keys = keys;
|
|
6900
|
+
return out15;
|
|
6901
6901
|
};
|
|
6902
6902
|
let clientLawHash;
|
|
6903
6903
|
let warnedDrift = false;
|
|
@@ -7327,9 +7327,9 @@ ${String(commit).toLowerCase()}`;
|
|
|
7327
7327
|
} catch {
|
|
7328
7328
|
}
|
|
7329
7329
|
const missingObject = (text.match(/\b[0-9a-f]{40}\b/) || [null])[0];
|
|
7330
|
-
const
|
|
7331
|
-
|
|
7332
|
-
|
|
7330
|
+
const err15 = new Error(text);
|
|
7331
|
+
err15.code = code;
|
|
7332
|
+
err15.errorInfo = {
|
|
7333
7333
|
code,
|
|
7334
7334
|
message: text,
|
|
7335
7335
|
component: "nomos.custody",
|
|
@@ -7347,7 +7347,7 @@ ${String(commit).toLowerCase()}`;
|
|
|
7347
7347
|
"nomos.custody.recommended_action": source === "localSnapshot" ? "quarantineLocalSnapshotAndReclone" : "refetchFullHistoryAndRetry"
|
|
7348
7348
|
}
|
|
7349
7349
|
};
|
|
7350
|
-
return
|
|
7350
|
+
return err15;
|
|
7351
7351
|
};
|
|
7352
7352
|
if (ckptBlobStr || ckptFrontierStr || ckptStagedFrontierFile || ckptCursor) {
|
|
7353
7353
|
const _ckptSpan = span("receive", restoreFrom ? "boot: restore folded state (snapshot)" : "boot: restore checkpoint", "boot");
|
|
@@ -8974,13 +8974,13 @@ ${String(commit).toLowerCase()}`;
|
|
|
8974
8974
|
if (!deviceSecret || !connectionPrincipal) {
|
|
8975
8975
|
throw new Error("owned device recovery needs a signed-in session with its persisted device credential");
|
|
8976
8976
|
}
|
|
8977
|
-
const
|
|
8977
|
+
const out15 = namedQueryTyped(QueryOperation.CRYPTO_OWNED_DEVICE_REQUEST, {
|
|
8978
8978
|
authorSecret: deviceSecret,
|
|
8979
8979
|
workspace,
|
|
8980
8980
|
principal: connectionPrincipal,
|
|
8981
8981
|
scope
|
|
8982
8982
|
});
|
|
8983
|
-
return String(
|
|
8983
|
+
return String(out15.request || "");
|
|
8984
8984
|
};
|
|
8985
8985
|
const ownedRecoveryPolicyRaw = (owner) => ownedTupleData(ownedRecoveryPolicyId(owner));
|
|
8986
8986
|
const ownedRecoveryOrdersRaw = async (recoveryPrincipal) => (await ownedQueryRows("nomosOwnedRecoveryOrdersByRecoveryPrincipal", { recoveryPrincipal })).map((row) => ({ id: String(row.id || ""), ...ownedRowData(row) }));
|
|
@@ -10316,11 +10316,11 @@ ${String(commit).toLowerCase()}`;
|
|
|
10316
10316
|
await sleep(pollMs);
|
|
10317
10317
|
}
|
|
10318
10318
|
if (!sawDelegation) {
|
|
10319
|
-
const
|
|
10319
|
+
const err15 = new Error(
|
|
10320
10320
|
`receiving-group setup: parent '${parent}' still holds NO SignerDelegation for '${owner}' after ${pollTimeoutMs}ms. enrollFirstDevice seated the device SIGNER, but the home cert chain's links[1] (the platform-signed delegation) never surfaced \u2014 the birth would come up UNWARRANTED/headless (birth-cert-not-seeded). The enroll must record the keyless delegation (enrollFirstDevice.delegationCert) BEFORE birth. [ParentSignerDelegationMissing]`
|
|
10321
10321
|
);
|
|
10322
|
-
|
|
10323
|
-
throw
|
|
10322
|
+
err15.code = "ParentSignerDelegationMissing";
|
|
10323
|
+
throw err15;
|
|
10324
10324
|
}
|
|
10325
10325
|
} finally {
|
|
10326
10326
|
delegationSpan.end();
|
|
@@ -10553,10 +10553,10 @@ ${String(commit).toLowerCase()}`;
|
|
|
10553
10553
|
const off = installedInterfaceInner();
|
|
10554
10554
|
if (off === null && _lastInterfaceReadError) {
|
|
10555
10555
|
const e = _lastInterfaceReadError;
|
|
10556
|
-
const
|
|
10557
|
-
|
|
10558
|
-
|
|
10559
|
-
throw
|
|
10556
|
+
const err15 = new Error(`projection read failed on workspace '${workspace}': ${e.message}`);
|
|
10557
|
+
err15.code = "nomos.projection.read_failed";
|
|
10558
|
+
err15.errorInfo = { code: "nomos.projection.read_failed", message: e.message, component: "nomos.projection", workspace, attributes: { "nomos.projection.workspace": workspace } };
|
|
10559
|
+
throw err15;
|
|
10560
10560
|
}
|
|
10561
10561
|
return off;
|
|
10562
10562
|
}),
|
|
@@ -11851,12 +11851,12 @@ function routedHolon(coordinator, { cloud, workspace, clientId, authToken, fetch
|
|
|
11851
11851
|
}
|
|
11852
11852
|
async function frontierMap() {
|
|
11853
11853
|
const rows = await coordinator.query("aggregatesByType", { __type: "NomosSummaryFrontier" });
|
|
11854
|
-
const
|
|
11854
|
+
const out15 = {};
|
|
11855
11855
|
for (const r of rows || []) {
|
|
11856
11856
|
const d = r.data || {};
|
|
11857
|
-
if (typeof d.shard === "string" && typeof d.frontier === "string")
|
|
11857
|
+
if (typeof d.shard === "string" && typeof d.frontier === "string") out15[d.shard] = d.frontier;
|
|
11858
11858
|
}
|
|
11859
|
-
return
|
|
11859
|
+
return out15;
|
|
11860
11860
|
}
|
|
11861
11861
|
async function scopedValue(kind, readId, groupKey, opts = {}) {
|
|
11862
11862
|
if (kind === "min" || kind === "max") {
|
|
@@ -12605,15 +12605,15 @@ var init_git_fs2 = __esm({
|
|
|
12605
12605
|
});
|
|
12606
12606
|
|
|
12607
12607
|
// vendor/engine/tree.ts
|
|
12608
|
-
function flatten2(dir, prefix,
|
|
12608
|
+
function flatten2(dir, prefix, out15) {
|
|
12609
12609
|
const children2 = [...(dir.contents ?? /* @__PURE__ */ new Map()).entries()].sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0);
|
|
12610
12610
|
for (const [name, inode] of children2) {
|
|
12611
12611
|
const path2 = prefix ? prefix + "/" + name : name;
|
|
12612
12612
|
if (inode.contents instanceof Map) {
|
|
12613
|
-
|
|
12614
|
-
flatten2(inode, path2,
|
|
12613
|
+
out15.push({ path: path2, dir: true });
|
|
12614
|
+
flatten2(inode, path2, out15);
|
|
12615
12615
|
} else {
|
|
12616
|
-
|
|
12616
|
+
out15.push({ path: path2, dir: false, bytes: inode.data ?? new Uint8Array(0) });
|
|
12617
12617
|
}
|
|
12618
12618
|
}
|
|
12619
12619
|
}
|
|
@@ -12636,13 +12636,13 @@ function serializeTree2(workTree) {
|
|
|
12636
12636
|
}
|
|
12637
12637
|
let total = 0;
|
|
12638
12638
|
for (const c of chunks) total += c.length;
|
|
12639
|
-
const
|
|
12639
|
+
const out15 = new Uint8Array(total);
|
|
12640
12640
|
let off = 0;
|
|
12641
12641
|
for (const c of chunks) {
|
|
12642
|
-
|
|
12642
|
+
out15.set(c, off);
|
|
12643
12643
|
off += c.length;
|
|
12644
12644
|
}
|
|
12645
|
-
return
|
|
12645
|
+
return out15;
|
|
12646
12646
|
}
|
|
12647
12647
|
var enc5, dec5;
|
|
12648
12648
|
var init_tree2 = __esm({
|
|
@@ -12657,13 +12657,13 @@ var init_tree2 = __esm({
|
|
|
12657
12657
|
function concatBytes2(chunks) {
|
|
12658
12658
|
let n = 0;
|
|
12659
12659
|
for (const c of chunks) n += c.length;
|
|
12660
|
-
const
|
|
12660
|
+
const out15 = new Uint8Array(n);
|
|
12661
12661
|
let o = 0;
|
|
12662
12662
|
for (const c of chunks) {
|
|
12663
|
-
|
|
12663
|
+
out15.set(c, o);
|
|
12664
12664
|
o += c.length;
|
|
12665
12665
|
}
|
|
12666
|
-
return
|
|
12666
|
+
return out15;
|
|
12667
12667
|
}
|
|
12668
12668
|
function pkt2(payload) {
|
|
12669
12669
|
const body = typeof payload === "string" ? enc6.encode(payload) : payload;
|
|
@@ -13190,13 +13190,13 @@ async function sha256hex2(t2) {
|
|
|
13190
13190
|
function osEntropyBuffer2(n) {
|
|
13191
13191
|
const bytes = new Uint8Array(n * 8);
|
|
13192
13192
|
for (let o = 0; o < bytes.length; o += 65536) crypto.getRandomValues(bytes.subarray(o, Math.min(o + 65536, bytes.length)));
|
|
13193
|
-
const
|
|
13193
|
+
const out15 = new Array(n), T = 2 ** 53;
|
|
13194
13194
|
for (let i = 0; i < n; i++) {
|
|
13195
13195
|
let z6 = 0n;
|
|
13196
13196
|
for (let b = 7; b >= 0; b--) z6 = z6 << 8n | BigInt(bytes[i * 8 + b]);
|
|
13197
|
-
|
|
13197
|
+
out15[i] = Number(z6 >> 11n) / T;
|
|
13198
13198
|
}
|
|
13199
|
-
return
|
|
13199
|
+
return out15;
|
|
13200
13200
|
}
|
|
13201
13201
|
function callProto(ex, operation, STDERR) {
|
|
13202
13202
|
const requestId = `adapter-${++protoRequestSequence2}`;
|
|
@@ -13897,15 +13897,15 @@ function contribution(read, cur) {
|
|
|
13897
13897
|
return { group, value: typeof raw === "number" ? raw : 0 };
|
|
13898
13898
|
}
|
|
13899
13899
|
function contributionDiff(read, before, after) {
|
|
13900
|
-
const
|
|
13900
|
+
const out15 = [];
|
|
13901
13901
|
if (before && after && before.group === after.group) {
|
|
13902
13902
|
const d = after.value - before.value;
|
|
13903
|
-
if (d !== 0)
|
|
13904
|
-
return
|
|
13903
|
+
if (d !== 0) out15.push({ readId: read.id, group: after.group, delta: d });
|
|
13904
|
+
return out15;
|
|
13905
13905
|
}
|
|
13906
|
-
if (before)
|
|
13907
|
-
if (after)
|
|
13908
|
-
return
|
|
13906
|
+
if (before) out15.push({ readId: read.id, group: before.group, delta: -before.value });
|
|
13907
|
+
if (after) out15.push({ readId: read.id, group: after.group, delta: after.value });
|
|
13908
|
+
return out15.filter((d) => d.delta !== 0);
|
|
13909
13909
|
}
|
|
13910
13910
|
function countTenantRows(eng, ws) {
|
|
13911
13911
|
let total = 0;
|
|
@@ -13918,16 +13918,16 @@ async function countTenantRowsByHome(eng, ws, homeKeys) {
|
|
|
13918
13918
|
const keySet = new Set(homeKeys);
|
|
13919
13919
|
const tagOf = /* @__PURE__ */ new Map();
|
|
13920
13920
|
for (const hk of homeKeys) tagOf.set(await routeTagHexOfHomeKey2(hk), hk);
|
|
13921
|
-
const
|
|
13922
|
-
for (const hk of homeKeys)
|
|
13921
|
+
const out15 = /* @__PURE__ */ new Map();
|
|
13922
|
+
for (const hk of homeKeys) out15.set(hk, 0);
|
|
13923
13923
|
for (const type of tenantTypes(eng)) {
|
|
13924
13924
|
for (const r of query2(eng, ws, "aggregatesByType", JSON.stringify({ __type: type }))) {
|
|
13925
13925
|
const id = String(r.id || "");
|
|
13926
13926
|
const hk = keySet.has(id) ? id : tagOf.get(routeTagHexOfMintedId(id) ?? "");
|
|
13927
|
-
if (hk !== void 0)
|
|
13927
|
+
if (hk !== void 0) out15.set(hk, (out15.get(hk) ?? 0) + 1);
|
|
13928
13928
|
}
|
|
13929
13929
|
}
|
|
13930
|
-
return
|
|
13930
|
+
return out15;
|
|
13931
13931
|
}
|
|
13932
13932
|
async function collectHomedIntents(eng, ws, homeKeys) {
|
|
13933
13933
|
const routes = directiveRoutes(eng);
|
|
@@ -13952,7 +13952,7 @@ async function collectHomedIntents(eng, ws, homeKeys) {
|
|
|
13952
13952
|
strikeParity.set(target, (strikeParity.get(target) ?? 0) + 1);
|
|
13953
13953
|
}
|
|
13954
13954
|
}
|
|
13955
|
-
const
|
|
13955
|
+
const out15 = [];
|
|
13956
13956
|
for (const { oid, blob, doc } of docs) {
|
|
13957
13957
|
const id = doc && typeof doc.id === "string" ? doc.id : null;
|
|
13958
13958
|
if (!id || (strikeParity.get(id) ?? 0) % 2 === 1) continue;
|
|
@@ -13968,9 +13968,9 @@ async function collectHomedIntents(eng, ws, homeKeys) {
|
|
|
13968
13968
|
const tag = routeTagHexOfMintedId(value);
|
|
13969
13969
|
homeKey = tag !== void 0 ? tagOf.get(tag) ?? null : null;
|
|
13970
13970
|
}
|
|
13971
|
-
if (homeKey !== null)
|
|
13971
|
+
if (homeKey !== null) out15.push({ oid, id, homeKey, blob });
|
|
13972
13972
|
}
|
|
13973
|
-
return
|
|
13973
|
+
return out15;
|
|
13974
13974
|
}
|
|
13975
13975
|
async function migrateHomes(eng, ws, ledger, sourceWs, homeKeys, { onlyIds = null } = {}) {
|
|
13976
13976
|
const wanted = onlyIds ? new Set(onlyIds) : null;
|
|
@@ -14079,7 +14079,7 @@ async function collectGlobalIntents(eng, ws) {
|
|
|
14079
14079
|
strikeParity.set(target, (strikeParity.get(target) ?? 0) + 1);
|
|
14080
14080
|
}
|
|
14081
14081
|
}
|
|
14082
|
-
const
|
|
14082
|
+
const out15 = [];
|
|
14083
14083
|
for (const { oid, blob, doc } of docs) {
|
|
14084
14084
|
const id = doc && typeof doc.id === "string" ? doc.id : null;
|
|
14085
14085
|
let touches = false;
|
|
@@ -14090,9 +14090,9 @@ async function collectGlobalIntents(eng, ws) {
|
|
|
14090
14090
|
if (t2 !== void 0 && globals.has(t2)) touches = true;
|
|
14091
14091
|
}
|
|
14092
14092
|
if (!touches || !id || (strikeParity.get(id) ?? 0) % 2 === 1) continue;
|
|
14093
|
-
|
|
14093
|
+
out15.push({ oid, id, blob });
|
|
14094
14094
|
}
|
|
14095
|
-
return
|
|
14095
|
+
return out15;
|
|
14096
14096
|
}
|
|
14097
14097
|
async function replicateIntents(eng, ws, ledger, intents, { push = true } = {}) {
|
|
14098
14098
|
const main2 = await mainIntentIds(eng, ws);
|
|
@@ -14558,8 +14558,8 @@ function stageLawClosure(eng, lawUsdz, label = "candidate-law") {
|
|
|
14558
14558
|
}, "lawClosureInfo");
|
|
14559
14559
|
}
|
|
14560
14560
|
function currentLaw(eng, ws) {
|
|
14561
|
-
const
|
|
14562
|
-
return
|
|
14561
|
+
const out15 = namedQueryProto(eng, ws, QueryOperation3.CURRENT_LAW);
|
|
14562
|
+
return out15.keyMap || {};
|
|
14563
14563
|
}
|
|
14564
14564
|
function installedLaw(eng, ws) {
|
|
14565
14565
|
return namedQueryProto(eng, ws, QueryOperation3.INSTALLED_LAW);
|
|
@@ -14588,8 +14588,8 @@ function kernelResource(eng, ws) {
|
|
|
14588
14588
|
return response.outcome.value.result.value;
|
|
14589
14589
|
}
|
|
14590
14590
|
function declaredCapabilities(eng, ws) {
|
|
14591
|
-
const
|
|
14592
|
-
return
|
|
14591
|
+
const out15 = namedQueryProto(eng, ws, QueryOperation3.DECLARED_CAPABILITIES);
|
|
14592
|
+
return out15.capabilities || [];
|
|
14593
14593
|
}
|
|
14594
14594
|
function outboundOffers(eng, ws, nowMillis = Date.now()) {
|
|
14595
14595
|
const response = callProto(eng.ex, {
|
|
@@ -14630,8 +14630,8 @@ function evolveDryRun(eng, ws, lawUsdz, domainHash, dispositions2 = null) {
|
|
|
14630
14630
|
return r.ok ? { admits: true } : { admits: false, detail: r.error };
|
|
14631
14631
|
}
|
|
14632
14632
|
function mintId(eng, typeTag) {
|
|
14633
|
-
const
|
|
14634
|
-
return
|
|
14633
|
+
const out15 = namedQueryProto(eng, "root", QueryOperation3.MINT, { typeTag, nowMillis: Date.now() });
|
|
14634
|
+
return out15.id;
|
|
14635
14635
|
}
|
|
14636
14636
|
function author(eng, ws, domain, directiveId, payload, controllerHash, opts = {}) {
|
|
14637
14637
|
const seq = eng.seq++;
|
|
@@ -14856,13 +14856,13 @@ async function streamAll(stream) {
|
|
|
14856
14856
|
}
|
|
14857
14857
|
let len = 0;
|
|
14858
14858
|
for (const c of chunks) len += c.length;
|
|
14859
|
-
const
|
|
14859
|
+
const out15 = new Uint8Array(len);
|
|
14860
14860
|
let at = 0;
|
|
14861
14861
|
for (const c of chunks) {
|
|
14862
|
-
|
|
14862
|
+
out15.set(c, at);
|
|
14863
14863
|
at += c.length;
|
|
14864
14864
|
}
|
|
14865
|
-
return
|
|
14865
|
+
return out15;
|
|
14866
14866
|
}
|
|
14867
14867
|
async function gzip(bytes) {
|
|
14868
14868
|
const cs = new CompressionStream("gzip");
|
|
@@ -16194,7 +16194,7 @@ async function writeRefusedRef(eng, ws, dl) {
|
|
|
16194
16194
|
async function listRefusedRefs(eng, ws) {
|
|
16195
16195
|
const gitdir = gitdirOf(ws);
|
|
16196
16196
|
const refs = kgit.listRefs(eng, gitdir, "refs/heads/refused/");
|
|
16197
|
-
const
|
|
16197
|
+
const out15 = [];
|
|
16198
16198
|
for (const { ref, oid } of refs) {
|
|
16199
16199
|
try {
|
|
16200
16200
|
const vb = kgit.readBlob(eng, gitdir, oid, "verdict.usda") ?? new Uint8Array();
|
|
@@ -16206,7 +16206,7 @@ async function listRefusedRefs(eng, ws) {
|
|
|
16206
16206
|
law = null;
|
|
16207
16207
|
}
|
|
16208
16208
|
const v = kgit.inspectRefusalVerdict(eng, vb);
|
|
16209
|
-
|
|
16209
|
+
out15.push({
|
|
16210
16210
|
ref,
|
|
16211
16211
|
...v,
|
|
16212
16212
|
verdict: { reason: v.reason },
|
|
@@ -16216,7 +16216,7 @@ async function listRefusedRefs(eng, ws) {
|
|
|
16216
16216
|
} catch {
|
|
16217
16217
|
}
|
|
16218
16218
|
}
|
|
16219
|
-
return
|
|
16219
|
+
return out15;
|
|
16220
16220
|
}
|
|
16221
16221
|
async function refusedSummary(eng, ws) {
|
|
16222
16222
|
const gitdir = gitdirOf(ws);
|
|
@@ -16355,9 +16355,9 @@ async function ledgerStats(eng, ws, ledger = null) {
|
|
|
16355
16355
|
const mounted = eng.mounted.get(ws);
|
|
16356
16356
|
if (mounted && mounted.ledgerStats?.head === head) return mounted.ledgerStats;
|
|
16357
16357
|
const commits = kgit.intentsAbove(eng, gitdir, head).length;
|
|
16358
|
-
const
|
|
16359
|
-
if (mounted) mounted.ledgerStats =
|
|
16360
|
-
return
|
|
16358
|
+
const out15 = { head, commits };
|
|
16359
|
+
if (mounted) mounted.ledgerStats = out15;
|
|
16360
|
+
return out15;
|
|
16361
16361
|
}
|
|
16362
16362
|
async function countRemoteCommits(eng, ledger) {
|
|
16363
16363
|
const head = (await custodyLsRefs(ledger, "refs/heads/main"))["refs/heads/main"] || null;
|
|
@@ -17354,6 +17354,7 @@ __export(governance_exports, {
|
|
|
17354
17354
|
ROOT_CUSTODIAN_SECRET: () => ROOT_CUSTODIAN_SECRET,
|
|
17355
17355
|
STAGE_THRESHOLD_CHARS: () => STAGE_THRESHOLD_CHARS,
|
|
17356
17356
|
adoptRootModelLifecycle: () => adoptRootModelLifecycle,
|
|
17357
|
+
adoptWorkspaceModel: () => adoptWorkspaceModel,
|
|
17357
17358
|
buildCertificate: () => buildCertificate,
|
|
17358
17359
|
buildRebirthPlan: () => buildRebirthPlan,
|
|
17359
17360
|
canonicalPrincipal: () => canonicalPrincipal2,
|
|
@@ -17549,6 +17550,41 @@ async function adoptRootModelLifecycle(candidateHash, opts, acceptance) {
|
|
|
17549
17550
|
const ok = sync.pushFailed !== true && sync.offline !== true && admission?.ok === true && rejected.length === 0;
|
|
17550
17551
|
return { ok, adoption, sync };
|
|
17551
17552
|
}
|
|
17553
|
+
async function adoptWorkspaceModel(workspace, domain, candidateHash, opts, acceptance) {
|
|
17554
|
+
const cloud = cloudBase(opts.cloud);
|
|
17555
|
+
const principal = resolveGovernancePrincipal(opts);
|
|
17556
|
+
const device = getDeviceKey(principal);
|
|
17557
|
+
if (device === void 0) {
|
|
17558
|
+
throw new Error(
|
|
17559
|
+
`no signing device is stored for '${principal}' \u2014 use githolon key import/enroll before adopting a model`
|
|
17560
|
+
);
|
|
17561
|
+
}
|
|
17562
|
+
const connect2 = await clientConnect();
|
|
17563
|
+
const holon = await connect2({
|
|
17564
|
+
cloud,
|
|
17565
|
+
workspace,
|
|
17566
|
+
clientId: `githolon-model-adopt-${Date.now().toString(16)}`,
|
|
17567
|
+
principal: canonicalPrincipal2(principal),
|
|
17568
|
+
authorSecret: device.secret
|
|
17569
|
+
});
|
|
17570
|
+
try {
|
|
17571
|
+
if (typeof holon.__nomosAdoptModel !== "function") {
|
|
17572
|
+
throw new Error("the installed @githolon/client has no typed model-adoption surface");
|
|
17573
|
+
}
|
|
17574
|
+
const adoption = await holon.__nomosAdoptModel(domain, candidateHash, acceptance);
|
|
17575
|
+
if (adoption.ok !== true) return { ok: false, adoption };
|
|
17576
|
+
if (typeof holon.sync !== "function") {
|
|
17577
|
+
throw new Error("the installed @githolon/client cannot synchronize the adopted model");
|
|
17578
|
+
}
|
|
17579
|
+
const sync = await holon.sync({ admit: true, discoverRemote: true });
|
|
17580
|
+
const admission = sync.admission;
|
|
17581
|
+
const rejected = (admission?.sessions ?? []).flatMap((session) => session.rejected ?? []);
|
|
17582
|
+
const ok = sync.pushFailed !== true && sync.offline !== true && admission?.ok === true && rejected.length === 0;
|
|
17583
|
+
return { ok, adoption, sync };
|
|
17584
|
+
} finally {
|
|
17585
|
+
holon._dispose?.();
|
|
17586
|
+
}
|
|
17587
|
+
}
|
|
17552
17588
|
async function signAndPostPreparedOffer(ws, domain, prepare, opts, authorMode = "account", preferActor, lawUsdz, birthCertificate, explicitAuthority) {
|
|
17553
17589
|
const cloud = cloudBase(opts.cloud);
|
|
17554
17590
|
const principal = explicitAuthority?.actor ?? resolveGovernancePrincipal(opts);
|
|
@@ -20295,7 +20331,7 @@ async function deployPackage(ws, opts, file, placement) {
|
|
|
20295
20331
|
(installed) => installed.domainHash === targetHash && installed.phase === "Pending" /* Pending */
|
|
20296
20332
|
)) {
|
|
20297
20333
|
out4(`\u2713 ${fileName} is already staged on ${ws} (${targetHash.slice(0, 16)}\u2026 pending)`);
|
|
20298
|
-
out4(" the
|
|
20334
|
+
out4(" the model lifecycle owns review and adoption; no second offer was submitted");
|
|
20299
20335
|
return 0;
|
|
20300
20336
|
}
|
|
20301
20337
|
if ((plan?.predecessorCandidates.length ?? 0) > 1) {
|
|
@@ -20361,7 +20397,7 @@ async function deployPackage(ws, opts, file, placement) {
|
|
|
20361
20397
|
out4(`\u2713 staged ${fileName} \u2192 ${ws} (pending)`);
|
|
20362
20398
|
if (plan?.supersedes) out4(` current model ${plan.supersedes.slice(0, 16)}\u2026 keeps serving`);
|
|
20363
20399
|
out4(` candidate ${deployedHash.slice(0, 16)}\u2026 is in custody but cannot serve yet`);
|
|
20364
|
-
out4(` next:
|
|
20400
|
+
out4(` next: githolon model adopt ${ws} --domain <candidate-home-domain> --file ${file}`);
|
|
20365
20401
|
return 0;
|
|
20366
20402
|
}
|
|
20367
20403
|
if (deployedHash !== void 0 && isCurrent) {
|
|
@@ -21237,22 +21273,22 @@ async function doctor(opts = {}) {
|
|
|
21237
21273
|
const cloud = cloudBase(opts.cloud);
|
|
21238
21274
|
const localLaw = await readLocalLaw(process.cwd(), cloud, opts.file);
|
|
21239
21275
|
const report = await probeKernelCapabilities(cloud);
|
|
21240
|
-
const
|
|
21241
|
-
|
|
21242
|
-
|
|
21243
|
-
|
|
21244
|
-
|
|
21245
|
-
|
|
21276
|
+
const out15 = [];
|
|
21277
|
+
out15.push(`githolon doctor \u2014 release coherence`);
|
|
21278
|
+
out15.push(` cloud : ${cloud}`);
|
|
21279
|
+
out15.push(` local law : ${localLaw ? `${localLaw.identity.slice(0, 16)}\u2026 (${localLaw.domains.join(", ") || "no domains"})` : "(not admitted \u2014 run `githolon compile` or inspect the error with `githolon deploy`)"}`);
|
|
21280
|
+
out15.push(stampLine("prod kernel", report?.prod));
|
|
21281
|
+
out15.push(stampLine("test kernel", report?.testmint));
|
|
21246
21282
|
if (!localLaw) {
|
|
21247
|
-
|
|
21248
|
-
|
|
21249
|
-
process.stdout.write(
|
|
21283
|
+
out15.push(``);
|
|
21284
|
+
out15.push(` \u26A0 no local build found \u2014 cannot check the law\u2194kernel fit. Run \`githolon compile\` first.`);
|
|
21285
|
+
process.stdout.write(out15.join("\n") + "\n");
|
|
21250
21286
|
return report ? 0 : 1;
|
|
21251
21287
|
}
|
|
21252
|
-
|
|
21253
|
-
|
|
21254
|
-
|
|
21255
|
-
process.stdout.write(
|
|
21288
|
+
out15.push(``);
|
|
21289
|
+
out15.push(` \u2713 ARCHIVE COHERENT \u2014 the selected kernel admitted and composed ${localLaw.identity.slice(0, 16)}\u2026 directly from typed USDA.`);
|
|
21290
|
+
out15.push(` Full schema/projection compatibility is enforced again by the ordinary install offer.`);
|
|
21291
|
+
process.stdout.write(out15.join("\n") + "\n");
|
|
21256
21292
|
return 0;
|
|
21257
21293
|
}
|
|
21258
21294
|
var init_doctor = __esm({
|
|
@@ -21681,11 +21717,11 @@ function bareTypeLabel(t2) {
|
|
|
21681
21717
|
return i > 0 && i < t2.length - 1 ? t2.slice(i + 1) : t2;
|
|
21682
21718
|
}
|
|
21683
21719
|
function geoFieldsOfInstalls(installs) {
|
|
21684
|
-
const
|
|
21720
|
+
const out15 = /* @__PURE__ */ new Map();
|
|
21685
21721
|
const add2 = (type, field) => {
|
|
21686
|
-
const set2 =
|
|
21722
|
+
const set2 = out15.get(type) ?? /* @__PURE__ */ new Set();
|
|
21687
21723
|
set2.add(field);
|
|
21688
|
-
|
|
21724
|
+
out15.set(type, set2);
|
|
21689
21725
|
};
|
|
21690
21726
|
for (const inst of installs) {
|
|
21691
21727
|
for (const layer of inst.layers) {
|
|
@@ -21701,7 +21737,7 @@ function geoFieldsOfInstalls(installs) {
|
|
|
21701
21737
|
}
|
|
21702
21738
|
}
|
|
21703
21739
|
}
|
|
21704
|
-
return
|
|
21740
|
+
return out15;
|
|
21705
21741
|
}
|
|
21706
21742
|
function pointOfOpValue(setOp) {
|
|
21707
21743
|
let v = setOp["Json"];
|
|
@@ -22453,6 +22489,126 @@ var init_scene = __esm({
|
|
|
22453
22489
|
}
|
|
22454
22490
|
});
|
|
22455
22491
|
|
|
22492
|
+
// src/model.ts
|
|
22493
|
+
var model_exports = {};
|
|
22494
|
+
__export(model_exports, {
|
|
22495
|
+
modelAdopt: () => modelAdopt
|
|
22496
|
+
});
|
|
22497
|
+
function domainInventory(value) {
|
|
22498
|
+
if (typeof value !== "object" || value === null) throw new Error("domain inventory is not an object");
|
|
22499
|
+
const row = value;
|
|
22500
|
+
if (row.ok !== true || !Array.isArray(row.domains) || typeof row.currentLaw !== "object" || row.currentLaw === null) {
|
|
22501
|
+
throw new Error("domain inventory has no typed lifecycle projection");
|
|
22502
|
+
}
|
|
22503
|
+
const domains = row.domains.map((candidate) => {
|
|
22504
|
+
if (typeof candidate !== "object" || candidate === null) throw new Error("domain inventory contains a non-record installation");
|
|
22505
|
+
const install = candidate;
|
|
22506
|
+
if (typeof install.domainHash !== "string" || typeof install.phase !== "string" || !Array.isArray(install.domainKeys) || !install.domainKeys.every((key2) => typeof key2 === "string")) {
|
|
22507
|
+
throw new Error("domain inventory contains an invalid installation record");
|
|
22508
|
+
}
|
|
22509
|
+
return { domainHash: install.domainHash, phase: install.phase, domainKeys: install.domainKeys };
|
|
22510
|
+
});
|
|
22511
|
+
const currentLaw2 = Object.fromEntries(Object.entries(row.currentLaw).map(([key2, hash]) => {
|
|
22512
|
+
if (typeof hash !== "string") throw new Error(`domain inventory has a non-string current law for '${key2}'`);
|
|
22513
|
+
return [key2, hash];
|
|
22514
|
+
}));
|
|
22515
|
+
return { ok: true, domains, currentLaw: currentLaw2 };
|
|
22516
|
+
}
|
|
22517
|
+
async function modelAdopt(workspace, opts) {
|
|
22518
|
+
const cloud = cloudBase(opts.cloud);
|
|
22519
|
+
let file;
|
|
22520
|
+
let identity;
|
|
22521
|
+
let domainKeys;
|
|
22522
|
+
try {
|
|
22523
|
+
file = discoverLawUsdz(process.cwd(), opts.file);
|
|
22524
|
+
const { eng } = await holonEngine(cloud, "githolon-model-adopt-inspect");
|
|
22525
|
+
const inspected = inspectLawArchive(eng, file);
|
|
22526
|
+
identity = inspected.identity;
|
|
22527
|
+
domainKeys = inspected.domainKeys;
|
|
22528
|
+
} catch (cause) {
|
|
22529
|
+
err13(`could not derive the candidate from typed USDA: ${cause.message}`);
|
|
22530
|
+
return 1;
|
|
22531
|
+
}
|
|
22532
|
+
if (!domainKeys.includes(opts.domain)) {
|
|
22533
|
+
err13(`candidate ${identity.slice(0, 16)}\u2026 does not contain domain '${opts.domain}' (${domainKeys.join(", ")})`);
|
|
22534
|
+
return 1;
|
|
22535
|
+
}
|
|
22536
|
+
out13(`candidate ${identity} (kernel-derived from ${file})`);
|
|
22537
|
+
out13(`workspace ${workspace} on ${cloud}`);
|
|
22538
|
+
out13(`domain ${opts.domain}`);
|
|
22539
|
+
const startedAt = Date.now();
|
|
22540
|
+
const heartbeat = setInterval(() => {
|
|
22541
|
+
const elapsed = Math.round((Date.now() - startedAt) / 1e3);
|
|
22542
|
+
out13(` ${elapsed}s \u2014 verifying current history and preparing the signed lifecycle decision\u2026`);
|
|
22543
|
+
}, 5e3);
|
|
22544
|
+
heartbeat.unref();
|
|
22545
|
+
try {
|
|
22546
|
+
const result = await adoptWorkspaceModel(
|
|
22547
|
+
workspace,
|
|
22548
|
+
opts.domain,
|
|
22549
|
+
sha256Digest().parse(identity),
|
|
22550
|
+
opts,
|
|
22551
|
+
opts.because === void 0 ? void 0 : { because: opts.because }
|
|
22552
|
+
);
|
|
22553
|
+
if (!result.ok) {
|
|
22554
|
+
const stage = typeof result.adoption.stage === "string" ? result.adoption.stage : "refused";
|
|
22555
|
+
const message = typeof result.adoption.error === "string" ? result.adoption.error : "the candidate remained unchanged";
|
|
22556
|
+
err13(`model adoption ${stage}: ${message}`);
|
|
22557
|
+
const report = result.adoption.report;
|
|
22558
|
+
if (typeof report === "object" && report !== null) {
|
|
22559
|
+
const r = report;
|
|
22560
|
+
out13(` history replayed=${String(r.replayedIntents ?? "?")} candidate=${String(r.candidateIntents ?? "?")}`);
|
|
22561
|
+
out13(` evidence sourceVerified=${String(r.sourceVerified ?? "?")} complete=${String(r.complete ?? "?")}`);
|
|
22562
|
+
}
|
|
22563
|
+
if (stage === "acceptance" && opts.because === void 0) {
|
|
22564
|
+
out13(" next: review the reported divergence, then repeat with --because <accountable business reason>");
|
|
22565
|
+
}
|
|
22566
|
+
return 2;
|
|
22567
|
+
}
|
|
22568
|
+
let inventory;
|
|
22569
|
+
const deadline = Date.now() + 3e4;
|
|
22570
|
+
do {
|
|
22571
|
+
const response = await fetch(`${cloud}/v2/workspaces/${encodeURIComponent(workspace)}/domains`);
|
|
22572
|
+
if (!response.ok) throw new Error(`domain inventory returned ${response.status}`);
|
|
22573
|
+
const observed = domainInventory(await response.json());
|
|
22574
|
+
const candidate2 = observed.domains.find((installed) => installed.domainHash === identity);
|
|
22575
|
+
const keys2 = candidate2?.domainKeys ?? domainKeys;
|
|
22576
|
+
if (candidate2?.phase === "Active" && keys2.every((key2) => observed.currentLaw[key2] === identity)) {
|
|
22577
|
+
inventory = observed;
|
|
22578
|
+
break;
|
|
22579
|
+
}
|
|
22580
|
+
await new Promise((resolve8) => setTimeout(resolve8, 250));
|
|
22581
|
+
} while (Date.now() < deadline);
|
|
22582
|
+
if (inventory === void 0) throw new Error("the active-law projection did not converge within 30 seconds");
|
|
22583
|
+
const candidate = inventory.domains.find((installed) => installed.domainHash === identity);
|
|
22584
|
+
const keys = candidate?.domainKeys ?? domainKeys;
|
|
22585
|
+
const drift = keys.filter((key2) => inventory.currentLaw[key2] !== identity);
|
|
22586
|
+
if (candidate?.phase !== "Active" || drift.length > 0) {
|
|
22587
|
+
err13(`adoption synced but ${identity} is not current for ${drift.join(", ") || "its declared domain keys"}`);
|
|
22588
|
+
return 1;
|
|
22589
|
+
}
|
|
22590
|
+
out13(`\u2713 adopted ${identity} across ${keys.length} domain key${keys.length === 1 ? "" : "s"} in ${Date.now() - startedAt} ms`);
|
|
22591
|
+
return 0;
|
|
22592
|
+
} catch (cause) {
|
|
22593
|
+
err13(cause.message);
|
|
22594
|
+
return 1;
|
|
22595
|
+
} finally {
|
|
22596
|
+
clearInterval(heartbeat);
|
|
22597
|
+
}
|
|
22598
|
+
}
|
|
22599
|
+
var out13, err13;
|
|
22600
|
+
var init_model = __esm({
|
|
22601
|
+
"src/model.ts"() {
|
|
22602
|
+
"use strict";
|
|
22603
|
+
init_src();
|
|
22604
|
+
init_cloud();
|
|
22605
|
+
init_governance();
|
|
22606
|
+
init_local_holon();
|
|
22607
|
+
out13 = (line) => void process.stdout.write(line + "\n");
|
|
22608
|
+
err13 = (line) => void process.stderr.write("error: " + line + "\n");
|
|
22609
|
+
}
|
|
22610
|
+
});
|
|
22611
|
+
|
|
22456
22612
|
// src/dlq.ts
|
|
22457
22613
|
var dlq_exports = {};
|
|
22458
22614
|
__export(dlq_exports, {
|
|
@@ -22482,33 +22638,33 @@ async function dlqSweep(ws, opts = {}) {
|
|
|
22482
22638
|
const res = await fetch(url);
|
|
22483
22639
|
body = await res.json();
|
|
22484
22640
|
if (body.ok !== true || body.root === void 0) {
|
|
22485
|
-
|
|
22641
|
+
err14(`dlq sweep refused: ${String(body.error ?? "no sweep in the response").slice(0, 300)}`);
|
|
22486
22642
|
return 1;
|
|
22487
22643
|
}
|
|
22488
22644
|
} catch (e) {
|
|
22489
|
-
|
|
22645
|
+
err14(`dlq sweep failed against ${cloud}: ${e.message}`);
|
|
22490
22646
|
return 1;
|
|
22491
22647
|
}
|
|
22492
22648
|
if (opts.json === true) {
|
|
22493
|
-
|
|
22649
|
+
out14(JSON.stringify(body, null, 2));
|
|
22494
22650
|
return body.jammed ? 2 : 0;
|
|
22495
22651
|
}
|
|
22496
|
-
|
|
22497
|
-
for (const line of renderSweepNode(body.root))
|
|
22652
|
+
out14(`DLQ sweep of '${ws}' \u2014 ${body.nodes} node(s), ${body.jammed} jammed`);
|
|
22653
|
+
for (const line of renderSweepNode(body.root)) out14(line);
|
|
22498
22654
|
if (body.jammed) {
|
|
22499
|
-
|
|
22500
|
-
|
|
22501
|
-
|
|
22655
|
+
out14("");
|
|
22656
|
+
out14("unjam: fix/deploy the law on the jammed workspace, then POST /v2/workspaces/<node>/dead-letters/retry");
|
|
22657
|
+
out14(" (or from the app: holon.retryDeadLetter(id); discard is the app's explicit choice)");
|
|
22502
22658
|
}
|
|
22503
22659
|
return body.jammed ? 2 : 0;
|
|
22504
22660
|
}
|
|
22505
|
-
var
|
|
22661
|
+
var out14, err14;
|
|
22506
22662
|
var init_dlq = __esm({
|
|
22507
22663
|
"src/dlq.ts"() {
|
|
22508
22664
|
"use strict";
|
|
22509
22665
|
init_cloud();
|
|
22510
|
-
|
|
22511
|
-
|
|
22666
|
+
out14 = (s) => void process.stdout.write(s + "\n");
|
|
22667
|
+
err14 = (s) => void process.stderr.write("error: " + s + "\n");
|
|
22512
22668
|
}
|
|
22513
22669
|
});
|
|
22514
22670
|
|
|
@@ -25298,7 +25454,7 @@ var HELP = {
|
|
|
25298
25454
|
},
|
|
25299
25455
|
deploy: {
|
|
25300
25456
|
usage: "githolon deploy [<ws>] [--as <uid>] [--parent <ws>] [--file <application.usda|law.usdz>] [--cloud <url>] [--target <name>]\n provider handover: --auth-provider-issuer <url> --auth-provider-jwks-file <path> --auth-provider-jwks-url <url> --auth-provider-audience <aud> --auth-provider-principal-claim <claim> --auth-provider-device-binding-claim <claim>",
|
|
25301
|
-
what: "Deploy the compiled application from its OpenUSD composition. Reference-only packages serve on\nthe application workspace; payload packages are staged for child birth and never made current there.\nFor a one-package project, the compiled law archive is the shorthand. There is one model lifecycle:\nthe first serving model becomes active; a successor stays Pending while the current model keeps serving,\nand the generated
|
|
25457
|
+
what: "Deploy the compiled application from its OpenUSD composition. Reference-only packages serve on\nthe application workspace; payload packages are staged for child birth and never made current there.\nFor a one-package project, the compiled law archive is the shorthand. There is one model lifecycle:\nthe first serving model becomes active; a successor stays Pending while the current model keeps serving,\nand exact-history adoption is driven by the generated client or `githolon model adopt`. Re-deploying the\nsame content hash is idempotent. With no <ws>, the project's workspace binding resolves it.",
|
|
25302
25458
|
flags: [
|
|
25303
25459
|
["--as <uid>", "attribute the deployment to this principal (needs its enrolled signing key)"],
|
|
25304
25460
|
["--parent <ws>", "birth an unborn application directly below this parent; existing lineage must match"],
|
|
@@ -25316,6 +25472,18 @@ var HELP = {
|
|
|
25316
25472
|
],
|
|
25317
25473
|
examples: ["githolon deploy", "githolon deploy my-guestbook", "githolon deploy co2-platform --as <admin-uid>"]
|
|
25318
25474
|
},
|
|
25475
|
+
model: {
|
|
25476
|
+
usage: "githolon model adopt [<workspace>] --domain <domain> [--file <law.usdz>] [--because <reason>] [--as <uid>] [--cloud <url>]",
|
|
25477
|
+
what: "Adopt one already-staged application model. The kernel derives the candidate identity directly\nfrom the compiled OpenUSD closure, replays current history under the lifecycle gate, and the selected\nworkspace principal signs the resulting decision. Nothing is promoted when proof or synchronization fails.",
|
|
25478
|
+
flags: [
|
|
25479
|
+
["--domain <domain>", "a domain key carried by the candidate; required so tooling never guesses the application root"],
|
|
25480
|
+
["--file <path>", "the exact compiled .law.usdz candidate (default: the single build/*.law.usdz)"],
|
|
25481
|
+
["--because <reason>", "explicitly accept an intentional historical outcome change; omitted for equivalent evolution"],
|
|
25482
|
+
["--as <uid>", "sign as this stored workspace principal"],
|
|
25483
|
+
["--cloud <url>", "target cloud"]
|
|
25484
|
+
],
|
|
25485
|
+
examples: ["githolon model adopt --domain home", "githolon model adopt co2-platform --domain home --file build/co2.law.usdz"]
|
|
25486
|
+
},
|
|
25319
25487
|
domains: {
|
|
25320
25488
|
usage: "githolon domains <status <ws> [--explain-current-interface] | retire <ws> <hashOrKey> [--with <hashOrKey>]>",
|
|
25321
25489
|
what: "Framework lifecycle inspection and explicit withdrawal.\n\u2022 status: per domain KEY, the active hash, then the superseded/retired lineage behind it.\n Lifecycle vocabulary: active = served now; superseded = replaced by a newer install for the same domain\n key, replayable, not served; retired = explicitly withdrawn, replayable, not served.\n --explain-current-interface spells out why active reads/dispatch use only that active map.\n\u2022 retire: mark an install Retired via a signed installDomain offer. The framework retires only as the\n consequence of installing a SUCCESSOR \u2014 by default the local compiled law (build/*.law.usdz),\n or --with <hashOrKey> names an already-installed successor. A key the successor does not cover is left\n with NO active law \u2014 WARNED loudly, never blocked. A key resolves to its active hash; a 64-hex arg is\n taken as the install hash.",
|
|
@@ -25465,9 +25633,9 @@ function capJsonStrings(v, max = 2048) {
|
|
|
25465
25633
|
if (typeof v === "string") return v.length > max ? `${v.slice(0, max)}\u2026(${v.length} chars)` : v;
|
|
25466
25634
|
if (Array.isArray(v)) return v.map((x) => capJsonStrings(x, max));
|
|
25467
25635
|
if (typeof v === "object" && v !== null) {
|
|
25468
|
-
const
|
|
25469
|
-
for (const [k, x] of Object.entries(v))
|
|
25470
|
-
return
|
|
25636
|
+
const out15 = {};
|
|
25637
|
+
for (const [k, x] of Object.entries(v)) out15[k] = capJsonStrings(x, max);
|
|
25638
|
+
return out15;
|
|
25471
25639
|
}
|
|
25472
25640
|
return v;
|
|
25473
25641
|
}
|
|
@@ -26130,7 +26298,7 @@ Options:
|
|
|
26130
26298
|
function cloudArgs(rest) {
|
|
26131
26299
|
const pos = [];
|
|
26132
26300
|
const opts = {};
|
|
26133
|
-
const VALUE_FLAGS = ["--cloud", "--principal", "--as", "--file", "--target", "--parent", "--via", "--max", "--pool", "--label", "--secret", "--payload", "--payload-file", "--save", "--format", "--with", "--out", "--reason", "--oid", "--seed-secret", "--gcp-secret", "--auth-provider-issuer", "--auth-provider-jwks-file", "--auth-provider-jwks-url", "--auth-provider-audience", "--auth-provider-principal-claim", "--auth-provider-device-binding-claim", "--controller-hash", "--plan", "--depth", "--domain", "--directive"];
|
|
26301
|
+
const VALUE_FLAGS = ["--cloud", "--principal", "--as", "--file", "--target", "--parent", "--via", "--max", "--pool", "--label", "--secret", "--payload", "--payload-file", "--save", "--format", "--with", "--out", "--reason", "--because", "--oid", "--seed-secret", "--gcp-secret", "--auth-provider-issuer", "--auth-provider-jwks-file", "--auth-provider-jwks-url", "--auth-provider-audience", "--auth-provider-principal-claim", "--auth-provider-device-binding-claim", "--controller-hash", "--plan", "--depth", "--domain", "--directive"];
|
|
26134
26302
|
const BOOL_FLAGS = ["--sha256", "--stamp", "--yes", "--clear", "--explain-current-interface", "--dry-run", "--json", "--full"];
|
|
26135
26303
|
for (let i = 0; i < rest.length; i++) {
|
|
26136
26304
|
const a = rest[i];
|
|
@@ -26172,6 +26340,7 @@ function cloudArgs(rest) {
|
|
|
26172
26340
|
else if (a === "--with") opts.with = v;
|
|
26173
26341
|
else if (a === "--domain") opts.domain = v;
|
|
26174
26342
|
else if (a === "--directive") opts.directive = v;
|
|
26343
|
+
else if (a === "--because") opts.because = v;
|
|
26175
26344
|
else if (a === "--out") opts.out = v;
|
|
26176
26345
|
else if (a === "--max") {
|
|
26177
26346
|
const n = Number(v);
|
|
@@ -26607,10 +26776,10 @@ async function main(argv) {
|
|
|
26607
26776
|
};
|
|
26608
26777
|
const lawArg = pull("--law");
|
|
26609
26778
|
const workspace = pull("--workspace") ?? "test-ws";
|
|
26610
|
-
const
|
|
26779
|
+
const out15 = pull("--out");
|
|
26611
26780
|
const runtime = pull("--runtime");
|
|
26612
26781
|
const law = (lawArg ?? "").split(",").map((s) => s.trim()).filter(Boolean);
|
|
26613
|
-
if (law.length === 0 ||
|
|
26782
|
+
if (law.length === 0 || out15 === void 0) {
|
|
26614
26783
|
process.stderr.write(
|
|
26615
26784
|
`error: usage: githolon harness-install --law <law.usdz[,law.usdz...]> --workspace <ws> --out <snapshotPath> [--runtime <dir>]
|
|
26616
26785
|
`
|
|
@@ -26618,7 +26787,7 @@ async function main(argv) {
|
|
|
26618
26787
|
return 1;
|
|
26619
26788
|
}
|
|
26620
26789
|
const { harnessInstall: harnessInstall2 } = await Promise.resolve().then(() => (init_harness(), harness_exports));
|
|
26621
|
-
return harnessInstall2({ law, workspace, out:
|
|
26790
|
+
return harnessInstall2({ law, workspace, out: out15, ...runtime !== void 0 ? { runtime } : {} });
|
|
26622
26791
|
}
|
|
26623
26792
|
if (argv[0] === "dev") {
|
|
26624
26793
|
const rest = argv.slice(1);
|
|
@@ -26788,6 +26957,31 @@ ${commandHelp("status")}`);
|
|
|
26788
26957
|
}
|
|
26789
26958
|
return status(pos[0], opts);
|
|
26790
26959
|
}
|
|
26960
|
+
if (argv[0] === "model") {
|
|
26961
|
+
const { pos, opts, bad } = cloudArgs(argv.slice(1));
|
|
26962
|
+
if (bad !== void 0) {
|
|
26963
|
+
process.stderr.write(`error: ${bad}
|
|
26964
|
+
|
|
26965
|
+
${commandHelp("model") ?? USAGE}`);
|
|
26966
|
+
return 1;
|
|
26967
|
+
}
|
|
26968
|
+
const [sub2, explicitWorkspace] = pos;
|
|
26969
|
+
if (sub2 !== "adopt" || opts.domain === void 0) {
|
|
26970
|
+
process.stderr.write(`error: expected: githolon model adopt [<workspace>] --domain <domain> [--file <law.usdz>] [--because <reason>]
|
|
26971
|
+
|
|
26972
|
+
${commandHelp("model") ?? USAGE}`);
|
|
26973
|
+
return 1;
|
|
26974
|
+
}
|
|
26975
|
+
try {
|
|
26976
|
+
const workspace = await resolveWorkspace(explicitWorkspace, process.cwd(), opts.target, "githolon model adopt <workspace>");
|
|
26977
|
+
const { modelAdopt: modelAdopt2 } = await Promise.resolve().then(() => (init_model(), model_exports));
|
|
26978
|
+
return modelAdopt2(workspace, { ...opts, domain: opts.domain, ...opts.because === void 0 ? {} : { because: opts.because } });
|
|
26979
|
+
} catch (cause) {
|
|
26980
|
+
process.stderr.write(`error: ${cause.message}
|
|
26981
|
+
`);
|
|
26982
|
+
return 1;
|
|
26983
|
+
}
|
|
26984
|
+
}
|
|
26791
26985
|
if (argv[0] === "ws" && argv[1] === "create") {
|
|
26792
26986
|
process.stderr.write(
|
|
26793
26987
|
"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"
|
|
@@ -27141,8 +27335,8 @@ ${USAGE}`);
|
|
|
27141
27335
|
let parsed;
|
|
27142
27336
|
try {
|
|
27143
27337
|
parsed = parseArgs(argv);
|
|
27144
|
-
} catch (
|
|
27145
|
-
process.stderr.write(`error: ${
|
|
27338
|
+
} catch (err15) {
|
|
27339
|
+
process.stderr.write(`error: ${err15.message}
|
|
27146
27340
|
|
|
27147
27341
|
${USAGE}`);
|
|
27148
27342
|
return 1;
|
|
@@ -27161,8 +27355,8 @@ ${USAGE}`);
|
|
|
27161
27355
|
process.stdout.write(`created ${path2}
|
|
27162
27356
|
`);
|
|
27163
27357
|
return 0;
|
|
27164
|
-
} catch (
|
|
27165
|
-
process.stderr.write(`error: ${
|
|
27358
|
+
} catch (err15) {
|
|
27359
|
+
process.stderr.write(`error: ${err15.message}
|
|
27166
27360
|
`);
|
|
27167
27361
|
return 1;
|
|
27168
27362
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "githolon",
|
|
3
|
-
"version": "0.107.
|
|
3
|
+
"version": "0.107.4",
|
|
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",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@bjorn3/browser_wasi_shim": "0.4.2",
|
|
32
32
|
"@bufbuild/protobuf": "^2.13.0",
|
|
33
|
-
"@githolon/dsl": "^0.107.
|
|
33
|
+
"@githolon/dsl": "^0.107.4",
|
|
34
34
|
"fast-xml-parser": "5.10.1",
|
|
35
35
|
"isomorphic-git": "^1.38.4",
|
|
36
36
|
"tsx": "^4.19.2"
|