Select checked implementations explicitly by target and ABI
This commit is contained in:
@@ -113,3 +113,29 @@ Common implementation helpers can still be ordinary generic TypeScript functions
|
||||
This does not implement universal runtime type application or legacy constructors.
|
||||
The `camino-portable-bindings` check compiles positive/negative typed consumers and
|
||||
executes both specializations in Node, Chromium Window, and Worker hosts.
|
||||
|
||||
Use `selectArtifactImplementation(checkedManifest, selection)` to choose an
|
||||
implementation by target, ABI, required export IDs, and optionally its exact ID.
|
||||
Without an ID, exactly one candidate must match. Missing exports, wrong targets,
|
||||
and ambiguous choices fail; manifest order never determines execution. This
|
||||
selects already checked bytes and does not grant permission to run untrusted
|
||||
package code in process. Multiple selected implementations remain part of the
|
||||
same checked world's complete artifact inventory.
|
||||
|
||||
```ts
|
||||
const implementation = selectArtifactImplementation(manifest, {
|
||||
target: "server",
|
||||
compatibility: "quixos-service-v1",
|
||||
id: "isolated-service",
|
||||
exports: requiredExports,
|
||||
});
|
||||
```
|
||||
|
||||
Consumers use the selected entrypoint, registry export and export coverage from
|
||||
that manifest. The reader's Nix builder accepts per-package
|
||||
`implementationSelection = { "package:reader-runtime@1" = {
|
||||
browser = "browser-module"; server = "server-module"; service = "service";
|
||||
}; };` overrides. Its fixture requires one implementation per lane covering that
|
||||
lane's needed exports; the selector itself permits a smaller requested subset.
|
||||
The installation records the chosen service and module entries. Process lifecycle
|
||||
and trusted-module placement still belong to the existing runner.
|
||||
|
||||
Reference in New Issue
Block a user