@githolon/dsl 0.59.0 → 0.59.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.
@@ -0,0 +1,45 @@
1
+ # Nomos Pre-Release License (v1)
2
+
3
+ Copyright © 2026 Captain App Ltd. All rights reserved.
4
+
5
+ This is a pre-release of Nomos. This license gives you what you need to BUILD
6
+ with it; we keep the rest for now.
7
+
8
+ ## You may
9
+
10
+ - install and use these packages to author Nomos domains, compile them, and
11
+ deploy them to Nomos Cloud or any Nomos instance Captain App operates or
12
+ authorizes;
13
+ - build, run, and ship applications on top of them — including commercial ones;
14
+ - keep everything that's yours: code you write, and everything these tools
15
+ generate FOR you (scaffolds from `create-githolon` / `githolon generate`, generated
16
+ clients, compiled domain packages) carries NO restriction from us — it is
17
+ yours outright.
18
+
19
+ ## You may not
20
+
21
+ - redistribute these packages or their source, in whole or in part, outside
22
+ your team;
23
+ - modify them or build derivative tools, SDKs, or runtimes from their source;
24
+ - offer the Nomos runtime, or anything materially similar, as a hosted service;
25
+ - reverse-engineer the holon wasm runtime.
26
+
27
+ ## Data retention
28
+
29
+ This is a pre-release we are actively evaluating. Workspaces you retire stop
30
+ counting toward your quota but are NOT deleted: **we retain all workspace data
31
+ (ledgers, law, intents) and may examine it to evaluate how the product is
32
+ used.** Don't put anything in a pre-release workspace you wouldn't want the
33
+ builders to read. If you need something truly expunged, ask:
34
+ jack@captainapp.co.uk.
35
+
36
+ ## The rest
37
+
38
+ Provided **as is**, with no warranty of any kind; to the maximum extent
39
+ permitted by law, Captain App Ltd accepts no liability arising from your use.
40
+ This license terminates automatically if you breach it.
41
+
42
+ Want the kernel source, broader rights, or to do something this doesn't cover?
43
+ **Ask: jack@captainapp.co.uk.** The plan is to open Nomos up gradually, with
44
+ the people actually using it — telling us what you're building is how that
45
+ happens faster.
@@ -0,0 +1,15 @@
1
+ # nomos_types
2
+
3
+ The pure data core for Nomos Dart frontends — kernel wire types, the offer codec,
4
+ the `NomosReads` typed-read seam, aggregate metadata, schema validation, and the
5
+ structured error surface. **No transport, no bridge, no runtime**: this package is
6
+ safe to depend on from UI code.
7
+
8
+ It is the foundation of the Nomos layered-packages emit (`dart.packages` in
9
+ `nomos-compile`): generated per-domain TYPES packages depend only on `nomos_types`,
10
+ while the effectful runtime rides `nomos_client` (which depends on and re-exports
11
+ this package). The layering line: generated types may flow to the UI; generated
12
+ clients/runtime may not.
13
+
14
+ Part of [Nomos](https://github.com/Captain-App/nomos2) — a local-first domain
15
+ runtime where every peer runs the same deterministic wasm holon.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@githolon/dsl",
3
- "version": "0.59.0",
3
+ "version": "0.59.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",
@@ -1878,6 +1878,10 @@ export interface ProofLegs {
1878
1878
  * When this domain is itself the BORN child's law (no standalone create), the index also registers the
1879
1879
  * child domain key pointing at the SAME leg, so `proof --domain <child>` resolves through the parent birth. */
1880
1880
  readonly childBirth?: ChildBirthLeg;
1881
+ /** ALL child-birth legs, when this domain declares MORE THAN ONE `.births()` directive (`childBirth` is
1882
+ * always the first of these). Emitted only in the >1 case so single-birth output is byte-unchanged;
1883
+ * readers should treat `childBirths ?? (childBirth ? [childBirth] : [])` as the canonical set. */
1884
+ readonly childBirths?: readonly ChildBirthLeg[];
1881
1885
  /** THE RELATION-BOOTSTRAP LEG — present iff this domain has a `.requires(R)`-gated directive AND a
1882
1886
  * discoverable granter of R (a `.grants(R)` marker, or a plan-probed granting `writeTuple`). Proves the
1883
1887
  * gated write SUCCEEDS once R is granted (the seed-then-prove positive). Additive: absent ⇒ older/ungated. */
@@ -2014,9 +2018,9 @@ export function proofLegsForModule(mod: DomainModule): ProofLegs | null {
2014
2018
  };
2015
2019
  }
2016
2020
 
2017
- /** The first `.births()` directive in a module (with a synthesizable payload), or undefined. */
2018
- function birthDirectiveOf(mod: DomainModule): Directive<unknown> | undefined {
2019
- return (mod.directives as Directive<unknown>[]).find((d) => d?.birthsChild === true && typeof d.payloadSchema === "object");
2021
+ /** Whether a module carries any `.births()` directive (with a synthesizable payload). */
2022
+ function hasBirthDirective(mod: DomainModule): boolean {
2023
+ return (mod.directives as Directive<unknown>[]).some((d) => d?.birthsChild === true && typeof d.payloadSchema === "object");
2020
2024
  }
2021
2025
 
2022
2026
  /** Build the legs for ONE domain module — every leg it carries (compile-valid always; standalone-provable
@@ -2034,10 +2038,11 @@ export function legsForDomain(mod: DomainModule, modules: readonly DomainModule[
2034
2038
  } catch {
2035
2039
  standalone = null;
2036
2040
  }
2037
- // The child-birth leg (when the domain has a `.births()` directive) — discovered by running its plan.
2038
- const birthDir = birthDirectiveOf(mod);
2039
- const childBirth = birthDir !== undefined ? allBirths.find((b) => b.parentDomain === domain && b.birthDirectiveId === birthDir.id) : undefined;
2040
- const childBirthWithSetup = childBirth !== undefined ? attachParentSetup(childBirth, allBirths) : undefined;
2041
+ // The child-birth legs (one per `.births()` directive) — discovered by running each plan. A parent
2042
+ // with SEVERAL births (co2: birthCatalogueWorkspace + birthEstateWorkspace) keeps EVERY leg; keeping
2043
+ // only the first left the other children compile-valid-only (unprovable through their birth).
2044
+ const childBirths = allBirths.filter((b) => b.parentDomain === domain).map((b) => attachParentSetup(b, allBirths));
2045
+ const childBirthWithSetup = childBirths[0];
2041
2046
 
2042
2047
  // The relation-bootstrap leg (when the domain has a `.requires(R)`-gated directive AND a discoverable
2043
2048
  // granter of R). FAIL SOFT: no granter → no leg (the negative conformance leg still covers the gate).
@@ -2120,6 +2125,7 @@ export function legsForDomain(mod: DomainModule, modules: readonly DomainModule[
2120
2125
  }
2121
2126
  : {}),
2122
2127
  ...(childBirthWithSetup !== undefined ? { childBirth: childBirthWithSetup } : {}),
2128
+ ...(childBirths.length > 1 ? { childBirths } : {}),
2123
2129
  ...(relationBootstrap !== undefined ? { relationBootstrap } : {}),
2124
2130
  };
2125
2131
  }
@@ -2142,17 +2148,18 @@ export function proofLegsIndex(modules: readonly DomainModule[]): { default: str
2142
2148
  // no standalone leg of its own. Register that child domain key pointing at the PARENT's child-birth leg
2143
2149
  // (so `proof --domain estate` proves it THROUGH the birth that installs it — the only way it comes to be).
2144
2150
  for (const legs of [...Object.values(domains)]) {
2145
- const cb = legs.childBirth;
2146
- if (cb === undefined) continue;
2147
- const existing = domains[cb.childDomain];
2148
- if (existing === undefined) {
2149
- // A pure child-only domain whose ONLY proof is the parent birth: register it as child-birth-provable.
2150
- domains[cb.childDomain] = { domain: cb.childDomain, legs: ["compile-valid", "child-birth-provable"], childBirth: cb };
2151
- if (!order.includes(cb.childDomain)) order.push(cb.childDomain);
2152
- } else if (existing.childBirth === undefined) {
2153
- // The child domain ALSO compiled standalone (e.g. it has its own create) — add the child-birth leg to it.
2154
- const mergedLegs = [...new Set([...(existing.legs ?? ["compile-valid"]), "child-birth-provable" as const])];
2155
- domains[cb.childDomain] = { ...existing, legs: mergedLegs, childBirth: cb };
2151
+ // EVERY birth leg fans out to its child (a parent with several `.births()` registers each child).
2152
+ for (const cb of legs.childBirths ?? (legs.childBirth !== undefined ? [legs.childBirth] : [])) {
2153
+ const existing = domains[cb.childDomain];
2154
+ if (existing === undefined) {
2155
+ // A pure child-only domain whose ONLY proof is the parent birth: register it as child-birth-provable.
2156
+ domains[cb.childDomain] = { domain: cb.childDomain, legs: ["compile-valid", "child-birth-provable"], childBirth: cb };
2157
+ if (!order.includes(cb.childDomain)) order.push(cb.childDomain);
2158
+ } else if (existing.childBirth === undefined) {
2159
+ // The child domain ALSO compiled standalone (e.g. it has its own create) — add the child-birth leg to it.
2160
+ const mergedLegs = [...new Set([...(existing.legs ?? ["compile-valid"]), "child-birth-provable" as const])];
2161
+ domains[cb.childDomain] = { ...existing, legs: mergedLegs, childBirth: cb };
2162
+ }
2156
2163
  }
2157
2164
  }
2158
2165
  if (order.length === 0) return null;
@@ -2473,7 +2480,7 @@ export function generateTsProof(modules: readonly DomainModule[], opts: TsProofO
2473
2480
  // domain's FULL legs (so the offline runner + the index never describe different directives).
2474
2481
  const hasStandaloneCreate = (m: DomainModule): boolean =>
2475
2482
  (m.directives as Directive<unknown>[]).some((d) => isStandaloneCreate(d));
2476
- const hasBirth = (m: DomainModule): boolean => birthDirectiveOf(m) !== undefined;
2483
+ const hasBirth = (m: DomainModule): boolean => hasBirthDirective(m);
2477
2484
  const isBootstrapProvable = (m: DomainModule): boolean => {
2478
2485
  try { return discoverRelationBootstrapLeg(m) !== undefined; } catch { return false; }
2479
2486
  };