Expand description
The Bynk registry’s admission rules, I/O-free (first-party registry track §3.4, decision E of #2321): unpack, pack and admit an archive in memory.
No std::fs, no ring, no network. The native registry (bynk registry add / serve) links this as a library; the same source builds to a
standalone wasm32 module with a C ABI (abi) that the hosted registry’s
admission adapter loads, so the client, the reference server and the
service apply one implementation.
Modules§
- abi
- The module boundary (first-party registry track §3.4): a plain C ABI, no
wasm-bindgen, so the build is one.wasmfile and no glue. - protocol
- The registry protocol’s data (packaging slice 4a, #2274, decision D; track
design/tracks/packaging.md§6.1): a registry’sconfig.json, its index lines, and the canonical payloads their signatures cover.
Structs§
- Admitted
- An upload that passed admission.
- Archive
Error - Why an archive was refused: always
bynk.registry.bad_archive. - Refusal
- Why a registry refused an upload: a stable
codefor the publish API’s JSON error, and a message. - Requirement
- A dependency or npm requirement in an index line.
- Tree
- A package’s files in memory:
/-separated relative path to bytes, ordered byte-wise by path — the order an archive and its checksum use.
Constants§
- BAD_
ARCHIVE - MAX_
UNPACKED - The most an archive may unpack to.
Functions§
- admit
- Admit
upload. WhenexpectedisSome((name, version)), the package must be exactly that. - is_
excluded - What a package archive leaves out: build output, npm’s cache, and every
hidden file or directory (
.git,.env, editor state) — a published package carries its sources, never a secret beside them. - pack
- Pack
treecanonically: the archive bytes and the tree checksum a consumer will compute from them. Excluded files (is_excluded) are left out. - unpack
- Unpack
archiveinto aTree, applying the hardening rules above.