githolon 0.100.4 → 0.100.6

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.
Files changed (2) hide show
  1. package/dist/cli.mjs +22 -19
  2. package/package.json +3 -3
package/dist/cli.mjs CHANGED
@@ -2852,8 +2852,9 @@ function atomicWriteRuntime(target, data) {
2852
2852
  function runtimeDirIsWarm(runtimeDir) {
2853
2853
  try {
2854
2854
  const w = statSync(join2(runtimeDir, "holon.wasm")).mtimeMs;
2855
+ const t = statSync(join2(runtimeDir, "holon-testmint.wasm")).mtimeMs;
2855
2856
  const p = statSync(join2(runtimeDir, "packages.json")).mtimeMs;
2856
- return Date.now() - Math.min(w, p) < RUNTIME_FRESH_MS;
2857
+ return Date.now() - Math.min(w, t, p) < RUNTIME_FRESH_MS;
2857
2858
  } catch {
2858
2859
  return false;
2859
2860
  }
@@ -2869,11 +2870,15 @@ async function refreshRuntimeDir(cloud, runtimeDir) {
2869
2870
  const r = await fetch(`${cloud}/v1/runtime/holon.wasm`);
2870
2871
  if (!r.ok) throw new Error(`runtime wasm \u2192 ${r.status}`);
2871
2872
  const wasmBytes = new Uint8Array(await r.arrayBuffer());
2873
+ const testmint = await fetch(`${cloud}/v1/runtime/holon-testmint.wasm`);
2874
+ if (!testmint.ok) throw new Error(`test-mint runtime wasm \u2192 ${testmint.status}`);
2875
+ const testmintBytes = new Uint8Array(await testmint.arrayBuffer());
2872
2876
  const pkgs = await fetch(`${cloud}/v1/runtime/packages`);
2873
2877
  if (!pkgs.ok) throw new Error(`runtime packages \u2192 ${pkgs.status}`);
2874
2878
  const pkgText = await pkgs.text();
2875
2879
  mkdirSync2(runtimeDir, { recursive: true });
2876
2880
  atomicWriteRuntime(join2(runtimeDir, "holon.wasm"), wasmBytes);
2881
+ atomicWriteRuntime(join2(runtimeDir, "holon-testmint.wasm"), testmintBytes);
2877
2882
  atomicWriteRuntime(join2(runtimeDir, "packages.json"), pkgText);
2878
2883
  _refreshedDirsThisProcess.add(runtimeDir);
2879
2884
  return true;
@@ -3570,12 +3575,15 @@ async function signAndPostChildLifecycle(parent, child, creator, action, opts) {
3570
3575
  return signAndPostPreparedOffer(
3571
3576
  parent,
3572
3577
  void 0,
3573
- (actor) => action === "retire" ? {
3574
- directiveId: "retireChild",
3575
- payload: { child, principal: creator, retiredBy: lineageIdentity(actor), retiredAt: Date.now() }
3576
- } : {
3577
- directiveId: "reclaimChild",
3578
- payload: { child, reclaimedBy: lineageIdentity(actor), reclaimedAt: Date.now() }
3578
+ (actor) => {
3579
+ const creatorActing = creator !== "" && sameIdentity(creator, actor);
3580
+ return action === "retire" ? {
3581
+ directiveId: creatorActing ? "retireChild" : "retireChildAsAdmin",
3582
+ payload: { child, principal: creator, retiredBy: lineageIdentity(actor), retiredAt: Date.now() }
3583
+ } : {
3584
+ directiveId: creatorActing ? "reclaimChild" : "reclaimChildAsAdmin",
3585
+ payload: { child, reclaimedBy: lineageIdentity(actor), reclaimedAt: Date.now() }
3586
+ };
3579
3587
  },
3580
3588
  opts,
3581
3589
  "self-if-unenrolled",
@@ -6331,15 +6339,6 @@ function warrantParentForBirth(eng, parentWs, parentDomain, lawHash, genesisOwne
6331
6339
  const root = authorKeygen(eng);
6332
6340
  setTestKRoot(eng, root.public);
6333
6341
  const parentCert = certSign(eng, {
6334
- child: parentWs,
6335
- founder: genesisOwner,
6336
- verified: true,
6337
- parentKey: dev2.public,
6338
- parentId: "root",
6339
- epoch: 0,
6340
- secret: dev2.secret
6341
- });
6342
- const rootDelegation = certSign(eng, {
6343
6342
  child: parentWs,
6344
6343
  founder: genesisOwner,
6345
6344
  verified: true,
@@ -6374,7 +6373,7 @@ function warrantParentForBirth(eng, parentWs, parentDomain, lawHash, genesisOwne
6374
6373
  parentId: parentWs,
6375
6374
  parentKey: dev2.public,
6376
6375
  epoch: 0,
6377
- certChain: JSON.stringify({ links: [parentCert, rootDelegation] })
6376
+ certChain: JSON.stringify({ links: [parentCert] })
6378
6377
  }, genesisOwner);
6379
6378
  const hasParentAttestation = !(sba.ok === false && /no directive registered/i.test(sba.error ?? ""));
6380
6379
  if (sba.ok === false && !/already|create-once|attest|no directive registered/i.test(sba.error ?? "")) return { ok: false, error: `seedBirthAttestation refused: ${sba.error}` };
@@ -6473,6 +6472,10 @@ async function runChildBirthLeg(eng, ws, lawHash, cb, frameworkHash) {
6473
6472
  }
6474
6473
  const bornParent = (setupRes.born ?? []).map((b) => b?.workspace).find((w) => typeof w === "string" && w.length > 0);
6475
6474
  if (bornParent === void 0) {
6475
+ const failed = (setupRes.birthOutcomes ?? []).find((o) => o?.status === "failed" || o?.status === "refused");
6476
+ if (failed !== void 0) {
6477
+ return done(false, `parent setup ${setup.parentDomain}/${setup.birthDirectiveId} child genesis failed: ${failed.reason ?? "unknown"}`);
6478
+ }
6476
6479
  return done(false, `parent setup ${setup.parentDomain}/${setup.birthDirectiveId} admitted but spawned no parent workspace (born=${JSON.stringify(setupRes.born ?? [])})`);
6477
6480
  }
6478
6481
  parentWs = bornParent;
@@ -7224,11 +7227,11 @@ async function harnessInstall(opts) {
7224
7227
  const refreshed = await refreshRuntimeDir(cloudBase(), runtimeDir);
7225
7228
  if (refreshed) process.stderr.write(`harness-install: refreshed runtime cache from the cloud \u2192 ${runtimeDir}
7226
7229
  `);
7227
- const wasmFile = join15(runtimeDir, "holon.wasm");
7230
+ const wasmFile = join15(runtimeDir, "holon-testmint.wasm");
7228
7231
  const pkgsFile = join15(runtimeDir, "packages.json");
7229
7232
  if (!existsSync13(wasmFile) || !existsSync13(pkgsFile)) {
7230
7233
  die(
7231
- `runtime cache missing at ${runtimeDir} (holon.wasm + packages.json). Warm it once with a \`githolon\` run (it fetches + caches the runtime), then re-run offline.`
7234
+ `test runtime cache missing at ${runtimeDir} (holon-testmint.wasm + packages.json). Warm it once with a \`githolon\` run (it fetches + caches the runtime), then re-run offline.`
7232
7235
  );
7233
7236
  }
7234
7237
  const wasm = readFileSync14(wasmFile);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "githolon",
3
- "version": "0.100.4",
3
+ "version": "0.100.6",
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.100.4",
33
- "@githolon/dsl": "^0.100.4",
32
+ "@githolon/client": "^0.100.6",
33
+ "@githolon/dsl": "^0.100.6",
34
34
  "isomorphic-git": "^1.38.4"
35
35
  },
36
36
  "devDependencies": {