create-githolon 0.1.4 → 0.1.6
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 +9 -0
- package/package.json +1 -1
- package/template/README.md +6 -0
- package/template/test/e2e.mts +11 -0
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
package/template/README.md
CHANGED
|
@@ -10,6 +10,12 @@ npx githolon compile # → build/: deployable package + manifests + typ
|
|
|
10
10
|
npx githolon login --agent # self-onboard a verified identity (no browser; linkable to a full account later)
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
+
**The shortest complete proof** — `npm install && npx githolon compile && npm run e2e`
|
|
14
|
+
— IS the whole demonstration: your law deploys to a throwaway workspace, an
|
|
15
|
+
ENFORCED-offline write (fetch is trapped) syncs through edge admission, and the
|
|
16
|
+
cloud answers your declared query and count. Paths A/B below are for keeping a
|
|
17
|
+
real workspace afterwards.
|
|
18
|
+
|
|
13
19
|
## Path A — deploy your law
|
|
14
20
|
|
|
15
21
|
```bash
|
package/template/test/e2e.mts
CHANGED
|
@@ -15,6 +15,9 @@ const CLOUD = (process.env.NOMOS_CLOUD || "https://nomos.captainapp.co.uk").repl
|
|
|
15
15
|
const WS = process.env.NOMOS_WS || "gb-e2e-" + Math.random().toString(36).slice(2, 8);
|
|
16
16
|
|
|
17
17
|
// explicit annotation on the const so TS's never-call narrowing applies after fail(...)
|
|
18
|
+
// IDENTITY NOTE: this proof uses the bare x-nomos-principal lane so the test is
|
|
19
|
+
// SELF-CONTAINED (a throwaway workspace, no stored credentials). Real apps use
|
|
20
|
+
// `githolon login --agent` (a VERIFIED identity) + `githolon ws create/deploy`.
|
|
18
21
|
const fail: (m: string) => never = (m) => { console.error("✗ " + m); process.exit(1); };
|
|
19
22
|
const ok = (m: string) => console.log("✓ " + m);
|
|
20
23
|
|
|
@@ -51,6 +54,11 @@ ok("local replay — guestbook law Active in the local projection");
|
|
|
51
54
|
|
|
52
55
|
// 3. LOCAL-FIRST write through the TYPED surface: payload shape + enum are compile-checked
|
|
53
56
|
const signedAt = new Date().toISOString();
|
|
57
|
+
// THE OFFLINE PROOF IS ENFORCED, not narrated: while we author/query/count
|
|
58
|
+
// LOCALLY, fetch THROWS — if any "local" path touched the network, this test fails.
|
|
59
|
+
const realFetch = globalThis.fetch;
|
|
60
|
+
globalThis.fetch = (() => { throw new Error("OFFLINE PROOF VIOLATED: local authoring touched the network"); }) as typeof fetch;
|
|
61
|
+
|
|
54
62
|
await app.signGuestbook({ author: "ada", message: "hello from the edge of the network", mood: "delighted", signedAt, tags: ["first-entry"] });
|
|
55
63
|
ok("typed dispatch signGuestbook — offline write under the pulled law");
|
|
56
64
|
|
|
@@ -77,6 +85,9 @@ const localCount = await app.entriesPerMood("delighted");
|
|
|
77
85
|
if (localCount !== 1) fail(`local declared count: ${localCount}`);
|
|
78
86
|
ok("declared count maintained locally — entriesPerMood('delighted') = 1");
|
|
79
87
|
|
|
88
|
+
globalThis.fetch = realFetch;
|
|
89
|
+
ok("offline proof ENFORCED — fetch was trapped: local write/query/mutate/count touched no network");
|
|
90
|
+
|
|
80
91
|
// 6. sync: push the session branch + edge admission merges to main
|
|
81
92
|
const s = await holon.sync({ admit: true });
|
|
82
93
|
if (!s.admission?.ok) fail(`sync/admit: ${JSON.stringify(s)}`);
|