githolon 0.110.1 → 0.111.1

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 CHANGED
@@ -9279,7 +9279,7 @@ var init_recovery_desk_pb = __esm({
9279
9279
  // ../adapter/proto/nomos/runtime/v2/observability_desk_pb.js
9280
9280
  import { enumDesc as enumDesc15, fileDesc as fileDesc22, messageDesc as messageDesc22, tsEnum as tsEnum15 } from "@bufbuild/protobuf/codegenv2";
9281
9281
  import { file_google_protobuf_any as file_google_protobuf_any2 } from "@bufbuild/protobuf/wkt";
9282
- var file_nomos_runtime_v2_observability_desk, RuntimeFailureSchema, RuntimeUnavailableSchema, RuntimeRefusalSchema, DiagnosticAttributeSchema, RuntimeEventSchema, FollowsSummarySchema, FollowObservationSchema, CredentialRefreshRequestedSchema, RuntimeReadySchema, WatchChangedSchema, SyncCompletedSchema, LinkChangedSchema, RuntimeSpanSchema, RuntimeFailureKindSchema, RuntimeFailureKind, RuntimeUnavailableReasonSchema, RuntimeUnavailableReason, RuntimeRefusalReasonSchema, RuntimeRefusalReason, FollowObservationPhaseSchema, FollowObservationPhase, LinkStatusSchema, LinkStatus;
9282
+ var file_nomos_runtime_v2_observability_desk, RuntimeFailureSchema, RuntimeUnavailableSchema, RuntimeRefusalSchema, DiagnosticAttributeSchema, RuntimeEventSchema, FollowsSummarySchema, FollowObservationSchema, CredentialRefreshRequestedSchema, RuntimeReadySchema, WatchChangedSchema, SyncCompletedSchema, LinkChangedSchema, RuntimeSpanSchema, WritePreparationSchema, RuntimeFailureKindSchema, RuntimeFailureKind, RuntimeUnavailableReasonSchema, RuntimeUnavailableReason, RuntimeRefusalReasonSchema, RuntimeRefusalReason, FollowObservationPhaseSchema, FollowObservationPhase, LinkStatusSchema, LinkStatus;
9283
9283
  var init_observability_desk_pb = __esm({
9284
9284
  "../adapter/proto/nomos/runtime/v2/observability_desk_pb.js"() {
9285
9285
  "use strict";
@@ -9291,7 +9291,7 @@ var init_observability_desk_pb = __esm({
9291
9291
  init_model_adoption_desk_pb();
9292
9292
  init_receiving_group_desk_pb();
9293
9293
  init_recovery_desk_pb();
9294
- file_nomos_runtime_v2_observability_desk = /* @__PURE__ */ fileDesc22("Cilub21vcy9ydW50aW1lL3YyL29ic2VydmFiaWxpdHlfZGVzay5wcm90bxIQbm9tb3MucnVudGltZS52MiJCCgxUcmFjZUNvbnRleHQSEAoIdHJhY2VfaWQYASABKAwSDwoHc3Bhbl9pZBgCIAEoDBIPCgdzYW1wbGVkGAMgASgIIp0CCg5SdW50aW1lRmFpbHVyZRIMCgRjb2RlGAEgASgJEg8KB21lc3NhZ2UYAiABKAkSEQoJY29tcG9uZW50GAMgASgJEhYKCXdvcmtzcGFjZRgEIAEoCUgAiAEBEhMKBmRvbWFpbhgFIAEoCUgBiAEBEhYKCWRpcmVjdGl2ZRgGIAEoCUgCiAEBEjkKCmF0dHJpYnV0ZXMYByADKAsyJS5ub21vcy5ydW50aW1lLnYyLkRpYWdub3N0aWNBdHRyaWJ1dGUSMgoEa2luZBgIIAEoDjIkLm5vbW9zLnJ1bnRpbWUudjIuUnVudGltZUZhaWx1cmVLaW5kQgwKCl93b3Jrc3BhY2VCCQoHX2RvbWFpbkIMCgpfZGlyZWN0aXZlIr4BChJSdW50aW1lVW5hdmFpbGFibGUSOgoGcmVhc29uGAEgASgOMioubm9tb3MucnVudGltZS52Mi5SdW50aW1lVW5hdmFpbGFibGVSZWFzb24SEQoJd29ya3NwYWNlGAIgASgJEhEKCXJldHJ5YWJsZRgDIAEoCBIfChJyZXRyeV9hZnRlcl9taWxsaXMYBCABKA1IAIgBARIOCgZkZXRhaWwYBSABKAlCFQoTX3JldHJ5X2FmdGVyX21pbGxpcyJ+Cg5SdW50aW1lUmVmdXNhbBI2CgZyZWFzb24YASABKA4yJi5ub21vcy5ydW50aW1lLnYyLlJ1bnRpbWVSZWZ1c2FsUmVhc29uEhEKCXdvcmtzcGFjZRgCIAEoCRIRCglyZ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kZPTExPV19PQlNFUlZBVElPTl9QSEFTRV9MT0NBTF9DT1BZX1VOUkVBREFCTEUQCypXCgpMaW5rU3RhdHVzEhsKF0xJTktfU1RBVFVTX1VOU1BFQ0lGSUVEEAASFAoQTElOS19TVEFUVVNfT1BFThABEhYKEkxJTktfU1RBVFVTX0NMT1NFRBACKnYKDFRyYW5zZmVyS2luZBIdChlUUkFOU0ZFUl9LSU5EX1VOU1BFQ0lGSUVEEAASFwoTVFJBTlNGRVJfS0lORF9ERUxUQRABEhYKElRSQU5TRkVSX0tJTkRfRlVMTBACEhYKElRSQU5TRkVSX0tJTkRfUFVTSBADYgZwcm90bzM", [file_google_protobuf_any2, file_nomos_kernel_v1_progress, file_nomos_runtime_v2_correspondence_desk, file_nomos_runtime_v2_custody_desk, file_nomos_runtime_v2_placement_desk, file_nomos_runtime_v2_maintenance_desk, file_nomos_runtime_v2_model_adoption_desk, file_nomos_runtime_v2_receiving_group_desk, file_nomos_runtime_v2_recovery_desk]);
9294
+ file_nomos_runtime_v2_observability_desk = /* @__PURE__ */ fileDesc22("Cilub21vcy9ydW50aW1lL3YyL29ic2VydmFiaWxpdHlfZGVzay5wcm90bxIQbm9tb3MucnVudGltZS52MiJCCgxUcmFjZUNvbnRleHQSEAoIdHJhY2VfaWQYASABKAwSDwoHc3Bhbl9pZBgCIAEoDBIPCgdzYW1wbGVkGAMgASgIIp0CCg5SdW50aW1lRmFpbHVyZRIMCgRjb2RlGAEgASgJEg8KB21lc3NhZ2UYAiABKAkSEQoJY29tcG9uZW50GAMgASgJEhYKCXdvcmtzcGFjZRgEIAEoCUgAiAEBEhMKBmRvbWFpbhgFIAEoCUgBiAEBEhYKCWRpcmVjdGl2ZRgGIAEoCUgCiAEBEjkKCmF0dHJpYnV0ZXMYByADKAsyJS5ub21vcy5ydW50aW1lLnYyLkRpYWdub3N0aWNBdHRyaWJ1dGUSMgoEa2luZBgIIAEoDjIkLm5vbW9zLnJ1bnRpbWUudjIuUnVudGltZUZhaWx1c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l9QSEFTRV9VTlNQRUNJRklFRBAAEiQKIEZPTExPV19PQlNFUlZBVElPTl9QSEFTRV9ERVNJUkVEEAESIAocRk9MTE9XX09CU0VSVkFUSU9OX1BIQVNFX0RVRRACEiQKIEZPTExPV19PQlNFUlZBVElPTl9QSEFTRV9SVU5OSU5HEAMSJAogRk9MTE9XX09CU0VSVkFUSU9OX1BIQVNFX1NFVFRMRUQQBBIwCixGT0xMT1dfT0JTRVJWQVRJT05fUEhBU0VfQVdBSVRJTkdfREVQRU5ERU5DWRAFEiQKIEZPTExPV19PQlNFUlZBVElPTl9QSEFTRV9PRkZMSU5FEAYSLworRk9MTE9XX09CU0VSVkFUSU9OX1BIQVNFX0lOVkFMSURfQ1JFREVOVElBTBAHEiQKIEZPTExPV19PQlNFUlZBVElPTl9QSEFTRV9CQUNLT0ZGEAgSLAooRk9MTE9XX09CU0VSVkFUSU9OX1BIQVNFX1JFQk9STl9SRU1PVEVMWRAJEiwKKEZPTExPV19PQlNFUlZBVElPTl9QSEFTRV9SRVBMQUNJTkdfTE9DQUwQChIyCi5GT0xMT1dfT0JTRVJWQVRJT05fUEhBU0VfTE9DQUxfQ09QWV9VTlJFQURBQkxFEAsqVwoKTGlua1N0YXR1cxIbChdMSU5LX1NUQVRVU19VTlNQRUNJRklFRBAAEhQKEExJTktfU1RBVFVTX09QRU4QARIWChJMSU5LX1NUQVRVU19DTE9TRUQQAip2CgxUcmFuc2ZlcktpbmQSHQoZVFJBTlNGRVJfS0lORF9VTlNQRUNJRklFRBAAEhcKE1RSQU5TRkVSX0tJTkRfREVMVEEQARIWChJUUkFOU0ZFUl9LSU5EX0ZVTEwQAhIWChJUUkFOU0ZFUl9LSU5EX1BVU0gQA2IGcHJvdG8z", [file_google_protobuf_any2, file_nomos_kernel_v1_progress, file_nomos_runtime_v2_correspondence_desk, file_nomos_runtime_v2_custody_desk, file_nomos_runtime_v2_placement_desk, file_nomos_runtime_v2_maintenance_desk, file_nomos_runtime_v2_model_adoption_desk, file_nomos_runtime_v2_receiving_group_desk, file_nomos_runtime_v2_recovery_desk]);
9295
9295
  RuntimeFailureSchema = /* @__PURE__ */ messageDesc22(file_nomos_runtime_v2_observability_desk, 1);
9296
9296
  RuntimeUnavailableSchema = /* @__PURE__ */ messageDesc22(file_nomos_runtime_v2_observability_desk, 2);
9297
9297
  RuntimeRefusalSchema = /* @__PURE__ */ messageDesc22(file_nomos_runtime_v2_observability_desk, 3);
@@ -9305,6 +9305,7 @@ var init_observability_desk_pb = __esm({
9305
9305
  SyncCompletedSchema = /* @__PURE__ */ messageDesc22(file_nomos_runtime_v2_observability_desk, 11);
9306
9306
  LinkChangedSchema = /* @__PURE__ */ messageDesc22(file_nomos_runtime_v2_observability_desk, 12);
9307
9307
  RuntimeSpanSchema = /* @__PURE__ */ messageDesc22(file_nomos_runtime_v2_observability_desk, 15);
9308
+ WritePreparationSchema = /* @__PURE__ */ messageDesc22(file_nomos_runtime_v2_observability_desk, 18);
9308
9309
  RuntimeFailureKindSchema = /* @__PURE__ */ enumDesc15(file_nomos_runtime_v2_observability_desk, 0);
9309
9310
  RuntimeFailureKind = /* @__PURE__ */ tsEnum15(RuntimeFailureKindSchema);
9310
9311
  RuntimeUnavailableReasonSchema = /* @__PURE__ */ enumDesc15(file_nomos_runtime_v2_observability_desk, 1);
@@ -11691,7 +11692,7 @@ function filesystemCustodyFetch(dataDir, origin, options = {}, networkFetch = fe
11691
11692
  async function runGitHttpBackend(projectRoot, { method, pathInfo, query: query2, contentType, body }, options = {}) {
11692
11693
  const stdin = body && body.length ? await requestBodyStdin(body) : void 0;
11693
11694
  try {
11694
- return await new Promise((resolve8, reject) => {
11695
+ return await new Promise((resolve9, reject) => {
11695
11696
  const env = {
11696
11697
  ...process.env,
11697
11698
  GIT_PROJECT_ROOT: projectRoot,
@@ -11766,7 +11767,7 @@ async function runGitHttpBackend(projectRoot, { method, pathInfo, query: query2,
11766
11767
  }
11767
11768
  headers[k] = v;
11768
11769
  }
11769
- resolve8({ status: status2, headers, body: payload });
11770
+ resolve9({ status: status2, headers, body: payload });
11770
11771
  });
11771
11772
  });
11772
11773
  } finally {
@@ -14850,6 +14851,22 @@ var init_credential_sessions = __esm({
14850
14851
  }
14851
14852
  });
14852
14853
 
14854
+ // ../peer-office/src/runtime/credential_failure.ts
14855
+ function recoverableCredential(failure) {
14856
+ return failure.code === "nomos.auth.token_expired" || failure.code === "nomos.auth.token_missing";
14857
+ }
14858
+ function syncNeedsCredentialRefresh(result, failure) {
14859
+ if (failure !== void 0 && recoverableCredential(failure)) return true;
14860
+ const offer = result?.offerReceipt?.outcome;
14861
+ const pushNeedsRefresh = offer?.case === "failure" ? recoverableCredential(offer.value) : result?.pushError?.status === 401;
14862
+ return pushNeedsRefresh || result?.discoveryError?.status === 401;
14863
+ }
14864
+ var init_credential_failure = __esm({
14865
+ "../peer-office/src/runtime/credential_failure.ts"() {
14866
+ "use strict";
14867
+ }
14868
+ });
14869
+
14853
14870
  // ../peer-office/src/runtime/credential_renewal.ts
14854
14871
  function identityTokenClaim(token, claim) {
14855
14872
  const claims = tokenClaims(token);
@@ -15048,19 +15065,11 @@ var init_sha256 = __esm({
15048
15065
 
15049
15066
  // ../peer-office/src/runtime/credential_recovery_desk.ts
15050
15067
  import { create as create17, fromBinary as fromBinary9, toBinary as toBinary8 } from "@bufbuild/protobuf";
15051
- function recoverableCredential(failure) {
15052
- return failure.code === "nomos.auth.token_expired" || failure.code === "nomos.auth.token_missing";
15053
- }
15054
- function syncNeedsCredentialRefresh(event) {
15055
- const failures = [event.result?.pushError, event.result?.discoveryError];
15056
- if (failures.some((failure) => failure?.status === 401 || failure?.status === 403)) return true;
15057
- const text2 = `${event.failure?.message ?? ""} ${failures.map((failure) => failure?.message ?? "").join(" ")}`.toLowerCase();
15058
- return text2.includes("unauthenticated") || text2.includes("token expired") || text2.includes("invalid token");
15059
- }
15060
15068
  var CredentialRecoveryDesk;
15061
15069
  var init_credential_recovery_desk = __esm({
15062
15070
  "../peer-office/src/runtime/credential_recovery_desk.ts"() {
15063
15071
  "use strict";
15072
+ init_credential_failure();
15064
15073
  init_kernel_pb();
15065
15074
  init_correspondence_desk_pb();
15066
15075
  init_credentials_desk_pb();
@@ -15145,7 +15154,7 @@ var init_credential_recovery_desk = __esm({
15145
15154
  return false;
15146
15155
  }
15147
15156
  observeSync(session, event) {
15148
- if (!syncNeedsCredentialRefresh(event) || this.#tokenless(session)) return;
15157
+ if (!syncNeedsCredentialRefresh(event.result, event.failure) || this.#tokenless(session)) return;
15149
15158
  this.#prune();
15150
15159
  const capability = this.#ports.capabilityFor(session);
15151
15160
  const existing = this.#active.get(capability);
@@ -16352,6 +16361,7 @@ var init_receiving_group_desk = __esm({
16352
16361
  #accounts = /* @__PURE__ */ new Map();
16353
16362
  /** D22: device key hash → the workspaces the console reported this key enrolled in (this process's memory, not truth). */
16354
16363
  #consoleEnrolments = /* @__PURE__ */ new Map();
16364
+ #preparingWrites = /* @__PURE__ */ new Map();
16355
16365
  #sequence = 0;
16356
16366
  #internalRequestId = 30000000000n;
16357
16367
  constructor(ports) {
@@ -16391,16 +16401,124 @@ var init_receiving_group_desk = __esm({
16391
16401
  if (head === account.observedHead) return;
16392
16402
  this.#tails.set(workspace, { ...account, inFlight: false, attempts: 0, notBefore: 0n });
16393
16403
  }
16394
- /** A refused nominal Home action can wait for framework recovery and retry once.
16395
- * Sealed/pending history is never re-signed, and no child is mistaken for Home. */
16404
+ /** Only a proven non-admission can enter recovery. Console-enrolled children
16405
+ * share the owning application's route, selected by credential capability and
16406
+ * principal, never by workspace-name guessing or an unverified payload. */
16396
16407
  recoverOffer(request, response) {
16397
- if (!this.#ports.call || request.command.case !== "kernelCall" || request.command.value.credentialUse !== CredentialUse.SESSION || request.command.value.request?.operation.case !== "offer" || request.command.value.request.operation.value.intent.case !== "call" || response.outcome.case !== "failure" || !["nomos.authz.signer_enrollment_missing", "nomos.authz.device_key_revoked"].includes(response.outcome.value.code)) return;
16408
+ if (!this.#ports.call || request.command.case !== "kernelCall" || request.command.value.credentialUse !== CredentialUse.SESSION || request.command.value.request?.operation.case !== "offer" || request.command.value.request.operation.value.intent.case !== "call") return;
16409
+ const missing = response.outcome.case === "failure" ? response.outcome.value.code === "nomos.authz.signer_enrollment_missing" : response.outcome.case === "offer" && response.outcome.value.outcome.case === "refused" && response.outcome.value.outcome.value.refusal?.code === KernelRefusalCode.FORGED_PRINCIPAL && response.outcome.value.outcome.value.refusal.details?.fields.actor?.kind.case === "text" && response.outcome.value.outcome.value.refusal.details.fields.actor.kind.value === "unenrolled-signer-key";
16410
+ const revoked = response.outcome.case === "failure" && response.outcome.value.code === "nomos.authz.device_key_revoked";
16411
+ if (!missing && !revoked) return;
16398
16412
  const binding = this.#ports.binding(request.command.value.session);
16399
- const account = binding ? this.#accounts.get(binding.workspace) : void 0;
16400
- if (!account) return;
16413
+ if (!binding) return;
16414
+ const enrolled = [...this.#accounts.values()].find((account2) => {
16415
+ const owner = this.#ports.binding(account2.session);
16416
+ return account2.enrolment && owner?.credentialCapability === binding.credentialCapability && owner.principal === binding.principal;
16417
+ });
16401
16418
  const copy3 = fromBinary14(RuntimeRequestSchema, toBinary11(RuntimeRequestSchema, request));
16419
+ if (enrolled?.enrolment) {
16420
+ if (revoked) return this.#writeRefused(binding.workspace, "This device's access has been revoked.");
16421
+ return this.#begin(request, `enrolled-write-${++this.#sequence}`, (workId2) => this.#prepareEnrolledWrite(copy3, binding, enrolled.application, enrolled.enrolment, workId2));
16422
+ }
16423
+ const account = this.#accounts.get(binding.workspace);
16424
+ if (!account) return;
16402
16425
  return this.#begin(request, `receiving-group-authoring-${++this.#sequence}`, (workId2) => this.#recoverOffer(copy3, response, account, workId2));
16403
16426
  }
16427
+ #writeRefused(workspace, detail, reason = RuntimeRefusalReason.ACCESS_DENIED) {
16428
+ return { case: "refused", value: create24(RuntimeRefusalSchema, {
16429
+ reason,
16430
+ workspace,
16431
+ retryable: false,
16432
+ detail
16433
+ }) };
16434
+ }
16435
+ #writeWaiting(workspace, detail) {
16436
+ return { case: "unavailable", value: create24(RuntimeUnavailableSchema, {
16437
+ reason: RuntimeUnavailableReason.CREDENTIAL_UNAVAILABLE,
16438
+ workspace,
16439
+ retryable: true,
16440
+ retryAfterMillis: 1e3,
16441
+ detail
16442
+ }) };
16443
+ }
16444
+ *#prepareEnrolledWrite(request, binding, application, route, workId2) {
16445
+ if (request.command.case !== "kernelCall") throw new Error("write preparation lost its call");
16446
+ const command = request.command.value;
16447
+ const principal = binding.principal;
16448
+ const unavailable = () => this.#writeWaiting(
16449
+ binding.workspace,
16450
+ "This device is still being prepared to save changes. Your change has not been saved. Try again when connected."
16451
+ );
16452
+ this.#ports.emit(binding.session, { case: "writePreparation", value: create24(WritePreparationSchema, {
16453
+ requestId: command.request.requestId,
16454
+ workspace: binding.workspace
16455
+ }) });
16456
+ const key2 = JSON.stringify([binding.credentialCapability, principal, binding.workspace]);
16457
+ const shared = this.#preparingWrites.get(key2);
16458
+ const deadline = this.#ports.clock.monotonicNanoseconds() + 30000000000n;
16459
+ let wake = 0;
16460
+ if (shared) {
16461
+ while (!shared.settled) {
16462
+ if (this.#ports.clock.monotonicNanoseconds() >= deadline) return unavailable();
16463
+ const receipt = yield { case: "wake", value: create24(PeerWakeEffectSchema, {
16464
+ effectId: `${workId2}:join-${++wake}`,
16465
+ delayMillis: 250
16466
+ }) };
16467
+ if (receipt.outcome.case !== "woken") return unavailable();
16468
+ }
16469
+ if (shared.result) return shared.result;
16470
+ } else {
16471
+ const preparation = { settled: false };
16472
+ this.#preparingWrites.set(key2, preparation);
16473
+ try {
16474
+ const secret = this.#ports.authorSecretIfPresent(binding.session);
16475
+ if (!secret) return preparation.result = this.#writeRefused(binding.workspace, "Sign in again to set up this device.", RuntimeRefusalReason.INVALID_CREDENTIAL);
16476
+ const keyHash = sha256Hex6(this.#ports.deriveSigningPublicKey(secret));
16477
+ let posture = this.#ports.posture(request, binding.session, principal, secret, false);
16478
+ if (posture.deviceSignerStatus === DeviceSignerStatus.REVOKED) {
16479
+ return preparation.result = this.#writeRefused(binding.workspace, "This device's access has been revoked.");
16480
+ }
16481
+ if (!posture.enrolledDevice || posture.deviceSignerStatus !== DeviceSignerStatus.ACTIVE) {
16482
+ const enrolled = yield* this.#enrolAtConsole(
16483
+ route,
16484
+ binding,
16485
+ `${application}|${principal}`,
16486
+ principal,
16487
+ keyHash,
16488
+ [binding.workspace],
16489
+ `${workId2}:console`
16490
+ );
16491
+ if (enrolled.case === "deferred") return preparation.result = enrolled.credentialRefused ? this.#writeRefused(binding.workspace, "Sign in again to set up this device.", RuntimeRefusalReason.INVALID_CREDENTIAL) : unavailable();
16492
+ if (!(binding.workspace in enrolled.value.heads)) {
16493
+ return preparation.result = this.#writeRefused(binding.workspace, "This device could not obtain access to save changes in this workspace.");
16494
+ }
16495
+ while (true) {
16496
+ posture = this.#ports.posture(request, binding.session, principal, secret, false);
16497
+ if (posture.deviceSignerStatus === DeviceSignerStatus.REVOKED) {
16498
+ return preparation.result = this.#writeRefused(binding.workspace, "This device's access has been revoked.");
16499
+ }
16500
+ if (posture.enrolledDevice && posture.deviceSignerStatus === DeviceSignerStatus.ACTIVE) break;
16501
+ if (this.#ports.clock.monotonicNanoseconds() >= deadline) return preparation.result = unavailable();
16502
+ const receipt = yield { case: "wake", value: create24(PeerWakeEffectSchema, {
16503
+ effectId: `${workId2}:observe-${++wake}`,
16504
+ delayMillis: 500
16505
+ }) };
16506
+ if (receipt.outcome.case !== "woken") return preparation.result = unavailable();
16507
+ }
16508
+ }
16509
+ } catch (error) {
16510
+ if (error instanceof ReceivingGroupRefusal) {
16511
+ return preparation.result = this.#writeRefused(binding.workspace, "This device could not obtain access to save changes in this workspace.");
16512
+ }
16513
+ preparation.result = unavailable();
16514
+ throw error;
16515
+ } finally {
16516
+ preparation.settled = true;
16517
+ this.#preparingWrites.delete(key2);
16518
+ }
16519
+ }
16520
+ return { case: "retried", request, response: this.#ports.call(request, command) };
16521
+ }
16404
16522
  *#recoverOffer(request, response, account, workId2) {
16405
16523
  const workspace = this.#ports.binding(account.session).workspace;
16406
16524
  const deadline = this.#ports.clock.monotonicNanoseconds() + 60000000000n;
@@ -16468,6 +16586,7 @@ var init_receiving_group_desk = __esm({
16468
16586
  this.#opening.clear();
16469
16587
  this.#accounts.clear();
16470
16588
  this.#consoleEnrolments.clear();
16589
+ this.#preparingWrites.clear();
16471
16590
  }
16472
16591
  #begin(request, workId2, procedure) {
16473
16592
  const held = {
@@ -20359,6 +20478,7 @@ var init_replica_follow_controller = __esm({
20359
20478
  init_replica_follow_state();
20360
20479
  init_local_copy_readability();
20361
20480
  init_placement_desk();
20481
+ init_credential_failure();
20362
20482
  ReplicaFollowReconciliationKind = Object.freeze({
20363
20483
  Following: "following",
20364
20484
  NotFollowing: "not_following"
@@ -20626,12 +20746,12 @@ var init_replica_follow_controller = __esm({
20626
20746
  this.#desk.transition(result.workspace, { case: ReplicaFollowEventKind.WentOffline, nowUnixMillis });
20627
20747
  return delayUntilDue(this.#desk.get(result.workspace), nowUnixMillis);
20628
20748
  }
20629
- const credentialFailure = [result.pushError, result.discoveryError].find((failure) => failure?.status === 401 || failure?.status === 403);
20630
- if (credentialFailure) {
20749
+ if (syncNeedsCredentialRefresh(result)) {
20750
+ const offer = result.offerReceipt?.outcome;
20631
20751
  const transition = this.#desk.transition(result.workspace, {
20632
20752
  case: ReplicaFollowEventKind.CredentialRejected,
20633
20753
  nowUnixMillis,
20634
- failure: credentialFailure.message || `remote rejected credential with HTTP ${credentialFailure.status}`
20754
+ failure: (offer?.case === "failure" ? offer.value.message : void 0) || result.pushError?.message || result.discoveryError?.message || "remote requires a refreshed credential"
20635
20755
  });
20636
20756
  if (transition.effects.some((effect) => effect.case === ReplicaFollowEffectKind.RefreshCredential)) {
20637
20757
  return 0;
@@ -22818,7 +22938,7 @@ import { create as create55, fromBinary as fromBinary20 } from "@bufbuild/protob
22818
22938
  function releaseSyncJudgment(workspace) {
22819
22939
  judgedThisLifetime.delete(workspace);
22820
22940
  }
22821
- var PLACEMENT_REF3, LAW_PRODUCTS_MEDIA_TYPE, WorkspaceSyncPhase, trackedMain, NO_COMMON_BASE, deferredRemote, deferredLocal, judgedThisLifetime, MAX_REBASES_PER_ROUND, elapsedMillis, WorkspaceSyncWork;
22941
+ var PLACEMENT_REF3, LAW_PRODUCTS_MEDIA_TYPE, WorkspaceSyncPhase, trackedMain, deferredRemote, deferredLocal, judgedThisLifetime, MAX_REBASES_PER_ROUND, elapsedMillis, WorkspaceSyncWork;
22822
22942
  var init_workspace_sync = __esm({
22823
22943
  "../peer-office/src/runtime/workspace_sync.ts"() {
22824
22944
  "use strict";
@@ -22844,7 +22964,6 @@ var init_workspace_sync = __esm({
22844
22964
  Done: "done"
22845
22965
  });
22846
22966
  trackedMain = "refs/remotes/nomos/main";
22847
- NO_COMMON_BASE = "this replica holds local history with no frontier its upstream ever confirmed; convergence needs a common admitted base \u2014 drop the local copy to refetch it, or re-discover a provider holding this lineage";
22848
22967
  deferredRemote = "refs/remotes/nomos/deferred";
22849
22968
  deferredLocal = "refs/nomos/sync-deferred-local";
22850
22969
  judgedThisLifetime = /* @__PURE__ */ new Map();
@@ -23052,38 +23171,13 @@ var init_workspace_sync = __esm({
23052
23171
  }), { case: "awaiting", requestId });
23053
23172
  }
23054
23173
  /**
23055
- * NO COMMON BASE — a round that cannot converge, and must not pay for history to find out.
23056
- *
23057
- * This replica holds a non-empty ledger but has never recorded a frontier its upstream
23058
- * confirmed (`refs/remotes/nomos/main` is absent). The kernel refuses convergence in that
23059
- * state ("a non-empty live ledger requires a common admitted base"), so every step after the
23060
- * O(1) frontier probe is wasted work — and it is not cheap waste: the fetch negotiates with
23061
- * no `have` (a full-history pack), and the dependency planner decodes EVERY intent from
23062
- * genesis and inspects every change, once per round. That is O(history) per follow round,
23063
- * repeated at every retry, for a round that can only end in a refusal.
23064
- *
23065
- * The one base this round can establish costs nothing and is established before this is
23066
- * asked: an upstream holding exactly this replica's head (the probe's answer) converges it
23067
- * and records the tracking frontier. Anything else needs the local copy to be dropped and
23068
- * refetched (an application decision, which preserves the copy), or a re-discovery that
23069
- * names a provider holding this lineage. Both are reported, at O(1), as this failure.
23070
- */
23071
- /**
23072
- * Establish this round's base when none is tracked, without walking any history it can avoid.
23073
- *
23074
- * The upstream just named its own frontier. If that commit is in THIS replica's lineage, it is
23075
- * a common admitted base by definition — both sides hold it — and adopting it turns the round
23076
- * into an ordinary fast-forward: the offer carries only the suffix above it, the fetch can name
23077
- * it as a truthful `have`, and convergence has the base the kernel requires. One commit walk
23078
- * (no change decoding, no pack, no network) decides it.
23079
- *
23080
- * If it is not in this replica's lineage, no base exists to establish and the round is refused
23081
- * (#noCommonBase) before it leases, fetches or plans anything.
23082
- *
23083
- * A kernel without the commit walk cannot be asked, so it keeps the previous behaviour.
23174
+ * Establish a cheap base when the provider's current tip is in our local chain.
23175
+ * A negative answer means the base is unknown: both sides may have advanced from
23176
+ * an earlier shared commit. Acquire the candidate and let the kernel discover
23177
+ * and judge that history. A tracking bookmark is not an admission prerequisite.
23084
23178
  */
23085
23179
  #establishBase(upstreamHead) {
23086
- if (!this.#noCommonBase() || !this.#kernel.historySummary) return true;
23180
+ if (!this.#missingTrackedBase() || !this.#kernel.historySummary) return true;
23087
23181
  const summary = this.#kernel.historySummary(this.#mount, this.#requestId, upstreamHead, this.#localHead);
23088
23182
  if (!summary.reachedBase) return false;
23089
23183
  this.#previousHead = upstreamHead;
@@ -23098,26 +23192,9 @@ var init_workspace_sync = __esm({
23098
23192
  get establishedBase() {
23099
23193
  return this.#establishedBase;
23100
23194
  }
23101
- #noCommonBase() {
23195
+ #missingTrackedBase() {
23102
23196
  return this.#previousHead === void 0 && this.#localHead !== void 0 && this.#replaceLocalHead === void 0;
23103
23197
  }
23104
- #noCommonBaseResult() {
23105
- return this.#finish(create55(SyncWorkspaceResponseSchema, {
23106
- workspace: this.#mount.workspace,
23107
- ...this.#localHead === void 0 ? {} : { currentHead: this.#localHead },
23108
- stillAhead: true,
23109
- ...this.#offerReceipt === void 0 ? {} : { offerReceipt: this.#offerReceipt },
23110
- pushError: create55(RuntimeTransportFailureSchema, {
23111
- endpoint: this.#offerEndpoint(),
23112
- status: 409,
23113
- refused: true,
23114
- message: NO_COMMON_BASE
23115
- }),
23116
- timings: create55(SyncPhaseTimingsSchema, {
23117
- convergeMillis: elapsedMillis(this.#clock, this.#started)
23118
- })
23119
- }));
23120
- }
23121
23198
  #holdsLocalWork() {
23122
23199
  return this.#command.admit && !!this.#localHead && this.#localHead !== this.#previousHead;
23123
23200
  }
@@ -23269,7 +23346,6 @@ var init_workspace_sync = __esm({
23269
23346
  if (!this.#desiredHead) return this.#transportFailure("resident peer returned no admitted frontier", false);
23270
23347
  this.#candidateDurable = admission.sealedMain === this.#desiredHead;
23271
23348
  if (state.phase === WorkspaceSyncPhase.Probe && this.#desiredHead !== this.#localHead) {
23272
- if (!this.#establishBase(this.#desiredHead)) return this.#noCommonBaseResult();
23273
23349
  if (this.#alreadyJudged(this.#desiredHead)) {
23274
23350
  return this.#finish(create55(SyncWorkspaceResponseSchema, {
23275
23351
  workspace: this.#mount.workspace,
@@ -23281,6 +23357,22 @@ var init_workspace_sync = __esm({
23281
23357
  offerReceipt: this.#offerReceipt
23282
23358
  }));
23283
23359
  }
23360
+ if (!this.#establishBase(this.#desiredHead)) {
23361
+ this.#offerAfterConverge = this.#command.admit;
23362
+ this.#rebaseFrom = void 0;
23363
+ return this.#leaseEffect();
23364
+ }
23365
+ if (this.#establishedBase && !this.#candidateDurable && this.#kernel.resolveRef(this.#mount, this.#requestId, trackedMain) === void 0) {
23366
+ return this.#finish(create55(SyncWorkspaceResponseSchema, {
23367
+ workspace: this.#mount.workspace,
23368
+ currentHead: this.#localHead,
23369
+ previousHead: this.#previousHead,
23370
+ stillAhead: true,
23371
+ directOfferDeferred: true,
23372
+ reconnectRequired: false,
23373
+ offerReceipt: this.#offerReceipt
23374
+ }));
23375
+ }
23284
23376
  if (this.#probeOnly) {
23285
23377
  this.#needsReconciliation = true;
23286
23378
  return this.#finish(create55(SyncWorkspaceResponseSchema, {
@@ -23326,7 +23418,7 @@ var init_workspace_sync = __esm({
23326
23418
  return this.#converge(this.#desiredHead, admission.resultPack.byteLength, 0);
23327
23419
  }
23328
23420
  if (this.#desiredHead === this.#previousHead) return this.#converge(this.#desiredHead, 0, 0);
23329
- if (!this.#establishBase(this.#desiredHead)) return this.#noCommonBaseResult();
23421
+ this.#establishBase(this.#desiredHead);
23330
23422
  if (admission.recoveryRequired !== false) return this.#leaseEffect();
23331
23423
  return this.#transportFailure("resident peer supplied neither the missing delta nor a history gap", false);
23332
23424
  }
@@ -23549,7 +23641,7 @@ var init_workspace_sync = __esm({
23549
23641
  }
23550
23642
  }
23551
23643
  #converge(candidateHead, receivedBytes, prefetchMillis) {
23552
- if (!this.#establishBase(candidateHead)) return this.#noCommonBaseResult();
23644
+ this.#establishBase(candidateHead);
23553
23645
  this.#beforeConverge?.(candidateHead, this.#previousHead);
23554
23646
  const convergeStarted = this.#clock.monotonicNanoseconds();
23555
23647
  let judged;
@@ -23883,9 +23975,9 @@ var init_workspace_sync = __esm({
23883
23975
  return this.#route?.receptionUrl || `${this.#cloudBase()}/v2/workspaces/${encodeURIComponent(this.#mount.workspace)}`;
23884
23976
  }
23885
23977
  #authToken() {
23886
- const resolve8 = this.#credentials.authTokenForCapability ?? this.#credentials.authToken;
23887
- if (!resolve8) throw new Error("workspace sync has no credential capability resolver");
23888
- return resolve8.call(this.#credentials, this.#binding.credentialCapability);
23978
+ const resolve9 = this.#credentials.authTokenForCapability ?? this.#credentials.authToken;
23979
+ if (!resolve9) throw new Error("workspace sync has no credential capability resolver");
23980
+ return resolve9.call(this.#credentials, this.#binding.credentialCapability);
23889
23981
  }
23890
23982
  };
23891
23983
  }
@@ -26083,13 +26175,21 @@ var init_correspondence_desk = __esm({
26083
26175
  }
26084
26176
  #observeSyncResult(requestId, workId2, result) {
26085
26177
  const timings = result.timings;
26178
+ const receipt = result.offerReceipt?.outcome;
26179
+ const admission = receipt?.case === "admission" ? receipt.value : void 0;
26086
26180
  this.#events.instant("peer.follow.sync-result", {
26087
26181
  request: create60(RuntimeRequestSchema, { protocolVersion: 2, requestId }),
26088
26182
  workspace: result.workspace
26089
26183
  }, {
26090
26184
  "sync.workId": workId2,
26091
26185
  ...result.currentHead ? { "sync.head": result.currentHead } : {},
26186
+ ...result.previousHead ? { "sync.previousHead": result.previousHead } : {},
26187
+ ...admission?.main ? { "sync.providerHead": admission.main } : {},
26188
+ ...admission?.sealedMain ? { "sync.sealedHead": admission.sealedMain } : {},
26092
26189
  "sync.stillAhead": result.stillAhead,
26190
+ "sync.reconnectRequired": result.reconnectRequired,
26191
+ "sync.refused": result.refused,
26192
+ "sync.deferred": result.deferred,
26093
26193
  "sync.directOfferDeferred": result.directOfferDeferred,
26094
26194
  "sync.offline": result.offline,
26095
26195
  ...timings ? {
@@ -29367,6 +29467,7 @@ var init_peer_office = __esm({
29367
29467
  return this.#responses.modelAdoption(request, step);
29368
29468
  }
29369
29469
  #receivingGroupResponse(request, step) {
29470
+ if (step.case === "refused") return this.#response(request, { case: "refused", value: step.value });
29370
29471
  if (step.case === "retried") return this.#birthCustodyResponse(step.request, this.#birthCustody.afterKernelCall(step.request, step.response));
29371
29472
  if (step.case === "pending") return this.#response(request, { case: "correspondencePending", value: step.value });
29372
29473
  if (step.case === "failure") return this.#failure(request, step.code, step.message);
@@ -29660,7 +29761,7 @@ function createPeerOfficeFrameRunner(kernel, credentials, profile, observations,
29660
29761
  const deadline = Date.now() + Math.max(0, withinMillis);
29661
29762
  while (outstanding() > 0 && Date.now() < deadline) {
29662
29763
  lanes.wake(0);
29663
- await new Promise((resolve8) => setTimeout(resolve8, 10));
29764
+ await new Promise((resolve9) => setTimeout(resolve9, 10));
29664
29765
  }
29665
29766
  return outstanding();
29666
29767
  },
@@ -29721,7 +29822,7 @@ async function drivePeerFrame(runner, initialFrame, fetchImpl = globalThis.fetch
29721
29822
  if (response.outcome.case === "localReadPending") {
29722
29823
  if (yieldLocalReadToCaller) return responseFrame;
29723
29824
  const pending2 = response.outcome.value;
29724
- await new Promise((resolve8) => setTimeout(resolve8, pending2.resumeAfterMillis));
29825
+ await new Promise((resolve9) => setTimeout(resolve9, pending2.resumeAfterMillis));
29725
29826
  responseFrame = runner.handleFrame(toBinary26(RuntimeRequestSchema, create72(RuntimeRequestSchema, {
29726
29827
  protocolVersion: response.protocolVersion,
29727
29828
  requestId: response.requestId,
@@ -29891,7 +29992,7 @@ async function executeHistoryAcquisitionEffect(effect, custody) {
29891
29992
  }
29892
29993
  }
29893
29994
  async function executeWakeEffect(effect) {
29894
- await new Promise((resolve8) => setTimeout(resolve8, effect.delayMillis));
29995
+ await new Promise((resolve9) => setTimeout(resolve9, effect.delayMillis));
29895
29996
  return create72(PeerEffectReceiptSchema, { effectId: effect.effectId, outcome: { case: "woken", value: create72(PeerWokenSchema) } });
29896
29997
  }
29897
29998
  async function executeCredentialRefreshEffect(effect, provider) {
@@ -31208,7 +31309,7 @@ async function prepareRemoteModelTransition(cloud, input) {
31208
31309
  }
31209
31310
  atHash = status2.outcome.value.head ?? "";
31210
31311
  if (atHash || Date.now() >= deadline) break;
31211
- await new Promise((resolve8) => setTimeout(resolve8, 1e3));
31312
+ await new Promise((resolve9) => setTimeout(resolve9, 1e3));
31212
31313
  }
31213
31314
  if (!atHash) {
31214
31315
  throw new Error("workspace has no current Git frontier to prove after pulling it");
@@ -31254,8 +31355,8 @@ async function prepareRemoteModelTransition(cloud, input) {
31254
31355
  target3
31255
31356
  );
31256
31357
  if (response.outcome.case !== "unavailable" || !response.outcome.value.retryable || Date.now() >= proofDeadline) break;
31257
- await new Promise((resolve8) => setTimeout(
31258
- resolve8,
31358
+ await new Promise((resolve9) => setTimeout(
31359
+ resolve9,
31259
31360
  Math.max(500, response.outcome.case === "unavailable" ? response.outcome.value.retryAfterMillis ?? 1e3 : 1e3)
31260
31361
  ));
31261
31362
  }
@@ -32108,7 +32209,7 @@ async function waitForWorkspaceMain(cloud, workspace, timeoutMs = 3e4) {
32108
32209
  while (Date.now() < deadline) {
32109
32210
  const head = await workspaceMainHead(cloud, workspace);
32110
32211
  if (head !== void 0) return head;
32111
- await new Promise((resolve8) => setTimeout(resolve8, 250));
32212
+ await new Promise((resolve9) => setTimeout(resolve9, 250));
32112
32213
  }
32113
32214
  return void 0;
32114
32215
  }
@@ -32329,7 +32430,7 @@ async function ensureSovereignHome(opts = {}) {
32329
32430
  const deadline = Date.now() + 3e4;
32330
32431
  while (Date.now() < deadline) {
32331
32432
  if (await fetch(`${cloud}/v2/workspaces/${encodeURIComponent(home)}`).then((r) => r.ok).catch(() => false)) break;
32332
- await new Promise((resolve8) => setTimeout(resolve8, 250));
32433
+ await new Promise((resolve9) => setTimeout(resolve9, 250));
32333
32434
  }
32334
32435
  if (!await fetch(`${cloud}/v2/workspaces/${encodeURIComponent(home)}`).then((r) => r.ok).catch(() => false)) {
32335
32436
  throw new Error(`Nomos admitted the birth of '${home}' but its custody did not become readable`);
@@ -32377,7 +32478,7 @@ async function ensureSovereignHome(opts = {}) {
32377
32478
  return typeof leaf?.verifiedVia === "string" && leaf.verifiedVia.length > 0;
32378
32479
  }).catch(() => false);
32379
32480
  if (visible) break;
32380
- await new Promise((resolve8) => setTimeout(resolve8, 250));
32481
+ await new Promise((resolve9) => setTimeout(resolve9, 250));
32381
32482
  }
32382
32483
  if (!visible) throw new Error(`the session home's verified device enrollment did not become readable`);
32383
32484
  }
@@ -32391,8 +32492,19 @@ async function ensureApplicationWorkspace(application, opts = {}) {
32391
32492
  }
32392
32493
  const statusUrl = `${cloud}/v2/workspaces/${encodeURIComponent(application)}`;
32393
32494
  const current = await fetch(statusUrl).catch(() => null);
32394
- if (current?.ok) {
32395
- const status2 = await current.json().catch(() => null);
32495
+ const status2 = current?.ok ? await current.json().catch(() => null) : null;
32496
+ let unborn = false;
32497
+ if (current?.ok && !status2?.lineage && !status2?.durableHead && !status2?.sealedHead) {
32498
+ const domains2 = await fetch(`${statusUrl}/domains`);
32499
+ if (domains2.status === 409) {
32500
+ const body2 = await domains2.json().catch(() => null);
32501
+ unborn = typeof body2?.error === "string" && body2.error.includes("unborn");
32502
+ }
32503
+ if (!unborn && !domains2.ok) {
32504
+ throw new Error(`could not establish whether application '${application}' has custody (${domains2.status})`);
32505
+ }
32506
+ }
32507
+ if (current?.ok && !unborn) {
32396
32508
  const principal = String(status2?.lineage?.principal ?? "");
32397
32509
  const actualParent = String(status2?.lineage?.parent ?? "");
32398
32510
  const expectedParent = requestedParent === "root" ? "" : requestedParent;
@@ -32428,7 +32540,7 @@ async function ensureApplicationWorkspace(application, opts = {}) {
32428
32540
  ...principal !== "" && session !== "" && sameIdentity(principal, session) ? { deployPrincipal: principal } : {}
32429
32541
  };
32430
32542
  }
32431
- if (current !== null && current.status !== 404 && current.status !== 409) {
32543
+ if (current !== null && !unborn && current.status !== 404 && current.status !== 409) {
32432
32544
  throw new Error(`could not inspect deploy target '${application}' (${current.status}); refusing to guess that it is unborn`);
32433
32545
  }
32434
32546
  if (requestedParent !== void 0) {
@@ -33750,7 +33862,7 @@ async function waitForDurableMainAdvance(cloud, ws2, previousHead, opts = {}) {
33750
33862
  while (Date.now() < deadline) {
33751
33863
  const head = await durableMainHead(cloud, ws2, fetchImpl);
33752
33864
  if (head !== void 0 && head !== previousHead) return head;
33753
- await new Promise((resolve8) => setTimeout(resolve8, pollMs));
33865
+ await new Promise((resolve9) => setTimeout(resolve9, pollMs));
33754
33866
  }
33755
33867
  return void 0;
33756
33868
  }
@@ -34306,8 +34418,10 @@ var init_commands = __esm({
34306
34418
  "mcp",
34307
34419
  "init-editor",
34308
34420
  "test",
34421
+ "conformance",
34309
34422
  "doctor",
34310
34423
  "cloud",
34424
+ "console",
34311
34425
  "status",
34312
34426
  "model",
34313
34427
  "platform",
@@ -34358,6 +34472,19 @@ var init_help = __esm({
34358
34472
  "use strict";
34359
34473
  init_commands();
34360
34474
  HELP = {
34475
+ console: {
34476
+ usage: "githolon console <login|logout|workspaces|universe|rollouts>",
34477
+ what: "Use a downloaded console API credential. The browser and CLI use the same console API.\nCredentials are stored locally with owner-only permissions; tokens are never printed.",
34478
+ flags: [
34479
+ ["login --file <credential.json>", "verify and save a downloaded credential"],
34480
+ ["logout", "remove the local credential; revoke other copies in the console"],
34481
+ ["workspaces | universe", "read registered workspaces or their live subtree as JSON"],
34482
+ ["rollouts [show <id>]", "list runs or inspect one"],
34483
+ ["rollouts start --file <request.json>", "submit {payload:{kind:law,source:workspace},only:[workspace]} (JSON strings quoted)"],
34484
+ ["rollouts resume <id>", "retry an existing law rollout"]
34485
+ ],
34486
+ examples: ["githolon console login --file nomos-console-example.json", "githolon console workspaces"]
34487
+ },
34361
34488
  compile: {
34362
34489
  usage: "githolon compile [config] [--require-usdcat]",
34363
34490
  what: "Compile typed authoring input into canonical OpenUSD. nomos.project.ts emits the readable law\nclosure, its .law.usdz transport archive, and generated clients; nomos.application.ts emits the application\ncomposition stage. TypeScript is authoring input only: the kernel admits and custodies USD.",
@@ -34423,6 +34550,16 @@ var init_help = __esm({
34423
34550
  ],
34424
34551
  examples: ["githolon cloud dev", "githolon cloud dev --port 8787 --ephemeral", "githolon cloud dev --platform my-platform --law build/my.law.usdz"]
34425
34552
  },
34553
+ conformance: {
34554
+ usage: "githolon conformance [--json] [--offline] [--runtime <directory>]",
34555
+ what: "Check the installed Node packages with an isolated generated application and the real test harness.\nProves write, read, refusal without mutation, persisted history and cold restore. Reports package versions\nand the kernel identity. First use may download verified runtime artifacts; no cloud workspace is changed.",
34556
+ flags: [
34557
+ ["--json", "emit one report for CI; exit nonzero if any check fails"],
34558
+ ["--offline", "use local runtime artifacts only; fail if unavailable"],
34559
+ ["--runtime <directory>", "use this verified runtime bundle"]
34560
+ ],
34561
+ examples: ["githolon conformance", "githolon conformance --offline --json"]
34562
+ },
34426
34563
  test: {
34427
34564
  usage: "githolon test [test-file-or-flutter-test-flags] [--diagnostics]",
34428
34565
  what: "Run generated Dart application scenarios through Flutter with the real local Nomos custody plane.\nThe server rides inside githolon; connected scenarios, partitions, restarts and fresh reinstalls need no\nserver path, environment variables, certificates, workspace setup or separate application state.",
@@ -34689,6 +34826,84 @@ var init_help = __esm({
34689
34826
  }
34690
34827
  });
34691
34828
 
34829
+ // src/console.ts
34830
+ var console_exports = {};
34831
+ __export(console_exports, {
34832
+ consoleCommand: () => consoleCommand,
34833
+ consoleCredential: () => consoleCredential,
34834
+ consoleRequest: () => consoleRequest
34835
+ });
34836
+ import { URL as URL2 } from "node:url";
34837
+ import { chmodSync as chmodSync3, mkdirSync as mkdirSync10, readFileSync as readFileSync11, renameSync as renameSync4, rmSync as rmSync5, writeFileSync as writeFileSync11 } from "node:fs";
34838
+ import { join as join15 } from "node:path";
34839
+ import { randomUUID as randomUUID4 } from "node:crypto";
34840
+ function consoleCredential(value) {
34841
+ if (!value || typeof value !== "object") throw new Error("Invalid console credential file");
34842
+ const v = value;
34843
+ if (v.format !== "nomos-console-credential-v1" || typeof v.endpoint !== "string" || typeof v.tenant !== "string" || typeof v.token !== "string") throw new Error("Invalid console credential file");
34844
+ const endpoint = new URL2(v.endpoint);
34845
+ if (endpoint.protocol !== "https:" || endpoint.username || endpoint.password || endpoint.pathname !== "/" || endpoint.search || endpoint.hash) throw new Error("Console endpoint must be an HTTPS origin");
34846
+ const token = /^nomos_api\.([a-z][a-z0-9-]{1,62})\.[a-f0-9]{32}\.[A-Za-z0-9_-]{43}$/.exec(v.token);
34847
+ if (!token || token[1] !== v.tenant) throw new Error("Credential does not match its workspace account");
34848
+ return { format: v.format, endpoint: endpoint.origin, tenant: v.tenant, token: v.token };
34849
+ }
34850
+ async function consoleRequest(profile, path4, method = "GET", body, fetcher = fetch) {
34851
+ const response = await fetcher(profile.endpoint + path4, {
34852
+ method,
34853
+ redirect: "error",
34854
+ signal: AbortSignal.timeout(12e4),
34855
+ headers: { authorization: `Bearer ${profile.token}`, "content-type": "application/json" },
34856
+ ...body !== void 0 ? { body: JSON.stringify(body) } : {}
34857
+ });
34858
+ const result = await response.json();
34859
+ if (!response.ok) throw new Error(`Console ${response.status}: ${result.error ?? "request refused"}`);
34860
+ return result;
34861
+ }
34862
+ async function consoleCommand(args) {
34863
+ const file = join15(configDir(), "console.json");
34864
+ if (args[0] === "login" && args.length === 3 && args[1] === "--file") {
34865
+ const profile2 = consoleCredential(JSON.parse(readFileSync11(args[2], "utf8")));
34866
+ await consoleRequest(profile2, `/v1/tenants/${profile2.tenant}/workspaces`);
34867
+ mkdirSync10(configDir(), { recursive: true });
34868
+ const temporary = `${file}.${randomUUID4()}.tmp`;
34869
+ try {
34870
+ writeFileSync11(temporary, JSON.stringify(profile2) + "\n", { mode: 384, flag: "wx" });
34871
+ renameSync4(temporary, file);
34872
+ chmodSync3(file, 384);
34873
+ } finally {
34874
+ rmSync5(temporary, { force: true });
34875
+ }
34876
+ console.log(`Console credential saved for ${profile2.tenant} at ${profile2.endpoint}`);
34877
+ return 0;
34878
+ }
34879
+ if (args[0] === "logout" && args.length === 1) {
34880
+ rmSync5(file, { force: true });
34881
+ console.log("Local console credential removed. Revoke the key in the console to disable other copies.");
34882
+ return 0;
34883
+ }
34884
+ const profile = consoleCredential(JSON.parse(readFileSync11(file, "utf8")));
34885
+ const root = `/v1/tenants/${encodeURIComponent(profile.tenant)}`;
34886
+ let result;
34887
+ if (args[0] === "workspaces" && args.length === 1) result = await consoleRequest(profile, `${root}/workspaces`);
34888
+ else if (args[0] === "universe" && args.length === 1) result = await consoleRequest(profile, "/v1/universe");
34889
+ else if (args[0] === "rollouts" && args.length === 1) result = await consoleRequest(profile, `${root}/rollouts`);
34890
+ else if (args[0] === "rollouts" && args[1] === "show" && args.length === 3) result = await consoleRequest(profile, `${root}/rollouts/${encodeURIComponent(args[2])}`);
34891
+ else if (args[0] === "rollouts" && args[1] === "resume" && args.length === 3) result = await consoleRequest(profile, `${root}/rollouts/${encodeURIComponent(args[2])}/resume`, "POST", {});
34892
+ else if (args[0] === "rollouts" && args[1] === "start" && args[2] === "--file" && args.length === 4) {
34893
+ const input = JSON.parse(readFileSync11(args[3], "utf8"));
34894
+ if (input?.payload?.kind !== "law") throw new Error("Console CLI supports law rollouts only");
34895
+ result = await consoleRequest(profile, `${root}/rollouts`, "POST", input);
34896
+ } else throw new Error("See githolon console --help for supported commands");
34897
+ console.log(JSON.stringify(result, null, 2));
34898
+ return 0;
34899
+ }
34900
+ var init_console = __esm({
34901
+ "src/console.ts"() {
34902
+ "use strict";
34903
+ init_cloud();
34904
+ }
34905
+ });
34906
+
34692
34907
  // src/mcp.ts
34693
34908
  var mcp_exports = {};
34694
34909
  __export(mcp_exports, {
@@ -34957,35 +35172,171 @@ var init_mcp = __esm({
34957
35172
  }
34958
35173
  });
34959
35174
 
35175
+ // src/conformance.ts
35176
+ var conformance_exports = {};
35177
+ __export(conformance_exports, {
35178
+ runConformance: () => runConformance
35179
+ });
35180
+ import { spawnSync as spawnSync5 } from "node:child_process";
35181
+ import { cpSync, existsSync as existsSync13, mkdirSync as mkdirSync11, mkdtempSync as mkdtempSync4, readFileSync as readFileSync12, rmSync as rmSync6, symlinkSync, writeFileSync as writeFileSync12 } from "node:fs";
35182
+ import { createRequire as createRequire3 } from "node:module";
35183
+ import { tmpdir as tmpdir3 } from "node:os";
35184
+ import { dirname as dirname4, join as join17, resolve as resolve5 } from "node:path";
35185
+ import { fileURLToPath as fileURLToPath2 } from "node:url";
35186
+ function installedPackage(name, from) {
35187
+ const require2 = createRequire3(join17(from, "package.json"));
35188
+ const entry = require2.resolve(name === "@githolon/testing" ? name : `${name}/package.json`);
35189
+ for (let directory2 = dirname4(entry); ; directory2 = dirname4(directory2)) {
35190
+ const manifest = join17(directory2, "package.json");
35191
+ if (existsSync13(manifest)) {
35192
+ const pkg = JSON.parse(readFileSync12(manifest, "utf8"));
35193
+ if (pkg.name === name) return { name, version: pkg.version, directory: directory2 };
35194
+ }
35195
+ if (dirname4(directory2) === directory2) throw new Error(`Cannot identify installed ${name}`);
35196
+ }
35197
+ }
35198
+ function runConformance(args, cwd = process.cwd()) {
35199
+ let json = false, offline = false, runtime;
35200
+ for (let index = 0; index < args.length; index++) {
35201
+ const arg = args[index];
35202
+ if (arg === "--json") json = true;
35203
+ else if (arg === "--offline") offline = true;
35204
+ else if (arg === "--runtime" && args[index + 1] && !args[index + 1].startsWith("--")) runtime = resolve5(cwd, args[++index]);
35205
+ else {
35206
+ process.stderr.write(`error: unknown or incomplete conformance option: ${arg}. See githolon conformance --help.
35207
+ `);
35208
+ return 2;
35209
+ }
35210
+ }
35211
+ const report = { passed: false, packages: [], checks: [] };
35212
+ let scratch;
35213
+ let stage = "installed packages";
35214
+ let action = "Run npm install in this project. Install githolon, @githolon/dsl and @githolon/testing as development dependencies if absent.";
35215
+ try {
35216
+ const packages = ["githolon", "@githolon/dsl", "@githolon/testing"].map((name) => {
35217
+ const pkg = installedPackage(name, cwd);
35218
+ report.packages.push({ name, version: pkg.version });
35219
+ return pkg;
35220
+ });
35221
+ const [cli, dsl] = packages;
35222
+ const peer2 = installedPackage("@githolon/runtime", dsl.directory);
35223
+ report.packages.push({ name: peer2.name, version: peer2.version });
35224
+ report.checks.push({ name: stage, passed: true });
35225
+ if (!json) {
35226
+ process.stdout.write("Nomos conformance \u2014 isolated generated application, real local runtime\n");
35227
+ for (const pkg of report.packages) process.stdout.write(` ${pkg.name} ${pkg.version}
35228
+ `);
35229
+ }
35230
+ scratch = mkdtempSync4(join17(tmpdir3(), "nomos-conformance-"));
35231
+ const here = dirname4(fileURLToPath2(import.meta.url));
35232
+ const distribution = existsSync13(join17(here, "conformance-probe.mjs")) ? here : resolve5(here, "../dist");
35233
+ cpSync(join17(distribution, "conformance-fixture"), scratch, { recursive: true });
35234
+ writeFileSync12(join17(scratch, "package.json"), '{"name":"nomos-conformance-probe","private":true,"type":"module"}\n');
35235
+ const modules = join17(scratch, "node_modules");
35236
+ mkdirSync11(join17(modules, "@githolon"), { recursive: true });
35237
+ for (const pkg of [dsl, peer2]) {
35238
+ symlinkSync(pkg.directory, join17(modules, pkg.name), process.platform === "win32" ? "junction" : "dir");
35239
+ }
35240
+ const environment = { ...process.env, TMPDIR: scratch, TMP: scratch, TEMP: scratch };
35241
+ const run2 = (argv) => {
35242
+ const result = spawnSync5(process.execPath, argv, {
35243
+ cwd: scratch,
35244
+ env: environment,
35245
+ encoding: "utf8",
35246
+ timeout: 18e4,
35247
+ maxBuffer: 8 * 1024 * 1024
35248
+ });
35249
+ if (result.error) throw result.error;
35250
+ if (result.status !== 0) throw new Error((result.stderr || result.stdout || `Exited ${result.status}`).slice(-6e3));
35251
+ };
35252
+ stage = "compile generated application";
35253
+ action = "Reinstall compatible githolon and @githolon/dsl versions from your lockfile. If this bundled fixture still fails, report the diagnostic and package versions to Nomos.";
35254
+ if (!json) process.stdout.write(`Checking ${stage}\u2026
35255
+ `);
35256
+ run2([join17(cli.directory, "dist/cli.mjs"), "compile", "--no-mount-check"]);
35257
+ report.checks.push({ name: stage, passed: true });
35258
+ stage = "runtime and application behavior";
35259
+ action = "Check the selected runtime and installed @githolon/testing version. For an uncached runtime, run once online or supply a verified runtime directory with --runtime. Report repeatable behavior failures with this report.";
35260
+ if (!json) process.stdout.write(`Checking ${stage}\u2026
35261
+ `);
35262
+ const resultFile = join17(scratch, "result.json");
35263
+ const testingEntry = createRequire3(join17(cwd, "package.json")).resolve("@githolon/testing");
35264
+ const probe = spawnSync5(process.execPath, [
35265
+ join17(distribution, "conformance-probe.mjs"),
35266
+ testingEntry,
35267
+ scratch,
35268
+ resultFile,
35269
+ runtime ?? "",
35270
+ String(offline)
35271
+ ], {
35272
+ cwd: scratch,
35273
+ env: environment,
35274
+ encoding: "utf8",
35275
+ timeout: 18e4,
35276
+ maxBuffer: 8 * 1024 * 1024
35277
+ });
35278
+ if (existsSync13(resultFile)) {
35279
+ const result = JSON.parse(readFileSync12(resultFile, "utf8"));
35280
+ report.checks.push(...result.checks);
35281
+ if (result.runtime) report.runtime = result.runtime;
35282
+ if (result.failure) report.failure = result.failure;
35283
+ report.passed = result.passed && probe.status === 0;
35284
+ }
35285
+ if (!report.passed && !report.failure) throw probe.error ?? new Error((probe.stderr || probe.stdout || `Probe exited ${probe.status}`).slice(-6e3));
35286
+ } catch (error) {
35287
+ report.checks.push({ name: stage, passed: false });
35288
+ report.failure = { stage, detail: error instanceof Error ? error.message : String(error), action };
35289
+ } finally {
35290
+ if (scratch) rmSync6(scratch, { recursive: true, force: true });
35291
+ }
35292
+ if (json) process.stdout.write(JSON.stringify(report, null, 2) + "\n");
35293
+ else {
35294
+ if (report.runtime) process.stdout.write(`Kernel SHA-256: ${report.runtime.kernelSha256}
35295
+ `);
35296
+ for (const check2 of report.checks) process.stdout.write(`${check2.passed ? "PASS" : "FAIL"} ${check2.name}${check2.detail ? ` \u2014 ${check2.detail}` : ""}
35297
+ `);
35298
+ if (report.failure) process.stderr.write(`${report.failure.detail}
35299
+ Next: ${report.failure.action}
35300
+ `);
35301
+ process.stdout.write(report.passed ? "PASS \u2014 installed Node stack conforms.\n" : "FAIL \u2014 conformance did not pass.\n");
35302
+ }
35303
+ return report.passed ? 0 : 1;
35304
+ }
35305
+ var init_conformance = __esm({
35306
+ "src/conformance.ts"() {
35307
+ "use strict";
35308
+ }
35309
+ });
35310
+
34960
35311
  // src/test.ts
34961
35312
  var test_exports = {};
34962
35313
  __export(test_exports, {
34963
35314
  resolveTestCloudEntry: () => resolveTestCloudEntry,
34964
35315
  runDartTests: () => runDartTests
34965
35316
  });
34966
- import { spawnSync as spawnSync5 } from "node:child_process";
34967
- import { existsSync as existsSync13 } from "node:fs";
34968
- import { dirname as dirname4, resolve as resolve5 } from "node:path";
34969
- import { fileURLToPath as fileURLToPath2 } from "node:url";
35317
+ import { spawnSync as spawnSync6 } from "node:child_process";
35318
+ import { existsSync as existsSync14 } from "node:fs";
35319
+ import { dirname as dirname5, resolve as resolve6 } from "node:path";
35320
+ import { fileURLToPath as fileURLToPath3 } from "node:url";
34970
35321
  function resolveTestCloudEntry(options = {}) {
34971
35322
  const cwd = options.cwd ?? process.cwd();
34972
35323
  const environment = options.environment ?? process.env;
34973
35324
  const explicit = environment.NOMOS_TEST_CLOUD_ENTRY;
34974
35325
  if (explicit !== void 0) {
34975
- const candidate = resolve5(cwd, explicit);
34976
- if (!existsSync13(candidate)) {
35326
+ const candidate = resolve6(cwd, explicit);
35327
+ if (!existsSync14(candidate)) {
34977
35328
  throw new Error(`NOMOS_TEST_CLOUD_ENTRY does not exist: ${candidate}`);
34978
35329
  }
34979
35330
  return candidate;
34980
35331
  }
34981
- const here = dirname4(fileURLToPath2(options.moduleUrl ?? import.meta.url));
35332
+ const here = dirname5(fileURLToPath3(options.moduleUrl ?? import.meta.url));
34982
35333
  const candidates = [
34983
- resolve5(here, "dev-server.mjs"),
34984
- resolve5(here, "../dist/dev-server.mjs"),
34985
- resolve5(here, "../../platform-shells/node/local-development/server.ts"),
34986
- resolve5(cwd, "platform-shells/node/local-development/server.ts")
35334
+ resolve6(here, "dev-server.mjs"),
35335
+ resolve6(here, "../dist/dev-server.mjs"),
35336
+ resolve6(here, "../../platform-shells/node/local-development/server.ts"),
35337
+ resolve6(cwd, "platform-shells/node/local-development/server.ts")
34987
35338
  ];
34988
- const server = candidates.find((candidate) => existsSync13(candidate));
35339
+ const server = candidates.find((candidate) => existsSync14(candidate));
34989
35340
  if (server === void 0) {
34990
35341
  throw new Error("the bundled local Nomos cloud is missing \u2014 rebuild or reinstall githolon");
34991
35342
  }
@@ -35003,7 +35354,7 @@ function runDartTests(args) {
35003
35354
  return 1;
35004
35355
  }
35005
35356
  process.stdout.write("githolon test \u2014 generated application scenarios with real local custody\n");
35006
- const result = spawnSync5("flutter", ["test", ...forwarded], {
35357
+ const result = spawnSync6("flutter", ["test", ...forwarded], {
35007
35358
  cwd: process.cwd(),
35008
35359
  stdio: "inherit",
35009
35360
  env: {
@@ -35619,7 +35970,7 @@ var init_law_command_projection = __esm({
35619
35970
  });
35620
35971
 
35621
35972
  // src/law_encoder.ts
35622
- import { readFileSync as readFileSync11 } from "node:fs";
35973
+ import { readFileSync as readFileSync13 } from "node:fs";
35623
35974
  async function loadInstalledLaw(input) {
35624
35975
  const file = discoverLawUsdz(input.cwd ?? process.cwd(), input.file);
35625
35976
  const inspected = await inspectLawArchive(input.cloud, file);
@@ -35631,7 +35982,7 @@ async function loadInstalledLaw(input) {
35631
35982
  );
35632
35983
  }
35633
35984
  const projection = parseLawCommandProjection(
35634
- readLawClosureAsset(new Uint8Array(readFileSync11(file)), COMMAND_PROJECTION)
35985
+ readLawClosureAsset(new Uint8Array(readFileSync13(file)), COMMAND_PROJECTION)
35635
35986
  );
35636
35987
  return { identity: inspected.identity, servedDomains: served, projection, file };
35637
35988
  }
@@ -35927,7 +36278,7 @@ var init_model_children = __esm({
35927
36278
  init_law_directive_call();
35928
36279
  init_law_command_projection();
35929
36280
  init_law_encoder();
35930
- sleep = (ms) => new Promise((resolve8) => setTimeout(resolve8, ms));
36281
+ sleep = (ms) => new Promise((resolve9) => setTimeout(resolve9, ms));
35931
36282
  }
35932
36283
  });
35933
36284
 
@@ -36052,7 +36403,7 @@ async function modelAdopt(workspace, opts) {
36052
36403
  inventory = observed;
36053
36404
  break;
36054
36405
  }
36055
- await new Promise((resolve8) => setTimeout(resolve8, 250));
36406
+ await new Promise((resolve9) => setTimeout(resolve9, 250));
36056
36407
  } while (Date.now() < deadline);
36057
36408
  if (inventory === void 0) throw new Error("the active-law projection did not converge within 30 seconds");
36058
36409
  const candidate = inventory.domains.find((installed) => installed.domainHash === identity);
@@ -36117,8 +36468,8 @@ __export(platform_exports, {
36117
36468
  storeSeatDevice: () => storeSeatDevice
36118
36469
  });
36119
36470
  import { createHash as createHash6 } from "node:crypto";
36120
- import { existsSync as existsSync14, mkdirSync as mkdirSync10, readFileSync as readFileSync12, writeFileSync as writeFileSync11 } from "node:fs";
36121
- import { join as join16 } from "node:path";
36471
+ import { existsSync as existsSync15, mkdirSync as mkdirSync12, readFileSync as readFileSync14, writeFileSync as writeFileSync13 } from "node:fs";
36472
+ import { join as join18 } from "node:path";
36122
36473
  function refuse(message) {
36123
36474
  throw new PlatformRefusal(message);
36124
36475
  }
@@ -36191,8 +36542,8 @@ async function readModelAuthority(cloud, platform, seatedAt) {
36191
36542
  }
36192
36543
  function loadSeatDevice(workspace) {
36193
36544
  const path4 = seatDevicePath(workspace);
36194
- if (!existsSync14(path4)) return void 0;
36195
- const stored = JSON.parse(readFileSync12(path4, "utf8"));
36545
+ if (!existsSync15(path4)) return void 0;
36546
+ const stored = JSON.parse(readFileSync14(path4, "utf8"));
36196
36547
  const publicKey = stored.publicKey ?? (stored.publicKeyHex === void 0 ? void 0 : Buffer.from(stored.publicKeyHex, "hex").toString("base64"));
36197
36548
  if (typeof stored.secret !== "string" || publicKey === void 0 || typeof stored.keyHash !== "string") {
36198
36549
  refuse(`${path4} is not a stored device key {secret, publicKey, keyHash}`);
@@ -36201,8 +36552,8 @@ function loadSeatDevice(workspace) {
36201
36552
  }
36202
36553
  function storeSeatDevice(workspace, device) {
36203
36554
  const path4 = seatDevicePath(workspace);
36204
- mkdirSync10(join16(path4, ".."), { recursive: true });
36205
- writeFileSync11(path4, JSON.stringify(device, null, 2) + "\n", { mode: 384 });
36555
+ mkdirSync12(join18(path4, ".."), { recursive: true });
36556
+ writeFileSync13(path4, JSON.stringify(device, null, 2) + "\n", { mode: 384 });
36206
36557
  }
36207
36558
  async function mintSeatDevice(cloud) {
36208
36559
  const generated = await generateDeviceKey(cloud);
@@ -36425,7 +36776,7 @@ async function platformAuthor(workspace, directiveId, opts) {
36425
36776
  }
36426
36777
  }
36427
36778
  function readPayload(opts) {
36428
- const raw = opts.payloadFile !== void 0 ? readFileSync12(opts.payloadFile, "utf8") : opts.payload;
36779
+ const raw = opts.payloadFile !== void 0 ? readFileSync14(opts.payloadFile, "utf8") : opts.payload;
36429
36780
  if (raw === void 0 || raw.trim() === "") refuse("author needs --payload <json> or --payload-file <file>");
36430
36781
  let parsed;
36431
36782
  try {
@@ -36617,7 +36968,7 @@ async function waitFor(condition, deadlineMillis, report) {
36617
36968
  announced = elapsed;
36618
36969
  report(elapsed);
36619
36970
  }
36620
- await new Promise((resolve8) => setTimeout(resolve8, 1e3));
36971
+ await new Promise((resolve9) => setTimeout(resolve9, 1e3));
36621
36972
  }
36622
36973
  return false;
36623
36974
  }
@@ -36637,7 +36988,7 @@ var init_platform = __esm({
36637
36988
  PlatformRefusal = class extends Error {
36638
36989
  };
36639
36990
  ws = (name) => encodeURIComponent(name);
36640
- seatDevicePath = (workspace) => join16(configDir(), `seat-device-${workspace}.json`);
36991
+ seatDevicePath = (workspace) => join18(configDir(), `seat-device-${workspace}.json`);
36641
36992
  SEAT_CONVERGENCE_MILLIS = 18e4;
36642
36993
  }
36643
36994
  });
@@ -36703,9 +37054,9 @@ var init_dlq = __esm({
36703
37054
 
36704
37055
  // src/custodian.ts
36705
37056
  import { createHash as createHash7, createPrivateKey as createPrivateKey2, createPublicKey as createPublicKey2 } from "node:crypto";
36706
- import { existsSync as existsSync15, readFileSync as readFileSync13 } from "node:fs";
36707
- import { dirname as dirname5, isAbsolute as isAbsolute3, join as join17, resolve as resolve6 } from "node:path";
36708
- import { fileURLToPath as fileURLToPath3, pathToFileURL as pathToFileURL3 } from "node:url";
37057
+ import { existsSync as existsSync16, readFileSync as readFileSync15 } from "node:fs";
37058
+ import { dirname as dirname6, isAbsolute as isAbsolute3, join as join19, resolve as resolve7 } from "node:path";
37059
+ import { fileURLToPath as fileURLToPath4, pathToFileURL as pathToFileURL3 } from "node:url";
36709
37060
  import { create as create80 } from "@bufbuild/protobuf";
36710
37061
  import { AnySchema as AnySchema3 } from "@bufbuild/protobuf/wkt";
36711
37062
  function custodianKeyHash(seed) {
@@ -36751,8 +37102,8 @@ async function resolveCustodianCredential(reference) {
36751
37102
  return fromSeed(custodianSeedFromText(device.secret, `~/.holon device key for ${rest}`), reference);
36752
37103
  }
36753
37104
  if (scheme === "file") {
36754
- if (rest === "" || !existsSync15(rest)) throw new Error(`--custodian-key file:<path> \u2014 no file at '${rest}'`);
36755
- return fromSeed(custodianSeedFromText(readFileSync13(rest, "utf8"), rest), `file:${rest}`);
37105
+ if (rest === "" || !existsSync16(rest)) throw new Error(`--custodian-key file:<path> \u2014 no file at '${rest}'`);
37106
+ return fromSeed(custodianSeedFromText(readFileSync15(rest, "utf8"), rest), `file:${rest}`);
36756
37107
  }
36757
37108
  if (scheme === "env") {
36758
37109
  const value = process.env[rest];
@@ -36778,8 +37129,8 @@ async function resolveCustodianCredential(reference) {
36778
37129
  }
36779
37130
  function readCustodianChain(file) {
36780
37131
  if (file === void 0) return [];
36781
- if (!existsSync15(file)) throw new Error(`--chain <file> \u2014 no file at '${file}'`);
36782
- const parsed = JSON.parse(readFileSync13(file, "utf8"));
37132
+ if (!existsSync16(file)) throw new Error(`--chain <file> \u2014 no file at '${file}'`);
37133
+ const parsed = JSON.parse(readFileSync15(file, "utf8"));
36783
37134
  const links = Array.isArray(parsed) ? parsed : typeof parsed === "object" && parsed !== null && Array.isArray(parsed.certChain) ? parsed.certChain : void 0;
36784
37135
  if (links === void 0) {
36785
37136
  throw new Error(
@@ -36829,10 +37180,10 @@ function scarFromVerdict(verdict) {
36829
37180
  }
36830
37181
  function frameworkReceptionPath(here = moduleDirectory()) {
36831
37182
  const candidates = [
36832
- join17(here, "framework", "nomos.reception.mjs"),
36833
- resolve6(here, "../../cloud/cloudflare-shell/domains/build/nomos/nomos.reception.mjs")
37183
+ join19(here, "framework", "nomos.reception.mjs"),
37184
+ resolve7(here, "../../cloud/cloudflare-shell/domains/build/nomos/nomos.reception.mjs")
36834
37185
  ];
36835
- const found = candidates.find((candidate) => existsSync15(candidate));
37186
+ const found = candidates.find((candidate) => existsSync16(candidate));
36836
37187
  if (found === void 0) {
36837
37188
  throw new Error(
36838
37189
  "the framework controller's compiled Reception is missing \u2014 reinstall `githolon`, or compile it with `node dsl/compile_package.mjs domain_nomos.nomos.project.ts` in cloud/cloudflare-shell/domains"
@@ -36841,8 +37192,8 @@ function frameworkReceptionPath(here = moduleDirectory()) {
36841
37192
  return found;
36842
37193
  }
36843
37194
  async function encodeDirectiveCall(receptionPath, domain, directiveId, workspace, payload) {
36844
- const absolute = isAbsolute3(receptionPath) ? receptionPath : resolve6(process.cwd(), receptionPath);
36845
- if (!existsSync15(absolute)) throw new Error(`--reception <path> \u2014 no compiled Reception at '${absolute}'`);
37195
+ const absolute = isAbsolute3(receptionPath) ? receptionPath : resolve7(process.cwd(), receptionPath);
37196
+ if (!existsSync16(absolute)) throw new Error(`--reception <path> \u2014 no compiled Reception at '${absolute}'`);
36846
37197
  const module = await import(pathToFileURL3(absolute).href);
36847
37198
  const frameworkCalls = module["nomosFrameworkCalls"];
36848
37199
  if (typeof frameworkCalls === "object" && frameworkCalls !== null) {
@@ -36907,7 +37258,7 @@ async function encodeDirectiveCall(receptionPath, domain, directiveId, workspace
36907
37258
  return captured;
36908
37259
  }
36909
37260
  function readPayload2(opts) {
36910
- const text2 = opts.payloadFile !== void 0 ? readFileSync13(opts.payloadFile, "utf8") : opts.payload;
37261
+ const text2 = opts.payloadFile !== void 0 ? readFileSync15(opts.payloadFile, "utf8") : opts.payload;
36911
37262
  if (text2 === void 0) throw new Error("pass the directive's payload with --payload <json> or --payload-file <file>");
36912
37263
  const parsed = JSON.parse(text2);
36913
37264
  if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
@@ -37121,7 +37472,7 @@ var init_custodian = __esm({
37121
37472
  [/forged-principal|ForgedPrincipal|VERIFIED author/i, "ForgedPrincipal"],
37122
37473
  [/bad-signature|BadSignature/i, "BadSignature"]
37123
37474
  ];
37124
- moduleDirectory = () => dirname5(fileURLToPath3(import.meta.url));
37475
+ moduleDirectory = () => dirname6(fileURLToPath4(import.meta.url));
37125
37476
  CapturedCall = class extends Error {
37126
37477
  constructor() {
37127
37478
  super("call captured");
@@ -37247,9 +37598,9 @@ Options
37247
37598
  });
37248
37599
 
37249
37600
  // src/cli.ts
37250
- import { existsSync as existsSync16, readFileSync as readFileSync14 } from "node:fs";
37251
- import { dirname as dirname6, join as join18, resolve as resolve7 } from "node:path";
37252
- import { pathToFileURL as pathToFileURL4, fileURLToPath as fileURLToPath4 } from "node:url";
37601
+ import { existsSync as existsSync17, readFileSync as readFileSync16 } from "node:fs";
37602
+ import { dirname as dirname7, join as join20, resolve as resolve8 } from "node:path";
37603
+ import { pathToFileURL as pathToFileURL4, fileURLToPath as fileURLToPath5 } from "node:url";
37253
37604
 
37254
37605
  // src/generate.ts
37255
37606
  import { mkdirSync, existsSync, writeFileSync } from "node:fs";
@@ -37761,6 +38112,7 @@ var USAGE2 = `githolon \u2014 model a business; Nomos owns the compute science
37761
38112
  Start here:
37762
38113
  githolon compile compile aggregates, birth, directives, and reads into law + a typed client
37763
38114
  githolon test run generated Dart scenarios with real local custody
38115
+ githolon conformance check the installed stack with an isolated generated application
37764
38116
  githolon check explain anything the law can already prove it would refuse
37765
38117
 
37766
38118
  The application surface is one idea:
@@ -37949,6 +38301,9 @@ async function main(argv) {
37949
38301
  process.stdout.write(USAGE2);
37950
38302
  return 0;
37951
38303
  }
38304
+ if (argv[0] === "console") {
38305
+ return (await Promise.resolve().then(() => (init_console(), console_exports))).consoleCommand(argv.slice(1));
38306
+ }
37952
38307
  if (argv[0] === "compile") {
37953
38308
  return runCompileCommand(argv.slice(1));
37954
38309
  }
@@ -37966,6 +38321,9 @@ async function main(argv) {
37966
38321
  const { initEditor: initEditor2 } = await Promise.resolve().then(() => (init_editor(), editor_exports));
37967
38322
  return initEditor2(process.cwd());
37968
38323
  }
38324
+ if (argv[0] === "conformance") {
38325
+ return (await Promise.resolve().then(() => (init_conformance(), conformance_exports))).runConformance(argv.slice(1));
38326
+ }
37969
38327
  if (argv[0] === "test") {
37970
38328
  const { runDartTests: runDartTests2 } = await Promise.resolve().then(() => (init_test(), test_exports));
37971
38329
  return runDartTests2(argv.slice(1));
@@ -37989,18 +38347,18 @@ async function main(argv) {
37989
38347
  ${commandHelp("cloud") ?? USAGE2}`);
37990
38348
  return 1;
37991
38349
  }
37992
- const { spawnSync: spawnSync6 } = await import("node:child_process");
37993
- const here = dirname6(fileURLToPath4(import.meta.url));
38350
+ const { spawnSync: spawnSync7 } = await import("node:child_process");
38351
+ const here = dirname7(fileURLToPath5(import.meta.url));
37994
38352
  const candidates = [
37995
- resolve7(here, "dev-server.mjs")
38353
+ resolve8(here, "dev-server.mjs")
37996
38354
  // published: dist/dev-server.mjs
37997
38355
  ];
37998
- const serverPath = candidates.find((p) => existsSync16(p));
38356
+ const serverPath = candidates.find((p) => existsSync17(p));
37999
38357
  if (!serverPath) {
38000
38358
  process.stderr.write("error: dev-server not found \u2014 reinstall `githolon` or run `npm run build` in the cli package\n");
38001
38359
  return 1;
38002
38360
  }
38003
- const r = spawnSync6(process.execPath, [serverPath, ...argv.slice(2)], { stdio: "inherit" });
38361
+ const r = spawnSync7(process.execPath, [serverPath, ...argv.slice(2)], { stdio: "inherit" });
38004
38362
  return r.status ?? 0;
38005
38363
  }
38006
38364
  if (argv[0] === "status") {