githolon 0.27.1 → 0.29.0

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 +48 -2
  2. package/package.json +3 -3
package/dist/cli.mjs CHANGED
@@ -1435,7 +1435,8 @@ __export(proof_offline_exports, {
1435
1435
  parseOfflineLegs: () => parseOfflineLegs,
1436
1436
  runChildBirthLeg: () => runChildBirthLeg,
1437
1437
  runOfflineLegs: () => runOfflineLegs,
1438
- runOfflineProofStandalone: () => runOfflineProofStandalone
1438
+ runOfflineProofStandalone: () => runOfflineProofStandalone,
1439
+ runRelationBootstrapLeg: () => runRelationBootstrapLeg
1439
1440
  });
1440
1441
  import { existsSync as existsSync5, readFileSync as readFileSync4 } from "node:fs";
1441
1442
  import { basename, dirname as dirname3, join as join6 } from "node:path";
@@ -1530,7 +1531,12 @@ function runOfflineLegs(eng, ws, lawHash, legs, frameworkHash) {
1530
1531
  lines.push(...v.legs);
1531
1532
  if (!v.ok) return done(false, lines, v.error);
1532
1533
  }
1533
- if (legs.directiveId === void 0 && legs.childBirth === void 0) {
1534
+ if (legs.relationBootstrap !== void 0) {
1535
+ const v = runRelationBootstrapLeg(eng, ws, lawHash, legs.relationBootstrap);
1536
+ lines.push(...v.legs);
1537
+ if (!v.ok) return done(false, lines, v.error);
1538
+ }
1539
+ if (legs.directiveId === void 0 && legs.childBirth === void 0 && legs.relationBootstrap === void 0) {
1534
1540
  lines.push(`\u2713 ${legs.domain} \u2014 compile-valid (the law compiled; no standalone create or .births() to prove a write)${kinds.length ? ` [${kinds.join(", ")}]` : ""}`);
1535
1541
  }
1536
1542
  return done(true, lines);
@@ -1635,6 +1641,46 @@ function runChildBirthLeg(eng, ws, lawHash, cb, frameworkHash) {
1635
1641
  lines.push(`\u2713 verify_chain GREEN on the born child ${childWs} (${verdict.plansRerun ?? "?"} plans re-run \u2014 it self-validates from intent 0 through its OWN gate)`);
1636
1642
  return done(true);
1637
1643
  }
1644
+ function runRelationBootstrapLeg(eng, ws, lawHash, rb) {
1645
+ const t0 = performance.now();
1646
+ const lines = [];
1647
+ const done = (ok, error) => ({ ok, ms: performance.now() - t0, legs: lines, ...error !== void 0 ? { error } : {} });
1648
+ const ACTOR = "user:proof-conformance";
1649
+ const actorOpts = { actor: ACTOR };
1650
+ const stamp = (/* @__PURE__ */ new Date()).toISOString();
1651
+ const grantedRelation = rb.grantedRelation ?? rb.relation;
1652
+ const computed = grantedRelation !== rb.relation;
1653
+ const speculative = rb.seedSpeculative === true;
1654
+ const grantPayload = { ...rb.grantPayload };
1655
+ const overwrite = /* @__PURE__ */ new Set([...rb.grantSubjectFields, ...rb.grantGrantedByFields]);
1656
+ for (const k of Object.keys(grantPayload)) {
1657
+ if (overwrite.has(k) || /^(subject|principal|grantedBy|grantee|member|user|owner)$/i.test(k)) grantPayload[k] = ACTOR;
1658
+ }
1659
+ for (const f of rb.grantAutoStamped) grantPayload[f] = stamp;
1660
+ const grantRes = author(eng, ws, rb.domain, rb.grantDirectiveId, grantPayload, lawHash, actorOpts);
1661
+ if (grantRes.ok === false) {
1662
+ if (speculative) {
1663
+ lines.push(`\u2013 relation-bootstrap leg SKIPPED (layer-3 seed-path) \u2014 the declared seed ${rb.domain}/${rb.grantDirectiveId} could not be replayed (${grantRes.error ?? "refused"}); the gate ${rb.gatedDirectiveId} .requires("${rb.relation}") stays proven negatively by the conformance leg`);
1664
+ return done(true);
1665
+ }
1666
+ return done(false, `relation bootstrap grant ${rb.domain}/${rb.grantDirectiveId} refused: ${grantRes.error ?? "unknown"} \u2014 the grant that should seat "${grantedRelation}" on the proof actor was rejected (is ${rb.grantDirectiveId} itself gated? add .grants("${grantedRelation}") + an ungated bootstrap, or prove by hand)`);
1667
+ }
1668
+ const seatDesc = speculative ? `replayed the declared seed ${rb.domain}/${rb.grantDirectiveId} (seats [${(rb.seedWritesRelations ?? [grantedRelation]).join(", ")}]) on ${ACTOR} \u2014 deferring to the real gate to authorize "${rb.relation}"` : `${rb.domain}/${rb.grantDirectiveId} granted "${grantedRelation}" to ${ACTOR} (${rb.via})${computed ? ` \u21D2 satisfies "${rb.relation}" via the rewrite` : ``}`;
1669
+ lines.push(`\u2713 relation bootstrap (${speculative ? "seed" : "grant"}) \u2014 ${seatDesc}`);
1670
+ const gatedPayload = { ...rb.gatedPayload };
1671
+ for (const f of rb.gatedAutoStamped) gatedPayload[f] = stamp;
1672
+ if (rb.gatedMintField !== void 0 && rb.gatedAggregateId !== void 0) gatedPayload[rb.gatedMintField] = mintId(eng, rb.gatedAggregateId);
1673
+ const gatedRes = author(eng, ws, rb.domain, rb.gatedDirectiveId, gatedPayload, lawHash, actorOpts);
1674
+ if (gatedRes.ok === false) {
1675
+ if (speculative) {
1676
+ lines.push(`\u2013 relation-bootstrap leg SKIPPED (layer-3 seed-path) \u2014 replaying the declared seed ${rb.domain}/${rb.grantDirectiveId} did NOT authorize ${rb.gatedDirectiveId} .requires("${rb.relation}") on the real gate (${gatedRes.error ?? "refused"}); no seed-path is provable, so no positive leg is emitted (the conformance leg still proves the gate refuses an actorless offer)`);
1677
+ return done(true);
1678
+ }
1679
+ return done(false, `relation bootstrap prove ${rb.domain}/${rb.gatedDirectiveId} refused: ${gatedRes.error ?? "unknown"} \u2014 the gated write did NOT succeed even after granting "${grantedRelation}" to the actor${computed ? ` (which should satisfy "${rb.relation}" via the rewrite)` : ``} (the gate is not honoring the seeded relation, OR the grant did not seat it on ${ACTOR})`);
1680
+ }
1681
+ lines.push(speculative ? `\u2713 relation bootstrap (prove) \u2014 ${rb.domain}/${rb.gatedDirectiveId} authored under the replayed seed (gated write SUCCEEDS \u2014 the REAL kernel gate confirmed the replayed seed establishes authority for "${rb.relation}")` : `\u2713 relation bootstrap (prove) \u2014 ${rb.domain}/${rb.gatedDirectiveId} authored under the seeded holder of "${rb.relation}" (gated write SUCCEEDS once granted)`);
1682
+ return done(true);
1683
+ }
1638
1684
  function actorFromPayload(payload, field) {
1639
1685
  if (field === void 0) return void 0;
1640
1686
  const value = payload[field];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "githolon",
3
- "version": "0.27.1",
3
+ "version": "0.29.0",
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.27.1",
33
- "@githolon/dsl": "^0.27.1",
32
+ "@githolon/client": "^0.29.0",
33
+ "@githolon/dsl": "^0.29.0",
34
34
  "isomorphic-git": "^1.38.4"
35
35
  },
36
36
  "devDependencies": {