6 Commits
Author SHA1 Message Date
Claude fe0f709498 ARTIFACT.md: choice 5 ruled, code cells low-first; layout ruled
Build / Image RASPI (push) Successful in 4m17s
Build / Image PC (push) Successful in 5m37s
Build / Image MILKV (push) Successful in 5m40s
Build / v4 tests (32- and 64-bit cells) (push) Successful in 13m56s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 16:19:58 +00:00
Claude 4a7ca4e288 ARTIFACT.md: choice 4 ruled, port bit plus request list
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 16:19:00 +00:00
Claude c9cc39f4ec ARTIFACT.md: choice 3 ruled, both stack effects recorded and checked
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 16:17:11 +00:00
Claude d052af6d53 ARTIFACT.md: choice 2 ruled, SHA-512 for provenance and proofs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 16:16:20 +00:00
Claude c4b922d496 ABI.md §4: records in 32-bit units, code in cells, as ARTIFACT.md rules
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 16:15:13 +00:00
Claude 2b8609e4fc ARTIFACT.md: choice 1 ruled, 32-bit units
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
2026-11-19 16:13:57 +00:00
2 changed files with 48 additions and 26 deletions
+3 -1
View File
@@ -60,7 +60,9 @@ anywhere but where it was compiled needs those fields fixed (§5).
## 4. The artifact
All of it is in cells, so an F18 node can read it.
**The records are in 32-bit units, low byte first, and the code is in the build's cells** (`ARTIFACT.md`
§1, ruled 2026-11-19, "32-bit units"). A node reads the records as it reads a block, four bytes to a
cell. *Corrected 2026-11-19: this line said "All of it is in cells, so an F18 node can read it".*
| Record | Holds |
|---|---|
+45 -25
View File
@@ -9,16 +9,18 @@ ruled:
- imports name the exact build;
- the source travels by reference.
**Nothing here is built.** The choices left open are numbered in §8.
**Nothing here is built.** The choices in §8 are ruled (2026-11-19).
## 1. Units, order, width
- **The unit is a 32-bit word**, stored little-endian, low byte first, as v4's blocks are (`blocks.h`:
"four bytes to a cell, the first lowest"). Every record is a whole number of units, so the records read
the same at either cell width.
- **The code is cells of the build's width.** A 32-bit engine and a 64-bit engine are two artifacts: the
- **The code is cells of the build's width**, each stored low byte first (choice 5). A 32-bit engine and a 64-bit engine are two artifacts: the
header says which, and placement refuses the wrong one.
- **A 64-bit value**, such as a hash, is two units, low unit first.
- **A 64-bit value**, such as a capsule's hash, is two units, low unit first.
- **A SHA-512 hash** (choice 2) is 16 units: its 64 bytes in their order, packed four to a unit, low byte
first.
- **A name** is a counted string, its length byte then its characters, packed four to a unit, low byte
first, as the dictionary packs names (`dict.f18`). It sits in the string pool and is referred to by its
unit offset.
@@ -27,11 +29,11 @@ ruled:
```
header 16 units
provenance 12 units
provenance 64 units
exports E x 8 units
imports I x 6 units
relocations R x 2 units
verification 4 units
verification 18 units
string pool S units
code C cells
```
@@ -54,15 +56,16 @@ engine of a train: the capsule's payload. The capsule's content hash and Ed25519
| 9 | the unit offset of the exports (the others follow, in §2's order) |
| 10–15 | reserved, 0 |
## 4. Provenance (12 units, ADR §3.1)
## 4. Provenance (64 units, ADR §3.1)
Each hash is SHA-512 (choice 2).
| Units | Field |
|---|---|
| 0–1 | the hash of the `.f18` source the engine was assembled from (choice 3: by reference) |
| 2–3 | the host tool's hash, the compiler's identity (choice 1) |
| 4–5 | the build configuration's hash: the knobs that change code, the cell width, `V4_NODE_WORDS`, the rings |
| 6–7 | the ROM's hash it must agree with: the tool's output is checked against the ROM's assembly |
| 8–11 | reserved, 0 |
| 0–15 | the hash of the `.f18` source the engine was assembled from (ABI choice 3: by reference) |
| 16–31 | the host tool's hash, the compiler's identity (ABI choice 1) |
| 32–47 | the build configuration's hash: the knobs that change code, the cell width, `V4_NODE_WORDS`, the rings |
| 48–63 | the ROM's hash it must agree with: the tool's output is checked against the ROM's assembly |
## 5. Exports, imports, relocations
@@ -75,7 +78,7 @@ engine of a train: the capsule's payload. The capsule's content hash and Ed25519
| 2 | the flags, as the entry's: immediate, compile-only, in-line, and the ACL defaults (pinned, mode) |
| 3 | the data stack effect: cells taken in the low 16 bits, cells left in the high 16, derived (choice 2) |
| 4 | the return stack effect, the same way, derived |
| 5 | the capabilities: a bit for the ports, then a string pool offset to its list of kernel request numbers, or 0 |
| 5 | the capabilities: bit 31 set if it touches ports; bits 0–30 the string pool offset of its list of kernel requests, or 0 for none |
| 6–7 | reserved, 0 |
**An import (6 units):**
@@ -98,13 +101,13 @@ engine of a train: the capsule's payload. The capsule's content hash and Ed25519
Placement (`ABI.md` §5) patches each relocation's branch field. It refuses a patched address beyond that
slot's reach: 27, 22, 17 or 12 bits (`iword.h`).
## 6. Verification (4 units, ADR §5)
## 6. Verification (18 units, ADR §5)
| Units | Field |
|---|---|
| 0–1 | the hash of the proof that covers this exact artifact: its theory and its build; 0 means none |
| 2 | the assumptions it holds under, as a string pool offset, or 0 |
| 3 | reserved, 0 |
| 0–15 | the SHA-512 hash of the proof that covers this exact artifact: its theory and its build; all 0 means none |
| 16 | the assumptions it holds under, as a string pool offset, or 0 |
| 17 | reserved, 0 |
## 7. What makes a valid artifact
@@ -112,18 +115,35 @@ The tool writes these properties and placement checks them. They are also the fi
about the format:
- the magic and the version;
- every count and offset within the payload;
- every string pool offset on a counted string;
- every string pool offset on a counted string, or, for a capabilities list, on a unit holding its count
*n* followed by *n* units, each a `KERNEL-WORD` number;
- every export's entry inside the code;
- every relocation's cell inside the code, its slot one that holds a branch, its import index below I;
- every reserved unit 0.
## 8. Open, for ruling one at a time
1. **The unit:** 32-bit units, width-independent records (§1), or the build's cell for everything?
2. **The hashes:** XXHash64, as capsule identities are today, for every hash in the artifact, or a
cryptographic hash (SHA-512, already in the tree for Ed25519) for provenance and proofs? Signing stays
Ed25519 either way.
3. **The return-stack effect:** recorded and checked (§5, unit 4), or the data stack only?
4. **Capabilities:** the port bit plus a list of kernel request numbers (§5, unit 5), or something else?
5. **Endianness for the code cells:** as the golden model stores them (host order), or fixed low-first like
the records?
1. ~~The unit~~ **Ruled 2026-11-19: "32-bit units".** Every record is in 32-bit units, low byte first,
as v4's blocks are, so the records read the same at either cell width (§1). Only the code is in the
build's cells.
2. ~~The hashes~~ **Ruled 2026-11-19: "SHA-512 for provenance".** The provenance hashes (source, tool,
configuration, ROM) and the proof's hash are SHA-512, the one already in the tree for Ed25519, 16
units each (§4, §6). An import's capsule hash stays the capsule's ID, XXHash64, 2 units (§5), and
signing stays Ed25519. The provenance record grows from 12 units to 64, with no reserved units, and
verification from 4 to 18.
3. ~~The return-stack effect~~ **Ruled 2026-11-19: "Record and check both".** The tool derives the
return-stack effect as it derives the data-stack effect, and records it in unit 4 of each export and
import (§5). Placement, compatibility (`ABI.md` §7, "the same stack effect") and the proofs check
both.
4. ~~Capabilities~~ **Ruled 2026-11-19: "Port bit + request list".** As drafted (§5, unit 5). The tool
derives it from the code: a port opcode sets the bit, and each kernel request the word reaches goes in
its list. Compatibility refuses a replacement that needs one the old did not (`ABI.md` §7). The list
is a count unit then that many request numbers (§7).
5. ~~Endianness for the code cells~~ **Ruled 2026-11-19: "Low-first, like the records".** Every byte of
the artifact has one order, low byte first, so its hashes and signature are the same whichever host
built it. A big-endian host swaps the bytes when it places the code.
## 9. Status
All five choices are ruled. This is the artifact layout, the ADR's step 2, as ruled. The next step is the
ADR's step 3: artifact production in the build (the host tool), designed for ruling before any code.