101 Commits
Author SHA1 Message Date
rajames d5605eddb6 Merge pull request 'v4: init.4th and the ACL at call; the F18 ADR, ABI and artifact layout; ADR step 3 tasks 1-3 (mkf18a)' (#198) from StarForth-v4.0.0 into master 2026-11-20 18:42:28 +00:00
Claude 998510757a logs: the protocol on bd8997ff (mkf18a, ADR step 3 task 3): PASS
Acceptance / Acceptance (pull_request) Successful in 37m45s
Build / Image RASPI (push) Successful in 4m47s
Build / Image PC (push) Successful in 5m28s
Build / Image MILKV (push) Successful in 5m39s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 16m10s
Every stage passes: the four boots at POST 990/990, dict_hash
0x0ffb1d31c4aa7857 on all three (405 words), test-32 (42 programs, 0
failures), the proofs, the images and the documents.
logs/20261119-230627/PROTOCOL.md. test-32 ran twice: a container
restart lost the first run, with no result.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 23:51:12 +00:00
Claude bd8997ffdf logs: the protocol on dc3803ab so far -- four boots and test-32 pass
Build / Image RASPI (push) Successful in 5m47s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 15m7s
Build / Image PC (push) Successful in 6m2s
Build / Image MILKV (push) Successful in 5m57s
accept-amd64, accept-aarch64, accept-riscv64 and accept-stick-high
pass, POST 990/990, dict_hash 0x0ffb1d31c4aa7857 on all three (405
words); test-32, 42 programs, 0 failures. Two aarch64 runs stopped at
the 570 s foreground cap, not failed (212934 after the heartbeat,
213939 at node 11's SEND), are kept; the third ran in the background,
alone (rules, 2026-11-18), and passed. Proofs, images and docs to come.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 22:20:59 +00:00
Claude dc3803ab47 v4: mkf18a, the host tool that builds a train's F18 artifact (ADR step 3, task 3)
Build / Image RASPI (push) Successful in 3m59s
Build / Image PC (push) Successful in 3m58s
Build / Image MILKV (push) Successful in 4m7s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 16m5s
The artifact's layout and its check (artifact.h, artifact.c), the tool
(tools/f18a.c, mkf18a.c) and make -C v4 artifacts. test_mkf18a, 83
checks at both widths, failed against a stub first. Gates: test,
test-32 and sanitize pass, POST 990/990. Plan section 11.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 21:09:22 +00:00
Claude 84f119a1b3 v4 text.c: a word's flags and capabilities after its name; import lines (task 3, part 1)
As ruled (plans §10.2, §10.3, §10.5): ': NAME inline pinned mode N
ports request N' records the word's attributes and lays nothing down;
'import TRAIN NAME' declares another train's word, its calls, jumps and
&NAME recorded as that import. test_text: 11 checks failed before; 274
pass at both widths. The check that ': T immediate ;' is refused is
replaced, as ruled. Full gates run at the end of task 3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 19:53:07 +00:00
Claude d6b894769c plans, ARTIFACT.md: task 3 ruling, capabilities declared, then checked
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 19:48:24 +00:00
Claude cad8291478 plans, ABI.md: task 3 ruling, a train's hash is its .f18a's capsule ID
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 19:47:39 +00:00
Claude 57f556e645 plans: task 3 ruling, an import line
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 19:42:13 +00:00
Claude 9b114fff83 plans: task 3 ruling, flags after the : name
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 19:41:42 +00:00
Claude a1b26eacaf plans: task 3 ruling, exports are the : words, no headers
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 19:41:13 +00:00
Claude daf614285a v4 effect.c: stack effects derived from code (ADR step 3, task 2)
Build / Image RASPI (push) Successful in 4m35s
Build / Image PC (push) Successful in 4m20s
Build / Image MILKV (push) Successful in 4m6s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 15m23s
Walks a word's code, opcode by opcode with the engine's own counts, and
gives what it takes and leaves on both stacks, or why it has none.
Called and in-line words; recursion, computed jumps, paths that meet at
different depths and loops that leave a count have none. Test first:
23 checks failed against a stub. SWAP', UM/MOD, C@, C! and ROUNDTRIP
agree with their stack comments. On the nucleus: 214 of 315 headers
fixed. v4 test, test-32 and ASan+UBSan pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 19:28:33 +00:00
Claude 4d64e677f5 v4 text.c: the address record (ADR step 3, task 1)
Build / Image RASPI (push) Successful in 4m13s
Build / Image PC (push) Successful in 3m51s
Build / Image MILKV (push) Successful in 4m30s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 17m32s
Every cell laid down that holds an address of the assembly is recorded,
with its branch slot or 7 for the whole cell, as ARTIFACT.md's
relocations need. Test first: test_text 13 checks failed before.
test_host_rom_nucleus runs with the record on: 1825 branches, 664 whole
cells, the ROM still equal word for word. v4 test, test-32 and
ASan+UBSan pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 17:51:54 +00:00
Claude 29b99f90e6 plans: step 3 §6.6 ruled, mkf18a / .f18a; design ruled
Build / Image RASPI (push) Successful in 4m41s
Build / Image PC (push) Successful in 5m50s
Build / Image MILKV (push) Successful in 6m2s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 15m51s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 16:33:29 +00:00
Claude 6c639e5d20 plans: step 3 §6.5 ruled, the tool's hash is its source's
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 16:32:59 +00:00
Claude 3733949c28 ABI.md 2c: a word with no fixed effect stays internal, the build does not fail
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 16:32:39 +00:00
Claude a6371b1ce3 plans: step 3 §6.4 ruled, every fixed-effect word exported
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 16:32:21 +00:00
Claude 255dd92deb plans: step 3 §6.3a ruled, the nucleus renamed to name order
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 16:31:07 +00:00
Claude b5e85392c1 plans: step 3 §6.3 ruled, all it finds, name order
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 16:30:24 +00:00
Claude 9c8b8dbd8b plans: step 3 §6.2a ruled, the nucleus is not an artifact
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 16:28:47 +00:00
Claude 4ecdc80197 plans: step 3 §6.2 ruled, both, nucleus first
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 16:27:31 +00:00
Claude 1961348e15 ARTIFACT.md: relocation slot 7, the whole cell (step 3 §6.1 ruled)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 16:26:29 +00:00
Claude 16b8fddaef plans: artifacts in the build (ADR step 3), draft for ruling
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 16:25:39 +00:00
Claude f2174a39a4 ABI.md, ARTIFACT.md: three drafting additions confirmed
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 16:24:51 +00:00
Claude fe0f709498 ARTIFACT.md: choice 5 ruled, code cells low-first; layout ruled
Build / Image RASPI (push) Successful in 4m17s
Build / Image PC (push) Successful in 5m37s
Build / Image MILKV (push) Successful in 5m40s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 13m56s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 16:19:58 +00:00
Claude 4a7ca4e288 ARTIFACT.md: choice 4 ruled, port bit plus request list
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 16:19:00 +00:00
Claude c9cc39f4ec ARTIFACT.md: choice 3 ruled, both stack effects recorded and checked
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 16:17:11 +00:00
Claude d052af6d53 ARTIFACT.md: choice 2 ruled, SHA-512 for provenance and proofs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 16:16:20 +00:00
Claude c4b922d496 ABI.md §4: records in 32-bit units, code in cells, as ARTIFACT.md rules
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 16:15:13 +00:00
Claude 2b8609e4fc ARTIFACT.md: choice 1 ruled, 32-bit units
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 16:13:57 +00:00
Claude e43cd63936 ARTIFACT.md: the F18 artifact's layout, draft for ruling (ADR step 2)
Build / Image RASPI (push) Successful in 5m28s
Build / Image PC (push) Successful in 4m15s
Build / Image MILKV (push) Successful in 5m11s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 15m13s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 16:05:50 +00:00
Claude b450c92858 ABI choice 7: safe activation is the first property proved; the ABI v0 contract is ruled
Build / Image RASPI (push) Successful in 5m54s
Build / Image PC (push) Successful in 7m15s
Build / Image MILKV (push) Successful in 6m17s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 14m53s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 15:00:36 +00:00
Claude cb1d6d6790 ABI choice 6: the safe moment is a heartbeat tick at which no P or return stack is inside the old code
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 14:59:24 +00:00
Claude 07f86d94c8 ABI choice 5: callers reach a replacement through a jump written at the old entry
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 14:58:39 +00:00
Claude 5d9737223b ABI: the rail yard -- the SDK and CI's model for staging trains, recorded as given (Captain Bob)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 14:57:53 +00:00
Claude bc876f8088 ABI choice 4: imports name the exact build (capsule hash); an update replaces the dependent set together
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 14:51:53 +00:00
Claude 3b229ba635 ABI choice 3: the engine carries its source by reference (its hash), not as a car
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 14:51:31 +00:00
Claude 913b74a631 ABI choice 2c: a word with no fixed stack effect cannot be exported; every export has a fixed, derived effect
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 14:50:48 +00:00
Claude 2957be86e5 ABI: one train per capsule -- an engine of assembled .f18, its named blobs as rolling stock (Captain Bob)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 14:49:40 +00:00
Claude d46ca3d174 ABI choice 2 reopened: the stack effect is derived by the tool from the compiled code, not declared
Captain Bob withdrew the first answer, the ( -- ) comment, the same day:
it rested on a bad assumption tied to (-, the SDK's marker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 14:45:18 +00:00
Claude 1008b442cd ABI choice 2: the stack effect is the ( -- ) comment, read strictly; every export must have one
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 14:41:53 +00:00
Claude 0c2aab1ab5 ABI choice 1: artifacts come from a host tool, checked cell for cell against the ROM's assembly
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 14:41:22 +00:00
Claude f8be000b0a ABI.md: the flags cell also has 8, in-line (compile.f18)
Build / Image RASPI (push) Successful in 3m32s
Build / Image PC (push) Successful in 7m23s
Build / Image MILKV (push) Successful in 7m12s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 14m9s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 14:40:03 +00:00
Claude 5e1dcc197b ABI.md: the F18 ABI, draft contract for ruling (ADR step 1)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 14:39:53 +00:00
Claude 4f7521290a ADR rulings 4: a word's logical identity is its capsule (content hash) + its name
Build / Image RASPI (push) Successful in 3m42s
Build / Image MILKV (push) Successful in 3m58s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 13m55s
Build / Image PC (push) Successful in 3m57s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 14:37:55 +00:00
Claude e6addc73b7 ADR rulings 3: Artemis owns persistent memory; run-time memory stays the kernel's
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 14:37:12 +00:00
Claude 8dd1129ff0 ADR rulings 2: Hermes is the messaging role, not a VM (in v4, the fabric's wires and routing)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 14:36:24 +00:00
Claude d06a16f869 ADR rulings 1: compiled F18 artifacts allowed beside the ROM ("ADR supersedes"); MACHINE.md 1 and 5 corrected
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 14:35:47 +00:00
Claude d93e985794 ADR 2026-11-19: F18 binary artifacts, ABI/API and live runtime updates -- recorded as given (Captain Bob)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 14:34:02 +00:00
Claude 7af88cc704 v4 ACL: the countdown at call, as v3 -- the call hook may redirect
Build / Image PC (push) Successful in 6m13s
Build / Image MILKV (push) Successful in 6m40s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 14m18s
Build / Image RASPI (push) Successful in 3m11s
Captain Bob ruled "As v3: add at call", "Engine: call redirects" and
"Build it".
- The engine's call hook returns where P goes.
- The kernel checks every call from code defined at run time. A TTL is
  counted down at the call. At a TTL of 0, or a denied word, the call is
  sent to (ACL-CALL), with the target on the data stack, which rechecks
  or refuses it by the word's own name, then goes on to it.
- A word being compiled is no longer checked, as in v3.

Two things were added while building, both from v3:
- (ACL-BUSY) turns the check off while the policy rechecks. Without it
  the recheck recursed.
- (ACL-CALL) does its own refusal and leaves WORD's buffer alone. A first
  version broke POST's CONVERT.digits.

Test first: test_mesh_boot's five new checks failed before; now 120 pass
and POST is 990/990. test_exec tests the redirect. test_host_quit's two
v4-only expectations now follow v3: a denied word compiles.

All 52 tests, test-32 and ASan/UBSan pass. An amd64 session passes 18/18.
Five alternating host boots: +1.4% median, inside the noise.
DECOMPOSITION.md 5.20 is updated, and the FPGA's call opcode is recorded
as owing the same redirect.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 14:10:16 +00:00
Claude 666cf39b8b plan: the ACL countdown at call -- design, for ruling (the call hook may redirect)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 13:17:32 +00:00
Claude 9e737b6252 v4 init.4th pins the words that create or end nodes
Captain Bob ruled: "Also pin the kernel words". After the policy loads,
init.4th pins 11 words: BIRTH, BIRTH-AS, UNIT, KILL, UNIT-KILL, PAUSE,
RESUME, NODE-BORN, NODE-KILL, NODE-SLEEP and NODE-WAKE. Their fields
cannot be changed, so no policy can deny them. v4 has no CAPSULE-BIRTH.
The wiring words, NODE-WIRE and NODE-UNWIRE, are not pinned; they
neither create nor end a node.

Test first in test_mesh_boot: each of the 11 is pinned. The before-run
had all 11 unpinned. After: 114 checks pass, POST 990/990.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 12:00:23 +00:00
Claude 04f917f005 logs: the amd64 session with init.4th and the ACL on (18/18), the serial log for logs/20261119-init-acl/amd64-session.txt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 11:57:54 +00:00
Claude b13d452e66 v4 init.4th, steps 1 and 2: the ACL policy loaded after POST, then the search order
Captain Bob ruled "ACL at boot", loaded "From init.4th", the include
"Compose[d] in FORTH".
- capsules/v4/init.4th, at block 3980: S" v4:ACL.4th" CAPSULE-INCLUDE,
  then STARSHIPOS.
- capsules/v4/ACL.4th is the policy, git mv'ed from v4/capsule/ACL.fth
  and reflowed into chained 64x16 blocks, its text unchanged.
- CAPSULE-INCLUDE in centre.4th places a capsule and LOADs its lowest
  block. It is composed from CAPSULE-OPEN and CAPSULE-LINE, with no new
  C word.
- The mesh loads v4:init.4th after POST and COLD, its one fixed step
  there.

Test first in test_mesh_boot: the parity line, DOE without naming
STARSHIPOS, and ACL-BOOT pinned. The before-run failed.

After: 113 checks pass and POST is 990/990. All 52 tests, test-32 and
ASan/UBSan pass. The dictionary has 405 words. One amd64 session passes
18/18 with "ACL: active".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 11:57:42 +00:00
rajames fdf9c1946c Merge pull request 'v4 fabric to spec: the mesh boot, the one adaptive heartbeat, mechanism A (#189)' (#197) from StarForth-v4.0.0 into master
Runner image / Build and publish the runner image (push) Failing after 8m54s
Release / Release ${{ github.ref_name }} (push) Failing after 35m23s
Merge StarForth-v4.0.0: the fabric to spec (v4.0.0-alpha.5), PR #197
2026-11-19 11:19:48 +00:00
Claude b9b2bd81da logs: the protocol on 7975bab0 (the heartbeat's walk in slices): PASS
Acceptance / Acceptance (pull_request) Successful in 31m27s
Build / Image RASPI (push) Successful in 3m7s
Build / Image PC (push) Successful in 3m35s
Build / Image MILKV (push) Successful in 4m2s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 14m45s
Every stage passes. accept-aarch64 passes BIRTH and every later check,
in 459 s. POST is 990/990 on all four boots, with one dict_hash
(0x847bd8ef42f53e14). test-32, the proofs, the images and the docs pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 03:11:18 +00:00
Claude 7975bab049 heartbeat: the Stadium's resident heat, walked a slice each tick -- CI's aarch64 BIRTH stall
The heartbeat's one input walked all 335,544 Stadium cells every tick,
about 15 ms on aarch64 TCG, longer than a tick. At fast pacing it took
the CPU, and a birth missed the session's 300 s on CI. That was my
11-17 change.

Captain Bob ruled: sample less often, scaled by the cells, measured
first, as a slice each tick; the slope inference later.
- stadium_heat_walk_step() walks STADIUM_HEAT_SLICE_CELLS cells per
  tick (Kconfig, 5500, about 0.25 ms on aarch64 TCG).
- A completed walk is one sample.
- The heartbeat's load takes a sample only when a walk is done.

Test first: test_stadium_node (21 checks) and test_heartbeat (13). Both
failed to build before. All kernel host tests pass. Four aarch64 boots
in a row pass 18/18 each, BIRTH included.

The evidence is in logs/20261119-heat-slice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 02:32:38 +00:00
Claude 13fae6df30 qemu_session.py: the CPU snapshot also dumps the code at each PC
Eight words at the PC, by its address, name the function offline. The
image loads where the firmware puts it, and the boot does not print
that address. aarch64's monitor has no $pc, so the address is taken
from the register line; checked on a real, paused QEMU.

Test first: the snapshot test, 6 checks; the new one failed before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 02:32:21 +00:00
Claude b6c87b3045 logs: the protocol on 36b25805 -- FAIL: aarch64 BIRTH stalled here too; the repro boot that caught it
accept-aarch64 failed at BIRTH. The new CPU snapshot showed the kernel
looping, not hung. The other stages passed, including riscv64, the
stick, test-32, the proofs and the images. I ran them before reading
aarch64's result, which was the wrong order.

The repro boot (logs/20261119-012050) gave the code at each PC. Matched
in the loader EFI's map, they name bitmap_get inside
stadium_resident_heat_total, then background_decay and isqrt64. That is
the heartbeat's load, which walked all 335,544 Stadium cells every tick.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 02:32:21 +00:00
Claude 36b258054c qemu_session.py: a failed check prints where the CPUs are (cpu_snapshot)
CI's Acceptance fails on aarch64 at BIRTH on every head since 58d0e887.
The birth takes more than 300 s there and does not reproduce here: about
11 s, unsigned. The heartbeat spiral was ruled out by an instrumented
scratch kernel.

Captain Bob ruled "Diagnose on CI". On a failed check, the session script
asks QEMU's monitor for the registers three times, a second apart, and
prints the program counters, so CI's next failure shows where the kernel
is and whether it moves. A monitor that does not answer does not stop
the run.

Test first: scripts/test_qemu_session_snapshot.sh, 5 checks; 3 failed
before. The register text was checked on real, paused QEMU for aarch64,
riscv64 and x86.

The evidence and the measurements are in logs/20261119-ci-snapshot. The
local aarch64 timing run is in logs/20261118-235613.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 00:29:23 +00:00
Claude c2e42c3cba logs: the protocol on 0565a039 (release: v4.0.0-alpha.5): PASS
Build / Image RASPI (push) Successful in 4m54s
Build / Image PC (push) Successful in 3m52s
Build / Image MILKV (push) Successful in 4m41s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 14m54s
Acceptance / Acceptance (pull_request) Failing after 40m41s
Every stage passes. POST is 990/990 on all four boots, with one
dict_hash (0x847bd8ef42f53e14). test-32, the proofs, the images and the
docs pass. accept-aarch64 (411 s) and docs ran in the background, each
alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 23:39:23 +00:00
Claude 0565a03996 release: v4.0.0-alpha.5
Captain Bob ruled: the line for new work is drawn with a merge, then a
tag, v4.0.0-alpha.5. This sets LITHOS_VERSION in kernel/Makefile and
updates README, CHANGELOG and CLAUDE.md to match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 23:06:05 +00:00
Claude 7099f42a5a logs: the protocol on e29a00f7: PASS
Build / Image RASPI (push) Successful in 4m57s
Build / Image PC (push) Successful in 5m8s
Build / Image MILKV (push) Successful in 5m21s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 14m17s
Acceptance / Acceptance (pull_request) Failing after 43m4s
Every stage passes. POST is 990/990 on all four boots, with one
dict_hash (0x847bd8ef42f53e14). test-32, the proofs, the images and the
docs pass. accept-aarch64 (416 s) and docs ran in the background, each
alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 22:19:53 +00:00
Claude e29a00f717 docs: dict_hash 0x847bd8ef42f53e14 in README and CLAUDE.md; FABRIC-3 XLVIII.28 closes the capsule-blocks work
Captain Bob ruled: the line for new work is drawn with a merge, then a tag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 21:43:57 +00:00
Claude 49c6ec82ee logs: the protocol on 53b1e98e: PASS
Build / Image PC (push) Successful in 5m36s
Build / Image MILKV (push) Successful in 5m22s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 14m25s
Build / Image RASPI (push) Successful in 6m41s
Acceptance / Acceptance (pull_request) Failing after 46m7s
This covers capsule blocks steps 1-4 for v4. Every stage passes.
- POST is 990/990 on all four boots.
- One dict_hash on the three ISAs: 0x847bd8ef42f53e14 (new, from
  loading capsules through blocks).
- test-32, the proofs, the images and the docs pass.
- accept-aarch64 (435 s) and docs ran in the background, each alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 21:14:41 +00:00
Claude 53b1e98eb7 plan capsule blocks: v3's INIT is kept as it is (Captain Bob)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 20:40:12 +00:00
Claude 15a8ec8bcf rules: the hosted product is not a concern -- only the gates that run it are kept green (Captain Bob)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 20:34:38 +00:00
Claude 6dcfbe6740 Capsule blocks steps 3+4 for v4: capsules are placed in RAM and load their lowest block
Captain Bob ruled: Block n lands at n-R; the lowest block is
interpreted; chaining is the developer's; together, v4 first.
- v4_blocks_place_capsule copies each Block n into RAM block n - R as 16
  lines of 64, space-padded, in any file order. A later block of the
  same number overwrites. It refuses a block below R.
- The mesh's load(), its capsule reader (CAPSULE-OPEN/(LINES), so a
  child's forth79.4th via BIRTH too), boot.c and test_host_unit's model
  each place a capsule, then interpret "<lowest> LOAD".
- mkdictionary.py skips --> when it types capsules at the hosted prompt.
- The v4 capsules are renumbered into R..2R-1, landing at RAM 1900 and
  up, away from POST's blocks 0-5. Each is chained with -->, and
  centre.4th's gap at 8103 is closed.

Test first:
- test_host_blocks.c gained 6 placement checks; it failed to build
  before.
- test_mesh_boot.c checks forth79's lowest block in RAM block 1900; it
  failed before.

After: POST is 990/990; all 52 tests at 64 bits, test-32, hosted-check
and ASan/UBSan pass; the amd64 kernel builds; the dictionary has 404
words.

Logs are in logs/20261118-capsule-place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 20:33:21 +00:00
Claude bcfca9fa19 plan capsule blocks: (- is a build marker per block, loads verbatim; CI's hook an open stub for the SDK (Captain Bob)
Build / Image PC (push) Successful in 6m11s
Build / Image MILKV (push) Successful in 6m10s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 14m21s
Acceptance / Acceptance (pull_request) Failing after 8m10s
Build / Image RASPI (push) Successful in 6m1s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 19:57:49 +00:00
Claude dd3469f9a3 plan capsule blocks: (- marks a system blob -- the idea, its rulings so far, and what is open
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 19:51:40 +00:00
Claude f30005e1f6 Capsule blocks step 2: mkcapsule makes no claims -- a later write overwrites
Captain Bob ruled "Overwrite. That's it. Deterministic and final", within
a capsule and across capsules, "consistent with VOCABULARY FORGET & FENCE
philosophy, not implementation". Of what only prevented collisions:
"All of it goes".
- The cross-capsule collision gate is gone.
- tools/capsule-reserved.txt and its check are gone.
- The interactive resolver and its claim registry are gone.
- BLOCK_MAP.md says "Blocks used", and marks a shared number "the later
  write overwrites". It is a convenience, not a gate.
- An unknown option is refused with the usage. A removed mode was
  otherwise taken for the capsules directory, with its next argument as
  the output file.

Test first: scripts/test_mkcapsule_overwrite.sh, 9 checks.
- The before-run failed 7. A repeat within one capsule already built,
  since there was never a check for it.
- After: all 9 pass.

step 1's test still passes, the amd64 build is clean, all 40 capsules
lint, and the mesh boot passes 109 checks with POST 990/990.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 19:44:32 +00:00
Claude 6f9900f805 Capsule blocks step 1: the RAM block count is a build knob, BLK_RAM_USER_BLOCKS
Captain Bob ruled that the offset is the RAM block count, not a literal
2048.
- v3/include/blk_layout.h defines it, 2048 by default. block_subsystem.h
  derives BLK_RAM_BLOCKS (2080) and BLK_DISK_START from it.
- Kconfig.kernel has the symbol. kernel/Makefile passes it to the
  kernel's C code and builds mkcapsule and mkartemis with it.
- mkcapsule's two literal 2048s are now the knob.

The default value is unchanged, so the layout and the media are as before.

Test first: scripts/test_capsule_ram_blocks.sh, 8 checks.
- The before-run failed 4: the knob did not exist and mkcapsule ignored
  it. Its three Makefile checks also hit a SIGPIPE flaw in the test,
  fixed before the after-run.
- After: all 8 pass.

The amd64 build and mkartemis build clean. All 40 capsules lint. The
mesh boot passes 109 checks with POST 990/990. test_host_blocks,
test_host_quit, test_host_unit and test-32 pass.

Logs are in logs/20261118-ram-blocks-knob.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 17:35:15 +00:00
Claude cda8aad8b2 plan capsule blocks: no chaining, developer responsible; the work, for ruling
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 17:26:22 +00:00
Claude d36b78cc73 plan capsule blocks: "Block map is a convenience"; chaining open
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 17:25:41 +00:00
Claude ea0fd7c38e plan capsule blocks: the map stays (blocks used), the range tables go (Captain Bob)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 17:24:55 +00:00
Claude 47712e0cd1 plan capsule blocks: land at n, copy down to n-R; where it lands is the developer's responsibility
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 17:24:16 +00:00
Claude 5210abaa4e plan capsule blocks: the offset is the RAM block count, a Kconfig symbol (Captain Bob)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 17:21:39 +00:00
Claude 1061433791 plan capsule blocks: collisions overwrite -- "Deterministic and final" (Captain Bob)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 17:21:15 +00:00
Claude 38c4d5ac69 plan: capsules and their blocks -- the talk so far (rulings 1, 1b, 1c; the fixed 2048 is the bug)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 17:20:37 +00:00
Claude 52e184ef03 logs: the protocol on 913a896e: PASS
Build / Image RASPI (push) Successful in 6m14s
Build / Image PC (push) Successful in 5m28s
Build / Image MILKV (push) Successful in 5m28s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 14m45s
Acceptance / Acceptance (pull_request) Failing after 42m12s
Every stage passes. On all four boots POST is 990/990, with one
dict_hash (0xf4e9fdc94f6bfc77). test-32, the proofs, the images and
the docs pass. accept-aarch64 (397 s) and docs ran in the background,
each alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 16:57:34 +00:00
Claude 913a896e1b docs: dict_hash 0xf4e9fdc94f6bfc77 (404 words) in README and CLAUDE.md; FABRIC-3 XLVIII.27
Ruled by Captain Bob: batch the docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 16:24:03 +00:00
Claude 9bf30f7a21 rules: a long protocol stage may run in the background, but only alone (Captain Bob)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 16:23:01 +00:00
Claude 4ed2df4b56 logs: the protocol on 573d386b: PASS
Build / Image RASPI (push) Successful in 7m25s
Build / Image PC (push) Successful in 6m29s
Build / Image MILKV (push) Successful in 6m52s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 15m13s
Acceptance / Acceptance (pull_request) Failing after 45m42s
Every stage passes. On all four boots POST is 990/990, with one
dict_hash (0xf4e9fdc94f6bfc77, word_count=404). test-32, the proofs,
the images and the docs pass. accept-aarch64 (401 s) and docs ran in
the background, alone, at Captain Bob's rulings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 16:10:38 +00:00
Claude 573d386b51 v4 dictionary: STARSHIPOS's entry (the docs gate refused the build without one)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 15:19:14 +00:00
Claude 66d0af55d0 logs: the protocol on 295cd518 -- FAIL at docs only (STARSHIPOS had no dictionary entry); superseded
All seven other stages passed: POST 990/990 on all four boots, one
dict_hash (0xf4e9fdc94f6bfc77, word_count=404), test-32, the proofs and
the images.

aarch64 went past 590 s twice in the foreground, killed at the BIRTH
step. One background run, at Captain Bob's ruling, passed in 429 s with
the birth's parity recorded.

The docs stage failed because the dictionary gate found no entry for
STARSHIPOS. The entry comes next, then the protocol again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 15:19:14 +00:00
Claude 295cd5185c v4: COLD keeps the vocabularies as sealed -- FORGET's prune, shared
COLD set VOC-LINK to 0, assuming the sealed system has one vocabulary.
With starshipos.4th sealed in, STARSHIPOS fell out of the chain after
COLD. A word defined in it then forgotten, or COLDed away, hung the
node. ACL-INIT-PRIMITIVES would also have skipped its words.

FORGET's loop is now (PRUNE-ALL). It drops the vocabularies above (Q)
and prunes the lists of those that stay. FORGET calls it as before, and
COLD calls it with the sealed DP. No new cell and no new word.

Test first in test_mesh_boot.c: FORGET and COLD of a word in
STARSHIPOS, and STARSHIPOS's own words staying. The before-run hung and
was stopped at 500 s. After: 109 checks pass, POST is 990/990, all 52
64-bit tests and test-32 pass, ASan/UBSan are clean, and the amd64
build is clean.

Found by Captain Bob's "make sure we're not applying incorrect logic".
Ruled: fix first, then the protocol. Logs are in
logs/20261118-cold-vocabularies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 13:35:22 +00:00
Claude 8301d09db0 logs: the protocol on b80bd5cd, superseded before its docs stage
Every boot passed: POST 990/990 on all four, dict_hash
0x3172c04e863199f4 on the three ISAs. test-32, the proofs and the
images passed.

The docs stage was stopped. The protocol is superseded because a latent
fault was found: COLD drops STARSHIPOS from the vocabulary chain
(VOC-LINK 0). Captain Bob ruled: fix first, then the protocol.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 13:14:11 +00:00
Claude b80bd5cd27 plan v4 init.4th: step 1 first; held -- "Capsules are ephemeral. We need to talk later" (Captain Bob)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 09:42:04 +00:00
Claude a98baaacdd plan: v4's init.4th -- design, for ruling
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 00:59:34 +00:00
Claude 4137f1b70d v4: starshipos.4th loaded before POST, as MACHINE.md 3 step 3 says
Captain Bob ruled that MACHINE.md stands. The kernel's system capsules
are now starshipos.4th, centre.4th, hera.4th and physics.4th, after
forth79.4th.

COLD, after POST, leaves FORTH alone in the search order, so the
prompt reaches STARSHIPOS's words by naming the vocabulary. The ruling
is that init.4th will set the search order; the capsule's header now
says so.

Test first in test_mesh_boot.c: its parity line, and `STARSHIPOS S" ok"
DOE`. It failed before the change. 105 checks now pass, POST is
990/990, and ASan/UBSan and the amd64 build are clean.

Logs are in logs/20261118-starshipos.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 00:59:04 +00:00
Claude 9ee797db7f Revert "starshipos.4th: its header says it is not loaded by the boot"
This reverts commit 9ae86b873e.
2026-11-18 00:56:00 +00:00
Claude 9ae86b873e starshipos.4th: its header says it is not loaded by the boot
Ruled by Captain Bob (2026-11-18): leave it unloaded. mkcapsule --lint
passes on all 40 capsules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 00:54:49 +00:00
Claude b789d18ac0 Phase 7 plan, Task 8: the 171 ticked -- done 2026-11-14 (POST-PARITY.md section 6, 990/990, floor 990)
Ruled by Captain Bob.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 00:51:48 +00:00
Claude 58d0e887ff logs: the protocol on c30e4a0a: PASS
Build / Image RASPI (push) Successful in 4m42s
Build / Image PC (push) Successful in 5m57s
Build / Image MILKV (push) Successful in 5m56s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 14m17s
Acceptance / Acceptance (pull_request) Failing after 42m19s
Every stage passes. On all four boots POST is 990/990, with one
dict_hash (0x627f392ccbaa96f1). test-32, the proofs, the images and the
docs pass. The docs stage ran in the background at Captain Bob's ruling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-18 00:22:20 +00:00
Claude c30e4a0afb CLAUDE.md: POST and parity as of 2026-11-17 (990 tests, 403 words, dict_hash 0x627f392ccbaa96f1)
Ruled by Captain Bob.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 23:49:58 +00:00
Claude 371ea698d4 capsules/README: Hermes's row gone (it moved into the kernel); Hestia and the v4 capsules listed
Build / Image RASPI (push) Successful in 3m53s
Build / Image PC (push) Successful in 4m28s
Build / Image MILKV (push) Successful in 4m33s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 14m8s
Ruled by Captain Bob. The empty capsules/hermes/ is left as it is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 23:45:06 +00:00
Claude 151b52f15a DATASHEET-F18 13.3: births resolved (046ce0be) -- the kernel's mesh fits each born node with the mesh ROM
Ruled by Captain Bob.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 23:39:03 +00:00
Claude b68da43c19 DATASHEET-F18 13.1: per-call-target heat resolved (#189) -- the table is gone, the kernel keeps the word's accounts
Ruled by Captain Bob.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 23:38:43 +00:00
Claude 1fe72399cf v4/README: POST runs at boot; still no K measurement (none found in v4's source)
Ruled by Captain Bob.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 23:38:16 +00:00
Claude 81890760e4 v4/README: the mesh, not the lone node
The kernel boots the fabric with Hera at place 0. Nodes are born and
killed through her. The fabric is lockstep. Each step walks only the
places that hold a node, and every node ticks on the one adaptive
heartbeat.

Ruled by Captain Bob.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 23:37:42 +00:00
Claude c2364b3646 README: v4's POST as of the protocol on edbb79e2 (990 tests, word_count=403, dict_hash 0x627f392ccbaa96f1)
Ruled by Captain Bob. The v3 line is left as it is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 23:36:48 +00:00
Claude f93cde222d docs: FABRIC-3 XLVIII.26 -- mechanism A, and the protocol passing on edbb79e2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-17 23:36:21 +00:00
406 changed files with 694163 additions and 899 deletions
+6 -4
View File
@@ -198,8 +198,10 @@ removed as an active target.)
**Current status: M7.1** — capsule birth protocol, Mama FORTH vocabulary, Tripod multi-VM
fleet (Hera/Artemis/Hestia — Hermes moved into the kernel as kernel-Hermes, FABRIC-3.6.md
Phase 4, 2026-09-22), and word-level ACL (Phases 1–7) are live; POST at boot verifies parity
hash across amd64/aarch64/riscv64 with a 318-word Mama capsule dictionary (word count as of
2026-11-10, hash `0x8c92508f748f99cf`; corrected 2026-11-10 — this file said 526 words,
hash across amd64/aarch64/riscv64 with a 404-word dictionary (word count as of 2026-11-18, hash
`0x847bd8ef42f53e14`, POST 990/990, `logs/20261118-204012/PROTOCOL.md`, capsules loaded through blocks; before that
`0xf4e9fdc94f6bfc77`, `logs/20261118-151921/PROTOCOL.md`; corrected 2026-11-18 — this file said
403 words, hash `0x627f392ccbaa96f1` (2026-11-17, before `starshipos.4th` loaded); it said 318 words, hash `0x8c92508f748f99cf` (2026-11-10); corrected 2026-11-10 — it said 526 words,
hash `0x82f4ae7cb2e2d424` (2026-10-14, `FABRIC-3.md` §XXXVIII); verify against a live
`PARITY:V4_SYSTEM word_count=` line before citing, it changes with any new C word registration).
@@ -229,7 +231,7 @@ Output: `build/<arch>/kernel/starkernel_loader.efi` + `build/<arch>/kernel/stark
Two independently tracked version strings flow into the generated `include/version.h`:
`VERSION` (`kernel/Makefile` — the embedded StarForth engine version, currently `3.2.0`;
note this does **not** auto-sync with the standalone StarForth repo's own version) and
`LITHOS_VERSION` (`kernel/Makefile` — the kernel version, currently **`4.0.0-alpha.4`**; corrected 2026-11-10 — this file said `2.1.0` (bumped at
`LITHOS_VERSION` (`kernel/Makefile` — the kernel version, currently **`4.0.0-alpha.5`**; corrected 2026-11-18 — this file said `4.0.0-alpha.4`; corrected 2026-11-10 — it said `2.1.0` (bumped at
the `v2.1.0` tag that closed FABRIC-3.6; corrected 2026-10-14 from `3.1.0` / `2.0.0`, which
replaced `2.0.1` on 2026-09-19 per `FABRIC-3.md` §I.2 — `2.0.1` named the SER5
hardware-track line and claimed unverified progress). The versioning policy is
@@ -358,7 +360,7 @@ before each architecture. The prompt is `[zuse@Hera] ok> `.
Do not claim a change is accepted until all three architectures have booted, and their logs are
present in `logs/`:
- **as built (v4)** to `[zuse@Hera] ok> `, with `PARITY:V4_POST tests=538 pass=538 fail=0` (the count
- **as built (v4)** to `[zuse@Hera] ok> `, with `PARITY:V4_POST tests=990 pass=990 fail=0` (2026-11-17; the count
grows with v4's POST) and `POST: PASSED`, and `PARITY:V4_SYSTEM ... dict_hash=` equal across
the three;
- **the PC stick loaded high** (Captain Bob, 2026-10-29, after the SER5 page-faulted in the
+22
View File
@@ -153,3 +153,25 @@ him -> the tag, on his word.
- **POST is as v3's works.** Not reproducing v3's tests AS WRITTEN, or a parity mismatch, is THE failure.
- Order given: inspect the debug (EMERGENCY) build first, then write the design for the failure-triggered
diagnostic build -- for his ruling, before building.
## A long stage may run in the background, but only alone (Captain Bob, 2026-11-18)
A protocol stage that takes longer than one foreground command (600 s at most) may run in the
background, on one condition: **nothing else runs at the same time**, no other background process
of any kind, the docs stage included. Captain Bob: "Aarch64 bg is fine as long as there is no other
background process running including docs. In fact that might generalize too."
So:
- **One stage at a time,** foreground or background. A background stage is waited for before the
next stage, or anything else, starts.
- **Still one QEMU at a time.**
- **Today this covers** `accept-aarch64` (401 to 429 s for the boot plus its session) and `docs`.
Any other long stage runs the same way.
## The hosted product is not a concern (Captain Bob, restated 2026-11-18)
"Nobody cares about hosted anymore. I told you that."
- No effort goes into the hosted v4 product (`v4/tools/hosted.c`, `boot.c`'s use by it) for its own
sake.
- It is touched only to keep the gates that still run it green: the docs stage's dictionary check
(`v4/tools/mkdictionary.py`) and `make -C v4 test`. Ruled "Keep the boot.c change", for that reason.
+14
View File
@@ -1,5 +1,19 @@
# Changelog
## 2026-11-18 — LithosAnanke v4.0.0-alpha.5: the fabric to spec
The kernel boots v4's fabric as designed (#189):
- Hera is born in the fabric and runs v3's whole POST, 990 cases, as written.
- Every node ticks on the one adaptive heartbeat, in lockstep.
- Each step walks only the places that hold a node (mechanism A, which brought aarch64 back inside
its 570 s).
- A fault dump prints when a node stops, and a diagnostic build follows any failed stage.
- Capsules are ephemeral: a block lands at its number less the RAM block count, a later write
overwrites, and the loader interprets the lowest block
(`docs/v4.0.0/plans/2026-11-18-capsule-blocks.md`).
`dict_hash` is `0x847bd8ef42f53e14`. `docs/fabric/FABRIC-3.md` XLVIII.25–28.
## 2026-11-10 — LithosAnanke v4.0.0-alpha.4: the plug-and-play stick
The plug-and-play stick (#92), the BAM flush (#155), the Book of Fabric (#138), the Dictionary of v4 (#157), and the .com’s Downloads and Documents pages (#126, #161).
+21
View File
@@ -28,6 +28,18 @@ config STARFORTH_V4
2026-10-14: v3 is being retired. Off builds v3 alone. See
docs/v4.0.0/DECOMPOSITION.md and boards/BRINGUP.md A6.
config BLK_RAM_USER_BLOCKS
int "The VM's user RAM block count (BLK_RAM_USER_BLOCKS)"
default 2048
help
How many blocks of fast RAM a VM sees: LBN 0 .. BLK_RAM_USER_BLOCKS - 1.
The block layout is derived from it (v3/include/blk_layout.h,
block_subsystem.h: BLK_RAM_BLOCKS, BLK_DISK_START). A capsule page
`Block n` must have n at least this, and is copied down by it to be
interpreted (docs/v4.0.0/plans/2026-11-18-capsule-blocks.md). mkcapsule
and mkartemis are built with the same value. Changing it moves where
disk blocks start, so media made with another value do not match.
config PARITY_MODE
bool "Deterministic parity harness mode (PARITY_MODE)"
default n
@@ -99,6 +111,15 @@ config STADIUM_CAPACITY_TICK
tuning is DoE work (item 5.1), same treatment as the other
placeholder constants in this file.
config STADIUM_HEAT_SLICE_CELLS
int "Stadium cells walked per heartbeat tick for the heartbeat's load (STADIUM_HEAT_SLICE_CELLS)"
default 5500
help
The adaptive heartbeat paces by the Stadium's resident heat, walked a
slice each tick: a whole walk is cells / this many ticks. 5500 is about
0.25 ms on aarch64 under TCG (measured 2026-11-19), a tenth of the
fastest tick.
config STADIUM_MEMORY_PERCENT
int "Percent of free physical memory the Stadium claims at boot (STADIUM_MEMORY_PERCENT)"
default 1
+6 -6
View File
@@ -1,4 +1,4 @@
# LithosAnanke v4.0.0-alpha.4
# LithosAnanke v4.0.0-alpha.5
**UEFI-bootable FORTH microkernel.** Boots from firmware, initialises memory and interrupts, then
runs StarForth as its sole userspace runtime. No libc. No OS. Just stone and necessity.
@@ -7,8 +7,8 @@ runs StarForth as its sole userspace runtime. No libc. No OS. Just stone and nec
**Try it in your browser:** [starshipos-f18.com](https://starshipos-f18.com/) — a StarshipOS
machine of your own, booted to `[zuse@Hera] ok>`, thrown away when you leave. **Releases:**
[v4.0.0-alpha.4](https://gitea.starshipos-f18.org/rajames/LithosAnanke/releases),
the kernel `4.0.0-alpha.4` with the StarForth engine `3.2.0`.
[v4.0.0-alpha.5](https://gitea.starshipos-f18.org/rajames/LithosAnanke/releases),
the kernel `4.0.0-alpha.5` with the StarForth engine `3.2.0`.
---
@@ -45,13 +45,13 @@ milestone, #156): what v4 needs of it, the block layer, moves into v4 and the re
| Bare metal | a generic PC (amd64; first on the bench: a Beelink SER5), Raspberry Pi 5 (aarch64), Milk-V Mars (riscv64); Zynq-7020 (ARMv7) not yet ported | Images build; first boots on the bench — `boards/BRINGUP.md` |
**v4 is the default build, and v3 is being retired**: every kernel boots v4 unless its boot
arguments say `system=v3`. POST at boot, on all three ISAs: v4 — **538 tests**,
`PARITY:V4_SYSTEM word_count=317 dict_hash=0xfec8c47cfc6f437f`; v3 — **1052 tests**,
arguments say `system=v3`. POST at boot, on all three ISAs: v4 — **990 tests**,
`PARITY:V4_SYSTEM word_count=404 dict_hash=0x847bd8ef42f53e14` (`logs/20261118-204012/PROTOCOL.md`); v3 — **1052 tests**,
`PARITY:M7.1a word_count=526 hash=0x82f4ae7cb2e2d424`.
**How a change gets in** (the Captain Bob method): `master` is reached only through a pull request
that passed **acceptance** — amd64, aarch64 and riscv64 booted in QEMU to `[zuse@Hera] ok>`, POST
538/538 and one `dict_hash` on all three; the PC stick booted loaded above 2 GiB, as a PC's firmware
990/990 and one `dict_hash` on all three; the PC stick booted loaded above 2 GiB, as a PC's firmware
loads it; and the 32-bit build's tests. Every acceptance boot starts from a fresh stick, so every
run is a first boot. The same stages run nightly and for every release (`scripts/nightly.sh`); the
serial logs are committed.
+25 -29
View File
@@ -6,7 +6,7 @@
## Capsule Summary
| Capsule | Blocks claimed | xxHash64 | Signed |
| Capsule | Blocks used | xxHash64 | Signed |
|---------|----------------|----------|--------|
| `ACL.4th` | 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4015 | `0xf8890c05c0d8f921` | n/a |
| `acl-std79.4th` | 4023, 4024, 4025, 4026, 4027, 4028, 4029, 4030, 4031, 4032, 4033, 4034, 4035, 4036, 4037, 4038, 4039, 4040, 4041, 4042, 4043, 4044, 4045, 4046, 4047, 4048 | `0x773bf9209df191d1` | n/a |
@@ -29,11 +29,11 @@
| `sdk.4th` | 5109, 5110, 5111, 5112, 5113, 5114, 5115 | `0x008fdbbb62c94a3a` | n/a |
| `turtle.4th` | 5100, 5101, 5102, 5103, 5104, 5105, 5106, 5107, 5108 | `0x4d470418ca543365` | n/a |
| `user-font-demo.4th` | 4200, 4201, 4202 | `0xce1fd7d1b581a56d` | n/a |
| `v4:centre.4th` | 8100, 8101, 8102, 8104, 8105, 8106, 8107 | `0xccd1b28a101c78b2` | n/a |
| `v4:forth79.4th` | 6000, 6001, 6002 | `0x4055641ee17d176b` | n/a |
| `v4:hera.4th` | 8000, 8001 | `0x85300ad4e6e8b86b` | n/a |
| `v4:physics.4th` | 8200, 8201, 8202, 8203, 8204 | `0x747d89ca8d57e29c` | n/a |
| `v4:starshipos.4th` | 7000, 7001 | `0xb74bfa51f8d4719a` | n/a |
| `v4:centre.4th` | 3964, 3965, 3966, 3967, 3968, 3969, 3970 | `0xea5815290d56dff3` | n/a |
| `v4:forth79.4th` | 3948, 3949, 3950 | `0x4609d6ef54166ef8` | n/a |
| `v4:hera.4th` | 3960, 3961 | `0x78730b1d6effe892` | n/a |
| `v4:physics.4th` | 3972, 3973, 3974, 3975, 3976 | `0x5b0195fc30828bde` | n/a |
| `v4:starshipos.4th` | 3956, 3957 | `0x1734a8f4fe7483a5` | n/a |
| `workload-0.4th` | 2200, 2201 | `0x93f86f60aeba8feb` | n/a |
| `workload-1-lite.4th` | 5058, 5059 | `0x44a7a7e3176dcc8d` | n/a |
| `workload-1.4th` | 4406, 4415, 4425, 4435 | `0x63e251adb0a03613` | n/a |
@@ -105,6 +105,25 @@
| 2160 | `workload-8.4th` | `0x56b7f2f0efa000df` | ok |
| 2200 | `workload-0.4th` | `0x93f86f60aeba8feb` | ok |
| 2201 | `workload-0.4th` | `0x93f86f60aeba8feb` | ok |
| 3948 | `v4:forth79.4th` | `0x4609d6ef54166ef8` | ok |
| 3949 | `v4:forth79.4th` | `0x4609d6ef54166ef8` | ok |
| 3950 | `v4:forth79.4th` | `0x4609d6ef54166ef8` | ok |
| 3956 | `v4:starshipos.4th` | `0x1734a8f4fe7483a5` | ok |
| 3957 | `v4:starshipos.4th` | `0x1734a8f4fe7483a5` | ok |
| 3960 | `v4:hera.4th` | `0x78730b1d6effe892` | ok |
| 3961 | `v4:hera.4th` | `0x78730b1d6effe892` | ok |
| 3964 | `v4:centre.4th` | `0xea5815290d56dff3` | ok |
| 3965 | `v4:centre.4th` | `0xea5815290d56dff3` | ok |
| 3966 | `v4:centre.4th` | `0xea5815290d56dff3` | ok |
| 3967 | `v4:centre.4th` | `0xea5815290d56dff3` | ok |
| 3968 | `v4:centre.4th` | `0xea5815290d56dff3` | ok |
| 3969 | `v4:centre.4th` | `0xea5815290d56dff3` | ok |
| 3970 | `v4:centre.4th` | `0xea5815290d56dff3` | ok |
| 3972 | `v4:physics.4th` | `0x5b0195fc30828bde` | ok |
| 3973 | `v4:physics.4th` | `0x5b0195fc30828bde` | ok |
| 3974 | `v4:physics.4th` | `0x5b0195fc30828bde` | ok |
| 3975 | `v4:physics.4th` | `0x5b0195fc30828bde` | ok |
| 3976 | `v4:physics.4th` | `0x5b0195fc30828bde` | ok |
| 4000 | `ACL.4th` | `0xf8890c05c0d8f921` | ok |
| 4001 | `ACL.4th` | `0xf8890c05c0d8f921` | ok |
| 4002 | `ACL.4th` | `0xf8890c05c0d8f921` | ok |
@@ -366,29 +385,6 @@
| 5113 | `sdk.4th` | `0x008fdbbb62c94a3a` | ok |
| 5114 | `sdk.4th` | `0x008fdbbb62c94a3a` | ok |
| 5115 | `sdk.4th` | `0x008fdbbb62c94a3a` | ok |
| 6000 | `v4:forth79.4th` | `0x4055641ee17d176b` | ok |
| 6001 | `v4:forth79.4th` | `0x4055641ee17d176b` | ok |
| 6002 | `v4:forth79.4th` | `0x4055641ee17d176b` | ok |
| 7000 | `v4:starshipos.4th` | `0xb74bfa51f8d4719a` | ok |
| 7001 | `v4:starshipos.4th` | `0xb74bfa51f8d4719a` | ok |
| 8000 | `v4:hera.4th` | `0x85300ad4e6e8b86b` | ok |
| 8001 | `v4:hera.4th` | `0x85300ad4e6e8b86b` | ok |
| 8100 | `v4:centre.4th` | `0xccd1b28a101c78b2` | ok |
| 8101 | `v4:centre.4th` | `0xccd1b28a101c78b2` | ok |
| 8102 | `v4:centre.4th` | `0xccd1b28a101c78b2` | ok |
| 8104 | `v4:centre.4th` | `0xccd1b28a101c78b2` | ok |
| 8105 | `v4:centre.4th` | `0xccd1b28a101c78b2` | ok |
| 8106 | `v4:centre.4th` | `0xccd1b28a101c78b2` | ok |
| 8107 | `v4:centre.4th` | `0xccd1b28a101c78b2` | ok |
| 8200 | `v4:physics.4th` | `0x747d89ca8d57e29c` | ok |
| 8201 | `v4:physics.4th` | `0x747d89ca8d57e29c` | ok |
| 8202 | `v4:physics.4th` | `0x747d89ca8d57e29c` | ok |
| 8203 | `v4:physics.4th` | `0x747d89ca8d57e29c` | ok |
| 8204 | `v4:physics.4th` | `0x747d89ca8d57e29c` | ok |
## Conflicts
None.
---
*40 capsule(s) scanned. Re-run `mkcapsule --manifest <dir>` to refresh.*
+6 -1
View File
@@ -14,8 +14,13 @@ changes the hash and the birth protocol rejects the image.
| `doe.4th` | user | DoE workload words (`EXEC-DOE`) — opt-in |
| `workload-0.4th` … `workload-9.4th` | `(p)` | Numbered personality variants |
| `init-l8-*.4th` | `(p)` | L8 Jacquard mode variants (stable/volatile/diverse/temporal/transition/omni) |
| `hermes/init.4th` | `(p)` | Hermes baby VM personality |
| `artemis/init.4th` | `(p)` | Artemis baby VM personality |
| `hestia/init.4th` | `(p)` | Hestia, the third Tripod leg (Hera/Artemis/Hestia): bind point and drawing-fabric owner |
| `v4/forth79.4th` | v4 | The FORTH-79 Required Word Set as colon definitions, loaded at boot (blocks 6000 up) |
| `v4/starshipos.4th` | v4 | The StarshipOS words in their own vocabulary, `STARSHIPOS`, loaded after `forth79.4th` (blocks 7000 up) |
| `v4/hera.4th` | v4 | What is Hera's alone: `KILL`, `PAUSE`, `RESUME` by number, through the kernel's registry (block 8000) |
| `v4/centre.4th` | v4 | What a node that births others needs: the kernel's requests by number (block 8100) |
| `v4/physics.4th` | v4 | The words of the loops: v3's physics-freeze and inference words, asked of the kernel (block 8200) |
## Block namespace
+60
View File
@@ -0,0 +1,60 @@
Block 3984
\ ACL.4th -- word-level access control: the policy.
\ v3's capsules/ACL.4th, as FORTH source the node compiles.
\ The capsule supplies an entry's fields and the check
\ (acl.f18, compile.f18); what is strict, how long a TTL
\ lasts and what is pinned is decided here. Loading it
\ switches access control on: its last line runs ACL-BOOT.
\ A system that does not load it has none. init.4th loads
\ it after POST (MACHINE.md 1.1: the init turns on security).
\ The xt these words take is what FIND and ['] give.
FORTH DEFINITIONS
1 CONSTANT ACL-STRICT-MODE
0 CONSTANT ACL-TTL-MODE-VAL
\ the TTL of a cold word, tuned 2026-06-15 on v3
256 CONSTANT ACL-BASE-TTL
65535 CONSTANT ACL-MAX-TTL
-->
Block 3985
\ ( xt -- xt ) for symmetry: the xt is the entry
: ACL-ENTRY ;
: ACL-STRICT ( xt -- )
DUP ACL-PINNED? IF DROP EXIT THEN
ACL-STRICT-MODE SWAP ACL-MODE! ;
: ACL-TTL-MODE ( xt -- )
DUP ACL-PINNED? IF DROP EXIT THEN
ACL-TTL-MODE-VAL SWAP ACL-MODE! ;
\ ( xt -- ttl ) a hotter word earns a longer TTL:
\ heat/4 + 256, at most 65535
: ACL-TTL-COMPUTE
ACL-HEAT@ 4 / ACL-BASE-TTL + ACL-MAX-TTL MIN ;
-->
Block 3986
\ ( xt -- ) what the check runs when a word's TTL is 0.
\ STRICT: allow, and leave the TTL 0 so that every use
\ comes back here. TTL: compute a TTL from the word's
\ heat; allow.
: ACL-RECHECK
DUP ACL-PINNED? IF DROP EXIT THEN
DUP ACL-MODE@ ACL-STRICT-MODE = IF
1 OVER ACL-ALLOW! 0 OVER ACL-TTL! DROP EXIT
THEN
DUP ACL-TTL-COMPUTE OVER ACL-TTL! 1 SWAP ACL-ALLOW! ;
\ the system CA's public key; placeholders, as in v3
0 CONSTANT ACL-CA-KEY-LO
0 CONSTANT ACL-CA-KEY-HI
-->
Block 3987
\ ( req-hi req-lo -- allow? ) the fabric asks this word
\ whether a channel may be opened. The default approves
\ every request; a policy edits this.
: HERMES-CHANNEL-OPEN? 2DROP 1 ;
\ ( -- ) default fields on every word; the words that
\ enforce the policy pinned; the recheck switched on
: ACL-BOOT
ACL-INIT-PRIMITIVES
['] ACL-RECHECK ACL-PIN ['] ACL-INIT-PRIMITIVES ACL-PIN
['] ACL-RECHECK ACL-HOOK !
LOG-INFO" ACL: active" ;
' ACL-BOOT ACL-PIN
ACL-BOOT
+18 -7
View File
@@ -1,4 +1,4 @@
Block 8100
Block 3964
( centre.4th -- what a node that births others needs. )
( docs/v4.0.0/MESH.md 9a. Births follow v3: any node may )
( birth on its own ports, and is its children's parent. )
@@ -14,7 +14,8 @@ VARIABLE (T#)
: (TC) ( c -- ) PAD (T#) @ + C! 1 (T#) +! ;
: (TS) ( baddr u -- )
DUP IF 0 DO DUP I + C@ (TC) LOOP DROP ELSE DROP DROP THEN ;
Block 8101
-->
Block 3965
: (TN) ( n -- ) 0 <# #S #> (TS) 32 (TC) ;
: (T) ( -- baddr u ) PAD (T#) @ ;
( The node being born: its number, its place, the port of )
@@ -27,7 +28,8 @@ VARIABLE (KIDC) VARIABLE (PERS) VARIABLE (PERS#)
-1 NODE-ERROR ! ;
: (TOLD) ( how -- ) 1 - IF (FAIL) THEN ;
: (TELL) ( baddr u -- ) (KID#) @ SEND (KID#) @ AWAIT (TOLD) ;
Block 8102
-->
Block 3966
( the system, a capsule of F18 code, cell by cell to its port )
: (NUCLEUS) ( -- )
S" v4:nucleus-64.f18" CAPSULE-OPEN 0= IF (FAIL) THEN
@@ -36,7 +38,13 @@ Block 8102
: (LINES) ( baddr u -- ) CAPSULE-OPEN 0= IF (FAIL) THEN
BEGIN PAD CAPSULE-LINE DUP 0< 0= WHILE PAD SWAP (TELL) REPEAT
DROP ;
Block 8104
( a capsule of FORTH blocks into this node: its lowest LOADed )
: CAPSULE-INCLUDE ( baddr u -- )
CAPSULE-OPEN 0= IF -1 NODE-ERROR ! EXIT THEN
PAD CAPSULE-LINE 0< IF EXIT THEN
0 0 PAD 1- CONVERT DROP DROP LOAD ;
-->
Block 3967
( Who it is, where its printing goes, which of its ports )
( leads to everything it is not told of, and who is there. )
: (WHO) ( -- )
@@ -45,7 +53,8 @@ Block 8104
(KIDC) @ (TN) S" DEFAULT-ROUTE " (TS)
(ME) @ (TN) (KIDC) @ (TN) S" NEIGHBOUR" (TS)
(T) 0 (KIDP) @ SEND-ON (KID#) @ AWAIT (TOLD) ;
Block 8105
-->
Block 3968
( number port childport baddr u -- place A NODE IS BORN, )
( its port childport joined to this one's port: empty, then )
( the system, FORTH-79, and its personality if u is not 0. )
@@ -60,7 +69,8 @@ Block 8105
S" (SEAL)" (TELL)
(KID) @ (KID#) @ NODE-PARITY
(KID) @ ;
Block 8106
-->
Block 3969
( number port childport -- place a node with no capsule )
: BIRTH 0 0 BIRTH-AS ;
( Two outer nodes are joined: port 3 of X to port 4 of Y, )
@@ -74,7 +84,8 @@ VARIABLE (XP) VARIABLE (XN) VARIABLE (YP) VARIABLE (YN)
: (JOIN) ( -- )
(XP) @ 3 (YP) @ 4 NODE-WIRE 0= IF (FAIL) THEN
(YN) @ 3 (XN) @ (SAY) (XN) @ 4 (YN) @ (SAY) ;
Block 8107
-->
Block 3970
( n -- A UNIT: four outer nodes, n+1 to n+4, on ports 2 )
( to 5 of this one, each by its own port 2, and joined in a )
( square: 1-2, 2-4, 4-3, 3-1. )
+6 -4
View File
@@ -1,10 +1,11 @@
Block 6000
Block 3948
( forth79.4th -- the FORTH-79 Required Word Set for v4, )
( as colon definitions, loaded when the system boots. )
( docs/v4.0.0/NUCLEUS.md. Blocks 6000 up. )
( docs/v4.0.0/NUCLEUS.md. Blocks 3948 up. )
( A word moves here from the assembled nucleus, v4/capsule, )
( once its colon definition passes POST. )
Block 6001
-->
Block 3949
( U* U/MOD -- FORTH-79 unsigned multiply and divide. )
( Neither v3 nor the v4 nucleus had them. )
( The first two words count the bits in a cell. )
@@ -14,7 +15,8 @@ Block 6001
VARIABLE (UD)
( u1 u2 -- ud the unsigned double product )
: U* UM* ;
Block 6002
-->
Block 3950
( ud u1 -- u2 u3 unsigned: u2 the remainder, u3 the quotient )
( One bit a step: shift ud left, and take u1 from its high )
( cell whenever it goes, counting that in the low cell. )
+3 -2
View File
@@ -1,4 +1,4 @@
Block 8000
Block 3960
( hera.4th -- what is Hera's alone, beside centre.4th, which )
( she loads first. docs/v4.0.0/MESH.md 9a. She decides )
( which nodes there are and which are awake: KILL, PAUSE and )
@@ -14,7 +14,8 @@ Block 8000
: KILL ( n -- )
(THERE?) 0= IF ." KILL: " (NO-NODE) THEN
DUP NODE-KILL NO-ROUTE ;
Block 8001
-->
Block 3961
: PAUSE ( n -- )
(THERE?) 0= IF ." PAUSE: " (NO-NODE) THEN NODE-SLEEP ;
: RESUME ( n -- )
+16
View File
@@ -0,0 +1,16 @@
Block 3980
( init.4th -- the system's init, run after POST and COLD. )
( MACHINE.md 1.1 and 3, step 5: everything after POST is )
( init.4th's. docs/v4.0.0/plans/2026-11-18-v4-init.md. )
( Step 2, security on: the ACL policy, ACL.4th. )
S" v4:ACL.4th" CAPSULE-INCLUDE
( The words that create or end nodes, pinned: their fields )
( cannot be changed, so no policy can deny them. )
' BIRTH ACL-PIN ' BIRTH-AS ACL-PIN ' UNIT ACL-PIN
' KILL ACL-PIN ' UNIT-KILL ACL-PIN
' PAUSE ACL-PIN ' RESUME ACL-PIN
' NODE-BORN ACL-PIN ' NODE-KILL ACL-PIN
' NODE-SLEEP ACL-PIN ' NODE-WAKE ACL-PIN
( Step 1, the search order: STARSHIPOS, then FORTH. Last, )
( since ACL.4th ends in FORTH DEFINITIONS. )
STARSHIPOS
+9 -5
View File
@@ -1,4 +1,4 @@
Block 8200
Block 3972
( physics.4th -- the words of the loops, v3's physics-freeze )
( and inference words, on a node the kernel keeps records )
( for: each asks its kernel, which keeps every word's and )
@@ -14,7 +14,8 @@ Block 8200
-27 KERNEL-WORD INFER-DECAY-SLOPE ( addr u -- d )
-28 KERNEL-WORD INFER-WINDOW-WIDTH ( addr u -- n )
-29 KERNEL-WORD INFER-RUN ( -- )
Block 8201
-->
Block 3973
( and what the last INFER-RUN, or the heartbeat's, found; )
( a q is a Q48.16 double, as qmath.f18's )
-30 KERNEL-WORD INFER-WINDOW@ ( -- u )
@@ -24,7 +25,8 @@ Block 8201
-34 KERNEL-WORD INFER-EARLY-EXIT@ ( -- flag )
( v3's DECAY_RATE_PER_US_Q16, its compile-time constant )
1 CONSTANT DECAY-RATE@
Block 8202
-->
Block 3974
( v3's StarForth module: a word's execution heat, by the )
( address ' leaves; and the hottest -- the kernel's records )
-35 KERNEL-WORD ENTROPY@ ( addr -- n )
@@ -40,7 +42,8 @@ Block 8202
." ==================================" CR
(HOT#) MIN 0 ?DO I (HOT) SWAP I 1+ 0 .R ." . "
>NAME COUNT TYPE ." : " 0 .R CR LOOP ;
Block 8203
-->
Block 3975
( WORD-ENTROPY: every word with heat, then the totals, as v3 )
VARIABLE (WE-T) VARIABLE (WE-N)
: WORD-ENTROPY ( -- )
@@ -56,7 +59,8 @@ VARIABLE (WE-T) VARIABLE (WE-N)
." Total words: " (WE-N) @ 0 .R CR
(WE-T) @ IF ." Average executions per word: "
(WE-T) @ (WE-N) @ / 0 .R CR THEN ;
Block 8204
-->
Block 3976
( (- skips its input to the matching close paren, nesting, )
( as v3's code does -- its documentation says to the line end )
: (- ( -- ) 1
+5 -4
View File
@@ -1,11 +1,12 @@
Block 7000
Block 3956
( starshipos.4th -- the StarshipOS words, in their own )
( vocabulary, STARSHIPOS: not FORTH-79, so not in FORTH. )
( Loaded when the system boots, after forth79.4th. )
( Blocks 7000 up. New definitions still go into FORTH; the )
( search starts in STARSHIPOS, then FORTH. )
( Blocks 3956 up. New definitions still go into FORTH; the )
( search starts in STARSHIPOS once init.4th sets it. )
VOCABULARY STARSHIPOS STARSHIPOS DEFINITIONS
Block 7001
-->
Block 3957
( DOE baddr u -- as S" name" DOE )
( Intended: run the DoE of that name, from the capsule of )
( that name. As yet it only types the name back -- asked for )
+22
View File
@@ -81,3 +81,25 @@ set HDR-NFA here ", ACL-HEAT@ #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LIN
\ ( xt -- n ) a number for the word that never changes: its address
set HDR-NFA here ", ACL-WORD-ID #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK here
: ACL-WORD-ID (ACL-XT) ;
\ ( xt -- ) a call from code defined at run time that the kernel sent here
\ (v4/system/mesh.c, on_call) because the word's TTL is 0 or it is denied.
\ As v3's inner interpreter, and as (ACL?): the recheck, or the TTL counted
\ down; then a denied word refused with v3's line -- by its own name, from
\ its entry (WORD's buffer is the running code's, not this) -- the stack
\ emptied and the line ended; an allowed word is jumped to, so it returns to
\ the caller as the call would have (docs/v4.0.0/plans/2026-11-19-acl-at-call.md).
: (ACL-CALL)
dup -3 + a! @ \ xt flags
dup $FFFF0000 and if ZERO
drop -65536 + ! jump TEST \ one use fewer
ZERO: drop drop dup (ACL-RECHECK)
TEST: dup -3 + a! @ 32 and if OK
drop
$33335B1B (EMIT4) $6D (EMIT4) $4E524157 (EMIT4) $203A (EMIT4) $6D305B1B (EMIT4) \ v3's line: WARN: in yellow
$3A4C4341 (EMIT4) $6E656420 (EMIT4) $20646569 (EMIT4) $27 (EMIT4)
-2 + a! @ 4* COUNT TYPE 39 EMIT CR \ the word's own name
DSTACK-DEPTH b! a !b \ as v3, the stack is emptied
pop drop jump (ABANDON)
OK: drop push ; \ on to the word
+16 -13
View File
@@ -113,22 +113,25 @@ macro ROT push SWAP pop SWAP endmacro
\ bits 16 .. 31 the TTL, a count of uses left before the next recheck
\ A new entry has all of them zero: allowed, not pinned, TTL mode, TTL 0.
\
\ (ACL?) is run by INTERPRET for every word it is about to execute or
\ compile. As v3: if the TTL is 0 the word is rechecked, otherwise the TTL
\ is counted down; then a denied word is refused. The recheck is the word
\ whose address is in (ACL-HOOK) -- ACL-RECHECK, once ACL.fth has loaded --
\ and with none there the word is allowed and given the longest TTL.
\ (ACL?) is run by INTERPRET for every word it is about to execute. As v3:
\ if the TTL is 0 the word is rechecked, otherwise the TTL is counted down;
\ then a denied word is refused. The recheck is the word whose address is in
\ (ACL-HOOK) -- ACL-RECHECK, once ACL.4th has loaded -- and with none there the
\ word is allowed and given the longest TTL.
\
\ v3 checks every execution, inside definitions too. v4 code is native: a
\ compiled call goes straight to its word. So v4 checks a word when it is
\ compiled as well as when it is interpreted -- a denied word cannot be
\ built into anything new -- but a call compiled while the word was allowed
\ is not checked again.
\ As v3, every execution is checked, inside definitions too (2026-11-19,
\ docs/v4.0.0/plans/2026-11-19-acl-at-call.md): a call from code defined at
\ run time is checked by the kernel at the call -- counted down there, or,
\ at a TTL of 0 or a denied word, sent to (ACL-CALL) (acl.f18), which runs
\ (ACL?). A word being compiled is not checked, as in v3. While the policy
\ rechecks a word, (ACL-BUSY) is 1 and the kernel checks nothing, as v3 runs
\ its policy with the check off.
\ ( xt -- ) recheck
: (ACL-RECHECK)
(ACL-HOOK) a! @ if NONE push ex \ call it with the xt
;
(ACL-HOOK) a! @ if NONE
1 (ACL-BUSY) a! ! push ex \ call it with the xt, the kernel's check off
0 (ACL-BUSY) a! ! ;
NONE: drop -3 + a! @ 65535 and -33 and $FFFF0000 + ! ;
\ ( xt -- xt ) as above; a denied word ends the line
@@ -202,7 +205,7 @@ set HDR-NFA here ", INTERPRET #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LIN
STATE a! @ if INTERP
drop 1 and if COMP \ compiling: immediate words still run
drop (ACL?) jump (GO)
COMP: drop (ACL?) (COMPILE,) jump (IL)
COMP: drop (COMPILE,) jump (IL) \ compiled, not checked: the call is, when it runs (as v3)
INTERP: drop 16 and if RUN
drop drop (.WORD) \ ": compile-only"
$6F63203A (EMIT4) $6C69706D (EMIT4) $6E6F2D65 (EMIT4) $796C (EMIT4) CR
+4
View File
@@ -35,5 +35,9 @@ store (IMG) &(IDLE)
store (IMG)+1 &(FAULTS)
store (IMG)+2 &KEY
store (IMG)+3 &CR
\ the ACL's check at call: where the kernel sends a call to be checked; and the
\ policy not running
store (ACL-CALLX) &(ACL-CALL)
store (ACL-BUSY) 0
start (IDLE)
+2
View File
@@ -120,6 +120,8 @@ constant RSTACK-DEPTH 32752
constant HEAT-OP 29216
constant (EXEC) 30047
constant (RUNX) 29954
constant (ACL-CALLX) 29956
constant (ACL-BUSY) 29925
constant ANTICLOCK 29248
constant CFBASE 32672
constant CFEND 32704
+2
View File
@@ -120,6 +120,8 @@ constant RSTACK-DEPTH 32752
constant HEAT-OP 29216
constant (EXEC) 30047
constant (RUNX) 29954
constant (ACL-CALLX) 29956
constant (ACL-BUSY) 29925
constant ANTICLOCK 29248
constant CFBASE 32672
constant CFEND 32704
+17 -9
View File
@@ -95,6 +95,19 @@ set HDR-NFA here ", VLIST #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK he
CUT: drop -1 + a! @ (Q)+1 a! @ a! ! jump L
DONE: drop ;
\ ( -- ) take off every list every entry at or above the address in (Q)+0:
\ FORTH's, and each vocabulary's that stays; a vocabulary defined at or above
\ it goes from the chain. FORGET does this for what it forgets, and COLD for
\ everything since the seal, so a vocabulary sealed into the system stays.
: (PRUNE-ALL)
(LATEST) (PRUNE)
V: VOC-LINK a! @ if PRUNED \ vocabularies that go
dup (Q) a! @ inv + 1 + -if GONE drop jump KEPT
GONE: drop 1 + a! @ VOC-LINK a! ! jump V
KEPT: P: if PRUNED \ the lists of those that stay
dup (PRUNE) 1 + a! @ jump P
PRUNED: drop ;
\ FORGET xxx FORTH-79: remove xxx and every word defined after it, in
\ whatever vocabulary; the space they took is free again. A vocabulary that
\ goes is no longer CONTEXT or CURRENT: FORTH is. A word that is not there
@@ -108,13 +121,7 @@ set HDR-NFA here ", FORGET #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK h
drop drop NODE-ERROR b! 10 !b ;
OK: drop
dup (Q) a! ! 4* DP a! ! \ the space from its name on
(LATEST) (PRUNE)
V: VOC-LINK a! @ if PRUNED \ vocabularies that go
dup (Q) a! @ inv + 1 + -if GONE drop jump KEPT
GONE: drop 1 + a! @ VOC-LINK a! ! jump V
KEPT: P: if PRUNED \ the lists of those that stay
dup (PRUNE) 1 + a! @ jump P
PRUNED: drop
(PRUNE-ALL)
CONTEXT a! @ (Q) a! @ inv + 1 + -if C1 drop jump C2
C1: drop (LATEST) CONTEXT a! !
C2: CURRENT a! @ (Q) a! @ inv + 1 + -if C3 drop jump TOLD
@@ -150,7 +157,7 @@ set HDR-NFA here ", WARM #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK her
jump ABORT
\ ( -- ) the system as it was when the capsule had just been loaded:
\ everything defined since is gone, there is one vocabulary, numbers are
\ everything defined since is gone, the vocabularies are as sealed, numbers are
\ decimal, the block buffers are empty. Then as WARM.
set HDR-NFA here ", COLD #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK here
: COLD
@@ -158,7 +165,8 @@ set HDR-NFA here ", COLD #id, #, 0 #, HDR-NFA #, HDR-LINK set HDR-LINK her
(BOOT)+1 a! @ (LATEST) a! !
(BOOT) a! @ 2/ 2/ (FENCE) a! !
(BOOT-ID) a! @ (NEXT-ID) a! !
(LATEST) CONTEXT a! ! (LATEST) CURRENT a! ! 0 VOC-LINK a! !
(LATEST) CONTEXT a! ! (LATEST) CURRENT a! !
(BOOT) a! @ 2/ 2/ (Q) a! ! (PRUNE-ALL) \ the vocabularies as sealed, with what was sealed in them
10 BASE a! ! 0 SCR a! ! 2 (LOG-LEVEL) a! ! 0 (ACL-HOOK) a! ! EMPTY-BUFFERS
(BOOT) a! @ 2/ 2/ (FORGOTTEN) \ the kernel's records of what has gone go too (dict.f18)
$54524F46 (EMIT4) $39372D48 (EMIT4) $6C6F4320 (EMIT4) $74532064 (EMIT4) $747261 (EMIT4) CR
+87
View File
@@ -6760,3 +6760,90 @@ Pushed at Captain Bob's word (8660ab77).
**Next:** mechanism A, test first, measured by five alternating runs, then the protocol.
### 26. Mechanism A: the fabric step walks only the places that hold a node (2026-11-17)
Captain Bob: "Go". The design and its evidence are in `docs/v4.0.0/plans/2026-11-17-the-fabric-step-cost.md`
section 7.
**The change** (edbb79e2):
- The fabric keeps its occupied places in a list, in ascending order. The step's nine passes walk that
list, in the same order as before.
- A node removed while a pass is at it keeps its link, so the walk goes on to the next node.
**Test first:** `test_fabric_walk.c`, 13 checks. Every existing test passes with the same checks.
**The cost:** the host mesh boot's median fell from 11.695 s to 7.999 s, 32% less, over five alternating
runs (`logs/20261117-mechanism-a/timing.txt`).
**The protocol on edbb79e2** (`logs/20261117-222402/PROTOCOL.md`): **PASS**.
- All four boots run POST 990 of 990 with one `dict_hash`, `0x627f392ccbaa96f1`.
- aarch64 is inside its 570 s. It had stopped in POST since 37469f6c.
- test-32, the proofs, the images and the docs pass.
- The docs stage runs longer than one foreground command; it ran in the background at Captain Bob's ruling.
### 27. starshipos.4th loaded; COLD keeps the vocabularies as sealed (2026-11-18)
**The audit of Phase 7 Tasks 5–7.** Task 8's 990 already covers their POST modules (ticked, b789d18a).
What the record asks beyond POST, each gap put to Captain Bob one at a time:
- **`starshipos.4th` loads before POST, after `forth79.4th`** (4137f1b7). MACHINE.md §3 step 3 says so
(ruled 2026-10-15). A first answer, "leave it unloaded", was given before that ruling had been shown,
and was reverted once it had.
- **`init.4th`: designed and held** (`docs/v4.0.0/plans/2026-11-18-v4-init.md`). Captain Bob: "Capsules
are ephemeral. We need to talk later." The loaders already keep no capsule's blocks: v4 drops the
`Block <n>` number and sends the lines, and v3 copies the blocks from block 1. Only the build tooling
(`mkcapsule`'s collision check, `BLOCK_MAP.md`) and the documents still treat ranges as claims.
- **Still open:**
- the ACL policy is not loaded by the kernel's boot;
- `BIRTH` is not pinned;
- the countdown "at call";
- Artemis's writes.
**A fault found by checking the logic** (Captain Bob: "make sure we're not applying incorrect logic";
295cd518).
- **The fault:** `COLD` set `VOC-LINK` to 0, on the assumption that the sealed system has one
vocabulary. With `STARSHIPOS` sealed in, a word defined in it and then forgotten, or COLDed away, hung
the node.
- **The fix:** `FORGET`'s prune is now `(PRUNE-ALL)`, and `COLD` uses it with the sealed `DP`. It adds no
cell and no word.
- **Test first:** the before-run hung and was stopped at 500 s; after, 109 checks pass.
- **The docs gate refused the build** until `STARSHIPOS` had its dictionary entry (573d386b).
**The protocol on 573d386b** (`logs/20261118-151921/PROTOCOL.md`): **PASS**.
- POST is 990/990 on all four boots.
- One `dict_hash` on the three ISAs: `0xf4e9fdc94f6bfc77`, `word_count=404`.
- `accept-aarch64`, the boot plus its session, now takes longer than one foreground command (401 to
429 s, and over 595 s three times in the foreground).
- **Ruled:** a long stage runs in the background, but only alone: "as long as there is no other
background process running including docs. In fact that might generalize too" (`.claude/memory/rules.md`).
### 28. Capsule blocks: no claims, placed in RAM, the lowest loaded (2026-11-18)
**The talk** (Captain Bob): "Capsules are ephemeral." Its rulings, one at a time, are in
`docs/v4.0.0/plans/2026-11-18-capsule-blocks.md`:
- `Block n` is copied down by R, the RAM block count; the fixed 2048 was "THE BUG".
- A later write overwrites: "Deterministic and final", within a capsule too.
- Where a block lands, and any chaining, is the developer's responsibility.
- The block map is "a convenience", and the range tables go.
**Built, test first, each step verified:**
| Step | Commit | What |
|---|---|---|
| 1 | 6f9900f8 | `BLK_RAM_USER_BLOCKS` is a Kconfig knob (default 2048). The kernel's block layout, `mkcapsule` and `mkartemis` follow it. |
| 2 | f30005e1 | `mkcapsule` makes no claims. The collision gate, `capsule-reserved.txt` and the resolver go ("All of it goes"). |
| 3 + 4, v4 | 6dcfbe67 | Every v4 loader places a capsule's blocks in RAM at `n - R`, then interprets `<lowest> LOAD`. The v4 capsules are renumbered to land at 1900 and up, and chained with `-->`. |
**Kept as is:**
- v3's `INIT` ("Yeah, keep").
- The hosted product, only kept green for the gates that run it: "Nobody cares about hosted anymore".
**`(-` as a build marker per block:** an open stub, until the SDK.
**The protocol on 53b1e98e** (`logs/20261118-204012/PROTOCOL.md`): **PASS**.
- POST is 990/990 on all four boots.
- `dict_hash` is `0x847bd8ef42f53e14` on all three ISAs; it changed with the block path.
**The line drawn here** (Captain Bob: "I want to make a delineation for new work"; ruled "Merge, then a
tag"): PR #197 merges once its Acceptance passes, and a tag on `master` marks the line. New work starts
after it.
+2
View File
@@ -336,6 +336,7 @@ VARIABLE ( -- ) VARIABLE xxx: define xxx, which leaves the address of one cell.
VERSION ( -- ) Print which system this is, and its cell width.
VLIST ( -- ) List the names in the CONTEXT vocabulary (WORDS).
VOCABULARY ( -- ) VOCABULARY xxx: define a vocabulary xxx; running it makes it the CONTEXT vocabulary.
STARSHIPOS ( -- ) Make STARSHIPOS, the vocabulary of the StarshipOS words (starshipos.4th, loaded before POST), the CONTEXT vocabulary; a search of it that finds nothing searches FORTH.
WARM ( -- ) Print the system's message and ABORT: both stacks emptied, the prompt.
WHILE ( flag -- ) Compile-only: in BEGIN ... WHILE ... REPEAT, leave the loop if flag is zero.
WITHIN ( n low high -- flag ) True if low <= n < high.
@@ -388,6 +389,7 @@ BIRTH-AS ( number port childport baddr u -- place ) BIRTH, and given the capsule
CAPSULE-CELL ( -- w flag ) The next cell of the capsule of F18 code this node has open, and true; 0 0 at its end. A kernel request.
CAPSULE-LINE ( baddr -- u | -1 ) The next line of the capsule of FORTH blocks this node has open, copied to baddr: its length, or -1 at its end. A kernel request.
CAPSULE-OPEN ( baddr u -- flag ) Find the named capsule, check its hash and signature, and open it to be read from its start by this node. A kernel request.
CAPSULE-INCLUDE ( baddr u -- ) Load the named capsule of FORTH blocks into this node: CAPSULE-OPEN places its blocks in RAM, block n at n - R, and its lowest block is LOADed; what runs after it is the capsule's own (-->, LOAD, THRU). init.4th loads the ACL policy so. centre.4th.
CENTRE ( n -- ) Hera only: a second centre, node n, from its port 6 to Hera's port 6, given centre.4th; it births its own unit, n+1 to n+4.
KILL ( n -- ) Hera only: node n is removed, whatever it was doing; every node is told it is gone, and Hera forgets the way to it.
NODE-BORN ( number -- place | -1 ) A node is born, empty, and entered in the registry with this node as its parent: its place, or -1 if there is no room. A kernel request.
Can't render this file because it contains an unexpected character in line 11 and column 3.
+206
View File
@@ -0,0 +1,206 @@
# The F18 ABI -- draft contract, for ruling
Written 2026-11-19. Step 1 of `ADR-2026-11-19-F18-ARTIFACTS.md` §7: "Define and document the minimal ABI
contract". It builds on the rulings in `plans/2026-11-19-f18-artifacts.md`:
1. compiled artifacts are allowed beside the ROM;
2. Hermes is the messaging role;
3. Artemis owns persistent memory;
4. a word's identity is its capsule plus its name.
**Nothing here is built.** The choices left open are numbered in §9, and each will be put to Captain Bob on
its own.
## 1. Terms
| Term | Meaning |
|---|---|
| **Word** | The unit of interface and access control (ADR §1). It has a name, an entry point, a stack effect and its ACL fields. |
| **Capsule: a train** | The unit of packaging, distribution and deployment (ADR §1). It is content-addressed, so its ID is its hash, and it is signed, as now (`kernel/include/starkernel/capsule.h`). **Ruled 2026-11-19, "One train per capsule":** each capsule is a train. Its *engine* is its `.f18` code, assembled by the host tool into one artifact. Its *rolling stock* is the named blobs coupled behind the engine: `.4th` source, data, and whatever else it carries, each with its own identity and provenance. A system is many trains; the nucleus is one of them. |
| **Artifact: the engine** | A train's compiled F18 unit: code cells, and the records of §4 that make them placeable and checkable. It is assembled from all of that capsule's `.f18` files. |
| **Rolling stock** | The named blobs behind an engine (MACHINE.md §1's trailer). The engine's code is what acts on them: the ROM's types, `.f18` assembled and `.4th` handed a line at a time, now carried by each train. |
| **Identity** | Ruling 4: a word's identity is (the hash of the capsule that defines it, the word's name). Addresses, word IDs and places are local resolution only. |
| **Loader** | Whoever places an artifact in a node. As today, that is the node itself, through words like `CAPSULE-INCLUDE`, or the kernel at boot. No central linker (ADR §6). |
## 2. The hardware contract (unchanged; kept apart, ADR §3.2)
The engine's contract is what it is today, and the ABI does not change it:
- **Instruction words** of six slots (`v4/include/v4/iword.h`). A branch (`jump`, `call`, `next`, `if`,
`-if`) carries its target in the bits to the right of its slot, page-relative, with a reach of 27, 22, 17
or 12 bits.
- **The return stack and the data stack** are rings, with their depths set by the build (`V4_DATA_RING`,
`V4_RET_RING`). A call pushes its return address.
- **Ports and messages** between nodes, as MESH.md has them. The ABI adds nothing between nodes: "inter-core
communication shall continue to use the established message architecture" (ADR §3.2).
- **The call hook** (2026-11-19, `exec.h`) may redirect a call. The ACL uses it now; §6 may use it.
**What this means for artifacts:** compiled code holds addresses in its branch fields. An artifact placed
anywhere but where it was compiled needs those fields fixed (§5).
## 3. The word contract
**The entry** is as `dict.f18` has it today:
| Cell | Holds |
|---|---|
| `xt - 4` | the word ID, local |
| `xt - 3` | the flags: 1 immediate, 2 hidden, 4 data, 8 in-line, 16 compile-only, 128 deferred, plus the ACL fields (bit 5 denied, bit 6 pinned, bits 8–15 the mode, bits 16–31 the TTL) |
| `xt - 2` | the name |
| `xt - 1` | the link |
| `xt` | the code |
**What the ABI adds is recorded, not run.** Each exported word has:
- **its stack effect:** how many cells it takes and leaves on each stack. This is the "stack effects" of
ADR §3.2. It is derived by the host tool from the compiled code (choice 2), checked when the artifact is
placed and in the proofs, never at run time.
- **its capabilities:** the kernel requests it may make (`KERNEL-WORD` numbers) and whether it touches ports.
- **its ACL defaults:** pinned or not, and its mode. They are applied at placement, through the same fields.
**The calling convention:** a call with a return address on the return stack, as now. A word returns with
`;`. Arguments and results travel on the data stack only, in the declared counts. There is nothing else.
## 4. The artifact
**The records are in 32-bit units, low byte first, and the code is in the build's cells** (`ARTIFACT.md`
§1, ruled 2026-11-19, "32-bit units"). A node reads the records as it reads a block, four bytes to a
cell. *Corrected 2026-11-19: this line said "All of it is in cells, so an F18 node can read it".*
| Record | Holds |
|---|---|
| **Header** | a magic number; the ABI version; the cell width (32 or 64); the record counts |
| **Provenance** (ADR §3.1) | the source capsule's hash; the compiler's identity (the host tool's hash, choice 1); the build configuration's hash (the knobs, `V4_NODE_WORDS`, the rings); the target |
| **Exports** | for each word: its name, its entry's offset in the code, its flags, its declared stack effect, its capabilities |
| **Imports** | for each word used from another capsule: (that capsule's hash, the name), and the stack effect it is expected to have |
| **Relocations** | every cell of the code whose branch field holds an address, with how to fix it: internal (add the base), or import *k* |
| **Code** | the compiled cells, as if placed at address 0 |
| **Verification** | the identity of the proof that covers this exact artifact, and the assumptions it holds under (ADR §5), or none |
**Integrity and authorship** are the capsule's: its content hash and its Ed25519 signature, as now. The
artifact repeats neither, and, as ADR §5 says, a hash is not correctness.
## 5. Placement: resolution without a linker
A loader places an artifact in one pass, in order:
1. **Check:**
- the header is one this ABI version and cell width take;
- the capsule's hash and signature check, as `CAPSULE-OPEN` already does;
- every import's capsule is present in this node, and the imported word is exported by it with the
stack effect expected. **Fail closed:** if any check fails, nothing is placed.
2. **Place:** the code cells are copied to the node's dictionary space at its `HERE`, the base.
3. **Fix:** each relocation's branch field is patched, adding the base, or putting in the import's
resolved address. A field whose patched address does not fit its slot's reach is refused (fail
closed). Patching happens at placement only, once, with no lazy binding and no later resolution.
4. **Enter:** an entry is made for each export, as `(HEADER)` makes one, and the kernel is told
(`(WORD-DEFINED)`). The word accounts, the ACL fields and the defaults of §3 apply from here.
This is the work FORTH's compiler already does when it compiles a reference to a word. It is done here
from records, not from source. It is not dynamic linking in the ADR's sense: there are no shared libraries,
no lazy binding, no global address space and no linker running beside the program.
## 6. Activation and retirement (ADR §4)
**A replacement** is a newer capsule exporting a word of the same name. Its identity differs, because its
capsule hash differs. Activation must make the code that calls the old word reach the new one. The call
sites compiled into other definitions hold the old address (§2). Choice 5 is how they reach it.
**A safe boundary** is a heartbeat at which no node is inside the old word: no return address into it is
on any return stack, and no message for it is waiting. Choice 6 is how that is known.
**Retirement:** the old code is freed only when nothing can reach it. Until then both versions coexist
(ADR §4).
**Rollback** is activating the old one again, as long as it is not retired. Artemis keeps the staged and
recovery copies (ruling 3).
## 7. Compatibility
**A replacement is compatible** when, for every word the old artifact exported:
- the new one exports a word of the same name;
- with the same stack effect;
- needing no capability the old did not.
Anything else is incompatible, and activation is refused. A verified artifact is not compatible because it
is verified (ADR §5); compatibility is checked against the old artifact's records.
## 8. What stays as it is
- POST, the protocol, and CI's gates (ADR §7).
- Source capsules and the boot as it is: the ROM still assembles the system at boot (ruling 1).
- The ACL's check at call, and the word accounts: an artifact's words are words like any other.
- Messages between nodes.
**Captain Bob's image, 2026-11-19:** "the .f18 assembler assembles all .f18 files it finds. Now here's a
thought. That 'assembled' code can be the 'engine' for a train of named blobs as metaphorically rolling
stock." Ruled "One train per capsule" (§1).
**The rail yard: the SDK and CI's model** (Captain Bob, 2026-11-19, recorded as given; nothing built):
> "When we build the SDK, we can naturally think of a railroad yard for staging outgoing artifact capsule
> 'trains' from first order preexisting 'cars' prior to writing new ones.. That would be the model and on
> the CI side we can use messaging as semaphores in our staging yard with inbound and outbound trains and
> the artifacts are the persistent part. Signed, sealed and versioned."
Read here as:
- **The yard stages trains.** An outgoing train is made up first from cars that already exist, which are
first-order and already built. New cars are written only for what is missing.
- **In CI, messages are the semaphores.** They signal inbound and outbound trains through the yard: what
may move, and when.
- **What persists is the artifacts:** signed, sealed and versioned. The yard's moves are transient.
It ties in `(-`, the build marker that asks CI to clear a block for the next image (`plans/2026-11-18-
capsule-blocks.md` §5), and Artemis keeping what is kept (ruling 3).
## 9. Open, for ruling one at a time
1. ~~Where artifacts come from~~ **Ruled 2026-11-19: "A host tool".** A C tool beside `mkcapsule` compiles
`.f18` to artifacts on the build machine. It is a second assembler beside the ROM's, so the two must
agree: the tool's output is checked against what the ROM assembles from the same source, cell for cell,
in the build and in CI. The compiler's identity in the provenance record is the tool's own hash.
The cell-for-cell check was added in drafting; confirmed by Captain Bob, 2026-11-19 ("Yes").
2. ~~The stack-effect declaration~~ **Ruled 2026-11-19: "Derived by the tool".**
- A first answer, "the ( -- ) comment, strict", was withdrawn the same day. Captain Bob: "I think I may
have made a bad assumption. I had the idea of that after (- was aliased to ( is for SDK special. We're
working on something more fundamental."
- **There is no declaration in the source.** The host tool computes each exported word's stack effect
from its compiled code, by static analysis of the F18 opcodes, and records it in the artifact. The
proofs check it. Comments stay comments.
- **2c, ruled 2026-11-19: "Refused as an export".** A word whose effect depends on its data (a loop
leaving a count of values, branches that leave different depths, `EXECUTE`, a `DEFER`red word) has no
fixed count. It cannot be exported by an engine: it stays internal to its train, or is restructured.
Every export has a fixed effect, derived by the tool; a word with none stays internal, and the build
does not fail for it (`plans/2026-11-19-f18-artifact-build.md` §6.4). *Corrected 2026-11-19: this
said "which the tool derives and the build fails without".*
3. ~~What a capsule carries~~ **Ruled 2026-11-19: "No, by reference".** A train's engine carries only the
hash of the `.f18` source it was assembled from, in its provenance record. The source stays in the
repository and in its own capsule. To check an engine against its source, the source is fetched by
that hash.
4. ~~Imports by capsule hash~~ **Ruled 2026-11-19: "Exact hash".** An import names the exact build of
the train it imports from: (its capsule hash, the word's name). If that train is rebuilt or updated,
its hash changes, so its importers are rebuilt too, and a live update replaces the whole dependent set
of trains together. Placement refuses an import whose hash is not present.
**Ruled 2026-11-19 (step 3, `plans/2026-11-19-f18-artifact-build.md` §10.4):** a train's hash is its
`.f18a`'s capsule ID. The nucleus has none, so a word imported from it has hash 0 and is resolved by name
in the node's dictionary at placement; exact hashes hold between artifact trains only.
5. ~~How callers reach a replacement~~ **Ruled 2026-11-19: "Jump at the old entry".** At activation, each
replaced word's first code cell, at its xt, is overwritten with a `jump` to the new word: one cell per
word, and every caller, compiled at run time or not, follows at once. The old code stays in place,
unreachable but for that cell, until it is retired. The new word must be within the jump's reach from
the old entry (27 bits in slot 0, which covers a node's memory), or activation is refused.
6. ~~The safe boundary~~ **Ruled 2026-11-19: "Scan at a heartbeat".** At a heartbeat tick the kernel
scans every node's P and return stack for an address inside the old words' code. When none is there, it
writes all of a set's jumps in that one tick. While some are there, it tries again on later ticks. A
message waiting for an old word is not code on a stack and does not hold the set back: the word it
reaches is the new one. That last point was added in drafting; confirmed by Captain Bob, 2026-11-19
("Yes").
7. ~~Proofs first~~ **Ruled 2026-11-19: "Safe activation first".** The first Isabelle/HOL property:
- the jump at each old entry is written only at a tick when no node's P or return stack holds an address
inside the old code (choice 6);
- after it, every call to an old word, from any caller, reaches the new word.
Placement's checks, compatibility and the soundness of the derived stack effects come after.
## 10. Status
All seven choices are ruled, plus 2c (no fixed effect means no export). This draft is the minimal ABI
contract, the ADR's step 1, as ruled.
The next step is the ADR's step 2, the artifact representation in detail: the exact cell layout of §4's
records, a design for ruling before any code.
+181
View File
@@ -0,0 +1,181 @@
# StarshipOS Architectural Design Decision
<!-- Recorded verbatim as given by Captain Bob, 2026-11-19. The conflicts it raises with the existing record
are put to him one at a time, and ruled in docs/v4.0.0/plans/2026-11-19-f18-artifacts.md. -->
## F18 Binary Artifacts, ABI/API, and Live Runtime Updates
Status: ACCEPTED — Immediate Design Decision
Date: 2026-11-19
Scope: F18 build system, LithosAnanke, StarshipOS runtime
Priority: Architectural foundation
---
### 1. Decision
StarshipOS shall establish a canonical binary artifact format for compiled F18 code, supported by a minimal, formally specified Application Binary Interface (ABI) and Application Programming Interface (API).
The ABI shall operate at the word and capsule levels:
- Words are the units of interface and access control.
- Capsules are the units of packaging, distribution, and deployment.
The implementation shall preserve the existing StarshipOS architecture without introducing conventional dynamic linking, shared-library infrastructure, or unnecessary runtime machinery.
### 2. Motivation
This decision supports four primary objectives:
1. Performance: Eliminate redundant compilation, dependency resolution, and other avoidable work from build and startup paths.
2. Verification: Provide immutable binary artifacts suitable for Isabelle/HOL verification and reproducible-build validation.
3. Authenticity and provenance: Establish traceability between source, build configuration, compiler, binary artifact, and formal verification evidence.
4. Live updates: Permit verified binary components to be staged and activated within a running StarshipOS instance without requiring a complete system restart.
Performance improvements must be measured. Binary artifact creation alone does not guarantee reduced startup latency.
### 3. Architectural Contract
#### 3.1 F18 Binary Artifacts
The build system shall compile F18 source into a canonical, versioned binary artifact representation.
An artifact shall provide sufficient information to establish:
- Artifact identity and integrity.
- Source and build provenance.
- Target architecture and compatibility constraints.
- Exported and imported word identities.
- Word-level interface contracts.
- Dependencies and required capabilities.
- Verification status and associated proof identity.
The format may contain individually addressable compiled units.
Artifacts shall remain independent of final deployment decisions. A compiled unit may be incorporated into kernel ROM or distributed as a runtime-consumable capsule.
Source files, compiled binaries, and supporting documentation shall retain their individual provenance.
#### 3.2 Application Binary Interface (ABI)
The ABI shall define the minimum binary-level contract necessary for independently compiled components to interoperate.
It shall address:
- Word identity and resolution.
- Calling conventions and stack effects.
- Memory ownership and access constraints.
- Entry points and dependencies.
- Capability and ACL requirements.
- Binary compatibility.
- Activation and retirement semantics.
The F18 hardware execution contract and the StarshipOS artifact interoperability contract shall remain conceptually distinct.
Logical word identity shall not depend on physical memory addresses or processor placement.
Local execution may resolve to physical addresses. Inter-core communication shall continue to use the established message architecture.
#### 3.3 Application Programming Interface (API)
The API shall expose the minimum operations necessary for artifact discovery, verification, staging, activation, retirement, and recovery.
These operations should be implemented through existing StarshipOS facilities wherever practical.
They shall not automatically require new kernel primitives.
The API shall preserve the existing responsibilities of:
- Hera: System ownership, component creation, and coordination.
- Hermes: Messaging, routing, and communication.
<!-- Ruled 2026-11-19 ("The messaging role"): Hermes names the role, not a VM. In v4 it is the fabric's wires
and routing (MESH.md), and kernel-Hermes on v3; no Hermes node is brought back. -->
- Artemis: Memory, persistence, and recovery.
<!-- Ruled 2026-11-19 ("Persistent memory"): Artemis owns what is kept -- persistent storage, staged artifacts,
recovery copies (FABRIC-3.5 XIV.3). Run-time memory stays the kernel's: the Stadium allocates it, and the
kernel serves blocks. -->
Specific API word names and signatures remain implementation decisions.
### 4. Live Runtime Updates
StarshipOS shall support the architectural capability to introduce verified replacement artifacts into a running system.
The intended lifecycle is:
1. Build the replacement artifact.
2. Verify integrity, compatibility, and applicable formal properties.
3. Distribute and stage the artifact.
4. Establish a safe activation boundary.
5. Activate the replacement.
6. Retire the previous implementation when safe.
7. Preserve recovery or rollback capability where applicable.
Heartbeat boundaries may provide logical activation points, but safe replacement must account for outstanding execution, messages, dependencies, and persistent state.
Multiple artifact versions may coexist during transitions.
Live replacement shall not violate existing runtime invariants or word-level ACL guarantees.
### 5. Formal Verification
The ABI and artifact format shall be suitable for specification in Isabelle/HOL.
Verification objectives include:
- Artifact structural validity.
- Interface and stack-effect compatibility.
- Dependency satisfaction.
- Memory and capability constraints.
- Safe activation and retirement.
- Preservation of established invariants across compatible replacements.
Proof evidence shall be associated with the exact artifact and its applicable assumptions.
Cryptographic integrity and authenticity shall be distinguished from functional correctness. Hashes alone do not establish correctness or authorship.
A verified replacement shall not be considered universally compatible merely because its individual components have been verified.
### 6. Explicit Non-Goals
This decision does not authorize introducing:
- ELF-style dynamic linking or shared libraries.
- A conventional process loader.
- A centralized runtime linker.
- A global executable address space.
- A conventional scheduler or memory manager.
- A new execution model.
- Mandatory inclusion of all compiled artifacts in kernel ROM.
- Unnecessary kernel primitives or additional abstraction layers.
The existing asynchronous, message-driven architecture remains authoritative.
### 7. Implementation Direction
Implementation shall proceed incrementally:
1. Define and document the minimal ABI contract.
2. Establish the canonical binary artifact representation.
3. Integrate artifact production into the existing build system.
4. Add integrity, provenance, and reproducibility checks.
5. Formalize applicable ABI properties in Isabelle/HOL.
6. Implement minimal artifact API operations.
7. Validate staged and live replacement using controlled experiments.
8. Measure build time, startup latency, runtime overhead, and replacement correctness.
Existing build, POST, CI, and verification gates shall remain in force unless explicitly superseded by independently validated equivalents.
### 8. Governing Principle
Words define interfaces. Capsules define deployment. Artifacts establish identity and provenance. The ABI guarantees interoperability. The API exposes operations. Isabelle/HOL verifies the applicable contracts.
No additional machinery shall be introduced without demonstrated necessity.
The machine remains the machine.
---
Decision: ACCEPTED
Implementation: Pending incremental design and experimental validation
Architectural impact: Foundational — F18 toolchain, capsule infrastructure, formal verification, and live deployment.
+159
View File
@@ -0,0 +1,159 @@
# The F18 artifact -- its layout, draft for ruling
Written 2026-11-19. Step 2 of `ADR-2026-11-19-F18-ARTIFACTS.md` §7, "Establish the canonical binary
artifact representation". It gives the exact layout of the records `ABI.md` §4 lists, under ABI v0 as
ruled:
- one train per capsule;
- a host tool assembles all of a capsule's `.f18` into its engine;
- each export's stack effect is derived, and a word with none fixed is not exported;
- imports name the exact build;
- the source travels by reference.
**Nothing here is built.** The choices in §8 are ruled (2026-11-19).
## 1. Units, order, width
- **The unit is a 32-bit word**, stored little-endian, low byte first, as v4's blocks are (`blocks.h`:
"four bytes to a cell, the first lowest"). Every record is a whole number of units, so the records read
the same at either cell width.
- **The code is cells of the build's width**, each stored low byte first (choice 5). A 32-bit engine and a 64-bit engine are two artifacts: the
header says which, and placement refuses the wrong one.
- **A 64-bit value**, such as a capsule's hash, is two units, low unit first.
- **A SHA-512 hash** (choice 2) is 16 units: its 64 bytes in their order, packed four to a unit, low byte
first.
- **A name** is a counted string, its length byte then its characters, packed four to a unit, low byte
first, as the dictionary packs names (`dict.f18`). It sits in the string pool and is referred to by its
unit offset.
## 2. The whole
```
header 16 units
provenance 64 units
exports E x 8 units
imports I x 6 units
relocations R x 2 units
verification 18 units
string pool S units
code C cells
```
The offsets of each part are in the header, so a reader skips what it does not need. The artifact is the
engine of a train: the capsule's payload. The capsule's content hash and Ed25519 signature, already
`mkcapsule`'s, cover it whole. The artifact repeats neither.
## 3. Header (16 units)
| Unit | Field |
|---|---|
| 0 | magic `F18A` (`0x41383146`) |
| 1 | ABI version: 0 |
| 2 | cell width in bits: 32 or 64 |
| 3 | the node words it was built for (`V4_NODE_WORDS`) |
| 4–5 | E, the export count; I, the import count |
| 6–7 | R, the relocation count; S, the string pool's units |
| 8 | C, the code's cells |
| 9 | the unit offset of the exports (the others follow, in §2's order) |
| 10–15 | reserved, 0 |
## 4. Provenance (64 units, ADR §3.1)
Each hash is SHA-512 (choice 2).
| Units | Field |
|---|---|
| 0–15 | the hash of the `.f18` source the engine was assembled from (ABI choice 3: by reference) |
| 16–31 | the host tool's hash, the compiler's identity (ABI choice 1) |
| 32–47 | the build configuration's hash: the knobs that change code, the cell width, `V4_NODE_WORDS`, the rings |
| 48–63 | the ROM's hash it must agree with: the tool's output is checked against the ROM's assembly |
## 5. Exports, imports, relocations
**An export (8 units):**
| Unit | Field |
|---|---|
| 0 | the name, as a string pool offset |
| 1 | the entry's offset in the code, in cells: the xt, relative to the base |
| 2 | the flags, as the entry's: immediate, compile-only, in-line, and the ACL defaults (pinned, mode) |
| 3 | the data stack effect: cells taken in the low 16 bits, cells left in the high 16, derived (choice 2) |
| 4 | the return stack effect, the same way, derived |
| 5 | the capabilities: bit 31 set if it touches ports; bits 0–30 the string pool offset of its list of kernel requests, or 0 for none |
| 6–7 | reserved, 0 |
**An import (6 units):**
| Units | Field |
|---|---|
| 0–1 | the exporting train's capsule hash, the exact build (choice 4) |
| 2 | the word's name, as a string pool offset |
| 3 | the data stack effect it is expected to have |
| 4 | the return stack effect it is expected to have |
| 5 | reserved, 0 |
**A relocation (2 units):**
| Unit | Field |
|---|---|
| 0 | the code cell, as an offset, and in the top 3 bits the slot whose branch field holds the address (0–3), or 7 for the whole cell |
| 1 | what it points to: `0xFFFFFFFF` for internal, so the base is added; otherwise the import's index |
Placement (`ABI.md` §5) patches each relocation's branch field. It refuses a patched address beyond that
slot's reach: 27, 22, 17 or 12 bits (`iword.h`).
**Slot 7, the whole cell** (ruled 2026-11-19, "Slot 7 = whole cell", step 3's design §6.1). The cell holds
an address as a value: an `&NAME` literal, or a dictionary link. Placement adds the base, or puts in the
import's address, to the whole cell, which reaches all of a node. Slots 4–6 are unused.
## 6. Verification (18 units, ADR §5)
| Units | Field |
|---|---|
| 0–15 | the SHA-512 hash of the proof that covers this exact artifact: its theory and its build; all 0 means none |
| 16 | the assumptions it holds under, as a string pool offset, or 0 |
| 17 | reserved, 0 |
## 7. What makes a valid artifact
The tool writes these properties and placement checks them. They are also the first things Isabelle states
about the format:
- the magic and the version;
- every count and offset within the payload;
- every string pool offset on a counted string, or, for a capabilities list, on a unit holding its count
*n* followed by *n* units, each a `KERNEL-WORD` number;
- every export's entry inside the code;
- every relocation's cell inside the code, its slot 0–3 one that holds a branch or 7, its import index
below I;
- every reserved unit 0.
## 8. Open, for ruling one at a time
1. ~~The unit~~ **Ruled 2026-11-19: "32-bit units".** Every record is in 32-bit units, low byte first,
as v4's blocks are, so the records read the same at either cell width (§1). Only the code is in the
build's cells.
2. ~~The hashes~~ **Ruled 2026-11-19: "SHA-512 for provenance".** The provenance hashes (source, tool,
configuration, ROM) and the proof's hash are SHA-512, the one already in the tree for Ed25519, 16
units each (§4, §6). An import's capsule hash stays the capsule's ID, XXHash64, 2 units (§5), and
signing stays Ed25519. The provenance record grows from 12 units to 64, with no reserved units, and
verification from 4 to 18.
3. ~~The return-stack effect~~ **Ruled 2026-11-19: "Record and check both".** The tool derives the
return-stack effect as it derives the data-stack effect, and records it in unit 4 of each export and
import (§5). Placement, compatibility (`ABI.md` §7, "the same stack effect") and the proofs check
both.
4. ~~Capabilities~~ **Ruled 2026-11-19: "Port bit + request list".** As drafted (§5, unit 5). The tool
derives it from the code: a port opcode sets the bit, and each kernel request the word reaches goes in
its list. Compatibility refuses a replacement that needs one the old did not (`ABI.md` §7). The list
is a count unit then that many request numbers (§7). The bit layout and the list's form were chosen in
drafting; confirmed by Captain Bob, 2026-11-19 ("Yes").
**Changed 2026-11-19 (step 3, `plans/2026-11-19-f18-artifact-build.md` §10.5, "Declared, then checked"):**
v4 has no port opcode, so capabilities cannot be derived. Each word declares them (`ports`, `request N`),
and the tool fails the build where it can see a port or a request that is not declared. The layout is
unchanged.
5. ~~Endianness for the code cells~~ **Ruled 2026-11-19: "Low-first, like the records".** Every byte of
the artifact has one order, low byte first, so its hashes and signature are the same whichever host
built it. A big-endian host swaps the bytes when it places the code.
## 9. Status
All five choices are ruled. This is the artifact layout, the ADR's step 2, as ruled. The next step is the
ADR's step 3: artifact production in the build (the host tool), designed for ruling before any code.
+8 -4
View File
@@ -329,16 +329,20 @@ machine blocks there, empty, until it is sent code.
These are reported, not hidden:
1. **Per-call-target heat** is the model's interim structure: `heat.h` says "in the meantime",
1. ~~**Per-call-target heat** is the model's interim structure: `heat.h` says "in the meantime",
and D-6 is deferred. It is a fixed 4096-entry table, and a call to a target at address 4096
or above is not counted. This is the stand-in recorded 2026-10-05. It is not the intended mechanism,
and it is not to be extended.
and it is not to be extended.~~ **Resolved 2026-11-12 (#189):** the table is gone. A call's target
is counted through `exec.h`'s hook at `call`, and the kernel keeps the word's accounts (`heat.h`;
FABRIC-3 XLVIII.24).
2. **Device addresses are attached by the owner, not fixed.** D-4 (the memory map) is deferred.
The FPGA needs fixed addresses.
3. **The ROM** is built and the host node boots from it (2026-10-15). A mesh node's ROM is
built too (`MACHINE.md` §2.2): entries 0–5, the shared math, and nothing else. In the test
host a node Hera births carries it. The products have no births yet, so they do not link
it. A node that is born is still sent the host's assembled system through its port.
host a node Hera births carries it. ~~The products have no births yet, so they do not link
it. A node that is born is still sent the host's assembled system through its port.~~
**Resolved (046ce0be, #189):** the kernel's mesh births nodes, and each is fitted with the mesh
ROM. Hera is born empty and given the nucleus as a capsule (`v4/system/mesh.c`).
4. ~~**`stack.h`'s opening comment** still says there is no overflow detection "and there never
will be". D-16 revised that, and the header carries a revision note above it. The code
counts and guards (§4). The comment's first paragraph is out of date.~~ **Resolved
+14 -5
View File
@@ -892,11 +892,20 @@ is rechecked, otherwise the TTL is counted down; then a denied word is refused w
is in the variable `ACL-HOOK`; with none there, the word is allowed and given the longest TTL. `ACL.fth` puts
its `ACL-RECHECK` there (v3 finds it by name each time).
**Where this is weaker than v3.** v3's inner interpreter checks every execution, inside definitions too. v4
code is native: a compiled call goes straight to its word, and no opcode asks permission. So v4 checks a
word when it is *compiled* as well as when it is interpreted — a denied word cannot be built into anything
new — but a call compiled while the word was allowed is not checked again when it runs. Closing that needs
the check in the node itself (the `call` opcode), which is a hardware decision and is not taken here.
**Where this was weaker than v3, and is not now** (2026-11-19, Captain Bob: "As v3: add at call"; "Engine: call
redirects"; `docs/v4.0.0/plans/2026-11-19-acl-at-call.md`).
- **The old gap:** v3's inner interpreter checks every execution, inside definitions too. v4 checked a word
when it was compiled and when it was interpreted, and a compiled call was never checked again.
- **Now, at the call:** the engine's call hook may send a call elsewhere. The kernel checks every call from
code defined at run time. A word with TTL left is counted down at the call. At a TTL of 0, or for a denied
word, the call goes to `(ACL-CALL)` (`acl.f18`), which rechecks or refuses it by the word's name and goes on
to it.
- **No compile-time check:** a word being compiled is not checked, as in v3.
- **The policy runs unchecked:** while the policy rechecks a word, `(ACL-BUSY)` is 1 and nothing is checked,
as v3 runs its policy with the check off.
- **A node with no kernel has no check at call:** the hosted node is one. Its compiled calls are not checked.
- **On the FPGA,** the `call` opcode must offer its kernel the same redirect. That is to be designed with the
FPGA.
| Word | Fate | Notes |
| --- | --- | --- |
+5 -2
View File
@@ -26,7 +26,10 @@ machine and a ROM.
| **Trailer** | Source, as named blobs. `.f18` is F18 assembler. `.4th` is FORTH. The blob's name gives its type. | The capsule directory (`capsules/`) |
The ROM is the only binary. It runs the same on the C engine and on the FPGA: one binary, the
same behaviour. Assemble FORTH from the trailer and the node is a FORTH machine. Assemble Lisp
same behaviour. **Superseded in part, 2026-11-19** (Captain Bob, "ADR supersedes";
`ADR-2026-11-19-F18-ARTIFACTS.md`): the build may also compile F18 into binary artifacts, with their
identity, provenance and interface. An artifact is a choice, not a requirement: the ROM still
assembles source at boot. Assemble FORTH from the trailer and the node is a FORTH machine. Assemble Lisp
and it would be a Lisp machine. The engine and the ROM do not change.
### 1.1 What it is for
@@ -204,7 +207,7 @@ streams the ROM instead.
| Today | Becomes |
|---|---|
| `v4/capsule/*.v4`, 14 files, 311 words, assembled on the build machine | `.f18` blobs under `capsules/v4/`, assembled by the ROM at boot |
| `v4/tools/mkimage.c` → `nucleus-64.f18`, a prebuilt dictionary | Builds the ROM only. The nucleus binary is gone. |
| `v4/tools/mkimage.c` → `nucleus-64.f18`, a prebuilt dictionary | Builds the ROM only. The nucleus binary is gone. (2026-11-19: compiled F18 artifacts are allowed beside the ROM, `ADR-2026-11-19-F18-ARTIFACTS.md`.) |
| `v4/src/text.c`, the assembler in C | The ROM's assembler is F18 code. `text.c` builds the ROM, as the first assembler builds the next. |
| `forth79.4th`: `U*`, `U/MOD` only | Every FORTH-79 word that is not an opcode, a register or the FORTH machinery (`NUCLEUS.md` 4, rule 1). It moves group by group, with POST after each (`NUCLEUS.md` 8, step 3). |
| `boot_capsules[]` in `v4/system/boot.c` | The system list (step 2, then step 3) is the loader's. Everything after POST is `init.4th`'s. |
@@ -207,9 +207,11 @@ Phase 4).
849 pass, 171 fail (`POST-PARITY.md` section 5).
- [x] Ruled (2026-11-14): "v3's table, not v3's bugs" -- v3's self-disagreements held to its table, cases
naming v3's internals held to their form with v4's values; both listed.
- [ ] The 171, by kind: address units (rules); what v4 lacks (`SP@` `SP!` `CASE` `SKIP` `SCAN` `SEARCH`
- [x] The 171, by kind: address units (rules); what v4 lacks (`SP@` `SP!` `CASE` `SKIP` `SCAN` `SEARCH`
`COMPARE` `ORDER` `THRU` `FLUSH` ...); v3's self-disagreements and v3-internal output (by the ruling);
the rest case by case. Then the whole table becomes v4's POST and its floor.: v3's whole POST as v4's; the floor raised
**Done 2026-11-14** (`POST-PARITY.md` section 6): 990 cases, all pass on Hera; each case rewritten is
listed with its reason in `POST.md`; the floor (`v4/system/POST_FLOOR`) is 990.
### Task 9: acceptance -- the full protocol; ENGINE.md, V3-PARITY.md, FABRIC-3
Each task gets its steps when the one before it is accepted, test first, as Phase 2's did.
@@ -0,0 +1,201 @@
# Capsules and their blocks -- the talk, and the bug it found
Written 2026-11-18, from the capsules talk with Captain Bob. It records the rulings as they are given.
**Nothing here is built.**
## 1. The design (Captain Bob)
- **A capsule is ephemeral.** "Capsules load into their respective block by the header for that
block, `Block <n>`. Then relocated into fast ram for execution. Other than the blocks used as
actual held data, everything else should be free for reuse."
- **`Block <n>`** "loads 1024 bytes from the defined block number and relocated". A page shorter
than 1024 bytes is padded; zeroes or spaces, "doesn't matter".
- **The order in the file is irrelevant.** His example, as the pages appear in the file:
```
Block 4098 \ stuff
Block 4255 \ stuff
Block 4096 \ program for stuff
Block 5077 \ crappy stuff
```
Each page lands by its own number, then is relocated into the VM's RAM and interpreted there.
- **The offset is not a constant** (ruled: "That's THE BUG! #1 needs to determine that from the
runtime and build knobs"). Where the VM's RAM ends, and so how far a page moves, comes from the
runtime and the build's knobs, never from a fixed 2048.
- **The order of interpretation** (ruled): "Start with lowest block loaded. The current block will
determine the next block interpreted." The lowest page runs first. What runs next is decided by
the page that is running, through `-->`, `LOAD` or `THRU` by number.
## 2. What the tree does today (read 2026-11-18)
| Where | What it does | Against the design |
|---|---|---|
| `tools/mkcapsule.c:414`, `:1094` | Refuses a page below the literal `2048`, "the VM's fast RAM (0..2047)" | The fixed number is the bug (ruled) |
| `v3/include/block_subsystem.h:78-88` | `BLK_RAM_BLOCKS` 2080 and `BLK_FORTH_SYS_RESERVED` 32 give 2048 user blocks | The knobs exist, but nothing derives the capsule offset from them |
| v3's `INIT` (`v3/src/word_source/starforth_words.c:300-490`) | Renumbers the pages 1, 2, 3 ... in **file order** and runs them | Places by file order, not by number; no offset from the knobs |
| v4's loader (`v4/system/mesh.c:102-117`, `load()`) | Drops the number and sends each page's lines to Hera **in file order**; writes no block | The pages are never in blocks, so a capsule cannot `LOAD`, `THRU` or `-->` its own pages; file order is execution order |
| `experiments/bare_metal/README.md` rule 3 | "Blocks are loaded in file order and executed top-to-bottom" | Contradicts "order is irrelevant" |
| `mkcapsule`'s collision check (`:846-879`), `BLOCK_MAP.md`, the range tables (`experiments/bare_metal/README.md`, `.claude/CLAUDE.md`, `capsules/README.md`) | Treat each page number as a permanent claim across all capsules | Open: see section 3 |
## 3. Open, one at a time
1. ~~The `Block <n>` header~~: ruled above.
2. ~~The collision check across capsules~~ **Ruled: "Overwrite. That's it. Deterministic and
final."** A page written to a block number already in use overwrites it; what was there is gone.
Which write wins follows from the load order, which is fixed, so it is deterministic. A shared
number is not an error, so `mkcapsule`'s cross-capsule collision check (`:846-879`) goes.
3. ~~The knobs~~ **Ruled: the RAM block count.** The offset is the VM's user RAM block count,
`BLK_RAM_BLOCKS - BLK_FORTH_SYS_RESERVED` (2048 today, `v3/include/block_subsystem.h:78-88`).
- It becomes a Kconfig symbol.
- The kernel reads it.
- `mkcapsule` is given it at build time in place of its literal 2048 (`:414`, `:1094`).
v4's node window (`V4_BLOCK_SLOTS`) is not the source of the offset.
4. ~~Where the pages land~~ **Ruled: at `n`, then copied down.**
- Each page is written to the block store at `n`, then copied to `n - R` for interpreting, where
R is the RAM block count (ruling 3).
- Block `n` is then free again.
- Asked about pages whose `n - R` falls outside the RAM (`Block 4096` lands at 2048 when R is
2048), Captain Bob ruled: **"Just copy down the specified blocks. Where they land will be
developers responsibility."** The loader does not check where a page lands. The one rule left
is that `n` is at least R (`mkcapsule`'s floor, from the knob).
5. ~~The range tables and `BLOCK_MAP.md`~~ **Ruled: "Map stays, tables go".**
- `BLOCK_MAP.md` stays, generated by `mkcapsule`, as a record of the numbers each capsule uses
("Blocks used", not "claimed"). Captain Bob: **"Block map is a convenience"**: an aid for
developers, with no authority and nothing checked against it.
- The range tables go from `experiments/bare_metal/README.md`, `.claude/CLAUDE.md` and
`capsules/README.md`. In their place: `n` is at least R, a later write overwrites, and where a
page lands is the developer's responsibility.
6. **Chaining.** Under "the lowest block first; the current block determines the next", only a
capsule's lowest page runs unless it chains. No capsule in the tree chains its pages today
(`forth79.4th` has 3 pages, `centre.4th` 7, v3's `init.4th` 3, none with `-->`, `LOAD` or
`THRU`). **Ruled: "No 'chaining' again developer responsible."**
- The loader interprets the capsule's lowest page and nothing more.
- A capsule that needs its other pages chains them itself (`-->`, `LOAD`, `THRU`).
- So each capsule in the tree is given its chaining when the loader changes, or only its lowest
page would run.
## 4. The work, for ruling (nothing built)
Each step is test first, then POST and the protocol:
1. **The knob. Built 2026-11-18:**
- `BLK_RAM_USER_BLOCKS` is in `Kconfig.kernel`, default 2048, defined in `v3/include/blk_layout.h`.
- `block_subsystem.h` derives `BLK_RAM_BLOCKS` (2080) and `BLK_DISK_START` from it.
- `kernel/Makefile` passes it to the kernel's C code, `mkcapsule` and `mkartemis`, and
`mkcapsule`'s two literal 2048s are the knob.
- Tested by `scripts/test_capsule_ram_blocks.sh`, 8 checks, in `logs/20261118-ram-blocks-knob/`.
The plan as written: `block_subsystem.h` and the kernel read
it, and `mkcapsule` is given it at build time in place of its literal 2048.
2. **`mkcapsule`. Built 2026-11-18** (rulings: overwrite within a capsule too, "consistent with
VOCABULARY FORGET & FENCE philosophy, not implementation"; of what only prevents collisions, "All of
it goes"):
- the cross-capsule collision gate is gone;
- so are `tools/capsule-reserved.txt` with its check, and the interactive resolver with its claim
registry;
- the map says "Blocks used", and marks a shared number "the later write overwrites";
- an unknown option is refused with the usage, so a removed mode is never taken for the capsules
directory.
A repeat within one capsule had no check to remove. Tested by `scripts/test_mkcapsule_overwrite.sh`,
9 checks, in `logs/20261118-mkcapsule-overwrite/`.
The plan as written:
- Its floor comes from the knob.
- Its cross-capsule collision check goes, since a later write overwrites.
- `BLOCK_MAP.md` says "Blocks used".
- Open: whether a number repeated within one capsule is still refused, or overwrites by the same
rule.
3. **The capsules chain their own pages.** Each multi-page capsule ends each page with `-->`, or has
its lowest page `THRU` the rest. That keeps it working under step 4.
4. **The loaders,** v4's `load()` and v3's `INIT`:
- each page is written to block `n`, then copied down to `n - R`;
- the lowest page is interpreted;
- nothing else is done.
5. **The documents.** The range tables go, and the rules take their place. `experiments/bare_metal/
README.md` rule 3 ("file order") goes.
## 5. `(-` marks a system blob (Captain Bob's idea, 2026-11-18; nothing built)
**The idea, as given:**
- `(-` is a special comment word, terminated by `)` like any `(` comment.
- It also "leaves behind the equivalent of a magic number".
- "The capsule loader can differentiate a 'system capsule' from any other capsule and it can be
diverted into 'please include in a kernel rom image'."
**What exists already:**
- **v3:** `(-` is a C word (`v3/src/word_source/starforth_words.c:274`) that skips to the matching
`)` and nests. Its own comment says it is "used for marking blocks that should be extracted to
init.4th", so v3 already meant it as a marker.
- **v4:** the same nesting comment, in `capsules/v4/physics.4th` block 8204.
- **POST:** v3's 4 cases for it pass in v4.
**As Captain Bob put it next, which supersedes the readings below** ("(- is more of a build
marker"):
- **It is per block.** "this particular block number": a block that opens with `(-` is marked.
- **At run time it loads verbatim,** like any block, "because it might be part of ongoing development
or a required dependency". `(-` is only the nesting comment there; there is no run-time magic
number.
- **At build it is a request to CI:** "asking the CI to consider this particular block number be
cleared for inclusion in the next iso image that qemu runs with".
- **What CI does with the request** (ruled): "Open ended stubs to be hooked into after we begin the
SDK later." So the stub is the record of the request, with nothing to act on it until the SDK.
**Kept:** `(-` nests, as now. v3's 4 POST cases are unchanged.
**Superseded** (kept as the record of how it was first understood):
- the magic number "both" at build and at run;
- the reading "per named blob";
- the targets (1) a new kernel ROM image and (3) the capsule directory of system blobs only.
The "kernel ROM image" is now "the next iso image that qemu runs with".
**Nothing is built.** When the SDK begins, the hook is to be designed against these lines.
## 6. Steps 3 and 4 for v4, built together (2026-11-18)
**Why together** (ruled "Together, v4 first"): v4's `-->` is error 14 outside a block load, so
capsule chaining added under the old line-streaming loader would have broken every boot.
**What is built:**
- **`v4_blocks_place_capsule`** (`v4/system/blocks.c`, `blocks.h`). Each `Block n` is copied to RAM
block `n - R` as 16 lines of 64 characters, padded with spaces, in any file order. A later block of
the same number overwrites. The lowest placed is given back, and a block below R is refused.
- **Every v4 loader places a capsule, then interprets `<lowest> LOAD`:**
- the mesh's `load()` (Hera's boot);
- the mesh's capsule reader (`CAPSULE-OPEN`/`(LINES)`, which is how `BIRTH` gives a child
`forth79.4th`);
- the hosted product's `boot.c`;
- `test_host_unit`'s model of the kernel.
`mkdictionary.py` types the capsules at the hosted prompt, and skips `-->` there.
- **The v4 capsules are renumbered into R..2R-1 and chained with `-->`.** They land at RAM 1900 and up,
away from POST's blocks 0–5:
| Capsule | Blocks |
|---|---|
| `forth79.4th` | 3948–3950 |
| `starshipos.4th` | 3956–3957 |
| `hera.4th` | 3960–3961 |
| `centre.4th` | 3964–3970 (it had a gap at 8103) |
| `physics.4th` | 3972–3976 |
**Test first:**
- `test_host_blocks.c` gained 6 placement checks (54 now). It failed to build before, with no
`v4_blocks_place_capsule`.
- `test_mesh_boot.c`: forth79.4th's lowest block is in RAM block 1900. It failed before, with block
1900 empty, and passes after (110 checks).
**Verified** (`logs/20261118-capsule-place/`):
- POST is 990/990;
- all 52 tests at 64 bits, test-32, `hosted-check` (three ISAs identical), and ASan/UBSan pass;
- the amd64 kernel builds;
- the dictionary check has 404 words, as before.
**v3's `INIT`** is the next step, as ruled.
**v3's `INIT` is kept as it is** (Captain Bob, 2026-11-18: "Yeah, keep"). v3 is not part of acceptance
and is being retired. Its loader still renumbers a capsule's blocks from 1, in file order, and runs
them all. The v3 capsules are not chained.

Some files were not shown because too many files have changed in this diff Show More