HowlFrame #90 Phase 2c: mediate read_file on Go and JavaScript - #56
Conversation
Phase 2c of #90: Go and JavaScript mediate (read_file) via HOWLFRAME_ALLOW_CAPS filesystem grant; empty/missing → CAPABILITY_DENIED before any filesystem read. Conformance on interp/VM/Go/JS. Production -compile-bc unchanged; #90 stays Partial. Co-authored-by: William Elias <wylelias.123@gmail.com>
howlcipher
left a comment
There was a problem hiding this comment.
COMMENT OK on head e3f14715 (CI build green).
Phase 2c scope check: Go+JS mediate (read_file) under existing filesystem via HOWLFRAME_ALLOW_CAPS / howlFrameGrantHas; CAPABILITY_DENIED before os.ReadFile / readFileSync; denial text has no path. Interpreter reads only after its existing filesystem gate (honest granted path for conformance). Conformance read_file_denied / read_file_granted on interpreter / bytecode VM / Go / JS. write_file / mkdir / fetch untouched. -compile-bc still AST path. #90 stays Partial.
Hard nos clean: no half bytecode linker / HFIR module smuggle / VM module opcodes; no new caps or opcodes; don’t reopen #102–#105/#108; no path flip; no batch of remaining host effects.
Okabe: undraft + squash-merge when ready.
Summary
Phase 2c of #90 mediates
(read_file)on generated Go and JavaScript under the existingfilesystemgrant (capability.ForConstruct("read_file")/OpReadFile). The runner grant isHOWLFRAME_ALLOW_CAPS, the same comma-separated list as-allow-caps.An empty, unset, or non-
filesystemgrant fails withCAPABILITY_DENIED: capability denied: filesystembeforeos.ReadFileorreadFileSync. The denial does not include the path, and the file is not opened. Afilesystemgrant reads the file.Go
try_letstill binds(bytes, error)fromhowlFrameReadFile, so a granted miss stays an IO error.letandbytes_to_stringusehowlFrameReadFileBytes. JavaScript returns UTF-8 text after the same check. The interpreter reads only after its existingfilesystemcheck, so the conformance case can include it. The bytecode VM already gatesOpReadFilebefore the read.tests/conformance/lowered_hfir_abi_v1.jsonaddsread_file_deniedandread_file_grantedfor the interpreter, the bytecode VM, Go, and JavaScript. The fixture reads/tmp/howlframe-abi-v1-phase2c.txt. The conformance test writesphase2c-read-markerthere first, because generated Go runs in its own directory.write_fileandmkdirare unchanged. Production-compile-bcis stillrunHFIRGatethen AST bytecode. #90 stays Partial.Journal:
docs/journals/2026-09-30_lowered_hfir_abi_phase2c_read_file.md.How to test
Denied hosts exit nonzero with
CAPABILITY_DENIEDand do not printphase2c-read-marker. With-allow-caps filesystem(orHOWLFRAME_ALLOW_CAPS=filesystemfor generated hosts) they print that marker.go test ./...passed locally.