githolon 0.69.3 → 0.70.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.
Files changed (2) hide show
  1. package/dist/cli.mjs +266 -10
  2. package/package.json +3 -3
package/dist/cli.mjs CHANGED
@@ -2972,10 +2972,12 @@ var init_repairs = __esm({
2972
2972
  // src/governance.ts
2973
2973
  var governance_exports = {};
2974
2974
  __export(governance_exports, {
2975
+ HONEST_CEILING: () => HONEST_CEILING,
2975
2976
  ROOT_CUSTODIAN_SECRET: () => ROOT_CUSTODIAN_SECRET,
2976
2977
  buildCertificate: () => buildCertificate,
2977
2978
  buildRebirthPlan: () => buildRebirthPlan,
2978
2979
  certifyEra: () => certifyEra,
2980
+ consentRebirth: () => consentRebirth,
2979
2981
  executeRepairRebirth: () => executeRepairRebirth,
2980
2982
  governanceOffer: () => governanceOffer,
2981
2983
  governanceRelay: () => governanceRelay,
@@ -2984,6 +2986,11 @@ __export(governance_exports, {
2984
2986
  keyExport: () => keyExport,
2985
2987
  keyImport: () => keyImport,
2986
2988
  keyShow: () => keyShow,
2989
+ postureMeaning: () => postureMeaning,
2990
+ postureSet: () => postureSet,
2991
+ postureShow: () => postureShow,
2992
+ readLiveConsent: () => readLiveConsent,
2993
+ readPosture: () => readPosture2,
2987
2994
  rebirthApply: () => rebirthApply,
2988
2995
  rebirthPlanCommand: () => rebirthPlanCommand,
2989
2996
  rebirthWorkspace: () => rebirthWorkspace,
@@ -3095,6 +3102,129 @@ async function grantOrRevoke(verb, kind, subject, opts) {
3095
3102
  out2(`\u2713 ${directiveId} ${subject} via signed governance offer to ${parent}`);
3096
3103
  return 0;
3097
3104
  }
3105
+ function postureMeaning(posture) {
3106
+ return posture === "sovereign" ? "the operator CANNOT run recovery verbs (rebirth, certifyEra, repairs) without YOUR consent \u2014 root's rebirth REFUSES for this workspace unless a live RebirthConsent fact is folded in your OWN chain (githolon consent rebirth <ws>). Restraint is law that replays, not host policy." : 'the operator CAN run recovery verbs (rebirth, certifyEra, repairs) FOR you \u2014 each a signed, attributed, permanent law fact you audit forever. "The assurance of being able to ask us for help." Revoke any time (\u2192 sovereign): githolon posture set <ws> sovereign --reason \u2026';
3107
+ }
3108
+ async function readPosture2(cloud, ws) {
3109
+ try {
3110
+ const r = await fetch(`${cloud}/v2/workspaces/${ws}/governancePosture?scope=self`);
3111
+ if (!r.ok) return "managed";
3112
+ const d = await r.json();
3113
+ const rows = Array.isArray(d?.rows) ? d.rows : [];
3114
+ const last = rows[rows.length - 1];
3115
+ return last?.data?.posture === "sovereign" ? "sovereign" : "managed";
3116
+ } catch {
3117
+ return null;
3118
+ }
3119
+ }
3120
+ async function readLiveConsent(cloud, ws) {
3121
+ try {
3122
+ const r = await fetch(`${cloud}/v2/workspaces/${ws}/rebirthConsentByWorkspace?workspaceId=${encodeURIComponent(ws)}`);
3123
+ if (!r.ok) return [];
3124
+ const d = await r.json();
3125
+ const now = Date.now();
3126
+ return (Array.isArray(d?.rows) ? d.rows : []).map((row) => row?.data ?? {}).filter((data) => {
3127
+ const e = Number(data["expiresAt"]);
3128
+ return !(e > 0) || e > now;
3129
+ }).map((data) => ({
3130
+ reason: String(data["reason"] ?? ""),
3131
+ consentedBy: String(data["consentedBy"] ?? ""),
3132
+ consentedAt: Number(data["consentedAt"] ?? 0),
3133
+ ...Number(data["expiresAt"]) > 0 ? { expiresAt: Number(data["expiresAt"]) } : {}
3134
+ }));
3135
+ } catch {
3136
+ return [];
3137
+ }
3138
+ }
3139
+ async function postureShow(ws, opts) {
3140
+ const cloud = cloudBase(opts.cloud);
3141
+ const posture = await readPosture2(cloud, ws);
3142
+ if (posture === null) {
3143
+ err2(`could not read '${ws}' posture from ${cloud} \u2014 is the workspace born?`);
3144
+ return 1;
3145
+ }
3146
+ out2(`governance posture \u2014 ${ws} on ${cloud}`);
3147
+ out2("\u2550".repeat(48));
3148
+ out2(` posture : ${posture.toUpperCase()}${posture === "managed" ? " (default)" : ""}`);
3149
+ out2(` means : ${postureMeaning(posture)}`);
3150
+ if (posture === "sovereign") {
3151
+ const consents = await readLiveConsent(cloud, ws);
3152
+ if (consents.length === 0) {
3153
+ out2(` consent : NONE live \u2014 a rebirth of this workspace would be REFUSED (428) until the tenant consents.`);
3154
+ out2(` grant it: githolon consent rebirth ${ws} --reason "\u2026"`);
3155
+ } else {
3156
+ out2(` consent : ${consents.length} live consent fact(s):`);
3157
+ for (const c of consents) out2(` \u2022 by ${c.consentedBy || "?"} at ${c.consentedAt ? new Date(c.consentedAt).toISOString() : "?"}${c.expiresAt ? ` (expires ${new Date(c.expiresAt).toISOString()})` : ""} \u2014 ${c.reason || ""}`);
3158
+ }
3159
+ out2("");
3160
+ out2(` HONEST CEILING: ${HONEST_CEILING}`);
3161
+ }
3162
+ return 0;
3163
+ }
3164
+ async function postureSet(ws, posture, opts) {
3165
+ if (posture !== "managed" && posture !== "sovereign") {
3166
+ err2(`expected: githolon posture set ${ws} <managed|sovereign> --reason "\u2026"`);
3167
+ return 1;
3168
+ }
3169
+ const reason = opts.reason;
3170
+ if (reason === void 0 || reason.trim() === "") {
3171
+ err2(`posture set requires a --reason (the audit justification, on the ledger forever)`);
3172
+ return 1;
3173
+ }
3174
+ let principal;
3175
+ try {
3176
+ principal = resolveGovernancePrincipal(opts);
3177
+ } catch (e) {
3178
+ err2(e.message);
3179
+ return 1;
3180
+ }
3181
+ const payload = { workspaceId: ws, posture, reason, setBy: principal, at: Date.now() };
3182
+ let v;
3183
+ try {
3184
+ v = await signAndPostGovernance(ws, "setGovernancePosture", payload, opts);
3185
+ } catch (e) {
3186
+ err2(e.message);
3187
+ return 1;
3188
+ }
3189
+ if (!v.ok) {
3190
+ err2(`setGovernancePosture refused (${v.status}): ${typeof v.body === "string" ? v.body : JSON.stringify(v.body)}`);
3191
+ return 1;
3192
+ }
3193
+ out2(`\u2713 ${ws} posture set to ${posture.toUpperCase()} via signed governance offer`);
3194
+ out2(` ${postureMeaning(posture)}`);
3195
+ if (posture === "sovereign") out2(` (forward-only: help already given stays in history; the operator now needs your consent to rebirth \u2014 githolon consent rebirth ${ws} --reason \u2026)`);
3196
+ return 0;
3197
+ }
3198
+ async function consentRebirth(ws, opts) {
3199
+ const reason = opts.reason;
3200
+ if (reason === void 0 || reason.trim() === "") {
3201
+ err2(`consent rebirth requires a --reason (why you consent \u2014 on the ledger forever)`);
3202
+ return 1;
3203
+ }
3204
+ let principal;
3205
+ try {
3206
+ principal = resolveGovernancePrincipal(opts);
3207
+ } catch (e) {
3208
+ err2(e.message);
3209
+ return 1;
3210
+ }
3211
+ const payload = { workspaceId: ws, reason, consentedBy: principal, consentedAt: Date.now() };
3212
+ if (typeof opts.expiresAt === "number" && opts.expiresAt > 0) payload["expiresAt"] = opts.expiresAt;
3213
+ let v;
3214
+ try {
3215
+ v = await signAndPostGovernance(ws, "consentToRebirth", payload, opts);
3216
+ } catch (e) {
3217
+ err2(e.message);
3218
+ return 1;
3219
+ }
3220
+ if (!v.ok) {
3221
+ err2(`consentToRebirth refused (${v.status}): ${typeof v.body === "string" ? v.body : JSON.stringify(v.body)}`);
3222
+ return 1;
3223
+ }
3224
+ out2(`\u2713 ${ws} \u2014 rebirth consent folded in the tenant chain (by ${principal})`);
3225
+ out2(` the operator's rebirth custody act may now proceed (the two-key ceremony is satisfied).`);
3226
+ return 0;
3227
+ }
3098
3228
  async function keyEnroll(opts) {
3099
3229
  const cloud = cloudBase(opts.cloud);
3100
3230
  const principal = opts.principal ?? activePrincipal();
@@ -3318,6 +3448,7 @@ async function certifyEra(ws, opts) {
3318
3448
  return 1;
3319
3449
  }
3320
3450
  let seed = opts.seedSecret ?? process.env["NOMOS_ROOT_SEED"];
3451
+ const hasAsIdentity = typeof opts.as === "string" && opts.as.length > 0;
3321
3452
  if (seed === void 0 && opts.gcpSecret !== void 0) {
3322
3453
  try {
3323
3454
  const { execFileSync } = await import("node:child_process");
@@ -3576,6 +3707,9 @@ async function buildRebirthPlan(cloud, ws, reason) {
3576
3707
  }
3577
3708
  const frozenAt = priorSupersessions === 0 ? ws : `${ws}--i${priorSupersessions}`;
3578
3709
  const newCustodyAddress = `${ws}--i${priorSupersessions + 1}`;
3710
+ const posture = await readPosture2(cloud, ws) ?? "managed";
3711
+ const consents = posture === "sovereign" ? await readLiveConsent(cloud, ws) : [];
3712
+ const consentState = posture === "managed" ? "not-required" : consents.length > 0 ? "present" : "absent";
3579
3713
  const plan = {
3580
3714
  v: 1,
3581
3715
  workspace: ws,
@@ -3591,6 +3725,7 @@ async function buildRebirthPlan(cloud, ws, reason) {
3591
3725
  mode,
3592
3726
  compaction,
3593
3727
  repairs,
3728
+ posture: { posture, consent: consentState },
3594
3729
  clientImpact: CLIENT_IMPACT,
3595
3730
  generatedAt: (/* @__PURE__ */ new Date()).toISOString()
3596
3731
  };
@@ -3662,6 +3797,18 @@ function renderRebirthImpact(plan, ledgerCommits) {
3662
3797
  L.push(" state-transform verbs execute at the re-fold seam in a future release.");
3663
3798
  }
3664
3799
  L.push("");
3800
+ L.push("GOVERNANCE POSTURE");
3801
+ const pp = plan.posture ?? { posture: "managed", consent: "not-required" };
3802
+ L.push(` posture : ${pp.posture.toUpperCase()}${pp.posture === "managed" ? " (default \u2014 the operator may run recovery verbs for the tenant)" : ""}`);
3803
+ if (pp.posture === "sovereign") {
3804
+ if (pp.consent === "present") {
3805
+ L.push(" consent : PRESENT \u2014 a live tenant RebirthConsent fact authorizes this rebirth (the two-key ceremony is satisfied).");
3806
+ } else {
3807
+ L.push(` consent : ABSENT \u2014 SOVEREIGN target: this rebirth is REFUSED until the tenant consents in THEIR OWN chain.`);
3808
+ L.push(` the tenant grants it: githolon consent rebirth ${plan.workspace} --reason "\u2026"`);
3809
+ }
3810
+ }
3811
+ L.push("");
3665
3812
  L.push("CLIENT IMPACT");
3666
3813
  L.push(` ${plan.clientImpact}.`);
3667
3814
  L.push(" Recommend tenants DRAIN/SYNC their clients before the rebirth window.");
@@ -3735,6 +3882,7 @@ async function rebirthWorkspace(ws, opts) {
3735
3882
  }
3736
3883
  }
3737
3884
  let seed = opts.seedSecret ?? process.env["NOMOS_ROOT_SEED"];
3885
+ const hasAsIdentity = typeof opts.as === "string" && opts.as.length > 0;
3738
3886
  if (seed === void 0 && opts.gcpSecret !== void 0) {
3739
3887
  try {
3740
3888
  const { execFileSync } = await import("node:child_process");
@@ -3745,8 +3893,10 @@ async function rebirthWorkspace(ws, opts) {
3745
3893
  }
3746
3894
  }
3747
3895
  if (seed === void 0 || seed.trim() === "") {
3748
- err2(`gov rebirth needs the ROOT CUSTODIAN seed \u2014 the blessed path is --gcp-secret ${ROOT_CUSTODIAN_SECRET}; --seed-secret <b64> is break-glass (avoid in shell history), env NOMOS_ROOT_SEED is the CI lane`);
3749
- return 1;
3896
+ if (!hasAsIdentity) {
3897
+ err2(`gov rebirth needs an identity: --as <admin-uid> (key on file \u2014 the same lane every signed governance offer uses), or the ROOT CUSTODIAN seed (--gcp-secret ${ROOT_CUSTODIAN_SECRET}; --seed-secret <b64> is break-glass, env NOMOS_ROOT_SEED the CI lane)`);
3898
+ return 1;
3899
+ }
3750
3900
  }
3751
3901
  const cloud = cloudBase(opts.cloud);
3752
3902
  const engMod = await Promise.resolve().then(() => (init_engine(), engine_exports));
@@ -3776,6 +3926,20 @@ async function rebirthWorkspace(ws, opts) {
3776
3926
  err2("refusing to rebirth root (the fixed point)");
3777
3927
  return 1;
3778
3928
  }
3929
+ {
3930
+ const planPosture = opts.plan?.posture;
3931
+ let sovereignBlocked = false;
3932
+ if (planPosture !== void 0) {
3933
+ sovereignBlocked = planPosture.posture === "sovereign" && planPosture.consent === "absent";
3934
+ } else {
3935
+ const posture = await readPosture2(cloud, ws) ?? "managed";
3936
+ if (posture === "sovereign") sovereignBlocked = (await readLiveConsent(cloud, ws)).length === 0;
3937
+ }
3938
+ if (sovereignBlocked) {
3939
+ err2(`'${ws}' is SOVEREIGN \u2014 a rebirth needs the tenant's OWN consent first (no live RebirthConsent fact). The tenant grants it from their admin: githolon consent rebirth ${ws} --reason "\u2026" \u2014 then re-run this rebirth. (Operator restraint is law that replays here, not host policy.)`);
3940
+ return 1;
3941
+ }
3942
+ }
3779
3943
  if (opts.quiet !== true) {
3780
3944
  try {
3781
3945
  const built = await buildRebirthPlan(cloud, ws, reason);
@@ -3810,7 +3974,19 @@ gov rebirth ${ws}:`);
3810
3974
  err2("could not resolve root's governance (workspaces) law hash from root currentLaw (pass --controller-hash)");
3811
3975
  return 1;
3812
3976
  }
3813
- const res = author2(eng, "root", "workspaces", "rebirthWorkspace", { workspaceId, reason, rebornAt }, controllerHash, { authorSecret: seed, actor: "user:root-custodian" });
3977
+ const actorUid = opts.as;
3978
+ let signSecret = seed;
3979
+ let actor = "user:root-custodian";
3980
+ if (typeof actorUid === "string" && actorUid.length > 0) {
3981
+ const dk = getDeviceKey(actorUid);
3982
+ if (dk === void 0) {
3983
+ err2(`no signing key on file for --as ${actorUid} (githolon key import/enroll)`);
3984
+ return 1;
3985
+ }
3986
+ signSecret = dk.secret;
3987
+ actor = `user:${actorUid}`;
3988
+ }
3989
+ const res = author2(eng, "root", "workspaces", "rebirthWorkspace", { workspaceId, reason, rebornAt }, controllerHash, { authorSecret: signSecret, actor });
3814
3990
  if (res.ok === false) {
3815
3991
  err2(`rebirthWorkspace refused locally: ${res.error}`);
3816
3992
  return 1;
@@ -4095,13 +4271,14 @@ function readSealedIntentBytes(eng, ws, intentOut) {
4095
4271
  if (f?.data === void 0) return void 0;
4096
4272
  return Buffer.from(f.data).toString("base64");
4097
4273
  }
4098
- var out2, err2, ROOT_CUSTODIAN_SECRET, CLIENT_IMPACT;
4274
+ var out2, err2, HONEST_CEILING, ROOT_CUSTODIAN_SECRET, CLIENT_IMPACT;
4099
4275
  var init_governance = __esm({
4100
4276
  "src/governance.ts"() {
4101
4277
  "use strict";
4102
4278
  init_cloud();
4103
4279
  out2 = (s) => void process.stdout.write(s + "\n");
4104
4280
  err2 = (s) => void process.stderr.write("error: " + s + "\n");
4281
+ HONEST_CEILING = `The operator controls root's law and could deploy law removing the consent check \u2014 but that act is itself a signed, ordered, permanent fact in root's chain, visible to every tenant running \`replay root\`, and grounds for exit-with-everything. Not "we can't" \u2014 "we can't secretly, and you can always leave."`;
4105
4282
  ROOT_CUSTODIAN_SECRET = "nomos-root-custodian-key";
4106
4283
  CLIENT_IMPACT = "every connected client raises CustodyBreak(superseded); unsynced client work is invisible to the cloud \u2014 drain/sync clients first";
4107
4284
  }
@@ -5433,16 +5610,19 @@ function runChildBirthLeg(eng, ws, lawHash, cb, frameworkHash) {
5433
5610
  }
5434
5611
  function seatRelationAuthority(eng, ws, lawHash, rb, actor, stamp, lines) {
5435
5612
  const actorOpts = { actor };
5613
+ const bareActor = actor.replace(/^user:/, "");
5436
5614
  const grantedRelation = rb.grantedRelation ?? rb.relation;
5437
5615
  const speculative = rb.seedSpeculative === true;
5438
5616
  if (rb.granterAuthority !== void 0) {
5439
5617
  const inner = seatRelationAuthority(eng, ws, lawHash, rb.granterAuthority, actor, stamp, lines);
5440
5618
  if (!inner.ok) return inner;
5441
5619
  }
5442
- const seatActorFields = (payload, routed) => {
5620
+ const seatActorFields = (payload, routed, wrapped = []) => {
5443
5621
  const set = new Set(routed);
5622
+ const wrappedSet = new Set(wrapped);
5444
5623
  for (const k of Object.keys(payload)) {
5445
- if (set.has(k) || /^(subject|principal|grantedBy|grantee|member|user|owner|founder)$/i.test(k)) payload[k] = actor;
5624
+ if (wrappedSet.has(k)) payload[k] = bareActor;
5625
+ else if (set.has(k) || /^(subject|principal|grantedBy|grantee|member|user|owner|founder)$/i.test(k)) payload[k] = actor;
5446
5626
  }
5447
5627
  };
5448
5628
  for (const seed of rb.prerequisiteSeeds ?? []) {
@@ -5456,7 +5636,7 @@ function seatRelationAuthority(eng, ws, lawHash, rb, actor, stamp, lines) {
5456
5636
  lines.push(`\u2713 relation seat (prerequisite) \u2014 ${rb.domain}/${seed.directiveId} established (as ${actor})`);
5457
5637
  }
5458
5638
  const grantPayload = { ...rb.grantPayload };
5459
- seatActorFields(grantPayload, [...rb.grantSubjectFields, ...rb.grantGrantedByFields]);
5639
+ seatActorFields(grantPayload, [...rb.grantSubjectFields, ...rb.grantGrantedByFields], rb.grantSubjectWrappedFields ?? []);
5460
5640
  for (const f of rb.grantAutoStamped) grantPayload[f] = stamp;
5461
5641
  const grantRes = author(eng, ws, rb.domain, rb.grantDirectiveId, grantPayload, lawHash, actorOpts);
5462
5642
  if (grantRes.ok === false) {
@@ -5471,6 +5651,7 @@ function runRelationBootstrapLeg(eng, ws, lawHash, rb) {
5471
5651
  const lines = [];
5472
5652
  const done = (ok, error) => ({ ok, ms: performance.now() - t0, legs: lines, ...error !== void 0 ? { error } : {} });
5473
5653
  const ACTOR = "user:proof-conformance";
5654
+ const BARE_ACTOR = "proof-conformance";
5474
5655
  const actorOpts = { actor: ACTOR };
5475
5656
  const stamp = (/* @__PURE__ */ new Date()).toISOString();
5476
5657
  const grantedRelation = rb.grantedRelation ?? rb.relation;
@@ -5489,10 +5670,12 @@ function runRelationBootstrapLeg(eng, ws, lawHash, rb) {
5489
5670
  return done(false, seat.error ?? `could not seat the granter's authority for ${rb.grantDirectiveId}`);
5490
5671
  }
5491
5672
  }
5492
- const seatActorFields = (payload, routed) => {
5673
+ const seatActorFields = (payload, routed, wrapped = []) => {
5493
5674
  const set = new Set(routed);
5675
+ const wrappedSet = new Set(wrapped);
5494
5676
  for (const k of Object.keys(payload)) {
5495
- if (set.has(k) || /^(subject|principal|grantedBy|grantee|member|user|owner|founder)$/i.test(k)) payload[k] = ACTOR;
5677
+ if (wrappedSet.has(k)) payload[k] = BARE_ACTOR;
5678
+ else if (set.has(k) || /^(subject|principal|grantedBy|grantee|member|user|owner|founder)$/i.test(k)) payload[k] = ACTOR;
5496
5679
  }
5497
5680
  };
5498
5681
  for (const seed of rb.prerequisiteSeeds ?? []) {
@@ -5507,7 +5690,7 @@ function runRelationBootstrapLeg(eng, ws, lawHash, rb) {
5507
5690
  lines.push(`\u2713 relation bootstrap (prerequisite) \u2014 ${rb.domain}/${seed.directiveId} established (as founder ${ACTOR}) before the grant`);
5508
5691
  }
5509
5692
  const grantPayload = { ...rb.grantPayload };
5510
- seatActorFields(grantPayload, [...rb.grantSubjectFields, ...rb.grantGrantedByFields]);
5693
+ seatActorFields(grantPayload, [...rb.grantSubjectFields, ...rb.grantGrantedByFields], rb.grantSubjectWrappedFields ?? []);
5511
5694
  for (const f of rb.grantAutoStamped) grantPayload[f] = stamp;
5512
5695
  const grantRes = author(eng, ws, rb.domain, rb.grantDirectiveId, grantPayload, lawHash, actorOpts);
5513
5696
  if (grantRes.ok === false) {
@@ -8518,6 +8701,19 @@ async function status(wsArg, opts) {
8518
8701
  }
8519
8702
  } catch {
8520
8703
  }
8704
+ try {
8705
+ const { readPosture: readPosture3, readLiveConsent: readLiveConsent2 } = await Promise.resolve().then(() => (init_governance(), governance_exports));
8706
+ const posture = await readPosture3(cloud, ws);
8707
+ if (posture !== null) {
8708
+ if (posture === "sovereign") {
8709
+ const consents = await readLiveConsent2(cloud, ws);
8710
+ out10(`posture SOVEREIGN (operator recovery verbs need tenant consent \u2014 ${consents.length} live consent fact(s))`);
8711
+ } else {
8712
+ out10(`posture managed (default \u2014 operator may run recovery verbs for the tenant)`);
8713
+ }
8714
+ }
8715
+ } catch {
8716
+ }
8521
8717
  const allDomains = d.domains ?? [];
8522
8718
  const frameworkHashes = new Set(FRAMEWORK_DOMAIN_KEYS.map((k) => d.currentLaw?.[k]).filter(Boolean));
8523
8719
  const domains = allDomains.filter((dm) => !frameworkHashes.has(dm.domainHash));
@@ -9196,6 +9392,7 @@ ${USAGE}`);
9196
9392
  ...opts,
9197
9393
  ...flag("--seed-secret") !== void 0 ? { seedSecret: flag("--seed-secret") } : {},
9198
9394
  ...flag("--gcp-secret") !== void 0 ? { gcpSecret: flag("--gcp-secret") } : {},
9395
+ ...flag("--as") !== void 0 ? { as: flag("--as") } : {},
9199
9396
  ...flag("--controller-hash") !== void 0 ? { controllerHash: flag("--controller-hash") } : {},
9200
9397
  yes: argv.includes("--yes")
9201
9398
  });
@@ -9203,6 +9400,65 @@ ${USAGE}`);
9203
9400
  process.stderr.write("error: expected: githolon rebirth <plan <ws> | apply --plan <plan.json>>\n");
9204
9401
  return 1;
9205
9402
  }
9403
+ if (argv[0] === "posture") {
9404
+ const { pos, opts, bad } = cloudArgs(argv.slice(1));
9405
+ if (bad !== void 0) {
9406
+ process.stderr.write(`error: ${bad}
9407
+
9408
+ ${USAGE}`);
9409
+ return 1;
9410
+ }
9411
+ const flag = (n) => {
9412
+ const i = argv.indexOf(n);
9413
+ return i >= 0 ? argv[i + 1] : void 0;
9414
+ };
9415
+ if (pos[0] === "set") {
9416
+ const platform2 = pos[1];
9417
+ const posture = pos[2];
9418
+ if (platform2 === void 0 || posture === void 0) {
9419
+ process.stderr.write("error: expected: githolon posture set <platform> <managed|sovereign> --reason <text>\n");
9420
+ return 1;
9421
+ }
9422
+ const { postureSet: postureSet2 } = await Promise.resolve().then(() => (init_governance(), governance_exports));
9423
+ return postureSet2(platform2, posture, { ...opts, ...flag("--reason") !== void 0 ? { reason: flag("--reason") } : {} });
9424
+ }
9425
+ const platform = pos[0];
9426
+ if (platform === void 0) {
9427
+ process.stderr.write("error: expected: githolon posture <platform> | githolon posture set <platform> <managed|sovereign> --reason <text>\n");
9428
+ return 1;
9429
+ }
9430
+ const { postureShow: postureShow2 } = await Promise.resolve().then(() => (init_governance(), governance_exports));
9431
+ return postureShow2(platform, opts);
9432
+ }
9433
+ if (argv[0] === "consent") {
9434
+ const { pos, opts, bad } = cloudArgs(argv.slice(1));
9435
+ if (bad !== void 0) {
9436
+ process.stderr.write(`error: ${bad}
9437
+
9438
+ ${USAGE}`);
9439
+ return 1;
9440
+ }
9441
+ const flag = (n) => {
9442
+ const i = argv.indexOf(n);
9443
+ return i >= 0 ? argv[i + 1] : void 0;
9444
+ };
9445
+ if (pos[0] === "rebirth") {
9446
+ const ws = pos[1];
9447
+ if (ws === void 0) {
9448
+ process.stderr.write("error: expected: githolon consent rebirth <ws> --reason <text> [--expires-at <epoch-ms>]\n");
9449
+ return 1;
9450
+ }
9451
+ const { consentRebirth: consentRebirth2 } = await Promise.resolve().then(() => (init_governance(), governance_exports));
9452
+ const expiresRaw = flag("--expires-at");
9453
+ return consentRebirth2(ws, {
9454
+ ...opts,
9455
+ ...flag("--reason") !== void 0 ? { reason: flag("--reason") } : {},
9456
+ ...expiresRaw !== void 0 && Number.isFinite(Number(expiresRaw)) ? { expiresAt: Number(expiresRaw) } : {}
9457
+ });
9458
+ }
9459
+ process.stderr.write("error: expected: githolon consent rebirth <ws> --reason <text>\n");
9460
+ return 1;
9461
+ }
9206
9462
  if (argv[0] === "gov") {
9207
9463
  const { governanceOffer: governanceOffer2, governanceRelay: governanceRelay2 } = await Promise.resolve().then(() => (init_governance(), governance_exports));
9208
9464
  const { pos, opts, bad } = cloudArgs(argv.slice(1));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "githolon",
3
- "version": "0.69.3",
3
+ "version": "0.70.1",
4
4
  "type": "module",
5
5
  "description": "githolon — the Nomos developer CLI: Rails-style generators for @githolon/dsl domains + the package compiler. Kernel-independent.",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -29,8 +29,8 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@bjorn3/browser_wasi_shim": "0.4.2",
32
- "@githolon/client": "^0.69.3",
33
- "@githolon/dsl": "^0.69.3",
32
+ "@githolon/client": "^0.70.1",
33
+ "@githolon/dsl": "^0.70.1",
34
34
  "isomorphic-git": "^1.38.4"
35
35
  },
36
36
  "devDependencies": {