githolon 0.105.13 → 0.105.15

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.
@@ -431,7 +431,7 @@ function prepareManagedPromotion(report, candidateHash, domain, opts = {}) {
431
431
  domainHash: candidateHash,
432
432
  ...opts.replaces ? { replaces: opts.replaces } : {},
433
433
  retireReplaced: opts.retireReplaced ?? false,
434
- ...opts.dispositions ? { dispositions: opts.dispositions } : {},
434
+ ...report.dispositions ? { dispositions: report.dispositions } : {},
435
435
  preflight
436
436
  }
437
437
  };
@@ -447,7 +447,6 @@ function prepareManagedRestoration(report, currentHash, priorHash, domain, opts
447
447
  }
448
448
  const acceptanceReason = opts.acceptanceReason?.trim();
449
449
  const prepared = prepareManagedPromotion(report, priorHash, domain, {
450
- dispositions: report.dispositions,
451
450
  ...acceptanceReason ? { acceptanceReason } : {}
452
451
  });
453
452
  if (!prepared.ok) {
@@ -556,6 +555,8 @@ var init_kernel_pb = __esm({
556
555
  // vendor/engine/engine.ts
557
556
  var engine_exports = {};
558
557
  __export(engine_exports, {
558
+ MAX_INLINE_INTENT_OFFER_BYTES: () => MAX_INLINE_INTENT_OFFER_BYTES,
559
+ MAX_STAGED_INTENT_OFFER_BYTES: () => MAX_STAGED_INTENT_OFFER_BYTES,
559
560
  NOMOS_SHARD_ROWS_READ: () => NOMOS_SHARD_ROWS_READ,
560
561
  admitAll: () => admitAll,
561
562
  admitIntentOffers: () => admitIntentOffers,
@@ -618,6 +619,7 @@ __export(engine_exports, {
618
619
  ingestPackAsCustody: () => ingestPackAsCustody,
619
620
  installedLaw: () => installedLaw,
620
621
  intentOfferResidencies: () => intentOfferResidencies,
622
+ intentOfferSizeRefusal: () => intentOfferSizeRefusal,
621
623
  isDirty: () => isDirty,
622
624
  isWarranted: () => isWarranted,
623
625
  kernelStamp: () => kernelStamp,
@@ -1624,6 +1626,10 @@ async function replicateIntents(eng, ws, ledger, intents, { push = true } = {})
1624
1626
  log("replicate-globals", { ws, replicated: replicated.length, skipped: skipped.length, refused: refused.length });
1625
1627
  return { replicated, skipped, refused };
1626
1628
  }
1629
+ function intentOfferSizeRefusal(staged, byteLength) {
1630
+ const maxOfferBytes = staged ? MAX_STAGED_INTENT_OFFER_BYTES : MAX_INLINE_INTENT_OFFER_BYTES;
1631
+ return byteLength <= 0 || byteLength > maxOfferBytes ? `intent offer must carry changeB64 <= ${maxOfferBytes / (1024 * 1024)} MiB` : null;
1632
+ }
1627
1633
  async function admitIntentOffers(eng, ws, ledger, offers, { receiptFence = null, shardRouting = null, clientBase = null } = {}) {
1628
1634
  const main = await mainIntentIds(eng, ws);
1629
1635
  const sessions = /* @__PURE__ */ new Map();
@@ -1695,9 +1701,16 @@ async function admitIntentOffers(eng, ws, ledger, offers, { receiptFence = null,
1695
1701
  let blob = offer?.blob instanceof Uint8Array ? offer.blob : null;
1696
1702
  try {
1697
1703
  if (!blob && typeof offer?.changeB64 === "string") blob = Uint8Array.from(atob(offer.changeB64), (c) => c.charCodeAt(0));
1698
- const maxOfferBytes = offer?.staged ? 64 * 1024 * 1024 : 32 * 1024 * 1024;
1699
- if (!blob || blob.byteLength === 0 || blob.byteLength > maxOfferBytes) {
1700
- rec.rejected.push({ oid: String(offer?.oid || "").slice(0, 10), error: `intent offer must carry changeB64 <= ${maxOfferBytes / (1024 * 1024)} MiB` });
1704
+ if (!blob) {
1705
+ rec.rejected.push({
1706
+ oid: String(offer?.oid || "").slice(0, 10),
1707
+ error: intentOfferSizeRefusal(!!offer?.staged, 0)
1708
+ });
1709
+ continue;
1710
+ }
1711
+ const sizeRefusal = intentOfferSizeRefusal(!!offer?.staged, blob.byteLength);
1712
+ if (sizeRefusal !== null) {
1713
+ rec.rejected.push({ oid: String(offer?.oid || "").slice(0, 10), error: sizeRefusal });
1701
1714
  continue;
1702
1715
  }
1703
1716
  const inspected = kgit.inspectChange(eng, blob);
@@ -1957,7 +1970,7 @@ async function mountWorkspace(eng, ws, ledger) {
1957
1970
  throw new Error(`kernel refused restored main ${remoteMain}: ${JSON.stringify(mounted)}`);
1958
1971
  }
1959
1972
  restored = true;
1960
- if (!seeded?.seeded) {
1973
+ if (!seeded?.seeded && ledger.readOnly !== true) {
1961
1974
  void pushCheckpoint(eng, ws, ledger).catch(() => {
1962
1975
  });
1963
1976
  }
@@ -3118,12 +3131,12 @@ async function verifyChain(eng, ws, ledger) {
3118
3131
  function verifyChainLocal(eng, ws) {
3119
3132
  return namedQueryProto(eng, ws, QueryOperation.VERIFY_CHAIN);
3120
3133
  }
3121
- function historyPreflight(eng, ws, domain, candidateHash, atHash, dispositions) {
3134
+ function historyPreflight(eng, ws, domain, candidateHash, atHash, actor = "") {
3122
3135
  return namedQueryProto(eng, ws, QueryOperation.HISTORY_PREFLIGHT, {
3123
3136
  domain,
3124
3137
  candidateHash,
3125
3138
  atHash,
3126
- ...dispositions ? { dispositions } : {}
3139
+ ...actor.trim() ? { ackBy: actor.trim() } : {}
3127
3140
  });
3128
3141
  }
3129
3142
  function historyRestorePreflight(eng, ws, domain, currentHash, priorHash, atHash, actor) {
@@ -3150,7 +3163,7 @@ function promotePreflighted(eng, ws, domain, candidateHash, opts = {}) {
3150
3163
  }
3151
3164
  let report;
3152
3165
  try {
3153
- report = historyPreflight(eng, ws, domain, candidateHash, atHash, opts.dispositions);
3166
+ report = historyPreflight(eng, ws, domain, candidateHash, atHash, actingPrincipal);
3154
3167
  } catch (error) {
3155
3168
  return { ok: false, stage: "preflight", error: String(error?.message || error) };
3156
3169
  }
@@ -3159,7 +3172,6 @@ function promotePreflighted(eng, ws, domain, candidateHash, opts = {}) {
3159
3172
  const {
3160
3173
  replaces: _replaces,
3161
3174
  retireReplaced: _retireReplaced,
3162
- dispositions: _dispositions,
3163
3175
  acceptanceReason: _acceptance,
3164
3176
  ...authorOpts
3165
3177
  } = opts;
@@ -3649,7 +3661,7 @@ function warmKernelCaches(eng, opts = {}) {
3649
3661
  ...opts.interactiveOnly ? { interactiveOnly: true } : {}
3650
3662
  });
3651
3663
  }
3652
- var enc3, dec3, BRANCH, PROTO_ABI_VERSION, protoRequestSequence, certificateBytes, protoBirthCertificate, RESULT_PACK_INLINE_MAX, dirOf, repoArgOf, gitdirOf, unpack, unsignedWasiPointers, log, protoTarget, protoAuthority, repoArgOfGitdir, bytesFromB64, kgit, closureInstallPayload, routeTagHexOfHomeKey, SUMMARY_SEP, summaryKey, splitSummaryKey, NOMOS_SHARD_ROWS_READ, groupOf, tallyOf, isExtremumRead, extremumMonotone, CKPT_REF, pushVia, fullRef, applyPackInto, importCustodyObjects, syncCandidate, custodyLsRefs, capturedReadUnix, queryArguments, queryAuthorityOptions, qById, query, queryPage, queryProfile, authorizationAddress, authorizationSubject, currentAuthorizationFrontier, check, expand, cryptoSealField, cryptoOwnedScopeKey, cryptoOwnedDeviceRequest, cryptoOwnedPrepareApproval, cryptoOwnedPrepareRecovery, cryptoKeygen, authorKeygen, eraCertSign, delegationCertSign, attestationSign, certSign, cryptoWrapKey, cryptoUnwrapKey, readPosture, count, sum, pendingConflicts, pendingConflictSummary, spatialBboxParams, spatialWithin, extremum, nomosActive, refusedRefName, GENESIS_WARRANT_ID, isWarranted, projectionStats, memoryDropProbe, readiness;
3664
+ var enc3, dec3, BRANCH, PROTO_ABI_VERSION, protoRequestSequence, certificateBytes, protoBirthCertificate, RESULT_PACK_INLINE_MAX, dirOf, repoArgOf, gitdirOf, unpack, unsignedWasiPointers, log, protoTarget, protoAuthority, repoArgOfGitdir, bytesFromB64, kgit, closureInstallPayload, routeTagHexOfHomeKey, SUMMARY_SEP, summaryKey, splitSummaryKey, NOMOS_SHARD_ROWS_READ, groupOf, tallyOf, isExtremumRead, extremumMonotone, MAX_INLINE_INTENT_OFFER_BYTES, MAX_STAGED_INTENT_OFFER_BYTES, CKPT_REF, pushVia, fullRef, applyPackInto, importCustodyObjects, syncCandidate, custodyLsRefs, capturedReadUnix, queryArguments, queryAuthorityOptions, qById, query, queryPage, queryProfile, authorizationAddress, authorizationSubject, currentAuthorizationFrontier, check, expand, cryptoSealField, cryptoOwnedScopeKey, cryptoOwnedDeviceRequest, cryptoOwnedPrepareApproval, cryptoOwnedPrepareRecovery, cryptoKeygen, authorKeygen, eraCertSign, delegationCertSign, attestationSign, certSign, cryptoWrapKey, cryptoUnwrapKey, readPosture, count, sum, pendingConflicts, pendingConflictSummary, spatialBboxParams, spatialWithin, extremum, nomosActive, refusedRefName, GENESIS_WARRANT_ID, isWarranted, projectionStats, memoryDropProbe, readiness;
3653
3665
  var init_engine = __esm({
3654
3666
  "vendor/engine/engine.ts"() {
3655
3667
  "use strict";
@@ -3907,6 +3919,8 @@ var init_engine = __esm({
3907
3919
  tallyOf = (eng, ws, read, group) => read.kind === "count" ? count(eng, ws, read.id, group).count : read.kind === "sum" ? sum(eng, ws, read.id, group).sum : extremum(eng, ws, read.id, read.kind, group).value;
3908
3920
  isExtremumRead = (read) => read.kind === "min" || read.kind === "max";
3909
3921
  extremumMonotone = (read, prev, next) => next === null && prev === null || next !== null && (prev === null || (read.kind === "min" ? next <= prev : next >= prev));
3922
+ MAX_INLINE_INTENT_OFFER_BYTES = 32 * 1024 * 1024;
3923
+ MAX_STAGED_INTENT_OFFER_BYTES = 64 * 1024 * 1024;
3910
3924
  CKPT_REF = (lawHash) => `refs/meta/checkpoint/${lawHash}`;
3911
3925
  pushVia = (ledger, fn) => ledger && ledger.pushLane ? ledger.pushLane(fn) : fn();
3912
3926
  fullRef = (r) => r === "HEAD" || r.startsWith("refs/") ? r : `refs/heads/${r}`;
@@ -910,6 +910,10 @@ function summaryOfCapture(ctx, fromOid, toOid) {
910
910
  rowsByHome: Object.fromEntries([...ctx.rowsByHome.entries()].sort((a, b) => a[0] < b[0] ? -1 : 1))
911
911
  };
912
912
  }
913
+ function intentOfferSizeRefusal(staged, byteLength) {
914
+ const maxOfferBytes = staged ? MAX_STAGED_INTENT_OFFER_BYTES : MAX_INLINE_INTENT_OFFER_BYTES;
915
+ return byteLength <= 0 || byteLength > maxOfferBytes ? `intent offer must carry changeB64 <= ${maxOfferBytes / (1024 * 1024)} MiB` : null;
916
+ }
913
917
  async function admitIntentOffers(eng, ws, ledger, offers, { receiptFence = null, shardRouting = null, clientBase = null } = {}) {
914
918
  const main = await mainIntentIds(eng, ws);
915
919
  const sessions = /* @__PURE__ */ new Map();
@@ -981,9 +985,16 @@ async function admitIntentOffers(eng, ws, ledger, offers, { receiptFence = null,
981
985
  let blob = offer?.blob instanceof Uint8Array ? offer.blob : null;
982
986
  try {
983
987
  if (!blob && typeof offer?.changeB64 === "string") blob = Uint8Array.from(atob(offer.changeB64), (c) => c.charCodeAt(0));
984
- const maxOfferBytes = offer?.staged ? 64 * 1024 * 1024 : 32 * 1024 * 1024;
985
- if (!blob || blob.byteLength === 0 || blob.byteLength > maxOfferBytes) {
986
- rec.rejected.push({ oid: String(offer?.oid || "").slice(0, 10), error: `intent offer must carry changeB64 <= ${maxOfferBytes / (1024 * 1024)} MiB` });
988
+ if (!blob) {
989
+ rec.rejected.push({
990
+ oid: String(offer?.oid || "").slice(0, 10),
991
+ error: intentOfferSizeRefusal(!!offer?.staged, 0)
992
+ });
993
+ continue;
994
+ }
995
+ const sizeRefusal = intentOfferSizeRefusal(!!offer?.staged, blob.byteLength);
996
+ if (sizeRefusal !== null) {
997
+ rec.rejected.push({ oid: String(offer?.oid || "").slice(0, 10), error: sizeRefusal });
987
998
  continue;
988
999
  }
989
1000
  const inspected = kgit.inspectChange(eng, blob);
@@ -1168,7 +1179,7 @@ async function mountWorkspace(eng, ws, ledger) {
1168
1179
  throw new Error(`kernel refused restored main ${remoteMain}: ${JSON.stringify(mounted)}`);
1169
1180
  }
1170
1181
  restored = true;
1171
- if (!seeded?.seeded) {
1182
+ if (!seeded?.seeded && ledger.readOnly !== true) {
1172
1183
  void pushCheckpoint(eng, ws, ledger).catch(() => {
1173
1184
  });
1174
1185
  }
@@ -2153,7 +2164,7 @@ async function ledgerStats(eng, ws, ledger = null) {
2153
2164
  if (mounted) mounted.ledgerStats = out;
2154
2165
  return out;
2155
2166
  }
2156
- var enc3, dec3, BRANCH, PROTO_ABI_VERSION, protoRequestSequence, certificateBytes, protoBirthCertificate, RESULT_PACK_INLINE_MAX, dirOf, repoArgOf, gitdirOf, unpack, unsignedWasiPointers, log, protoTarget, protoAuthority, repoArgOfGitdir, bytesFromB64, kgit, closureInstallPayload, routeTagHexOfHomeKey, SUMMARY_SEP, summaryKey, splitSummaryKey, NOMOS_SHARD_ROWS_READ, groupOf, tallyOf, isExtremumRead, extremumMonotone, CKPT_REF, pushVia, fullRef, applyPackInto, custodyLsRefs, capturedReadUnix, queryArguments, queryAuthorityOptions, qById, query, authorKeygen, certSign, readPosture, count, sum, pendingConflicts, pendingConflictSummary, spatialBboxParams, spatialWithin, extremum, nomosActive, refusedRefName, GENESIS_WARRANT_ID, isWarranted;
2167
+ var enc3, dec3, BRANCH, PROTO_ABI_VERSION, protoRequestSequence, certificateBytes, protoBirthCertificate, RESULT_PACK_INLINE_MAX, dirOf, repoArgOf, gitdirOf, unpack, unsignedWasiPointers, log, protoTarget, protoAuthority, repoArgOfGitdir, bytesFromB64, kgit, closureInstallPayload, routeTagHexOfHomeKey, SUMMARY_SEP, summaryKey, splitSummaryKey, NOMOS_SHARD_ROWS_READ, groupOf, tallyOf, isExtremumRead, extremumMonotone, MAX_INLINE_INTENT_OFFER_BYTES, MAX_STAGED_INTENT_OFFER_BYTES, CKPT_REF, pushVia, fullRef, applyPackInto, custodyLsRefs, capturedReadUnix, queryArguments, queryAuthorityOptions, qById, query, authorKeygen, certSign, readPosture, count, sum, pendingConflicts, pendingConflictSummary, spatialBboxParams, spatialWithin, extremum, nomosActive, refusedRefName, GENESIS_WARRANT_ID, isWarranted;
2157
2168
  var init_engine = __esm({
2158
2169
  "../adapter/engine.ts"() {
2159
2170
  "use strict";
@@ -2411,6 +2422,8 @@ var init_engine = __esm({
2411
2422
  tallyOf = (eng, ws, read, group) => read.kind === "count" ? count(eng, ws, read.id, group).count : read.kind === "sum" ? sum(eng, ws, read.id, group).sum : extremum(eng, ws, read.id, read.kind, group).value;
2412
2423
  isExtremumRead = (read) => read.kind === "min" || read.kind === "max";
2413
2424
  extremumMonotone = (read, prev, next) => next === null && prev === null || next !== null && (prev === null || (read.kind === "min" ? next <= prev : next >= prev));
2425
+ MAX_INLINE_INTENT_OFFER_BYTES = 32 * 1024 * 1024;
2426
+ MAX_STAGED_INTENT_OFFER_BYTES = 64 * 1024 * 1024;
2414
2427
  CKPT_REF = (lawHash) => `refs/meta/checkpoint/${lawHash}`;
2415
2428
  pushVia = (ledger, fn) => ledger && ledger.pushLane ? ledger.pushLane(fn) : fn();
2416
2429
  fullRef = (r) => r === "HEAD" || r.startsWith("refs/") ? r : `refs/heads/${r}`;
@@ -2991,8 +3004,8 @@ function resolveGatewayOperation(spec, opName, method) {
2991
3004
 
2992
3005
  // ../cloud/cloudflare-shell/src/kernel-registry.generated.ts
2993
3006
  var DEPLOYED_KERNELS = [
2994
- { prefix: "64219cdd", hash: "64219cdd5441cd92cb08d5200a6e65e7814364cc6d1b7cd1b014322ea4372092", version: "kernel-64219cdd", note: "production (this candidate)", features: ["compoundKeys", "capturedReads", "invariantGate", "surfacedMerge", "fieldProvenance", "nullSemantics", "attestedReads", "conflictSnapshots", "ownedAudience", "temporalEnum"] },
2995
- { prefix: "9ca691fd", hash: "9ca691fd3524897b2edc236167b1b490701c85b41ad066cc41041829d42357f7", version: "kernel-9ca691fd", note: "test-mint (this candidate) \u2014 feature-equivalent to production", features: ["compoundKeys", "capturedReads", "invariantGate", "surfacedMerge", "fieldProvenance", "nullSemantics", "attestedReads", "conflictSnapshots", "ownedAudience", "temporalEnum"] }
3007
+ { prefix: "d37253bc", hash: "d37253bcefd90a180a6a1af96422a9f0724dfca9efd9ae7cff070afa2c410f09", version: "kernel-d37253bc", note: "production (this candidate)", features: ["compoundKeys", "capturedReads", "invariantGate", "surfacedMerge", "fieldProvenance", "nullSemantics", "attestedReads", "conflictSnapshots", "ownedAudience", "temporalEnum"] },
3008
+ { prefix: "b6bddd8d", hash: "b6bddd8d61390edbe2ee4e5f3c7f21108bdb7800af746d20f568936f63e2d517", version: "kernel-b6bddd8d", note: "test-mint (this candidate) \u2014 feature-equivalent to production", features: ["compoundKeys", "capturedReads", "invariantGate", "surfacedMerge", "fieldProvenance", "nullSemantics", "attestedReads", "conflictSnapshots", "ownedAudience", "temporalEnum"] }
2996
3009
  ];
2997
3010
 
2998
3011
  // ../cloud/cloudflare-shell/src/staged-intents.ts