Current behavior
The install pipeline splits into plan (pure routing) and commit (resolution, integrity, materialization, writes).facet add, facet remove, and facet install converge on the same commit phase — they differ only in the they produce.
The pipeline
Parse sources
Registry (
name@1.*), GitHub (github:owner/repo#ref), git URLs, local paths. Caret/tilde/comparator ranges are rejected.Resolve versions
Additions always re-resolve non-exact specifiers. Reproductions trust the lockfile when satisfying; re-resolve only absent or stale entries.
Cache + integrity
Cache keyed by
<name>@<version>. Hits are re-hashed against the . Tampered content is evicted. Lockfile pins are string-compared; new entries require .Materialize
Assets written to every selected adapter. Skip-if-identical. Inverse ops journaled for rollback.
The manifest is never written ahead of the install. A failed
facet add leaves the project exactly as it was.Lockfile shape
Per facet:{source, version, integrity, assets}. The source is tagged:
| Kind | Fields | Notes |
|---|---|---|
registry | registry | Version in the entry’s version field |
git | url, commit | Ref stays in facets.json |
local | path | Resolved local path |
Frozen lockfile
--frozen-lockfile makes the lockfile authoritative.
Additions or removals are rejected immediately. Only
facet install can run frozen.| Behavior | Frozen mode |
|---|---|
| Version resolution | Forbidden |
| Archive download | Allowed (reproduction) |
| Integrity verification | Required for every facet, including local |
| Drift removal + receipt | Runs |
| Lockfile / manifest write | Never |
Open-beta target (future)
Server resolution
Two resolution paths will be added:Source-mode servers
Source-mode servers
Query the registry for the latest version at or above the floor constraint. Download, verify, compute API surface hash.
Ref-mode servers (OCI)
Ref-mode servers (OCI)
Resolve the OCI image tag to a digest. Pin the digest. Compute API surface hash. If the reference is already a digest, use it as-is.
Upgrade
facet upgrade will check for newer versions, surface text diffs and API surface changes, and let the consumer choose which updates to apply.
Remove
facet remove deletes a facet’s assets via the delta-based pipeline. Assets are removed using the install receipt — no cache or network needed. Manifest, lockfile, and receipt are written together on success.
Not in the install flow
- Text asset resolution — text is in the archive. No install-time fetching.
- Transitive server resolution — servers are terminal.
- Disk layout — determined by adapters, not the specification.