docs: attenuation by narrowing design doc - #1047
Draft
ci-belphegor wants to merge 1 commit into
Draft
Conversation
Specifies narrowing — attenuation restricted to unaltered method forwards over subsets of a base's arguments — as a library exported from `@metamask/kernel-utils`, the fs capability it is first applied to, and the kernel integration it is meant to lead to. Adds a `narrowing` glossary entry. No code; the implementation follows in separate pull requests. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
ci-belphegor
force-pushed
the
grypez/narrowing-1-docs
branch
from
September 11, 2026 11:42
598072a to
8a78cf0
Compare
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
Design doc for attenuation by narrowing: a restricted form of attenuation in which every method of the derived capability is an unaltered forward to the same method of the capability it narrows, admitting a subset of that method's arguments. The restriction buys something worth having — narrowings of a common capability form a lattice whose join is computable syntactically, so overlapping grants combine without ambiguity.
Also adds a
narrowingentry to the glossary.This document is normative for semantics. The implementation follows in the rest of this stack.
Notes for reviewers
Four claims in this document were corrected during implementation, each after being measured rather than argued about. They are worth knowing because they are the parts most likely to be wrong again:
pathUnderconfines nothing on its own. A pattern cannot see inside a segment, so['srv', 'data/../../etc']satisfiespathUnder(['srv'])and resolves to/etc. The capability must reject malformed segments separately.fsdoes not actually enforce anti-aliasing, which an earlier draft claimed it did.lstatfollows every intermediate component, somakeNoSymlinksCaveatcatches only a final-position symlink. Documented as an unmet obligation with a Roadmap entry rather than fixed here.@endo/pass-stylerejectsBufferandUint8Arrayas mutable;hardendoes not help), soreadFiletakes a required encoding and returns a string.Stack
PR 1 of 12. Base:
main.