feat(kernel-platforms): vend fs as an exo - #1056
Draft
ci-belphegor wants to merge 1 commit into
Draft
Conversation
Replace the hardened record of caveated functions with an exo built from explicit `M.interface` method guards, and flatten the `promises.readFile` config nesting into a flat `methods` list to match the exo's flat method namespace. Paths stay strings. Guards are explicit rather than `makeDefaultExo`'s `defaultGuards: 'passable'` because narrowing conjoins a delta onto a per-argument guard, so there has to be one to conjoin onto. They are `M.callWhen` because narrowed methods forward through `E()` and every derived guard is asyncified. No changelog entry: 9a/9b/9c squash to a single commit on main, so the one `**BREAKING:**` entry covering the whole shape change lands in 9c. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
ci-belphegor
force-pushed
the
grypez/narrowing-9b-fs-exo
branch
from
September 11, 2026 11:42
40ec599 to
55901ff
Compare
ci-belphegor
added this pull request to stack #1060
September 11, 2026 11:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
Converts
fsfrom a hardened record of caveated functions into an exo with explicitM.interfacemethod guards, and flattens the nestedpromises: { readFile: true }config into a flatmethods: ['readFile']list, since exos have a flat method namespace.A vat's global
fsbecomes the exo itself:await E(fs).readFile('/srv/x')rather thanfs.promises.readFile(...).There is exactly one thing to judge in this PR: is this the right exo shape, and are the guards right? Paths stay strings here; segment arrays are the next PR, deliberately, so that a reviewer is not simultaneously assessing path semantics and interface guards.
Notes for reviewers
The guards are written out per method rather than via
makeDefaultExo, which departs from the repo convention on purpose:makeDefaultExoyieldsdefaultGuards: 'passable'and an empty guard map, and narrowing conjoins a delta onto a per-argument guard, so there has to be one to conjoin onto. There is a comment at the interface saying so.defaultGuardsis omitted entirely, so the guard map is the sole authority — a method absent from the map is uncallable rather than falling back to "any passable args." That applies the design's "omission removes authority" default one level down.A real surface reduction, flagged rather than buried.
M.any()matches Passables only, soreadFile(path, { signal: abortSignal })is now rejected where the raw function accepted it. No caller in this repo does that, but it is a genuine narrowing of behavior, not just a reshaping. It is named in 9c's changelog entry.An omitted
methodsyields an exo with zero methods; an unknown method name is rejected by the config struct.No changelog here — the 9a/9b/9c chain squashes to one commit and the single
**BREAKING:**entry lands in 9c.Stack
PR 10 of 12. Base: #1055.