Expand description
Packages, decl.toml, and decl.lock (§8.6–8.7) — a port of the
reference implementation’s package.ts: exact-pinned dependencies,
fail-closed manifests, content-hashed reproducibility. Conventions:
dependency packages live under <root>/decl_modules/<name>/ in a flat
layout, and the lock file is line-based name version sha256 in name
order.
Structs§
- Manifest
- a
decl.toml(§8.6) - Package
Universe - the closed set of packages an entry file’s manifest reaches (§8.6)
- Resolved
Package - a dependency resolved to a directory
Functions§
- find_
package_ root - the enclosing package root (the nearest ancestor with decl.toml)
- lock_
text - The lock file’s text (§8.7): one line per package,
name version hash, sorted by name. - open_
package_ universe - Open the package universe of an entry file: the manifest found upward from
it, its dependencies resolved to a closed set.
Nonewhen no manifest governs the entry. - package_
hash - content hash: SHA-256 over the package’s module files in canonical path order (§8.7)
- parse_
manifest - Read a manifest, fail-closed (D28): an unknown field is E3011, a range pin
E3012, a missing file E3004 — each reported through
reportwith the code and the message.Nonewhen the manifest cannot be used. - verify_
lock - fail-closed verification: missing entry, version drift, or hash mismatch stops resolution — never a silent re-resolve
- write_
lock - Write the lock file into the package root; returns its path.
Type Aliases§
- Resolver
- maps a package specifier, from a directory, to the package’s path or to a (code, message) diagnostic