Compare commits
48
Commits
29b99f90e6
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
058d78d1ea | ||
|
|
ab2141383c | ||
|
|
2783edbf89 | ||
|
|
4c7503f352 | ||
|
|
6ebe706351 | ||
|
|
a4f0beaac8 | ||
|
|
0825a4348f | ||
|
|
552d76595d | ||
|
|
3633e051a8 | ||
|
|
db0085d926 | ||
|
|
0234dc6baf | ||
|
|
78073f3112 | ||
|
|
9c7fa4f855 | ||
|
|
63e9966abc | ||
|
|
20918f9f09 | ||
|
|
9db364f7c7 | ||
|
|
5425d52cb1 | ||
|
|
6eecf0d2d7 | ||
|
|
65737e282f | ||
|
|
d5605eddb6 | ||
|
|
a9a8687fa5 | ||
|
|
43f8687f70 | ||
|
|
0522d77337 | ||
|
|
27ab2bce1e | ||
|
|
41befb0294 | ||
|
|
9039ce836d | ||
|
|
0a0be0cafd | ||
|
|
adcfadb7f7 | ||
|
|
1990a40f09 | ||
|
|
40e9773885 | ||
|
|
f7769c0e93 | ||
|
|
cf2a321807 | ||
|
|
0684cd8362 | ||
|
|
7cfcbf2b68 | ||
|
|
3945d3964a | ||
|
|
7422dc5319 | ||
|
|
33bd835474 | ||
|
|
998510757a | ||
|
|
bd8997ffdf | ||
|
|
dc3803ab47 | ||
|
|
84f119a1b3 | ||
|
|
d6b894769c | ||
|
|
cad8291478 | ||
|
|
57f556e645 | ||
|
|
9b114fff83 | ||
|
|
a1b26eacaf | ||
|
|
daf614285a | ||
|
|
4d64e677f5 |
+4
-1
@@ -315,7 +315,10 @@ for its tree -- any change outside the evidence after the run is stale, and the
|
|||||||
again. **One stage per foreground command is also a protocol**, and is how an agent runs it (the
|
again. **One stage per foreground command is also a protocol**, and is how an agent runs it (the
|
||||||
QEMU rule: never in the background): `scripts/nightly.sh protocol accept-amd64`, then
|
QEMU rule: never in the background): `scripts/nightly.sh protocol accept-amd64`, then
|
||||||
`accept-aarch64`, `accept-riscv64`, `accept-stick-high`, `test-32`, `proofs`, `images`, `docs`,
|
`accept-aarch64`, `accept-riscv64`, `accept-stick-high`, `test-32`, `proofs`, `images`, `docs`,
|
||||||
each its own command, then `scripts/nightly.sh protocol-report`. The tools: `make
|
each its own command, then `scripts/nightly.sh protocol-report`. **While a PR is open, commit locally and
|
||||||
|
push once** (#152, 2026-11-08): Gitea redoes the PR's patch test and diff statistics on every push to its
|
||||||
|
branch, and a burst of pushes with large log directories took it to 1.75 GiB. Its `app.ini` diff limits
|
||||||
|
(`MAX_GIT_DIFF_LINES` 300, `MAX_GIT_DIFF_FILES` 30) stop a runaway diff; one push keeps it to one test. The tools: `make
|
||||||
ARCH=amd64,aarch64,riscv64 init`, plus the HOL-Library heap the CI image has (`ci/runner-image`).
|
ARCH=amd64,aarch64,riscv64 init`, plus the HOL-Library heap the CI image has (`ci/runner-image`).
|
||||||
|
|
||||||
**v4 is the default build (Captain Bob, 2026-10-14: "v4 is the default build ... no, qemu to v4
|
**v4 is the default build (Captain Bob, 2026-10-14: "v4 is the default build ... no, qemu to v4
|
||||||
|
|||||||
@@ -175,3 +175,16 @@ So:
|
|||||||
sake.
|
sake.
|
||||||
- It is touched only to keep the gates that still run it green: the docs stage's dictionary check
|
- 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.
|
(`v4/tools/mkdictionary.py`) and `make -C v4 test`. Ruled "Keep the boot.c change", for that reason.
|
||||||
|
|
||||||
|
## Capsules, keys and trust (Captain Bob, 2026-11-20)
|
||||||
|
|
||||||
|
- **Never a throwaway CA or key**, for a test or anything else: "No throwaway. I never would want that,
|
||||||
|
it's a stupid idea." What needs a real signature is shown in CI, with the real key (#139, ruling 4).
|
||||||
|
- **The root CA's private key is on the CI server**, `/var/lib/starshipos-ca/root/`, beside its
|
||||||
|
certificate. Never mount or copy that directory anywhere. The root's public certificate is in the tree,
|
||||||
|
`ci/pki/starshipos-root-ca.pem`.
|
||||||
|
- **Capsules are becoming trains:** the v4 runtime engine (a `.f18a`) towing named blobs as rolling stock.
|
||||||
|
Each blob is signed by its author and hashed, and the capsule's `MANIFEST.md` holds each blob's hash.
|
||||||
|
Bona fide contributors get their own intermediate certificate under the StarshipOS root; casual users get
|
||||||
|
a snakeoil one, told apart by the chain to the root. For ADR step 4
|
||||||
|
(`docs/v4.0.0/plans/2026-11-20-capsule-trust.md`).
|
||||||
|
|||||||
@@ -75,13 +75,17 @@ jobs:
|
|||||||
if: failure()
|
if: failure()
|
||||||
run: scripts/nightly.sh diagnose # build only; the failed step stays the job's failure
|
run: scripts/nightly.sh diagnose # build only; the failed step stays the job's failure
|
||||||
|
|
||||||
|
# #184 (Captain Bob, 2026-11-20: "A warning only"): only what this run wrote is uploaded -- the logs and
|
||||||
|
# CSVs newer than its start, and the stages' output (scripts/nightly.sh run-logs) -- not every log in
|
||||||
|
# the tree. The upload is a copy for convenience, the evidence is committed: a failed upload is a
|
||||||
|
# warning (continue-on-error), and cannot turn a passing run red.
|
||||||
|
- name: This run's logs and DoE CSVs, gathered
|
||||||
|
if: always()
|
||||||
|
run: scripts/nightly.sh run-logs || true
|
||||||
- name: Keep the logs and DoE CSVs
|
- name: Keep the logs and DoE CSVs
|
||||||
if: always()
|
if: always()
|
||||||
|
continue-on-error: true
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: acceptance-logs-${{ github.run_number }}
|
name: acceptance-logs-${{ github.run_number }}
|
||||||
path: |
|
path: build/nightly/run-logs/
|
||||||
logs/
|
|
||||||
experiments/bare_metal/runs/
|
|
||||||
build/nightly/accept-*.txt
|
|
||||||
build/nightly/test-32.txt
|
|
||||||
|
|||||||
@@ -65,6 +65,9 @@ jobs:
|
|||||||
run: scripts/nightly.sh accept stick-high
|
run: scripts/nightly.sh accept stick-high
|
||||||
- name: Acceptance 32-bit build
|
- name: Acceptance 32-bit build
|
||||||
run: scripts/nightly.sh test-32
|
run: scripts/nightly.sh test-32
|
||||||
|
- name: A signed kernel refuses an unsigned capsule (#139)
|
||||||
|
if: always()
|
||||||
|
run: scripts/nightly.sh capsule-trust
|
||||||
|
|
||||||
- name: Images
|
- name: Images
|
||||||
run: scripts/nightly.sh images
|
run: scripts/nightly.sh images
|
||||||
@@ -98,11 +101,17 @@ jobs:
|
|||||||
if: failure()
|
if: failure()
|
||||||
run: scripts/nightly.sh diagnose # build only; the failed step stays the job's failure
|
run: scripts/nightly.sh diagnose # build only; the failed step stays the job's failure
|
||||||
|
|
||||||
|
# #184 (Captain Bob, 2026-11-20: "A warning only"): only what this run wrote is uploaded -- the logs and
|
||||||
|
# CSVs newer than its start, and the stages' output (scripts/nightly.sh run-logs) -- not every log in
|
||||||
|
# the tree. The upload is a copy for convenience, the evidence is committed: a failed upload is a
|
||||||
|
# warning (continue-on-error), and cannot turn a passing run red.
|
||||||
|
- name: This run's logs and DoE CSVs, gathered
|
||||||
|
if: always()
|
||||||
|
run: scripts/nightly.sh run-logs || true
|
||||||
- name: Keep the logs and DoE CSVs
|
- name: Keep the logs and DoE CSVs
|
||||||
if: always()
|
if: always()
|
||||||
|
continue-on-error: true
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: logs-${{ github.run_number }}
|
name: logs-${{ github.run_number }}
|
||||||
path: |
|
path: build/nightly/run-logs/
|
||||||
logs/
|
|
||||||
experiments/bare_metal/runs/
|
|
||||||
|
|||||||
@@ -111,11 +111,17 @@ jobs:
|
|||||||
if: failure()
|
if: failure()
|
||||||
run: scripts/nightly.sh diagnose # build only; the failed step stays the job's failure
|
run: scripts/nightly.sh diagnose # build only; the failed step stays the job's failure
|
||||||
|
|
||||||
|
# #184 (Captain Bob, 2026-11-20: "A warning only"): only what this run wrote is uploaded -- the logs and
|
||||||
|
# CSVs newer than its start, and the stages' output (scripts/nightly.sh run-logs) -- not every log in
|
||||||
|
# the tree. The upload is a copy for convenience, the evidence is committed: a failed upload is a
|
||||||
|
# warning (continue-on-error), and cannot turn a passing run red.
|
||||||
|
- name: This run's logs and DoE CSVs, gathered
|
||||||
|
if: always()
|
||||||
|
run: scripts/nightly.sh run-logs || true
|
||||||
- name: Keep the logs and DoE CSVs
|
- name: Keep the logs and DoE CSVs
|
||||||
if: always()
|
if: always()
|
||||||
|
continue-on-error: true
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: release-logs-${{ github.ref_name }}
|
name: release-logs-${{ github.ref_name }}
|
||||||
path: |
|
path: build/nightly/run-logs/
|
||||||
logs/
|
|
||||||
experiments/bare_metal/runs/
|
|
||||||
|
|||||||
@@ -20,6 +20,17 @@ config ENABLE_HOTWORDS_CACHE
|
|||||||
migration exists to collapse to one source of truth. Set to y
|
migration exists to collapse to one source of truth. Set to y
|
||||||
to enable; also gates L8 Jacquard's L1_heat_tracking bit.
|
to enable; also gates L8 Jacquard's L1_heat_tracking bit.
|
||||||
|
|
||||||
|
config WORD_PHYSICS
|
||||||
|
bool "Compudynamics on a v4 node's words: the loops at call and at each tick (WORD_PHYSICS)"
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
#189 Phase 7 Task 9 (Captain Bob, 2026-11-20, "A Kconfig switch"): a
|
||||||
|
word's heat, its decay, the rolling window, pipelining, inference and
|
||||||
|
L8, run by the kernel at every call and at every heartbeat tick. Off,
|
||||||
|
a word's calls are still counted and charged to the Stadium, and none
|
||||||
|
of the loops runs: the boot the acceptance checks are seen to fail
|
||||||
|
on. The revert, as OPCODE_PHYSICS is the opcodes'.
|
||||||
|
|
||||||
config OPCODE_PHYSICS
|
config OPCODE_PHYSICS
|
||||||
bool "Compudynamics on the 32 F18 opcodes as well as the words (OPCODE_PHYSICS)"
|
bool "Compudynamics on the 32 F18 opcodes as well as the words (OPCODE_PHYSICS)"
|
||||||
default y
|
default y
|
||||||
|
|||||||
@@ -278,7 +278,7 @@ INIT_PROOFS ?= 1
|
|||||||
INIT_COMMON := build-essential make git git-lfs python3 curl ca-certificates xz-utils \
|
INIT_COMMON := build-essential make git git-lfs python3 curl ca-certificates xz-utils \
|
||||||
xorriso mtools gdisk dosfstools fdisk \
|
xorriso mtools gdisk dosfstools fdisk \
|
||||||
qemu-user
|
qemu-user
|
||||||
INIT_DOCPKGS := pandoc latexmk texlive-xetex texlive-latex-base texlive-latex-recommended \
|
INIT_DOCPKGS := pandoc latexmk texlive-xetex texlive-latex-base texlive-latex-recommended texlive-science \
|
||||||
texlive-latex-extra texlive-pictures texlive-fonts-recommended lmodern \
|
texlive-latex-extra texlive-pictures texlive-fonts-recommended lmodern \
|
||||||
fonts-dejavu fonts-dejavu-extra doxygen graphviz
|
fonts-dejavu fonts-dejavu-extra doxygen graphviz
|
||||||
INIT_amd64 := qemu-system-x86 ovmf
|
INIT_amd64 := qemu-system-x86 ovmf
|
||||||
|
|||||||
+22
-15
@@ -29,10 +29,12 @@
|
|||||||
| `sdk.4th` | 5109, 5110, 5111, 5112, 5113, 5114, 5115 | `0x008fdbbb62c94a3a` | n/a |
|
| `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 |
|
| `turtle.4th` | 5100, 5101, 5102, 5103, 5104, 5105, 5106, 5107, 5108 | `0x4d470418ca543365` | n/a |
|
||||||
| `user-font-demo.4th` | 4200, 4201, 4202 | `0xce1fd7d1b581a56d` | n/a |
|
| `user-font-demo.4th` | 4200, 4201, 4202 | `0xce1fd7d1b581a56d` | n/a |
|
||||||
| `v4:centre.4th` | 3964, 3965, 3966, 3967, 3968, 3969, 3970 | `0xea5815290d56dff3` | n/a |
|
| `v4:ACL.4th` | 3984, 3985, 3986, 3987 | `0xdba5690fb0ee12a4` | n/a |
|
||||||
|
| `v4:centre.4th` | 3964, 3965, 3966, 3967, 3968, 3969, 3970 | `0x53b1e3df644e8e25` | n/a |
|
||||||
| `v4:forth79.4th` | 3948, 3949, 3950 | `0x4609d6ef54166ef8` | n/a |
|
| `v4:forth79.4th` | 3948, 3949, 3950 | `0x4609d6ef54166ef8` | n/a |
|
||||||
| `v4:hera.4th` | 3960, 3961 | `0x78730b1d6effe892` | n/a |
|
| `v4:hera.4th` | 3960, 3961 | `0x78730b1d6effe892` | n/a |
|
||||||
| `v4:physics.4th` | 3972, 3973, 3974, 3975, 3976 | `0x5b0195fc30828bde` | n/a |
|
| `v4:init.4th` | 3980 | `0x13fe8932fa4d2934` | n/a |
|
||||||
|
| `v4:physics.4th` | 3972, 3973, 3974, 3975, 3976 | `0xb26da18d35ce5a84` | n/a |
|
||||||
| `v4:starshipos.4th` | 3956, 3957 | `0x1734a8f4fe7483a5` | n/a |
|
| `v4:starshipos.4th` | 3956, 3957 | `0x1734a8f4fe7483a5` | n/a |
|
||||||
| `workload-0.4th` | 2200, 2201 | `0x93f86f60aeba8feb` | n/a |
|
| `workload-0.4th` | 2200, 2201 | `0x93f86f60aeba8feb` | n/a |
|
||||||
| `workload-1-lite.4th` | 5058, 5059 | `0x44a7a7e3176dcc8d` | n/a |
|
| `workload-1-lite.4th` | 5058, 5059 | `0x44a7a7e3176dcc8d` | n/a |
|
||||||
@@ -112,18 +114,23 @@
|
|||||||
| 3957 | `v4:starshipos.4th` | `0x1734a8f4fe7483a5` | ok |
|
| 3957 | `v4:starshipos.4th` | `0x1734a8f4fe7483a5` | ok |
|
||||||
| 3960 | `v4:hera.4th` | `0x78730b1d6effe892` | ok |
|
| 3960 | `v4:hera.4th` | `0x78730b1d6effe892` | ok |
|
||||||
| 3961 | `v4:hera.4th` | `0x78730b1d6effe892` | ok |
|
| 3961 | `v4:hera.4th` | `0x78730b1d6effe892` | ok |
|
||||||
| 3964 | `v4:centre.4th` | `0xea5815290d56dff3` | ok |
|
| 3964 | `v4:centre.4th` | `0x53b1e3df644e8e25` | ok |
|
||||||
| 3965 | `v4:centre.4th` | `0xea5815290d56dff3` | ok |
|
| 3965 | `v4:centre.4th` | `0x53b1e3df644e8e25` | ok |
|
||||||
| 3966 | `v4:centre.4th` | `0xea5815290d56dff3` | ok |
|
| 3966 | `v4:centre.4th` | `0x53b1e3df644e8e25` | ok |
|
||||||
| 3967 | `v4:centre.4th` | `0xea5815290d56dff3` | ok |
|
| 3967 | `v4:centre.4th` | `0x53b1e3df644e8e25` | ok |
|
||||||
| 3968 | `v4:centre.4th` | `0xea5815290d56dff3` | ok |
|
| 3968 | `v4:centre.4th` | `0x53b1e3df644e8e25` | ok |
|
||||||
| 3969 | `v4:centre.4th` | `0xea5815290d56dff3` | ok |
|
| 3969 | `v4:centre.4th` | `0x53b1e3df644e8e25` | ok |
|
||||||
| 3970 | `v4:centre.4th` | `0xea5815290d56dff3` | ok |
|
| 3970 | `v4:centre.4th` | `0x53b1e3df644e8e25` | ok |
|
||||||
| 3972 | `v4:physics.4th` | `0x5b0195fc30828bde` | ok |
|
| 3972 | `v4:physics.4th` | `0xb26da18d35ce5a84` | ok |
|
||||||
| 3973 | `v4:physics.4th` | `0x5b0195fc30828bde` | ok |
|
| 3973 | `v4:physics.4th` | `0xb26da18d35ce5a84` | ok |
|
||||||
| 3974 | `v4:physics.4th` | `0x5b0195fc30828bde` | ok |
|
| 3974 | `v4:physics.4th` | `0xb26da18d35ce5a84` | ok |
|
||||||
| 3975 | `v4:physics.4th` | `0x5b0195fc30828bde` | ok |
|
| 3975 | `v4:physics.4th` | `0xb26da18d35ce5a84` | ok |
|
||||||
| 3976 | `v4:physics.4th` | `0x5b0195fc30828bde` | ok |
|
| 3976 | `v4:physics.4th` | `0xb26da18d35ce5a84` | ok |
|
||||||
|
| 3980 | `v4:init.4th` | `0x13fe8932fa4d2934` | ok |
|
||||||
|
| 3984 | `v4:ACL.4th` | `0xdba5690fb0ee12a4` | ok |
|
||||||
|
| 3985 | `v4:ACL.4th` | `0xdba5690fb0ee12a4` | ok |
|
||||||
|
| 3986 | `v4:ACL.4th` | `0xdba5690fb0ee12a4` | ok |
|
||||||
|
| 3987 | `v4:ACL.4th` | `0xdba5690fb0ee12a4` | ok |
|
||||||
| 4000 | `ACL.4th` | `0xf8890c05c0d8f921` | ok |
|
| 4000 | `ACL.4th` | `0xf8890c05c0d8f921` | ok |
|
||||||
| 4001 | `ACL.4th` | `0xf8890c05c0d8f921` | ok |
|
| 4001 | `ACL.4th` | `0xf8890c05c0d8f921` | ok |
|
||||||
| 4002 | `ACL.4th` | `0xf8890c05c0d8f921` | ok |
|
| 4002 | `ACL.4th` | `0xf8890c05c0d8f921` | ok |
|
||||||
@@ -387,4 +394,4 @@
|
|||||||
| 5115 | `sdk.4th` | `0x008fdbbb62c94a3a` | ok |
|
| 5115 | `sdk.4th` | `0x008fdbbb62c94a3a` | ok |
|
||||||
|
|
||||||
---
|
---
|
||||||
*40 capsule(s) scanned. Re-run `mkcapsule --manifest <dir>` to refresh.*
|
*42 capsule(s) scanned. Re-run `mkcapsule --manifest <dir>` to refresh.*
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ Block 3973
|
|||||||
-32 KERNEL-WORD INFER-VARIANCE@ ( -- d )
|
-32 KERNEL-WORD INFER-VARIANCE@ ( -- d )
|
||||||
-33 KERNEL-WORD INFER-FIT@ ( -- d )
|
-33 KERNEL-WORD INFER-FIT@ ( -- d )
|
||||||
-34 KERNEL-WORD INFER-EARLY-EXIT@ ( -- flag )
|
-34 KERNEL-WORD INFER-EARLY-EXIT@ ( -- flag )
|
||||||
|
-41 KERNEL-WORD L8-CARD@ ( -- card changes )
|
||||||
|
-42 KERNEL-WORD L8-HOLD ( card -- ; -1: L8 chooses )
|
||||||
( v3's DECAY_RATE_PER_US_Q16, its compile-time constant )
|
( v3's DECAY_RATE_PER_US_Q16, its compile-time constant )
|
||||||
1 CONSTANT DECAY-RATE@
|
1 CONSTANT DECAY-RATE@
|
||||||
-->
|
-->
|
||||||
|
|||||||
@@ -59,6 +59,31 @@ ss -ltnp | grep 7681 # the ttyd of starshipos-demo, not
|
|||||||
|
|
||||||
The service expects the checkout's `demo/` at `/opt/starshipos-demo/demo` (step 1 put it there).
|
The service expects the checkout's `demo/` at `/opt/starshipos-demo/demo` (step 1 put it there).
|
||||||
|
|
||||||
|
**The transcripts (#192, ruled 2026-11-21: "Write-only drop box").** Each session writes what the
|
||||||
|
visitor typed and what the machine answered to `/var/lib/starshipos-demo-transcripts`, one file per
|
||||||
|
session, mode 0600 (`console.py`). The directory is yours, group `starshipos-demo`, mode 1730: a
|
||||||
|
session can add a file, but cannot list the directory or read anything in it. A root timer hands each
|
||||||
|
file to you and deletes every one older than 7 days (`transcripts-tidy.sh`). The Try it page says so.
|
||||||
|
Before (re)starting the service, with `OWNER` your own login:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
OWNER=<your login>
|
||||||
|
install -d -o "$OWNER" -g starshipos-demo -m 1730 /var/lib/starshipos-demo-transcripts
|
||||||
|
sed "s/^Environment=OWNER=CHANGE-ME$/Environment=OWNER=$OWNER/" \
|
||||||
|
demo/starshipos-demo-transcripts.service > /etc/systemd/system/starshipos-demo-transcripts.service
|
||||||
|
cp demo/starshipos-demo-transcripts.timer /etc/systemd/system/
|
||||||
|
systemctl daemon-reload && systemctl enable --now starshipos-demo-transcripts.timer
|
||||||
|
systemctl restart starshipos-demo # its unit now writes the transcripts directory
|
||||||
|
systemctl list-timers starshipos-demo-transcripts --no-pager
|
||||||
|
```
|
||||||
|
|
||||||
|
Then the check: open a session, type a line, close it; within 5 minutes its file is in
|
||||||
|
`/var/lib/starshipos-demo-transcripts`, owned by you, mode `-rw-------`, and `sudo -u
|
||||||
|
starshipos-demo ls /var/lib/starshipos-demo-transcripts` is refused. A file older than 7 days
|
||||||
|
(`touch -d '8 days ago' FILE.log`) is gone at the next run (`systemctl start
|
||||||
|
starshipos-demo-transcripts` runs it at once). Apache must not serve the directory: nothing in
|
||||||
|
`apache-demo.conf` maps it, and nothing should.
|
||||||
|
|
||||||
## 5. TLS and Apache for try.starshipos-f18.com (~10 min)
|
## 5. TLS and Apache for try.starshipos-f18.com (~10 min)
|
||||||
|
|
||||||
DNS: `try.starshipos-f18.com` must point at this server (an A record) before certbot.
|
DNS: `try.starshipos-f18.com` must point at this server (an A record) before certbot.
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ XWiki "Try it" page (iframe) -> Apache: TLS, websocket -> ttyd -> start-session.
|
|||||||
| `console.py` | Joins the visitor's terminal to the machine only once it runs, discarding keys typed while it loads |
|
| `console.py` | Joins the visitor's terminal to the machine only once it runs, discarding keys typed while it loads |
|
||||||
| `qemu-args.sh` | The machine, shared by the two above: a resumed machine must match the saved one exactly |
|
| `qemu-args.sh` | The machine, shared by the two above: a resumed machine must match the saved one exactly |
|
||||||
| `starshipos-demo.service` | ttyd as a systemd service, on localhost; two guests at once, a busy message for the rest (#114, #116) |
|
| `starshipos-demo.service` | ttyd as a systemd service, on localhost; two guests at once, a busy message for the rest (#114, #116) |
|
||||||
|
| `transcripts-tidy.sh` | Hands each session's transcript to its owner, mode 0600, and deletes those over 7 days (#192) |
|
||||||
|
| `starshipos-demo-transcripts.service`, `.timer` | Runs `transcripts-tidy.sh` as root every 5 minutes (#192) |
|
||||||
|
| `test_transcripts.py` | Tests the transcript and the tidy, with a stand-in machine: `python3 demo/test_transcripts.py` |
|
||||||
| `DEPLOY.md` | Putting it on the server, step by step |
|
| `DEPLOY.md` | Putting it on the server, step by step |
|
||||||
| `apache-demo.conf` | Example vhost: TLS, the websocket, framing allowed for the `.com` only (#115) |
|
| `apache-demo.conf` | Example vhost: TLS, the websocket, framing allowed for the `.com` only (#115) |
|
||||||
| `xwiki-try-it.xwiki` | The "Try it" page, its own page on the `.com` XWiki (`TryIt`), in the landing page's style |
|
| `xwiki-try-it.xwiki` | The "Try it" page, its own page on the `.com` XWiki (`TryIt`), in the landing page's style |
|
||||||
@@ -33,6 +36,10 @@ seccomp sandbox (no spawning, no privilege changes), as an unprivileged user, in
|
|||||||
that fences memory, CPU and the file system. A session lasts at most `DEMO_SESSION_LIMIT` seconds
|
that fences memory, CPU and the file system. A session lasts at most `DEMO_SESSION_LIMIT` seconds
|
||||||
(1800).
|
(1800).
|
||||||
|
|
||||||
|
What is kept: a transcript of each session -- what the visitor typed and what the machine answered
|
||||||
|
-- for up to 7 days, readable by the server's owner only, then deleted (#192; `DEPLOY.md`, step 4).
|
||||||
|
The Try it page and the session's first lines say so.
|
||||||
|
|
||||||
## Setting it up
|
## Setting it up
|
||||||
|
|
||||||
From a checkout of the most recent green commit -- the latest that passed acceptance, `master`
|
From a checkout of the most recent green commit -- the latest that passed acceptance, `master`
|
||||||
|
|||||||
@@ -10,6 +10,13 @@ A resumed machine takes a moment to load. Anything typed meanwhile would reach a
|
|||||||
whose state is about to be replaced, and be lost half-way through a line ("3 4 + ." arriving as
|
whose state is about to be replaced, and be lost half-way through a line ("3 4 + ." arriving as
|
||||||
"4 + ."). So: wait until QEMU says the machine is running, throw away what was typed before,
|
"4 + ."). So: wait until QEMU says the machine is running, throw away what was typed before,
|
||||||
say so, and only then pass bytes both ways. Ends when either side closes.
|
say so, and only then pass bytes both ways. Ends when either side closes.
|
||||||
|
|
||||||
|
The transcript (#192, ruled 2026-11-13 and 2026-11-21): what the machine sends -- its prompt, the visitor's
|
||||||
|
line as it echoes it, what it prints -- is also written to DEMO_TRANSCRIPTS
|
||||||
|
(/var/lib/starshipos-demo-transcripts), one file a session, named by its UTC start and this process, mode 0600.
|
||||||
|
The directory is a drop box this user can write in but not list or read (DEPLOY.md); transcripts-tidy.sh
|
||||||
|
hands each file to its owner and deletes it after 7 days. The Try It page says so. If it cannot be written,
|
||||||
|
the session goes on without one.
|
||||||
"""
|
"""
|
||||||
import json, os, select, socket, sys, termios, time, tty
|
import json, os, select, socket, sys, termios, time, tty
|
||||||
|
|
||||||
@@ -38,6 +45,14 @@ while True: # until the machine runs
|
|||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
|
||||||
con = connect(con_path)
|
con = connect(con_path)
|
||||||
|
transcript = None
|
||||||
|
try:
|
||||||
|
tdir = os.environ.get("DEMO_TRANSCRIPTS", "/var/lib/starshipos-demo-transcripts")
|
||||||
|
name = os.path.join(tdir, time.strftime("%Y%m%d-%H%M%S", time.gmtime()) + "-%d.log" % os.getpid())
|
||||||
|
transcript = os.open(name, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o600)
|
||||||
|
os.write(transcript, ("# StarshipOS demo session, %s UTC\n" % time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime())).encode())
|
||||||
|
except OSError:
|
||||||
|
transcript = None # no transcript, the session as before
|
||||||
stdin, stdout = sys.stdin.fileno(), sys.stdout.fileno()
|
stdin, stdout = sys.stdin.fileno(), sys.stdout.fileno()
|
||||||
saved = None
|
saved = None
|
||||||
if os.isatty(stdin):
|
if os.isatty(stdin):
|
||||||
@@ -56,7 +71,13 @@ try:
|
|||||||
data = con.recv(4096)
|
data = con.recv(4096)
|
||||||
if not data: break
|
if not data: break
|
||||||
os.write(stdout, data)
|
os.write(stdout, data)
|
||||||
|
if transcript is not None:
|
||||||
|
try: os.write(transcript, data)
|
||||||
|
except OSError: transcript = None
|
||||||
except OSError:
|
except OSError:
|
||||||
pass # the visitor's terminal went away
|
pass # the visitor's terminal went away
|
||||||
finally:
|
finally:
|
||||||
if saved: termios.tcsetattr(stdin, termios.TCSADRAIN, saved)
|
if saved: termios.tcsetattr(stdin, termios.TCSADRAIN, saved)
|
||||||
|
if transcript is not None:
|
||||||
|
os.write(transcript, ("\n# ended %s UTC\n" % time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime())).encode())
|
||||||
|
os.close(transcript)
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# starshipos-demo-transcripts.service -- the demo's transcripts (#192, ruled 2026-11-21: "Write-only drop box").
|
||||||
|
# Each session (console.py) writes its transcript, mode 0600, into /var/lib/starshipos-demo-transcripts:
|
||||||
|
# owned by Captain Bob, group starshipos-demo, mode 1730, so a session can add a file but not list or
|
||||||
|
# read the directory. This hands each file to the owner and deletes every one older than 7 days.
|
||||||
|
# Run by starshipos-demo-transcripts.timer. Set OWNER below to the owner's login (DEPLOY.md, step 4).
|
||||||
|
[Unit]
|
||||||
|
Description=StarshipOS demo transcripts: hand them to their owner, delete those over 7 days
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
Environment=OWNER=CHANGE-ME
|
||||||
|
ExecStart=/opt/starshipos-demo/demo/transcripts-tidy.sh /var/lib/starshipos-demo-transcripts ${OWNER}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# starshipos-demo-transcripts.timer -- runs starshipos-demo-transcripts.service every 5 minutes (#192).
|
||||||
|
[Unit]
|
||||||
|
Description=StarshipOS demo transcripts, every 5 minutes
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnBootSec=5min
|
||||||
|
OnUnitActiveSec=5min
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
||||||
@@ -14,6 +14,8 @@ Group=starshipos-demo
|
|||||||
Environment=DEMO_STATE=/var/lib/starshipos-demo
|
Environment=DEMO_STATE=/var/lib/starshipos-demo
|
||||||
Environment=DEMO_SESSION_LIMIT=1800
|
Environment=DEMO_SESSION_LIMIT=1800
|
||||||
Environment=DEMO_MAX_GUESTS=2
|
Environment=DEMO_MAX_GUESTS=2
|
||||||
|
# each session's transcript (console.py, #192): a write-only drop box, kept 7 days
|
||||||
|
Environment=DEMO_TRANSCRIPTS=/var/lib/starshipos-demo-transcripts
|
||||||
# the guests' slot locks (start-session.sh): /run/starshipos-demo, made for this user, gone at stop
|
# the guests' slot locks (start-session.sh): /run/starshipos-demo, made for this user, gone at stop
|
||||||
RuntimeDirectory=starshipos-demo
|
RuntimeDirectory=starshipos-demo
|
||||||
# --max-clients: the guests and a few more, so a visitor over the limit reaches the busy message
|
# --max-clients: the guests and a few more, so a visitor over the limit reaches the busy message
|
||||||
@@ -30,6 +32,7 @@ ProtectHome=yes
|
|||||||
PrivateTmp=yes
|
PrivateTmp=yes
|
||||||
PrivateDevices=yes
|
PrivateDevices=yes
|
||||||
ReadOnlyPaths=/var/lib/starshipos-demo
|
ReadOnlyPaths=/var/lib/starshipos-demo
|
||||||
|
ReadWritePaths=/var/lib/starshipos-demo-transcripts
|
||||||
# Sized for this server (3.8 GiB, two cores; both wikis, Gitea, Nexus, CI). Since #151 an idle guest
|
# Sized for this server (3.8 GiB, two cores; both wikis, Gitea, Nexus, CI). Since #151 an idle guest
|
||||||
# halts (1% of a core at the prompt, was 100%), so a session costs CPU only while its visitor runs
|
# halts (1% of a core at the prompt, was 100%), so a session costs CPU only while its visitor runs
|
||||||
# something. All sessions together get 1.5 cores at the lowest priority (Captain Bob, 2026-11-08):
|
# something. All sessions together get 1.5 cores at the lowest priority (Captain Bob, 2026-11-08):
|
||||||
|
|||||||
@@ -42,7 +42,8 @@ trap 'rm -rf "$tmp"' EXIT
|
|||||||
cp "$dir/vars.fd" "$tmp/vars.fd"
|
cp "$dir/vars.fd" "$tmp/vars.fd"
|
||||||
demo_qemu_args "$dir" "$tmp/vars.fd"
|
demo_qemu_args "$dir" "$tmp/vars.fd"
|
||||||
|
|
||||||
printf '\r\nStarshipOS -- starting a throwaway machine, yours for up to %d minutes. Nothing you do is kept.\r\n' $((limit / 60))
|
printf '\r\nStarshipOS -- starting a throwaway machine, yours for up to %d minutes. Nothing you do is kept on it.\r\n' $((limit / 60))
|
||||||
|
printf 'A transcript of this session is kept for up to 7 days, then deleted.\r\n'
|
||||||
printf 'Try: 3 4 + . : SQUARE DUP * ; 7 SQUARE .\r\n\r\n'
|
printf 'Try: 3 4 + . : SQUARE DUP * ; 7 SQUARE .\r\n\r\n'
|
||||||
# QEMU is a tracked child, not exec'd, so that whatever ends the session ends the machine: ttyd
|
# QEMU is a tracked child, not exec'd, so that whatever ends the session ends the machine: ttyd
|
||||||
# hangs up (it signals this script only), the service stops, or the time runs out. Its console is
|
# hangs up (it signals this script only), the service stops, or the time runs out. Its console is
|
||||||
|
|||||||
@@ -0,0 +1,80 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# SPDX-License-Identifier: LicenseRef-Starship-1.0
|
||||||
|
# Copyright (c) 2023-2026 Robert A. James
|
||||||
|
"""test_transcripts.py -- the demo's transcripts (#192, ruled 2026-11-13 and 2026-11-21): console.py writes each
|
||||||
|
session's console into DEMO_TRANSCRIPTS, one dated file a session, readable only by its writer; and
|
||||||
|
transcripts-tidy.sh hands each to the directory's owner and deletes those older than 7 days. No QEMU: a fake QMP
|
||||||
|
socket that says the machine runs, and a fake console that echoes. Prints PASS:/FAIL: and RESULT:."""
|
||||||
|
import json, os, socket, subprocess, sys, tempfile, threading, time, glob
|
||||||
|
|
||||||
|
HERE = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
ok = True
|
||||||
|
def check(what, cond):
|
||||||
|
global ok
|
||||||
|
print(("PASS: " if cond else "FAIL: ") + what)
|
||||||
|
ok = ok and bool(cond)
|
||||||
|
|
||||||
|
def qmp_server(path):
|
||||||
|
s = socket.socket(socket.AF_UNIX); s.bind(path); s.listen(1)
|
||||||
|
def run():
|
||||||
|
c, _ = s.accept(); f = c.makefile("rw")
|
||||||
|
f.write(json.dumps({"QMP": {}}) + "\n"); f.flush()
|
||||||
|
for line in f:
|
||||||
|
f.write(json.dumps({"return": {"status": "running"}} if "query-status" in line else {"return": {}}) + "\n"); f.flush()
|
||||||
|
threading.Thread(target=run, daemon=True).start()
|
||||||
|
|
||||||
|
def console_server(path):
|
||||||
|
s = socket.socket(socket.AF_UNIX); s.bind(path); s.listen(1)
|
||||||
|
def run():
|
||||||
|
c, _ = s.accept()
|
||||||
|
c.sendall(b"[zuse@Hera] ok> ")
|
||||||
|
while True:
|
||||||
|
d = c.recv(1024)
|
||||||
|
if not d: break
|
||||||
|
c.sendall(d) # the machine echoes
|
||||||
|
if b"\r" in d: c.sendall(b"7 ok\r\n[zuse@Hera] ok> ")
|
||||||
|
threading.Thread(target=run, daemon=True).start()
|
||||||
|
|
||||||
|
with tempfile.TemporaryDirectory() as t:
|
||||||
|
tr = os.path.join(t, "transcripts"); os.mkdir(tr, 0o730)
|
||||||
|
qmp_server(os.path.join(t, "qmp.sock")); console_server(os.path.join(t, "con.sock"))
|
||||||
|
env = dict(os.environ, DEMO_TRANSCRIPTS=tr)
|
||||||
|
p = subprocess.Popen([sys.executable, "-I", os.path.join(HERE, "console.py"), os.path.join(t, "qmp.sock"), os.path.join(t, "con.sock")],
|
||||||
|
stdin=subprocess.PIPE, stdout=subprocess.PIPE, env=env)
|
||||||
|
time.sleep(1.0); p.stdin.write(b"3 4 + .\r"); p.stdin.flush(); time.sleep(1.0); p.stdin.close()
|
||||||
|
out = p.stdout.read(); p.wait(timeout=10)
|
||||||
|
files = glob.glob(os.path.join(tr, "*.log"))
|
||||||
|
check("the visitor still sees the session: %r" % out[-40:], b"7 ok" in out)
|
||||||
|
check("one transcript for the session (%d)" % len(files), len(files) == 1)
|
||||||
|
if files:
|
||||||
|
f = files[0]; text = open(f, "rb").read()
|
||||||
|
check("named by its date, UTC: %s" % os.path.basename(f), os.path.basename(f)[:8].isdigit())
|
||||||
|
check("it holds what was typed, as the machine echoed it, and what it printed", b"3 4 + ." in text and b"7 ok" in text)
|
||||||
|
check("readable by its writer only (mode %o)" % (os.stat(f).st_mode & 0o777), os.stat(f).st_mode & 0o777 == 0o600)
|
||||||
|
# a directory it cannot write: the session goes on, without a transcript
|
||||||
|
ro = os.path.join(t, "nowhere")
|
||||||
|
env2 = dict(os.environ, DEMO_TRANSCRIPTS=ro)
|
||||||
|
os.unlink(os.path.join(t, "qmp.sock")); os.unlink(os.path.join(t, "con.sock"))
|
||||||
|
qmp_server(os.path.join(t, "qmp.sock")); console_server(os.path.join(t, "con.sock"))
|
||||||
|
p = subprocess.Popen([sys.executable, "-I", os.path.join(HERE, "console.py"), os.path.join(t, "qmp.sock"), os.path.join(t, "con.sock")],
|
||||||
|
stdin=subprocess.PIPE, stdout=subprocess.PIPE, env=env2)
|
||||||
|
time.sleep(1.0); p.stdin.write(b"3 4 + .\r"); p.stdin.flush(); time.sleep(1.0); p.stdin.close()
|
||||||
|
out = p.stdout.read(); p.wait(timeout=10)
|
||||||
|
check("with no directory to write in, the session still works", b"7 ok" in out)
|
||||||
|
|
||||||
|
# transcripts-tidy.sh: handed to the owner, the old deleted
|
||||||
|
box = os.path.join(t, "box"); os.mkdir(box)
|
||||||
|
new, old = os.path.join(box, "20261121-000000-1.log"), os.path.join(box, "20261101-000000-2.log")
|
||||||
|
for f in (new, old): open(f, "w").write("x"); os.chmod(f, 0o600)
|
||||||
|
eight_days = time.time() - 8 * 86400; os.utime(old, (eight_days, eight_days))
|
||||||
|
r = subprocess.run(["bash", os.path.join(HERE, "transcripts-tidy.sh"), box, "nobody"], capture_output=True, text=True)
|
||||||
|
check("the tidy succeeds: %s" % (r.stderr.strip() or "ok"), r.returncode == 0)
|
||||||
|
check("a transcript older than 7 days is deleted", not os.path.exists(old))
|
||||||
|
check("a newer one is kept", os.path.exists(new))
|
||||||
|
if os.path.exists(new):
|
||||||
|
import pwd
|
||||||
|
st = os.stat(new)
|
||||||
|
check("and handed to the directory's owner (%s), mode 600" % pwd.getpwuid(st.st_uid).pw_name,
|
||||||
|
pwd.getpwuid(st.st_uid).pw_name == "nobody" and st.st_mode & 0o777 == 0o600)
|
||||||
|
print("RESULT: " + ("PASS" if ok else "FAIL"))
|
||||||
|
sys.exit(0 if ok else 1)
|
||||||
Executable
+12
@@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# SPDX-License-Identifier: LicenseRef-Starship-1.0
|
||||||
|
# Copyright (c) 2023-2026 Robert A. James
|
||||||
|
# transcripts-tidy.sh DIR OWNER -- the demo's transcripts (#192): each handed to OWNER, mode 0600, so only OWNER
|
||||||
|
# reads it (the session's user wrote it, and cannot list the directory); every one older than 7 days deleted.
|
||||||
|
# Run as root by starshipos-demo-transcripts.timer every 5 minutes. Tests: demo/test_transcripts.py.
|
||||||
|
set -euo pipefail
|
||||||
|
dir=${1:?usage: transcripts-tidy.sh DIR OWNER}
|
||||||
|
owner=${2:?usage: transcripts-tidy.sh DIR OWNER}
|
||||||
|
[ -d "$dir" ] || { echo "transcripts-tidy: no $dir" >&2; exit 1; }
|
||||||
|
find "$dir" -maxdepth 1 -type f -name '*.log' -mmin +10080 -delete # 7 days
|
||||||
|
find "$dir" -maxdepth 1 -type f -name '*.log' ! -user "$owner" -exec chown "$owner:" {} + -exec chmod 0600 {} +
|
||||||
@@ -13,7 +13,8 @@ This is a real StarshipOS machine, started just for you and already at its promp
|
|||||||
simulation of StarshipOS and not a recording: the console below is the serial console of an
|
simulation of StarshipOS and not a recording: the console below is the serial console of an
|
||||||
amd64 machine running the same image the project publishes every night. You are logged in as
|
amd64 machine running the same image the project publishes every night. You are logged in as
|
||||||
**Zuse**, the superuser -- of a machine that exists only for your session. There is nothing to
|
**Zuse**, the superuser -- of a machine that exists only for your session. There is nothing to
|
||||||
break, and nothing you do is kept. Close the page and it is gone.
|
break, and nothing you do is kept on it. Close the page and it is gone. A transcript of your
|
||||||
|
session -- what you type and what the machine answers -- is kept for up to 7 days, then deleted.
|
||||||
|
|
||||||
{{html clean="false"}}
|
{{html clean="false"}}
|
||||||
<iframe src="https://try.starshipos-f18.com/" title="StarshipOS console"
|
<iframe src="https://try.starshipos-f18.com/" title="StarshipOS console"
|
||||||
|
|||||||
@@ -6847,3 +6847,39 @@ What the record asks beyond POST, each gap put to Captain Bob one at a time:
|
|||||||
tag"): PR #197 merges once its Acceptance passes, and a tag on `master` marks the line. New work starts
|
tag"): PR #197 merges once its Acceptance passes, and a tag on `master` marks the line. New work starts
|
||||||
after it.
|
after it.
|
||||||
|
|
||||||
|
|
||||||
|
## XLIX. Capsule trust: the intermediate is the anchor, and a signed kernel refuses an unsigned capsule (#139, 2026-11-20)
|
||||||
|
|
||||||
|
### 1. Found
|
||||||
|
|
||||||
|
XLVI left two things open (2026-11-07). The kernel does not check the image's signing certificate against
|
||||||
|
the StarshipOS Root CA. And an unsigned capsule (`CAPSULE_SIG_MISSING`) is only a warning, as ruled on
|
||||||
|
2026-08-26, when CI had no key. Since XLVI, CI signs every build, and the gate into master and a release
|
||||||
|
refuse an unsigned one (#174).
|
||||||
|
|
||||||
|
### 2. Ruled (Captain Bob, 2026-11-20; `docs/v4.0.0/plans/2026-11-20-capsule-trust.md`)
|
||||||
|
|
||||||
|
1. **"Intermediate is the anchor; no root check."** The "StarshipOS Capsule Signing" certificate in the
|
||||||
|
image (XLVI) is what capsules are trusted by. No root key goes in the kernel or in CI. First ruled
|
||||||
|
"verify at boot"; withdrawn when asked where CI would take the root's certificate from: "Actually we
|
||||||
|
decided to include an intermediate certificate in the kernel". On the way it was found that the root's
|
||||||
|
private key is on the CI server beside its certificate, in `/var/lib/starshipos-ca/root/` (mode 700),
|
||||||
|
so mounting that directory into CI jobs, one way to reach the certificate, would have exposed it.
|
||||||
|
2. **"Refuse on signed builds."** A kernel built with the signing key refuses an unsigned capsule. A
|
||||||
|
developer build, without the key, warns and boots.
|
||||||
|
3. **"NO_ROOT_KEY, by build."** A signing certificate missing from the image, or one that cannot be read,
|
||||||
|
is refused on a signed build and warned of on a developer build.
|
||||||
|
4. **"Left to CI."** The boot of a signed kernel with an unsigned capsule is CI's to show, since only CI
|
||||||
|
has the key.
|
||||||
|
|
||||||
|
### 3. Built
|
||||||
|
|
||||||
|
- `capsule_sig_refused()` (`kernel/src/capsule/capsule_sig.c`): the one decision. INVALID always;
|
||||||
|
MISSING and NO_ROOT_KEY on a signed build (`CAPSULE_SIGNED_BUILD`, set by `kernel/Makefile` and
|
||||||
|
`v4/Makefile` exactly when they sign). v4's boot and v3's three births ask it.
|
||||||
|
- `kernel/tests/test_capsule_sig.c`, built twice, unsigned and signed: written first, it did not build
|
||||||
|
without the function. It now passes 4 checks each way.
|
||||||
|
- `scripts/nightly.sh capsule-trust`, a step of `nightly.yml`: a signed build with `v4:centre.4th` left
|
||||||
|
unsigned (`CAPSULE_TEST_UNSIGN`, `scripts/capsule_unsign.py`, for the test only), booted on amd64. It
|
||||||
|
must say `missing (unsigned)` and stop with `POST: FAILED`, and give no prompt. It is not a protocol
|
||||||
|
stage, since a developer has no key. It is first seen in the nightly after this merges.
|
||||||
|
|||||||
@@ -208,6 +208,8 @@ IS ( xt -- ) IS xxx: make the deferred word xxx run xt; compiled when compiling.
|
|||||||
J ( -- n ) Compile-only: the index of the next outer DO loop.
|
J ( -- n ) Compile-only: the index of the next outer DO loop.
|
||||||
KERNEL-WORD ( n -- ) KERNEL-WORD xxx: define xxx, a word that asks the kernel to do request n (as BYE, BLOCK).
|
KERNEL-WORD ( n -- ) KERNEL-WORD xxx: define xxx, a word that asks the kernel to do request n (as BYE, BLOCK).
|
||||||
KEY ( -- c ) Wait for a key and leave its character.
|
KEY ( -- c ) Wait for a key and leave its character.
|
||||||
|
L8-CARD@ ( -- card changes ) L8's current card on this node, 0 to 63, and how many times it has changed: more than 0 once L8 has run.
|
||||||
|
L8-HOLD ( card -- ) Holds L8 on the card given, 0 to 63, its gates applied; -1 lets L8 choose again.
|
||||||
LATEST ( -- xt ) The newest entry of the CURRENT vocabulary.
|
LATEST ( -- xt ) The newest entry of the CURRENT vocabulary.
|
||||||
LEAVE ( -- ) Compile-only: leave the innermost DO loop at its next LOOP or +LOOP.
|
LEAVE ( -- ) Compile-only: leave the innermost DO loop at its next LOOP or +LOOP.
|
||||||
LFA ( xt -- addr ) The link field of the entry (>LINK).
|
LFA ( xt -- addr ) The link field of the entry (>LINK).
|
||||||
|
|||||||
|
Can't render this file because it contains an unexpected character in line 11 and column 3.
|
@@ -176,6 +176,9 @@ capsule-blocks.md` §5), and Artemis keeping what is kept (ruling 3).
|
|||||||
the train it imports from: (its capsule hash, the word's name). If that train is rebuilt or updated,
|
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
|
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.
|
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
|
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
|
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,
|
word, and every caller, compiled at run time or not, follows at once. The old code stays in place,
|
||||||
|
|||||||
@@ -67,6 +67,12 @@ Each hash is SHA-512 (choice 2).
|
|||||||
| 32–47 | the build configuration's hash: the knobs that change code, the cell width, `V4_NODE_WORDS`, the rings |
|
| 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 |
|
| 48–63 | the ROM's hash it must agree with: the tool's output is checked against the ROM's assembly |
|
||||||
|
|
||||||
|
**How each hash is taken** (ruled 2026-11-20, "Keep as drafted": plan 2026-11-19-f18-artifact-build §11,
|
||||||
|
choices 1 and 2). Each input is framed as its name, a NUL, its length in 8 bytes low first, then its
|
||||||
|
bytes, so two inputs cannot run together. The tool's hash covers its own sources and every `include/v4`
|
||||||
|
header, in a fixed order. The configuration's covers the sizes as text, framed as `config`, then the map.
|
||||||
|
The ROM's covers the ROM file. `v4/tools/f18a.h` names the files.
|
||||||
|
|
||||||
## 5. Exports, imports, relocations
|
## 5. Exports, imports, relocations
|
||||||
|
|
||||||
**An export (8 units):**
|
**An export (8 units):**
|
||||||
@@ -145,6 +151,10 @@ about the format:
|
|||||||
its list. Compatibility refuses a replacement that needs one the old did not (`ABI.md` §7). The list
|
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
|
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").
|
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
|
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
|
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.
|
built it. A big-endian host swaps the bytes when it places the code.
|
||||||
|
|||||||
+12
-9
@@ -6,10 +6,10 @@ the standard first -- FORTH-79, FORTH-83, ANS 1994 -- then v3's table, not v3's
|
|||||||
The cases are `v4/system/post_cases.c`; those of the words `capsules/v4/physics.4th` defines
|
The cases are `v4/system/post_cases.c`; those of the words `capsules/v4/physics.4th` defines
|
||||||
need the kernel and are not run by the hosted product.
|
need the kernel and are not run by the hosted product.
|
||||||
|
|
||||||
POST runs 990 cases. 783 are v3's, with what the hosted v3 binary did as the
|
POST runs 992 cases. 782 are v3's, with what the hosted v3 binary did as the
|
||||||
expected result. This file lists every other case, and why.
|
expected result. This file lists every other case, and why.
|
||||||
|
|
||||||
## 1. Rewritten: the standard's result, or v3's table's (159)
|
## 1. Rewritten: the standard's result, or v3's table's (160)
|
||||||
|
|
||||||
v3 departs from the standard, or the case is written for v3's machine. v4
|
v3 departs from the standard, or the case is written for v3's machine. v4
|
||||||
follows the standard (standing ruling), so the expected result is the
|
follows the standard (standing ruling), so the expected result is the
|
||||||
@@ -67,7 +67,7 @@ standard's and not v3's.
|
|||||||
| `UPDATE.no_block` | `0 SCR ! UPDATE` | error | unchanged | stack `empty`, prints nothing | v3 raises an error FORTH-79 does not ask for |
|
| `UPDATE.no_block` | `0 SCR ! UPDATE` | error | unchanged | stack `empty`, prints nothing | v3 raises an error FORTH-79 does not ask for |
|
||||||
| `SCR.after_load` | `1 LOAD SCR @ . CR` | stack `empty`, printed `1 \n` | unchanged | stack `empty`, prints `1 \n` | v3 prints nothing after 1 LOAD; SCR is still 1 from the LIST before |
|
| `SCR.after_load` | `1 LOAD SCR @ . CR` | stack `empty`, printed `1 \n` | unchanged | stack `empty`, prints `1 \n` | v3 prints nothing after 1 LOAD; SCR is still 1 from the LIST before |
|
||||||
| `FIND.existing` | `FIND DUP . CR` | stack `empty`, printed `7883424 \n` | unchanged | 0 value(s) left; output not compared | FORTH-79: FIND takes the next word, DUP here, and leaves its address, which is printed |
|
| `FIND.existing` | `FIND DUP . CR` | stack `empty`, printed `7883424 \n` | unchanged | 0 value(s) left; output not compared | FORTH-79: FIND takes the next word, DUP here, and leaves its address, which is printed |
|
||||||
| `FIND.user_word` | `: test5 44 ; FIND test5 . CR` | stack `empty`, printed `8206544 \n` | unchanged | 0 value(s) left; output not compared | the address FIND leaves is printed |
|
| `FIND.user_word` | `: test5 44 ; FIND test5 . CR` | stack `empty`, printed varies run to run | unchanged | 0 value(s) left; output not compared | the address FIND leaves is printed |
|
||||||
| `FIND.empty` | `FIND` | error | unchanged | stack `0`, prints nothing | FORTH-79: FIND leaves 0 when there is no word; v3 raises an error |
|
| `FIND.empty` | `FIND` | error | unchanged | stack `0`, prints nothing | FORTH-79: FIND leaves 0 when there is no word; v3 raises an error |
|
||||||
| `VOCABULARY.cross_vocab_access` | `VOCABULARY V1 V1 DEFINITIONS : V1WORD 11 ; FORTH V1WORD . CR` | stack `empty`, printed `11 \n` | unchanged | an error | FORTH-79: a word defined in another vocabulary is not found from FORTH; v3 finds it |
|
| `VOCABULARY.cross_vocab_access` | `VOCABULARY V1 V1 DEFINITIONS : V1WORD 11 ; FORTH V1WORD . CR` | stack `empty`, printed `11 \n` | unchanged | an error | FORTH-79: a word defined in another vocabulary is not found from FORTH; v3 finds it |
|
||||||
| `VOCABULARY.duplicate` | `VOCABULARY TESTVOC VOCABULARY TESTVOC` | error | unchanged | stack `empty`, prints nothing | v3 raises an error FORTH-79 does not ask for: defining a name again |
|
| `VOCABULARY.duplicate` | `VOCABULARY TESTVOC VOCABULARY TESTVOC` | error | unchanged | stack `empty`, prints nothing | v3 raises an error FORTH-79 does not ask for: defining a name again |
|
||||||
@@ -127,8 +127,8 @@ standard's and not v3's.
|
|||||||
| `LATEST.basic~2` | `LATEST @ . CR` | stack `empty`, printed `0 \n` | `LATEST 0<> . CR` | stack `empty`, prints `-1 \n` | v3's own word: v3 prints a value of its own machine (its DictEntry); the case as its description has it |
|
| `LATEST.basic~2` | `LATEST @ . CR` | stack `empty`, printed `0 \n` | `LATEST 0<> . CR` | stack `empty`, prints `-1 \n` | v3's own word: v3 prints a value of its own machine (its DictEntry); the case as its description has it |
|
||||||
| `LATEST.after_def` | `: test7 46 ; LATEST @ . CR` | stack `empty`, printed `0 \n` | `: test7 46 ; LATEST ' test7 = . CR` | stack `empty`, prints `-1 \n` | v3's own word: v3 prints a value of its own machine (its DictEntry); the case as its description has it |
|
| `LATEST.after_def` | `: test7 46 ; LATEST @ . CR` | stack `empty`, printed `0 \n` | `: test7 46 ; LATEST ' test7 = . CR` | stack `empty`, prints `-1 \n` | v3's own word: v3 prints a value of its own machine (its DictEntry); the case as its description has it |
|
||||||
| `LATEST.after_forget` | `CREATE test8 FORGET test8 LATEST @ . CR` | stack `empty`, printed `0 \n` | `LATEST CREATE test8 FORGET test8 LATEST = . CR` | stack `empty`, prints `-1 \n` | v3's own word: v3 prints a value of its own machine (its DictEntry); the case as its description has it |
|
| `LATEST.after_forget` | `CREATE test8 FORGET test8 LATEST @ . CR` | stack `empty`, printed `0 \n` | `LATEST CREATE test8 FORGET test8 LATEST = . CR` | stack `empty`, prints `-1 \n` | v3's own word: v3 prints a value of its own machine (its DictEntry); the case as its description has it |
|
||||||
| `>BODY.basic` | `CREATE test9 ' test9 >BODY . CR` | stack `empty`, printed `8207624 \n` | `CREATE test9 FIND test9 >BODY ' test9 = . CR` | stack `empty`, prints `-1 \n` | FORTH-83 >BODY takes a compilation address -- FORTH-79's FIND gives one; FORTH-79's ' gives the parameter field already, so v3's ' xxx >BODY goes one too far. v3 prints an address: the case shows >BODY's field is ''s (and VARIABLE's) |
|
| `>BODY.basic` | `CREATE test9 ' test9 >BODY . CR` | stack `empty`, printed varies run to run | `CREATE test9 FIND test9 >BODY ' test9 = . CR` | stack `empty`, prints `-1 \n` | FORTH-83 >BODY takes a compilation address -- FORTH-79's FIND gives one; FORTH-79's ' gives the parameter field already, so v3's ' xxx >BODY goes one too far. v3 prints an address: the case shows >BODY's field is ''s (and VARIABLE's) |
|
||||||
| `>BODY.variable` | `VARIABLE var1 ' var1 >BODY . CR` | stack `empty`, printed `8208136 \n` | `VARIABLE var1 FIND var1 >BODY var1 = . CR` | stack `empty`, prints `-1 \n` | FORTH-83 >BODY takes a compilation address -- FORTH-79's FIND gives one; FORTH-79's ' gives the parameter field already, so v3's ' xxx >BODY goes one too far. v3 prints an address: the case shows >BODY's field is ''s (and VARIABLE's) |
|
| `>BODY.variable` | `VARIABLE var1 ' var1 >BODY . CR` | stack `empty`, printed varies run to run | `VARIABLE var1 FIND var1 >BODY var1 = . CR` | stack `empty`, prints `-1 \n` | FORTH-83 >BODY takes a compilation address -- FORTH-79's FIND gives one; FORTH-79's ' gives the parameter field already, so v3's ' xxx >BODY goes one too far. v3 prints an address: the case shows >BODY's field is ''s (and VARIABLE's) |
|
||||||
| `ORDER.basic` | `ORDER` | stack `empty`, printed `Search order: (FIND)\nCurrent: (FIND)\n` | unchanged | stack `empty`, prints `Search order: FORTH \nCurrent: FORTH\n` | ANS Forth 16.6.2.1985 ORDER: the form is the system's; v3 names FORTH '(FIND)' -- v4's form with v4's names |
|
| `ORDER.basic` | `ORDER` | stack `empty`, printed `Search order: (FIND)\nCurrent: (FIND)\n` | unchanged | stack `empty`, prints `Search order: FORTH \nCurrent: FORTH\n` | ANS Forth 16.6.2.1985 ORDER: the form is the system's; v3 names FORTH '(FIND)' -- v4's form with v4's names |
|
||||||
| `ORDER.multiple` | `VOCABULARY TEST-VOC9 TEST-VOC9 DEFINITIONS ORDER` | stack `empty`, printed `Search order: TEST-VOC9 (FIND)\nCurrent:` | unchanged | stack `empty`, prints `Search order: TEST-VOC9 FORTH\nCurrent: TEST-VOC9\n` | ANS Forth 16.6.2.1985 ORDER: the form is the system's; v3 names FORTH '(FIND)' -- v4's form with v4's names |
|
| `ORDER.multiple` | `VOCABULARY TEST-VOC9 TEST-VOC9 DEFINITIONS ORDER` | stack `empty`, printed `Search order: TEST-VOC9 (FIND)\nCurrent:` | unchanged | stack `empty`, prints `Search order: TEST-VOC9 FORTH\nCurrent: TEST-VOC9\n` | ANS Forth 16.6.2.1985 ORDER: the form is the system's; v3 names FORTH '(FIND)' -- v4's form with v4's names |
|
||||||
| `ORDER.after_forth` | `TEST-VOC9 FORTH ORDER` | stack `empty`, printed `Search order: (FIND)\nCurrent: (FIND)\n` | unchanged | stack `empty`, prints `Search order: FORTH \nCurrent: FORTH\n` | ANS Forth 16.6.2.1985 ORDER: the form is the system's; v3 names FORTH '(FIND)' -- v4's form with v4's names |
|
| `ORDER.after_forth` | `TEST-VOC9 FORTH ORDER` | stack `empty`, printed `Search order: (FIND)\nCurrent: (FIND)\n` | unchanged | stack `empty`, prints `Search order: FORTH \nCurrent: FORTH\n` | ANS Forth 16.6.2.1985 ORDER: the form is the system's; v3 names FORTH '(FIND)' -- v4's form with v4's names |
|
||||||
@@ -138,12 +138,13 @@ standard's and not v3's.
|
|||||||
| `FROZEN?.not_found` | `S" __nonexistent_freeze_xyz__" FROZEN? . CR` | stack `empty`, printed `7229 \n` | unchanged | stack `empty`, prints `0 \n` | v3 prints a number its table's description does not ask for; the description's value |
|
| `FROZEN?.not_found` | `S" __nonexistent_freeze_xyz__" FROZEN? . CR` | stack `empty`, printed `7229 \n` | unchanged | stack `empty`, prints `0 \n` | v3 prints a number its table's description does not ask for; the description's value |
|
||||||
| `HEAT!.basic` | `: __heat_store_test_word__ ; 999 S" __heat_store_test_word__" HEAT! S" __heat_store_test_word__" HEAT@ . CR` | stack `empty`, printed `7289 \n` | unchanged | stack `empty`, prints `999 \n` | v3 prints a number its table's description does not ask for; the description's value |
|
| `HEAT!.basic` | `: __heat_store_test_word__ ; 999 S" __heat_store_test_word__" HEAT! S" __heat_store_test_word__" HEAT@ . CR` | stack `empty`, printed `7289 \n` | unchanged | stack `empty`, prints `999 \n` | v3 prints a number its table's description does not ask for; the description's value |
|
||||||
| `HEAT@.of_fresh_word` | `: __heat_fetch_test_word__ ; S" __heat_fetch_test_word__" HEAT@ . CR` | stack `empty`, printed `7328 \n` | unchanged | stack `empty`, prints `0 \n` | v3 prints a number its table's description does not ask for; the description's value |
|
| `HEAT@.of_fresh_word` | `: __heat_fetch_test_word__ ; S" __heat_fetch_test_word__" HEAT@ . CR` | stack `empty`, printed `7328 \n` | unchanged | stack `empty`, prints `0 \n` | v3 prints a number its table's description does not ask for; the description's value |
|
||||||
|
| `ENTROPY!.overwrite` | `: ENTOV ; 10 ' ENTOV ENTROPY! 20 ' ENTOV ENTROPY! ' ENTOV ENTROPY@ . CR` | stack `empty`, printed varies run to run | unchanged | stack `empty`, prints `20 \n` | the second ENTROPY! overwrites the first: 20. v3's run printed 20 or 0, as its heartbeat cooled the word between the lines in real time |
|
||||||
| `DECAY-RATE@.basic` | `DECAY-RATE@ . CR` | stack `empty`, printed `0 \n` | unchanged | stack `empty`, prints `1 \n` | v3's own word: the build's DECAY_RATE_PER_US_Q16, 1 by default (v3/Makefile, Kconfig.physics); the v3 that made the table was built with 0 |
|
| `DECAY-RATE@.basic` | `DECAY-RATE@ . CR` | stack `empty`, printed `0 \n` | unchanged | stack `empty`, prints `1 \n` | v3's own word: the build's DECAY_RATE_PER_US_Q16, 1 by default (v3/Makefile, Kconfig.physics); the v3 that made the table was built with 0 |
|
||||||
| `Q.VARIANCE.three_cells` | `100 HERE ! 200 HERE 8 + ! 300 HERE 16 + ! HERE 3 Q.VARIANCE Q.TO-INT . CR` | stack `empty`, printed `6666 \n` | `100 HERE ! 200 HERE 1 + ! 300 HERE 2 + ! HERE 3 Q.VARIANCE Q.TO-INT . CR` | stack `empty`, prints `6666 \n` | v3's address unit is a byte in 8-byte cells; v4's is a cell (D-1): the case in v4's units, a byte address 4 * a cell's |
|
| `Q.VARIANCE.three_cells` | `100 HERE ! 200 HERE 8 + ! 300 HERE 16 + ! HERE 3 Q.VARIANCE Q.TO-INT . CR` | stack `empty`, printed `6666 \n` | `100 HERE ! 200 HERE 1 + ! 300 HERE 2 + ! HERE 3 Q.VARIANCE Q.TO-INT . CR` | stack `empty`, prints `6666 \n` | v3's address unit is a byte in 8-byte cells; v4's is a cell (D-1): the case in v4's units, a byte address 4 * a cell's |
|
||||||
| `INFER-DECAY-SLOPE.three_cells` | `300 HERE ! 200 HERE 8 + ! 100 HERE 16 + ! HERE 3 INFER-DECAY-SLOPE Q.TO-INT . CR` | stack `empty`, printed `0 \n` | `300 HERE ! 200 HERE 1 + ! 100 HERE 2 + ! HERE 3 INFER-DECAY-SLOPE Q.TO-INT . CR` | stack `empty`, prints `0 \n` | v3's address unit is a byte in 8-byte cells; v4's is a cell (D-1): the case in v4's units, a byte address 4 * a cell's |
|
| `INFER-DECAY-SLOPE.three_cells` | `300 HERE ! 200 HERE 8 + ! 100 HERE 16 + ! HERE 3 INFER-DECAY-SLOPE Q.TO-INT . CR` | stack `empty`, printed `0 \n` | `300 HERE ! 200 HERE 1 + ! 100 HERE 2 + ! HERE 3 INFER-DECAY-SLOPE Q.TO-INT . CR` | stack `empty`, prints `0 \n` | v3's address unit is a byte in 8-byte cells; v4's is a cell (D-1): the case in v4's units, a byte address 4 * a cell's |
|
||||||
| `INFER-VARIANCE@.after_run` | `INFER-RUN INFER-VARIANCE@ Q.TO-INT . CR` | stack `empty`, printed `39 \n` | `INFER-RUN INFER-VARIANCE@ Q.TO-INT DROP CR` | stack `empty`, prints `\n` | the value comes of the run's own history, the same on no two runs or machines: the case as its description has it ('no error') |
|
| `INFER-VARIANCE@.after_run` | `INFER-RUN INFER-VARIANCE@ Q.TO-INT . CR` | stack `empty`, printed varies run to run | `INFER-RUN INFER-VARIANCE@ Q.TO-INT DROP CR` | stack `empty`, prints `\n` | the value comes of the run's own history, the same on no two runs or machines: the case as its description has it ('no error') |
|
||||||
| `INFER-WINDOW@.after_run` | `INFER-RUN INFER-WINDOW@ . CR` | stack `empty`, printed `0 \n` | `INFER-RUN INFER-WINDOW@ DROP CR` | stack `empty`, prints `\n` | the value comes of the run's own history, the same on no two runs or machines: the case as its description has it ('no error') |
|
| `INFER-WINDOW@.after_run` | `INFER-RUN INFER-WINDOW@ . CR` | stack `empty`, printed varies run to run | `INFER-RUN INFER-WINDOW@ DROP CR` | stack `empty`, prints `\n` | the value comes of the run's own history, the same on no two runs or machines: the case as its description has it ('no error') |
|
||||||
| `INFER-EARLY-EXIT@.after_run` | `INFER-RUN INFER-EARLY-EXIT@ . CR` | stack `empty`, printed `0 \n` | `INFER-RUN INFER-EARLY-EXIT@ DUP 0= SWAP 1 = OR . CR` | stack `empty`, prints `-1 \n` | the value comes of the run's own history, the same on no two runs or machines: the case as its description has it ('no error') (0 or 1) |
|
| `INFER-EARLY-EXIT@.after_run` | `INFER-RUN INFER-EARLY-EXIT@ . CR` | stack `empty`, printed varies run to run | `INFER-RUN INFER-EARLY-EXIT@ DUP 0= SWAP 1 = OR . CR` | stack `empty`, prints `-1 \n` | the value comes of the run's own history, the same on no two runs or machines: the case as its description has it ('no error') (0 or 1) |
|
||||||
| `Q.1.raw_value` | `Q.1 . CR` | stack `empty`, printed `65536 \n` | `Q.1 D. CR` | stack `empty`, prints `65536 \n` | Q48.16 on v4 is a double, low cell then high (ruled 2026-11-14): its raw value printed with D. |
|
| `Q.1.raw_value` | `Q.1 . CR` | stack `empty`, printed `65536 \n` | `Q.1 D. CR` | stack `empty`, prints `65536 \n` | Q48.16 on v4 is a double, low cell then high (ruled 2026-11-14): its raw value printed with D. |
|
||||||
| `Q.0.raw_value` | `Q.0 . CR` | stack `empty`, printed `0 \n` | `Q.0 D. CR` | stack `empty`, prints `0 \n` | Q48.16 on v4 is a double, low cell then high (ruled 2026-11-14): its raw value printed with D. |
|
| `Q.0.raw_value` | `Q.0 . CR` | stack `empty`, printed `0 \n` | `Q.0 D. CR` | stack `empty`, prints `0 \n` | Q48.16 on v4 is a double, low cell then high (ruled 2026-11-14): its raw value printed with D. |
|
||||||
| `Q.SCALE.raw_value` | `Q.SCALE . CR` | stack `empty`, printed `65536 \n` | `Q.SCALE D. CR` | stack `empty`, prints `65536 \n` | Q48.16 on v4 is a double, low cell then high (ruled 2026-11-14): its raw value printed with D. |
|
| `Q.SCALE.raw_value` | `Q.SCALE . CR` | stack `empty`, printed `65536 \n` | `Q.SCALE D. CR` | stack `empty`, prints `65536 \n` | Q48.16 on v4 is a double, low cell then high (ruled 2026-11-14): its raw value printed with D. |
|
||||||
@@ -206,7 +207,7 @@ printed unless an address is printed; the values are not.
|
|||||||
| `LIST.basic` | `1 LIST` | values left only |
|
| `LIST.basic` | `1 LIST` | values left only |
|
||||||
| `SCR.after_list` | `1 LIST SCR @ . CR` | values left only |
|
| `SCR.after_list` | `1 LIST SCR @ . CR` | values left only |
|
||||||
|
|
||||||
## 3. Written by hand (28)
|
## 3. Written by hand (30)
|
||||||
|
|
||||||
For required words v3 has no case for. The expected results are the
|
For required words v3 has no case for. The expected results are the
|
||||||
standard's; no v3 run stands behind them.
|
standard's; no v3 run stands behind them.
|
||||||
@@ -241,6 +242,8 @@ standard's; no v3 run stands behind them.
|
|||||||
| `WORD.delimiter` | `: W2 44 WORD COUNT TYPE ; W2 A B,` | stack `empty`, prints `A B` |
|
| `WORD.delimiter` | `: W2 44 WORD COUNT TYPE ; W2 A B,` | stack `empty`, prints `A B` |
|
||||||
| `WORD.count` | `: W3 BL WORD C@ . ; W3 ABC` | stack `empty`, prints `3 ` |
|
| `WORD.count` | `: W3 BL WORD C@ . ; W3 ABC` | stack `empty`, prints `3 ` |
|
||||||
| `WORD.skips_leading` | `: W4 BL WORD COUNT TYPE ; W4 X` | stack `empty`, prints `X` |
|
| `WORD.skips_leading` | `: W4 BL WORD COUNT TYPE ; W4 X` | stack `empty`, prints `X` |
|
||||||
|
| `L8-CARD@.basic` | `L8-CARD@ 0< . 64 U< . CR` | stack `empty`, prints `0 -1 \n` |
|
||||||
|
| `L8-HOLD.basic` | `18 L8-HOLD L8-CARD@ DROP . -1 L8-HOLD CR` | stack `empty`, prints `18 \n` |
|
||||||
|
|
||||||
## 4. v3 cases left out (52)
|
## 4. v3 cases left out (52)
|
||||||
|
|
||||||
|
|||||||
@@ -515,6 +515,23 @@ it.
|
|||||||
- There is no decay, rolling window, pipelining, inference, L8, heartbeat
|
- There is no decay, rolling window, pipelining, inference, L8, heartbeat
|
||||||
or Stadium wire on the node.
|
or Stadium wire on the node.
|
||||||
|
|
||||||
|
*Corrected 2026-11-20 (#189; ENGINE step 4 Phase 7, `plans/2026-11-13-engine-step4-phase7-the-loops-and-parity.md`).*
|
||||||
|
Section 2.2 was true of the lone node of 2026-10-07. It no longer is of v4 in its place in the system. The
|
||||||
|
kernel keeps every word's record (Phase 2) and runs v3's loops on it, at `call` and on the one heartbeat
|
||||||
|
(Phase 7, Tasks 1 to 4):
|
||||||
|
- L1: heat;
|
||||||
|
- L2: the rolling window;
|
||||||
|
- L3: decay, on touch and in the background;
|
||||||
|
- L4: pipelining and the hot-words cache, behind `ENABLE_PIPELINING` and `ENABLE_HOTWORDS_CACHE`, off as in v3;
|
||||||
|
- L5 and L6: inference;
|
||||||
|
- L7: the adaptive heartbeat, the kernel's one heartbeat (2026-11-17);
|
||||||
|
- L8: the Jacquard selector.
|
||||||
|
|
||||||
|
The loops also run on the 32 opcodes (`OPCODE_PHYSICS`). The words of `physics.4th` read and set them, among
|
||||||
|
them `L8-CARD@` and `L8-HOLD` (Task 9). Each acceptance boot asserts L1, L3, L2 with L5, and L8 at the
|
||||||
|
prompt (`scripts/qemu_session.py`, `loops()`), and `WORD_PHYSICS=0`, the revert, fails acceptance at POST.
|
||||||
|
The call-target count of `heat.c` described above is still there, beside the kernel's records.
|
||||||
|
|
||||||
### 2.3 What the v4 design documents say
|
### 2.3 What the v4 design documents say
|
||||||
|
|
||||||
The documents ruled on 2026-10-01 do not say "as v3". They say:
|
The documents ruled on 2026-10-01 do not say "as v3". They say:
|
||||||
|
|||||||
@@ -213,8 +213,58 @@ Phase 4).
|
|||||||
**Done 2026-11-14** (`POST-PARITY.md` section 6): 990 cases, all pass on Hera; each case rewritten is
|
**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.
|
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
|
### Task 9: acceptance -- the full protocol; ENGINE.md, V3-PARITY.md, FABRIC-3
|
||||||
|
**Designed 2026-11-20, for ruling** (#189's last two items: "Acceptance asserts it on the three architectures
|
||||||
|
and the stick -- a boot without the physics fails", and "V3-PARITY.md section 2 and #4 say what is now
|
||||||
|
built"). Nothing here is built.
|
||||||
|
|
||||||
Each task gets its steps when the one before it is accepted, test first, as Phase 2's did.
|
What a boot shows today: the heartbeat ticking, the Stadium conserved, Hera's words admitted after POST
|
||||||
|
(`scripts/qemu_session.py`, every acceptance boot). Nothing there fails if a word's heat, its decay, the
|
||||||
|
window, inference or L8 did not run: those are seen in `test_mesh_boot` on the host only.
|
||||||
|
|
||||||
|
The words of Task 4 read them at the prompt, on the real boot, so the session can ask. The steps:
|
||||||
|
1. **Test first: a build without the physics.** `OPCODE_PHYSICS=0` takes out only the opcodes' loops, so
|
||||||
|
it is not the case. The check is seen to fail on a boot whose per-call hook does nothing: a
|
||||||
|
one-line stub, in a diagnostic build only, never committed in the tree that ships.
|
||||||
|
2. **The checks, in the v4 session of `qemu_session.py`,** after the prompt, each a line typed and its
|
||||||
|
answer matched:
|
||||||
|
- L1, heat: a word defined and called three times. `' W HEAT@ .` is more than 0.
|
||||||
|
- L3, decay: `HEAT!` sets a word's heat; after a set number of heartbeat ticks, `HEAT@` is less.
|
||||||
|
- L2 and L5, the window and inference: after a workload, `INFER-RUN INFER-WINDOW@ .` is not 0.
|
||||||
|
- L8: no word reads the card today. See the open questions.
|
||||||
|
Each value is measured on the three architectures first, and the matches are written from what the
|
||||||
|
boots print, not guessed.
|
||||||
|
3. **The record:** `V3-PARITY.md` section 2.2 corrected, dated, to what is built (it says "There is no
|
||||||
|
decay, rolling window, pipelining, inference, L8, heartbeat or Stadium wire on the node"), and #4 told.
|
||||||
|
4. **The protocol** on the result: four boots, test-32, the proofs, the images, the documents.
|
||||||
|
|
||||||
|
**Ruled 2026-11-20, one at a time:**
|
||||||
|
1. **The loops asserted: "L1, L3, L2/L5, L8".** Heat, decay, the window and inference, and L8: every loop v4
|
||||||
|
carries, seen on the real boot on the three architectures and the stick. Asked: those, or a smaller set
|
||||||
|
with the rest left to `test_mesh_boot`.
|
||||||
|
2. **L8: "A word, L8-CARD@".** A kernel request, as Task 4's words are, in `physics.4th`. It leaves the node's
|
||||||
|
current card number. It gets a POST case, and the session checks that it is one of the table's cards
|
||||||
|
after a workload. Asked: a word, a line the kernel prints, or L8 left to the host test.
|
||||||
|
**2a, ruled 2026-11-20: "L8-CARD@ leaves card and changes".** `( -- card changes )`. The check is that the
|
||||||
|
card is one of the table's and that changes is more than 0 after a workload. The card alone could not
|
||||||
|
fail: L8 starts on card 8, and with the physics off it never runs, so the card stays 8, which is one of
|
||||||
|
the table's. With the physics on, UCB1 tries each untried card once, and the kernel counts each change
|
||||||
|
(`v4_mesh_l8.changes`).
|
||||||
|
3. **The boot without the physics: "A Kconfig switch".** `WORD_PHYSICS` (default y), beside `OPCODE_PHYSICS`,
|
||||||
|
turns the per-call and per-tick word loops off. It is a real revert, as ruling 7's is. The session's
|
||||||
|
checks are seen to fail on `WORD_PHYSICS=0`, and pass on the boot as built. Step 1 above, the stub, is
|
||||||
|
replaced by this. Asked: that, or a one-off stub in a diagnostic build.
|
||||||
|
**3a, ruled 2026-11-20: "POST's failure is enough".** A `WORD_PHYSICS=0` boot fails acceptance at POST
|
||||||
|
(amd64, `logs/20261120-task9/amd64-nophysics.txt`): its `ENTROPY@` cases need a word's heat. So it
|
||||||
|
never reaches the prompt, and every loop check fails with it, but not one at a time. The checks are
|
||||||
|
then measured and passed on the boot as built. Nothing in POST changes. Asked: that, POST's physics
|
||||||
|
cases skipped under `WORD_PHYSICS=0`, or each loop failed by holding L8 on cards that turn it off.
|
||||||
|
**The L2/L5 check, measured 2026-11-20** (taken as recommended: Captain Bob, "Yes go on"). On amd64,
|
||||||
|
as built, `INFER-WINDOW@` was 0. Every loop but L1 is gated by L8's current card, and L5's width is
|
||||||
|
computed only on ticks whose card has L5 on, so on a real boot it may or may not be set. The check is
|
||||||
|
instead that `INFER-RUN INFER-VARIANCE@` is not 0 after the workload: the variance is computed whenever
|
||||||
|
the window holds calls, whatever the card, and stays 0 with no window. That is L2's window with the
|
||||||
|
engine run on it. The width is printed beside it, not checked; L5's width stays in `test_mesh_boot`,
|
||||||
|
where L8 is held on a card. The same boot: L1 H=6, L3 1000 cooled to 0 in 40 s, L8 65 changes on card 11.
|
||||||
|
|
||||||
## Review focus
|
## Review focus
|
||||||
|
|
||||||
|
|||||||
@@ -145,3 +145,254 @@ accepted before the next:
|
|||||||
3. `mkf18a` and `make -C v4 artifacts` (test 3).
|
3. `mkf18a` and `make -C v4 artifacts` (test 3).
|
||||||
4. The small train, placed at a base other than 0 (test 5).
|
4. The small train, placed at a base other than 0 (test 5).
|
||||||
5. The nucleus renamed to name order (3a), designed first: it changes the boot, so the protocol runs.
|
5. The nucleus renamed to name order (3a), designed first: it changes the boot, so the protocol runs.
|
||||||
|
|
||||||
|
## 8. Task 1 built (2026-11-19): `text.c`'s address record
|
||||||
|
|
||||||
|
**What changed:**
|
||||||
|
- `text.h` and `text.c`: `v4_text_record(t, buf, cap)` turns the record on, and `v4_text_addresses(t)` says
|
||||||
|
how many were recorded. Each entry is a cell and its slot, 0–3 for a branch field or 7
|
||||||
|
(`V4_TEXT_WHOLE_CELL`) for the whole cell. What is recorded:
|
||||||
|
- every branch, to a word or a label, back or forward, including `NEXT`'s;
|
||||||
|
- an `&NAME` literal in code, and `#, &NAME`;
|
||||||
|
- `here`, and a `set` variable that holds an address, wherever it is laid down (code, `#,`, `store`);
|
||||||
|
- a header's name cell, and its link when there is an entry before it.
|
||||||
|
|
||||||
|
The map's constants and plain numbers are not recorded. A full record is an error. With the record off,
|
||||||
|
nothing changes.
|
||||||
|
- **Found while building:** the nucleus lays its headers down with `set HDR-NFA here ... #, HDR-LINK`, not
|
||||||
|
with `header`. So a `set` variable carries whether it holds an address, or those links would be missed.
|
||||||
|
|
||||||
|
**Test first** (`logs/20261119-text-record/`):
|
||||||
|
- `test_text`: 15 new checks. Before the change, 13 failed: every one that expects an address recorded.
|
||||||
|
The two that expect nothing passed, as they should. Two errors in the tests themselves were fixed before
|
||||||
|
the change: `source` needs its `N-1` constant, and the notation is `FOR ... NEXT`, upper case.
|
||||||
|
- `test_host_rom_nucleus`, with the record on (test 4). On the system's source it records 1825 branches
|
||||||
|
and 664 whole cells. Every whole cell holds an address of the assembly, and the ROM's assembly is still
|
||||||
|
equal to it word for word, at both widths. This check could not be seen to fail before: the record did
|
||||||
|
not exist. It guards that the record changes no cell.
|
||||||
|
|
||||||
|
**Verified:**
|
||||||
|
- `make -C v4 test` passes: all tests at both widths, and the three mesh boots with POST 990/990.
|
||||||
|
- `make -C v4 test-32` passes.
|
||||||
|
- ASan+UBSan passes for every test at both widths, and for the mesh boot (POST 990/990). The run hit my
|
||||||
|
one-hour background limit at the 64-bit `test_host_mesh`, so the rest was run again from there.
|
||||||
|
`v4-gates.txt` and `v4-sanitize-rest.txt` hold the two parts.
|
||||||
|
- The boot does not use the record, so the kernel and the protocol are unchanged.
|
||||||
|
|
||||||
|
## 9. Task 2 built (2026-11-19): `effect.c`, the stack effects
|
||||||
|
|
||||||
|
**What it is:** `v4/include/v4/effect.h` and `v4/src/effect.c`, a build-machine analysis, not part of the
|
||||||
|
engine or the kernel. `v4_effect_of(e, addr, how)` walks a word's code from its entry and gives what it
|
||||||
|
takes and leaves on both stacks, or why it has none, and where. The opcode counts are the engine's own
|
||||||
|
table (`exec.c`, D-16). Effects of called words are kept, so each is walked once. A callback gives the
|
||||||
|
effects of code outside the range analysed: the ROM's, or another train's.
|
||||||
|
|
||||||
|
**Two ways a word is reached,** from the header's flag 8:
|
||||||
|
- **Called:** it returns with `;` at its own entry depth on the return stack, so its return-stack effect
|
||||||
|
is always 0 → 0. A `;` with its own value on the return stack is a computed jump (EXECUTE, a DEFERred
|
||||||
|
word), and has no fixed effect. So has touching its caller's return address, and `ex`.
|
||||||
|
- **In line:** the body runs to the first `;` wherever the return stack is. `push` in line is data 1 → 0
|
||||||
|
and return stack 0 → 1.
|
||||||
|
|
||||||
|
No fixed effect: paths that meet with different depths (a loop that leaves a count of values), returns
|
||||||
|
that disagree, recursion, a word that never returns, and a call to a word with none.
|
||||||
|
|
||||||
|
**Test first** (`logs/20261119-effect/`): `test_effect`, 34 checks.
|
||||||
|
- Against a stub that derived nothing, the 23 checks that expect a fixed effect failed. The 10 that
|
||||||
|
expect none passed vacuously.
|
||||||
|
- Three of my expectations were wrong, and the analysis was right. I corrected them:
|
||||||
|
- `a! @ !` is 1 → 0, not 2 → 0: the value fetched is stored back;
|
||||||
|
- `drop jump A`, with A `dup`, is 2 → 2: `dup` needs a second cell;
|
||||||
|
- `3 FOR dup drop NEXT` is 1 → 1: the `dup` needs a cell already there. The fixed-loop check now uses
|
||||||
|
`5 drop`, and the 1 → 1 case is a check of its own.
|
||||||
|
- **Five real words agree with their stack comments:** SWAP', UM/MOD, C@, C! and ROUNDTRIP (2 → 1, through
|
||||||
|
its `jump C@`).
|
||||||
|
|
||||||
|
**On the nucleus** (`nucleus-dictionary.txt`, a one-off measurement): of 315 headers, 65 of them in line,
|
||||||
|
214 have a fixed effect and 101 have none.
|
||||||
|
- 78 call a word with no fixed effect;
|
||||||
|
- 11 have a computed jump;
|
||||||
|
- 8 have returns that disagree;
|
||||||
|
- 4 touch their caller's return address.
|
||||||
|
|
||||||
|
Under ruling §6.4, the 214 would be the nucleus's exports. The nucleus is not an artifact (§6.2a), so
|
||||||
|
this is a measure of the analysis, not an interface.
|
||||||
|
|
||||||
|
**Verified:**
|
||||||
|
- `make -C v4 test` passes, with all three mesh boots at POST 990/990.
|
||||||
|
- `make -C v4 test-32` passes.
|
||||||
|
- `make -C v4 sanitize` passes: every test at both widths, and the mesh boot at POST 990/990, under
|
||||||
|
ASan+UBSan.
|
||||||
|
|
||||||
|
## 10. Task 3, `mkf18a`: rulings while designing it
|
||||||
|
|
||||||
|
1. **Exports: "`: NAME` words, no headers"** (2026-11-19). Every `:` word with a fixed effect is exported,
|
||||||
|
named by its `:` name. A train's source lays no dictionary entry: placement makes the entries (`ABI.md`
|
||||||
|
§5, step 4, as written). Asked because a `header` in the code would make each entry twice.
|
||||||
|
2. **Flags: "After the name, like header"** (2026-11-19). The flags follow the `:` name, as they follow
|
||||||
|
`header` today: `: PLUS inline + ;`, `: [ immediate ...`. The ACL defaults come the same way, as
|
||||||
|
`pinned` and `mode N`. `text.c` records them and lays nothing in the code. In-line also decides how the
|
||||||
|
tool derives the word's effect (§9).
|
||||||
|
3. **Imports: "An import line"** (2026-11-19). `import TRAIN NAME` declares NAME as from the train TRAIN,
|
||||||
|
before it is used. The tool takes TRAIN's capsule hash, and the word's derived effects, from that train's
|
||||||
|
build, so the build fails if TRAIN does not export NAME. Each call to NAME is a relocation to its import.
|
||||||
|
4. **A train's capsule hash: "Its .f18a's capsule ID"** (2026-11-19). A train is identified by its engine:
|
||||||
|
the capsule ID `mkcapsule` gives its `.f18a`. The nucleus has none (§6.2a), so a word imported from it
|
||||||
|
is named with hash 0 and resolved by name in the node's dictionary at placement. Exact-hash imports
|
||||||
|
(`ABI.md` choice 4) hold between artifact trains only. Asked because a capsule today is one file, and
|
||||||
|
the nucleus is 16 blobs.
|
||||||
|
5. **Capabilities: "Declared, then checked"** (2026-11-19). v4 has no port opcode: a port is an address,
|
||||||
|
reached through A, B or P, whose values are data, so which words touch ports cannot be derived. A word
|
||||||
|
declares what it needs after its name, like its flags: `ports`, `request N`. The tool records the
|
||||||
|
declaration. Where it can see a port or a request, it fails the build if the declaration is missing:
|
||||||
|
a literal port address put into A or B, or a kernel request with a literal number. What it cannot see
|
||||||
|
is the declaration's. This changes `ARTIFACT.md` choice 4's "the tool derives it from the code".
|
||||||
|
|
||||||
|
## 11. Task 3 built (2026-11-19): `mkf18a` and `make -C v4 artifacts`
|
||||||
|
|
||||||
|
**What changed.**
|
||||||
|
- `text.c` (part 1, committed first): the attributes after a `:` name (`immediate data inline compile-only
|
||||||
|
pinned mode N ports request N`), recorded and laid nowhere in the code; `import TRAIN NAME`, whose uses are
|
||||||
|
calls to a placeholder `V4_NODE_WORDS-1-k` and are recorded as relocations to import k. A use before the
|
||||||
|
declaration fails, and so does code that reaches the placeholders.
|
||||||
|
- `include/v4/artifact.h`, `src/artifact.c`: the layout of `ARTIFACT.md` and its check (§7), shared by the
|
||||||
|
tool and, later, by placement.
|
||||||
|
- `tools/f18a.c`, `tools/f18a.h`, `tools/mkf18a.c`: the tool, `mkf18a OUT.f18a MAP.f18 ROM DIR
|
||||||
|
[TRAIN=PATH.f18a ...]`. It assembles the map, then DIR's `.f18` files in name order, at 0, with the record
|
||||||
|
on (§6.3). It refuses a header, a start, and a store; resolves each import from the trains it is given;
|
||||||
|
derives the effects (§9) and exports every `:` word that has one (§6.4, ruling 1); checks the declared
|
||||||
|
capabilities (ruling 5); and writes the relocations, the pool and the four hashes.
|
||||||
|
- `Makefile`: `mkf18a-32`, `mkf18a-64` and their tests; `artifacts` builds the tool at both widths. `test`
|
||||||
|
runs `mkf18a-32/64`, `sanitize` their ASan+UBSan builds.
|
||||||
|
|
||||||
|
**Test first, seen to fail.** `test_text` had 11 failures of 274 checks before part 1
|
||||||
|
(`logs/20261119-mkf18a/text-before-64.txt`), none after (`text-after.txt`). `test_mkf18a` failed at its
|
||||||
|
first check against a stub that built nothing (`mkf18a-before-64.txt`), and passes 83 checks at both widths
|
||||||
|
after (`mkf18a-after-64.txt`, `mkf18a-after.txt`). It builds a library train and a train that imports from
|
||||||
|
it, reads every unit back against `text.c`, builds both twice for the same bytes, and checks ten refusals:
|
||||||
|
of the checker, and of the tool (r1-r9 refused, r10 built).
|
||||||
|
|
||||||
|
**The test's own error.** A name meant to be 32 characters, to be refused, was 31 and was taken; the test
|
||||||
|
was corrected, not the tool.
|
||||||
|
|
||||||
|
**Choices made in drafting.** Ruled 2026-11-20, each "Keep as drafted", one at a time:
|
||||||
|
1. The provenance hashes frame each input as its name, a NUL, its length in 8 bytes low first, then its bytes
|
||||||
|
(`f18a.h`).
|
||||||
|
2. The tool's hash covers `tools/mkf18a.c`, `tools/f18a.c`, `tools/f18a.h`, `src/artifact.c`, `asm.c`,
|
||||||
|
`effect.c`, `iword.c`, `text.c`, then every `include/v4/*.h`, in that order. The configuration hash covers
|
||||||
|
the text `V4_CELL_BITS=.. V4_NODE_WORDS=.. V4_DATA_RING=.. V4_RET_RING=.. V4_ROM_WORDS=..`, framed as
|
||||||
|
`config`, then the map. The ROM's is the ROM file.
|
||||||
|
3. The pool's unit 0 is always 0, so an offset of 0 means none.
|
||||||
|
4. A store of a literal number to `(PORT)` counts as a request, not as touching the ports.
|
||||||
|
5. Capabilities pass through calls: a word that calls one that declares `ports` must declare it too.
|
||||||
|
6. The imports' placeholders are the node's top words, `V4_NODE_WORDS-1-k`.
|
||||||
|
|
||||||
|
**Recorded, not fixed:** a store into the code below `here` is not caught by the store check, which looks
|
||||||
|
only above `here`.
|
||||||
|
|
||||||
|
**Verified** (`logs/20261119-mkf18a/v4-gates.txt`, exit 0):
|
||||||
|
- `make -C v4 test` passes, with the mesh boots at POST 990/990, and `mkf18a-64` and `mkf18a-32` at 83 checks.
|
||||||
|
- `make -C v4 test-32` passes.
|
||||||
|
- `make -C v4 sanitize` passes, `mkf18a` included at both widths.
|
||||||
|
|
||||||
|
## 12. Task 4, the small train placed: design, for ruling
|
||||||
|
|
||||||
|
Written 2026-11-20. Test 5 of §4: a few words of `.f18` with one import from the nucleus, built by `mkf18a`
|
||||||
|
into a `.f18a`, placed at a base other than 0. Its words run, and its call into the nucleus reaches the
|
||||||
|
nucleus. **Nothing here is built.** The kernel and the boot are unchanged: carrying artifacts in capsules
|
||||||
|
and placing them on a node are the ADR's steps 4 and 6 (§3).
|
||||||
|
|
||||||
|
**What it needs that task 3 left out:**
|
||||||
|
- **Imports from the nucleus.** Ruling 4 (§10) names them with hash 0, resolved by name in the node's
|
||||||
|
dictionary. To check the import's effect at build time, the tool needs the nucleus's effects. Task 2
|
||||||
|
derived them once, by the dictionary's names (`logs/20261119-effect/nucleus-dictionary.txt`); task 4
|
||||||
|
makes that a part of the tool.
|
||||||
|
- **Placement**, `ABI.md` §5: check, place at the base, fix each relocation, enter each export.
|
||||||
|
|
||||||
|
**The test, `test_place`, written first:**
|
||||||
|
1. A train of two files: `: SQ dup + ;` style words, one of them calling a nucleus word with a fixed
|
||||||
|
effect (`OVER` or the like, picked from the 214), one calling the other.
|
||||||
|
2. `mkf18a` builds it, with the nucleus import's hash 0 and its effect from the nucleus.
|
||||||
|
3. The host system is booted as `test_mesh_boot` boots it. The train is placed into Hera at her `HERE`,
|
||||||
|
which is not 0. `HERE` moves past it.
|
||||||
|
4. Console lines run the words and print their results. Each must be as the same source gives when
|
||||||
|
typed at the prompt. Each relocated cell must hold the base plus its offset, or the nucleus word's
|
||||||
|
address.
|
||||||
|
5. Refusals, each leaving the node unchanged: a nucleus import the dictionary lacks; an import whose
|
||||||
|
effect disagrees; an artifact the checker refuses; a relocation out of its slot's reach at that base.
|
||||||
|
|
||||||
|
**Ruled 2026-11-20, one at a time:**
|
||||||
|
1. **Placement: "Host placer in C".** `v4/src/place.c` checks, copies, patches and enters into a host
|
||||||
|
node's memory, in the booted host system. It is the oracle for the loader on the node (step 6). Asked:
|
||||||
|
a host placer in C, or the loader in FORTH on the node now, pulled forward from step 6.
|
||||||
|
2. **Entries: "Placer lays entries".** The placer lays each export's entry as `(HEADER)` lays one: the ID,
|
||||||
|
the flags with the ACL defaults, the name, the link, the code. It tells the kernel, as `(WORD-DEFINED)`
|
||||||
|
does. The test runs the words by name at the console. Asked: entries now, or calls by address and
|
||||||
|
entries left to step 6.
|
||||||
|
**2a, ruled 2026-11-20: "Split at each export".** An entry is laid right before its code (`dict.f18`:
|
||||||
|
the four cells at xt-4 to xt-1, the code at xt), but the artifact's code is one block with no room
|
||||||
|
between its words (ruling 1). So the placer lays each export's entry, then that export's code, up to
|
||||||
|
the next export's entry offset. Code before the first export goes first, with no entry. Every cell
|
||||||
|
moves by the entries laid before it, so every relocation is mapped through the moved offsets, and
|
||||||
|
each one's reach is checked at its final address. Calls go straight to the code. A word whose code
|
||||||
|
runs on into the next export's, with no `;` or jump between, cannot be split, and the placer refuses
|
||||||
|
it. *Corrected 2026-11-20, ruled "In the tool": the tool refuses it, at build time, and the placer
|
||||||
|
trusts the artifact for it. The placer cannot see it: the artifact names only the exports, and the
|
||||||
|
word before an export may be internal, with no fixed effect. The tool knows every `:` word, and walks
|
||||||
|
each with its range ending at the next.* Asked: that, or the whole block at the base, with an entry after it whose xt cell jumps to the word.
|
||||||
|
3. **The nucleus's effects: "Tool assembles it".** `mkf18a` is given the nucleus's directory, assembles it
|
||||||
|
with its map, and derives each header's effect by name, as task 2's measurement did. Nothing is
|
||||||
|
generated in between. Asked: that, or an effects file generated once per build.
|
||||||
|
4. **The import's name: "import nucleus NAME".** `nucleus` is a reserved train name: the import has hash
|
||||||
|
0, its effect from the nucleus, and placement resolves it by name in the dictionary. Asked: that, or a
|
||||||
|
directive of its own.
|
||||||
|
|
||||||
|
## 13. Task 4 built (2026-11-20): the small train placed
|
||||||
|
|
||||||
|
**What changed.**
|
||||||
|
- `tools/f18a.c`, `mkf18a.c`: `import nucleus NAME` (ruling 4). Given `nucleus=SYSDIR`, the tool assembles
|
||||||
|
the nucleus as the ROM does and looks NAME up by its dictionary name. The import has hash 0 and the effect
|
||||||
|
derived there. A word in line there, or one with no fixed effect, is refused (ruling 3). The tool also
|
||||||
|
refuses a word that runs on into the next export (2a, as corrected).
|
||||||
|
- `include/v4/place.h`, `src/place.c`: the host placer, `v4_train_place` (rulings 1, 2, 2a). It checks
|
||||||
|
everything before it writes anything. Then it places the code at HERE, split at each export with the
|
||||||
|
export's entry laid before its code, fixes each relocation at its moved address, enters each export into
|
||||||
|
CURRENT's vocabulary, moves DP, and tells the kernel of each xt.
|
||||||
|
- `tests/train-place/`: the small train, two files. `DIST` calls the nucleus's `ABS`; `DIST2` calls `DIST`;
|
||||||
|
`CLAMP0` has a forward branch; `ADDR` holds `&DIST`. The Makefile builds its `.f18a` with `mkf18a-64`
|
||||||
|
itself.
|
||||||
|
- `tests/test_mesh_boot.c`: the system is booted, and the train is placed on Hera at her HERE (9782).
|
||||||
|
- `Makefile`: the train's rule. The mesh boot's four builds link the placer. `test_mkf18a` is built with the
|
||||||
|
host node's size, as the tool is: the nucleus did not fit a mesh node's.
|
||||||
|
|
||||||
|
**Test first, seen to fail.**
|
||||||
|
- `test_mkf18a`, nucleus imports: 3 of 88 checks failed against a stub (`logs/20261120-place/nucleus-before-64.txt`).
|
||||||
|
93 passed after.
|
||||||
|
- The run-on refusal failed first (`runon-before-64.txt`). Now 95 pass at both widths.
|
||||||
|
- `test_mesh_boot`: 16 new checks failed against a stub placer (`place-before.txt`). Now 141 pass (`place-after.txt`).
|
||||||
|
|
||||||
|
What the placement checks:
|
||||||
|
- the words run by name: `7 3 DIST .` and `3 7 DIST .` give 4, `DIST2` 8, `CLAMP0` 0 and 5;
|
||||||
|
- `ADDR` equals `' DIST`;
|
||||||
|
- a word compiled at the prompt calls a placed one;
|
||||||
|
- the kernel keeps a record of each export;
|
||||||
|
- six refusals each leave Hera unchanged: a wrong magic, another node size, a name the dictionary lacks, an
|
||||||
|
effect not the one expected, an import from a train, and no room below DLIMIT.
|
||||||
|
|
||||||
|
**The test's own error.** Its `defined` callback first only kept the xts, and did not tell the kernel. The
|
||||||
|
test was corrected to run the word in `(WORD-DEFINED)` with each xt, as `(DEFINED)` does. The placer was
|
||||||
|
not changed.
|
||||||
|
|
||||||
|
**Choices made in building, for ruling:**
|
||||||
|
1. An import from the nucleus declares no capabilities: the nucleus declares none.
|
||||||
|
2. The placer looks an import up in FORTH, from `(LATEST)`, skipping hidden entries, and enters the exports
|
||||||
|
into CURRENT's vocabulary.
|
||||||
|
3. An import from an artifact train (a hash that is not 0) is refused for now, "not placed yet".
|
||||||
|
4. The run-on check walks the word before each export with its range ending at that export. A word that
|
||||||
|
has no fixed effect for another reason, found first, is not seen to run on.
|
||||||
|
|
||||||
|
**Verified** (`logs/20261120-place/v4-gates.txt`, exit 0):
|
||||||
|
- `make -C v4 test`: the mesh boots at POST 990/990, the placement among them, and `mkf18a` at 95 checks
|
||||||
|
at both widths.
|
||||||
|
- `make -C v4 test-32` passes.
|
||||||
|
- `make -C v4 sanitize` passes, the mesh boot with the placement included.
|
||||||
|
|||||||
@@ -0,0 +1,94 @@
|
|||||||
|
# Capsule trust: no unsigned capsule on a signed build (#139) -- design, for ruling
|
||||||
|
|
||||||
|
Written 2026-11-20. **Built 2026-11-20** (section "Built", below; FABRIC-3 XLIX).
|
||||||
|
|
||||||
|
## The rulings (Captain Bob, 2026-11-20, one at a time)
|
||||||
|
|
||||||
|
1. **The anchor: "Intermediate is the anchor; no root check."** The "StarshipOS Capsule Signing"
|
||||||
|
certificate built into the image (`capsules/pki/starshipos-intermediate.der`, FABRIC-3 XLVI, ruled
|
||||||
|
2026-11-07) is what the capsules are trusted by. The kernel does not check it against the StarshipOS
|
||||||
|
Root CA, and no root key is put in the kernel or in CI.
|
||||||
|
- First ruled "Yes, verify at boot". Then, asked where CI should take the root's public certificate
|
||||||
|
from, Captain Bob: "Actually we decided to include an intermediate certificate in the kernel" --
|
||||||
|
XLVI's decision -- and the root check was withdrawn.
|
||||||
|
- On the way it was found that the root's private key is on the CI server, beside its certificate, in
|
||||||
|
`/var/lib/starshipos-ca/root/` (mode 700). The root's public certificate is also in the tree,
|
||||||
|
`ci/pki/starshipos-root-ca.pem`.
|
||||||
|
2. **"Refuse on signed builds."** A kernel built with the signing key (CI, releases) refuses an unsigned
|
||||||
|
capsule at boot. A developer build without the key keeps the warning, so local work still boots.
|
||||||
|
3. **A certificate that cannot be read: "NO_ROOT_KEY, by build."** If the image's signing certificate is
|
||||||
|
missing or does not parse, every capsule is NO_ROOT_KEY, with a line saying why. A signed build
|
||||||
|
refuses it, as it refuses MISSING; an unsigned build warns and boots.
|
||||||
|
|
||||||
|
## What is there
|
||||||
|
|
||||||
|
- `kernel/src/capsule/capsule_sig.c` gives each capsule a result: OK, MISSING, INVALID or NO_ROOT_KEY.
|
||||||
|
The callers refuse INVALID only (`capsule_sig.h`, ruled 2026-08-26, when CI had no key).
|
||||||
|
- The callers: v4's boot (`v4/system/boot.c:345`, each capsule it loads) and v3's birth
|
||||||
|
(`kernel/src/capsule/capsule_birth.c`, three places).
|
||||||
|
- The build signs only when `SIGN_KEY` is set (`kernel/Makefile`, `v4/Makefile`): CI sets it from the
|
||||||
|
secret `CAPSULE_SIGN_KEY`. The gate into master and a release already refuse an unsigned build (#174).
|
||||||
|
|
||||||
|
## The design
|
||||||
|
|
||||||
|
1. **One decision, in one place:** `capsule_sig_refused(result)` in `capsule_sig.c`. INVALID is always
|
||||||
|
refused. MISSING and NO_ROOT_KEY are refused when the build is signed, and warned of otherwise. Every
|
||||||
|
caller asks it, instead of testing for INVALID itself. Each caller still says why: "missing
|
||||||
|
(unsigned)", "invalid", "no signing certificate".
|
||||||
|
2. **A signed build** is compiled with `-DCAPSULE_SIGNED_BUILD=1`, set by the kernel's and v4's Makefiles
|
||||||
|
exactly when they pass `--sign-key` to mkcapsule. So the flag and the signatures always agree.
|
||||||
|
3. **`capsule_sig.h`'s comment** (the 2026-08-26 reason MISSING was a warning) is corrected, dated, and
|
||||||
|
FABRIC-3 gets the ruling.
|
||||||
|
4. **Tests, written first:**
|
||||||
|
- A host test of `capsule_sig_refused` built both ways: on a signed build MISSING, INVALID and
|
||||||
|
NO_ROOT_KEY are refused and OK is not; on an unsigned build only INVALID is.
|
||||||
|
- **The boots on the three architectures:** the acceptance runs, signed in CI, show a signed build
|
||||||
|
booting, as today. A signed build with one capsule unsigned is refused at that capsule. An unsigned
|
||||||
|
developer build still boots, with its warnings.
|
||||||
|
|
||||||
|
## Ruled
|
||||||
|
|
||||||
|
4. **The refused-capsule boot: "Left to CI".** CI has the real key. A job builds signed, strips one
|
||||||
|
capsule's signature, and expects the boot refused at that capsule. This container has no key, so that
|
||||||
|
boot is CI's, and the host test and the boots here cover the rest. Asked: that, or a throwaway CA made
|
||||||
|
here, its intermediate standing in for the real one in a test build.
|
||||||
|
|
||||||
|
## Built (2026-11-20)
|
||||||
|
|
||||||
|
As the design, with one difference in step 4: the refused-capsule boot is CI's (ruling 4).
|
||||||
|
`scripts/nightly.sh capsule-trust`, in `nightly.yml`, builds signed with `CAPSULE_TEST_UNSIGN=v4:centre.4th`
|
||||||
|
(`scripts/capsule_unsign.py` takes that one signature out after mkcapsule), and boots amd64 in the session's
|
||||||
|
`unsigned_capsule` mode. It expects the capsule's "missing (unsigned)" line, `POST: FAILED` and no prompt.
|
||||||
|
- **Checked here:** the mode refuses to run without `SIGN_KEY`. The script unsigns only the capsule named,
|
||||||
|
and refuses one that is not signed and one that is not there.
|
||||||
|
- **To see in CI:** the boot itself, in the first nightly after the merge.
|
||||||
|
|
||||||
|
`kernel/tests/test_capsule_sig.c` (and `_signed.c`) was written first and did not build without
|
||||||
|
`capsule_sig_refused`. It now passes 4 checks on each build (`logs/20261120-capsule-trust/`).
|
||||||
|
|
||||||
|
|
||||||
|
## Given for ADR step 4, when capsules carry trains (Captain Bob, 2026-11-20)
|
||||||
|
|
||||||
|
Recorded as given, to design from at step 4 ("Integrity, provenance, and reproducibility checks" and the
|
||||||
|
carrying of artifacts in capsules). Nothing of it is built.
|
||||||
|
|
||||||
|
- **The capsule is a train:** "we are evolving to capsules with the v4 runtime engine towing rolling stock
|
||||||
|
named blobs". The engine is the train's `.f18a`, and the cars are its named blobs (ABI.md, "one train
|
||||||
|
per capsule").
|
||||||
|
- **Each blob is signed by its author and hashed:** "Each blob in the capsule is signed by the author and
|
||||||
|
hashed. The MANIFEST.md inside the capsule will hold each named blobs hash."
|
||||||
|
- **The authors:** "Bonafide contributors will have their own intermediate certificate and 'casual' users
|
||||||
|
get a snakeoil cert." StarshipOS's own trains are signed with the StarshipOS Capsule Signing certificate,
|
||||||
|
as today.
|
||||||
|
- **How they are told apart:** "It can tell the intermediate cert from a snakeoil because it has an
|
||||||
|
intermediate chained to the CA." So at step 4 the kernel checks an author's intermediate against the
|
||||||
|
StarshipOS Root CA's public key, anchored in the kernel. The public certificate is in the tree
|
||||||
|
(`ci/pki/starshipos-root-ca.pem`, with its published hash); the root's private key stays on the server.
|
||||||
|
This is the chain check ruling 1 leaves out for now, for the one system certificate. It comes in with
|
||||||
|
contributors' trains.
|
||||||
|
|
||||||
|
**For step 4's design, to be asked one at a time then:**
|
||||||
|
- whether `MANIFEST.md` is itself a signed blob, so its hashes are trusted;
|
||||||
|
- what placement does with a blob whose hash differs from its manifest's;
|
||||||
|
- what each tier is allowed: StarshipOS, a contributor, a snakeoil user. `contrib_capsule_refused()`
|
||||||
|
(`capsule_birth.c`, FABRIC-2 I.5) is where tiers began.
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user