Add capsules/sdk.4th: SDK v1.9.0 vocabulary + FENCE over the cookbook capsules

Loads turtle.4th and doe.4th, defines SDK-VERSION/SDK-HELP into an SDK
vocabulary, then calls FENCE once everything is loaded -- protecting the
base wordset and both cookbook capsules from FORGET. Kernel-only (EXEC
doesn't exist hosted), REPL-invoked via S" sdk.4th" EXEC, not part of
init.4th's boot sequence.

Verified before writing the capsule, not assumed: VOCABULARY/DEFINITIONS
does not actually scope word visibility in this interpreter -- vm_find_word
is a flat dictionary scan that never consults CONTEXT/CURRENT. Documented
plainly in the HOWTO so this isn't mistaken for namespace isolation later.

Block range 5109-5115 -- discovered along the way that user-block space is
capped at [2048, 5120) by mkcapsule, tighter than expected.

Verified: mkcapsule --lint clean, hosted-build trace runs SDK-HELP with
zero attributable VM errors, zero build warnings and identical 1012/0/0
POST results with matching dict_hash on all three kernel architectures.

HOWTO: docs/working/architecture/SDK-HOWTO-20260819.md

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Robert Allan James
2026-08-19 06:10:51 -04:00
co-authored by Claude Sonnet 5
parent 4e7dcdf889
commit d1547ecdae
10 changed files with 114512 additions and 21020 deletions
+10 -2
View File
@@ -1,5 +1,5 @@
# Capsule Block Manifest — Auto-generated
<!-- Generated by mkcapsule --manifest 2026-08-19T09:54:15Z -->
<!-- Generated by mkcapsule --manifest 2026-08-19T10:07:24Z -->
<!-- DO NOT EDIT — re-run mkcapsule --manifest to refresh. -->
<!-- Hand-written justifications and immutability notes live -->
<!-- in MANIFEST.md alongside this auto-generated index. -->
@@ -35,6 +35,7 @@
| `init.4th` | 2049, 2050, 2057 | `0x214d424abd382707` |
| `lib.4th` | 4050 | `0x20625ebf1276c239` |
| `process.4th` | 4300, 4301 | `0x781afc1dbd0294f7` |
| `sdk.4th` | 5109, 5110, 5111, 5112, 5113, 5114, 5115 | `0x008fdbbb62c94a3a` |
| `turtle.4th` | 5100, 5101, 5102, 5103, 5104, 5105, 5106, 5107, 5108 | `0x4d470418ca543365` |
| `user-font-demo.4th` | 4200, 4201, 4202 | `0xce1fd7d1b581a56d` |
| `zuse.4th` | 4016, 4017, 4018 | `0x12f38ec782434a77` |
@@ -335,10 +336,17 @@
| 5106 | `turtle.4th` | `0x4d470418ca543365` | ok |
| 5107 | `turtle.4th` | `0x4d470418ca543365` | ok |
| 5108 | `turtle.4th` | `0x4d470418ca543365` | ok |
| 5109 | `sdk.4th` | `0x008fdbbb62c94a3a` | ok |
| 5110 | `sdk.4th` | `0x008fdbbb62c94a3a` | ok |
| 5111 | `sdk.4th` | `0x008fdbbb62c94a3a` | ok |
| 5112 | `sdk.4th` | `0x008fdbbb62c94a3a` | ok |
| 5113 | `sdk.4th` | `0x008fdbbb62c94a3a` | ok |
| 5114 | `sdk.4th` | `0x008fdbbb62c94a3a` | ok |
| 5115 | `sdk.4th` | `0x008fdbbb62c94a3a` | ok |
## Conflicts
None.
---
*30 capsule(s) scanned. Re-run `mkcapsule --manifest <dir>` to refresh.*
*31 capsule(s) scanned. Re-run `mkcapsule --manifest <dir>` to refresh.*
+60
View File
@@ -0,0 +1,60 @@
Block 5109
( sdk.4th -- SDK v1.9.0 scoping. Loads the cookbook )
( capsules (turtle.4th, doe.4th), a discoverable SDK )
( vocabulary entry point, and raises FENCE once )
( everything is loaded, so a developer at the REPL can )
( FORGET their own scratch work afterward without )
( disturbing any of this. Kernel-only (EXEC is kernel- )
( only); REPL-invoked -- S" sdk.4th" EXEC -- not part of )
( init.4th's boot sequence, matching turtle.4th's own )
( choice. NOTE: VOCABULARY/DEFINITIONS here is )
( organizational, not isolating -- this VM's word lookup )
( is a flat dictionary scan, so SDK words remain )
( globally callable like any other word, both before and )
( after this capsule loads. Verified directly on the )
( hosted build before writing this file. )
VOCABULARY SDK
Block 5110
( Load the cookbook capsules this SDK re-exports. )
S" turtle.4th" EXEC
S" doe.4th" EXEC
Block 5111
( SDK's own words, defined into the SDK vocabulary for )
( introspection -- see the note above, they are just as )
( callable from FORTH context as anywhere else. )
SDK DEFINITIONS
: SDK-VERSION ( -- )
." SDK v1.9.0 (scoping)" CR ;
Block 5112
: SDK-HELP ( -- )
." SDK vocabulary: turtle.4th + doe.4th + FENCE." CR
." Turtle graphics (docs/working/architecture/" CR
." TURTLE-GRAPHICS-HOWTO-20260819.md):" CR
." HOME CS FORWARD BACK LEFT RIGHT PENUP PENDOWN" CR
." SETCOLOR SETXY SETHEADING POLYGON STAR TURTLE-DEMO" CR
Block 5113
." DoE library (docs/working/architecture/" CR
." DOE-LIBRARY-HOWTO-20260819.md):" CR
." DOE ( -- ) or seed n-reps EXEC-DOE" CR
." SDK-VERSION prints the release tag." CR ;
Block 5114
( Back to FORTH context -- CURRENT no longer targets )
( SDK, so anything typed at the REPL after this loads )
( defines normally. )
FORTH DEFINITIONS
Block 5115
( Raise FENCE now that the base wordset, turtle.4th, )
( doe.4th, and this file's own words are all loaded -- )
( a developer can FORGET their own later scratch )
( definitions without being able to reach back )
( through any of this. )
FENCE
SDK-VERSION
." Loaded. Run SDK-HELP for the word list." CR