From 11ed4ddf2791627a8c6da1ae33c1cb2b804a430b Mon Sep 17 00:00:00 2001 From: giles Date: Tue, 26 May 2026 19:44:56 +0000 Subject: [PATCH] =?UTF-8?q?fed-sx-m1:=20Step=201a=20=E2=80=94=20next/=20sk?= =?UTF-8?q?eleton=20+=20README=20+=20gitignore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- next/.gitignore | 1 + next/README.md | 34 ++++++++++++++++++++++++++++++++++ next/genesis/.gitkeep | 0 next/kernel/.gitkeep | 0 next/tests/.gitkeep | 0 plans/fed-sx-milestone-1.md | 14 ++++++++++++++ 6 files changed, 49 insertions(+) create mode 100644 next/.gitignore create mode 100644 next/README.md create mode 100644 next/genesis/.gitkeep create mode 100644 next/kernel/.gitkeep create mode 100644 next/tests/.gitkeep diff --git a/next/.gitignore b/next/.gitignore new file mode 100644 index 00000000..8fce6030 --- /dev/null +++ b/next/.gitignore @@ -0,0 +1 @@ +data/ diff --git a/next/README.md b/next/README.md new file mode 100644 index 00000000..e6bfc4d9 --- /dev/null +++ b/next/README.md @@ -0,0 +1,34 @@ +# next — fed-sx Milestone 1 kernel + +Single-instance, single-actor fed-sx server built as Erlang-on-SX modules. +See `plans/fed-sx-design.md` for the architecture and +`plans/fed-sx-milestone-1.md` for the build plan. + +## Layout + +``` +next/ +├── kernel/ Erlang-on-SX kernel modules (.erl, hot-loaded via code:load_binary/3) +├── genesis/ SX source files for the genesis bootstrap bundle (DefineActivity, ...) +├── tests/ Bash test scripts driving sx_server.exe via the epoch protocol +└── data/ Runtime state — gitignored + ├── log/ per-actor JSONL outboxes + ├── objects/ CID-addressed artifacts on disk + ├── snapshots/ projection snapshots + ├── indexes/ derived projection index files + └── keys/ actor signing keys + bearer tokens +``` + +## Substrate + +The kernel is Erlang-on-SX. Each `.erl` source file is hot-loaded at boot via +`code:load_binary(Mod, Filename, SourceString)` (Erlang Phase 7 BIF). The +underlying SX runtime provides the host primitives the kernel calls into: +`crypto:*`, `cid:*`, `file:*`, `code:*`, and (Step 8) `http:listen/2`. + +Tests drive the kernel via the epoch protocol: + +```bash +printf '(epoch 1)\n(load "lib/erlang/runtime.sx")\n(epoch 2)\n\n' \ + | hosts/ocaml/_build/default/bin/sx_server.exe +``` diff --git a/next/genesis/.gitkeep b/next/genesis/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/next/kernel/.gitkeep b/next/kernel/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/next/tests/.gitkeep b/next/tests/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/plans/fed-sx-milestone-1.md b/plans/fed-sx-milestone-1.md index de7a3e60..38ae3afb 100644 --- a/plans/fed-sx-milestone-1.md +++ b/plans/fed-sx-milestone-1.md @@ -99,6 +99,10 @@ in isolation, and a clear acceptance check. ## Step 1 — Repo skeleton + canonical CID +**Sub-deliverables:** +- [x] **1a** — `next/` directory skeleton, README, `.gitignore` for `data/` +- [ ] **1b** — `next/kernel/cid.erl` (from_sx/to_string/from_string/equals) + `next/tests/cid.sh` (10+ cases) + **Deliverables:** ``` @@ -920,3 +924,13 @@ A few things still under-specified; resolve as work begins. 60 seconds." Tunable per-projection later; v1 uses the default. 5. **Genesis bundle format.** Dag-cbor map per §12.2; concrete schema needs one round of refinement once we author the actual definitions in step 4. + +--- + +## Progress log + +Newest first. One line per sub-deliverable commit. Erlang conformance gate +(`bash lib/erlang/conformance.sh`) must remain 729/729 on every entry. + +- **2026-05-26** — Step 1a: `next/` skeleton created (kernel/, genesis/, tests/, data/), README, `.gitignore data/`. Erlang conformance 729/729 preserved. +