githolon 0.27.1 → 0.28.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.
- package/dist/cli.mjs +36 -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.
|
|
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,34 @@ 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 grantPayload = { ...rb.grantPayload };
|
|
1652
|
+
const overwrite = /* @__PURE__ */ new Set([...rb.grantSubjectFields, ...rb.grantGrantedByFields]);
|
|
1653
|
+
for (const k of Object.keys(grantPayload)) {
|
|
1654
|
+
if (overwrite.has(k) || /^(subject|principal|grantedBy|grantee|member|user)$/i.test(k)) grantPayload[k] = ACTOR;
|
|
1655
|
+
}
|
|
1656
|
+
for (const f of rb.grantAutoStamped) grantPayload[f] = stamp;
|
|
1657
|
+
const grantRes = author(eng, ws, rb.domain, rb.grantDirectiveId, grantPayload, lawHash, actorOpts);
|
|
1658
|
+
if (grantRes.ok === false) {
|
|
1659
|
+
return done(false, `relation bootstrap grant ${rb.domain}/${rb.grantDirectiveId} refused: ${grantRes.error ?? "unknown"} \u2014 the grant that should seat "${rb.relation}" on the proof actor was rejected (is ${rb.grantDirectiveId} itself gated? add .grants("${rb.relation}") + an ungated bootstrap, or prove by hand)`);
|
|
1660
|
+
}
|
|
1661
|
+
lines.push(`\u2713 relation bootstrap (grant) \u2014 ${rb.domain}/${rb.grantDirectiveId} granted "${rb.relation}" to ${ACTOR} (${rb.via})`);
|
|
1662
|
+
const gatedPayload = { ...rb.gatedPayload };
|
|
1663
|
+
for (const f of rb.gatedAutoStamped) gatedPayload[f] = stamp;
|
|
1664
|
+
if (rb.gatedMintField !== void 0 && rb.gatedAggregateId !== void 0) gatedPayload[rb.gatedMintField] = mintId(eng, rb.gatedAggregateId);
|
|
1665
|
+
const gatedRes = author(eng, ws, rb.domain, rb.gatedDirectiveId, gatedPayload, lawHash, actorOpts);
|
|
1666
|
+
if (gatedRes.ok === false) {
|
|
1667
|
+
return done(false, `relation bootstrap prove ${rb.domain}/${rb.gatedDirectiveId} refused: ${gatedRes.error ?? "unknown"} \u2014 the gated write did NOT succeed even after granting "${rb.relation}" to the actor (the gate is not honoring the seeded relation, OR the grant did not seat R on ${ACTOR})`);
|
|
1668
|
+
}
|
|
1669
|
+
lines.push(`\u2713 relation bootstrap (prove) \u2014 ${rb.domain}/${rb.gatedDirectiveId} authored under the seeded holder of "${rb.relation}" (gated write SUCCEEDS once granted)`);
|
|
1670
|
+
return done(true);
|
|
1671
|
+
}
|
|
1638
1672
|
function actorFromPayload(payload, field) {
|
|
1639
1673
|
if (field === void 0) return void 0;
|
|
1640
1674
|
const value = payload[field];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "githolon",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.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.
|
|
33
|
-
"@githolon/dsl": "^0.
|
|
32
|
+
"@githolon/client": "^0.28.0",
|
|
33
|
+
"@githolon/dsl": "^0.28.0",
|
|
34
34
|
"isomorphic-git": "^1.38.4"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|