githolon 0.103.9 → 0.103.10

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.
@@ -3932,7 +3932,7 @@ var init_engine = __esm({
3932
3932
  outboxRefName = (requestId) => `refs/heads/outbox/${String(requestId || "unknown").replace(/[^A-Za-z0-9._-]/g, "_")}`;
3933
3933
  GENESIS_WARRANT_ID = "genesis-warrant:self";
3934
3934
  isWarranted = (eng, ws) => qById(eng, ws, GENESIS_WARRANT_ID).length > 0;
3935
- projectionStats = (eng, ws) => namedQueryProto(eng, ws || "root", QueryOperation.PROJECTION_STATS);
3935
+ projectionStats = (eng, ws = "root", options = {}) => namedQueryProto(eng, ws || "root", QueryOperation.PROJECTION_STATS, options.deep ? { deep: true } : {});
3936
3936
  memoryDropProbe = (eng, ws) => namedQueryProto(eng, ws, QueryOperation.MEMORY_DROP_PROBE);
3937
3937
  readiness = (eng, ws) => namedQueryProto(eng, ws, QueryOperation.READINESS);
3938
3938
  }
@@ -2595,8 +2595,8 @@ function resolveGatewayOperation(spec, opName, method) {
2595
2595
 
2596
2596
  // ../cloud/cloudflare-shell/src/kernel-registry.generated.ts
2597
2597
  var DEPLOYED_KERNELS = [
2598
- { prefix: "b40b537a", hash: "b40b537a66fe971c86ace3e0f8f2c1ff4087bdb0f7e50d2c9e5d5798633f41a6", version: "kernel-b40b537a", note: "production (this candidate)", features: ["compoundKeys", "capturedReads", "invariantGate", "surfacedMerge", "fieldProvenance", "nullSemantics", "attestedReads", "conflictSnapshots", "ownedAudience"] },
2599
- { prefix: "fd8eeca0", hash: "fd8eeca068dabc11c84825a181062df5958fb9322c945e623753494f760fdc37", version: "kernel-fd8eeca0", note: "test-mint (this candidate) \u2014 feature-equivalent to production", features: ["compoundKeys", "capturedReads", "invariantGate", "surfacedMerge", "fieldProvenance", "nullSemantics", "attestedReads", "conflictSnapshots", "ownedAudience"] }
2598
+ { prefix: "d512065a", hash: "d512065a204a4b5ac59dd8dfc262d98e49d9e47823582a6123351f4668c68c8b", version: "kernel-d512065a", note: "production (this candidate)", features: ["compoundKeys", "capturedReads", "invariantGate", "surfacedMerge", "fieldProvenance", "nullSemantics", "attestedReads", "conflictSnapshots", "ownedAudience"] },
2599
+ { prefix: "1c66f90d", hash: "1c66f90d98e71f451b5d3505bba09b66694a22674845e2fd499468854c1a0aae", version: "kernel-1c66f90d", note: "test-mint (this candidate) \u2014 feature-equivalent to production", features: ["compoundKeys", "capturedReads", "invariantGate", "surfacedMerge", "fieldProvenance", "nullSemantics", "attestedReads", "conflictSnapshots", "ownedAudience"] }
2600
2600
  ];
2601
2601
 
2602
2602
  // ../cloud/cloudflare-shell/src/staged-intents.ts
package/dist/full-cli.mjs CHANGED
@@ -3213,7 +3213,7 @@ function providerOperation(mode, rawFields, workBytes) {
3213
3213
  else throw new Error(`no typed protobuf operation for provider call '${mode}'`);
3214
3214
  return { case: "custody", value: create(CustodyRequestSchema, { operation: custody }) };
3215
3215
  }
3216
- function nmsInternalReportProviderTransport(host, encoded, phases, responseBytes) {
3216
+ function nmsInternalReportProviderTransport(host, encoded, phases, responseBytes, context = {}) {
3217
3217
  const rounded = Object.fromEntries(Object.entries({ encode: encoded.encodeMs, ...phases }).map(([key2, value]) => [key2, Math.round(value * 1e3) / 1e3]));
3218
3218
  const totalMs = Object.values(rounded).reduce((sum2, value) => sum2 + value, 0);
3219
3219
  const debug = globalThis.__NOMOS_PROFILE_TRANSPORT__ === true || globalThis.process?.env?.NOMOS_PROFILE_TRANSPORT === "1";
@@ -3221,10 +3221,13 @@ function nmsInternalReportProviderTransport(host, encoded, phases, responseBytes
3221
3221
  console.warn(`[nomos-transport-perf] ${JSON.stringify({
3222
3222
  host,
3223
3223
  mode: encoded.mode,
3224
+ detail: encoded.detail,
3225
+ requestId: encoded.requestId,
3224
3226
  totalMs: Math.round(totalMs * 1e3) / 1e3,
3225
3227
  phases: rounded,
3226
3228
  requestBytes: encoded.bytes.length,
3227
- responseBytes
3229
+ responseBytes,
3230
+ ...context
3228
3231
  })}`);
3229
3232
  }
3230
3233
  function nmsInternalEncodeProviderCall(mode, fields, workBytes, requestPrefix = "browser") {
@@ -3241,7 +3244,9 @@ function nmsInternalEncodeTypedProviderCall(operation, requestPrefix = "browser"
3241
3244
  requestId,
3242
3245
  operation
3243
3246
  }));
3244
- return { requestId, mode: operation.case || "empty", bytes, encodeMs: monotonicMs() - started };
3247
+ const query3 = operation.case === "query" ? operation.value.query : void 0;
3248
+ const detail = query3?.case === "named" ? `query:named:${String(query3.value.operation)}` : query3?.case ? `query:${query3.case}` : operation.case || "empty";
3249
+ return { requestId, mode: operation.case || "empty", detail, bytes, encodeMs: monotonicMs() - started };
3245
3250
  }
3246
3251
  function nmsInternalDecodeProviderResponse(bytes, requestId, stderr = []) {
3247
3252
  const response = fromBinary(CallResponseSchema, bytes);
@@ -3302,7 +3307,8 @@ function nmsInternalDecodeProviderResponse(bytes, requestId, stderr = []) {
3302
3307
  verdictDecodeUs: Number(result.value.spans.verdictDecodeUs),
3303
3308
  promoteAndCleanupRefsUs: Number(result.value.spans.promoteAndCleanupRefsUs),
3304
3309
  frontierRebuildUs: Number(result.value.spans.frontierRebuildUs),
3305
- frontierStoreUs: Number(result.value.spans.frontierStoreUs)
3310
+ frontierStoreUs: Number(result.value.spans.frontierStoreUs),
3311
+ verification: result.value.spans.verification ? jsVerifyChainDiagnostics(result.value.spans.verification) : void 0
3306
3312
  } : void 0
3307
3313
  });
3308
3314
  case "repoStats":
@@ -3371,7 +3377,15 @@ function jsVerifyChainDiagnostics(diagnostics) {
3371
3377
  typedInstallVerifierUs: Number(step.phases.typedInstallVerifierUs),
3372
3378
  admissionUs: Number(step.phases.admissionUs),
3373
3379
  foldUs: Number(step.phases.foldUs)
3374
- } : void 0
3380
+ } : void 0,
3381
+ engineTimings: step.engineTimings.map((timing) => ({
3382
+ phase: timing.phase,
3383
+ totalUs: Number(timing.totalUs)
3384
+ }))
3385
+ })),
3386
+ engineTimings: diagnostics.engineTimings.map((timing) => ({
3387
+ phase: timing.phase,
3388
+ totalUs: Number(timing.totalUs)
3375
3389
  }))
