Epic: resources: scripts as resources (RESOURCES slices 5 and 6) #138
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
L2 and L3 of RESOURCES.md: scripts as resources. Slice 5 (L2:
Sandbox.embedded/load/read, the statically readable capability block, the script as a leaf of the module graph) and slice 6 (L3: the one new case of the module-constant purity rule, folding a pure initializer in the VM, the embedding throughEncode, the six conditions as diagnostics). Both are too large for one PR, so this issue is an epic; the design record stays the specification.Source
Dependencies
Sandboxon both implementations: holds onmain(SCRIPTS.md slices 4, 5, 7 and 8;tests/conformance/sandbox-crossing.trb,tests/conformance/vm-only/sandbox-*.trb). RESOURCES.md probe 4 and the "Blocked" cells of slices 5 and 6 are stale; step 1 corrects them.Steps (a step becomes its own issue when it starts next)
Sandbox.read(path: Path): the run-time-path member, callers migrated (no seed)Sandbox.load(Resource)andSandbox.embedded(EmbeddedText): the literal resolves against the writing file, the script table is keyed by stable name,loadstops taking aString(changes a std signature the compiler recognizes by shape: two commits, seed refresh by Torben)load/embeddedmust be statically readable; the diagnostic points atSandbox.read(RESOURCES.md section 7)(stable name, receiver type, allowlist),torb checkopens the script; script imports checked against the allowlist at build timesemantics/checker/declaration.trb, no folding yetEncode); the six conditions as diagnostics, one message each (may split into one issue per group of conditions when it starts)docs/standard-library/resource.md,sandbox.md(three members),docs/tooling/torb-build.md, ECS loader snippet, CONCEPT decision log entry; RESOURCES.md status DoneDone when all steps are closed and the RESOURCES.md slices 5 and 6 are marked done.
[loop:torbscript] intake: in scope (author orion, label loop), source RESOURCES.md slices 5 and 6, not a duplicate. Depends on #137 and on Sandbox running on both implementations. next: waiting (dependency #137) until 2026-10-10T04:00:00Z
[loop:torbscript] claim refine by session:loop-torbscript-20261029 until 2026-10-29T10:20Z
Sandbox.readfor a script path known at run time (step 1 of #138) #576resources: scripts as resources (RESOURCES slices 5 and 6)to Epic: resources: scripts as resources (RESOURCES slices 5 and 6)[loop:torbscript] decided by the loop: the dependency "Sandbox on both implementations" is met on
main(4b59fae):tests/conformance/sandbox-crossing.trbprints the same in the VM and in a native binary,tests/conformance/vm-only/sandbox-*.trbandcompiler/tests/sandbox.test.trbrun scripts in the VM,Sandbox.loadTextexists. RESOURCES.md probe 4 and the "Blocked" cells of slices 5 and 6 are stale (step 1 corrects them); #137 is closed. The "waiting (dependency #137)" intake note is obsolete.[loop:torbscript] decided by the loop: slices 5 and 6 are far more than one PR (rename and retype of three
Sandboxmembers, the literal capability block rule, graph leaf and cache key, then compile-time evaluation with six fenced conditions), so this issue is an epic with the checklist in its body. Only step 1 is filed now: #576 (Sandbox.read(path: Path)), because it is the one step that touches none of the graph/checker/script-table code that the script-receivers epic #518 (#513, #514) is reworking, and it needs no seed refresh (the compiler recognizesSandbox.loadby shape and looks up no nameread). Steps 2 to 4 start after #513 and #514 have landed; step 2 changesload's signature, which the compiler recognizes by shape, so it takes the two-commit seed route when it is filed.[loop:torbscript] decided by the loop: no owner question. The rename of
loadtoreadand the retyping ofloadtoResourceare decided by RESOURCES.md section 5 ("Changing it costs nothing"); naming and technical design follow the design record.[loop:torbscript] refine: verified the Sandbox dependency against
main, turned the issue into an epic (checklist of 7 steps in the body), filed step 1 as #576 (labelsloop,ready; no duplicate among the open issues for "Sandbox.read", "embedded", "Sandbox.load"), next: waiting (epic; first step #576 is ready, steps 2 to 4 follow #513 and #514, later steps are filed just in time). Worker usage: about 115k tokens (sonnet).