@githolon/dsl 0.30.0 → 0.30.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/package.json +1 -1
- package/src/codegen_proof.ts +242 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@githolon/dsl",
|
|
3
|
-
"version": "0.30.
|
|
3
|
+
"version": "0.30.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Nomos 2 domain-authoring DSL: aggregates + directives in TS, executed and encoded to the Rust kernel's wire shapes.",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
package/src/codegen_proof.ts
CHANGED
|
@@ -383,6 +383,27 @@ function relationSeedLegLines(
|
|
|
383
383
|
? ` — a COMPUTED gate: granting "${leg.grantedRelation}" makes the actor satisfy "${leg.relation}" via the rewrite`
|
|
384
384
|
: ``;
|
|
385
385
|
|
|
386
|
+
if (leg.bornContext !== undefined) {
|
|
387
|
+
// LAYER 4 — THE BORN-DOMAIN GENESIS-AUTHORITY PATH (co2 home). R is established ONLY by the birth genesis
|
|
388
|
+
// (e.g. birthHome → seedHomeCreator seats creator), and the seed carries an owner-binding PREREQUISITE a
|
|
389
|
+
// standalone re-seed can't satisfy. This leg is proven by `githolon proof` (offline, on the local wasm):
|
|
390
|
+
// the runner BIRTHS the workspace as the proof actor (= owner), then dispatches the gated directive INSIDE
|
|
391
|
+
// the born workspace as that owner, asserting ADMITTED at the real kernel gate (a refusal degrades to a
|
|
392
|
+
// diagnostic — never a false green). The LIVE `--live` lane proves the underlying birth via the child-birth
|
|
393
|
+
// leg; the gated-directive-in-born-context proof is the offline runner's (birthing a throwaway home per
|
|
394
|
+
// gated directive live would leave orphan workspaces).
|
|
395
|
+
const bc = leg.bornContext;
|
|
396
|
+
return [
|
|
397
|
+
`// ${n()}. RELATION BOOTSTRAP — LAYER 4 (born-domain genesis authority): \`${leg.domain}/${leg.gatedDirectiveId}\``,
|
|
398
|
+
`// is GATED (\`.requires("${leg.relation}")\`), established ONLY by the birth genesis (\`${bc.birthDirectiveId}\` →`,
|
|
399
|
+
`// \`${bc.seatsViaDirectiveId}\` seats "${leg.relation}") — NOT a standalone-replayable seed (its owner-binding`,
|
|
400
|
+
`// prerequisite would false-fail). Proven by \`githolon proof\` (offline): birth the workspace as the owner,`,
|
|
401
|
+
`// then dispatch \`${leg.gatedDirectiveId}\` INSIDE the born workspace as that owner (real-gate admitted).`,
|
|
402
|
+
`console.log("– relation-bootstrap leg (born-context) — \`${leg.domain}/${leg.gatedDirectiveId}\` .requires(\\"${leg.relation}\\") is proven in the BORN workspace by \`githolon proof\` (offline); the birth is proven live by the child-birth leg");`,
|
|
403
|
+
``,
|
|
404
|
+
];
|
|
405
|
+
}
|
|
406
|
+
|
|
386
407
|
if (speculative) {
|
|
387
408
|
// LAYER 3 (seed-path replay). The gate relation is reachable only through ttu/intersection/exclusion — no
|
|
388
409
|
// directly-grantable base. We REPLAY the domain's declared seed and let the REAL GATE arbitrate: if the
|
|
@@ -493,8 +514,10 @@ export interface RelationBootstrapLeg {
|
|
|
493
514
|
* `writeTuple(R)`), `"computed-base"` (R is computed; the grant seats a rewrite BASE relation the granter
|
|
494
515
|
* was found for), or `"seed-path"` (LAYER 3: R is reachable only through ttu/intersection/exclusion — no
|
|
495
516
|
* directly-grantable base — so a DECLARED SEED directive that establishes root authority is replayed and
|
|
496
|
-
* the REAL KERNEL GATE is the arbiter of whether it authorizes the write)
|
|
497
|
-
|
|
517
|
+
* the REAL KERNEL GATE is the arbiter of whether it authorizes the write), or `"born-context"` (LAYER 4:
|
|
518
|
+
* R is established by the domain's BIRTH GENESIS — the gated directive is proven INSIDE the born workspace
|
|
519
|
+
* as the owner; see {@link BornContextAuthority}). Audit + runner semantics. */
|
|
520
|
+
readonly via: "marker" | "inferred" | "computed-base" | "seed-path" | "born-context";
|
|
498
521
|
/** LAYER-3 ANTI-FALSE-GREEN FLAG. `true` ⇒ this is a SPECULATIVE seed-path leg: codegen could NOT prove
|
|
499
522
|
* (via rewrite resolution) that replaying `grantDirectiveId` authorizes the gated write — it discovered a
|
|
500
523
|
* seed that writes relation tuples and is DEFERRING to the real kernel gate. The runner replays the seed,
|
|
@@ -504,6 +527,37 @@ export interface RelationBootstrapLeg {
|
|
|
504
527
|
readonly seedSpeculative?: boolean;
|
|
505
528
|
/** The relations the discovered seed directive writes (layer-3 audit/diagnostic — what authority it seats). */
|
|
506
529
|
readonly seedWritesRelations?: readonly string[];
|
|
530
|
+
/** LAYER 4 — THE BORN-DOMAIN GENESIS-AUTHORITY PATH. Present iff the gate relation is established by the
|
|
531
|
+
* domain's BIRTH GENESIS (not a standalone-replayable seed): a `.births()` directive whose genesis chain
|
|
532
|
+
* seats R (e.g. co2's `birthHome` → `seedHomeCreator` seats `creator`), and whose born workspace runs the
|
|
533
|
+
* SAME law — so the gated directive can be proven INSIDE the born context, dispatched as the genesis-
|
|
534
|
+
* established OWNER, where the seed's own prerequisite invariants (HomeCreatorSeedBindsOwner) hold. This
|
|
535
|
+
* TAKES PRECEDENCE over a standalone seed (`grantDirectiveId`) for a born domain: a standalone re-seed
|
|
536
|
+
* would trip the seed's owner-binding prerequisite (HomeOwner unset) and FALSE-fail. When present, the
|
|
537
|
+
* runner IGNORES the standalone grant fields and proves via {@link BornContextAuthority}. */
|
|
538
|
+
readonly bornContext?: BornContextAuthority;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
/** THE BORN-DOMAIN GENESIS AUTHORITY (layer 4): the self-birth directive whose genesis seats the gate relation
|
|
542
|
+
* for the OWNER, plus what the runner needs to birth it (as the proof actor = the home owner) and then prove
|
|
543
|
+
* the gated directive INSIDE the born workspace. The real kernel gate is the arbiter — a refusal degrades to
|
|
544
|
+
* a diagnostic (never a false green). */
|
|
545
|
+
export interface BornContextAuthority {
|
|
546
|
+
/** The self-birth directive (`birthHome`) whose genesis chain seats the gate relation. */
|
|
547
|
+
readonly birthDirectiveId: string;
|
|
548
|
+
/** The synthesized birth payload (auto-stamped `…At` omitted; framework/law-hash placeholders removed — the
|
|
549
|
+
* runtime injects the REAL hashes + the proof actor as owner). */
|
|
550
|
+
readonly birthPayload: Record<string, unknown>;
|
|
551
|
+
readonly birthAutoStamped: readonly string[];
|
|
552
|
+
/** The birth payload field carrying the home OWNER — the runtime sets it to the proof actor, so the born
|
|
553
|
+
* home is owned by (and seats the relation for) the actor the gated dispatch then runs as. */
|
|
554
|
+
readonly ownerField?: string;
|
|
555
|
+
/** The birth payload field carrying the framework-controller hash (runtime injects the real one). */
|
|
556
|
+
readonly frameworkHashField?: string;
|
|
557
|
+
/** The birth payload field carrying the child law hash (runtime injects the deployed package hash). */
|
|
558
|
+
readonly lawHashField?: string;
|
|
559
|
+
/** The genesis step directive that actually seats the relation (audit — e.g. `seedHomeCreator`). */
|
|
560
|
+
readonly seatsViaDirectiveId: string;
|
|
507
561
|
}
|
|
508
562
|
|
|
509
563
|
/** Run a directive's plan with a synthesized+probe payload under birth-probe globals and return the drained
|
|
@@ -687,6 +741,127 @@ export function resolveGrantableBaseRelations(
|
|
|
687
741
|
return out;
|
|
688
742
|
}
|
|
689
743
|
|
|
744
|
+
// ── LAYER 4: born-domain genesis-authority discovery (the co2 home case) ─────────────────────────────────
|
|
745
|
+
//
|
|
746
|
+
// A gate relation R may be established ONLY by the domain's BIRTH GENESIS — a `.births()` directive whose
|
|
747
|
+
// genesis chain seats R for the owner (co2's `birthHome` genesis runs `seedHomeCreator`, seating `creator`).
|
|
748
|
+
// The seed itself carries a PREREQUISITE (an owner-binding workspaceInvariant reading state set by an EARLIER
|
|
749
|
+
// genesis step), so a standalone re-seed FALSE-fails (the prior state is absent). The law-true authority path
|
|
750
|
+
// is to BIRTH the workspace (replaying the whole genesis, seating R for the owner) and prove the gated
|
|
751
|
+
// directive INSIDE the born workspace, dispatched as that owner. Discovery probes each `.births()` directive's
|
|
752
|
+
// genesis chain for a step that writeTuples R; if found, the born workspace (running the SAME law) is where
|
|
753
|
+
// the gated directive proves.
|
|
754
|
+
|
|
755
|
+
/** Probe a `.births()` directive's genesis chain (birth-probe globals) → the recorded steps + the synthesized
|
|
756
|
+
* parent payload. `undefined` ⇒ not probeable / no recipe. Mirrors {@link discoverChildBirthLeg}'s probe. */
|
|
757
|
+
function probeBirthGenesis(
|
|
758
|
+
birthDir: Directive<unknown>,
|
|
759
|
+
where: string,
|
|
760
|
+
): { chain: Array<{ domain?: string; directiveId?: string; actor?: unknown }>; synth: SynthesizedPayload } | undefined {
|
|
761
|
+
let synth: SynthesizedPayload;
|
|
762
|
+
try {
|
|
763
|
+
synth = synthesizePayload(birthDir.payloadSchema as z.ZodTypeAny, where);
|
|
764
|
+
} catch {
|
|
765
|
+
return undefined;
|
|
766
|
+
}
|
|
767
|
+
const probePayload: Record<string, unknown> = { ...synth.value };
|
|
768
|
+
for (const f of synth.autoStamped) probePayload[f] = "2026-01-01T00:00:00Z";
|
|
769
|
+
let recipe: { genesisChain?: unknown } | undefined;
|
|
770
|
+
try {
|
|
771
|
+
withBirthProbeGlobals(() => {
|
|
772
|
+
__resetAuthoring();
|
|
773
|
+
__resetReads();
|
|
774
|
+
__resetBirths();
|
|
775
|
+
try {
|
|
776
|
+
birthDir.plan(probePayload as never, deterministicPorts({ physical: 1, replica: 1, principal: "principal:probe" }));
|
|
777
|
+
} finally {
|
|
778
|
+
try { __drainAuthoring(); __drainReads(); } catch { /* drained */ }
|
|
779
|
+
}
|
|
780
|
+
recipe = __drainBirths()[0] as typeof recipe;
|
|
781
|
+
});
|
|
782
|
+
} catch {
|
|
783
|
+
return undefined;
|
|
784
|
+
}
|
|
785
|
+
if (recipe === undefined || !Array.isArray(recipe.genesisChain)) return undefined;
|
|
786
|
+
return { chain: recipe.genesisChain as Array<{ domain?: string; directiveId?: string; actor?: unknown }>, synth };
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
/**
|
|
790
|
+
* Discover the BORN-DOMAIN genesis authority for a gate `relation`: a `.births()` directive in `mod` whose
|
|
791
|
+
* genesis chain seats `relation` (a genesis step whose directive `writeTuple`s R) AND whose born workspace
|
|
792
|
+
* runs the SAME law (so the gated directive is addressable there). Returns what the runner needs to birth the
|
|
793
|
+
* workspace as the proof actor (= the owner) + the owner/hash payload fields. `undefined` ⇒ no birth seats R.
|
|
794
|
+
*/
|
|
795
|
+
export function discoverBornContextAuthority(
|
|
796
|
+
mod: DomainModule,
|
|
797
|
+
relation: string,
|
|
798
|
+
): BornContextAuthority | undefined {
|
|
799
|
+
const domain = mod.domain ?? mod.name;
|
|
800
|
+
const directives = mod.directives as Directive<unknown>[];
|
|
801
|
+
const byId = new Map(directives.map((d) => [d.id, d]));
|
|
802
|
+
for (const bd of directives) {
|
|
803
|
+
if (bd?.birthsChild !== true || typeof bd.payloadSchema !== "object") continue;
|
|
804
|
+
const probed = probeBirthGenesis(bd, `${domain}/${bd.id}`);
|
|
805
|
+
if (probed === undefined) continue;
|
|
806
|
+
const { chain, synth } = probed;
|
|
807
|
+
// Find the genesis step (in THIS domain) whose directive writeTuples `relation` — that step seats R.
|
|
808
|
+
let seatsVia: string | undefined;
|
|
809
|
+
for (const step of chain) {
|
|
810
|
+
if (step === null || typeof step !== "object" || step.domain !== domain || typeof step.directiveId !== "string") continue;
|
|
811
|
+
const stepDir = byId.get(step.directiveId);
|
|
812
|
+
if (stepDir === undefined) continue;
|
|
813
|
+
if (probeRelationsWritten(stepDir, `${domain}/${stepDir.id}`).includes(relation)) {
|
|
814
|
+
seatsVia = step.directiveId;
|
|
815
|
+
break;
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
if (seatsVia === undefined) continue;
|
|
819
|
+
|
|
820
|
+
// Resolve the owner field (the payload field whose value the genesis routes as the seed's subject/actor)
|
|
821
|
+
// + the framework/law-hash fields (matched by value against the genesis install steps), mirroring
|
|
822
|
+
// discoverChildBirthLeg. The owner field is the payload field carried as a genesis step actor.
|
|
823
|
+
const fieldForValue = (v: unknown): string | undefined =>
|
|
824
|
+
Object.entries(synth.value).find(([, sv]) => sv === v && typeof v === "string" && v.length > 0)?.[0];
|
|
825
|
+
const ownerField = (() => {
|
|
826
|
+
for (const step of chain as Array<{ actor?: unknown }>) {
|
|
827
|
+
const exact = fieldForValue(step?.actor);
|
|
828
|
+
if (exact !== undefined) return exact;
|
|
829
|
+
if (typeof step?.actor === "string") {
|
|
830
|
+
for (const [field, value] of Object.entries(synth.value)) {
|
|
831
|
+
if (typeof value === "string" && value.length > 0 && (step.actor === `user:${value}` || step.actor === `key:${value}`)) return field;
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
return undefined;
|
|
836
|
+
})();
|
|
837
|
+
const installSteps = chain.filter((s) => s !== null && typeof s === "object" && s.directiveId === "installDomain") as Array<{ domain?: string; payload?: { domainHash?: unknown } }>;
|
|
838
|
+
const frameworkHashField = fieldForValue(installSteps.find((s) => s.domain === "bootstrap")?.payload?.domainHash);
|
|
839
|
+
const lawHashField = fieldForValue(installSteps.find((s) => s.domain === "nomos")?.payload?.domainHash);
|
|
840
|
+
|
|
841
|
+
const birthPayload: Record<string, unknown> = { ...synth.value };
|
|
842
|
+
if (frameworkHashField !== undefined) delete birthPayload[frameworkHashField];
|
|
843
|
+
if (lawHashField !== undefined) delete birthPayload[lawHashField];
|
|
844
|
+
|
|
845
|
+
return {
|
|
846
|
+
birthDirectiveId: bd.id,
|
|
847
|
+
birthPayload,
|
|
848
|
+
birthAutoStamped: synth.autoStamped,
|
|
849
|
+
...(ownerField !== undefined ? { ownerField } : {}),
|
|
850
|
+
...(frameworkHashField !== undefined ? { frameworkHashField } : {}),
|
|
851
|
+
...(lawHashField !== undefined ? { lawHashField } : {}),
|
|
852
|
+
seatsViaDirectiveId: seatsVia,
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
return undefined;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
/** Does any workspaceInvariant fire ON `directiveId` — i.e. does that directive carry a PREREQUISITE (a
|
|
859
|
+
* declared invariant reading state another step must establish first)? A standalone replay of such a
|
|
860
|
+
* directive can FALSE-fail (the prior state is absent), so a born domain must prove via the genesis path. */
|
|
861
|
+
function directiveHasPrerequisiteInvariant(mod: DomainModule, directiveId: string): boolean {
|
|
862
|
+
return (mod.workspaceInvariants ?? []).some((inv) => inv.on === directiveId);
|
|
863
|
+
}
|
|
864
|
+
|
|
690
865
|
/** Discover the RELATION-BOOTSTRAP leg for a module: the first gated (`.requires(R)`) directive plus the
|
|
691
866
|
* sibling that ESTABLISHES the actor's authority for R. In priority order: (1) a DIRECT granter of R (a
|
|
692
867
|
* `.grants(R)` marker or a plan-probed `writeTuple(R)`) — the original lane; (2) REWRITE-AWARE — when R is
|
|
@@ -765,14 +940,54 @@ export function discoverRelationBootstrapLeg(mod: DomainModule): RelationBootstr
|
|
|
765
940
|
// guard: `seedSpeculative`). Prefer a seed that seats the MOST relations (a genesis/owner seed like
|
|
766
941
|
// estate's, which lands admin/creator/estateOwner together — the broadest root authority).
|
|
767
942
|
const seed = discoverSeedDirective(candidates, domain);
|
|
768
|
-
if (seed
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
943
|
+
if (seed !== undefined) {
|
|
944
|
+
found = { granter: seed.dir, via: "inferred" };
|
|
945
|
+
grantedRelation = seed.relationsWritten[0] ?? relation; // cosmetic — the seed's primary relation
|
|
946
|
+
via = "seed-path";
|
|
947
|
+
seedSpeculative = true;
|
|
948
|
+
seedWritesRelations = seed.relationsWritten;
|
|
949
|
+
}
|
|
774
950
|
}
|
|
775
951
|
}
|
|
952
|
+
|
|
953
|
+
// (4) BORN-DOMAIN GENESIS AUTHORITY (the co2 home case) — precedence over a standalone seed. The standalone
|
|
954
|
+
// path is "clean" ONLY when a granter was found, it isn't the speculative seed-path lane, AND that granter
|
|
955
|
+
// carries NO prerequisite invariant (a standalone re-seed of a prerequisite-gated granter — e.g.
|
|
956
|
+
// seedHomeCreator, gated by HomeCreatorSeedBindsOwner — would FALSE-fail because the prior genesis state is
|
|
957
|
+
// absent). When the standalone path is NOT clean, prefer proving the gated directive INSIDE the born
|
|
958
|
+
// workspace, whose genesis seats R for the owner.
|
|
959
|
+
const standaloneClean =
|
|
960
|
+
found !== undefined && !seedSpeculative && !directiveHasPrerequisiteInvariant(mod, found.granter.id);
|
|
961
|
+
if (!standaloneClean) {
|
|
962
|
+
const bornContext = discoverBornContextAuthority(mod, relation);
|
|
963
|
+
if (bornContext !== undefined) {
|
|
964
|
+
return {
|
|
965
|
+
domain,
|
|
966
|
+
gatedDirectiveId: gated.id,
|
|
967
|
+
relation,
|
|
968
|
+
grantedRelation: relation,
|
|
969
|
+
gatedPayload,
|
|
970
|
+
gatedAutoStamped: gatedSynth.autoStamped,
|
|
971
|
+
...(gatedMintField !== undefined ? { gatedMintField, gatedAggregateId: gated.aggregateId } : {}),
|
|
972
|
+
// grant fields are UNUSED for a born-context leg (the runner births + dispatches inside); populate them
|
|
973
|
+
// with the genesis seed's id / empty payload so the shape stays uniform (never dispatched standalone).
|
|
974
|
+
grantDirectiveId: bornContext.seatsViaDirectiveId,
|
|
975
|
+
grantPayload: {},
|
|
976
|
+
grantAutoStamped: [],
|
|
977
|
+
grantSubjectFields: [],
|
|
978
|
+
grantGrantedByFields: [],
|
|
979
|
+
via: "born-context",
|
|
980
|
+
bornContext,
|
|
981
|
+
};
|
|
982
|
+
}
|
|
983
|
+
// No born-domain path. If a standalone granter exists but carries a prerequisite it can't satisfy alone
|
|
984
|
+
// (and isn't the speculative lane), do NOT emit a doomed passing leg — return undefined so the caller's
|
|
985
|
+
// loud diagnostic names the unmet prerequisite. A speculative seed-path stays (it degrades safely).
|
|
986
|
+
if (found !== undefined && !seedSpeculative && directiveHasPrerequisiteInvariant(mod, found.granter.id)) {
|
|
987
|
+
return undefined;
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
if (found === undefined) return undefined; // no granter at all → the caller emits the diagnostic
|
|
776
991
|
const granter = found.granter;
|
|
777
992
|
|
|
778
993
|
// Synthesize the grant payload + resolve which fields route into subject / grantedBy (so runtime seats the
|
|
@@ -845,6 +1060,19 @@ export function diagnoseRelationBootstrapGap(mod: DomainModule): string | undefi
|
|
|
845
1060
|
if (discoverRelationBootstrapLeg(mod) !== undefined) return undefined; // resolved — no gap
|
|
846
1061
|
const relation = gated.requiresRelationGate!.relation;
|
|
847
1062
|
const object = gated.requiresRelationGate!.object;
|
|
1063
|
+
// NAME THE UNMET PREREQUISITE (co2 home diagnostic): when a granter of R exists but carries a prerequisite
|
|
1064
|
+
// invariant a standalone re-seed can't satisfy AND no birth genesis seats R, say so precisely.
|
|
1065
|
+
const directivesAll = mod.directives as Directive<unknown>[];
|
|
1066
|
+
const prereqGranter = directivesAll.find(
|
|
1067
|
+
(d) => d !== gated && typeof d?.payloadSchema === "object" && d.birthsChild !== true
|
|
1068
|
+
&& probeGrantsRelation(d, relation, `${domain}/${d.id}`) && directiveHasPrerequisiteInvariant(mod, d.id),
|
|
1069
|
+
);
|
|
1070
|
+
if (prereqGranter !== undefined) {
|
|
1071
|
+
const inv = (mod.workspaceInvariants ?? []).find((i) => i.on === prereqGranter.id);
|
|
1072
|
+
return `${domain}/${gated.id} is gated by .requires("${relation}") but the proof cannot seed authority: the only granter of "${relation}" is `
|
|
1073
|
+
+ `${domain}/${prereqGranter.id}, which carries the prerequisite invariant '${inv?.id ?? "?"}' (it reads state an EARLIER step must establish), so a standalone re-seed FALSE-fails — and no \`.births()\` genesis seats "${relation}" to prove it in a born workspace. `
|
|
1074
|
+
+ `Establish "${relation}" via a birth genesis (a \`.births()\` whose chain runs ${prereqGranter.id} after seeding its prerequisite), or prove ${gated.id} by hand. (The negative conformance leg still proves the gate refuses an actorless offer.)`;
|
|
1075
|
+
}
|
|
848
1076
|
const bases = resolveGrantableBaseRelations(mod.relationTypes, object, relation).filter((b) => b !== relation);
|
|
849
1077
|
const tried = bases.length > 0
|
|
850
1078
|
? `no directive grants "${relation}" directly, nor any of its directly-grantable rewrite bases [${bases.join(", ")}]`
|
|
@@ -1544,7 +1772,7 @@ function generateBirthOnlyProof(
|
|
|
1544
1772
|
`import { readFileSync } from "node:fs";`,
|
|
1545
1773
|
`import { connect, encodeIntentOfferBytes } from "@githolon/client";`,
|
|
1546
1774
|
`import { ${factory}, ${hashConst} } from "./${opts.packageName}.client.ts";`,
|
|
1547
|
-
`void connect; void ${factory};`,
|
|
1775
|
+
`void connect; void encodeIntentOfferBytes; void ${factory};`,
|
|
1548
1776
|
``,
|
|
1549
1777
|
`const CLOUD = (process.env.NOMOS_CLOUD || "https://nomos.captainapp.co.uk").replace(/\\/+$/, "");`,
|
|
1550
1778
|
`const WS = process.env.NOMOS_WS || ${JSON.stringify(slug + "-proof-")} + Math.random().toString(36).slice(2, 8);`,
|
|
@@ -1552,6 +1780,11 @@ function generateBirthOnlyProof(
|
|
|
1552
1780
|
...v2IdentityAndCleanupPreamble(opts, hashConst, n),
|
|
1553
1781
|
``,
|
|
1554
1782
|
...liveChildBirthLegLines(cb, opts, n),
|
|
1783
|
+
// THE RELATION-BOOTSTRAP LEG (incl. LAYER 4 born-context): a birth-only domain may ALSO carry a gated
|
|
1784
|
+
// non-birth directive whose authority is established by the birth genesis (co2 home's updateHomeProfile
|
|
1785
|
+
// via birthHome→seedHomeCreator). Emit it so the birth-only proof names it (the born-context proof itself
|
|
1786
|
+
// runs in the offline `githolon proof` lane). No-op when the domain has no gated directive.
|
|
1787
|
+
...relationSeedLegLines(primaryLegs.relationBootstrap, factory, n, primaryLegs.relationBootstrap === undefined ? diagnoseRelationBootstrapGap(mod) : undefined),
|
|
1555
1788
|
`console.log(\`\\nALL GREEN — generated proof for "${opts.packageName}": deploy → child birth (\${WS} → the born child) → verified\`);`,
|
|
1556
1789
|
``,
|
|
1557
1790
|
...v2CatchFinally(),
|