3376
3390
  };
3377
3391
  }
@@ -3418,7 +3432,7 @@ function nmsInternalParseSnapshot(bytes) {
3418
3432
  return { treeBytes: bytes, ckpt: null, frontier: null, cursor: null, stateRoot: null, syncedBase: null };
3419
3433
  }
3420
3434
  function nmsInternalBuildSnapshot(treeBytes, ckpt, syncedBase) {
3421
- const hasCheckpoint = !!(ckpt && (ckpt.blob || ckpt.frontier || ckpt.cursor && ckpt.stateRoot));
3435
+ const hasCheckpoint = !!(ckpt && (ckpt.blob || ckpt.frontier || ckpt.cursor));
3422
3436
  if (!hasCheckpoint && !syncedBase) return treeBytes;
3423
3437
  return enc2.encode(JSON.stringify({
3424
3438
  v: 2,
@@ -3564,7 +3578,7 @@ function createWasmEnginePlane({ span } = {}) {
3564
3578
  const view = {
3565
3579
  /** The parsed restore checkpoint (so index.mjs can drive checkpoint_import after boot, exactly as before). */
3566
3580
  get restoreCheckpoint() {
3567
- return _ckptBlobStr || _ckptFrontierStr || _ckptCursor && _ckptStateRoot ? { blob: _ckptBlobStr, frontier: _ckptFrontierStr, cursor: _ckptCursor, stateRoot: _ckptStateRoot } : null;
3581
+ return _ckptBlobStr || _ckptFrontierStr || _ckptCursor ? { blob: _ckptBlobStr, frontier: _ckptFrontierStr, cursor: _ckptCursor, stateRoot: _ckptStateRoot } : null;
3568
3582
  },
3569
3583
  /** The converged fork point persisted in the restoreFrom snapshot (null for old/tree-only snapshots). */
3570
3584
  get restoreSyncedBase() {
@@ -3738,7 +3752,7 @@ function createWasmEnginePlane({ span } = {}) {
3738
3752
  const treeBytes = serializeTree(wsDirNode);
3739
3753
  return nmsInternalBuildSnapshot(
3740
3754
  treeBytes,
3741
- ckpt && (ckpt.blob || ckpt.frontier || ckpt.cursor && ckpt.stateRoot) ? ckpt : null,
3755
+ ckpt && (ckpt.blob || ckpt.frontier || ckpt.cursor) ? ckpt : null,
3742
3756
  opts.syncedBase || null
3743
3757
  );
3744
3758
  }
@@ -5345,7 +5359,7 @@ async function connectSingle({ cloud, workspace, clientId, authToken, restoreFro
5345
5359
  if (salvageOnly) allowUnborn = true;
5346
5360
  if (!cloud || !workspace) throw new Error("connect({ cloud, workspace }) required");
5347
5361
  const _fetch = typeof fetchImpl === "function" ? fetchImpl : globalThis.fetch;
5348
- const deviceSecret = authorSecret || "";
5362
+ let deviceSecret = authorSecret || "";
5349
5363
  const base = cloud.replace(/\/+$/, "");
5350
5364
  const localOnly = /^local:\/\//i.test(base);
5351
5365
  const historicSnapshotConfig = historicSnapshots === false ? null : historicSnapshots && typeof historicSnapshots === "object" ? historicSnapshots : {};
@@ -5589,9 +5603,11 @@ ${String(commit).toLowerCase()}`;
5589
5603
  const watchStops = /* @__PURE__ */ new Set();
5590
5604
  let installedLawRowsCache;
5591
5605
  let installedLawCurrentCache;
5592
- const invalidateInstalledLawRows = () => {
5606
+ let installedInterfaceCache;
5607
+ const invalidateInstalledLawMetadata = () => {
5593
5608
  installedLawRowsCache = void 0;
5594
5609
  installedLawCurrentCache = void 0;
5610
+ installedInterfaceCache = void 0;
5595
5611
  };
5596
5612
  let _disposed = false;
5597
5613
  const nudgeWatches = () => {
@@ -5936,10 +5952,13 @@ ${String(commit).toLowerCase()}`;
5936
5952
  const compatGuardWrite = (directiveId, force) => assertWriteShippable(compatState, directiveId, { force, workspace });
5937
5953
  let _lastInterfaceReadError = null;
5938
5954
  const installedInterfaceInner = () => {
5955
+ if (installedInterfaceCache !== void 0) return installedInterfaceCache;
5939
5956
  try {
5940
5957
  const compact = JSON.parse(call("query", { queryBytes: qBytes({ op: "interfaceOffer" }) }));
5941
5958
  _lastInterfaceReadError = null;
5942
- return compact && typeof compact === "object" && !Array.isArray(compact) && Object.keys(compact).length ? compact : null;
5959
+ const installedInterface = compact && typeof compact === "object" && !Array.isArray(compact) && Object.keys(compact).length ? compact : null;
5960
+ installedInterfaceCache = installedInterface;
5961
+ return installedInterface;
5943
5962
  } catch (error) {
5944
5963
  _lastInterfaceReadError = error instanceof Error ? error : new Error(String(error));
5945
5964
  return null;
@@ -6079,7 +6098,7 @@ ${String(commit).toLowerCase()}`;
6079
6098
  }
6080
6099
  }
6081
6100
  }
6082
- invalidateInstalledLawRows();
6101
+ invalidateInstalledLawMetadata();
6083
6102
  nudgeWatches();
6084
6103
  return {
6085
6104
  upToDate: false,
@@ -6221,22 +6240,35 @@ ${String(commit).toLowerCase()}`;
6221
6240
  };
6222
6241
  return err13;
6223
6242
  };
6224
- if (ckptBlobStr || ckptFrontierStr || ckptStagedFrontierFile || ckptCursor && ckptStateRoot) {
6243
+ if (ckptBlobStr || ckptFrontierStr || ckptStagedFrontierFile || ckptCursor) {
6225
6244
  const _ckptSpan = span("receive", restoreFrom ? "boot: restore folded state (snapshot)" : "boot: restore checkpoint", "boot");
6245
+ let checkpointResult = null;
6226
6246
  try {
6227
- call("checkpoint_import", {
6247
+ checkpointResult = JSON.parse(call("checkpoint_import", {
6228
6248
  ...ckptBlobStr ? { blob: ckptBlobStr } : {},
6229
6249
  ...ckptFrontierStr ? { frontier: ckptFrontierStr } : {},
6230
6250
  ...ckptStagedFrontierFile ? { stagedFrontierFile: ckptStagedFrontierFile } : {},
6231
6251
  ...ckptCursor ? { cursor: ckptCursor } : {},
6232
- ...ckptStateRoot ? { stateRoot: ckptStateRoot } : {}
6233
- });
6252
+ ...ckptStateRoot ? { stateRoot: ckptStateRoot } : {},
6253
+ // Cold-open latency is a public runtime property. Ask the kernel for
6254
+ // its bounded phase table so tenant tooling can distinguish custody,
6255
+ // schema, SQLite hydration and policy-cache work without profiling the
6256
+ // opaque host bridge or weakening the kernel boundary.
6257
+ spans: true
6258
+ }));
6234
6259
  } catch (error) {
6235
6260
  if (typeof process !== "undefined" && process.env?.NOMOS_DEBUG_RAW) {
6236
6261
  console.error("[nomos] checkpoint restore refused", error);
6237
6262
  }
6238
6263
  }
6239
- _ckptSpan.end();
6264
+ _ckptSpan.end(checkpointResult ? {
6265
+ restored: checkpointResult.restored,
6266
+ reason: checkpointResult.reason,
6267
+ aggregates: checkpointResult.aggregates,
6268
+ readOnly: checkpointResult.readOnly,
6269
+ lazyReadIndex: checkpointResult.lazyReadIndex,
6270
+ kernelSpans: checkpointResult.kernelSpans
6271
+ } : {});
6240
6272
  }
6241
6273
  const remoteUnavailableAtConnect = (cause) => {
6242
6274
  const msg = String(cause?.message || cause);
@@ -6712,7 +6744,7 @@ ${String(commit).toLowerCase()}`;
6712
6744
  affected = Array.isArray(res.affected) ? res.affected : [];
6713
6745
  }
6714
6746
  if ((domain === "nomos" || domain === "bootstrap") && ["installDomain", "stageDomain", "promoteDomain", "rollbackDomain"].includes(directiveId)) {
6715
- invalidateInstalledLawRows();
6747
+ invalidateInstalledLawMetadata();
6716
6748
  }
6717
6749
  scheduleMaintenanceSoon();
6718
6750
  nudgeWatchesSoon();
@@ -9357,6 +9389,29 @@ ${String(commit).toLowerCase()}`;
9357
9389
  authHeaders = packAuthHeaders({ authToken: activeAuthToken, principal: connectionPrincipal });
9358
9390
  return { refreshed: true };
9359
9391
  },
9392
+ /** Refresh the client-held identity proof and/or default signing key without disposing, remounting or
9393
+ * refolding this resident holon. The kernel remains the authority: changing the client key grants
9394
+ * nothing; the next offer still has to prove that key is enrolled under the workspace law. */
9395
+ refreshCredentials: ({ authToken: token, authorSecret: secret } = {}) => {
9396
+ if (token !== void 0) {
9397
+ const next = typeof token === "string" ? token.trim() : "";
9398
+ if (next) {
9399
+ const subjectClaim = jwtClaim(next, "sub");
9400
+ const nextSubject = canonicalPrincipal(
9401
+ typeof subjectClaim === "string" ? subjectClaim : ""
9402
+ );
9403
+ if (!nextSubject || nextSubject !== connectionPrincipal) {
9404
+ throw new Error("credential refresh changed the signed-in identity; reopen the application explicitly");
9405
+ }
9406
+ }
9407
+ activeAuthToken = next;
9408
+ authHeaders = packAuthHeaders({ authToken: activeAuthToken, principal: connectionPrincipal });
9409
+ }
9410
+ if (secret !== void 0) {
9411
+ deviceSecret = typeof secret === "string" ? secret.trim() : "";
9412
+ }
9413
+ return { refreshed: true };
9414
+ },
9360
9415
  /**
9361
9416
  * THE ONE ENCODER as the public offer entrypoint. A generated client (TS or Dart-via-bridge) calls THIS
9362
9417
  * with the planned payload + the verified `actor` — it NEVER re-encodes the v2 envelope itself. The bytes
@@ -14829,7 +14884,7 @@ var init_engine = __esm({
14829
14884
  outboxRefName = (requestId) => `refs/heads/outbox/${String(requestId || "unknown").replace(/[^A-Za-z0-9._-]/g, "_")}`;
14830
14885
  GENESIS_WARRANT_ID = "genesis-warrant:self";
14831
14886
  isWarranted = (eng, ws) => qById(eng, ws, GENESIS_WARRANT_ID).length > 0;
14832
- projectionStats = (eng, ws) => namedQueryProto(eng, ws || "root", QueryOperation2.PROJECTION_STATS);
14887
+ projectionStats = (eng, ws = "root", options = {}) => namedQueryProto(eng, ws || "root", QueryOperation2.PROJECTION_STATS, options.deep ? { deep: true } : {});
14833
14888
  memoryDropProbe = (eng, ws) => namedQueryProto(eng, ws, QueryOperation2.MEMORY_DROP_PROBE);
14834
14889
  readiness = (eng, ws) => namedQueryProto(eng, ws, QueryOperation2.READINESS);
14835
14890
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "githolon",
3
- "version": "0.103.9",
3
+ "version": "0.103.10",
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.103.9",
33
+ "@githolon/dsl": "^0.103.10",
34
34
  "isomorphic-git": "^1.38.4",
35
35
  "tsx": "^4.19.2"
36
36
  },