pkg/lock
lib/pkg/lock.vklib/pkg/lock.vk
Pure-Veko homoiconic veko.lock codec, cryptographic verifier, ~/.veko_modules global package store,
and official (https://veko-lang.org/pkg) + decentralized HTTPS .vkp resolver.
Records deterministic sorted LockEntry records (name, version, source, sha256, merkle_root, signer)
in canonical Veko data syntax—verifying archive SHA-256, Merkle tree roots, and Ed25519 / ML-DSA-65 signatures.
DEFAULT-REGISTRY = fn [] str
Official Veko HTTPS package registry root (veko-lang.org), overrideable via VEKO_REGISTRY.
registry-base = fn [] str
Returns the active HTTPS registry base URL (VEKO_REGISTRY when set, otherwise https://veko-lang.org/pkg).
modules-home = fn [] str
Resolves the shared user-level .veko_modules directory (VEKO_MODULES -> $HOME/.veko_modules / %USERPROFILE%\.veko_modules -> .veko/modules).
expand-spec-with-registry = fn [spec str, reg_base str] str
Expands a dependency specifier into its canonical source URL or local path:
- 'http-extra@1.2.0' -> 'https://veko-lang.org/pkg/http-extra/1.2.0.vkp' (or VEKO_REGISTRY)
- 'https://host/pkg.vkp' -> unchanged decentralized URL
- '../shared' or 'vendor/pkg.vkp' -> unchanged local path
use [lk = pkg/lock]
u1 = lk/expand-spec-with-registry 'sqlite-orm@1.0.2' 'https://veko-lang.org/pkg'
u2 = lk/expand-spec-with-registry 'https://cdn.example.org/p.vkp' 'https://veko-lang.org/pkg'
if u1 != 'https://veko-lang.org/pkg/sqlite-orm/1.0.2.vkp' or u2 != 'https://cdn.example.org/p.vkp' [ err 'spec expand failed' ] else [ .ok ]
infer-dep-name = fn [spec str] str
Extracts the default dependency alias from a specifier ('sqlite-orm@1.0.2' -> 'sqlite-orm', 'https://.../foo-1.0.vkp' -> 'foo').
fetch-vkp-url = fn [url str] bytes
Downloads raw binary .vkp bytes over HTTP/HTTPS across all 3 execution tracks (lib/net/client.vk).
LockEntry = struct { name str, version str, source str, sha256 str, merkle_root str, signer str = ... }
One cryptographically pinned package dependency in veko.lock.
Lockfile = struct { version i64 = ..., packages block[LockEntry] }
Parsed representation of a veko.lock manifest.
encode = fn [lf Lockfile] str
Formats a Lockfile into canonical, idempotent homoiconic veko.lock text.
use [lk = pkg/lock]
lf = lk/Lockfile {
version = 1
packages = [
lk/LockEntry {
name = 'codec_ext'
version = '1.2.0'
source = 'pkgs/codec_ext.vkp'
sha256 = '0123456789abcdef'
merkle_root = 'fedcba9876543210'
signer = 'ed25519:aaaa'
}
]
}
txt = lk/encode lf
parsed = lk/decode txt
if (len parsed.packages) != 1 or parsed.packages[0].name != 'codec_ext' [ err 'lock roundtrip failed' ] else [ .ok ]
decode = fn [src str] Lockfile
Zero-eval deterministic parser for homoiconic veko.lock files.
lock-vkp-bytes = fn [dep_name str, source_ref str, raw bytes, trust_keys block[str]] LockEntry
Builds a LockEntry from a signed .vkp bundle raw (verifying trust_keys when non-empty, or self-signature otherwise).
verify-locked-bytes = fn [entry LockEntry, raw bytes, extra_trust block[str]] vkp/VkpBundle
Verifies raw .vkp bytes against every cryptographic field pinned in entry (sha256, merkle_root, and signer + extra_trust).
global-cache-path = fn [entry LockEntry] str
Returns the global content-addressed cache path <~/.veko_modules>/cache/<sha256>.vkp for entry.
installed-pkg-path = fn [entry LockEntry] str
Returns the human-readable installed snapshot path <~/.veko_modules>/pkgs/<name>@<version>.vkp for entry.
cache-path = fn [proj_dir str, entry LockEntry] str
Returns the workspace-local content-addressed cache path <proj_dir>/.veko/pkg_cache/<sha256>.vkp for entry.
locate-cached-vkp = fn [proj_dir str, entry LockEntry] str
Resolves cached .vkp path preferring ~/.veko_modules/cache/<sha256>.vkp if present, then <proj_dir>/.veko/pkg_cache/<sha256>.vkp.
find-entry = fn [lf Lockfile, dep_name str] LockEntry
Looks up dep_name inside lf (err if absent).