diff --git a/Contributing.md b/CONTRIBUTING.md similarity index 98% rename from Contributing.md rename to CONTRIBUTING.md index 82672f347..3d6f8916f 100644 --- a/Contributing.md +++ b/CONTRIBUTING.md @@ -7,7 +7,7 @@ Interested in participating? Please follow Also, please be sure to read [the README.md](README.md) for this repository. -To contribute to an [existing proposal](https://github.com/WebAssembly/WASI/blob/main/Proposals.md), +To contribute to an [existing proposal](https://github.com/WebAssembly/WASI/blob/main/docs/Proposals.md), refer to the linked proposal repository. The start a new proposal, the first step is to file an issue in the @@ -46,7 +46,7 @@ During this phase: 1. An issue is filed on the [WASI repository](https://github.com/WebAssembly/WASI/issues) to present the idea. 1. Discussion on the API occurs on the issue. - 1. A champion or champions emerge. They may add the proposal to the [proposal list](https://github.com/WebAssembly/WASI/blob/main/Proposals.md) at phase 0. + 1. A champion or champions emerge. They may add the proposal to the [proposal list](https://github.com/WebAssembly/WASI/blob/main/docs/Proposals.md) at phase 0. 1. The champion(s) put together a description of the API in their own GitHub repository or on the issue. You can use the [proposal template] if you like, but it's not required in this phase. ### 1. Feature Proposal [WASI Subgroup] @@ -58,7 +58,7 @@ Entry requirements: During this phase: - 1. If the proposal is not already listed, it should be added to the [proposal list](https://github.com/WebAssembly/WASI/blob/main/Proposals.md) at this time. + 1. If the proposal is not already listed, it should be added to the [proposal list](https://github.com/WebAssembly/WASI/blob/main/docs/Proposals.md) at this time. 1. A new repository, forking the [proposal template] repo, is created by one of the SG chairs, or transferred to the WebAssembly organization by the champion. 1. The champion will attempt to reach broad consensus in the Subgroup. 1. Pull requests and issues are used to iterate on the design of the API. Specifically, an overview document must be produced that specifies the API with reasonably precise and complete language before attempting to move to phase 2 (meaning it is sufficiently precise to be implemented following this description, without obvious holes or ambiguities). diff --git a/README.md b/README.md index 465cfa234..f8f9a7f2a 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ virtualizability, and more. ## Find the APIs Development of each API happens in its own repo, which you can access -from the [proposals list](Proposals.md). +from the [proposals list](docs/Proposals.md). This repo is for general discussion, as well as documenting how we work and high-level goals. @@ -33,112 +33,8 @@ and high-level goals. ## Propose a new API If you would like to create a new proposal, get started with our -[Contributing guide](Contributing.md). +[Contributing guide](CONTRIBUTING.md). All new API proposals should use the new format and the new repo structure that is shown in the [proposal template](https://github.com/WebAssembly/wasi-proposal-template). See the [Wit in WASI](docs/WitInWasi.md) document for more information about using Wit for WASI proposals. - -## WASI High Level Goals - -(In the spirit of [WebAssembly's High-Level Goals](https://github.com/WebAssembly/design/blob/main/HighLevelGoals.md).) - -1. Define a set of portable, modular, runtime-independent, and - WebAssembly-native APIs which can be used by WebAssembly code to interact - with the outside world. These APIs preserve the essential sandboxed nature of - WebAssembly through a [Capability-based] API design. -2. Specify and implement incrementally. Start with a Minimum Viable Product - (MVP), then adding additional features, prioritized by feedback and - experience. -3. Supplement API designs with documentation and tests, and, when feasible, - reference implementations which can be shared between wasm engines. -4. Make a great platform: - * Work with WebAssembly tool and library authors to help them provide - WASI support for their users. - * When being WebAssembly-native means the platform isn't directly - compatible with existing applications written for other platforms, - design to enable compatibility to be provided by tools and libraries. - * Allow the overall API to evolve over time; to make changes to API - modules that have been standardized, build implementations of them - using libraries on top of new API modules to provide compatibility. - -[Capability-based]: https://en.wikipedia.org/wiki/Capability-based_security - -## WASI Design Principles - -### Capability-based security - -WASI is designed with capability-based security principles, using the -facilities provided by the Wasm [component model]. All access to external -resources is provided by capabilities. - -There are two kinds of capabilities: - - - Handles, defined in the [component-model type system], dynamically - identify and provide access to resources. They are unforgeable, meaning - there's no way for an instance to acquire access to a handle other than - to have another instance explicitly pass one to it. - - - Link-time capabilities, which are functions which require no handle - arguments, are used sparingly, in situations where it's not necessary - to identify more than one instance of a resource at runtime. Link-time - capabilities are *interposable*, so they are still refusable in a - capability-based security sense. - -WASI has no *ambient authorities*, meaning that there are no global -namespaces at runtime, and no global functions at link time. - -[component model]: https://github.com/WebAssembly/component-model -[component-model type system]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/Explainer.md#type-definitions - -Note that this is a different sense of "capability" than [Linux -capabilities](http://man7.org/linux/man-pages/man7/capabilities.7.html) -or the withdrawn [POSIX -capabilities](https://archive.org/details/posix_1003.1e-990310), which -are per-process rather than per-resource. - -### Interposition - -Interposition in the context of WASI interfaces is the ability for a -Webassembly instance to implement a given WASI interface, and for a -consumer WebAssembly instance to be able to use this implementation -transparently. This can be used to adapt or attenuate the functionality -of a WASI API without changing the code using it. - -Component model interfaces always support link-time interposition. While -WASI APIs are often implemented in hosts, they can also be implemented -in Wasm, which may itself be a wrapper around the host. This may be used -to implement *attenuation*, providing filtered access to the underlying -host-provided functionality. - -Interposition is sometimes referred to as "virtualization", however we -use "interposition" here because the word "virtualization" has several -related meanings. - -### Compatibility - -Compatibility with existing applications and libraries, as well as -existing host platforms, is important, but will sometimes be in conflict -with overall API cleanliness, safety, performance, or portability. -Where practical, WASI seeks to keep the WASI API itself free of -compatibility concerns, and provides compatibility through libraries, -such as WASI libc, and tools. This way, applications which don't require -compatibility for compatibility's sake aren't burdened by it. - -### Portability - -Portability is important to WASI, however the meaning of portability -will be specific to each API. - -WASI's modular nature means that engines don't need to implement every -API in WASI, so we don't need to exclude APIs just because some host -environments can't implement them. We prefer APIs which can run across -a wide variety of engines when feasible, but we'll ultimately decide -whether something is "portable enough" on an API-by-API basis. - -### Modularity - -WASI will include many interfaces that are not appropriate for every host -environment, so WASI uses the component model's worlds mechanism to allow -specific sets of APIs to be described which meet the needs of different -environments. diff --git a/Charter.md b/docs/Charter.md similarity index 100% rename from Charter.md rename to docs/Charter.md diff --git a/docs/DesignPrinciples.md b/docs/DesignPrinciples.md new file mode 100644 index 000000000..a17deed09 --- /dev/null +++ b/docs/DesignPrinciples.md @@ -0,0 +1,78 @@ +## WASI Design Principles + +### Capability-based security + +WASI is designed with capability-based security principles, using the +facilities provided by the Wasm [component model]. All access to external +resources is provided by capabilities. + +There are two kinds of capabilities: + + - Handles, defined in the [component-model type system], dynamically + identify and provide access to resources. They are unforgeable, meaning + there's no way for an instance to acquire access to a handle other than + to have another instance explicitly pass one to it. + + - Link-time capabilities, which are functions which require no handle + arguments, are used sparingly, in situations where it's not necessary + to identify more than one instance of a resource at runtime. Link-time + capabilities are *interposable*, so they are still refusable in a + capability-based security sense. + +WASI has no *ambient authorities*, meaning that there are no global +namespaces at runtime, and no global functions at link time. + +[component model]: https://github.com/WebAssembly/component-model +[component-model type system]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/Explainer.md#type-definitions + +Note that this is a different sense of "capability" than [Linux +capabilities](http://man7.org/linux/man-pages/man7/capabilities.7.html) +or the withdrawn [POSIX +capabilities](https://archive.org/details/posix_1003.1e-990310), which +are per-process rather than per-resource. + +### Interposition + +Interposition in the context of WASI interfaces is the ability for a +Webassembly instance to implement a given WASI interface, and for a +consumer WebAssembly instance to be able to use this implementation +transparently. This can be used to adapt or attenuate the functionality +of a WASI API without changing the code using it. + +Component model interfaces always support link-time interposition. While +WASI APIs are often implemented in hosts, they can also be implemented +in Wasm, which may itself be a wrapper around the host. This may be used +to implement *attenuation*, providing filtered access to the underlying +host-provided functionality. + +Interposition is sometimes referred to as "virtualization", however we +use "interposition" here because the word "virtualization" has several +related meanings. + +### Compatibility + +Compatibility with existing applications and libraries, as well as +existing host platforms, is important, but will sometimes be in conflict +with overall API cleanliness, safety, performance, or portability. +Where practical, WASI seeks to keep the WASI API itself free of +compatibility concerns, and provides compatibility through libraries, +such as WASI libc, and tools. This way, applications which don't require +compatibility for compatibility's sake aren't burdened by it. + +### Portability + +Portability is important to WASI, however the meaning of portability +will be specific to each API. + +WASI's modular nature means that engines don't need to implement every +API in WASI, so we don't need to exclude APIs just because some host +environments can't implement them. We prefer APIs which can run across +a wide variety of engines when feasible, but we'll ultimately decide +whether something is "portable enough" on an API-by-API basis. + +### Modularity + +WASI will include many interfaces that are not appropriate for every host +environment, so WASI uses the component model's worlds mechanism to allow +specific sets of APIs to be described which meet the needs of different +environments. diff --git a/docs/HighLevelGoals.md b/docs/HighLevelGoals.md new file mode 100644 index 000000000..8788f7576 --- /dev/null +++ b/docs/HighLevelGoals.md @@ -0,0 +1,24 @@ +## WASI High Level Goals + +(In the spirit of [WebAssembly's High-Level Goals](https://github.com/WebAssembly/design/blob/main/HighLevelGoals.md).) + +1. Define a set of portable, modular, runtime-independent, and + WebAssembly-native APIs which can be used by WebAssembly code to interact + with the outside world. These APIs preserve the essential sandboxed nature of + WebAssembly through a [Capability-based] API design. +2. Specify and implement incrementally. Start with a Minimum Viable Product + (MVP), then adding additional features, prioritized by feedback and + experience. +3. Supplement API designs with documentation and tests, and, when feasible, + reference implementations which can be shared between wasm engines. +4. Make a great platform: + * Work with WebAssembly tool and library authors to help them provide + WASI support for their users. + * When being WebAssembly-native means the platform isn't directly + compatible with existing applications written for other platforms, + design to enable compatibility to be provided by tools and libraries. + * Allow the overall API to evolve over time; to make changes to API + modules that have been standardized, build implementations of them + using libraries on top of new API modules to provide compatibility. + +[Capability-based]: https://en.wikipedia.org/wiki/Capability-based_security diff --git a/proposals/README.md b/docs/Preview2.md similarity index 97% rename from proposals/README.md rename to docs/Preview2.md index 7f5c2352f..3ff1b003b 100644 --- a/proposals/README.md +++ b/docs/Preview2.md @@ -89,7 +89,7 @@ Preview 2 in terms of Preview 3. The release criteria of Preview 3 will include that performance will be measured and addressed. -[WASI Subgroup Phase Process]: https://github.com/WebAssembly/WASI/blob/main/Contributing.md#the-phase-process -[portability criteria]: https://github.com/WebAssembly/WASI/blob/main/Contributing.md#2-feature-description-available-wasi-subgroup +[WASI Subgroup Phase Process]: https://github.com/WebAssembly/WASI/blob/main/CONTRIBUTING.md#the-phase-process +[portability criteria]: https://github.com/WebAssembly/WASI/blob/main/CONTRIBUTING.md#2-feature-description-available-wasi-subgroup [worlds]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md#wit-worlds [launch criteria]: #wasi-preview-2-launch-criteria diff --git a/Proposals.md b/docs/Proposals.md similarity index 98% rename from Proposals.md rename to docs/Proposals.md index 8dc0c9cd2..ff5541bb2 100644 --- a/Proposals.md +++ b/docs/Proposals.md @@ -4,8 +4,8 @@ WASI APIs are developed as proposals. These proposals go through 5 phases of dev You can learn more about contributing new proposals (and other ways to contribute) in our [Contributing] guide. -[the WASI Subgroup's Phase Process]: https://github.com/WebAssembly/WASI/blob/main/Contributing.md#the-phase-process -[Contributing]: https://github.com/WebAssembly/WASI/blob/main/Contributing.md +[the WASI Subgroup's Phase Process]: https://github.com/WebAssembly/WASI/blob/main/CONTRIBUTING.md#the-phase-process +[Contributing]: https://github.com/WebAssembly/WASI/blob/main/CONTRIBUTING.md ## Active Proposals diff --git a/proposals/cli/README.md b/proposals/cli/README.md index 7df15996a..90b388004 100644 --- a/proposals/cli/README.md +++ b/proposals/cli/README.md @@ -6,7 +6,7 @@ A proposed [WebAssembly System Interface](https://github.com/WebAssembly/WASI) A wasi-cli is currently in [Phase 3]. -[Phase 3]: https://github.com/WebAssembly/WASI/blob/main/Proposals.md#phase-3---implementation-phase-cg--wg +[Phase 3]: https://github.com/WebAssembly/WASI/blob/main/docs/Proposals.md#phase-3---implementation-phase-cg--wg ### Champions diff --git a/proposals/clocks/README.md b/proposals/clocks/README.md index a99080fae..b7d0c3ef7 100644 --- a/proposals/clocks/README.md +++ b/proposals/clocks/README.md @@ -6,7 +6,7 @@ A proposed [WebAssembly System Interface](https://github.com/WebAssembly/WASI) A WASI-clocks is currently in [Phase 3]. -[Phase 3]: https://github.com/WebAssembly/WASI/blob/main/Proposals.md#phase-3---implementation-phase-cg--wg +[Phase 3]: https://github.com/WebAssembly/WASI/blob/main/docs/Proposals.md#phase-3---implementation-phase-cg--wg ### Champions diff --git a/proposals/filesystem/README.md b/proposals/filesystem/README.md index b71eab4ee..06c90fc6f 100644 --- a/proposals/filesystem/README.md +++ b/proposals/filesystem/README.md @@ -6,7 +6,7 @@ A proposed [WebAssembly System Interface](https://github.com/WebAssembly/WASI) A WASI-filesystem is currently in [Phase 3]. -[Phase 3]: https://github.com/WebAssembly/WASI/blob/main/Proposals.md#phase-3---implementation-phase-cg--wg +[Phase 3]: https://github.com/WebAssembly/WASI/blob/main/docs/Proposals.md#phase-3---implementation-phase-cg--wg ### Champions diff --git a/proposals/http/README.md b/proposals/http/README.md index bfe0572a4..5ed5e7f24 100644 --- a/proposals/http/README.md +++ b/proposals/http/README.md @@ -4,7 +4,7 @@ A proposed [WebAssembly System Interface](https://github.com/WebAssembly/WASI) A ### Current Phase -wasi-http is currently in [Phase 3](https://github.com/WebAssembly/WASI/blob/main/Proposals.md#phase-3---implementation-phase-cg--wg) +wasi-http is currently in [Phase 3](https://github.com/WebAssembly/WASI/blob/main/docs/Proposals.md#phase-3---implementation-phase-cg--wg) ### Champions diff --git a/proposals/io/README.md b/proposals/io/README.md index 9efd0bcaf..e8143232b 100644 --- a/proposals/io/README.md +++ b/proposals/io/README.md @@ -6,7 +6,7 @@ A proposed [WebAssembly System Interface](https://github.com/WebAssembly/WASI) A WASI I/O is currently in [Phase 3]. -[Phase 3]: https://github.com/WebAssembly/WASI/blob/main/Proposals.md#phase-3---implementation-phase-cg--wg +[Phase 3]: https://github.com/WebAssembly/WASI/blob/main/docs/Proposals.md#phase-3---implementation-phase-cg--wg ### Champions diff --git a/proposals/random/README.md b/proposals/random/README.md index f68b5ace6..d13e67256 100644 --- a/proposals/random/README.md +++ b/proposals/random/README.md @@ -6,7 +6,7 @@ A proposed [WebAssembly System Interface](https://github.com/WebAssembly/WASI) A WASI-random is currently in [Phase 3]. -[Phase 3]: https://github.com/WebAssembly/WASI/blob/main/Proposals.md#phase-3---implementation-phase-cg--wg +[Phase 3]: https://github.com/WebAssembly/WASI/blob/main/docs/Proposals.md#phase-3---implementation-phase-cg--wg ### Champions diff --git a/proposals/sockets/README.md b/proposals/sockets/README.md index bc2f088b9..afb0ce883 100644 --- a/proposals/sockets/README.md +++ b/proposals/sockets/README.md @@ -4,7 +4,7 @@ A proposed [WebAssembly System Interface](https://github.com/WebAssembly/WASI) A ### Current Phase -[Phase 3](https://github.com/WebAssembly/WASI/blob/main/Proposals.md#phase-3---implementation-phase-cg--wg) +[Phase 3](https://github.com/WebAssembly/WASI/blob/main/docs/Proposals.md#phase-3---implementation-phase-cg--wg) ### Champions