create-holon 0.1.3 → 0.1.5

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/LICENSE.md CHANGED
@@ -24,6 +24,15 @@ with it; we keep the rest for now.
24
24
  - offer the Nomos runtime, or anything materially similar, as a hosted service;
25
25
  - reverse-engineer the holon wasm runtime.
26
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
+
27
36
  ## The rest
28
37
 
29
38
  Provided **as is**, with no warranty of any kind; to the maximum extent
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-holon",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "type": "module",
5
5
  "description": "Scaffold a Nomos domain package: the starter domain + compile config + live e2e. `npm create githolon my-app`.",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -43,6 +43,34 @@ After birth, `holon/` tracks YOUR workspace: new writes admitted on main arrive
43
43
  with `git pull`. (`githolon git setup` installed a git credential helper, so plain
44
44
  git just works against the cloud.)
45
45
 
46
+ ## Make it YOURS — the five-minute walkthrough
47
+
48
+ The starter is the tutorial; this is the exact path from guestbook to your own law.
49
+
50
+ 1. **Rename the law file** and reshape it:
51
+ `git mv domains/guestbook.ts domains/<yours>.ts` — keep the patterns
52
+ (aggregate fields each tagged a merge driver; directives = zod payload → pure
53
+ plan; `addToSet` for AddWins sets — `set()` on a set field is refused).
54
+ 2. **Point the compile config at it** — `nomos.package.mjs`:
55
+ ```js
56
+ export default { name: "<pkg>", domains: [{ key: "<pkg>", modules: ["./domains/<yours>.ts"] }] };
57
+ ```
58
+ **Naming convention:** make `<pkg>` ONE lowercase word (`potluck`, `studygroup`).
59
+ It becomes the generated symbols verbatim: `build/<pkg>.client.ts` exporting
60
+ `<pkg>Client(holon)` and `<PKG>_DOMAIN_HASH`.
61
+ 3. **Compile and read what you built:**
62
+ ```bash
63
+ npx githolon compile && cat build/<pkg>.summary.txt
64
+ ```
65
+ 4. **Re-point the proof** — in `test/e2e.mts`, update the client import and the
66
+ directive/query/count names to yours; `npm run typecheck` names every stale
67
+ reference until it's clean.
68
+ 5. **Prove it live:** `npm run e2e` — your law deploys to a throwaway workspace,
69
+ an offline write syncs through admission, the cloud answers your declared
70
+ query and count, and two blind clients prove the AddWins merge.
71
+
72
+ Then deploy it for real: `npx githolon login --agent && npx githolon ws create <ws> && npx githolon deploy <ws>`.
73
+
46
74
  ## What's here
47
75
 
48
76
  - `domains/guestbook.ts` — the starter domain (the law): one aggregate, two
@@ -51,6 +51,11 @@ ok("local replay — guestbook law Active in the local projection");
51
51
 
52
52
  // 3. LOCAL-FIRST write through the TYPED surface: payload shape + enum are compile-checked
53
53
  const signedAt = new Date().toISOString();
54
+ // THE OFFLINE PROOF IS ENFORCED, not narrated: while we author/query/count
55
+ // LOCALLY, fetch THROWS — if any "local" path touched the network, this test fails.
56
+ const realFetch = globalThis.fetch;
57
+ globalThis.fetch = (() => { throw new Error("OFFLINE PROOF VIOLATED: local authoring touched the network"); }) as typeof fetch;
58
+
54
59
  await app.signGuestbook({ author: "ada", message: "hello from the edge of the network", mood: "delighted", signedAt, tags: ["first-entry"] });
55
60
  ok("typed dispatch signGuestbook — offline write under the pulled law");
56
61
 
@@ -77,6 +82,9 @@ const localCount = await app.entriesPerMood("delighted");
77
82
  if (localCount !== 1) fail(`local declared count: ${localCount}`);
78
83
  ok("declared count maintained locally — entriesPerMood('delighted') = 1");
79
84
 
85
+ globalThis.fetch = realFetch;
86
+ ok("offline proof ENFORCED — fetch was trapped: local write/query/mutate/count touched no network");
87
+
80
88
  // 6. sync: push the session branch + edge admission merges to main
81
89
  const s = await holon.sync({ admit: true });
82
90
  if (!s.admission?.ok) fail(`sync/admit: ${JSON.stringify(s)}`);