feat(kernel): Hera in the kernel's fabric and registry; centre.4th and hera.4th on her

#189, ENGINE step 4 Phase 1, Task 5a. Captain Bob, 2026-11-13: "Full
births now"; "Hera as now, in a fabric".

- sk_v4.c: the kernel's fabric (v4/fabric.h), Hera's node at its one
  place, entered in its registry (v4/manage.h) as node 10. The registry's
  answers are real: a birth is "no room" -- the fabric has one place
  until 5b; CAPSULE-OPEN/-LINE read the kernel's capsule directory,
  checked as the boot checks (no capsule of F18 code is there until 5b);
  a born node's parity line. She is not told her number: the boot's
  console addresses node 0 (told 10, the boot stopped after POST -- kept,
  labelled, logs/20261113-132712).
- boot.h/boot.c: v4_boot's `request` hook (the registry's requests) and
  `capsules` (the kernel's own, loaded before the seal, so POST runs on
  them). hosted.c sets neither: the hosted product's boot is as it was.
- kernel/Makefile: manage.c in the kernel's v4 engine.
- qemu_session.py: a v4 acceptance boot asks NODE-ME . and wants 0.
- v4-dictionary.tsv: the 55 words of centre.4th and hera.4th, written
  from their source and manage.h; mkdictionary.py loads the kernel's
  capsules into the hosted system before WORDS, so the live list is the
  kernel's -- 375 words.
- .claude/memory/rules.md, rule 6: every boot command under timeout 570.

Seen to fail first (logs/20261113-132410): NODE-ME was an unknown word.
After: amd64 NODE-ME . gives 0 ok; POST 539/539; word_count 375. v4
suite: test, test-32 99 programs 0 failures; v4-checks 79 under the
sanitizers 0 failures, the hosted builds alike.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
This commit is contained in:
Claude
2026-11-13 14:24:27 +00:00
parent c32cd04388
commit f10d2bc835
21 changed files with 348 additions and 24 deletions
+55
View File
@@ -321,3 +321,58 @@ XOR ( x1 x2 -- x3 ) Bitwise exclusive or.
[LITERAL] ( x -- ) Another name for LITERAL, as v3 has it.
\ ( -- ) \ text: a comment to the end of the line; immediate.
] ( -- ) Start compiling what follows.
(FAIL) ( -- ) A birth went wrong: print "BIRTH: node n did not do as it was told" and raise an error (centre.4th).
(JOIN) ( -- ) Join two outer nodes of a unit: port 3 of X to port 4 of Y, each told the other is there (centre.4th).
(KID#) ( -- addr ) Variable: the number of the node being born (centre.4th).
(KID) ( -- addr ) Variable: the place of the node being born (centre.4th).
(KIDC) ( -- addr ) Variable: the newborn node's own port that leads back to its parent (centre.4th).
(KIDP) ( -- addr ) Variable: this node's port that leads to the node being born (centre.4th).
(LINES) ( baddr u -- ) Send the newborn node the named capsule of FORTH blocks, a line at a time, each to be completed (centre.4th).
(N) ( k -- number ) The number of the unit's k-th outer node: the unit's number plus k (centre.4th).
(NO-NODE) ( n -- ) Drop n, print "no such node" and raise an error (hera.4th).
(NUCLEUS) ( -- ) Send the newborn node the system, the capsule of F18 code, cell by cell to its port (centre.4th).
(P1) ( -- addr ) Variable: the place of a unit's first outer node (centre.4th).
(P2) ( -- addr ) Variable: the place of a unit's second outer node (centre.4th).
(P3) ( -- addr ) Variable: the place of a unit's third outer node (centre.4th).
(P4) ( -- addr ) Variable: the place of a unit's fourth outer node (centre.4th).
(PERS#) ( -- addr ) Variable: the length of the newborn node's personality capsule's name; 0: none (centre.4th).
(PERS) ( -- addr ) Variable: the byte address of the newborn node's personality capsule's name (centre.4th).
(SAY) ( them port me -- ) Tell node me that the port, by its number, leads to node them, and that node them is its neighbour there (centre.4th).
(T#) ( -- addr ) Variable: how many characters of text for another node have been built in PAD (centre.4th).
(T) ( -- baddr u ) The text built in PAD for another node (centre.4th).
(T0) ( -- ) Begin building text for another node in PAD: empty (centre.4th).
(TC) ( c -- ) Add a character to the text being built in PAD (centre.4th).
(TELL) ( baddr u -- ) Send the newborn node the text to interpret, wait for how it ended, and fail the birth if it did not complete (centre.4th).
(THERE?) ( n -- n flag ) True if node n is live and is not Hera herself (hera.4th).
(TN) ( n -- ) Add a number and a space to the text being built in PAD (centre.4th).
(TOLD) ( how -- ) Fail the birth unless how is 1: the text completed (centre.4th).
(TS) ( baddr u -- ) Add a string to the text being built in PAD (centre.4th).
(U) ( -- addr ) Variable: the number of the unit being born; its outer nodes are this plus 1 to 4 (centre.4th).
(WHO) ( -- ) Tell the newborn node its number, where its printing goes, its default route and who is at its port back (centre.4th).
(X) ( place number -- ) Set X, the first of the two outer nodes (JOIN) joins (centre.4th).
(XN) ( -- addr ) Variable: X's number (centre.4th).
(XP) ( -- addr ) Variable: X's place (centre.4th).
(Y) ( place number -- ) Set Y, the second of the two outer nodes (JOIN) joins (centre.4th).
(YN) ( -- addr ) Variable: Y's number (centre.4th).
(YP) ( -- addr ) Variable: Y's place (centre.4th).
BIRTH ( number port childport -- place ) A node is born, numbered number, its port childport joined to this node's port: given the system and FORTH-79; its place.
BIRTH-AS ( number port childport baddr u -- place ) BIRTH, and given the capsule named by the string as its personality when u is not 0.
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.
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.
NODE-CHILD ( number i -- child | 0 ) The number of node number's i-th live child, or 0. A kernel request.
NODE-KILL ( number -- ) Hera only: remove the node; its children become hers. A kernel request; KILL is the word to use.
NODE-ME ( -- place ) This node's place: where it is in the kernel's fabric. A kernel request.
NODE-PARITY ( place number -- ) Record the parity of a node this one birthed, under the number it was born as. A kernel request.
NODE-PLACE ( number -- place | -1 ) The node's place in the kernel's fabric, or -1: not live. A kernel request.
NODE-SLEEP ( number -- ) Hera only: put the node to sleep. A kernel request; PAUSE is the word to use.
NODE-UNWIRE ( a pa -- ) Cut the wire on port pa of node a, this node or one it birthed. A kernel request.
NODE-WAKE ( number -- ) Hera only: wake the node. A kernel request; RESUME is the word to use.
NODE-WIRE ( a pa b pb -- flag ) Join port pa of node a to port pb of node b, each this node or one it birthed: true if done. A kernel request.
PAUSE ( n -- ) Hera only: put node n to sleep; it executes nothing until RESUME.
RESUME ( n -- ) Hera only: wake node n.
UNIT ( n -- ) Birth a unit: four outer nodes, n+1 to n+4, on ports 2 to 5 of this one, joined in a square.
UNIT-KILL ( n -- ) Hera only: remove node n's children, one by one, then n.
Can't render this file because it contains an unexpected character in line 10 and column 3.