Projections
A projection is how one ecosystem’s bytes come out of the store and into the form that ecosystem’s own clients read. The store holds the bytes once, by digest; a projection packs an output into them on the way in and renders a consumer layout from them on the way out. Any number are bound at once, by the repository’s authors (92).
The contract
Section titled “The contract”The seam is six operations (84 to 86, 137, 140). pack takes an output at a build identity and, where the bytes are an artifact’s, the version, and answers the ecosystem’s own bytes for it and the metadata the ecosystem gives them. A cache entry packs with no version, and its bytes carry no metadata that makes an offer (100). render takes a set of artifacts and their metadata, or of cache entries by build identity, and answers a consumer layout in the ecosystem’s own form, and which versions, or which build identities, it holds. serve takes a consumer layout and answers the ecosystem’s own clients over the protocol they read, for an ecosystem whose clients read no files. pinned takes a checkout and answers the names and versions its lockfile pins, as the lockfile spells them, or absent where it holds no lockfile of the ecosystem. requires takes the artifact of a version a layout holds and answers the names of the ecosystem its manifest requires, each with the range it requires, as the manifest spells them. satisfying takes a range and some versions and answers those that satisfy the range, newest first by the ecosystem’s own ordering, never by spelling or by the order given (23). An ecosystem with no manifest, a file, an image or moon’s cache, answers both with none, an empty list, and never absent. The same outputs and the same version, or the same build identity, pack to the same bytes, or the projection says it cannot promise so (87). A projection that packs no cache entries answers absent for one, as the file and image projections do. A layout holds only versions whose verdict under its policy is satisfied.
pack is the ecosystem’s own packager run against outputs the build left, with the version handed over the way that packager takes it, and never an archive opened and edited (C.11). A compiled binary carries the revision and the build identity, never the version (24).
Members
Section titled “Members”| ecosystem | pack | render | serve | status |
|---|---|---|---|---|
| npm | the tarball npm pack writes, with package.json as metadata |
a packument and tarballs under a registry read layout | the host’s one process, at http://127.0.0.1:7420/<owner>/<name>/npm/, the same on every host (49, 114), since npm reads no files |
built |
| Maven | the jar and its POM | a maven2 layout with checksums and maven-metadata.xml |
not needed: a file:// repository |
designed |
| Python | the wheel and sdist, with their metadata | a simple index per PEP 503 | not needed: find-links or a file:// index |
designed |
| Go | the module zip | the module proxy layout | not needed: GOPROXY=file:// |
designed |
| Cargo | the crate file, cargo package --no-verify after the component’s version is set on every crate of the component, so a path dependency on a sibling crate is rewritten to that version’s requirement as cargo does (110); a crate belongs to the component whose paths hold its manifest (123); a path dependency on a sibling crate the component does not declare as an output is refused naming the crate, since a consumer could resolve nothing for it; and a path dependency on a crate of another component is packed as a dependency on the version requirement the manifest writes for it, refused naming the crate where the store holds no such version (138) |
a sparse registry under the served address, sparse+http://127.0.0.1:7420/<owner>/<name>/cargo/, the same on every host (49, 114), named timber in the checkout’s cargo configuration |
the host’s one process, since a sparse index is read over the protocol | built |
| NuGet | the package file | a folder feed in the v3 layout | not needed | designed |
| a file | any file, with a declared media type | a directory | not needed | pack built: the output’s one file, its own bytes under every version, with no media type yet; render designed |
| an image | an image as pushed | the OCI layout itself | the layout served as a registry | pack built: an OCI image archive, as docker save writes one, its own bytes under every version; render and serve designed |
| moon’s cache | a task’s output archive, by task hash | moon’s outputs directory, one archive per hash, rendered from the task hashes the landing’s verdicts name | not needed: moon reads the directory before any remote | pack and render built: a cache entry only, never an artifact; see below |
moon’s cache
Section titled “moon’s cache”The moon cache projection packs no artifact: a pack given a version
answers absent, so no policy file names it for an output (53). Its pack
is the archive moon left for a task that passed,
.moon/cache/outputs/<task hash>.tar.gz, its bytes unchanged and with no
metadata, written to the store as a cache entry under the task hash. It
says it cannot promise the same bytes again, since moon writes each
file’s time and owner into the archive (87). Its render reads each
entry’s bytes from the store, checks they are the entry’s digest, and
writes them as the archive of its task hash, leaving one moon already
holds as it is; a build identity that is no task hash is refused before
anything is written.
timber sync renders the entries of the newest landed revision the
checkout descends from, or of the revision named, from the task hashes
its passing verdicts name, so moon replays what the landing already ran.
An entry the store no longer holds is named as absent and refuses
nothing: the task runs again (54). moon keeps an outputs directory per
checkout, so one sync fills one checkout; the checkouts of a host share
one directory only where each links its .moon/cache/outputs to it, and
the render writes through the link.
The repository binds its projections: the policy file’s [projections]
names the ecosystem of the projection that packs each output, such as
site = "file" or api = "image" (C.10). A projection not yet built
answers render and serve absent, naming the operation.
A publish packs an npm output with npm’s own packager. The output’s
shallowest package.json names the package; the files the build left
under it are copied into a scratch directory, the version is set there
with npm pkg set version=<version>, and npm pack --ignore-scripts
makes the tarball, which is the artifact’s bytes as npm wrote them,
named by the package’s own name (C.11, 84). No script of the package
runs, prepack and prepare among them, and the build’s own files are
never edited, since timber builds nothing (15). npm promises no same
tarball across its own versions, so the projection says it cannot
promise the same bytes again (87).
npm reads no files, so the host’s one serving process serves an npm
layout to it. A consuming repository writes one line in the .npmrc
beside its package.json, once, for each scope its family publishes:
@family:registry=http://127.0.0.1:7420/agentplot/consumer/npm/The address is the host’s process at its one name and port, with the
consuming repository’s owner and name in the path, the same on every
host and in every checkout (114). That line is what makes @family the
family’s: npm reads a package of the scope from the served layout and
from nowhere else, and every other package from the registry it reads
them from now. timber reads nothing else of the file, and writes no
credential into it.
timber sync then renders the layout at .timber/layouts/npm/: the
family versions the checkout’s package-lock.json (or
npm-shrinkwrap.json) pins; for each family package package.json, or
a workspace’s, declares and no lockfile pins yet, the newest version the
policy admits within the range it declares, so a first install needs no
lockfile written by hand; and every family package those versions
require, through every level (137, 140). Each is judged under the policy
as any version is. sync prints where the layout is served and finds the
host’s process, or starts it where none answers; npm cannot start it, so
the process stays while a served layout is there, and ends at its next
idle time once the layout, or its checkout, is gone.
A new family package is declared first and synced, then installed:
npm pkg set dependencies.@family/widget='^1.2.0'timber syncnpm installnpm install @family/widget before the sync answers 404, saying the
layout holds no version of the package and that timber sync holds a
name package.json declares. A tarball the lockfile pins that the layout
lacks is rendered on npm’s request, under the same policy. A version the
policy refuses is never listed; npm’s request for its tarball is
answered 403, and npm prints the version and the claim found wanting
after its status line:
npm error 403 403 Forbidden - GET http://127.0.0.1:7420/agentplot/consumer/npm/@family/widget/-/widget-1.5.0.tgz - … refused: npm @family/widget 1.5.0 at sha256:… wants a claim of acceptance …A version the store does not name is answered 404 the same way, and
one whose source cannot be read 502, carrying that source’s own words
(99, 58, 59). The lockfile npm writes records each family tarball at the
served address, http://127.0.0.1:7420/<owner>/<name>/npm/…, the same
on every host and in every checkout, naming no home, checkout or store
(49).
A family repository declares each crate it publishes as an output of
its component: the packaging task that leaves the crate’s file, such as
a task running cargo package --no-verify --registry timber -p fam-a,
whose output is the .crate file it writes (C.11, 84). A publish reads
the package’s name and its place in the repository from that file, sets
the component’s one version on the package and on every crate of the
same component it reaches by path, and packs the package alone with
cargo package --no-verify --exclude-lockfile, with no lockfile of its
own, so the same tree and version pack to the same bytes (87, 110).
Every manifest it edits gets its own bytes back.
A crate belongs to the component whose paths hold its manifest (123). A path dependency on a sibling, a crate of the same component, is written with a version and the registry, since cargo packages no path dependency without them:
[dependencies]fam-b = { path = "../fam-b", version = "0.0.0", registry = "timber" }The publish gives it the component’s version, and the packed crate
depends on fam-b at that version in the registry, with no path, as
Cargo does for any publish. Every crate of the component a packed crate
reaches is declared as an output too, since a consumer could resolve
nothing for one that is not; a pack that reaches one that is not is
refused naming it and the component.
A path dependency on a crate of another component keeps the requirement
its manifest writes, such as base-c = { path = "../../base/base-c", version = "0.3", registry = "timber" }, and is packed as a dependency
on that requirement. No version of it is picked: which one a build uses
is the consumer’s. The publish reads the store’s versions of it first,
and where none is within the requirement it refuses the pack, naming the
crate, the requirement and the versions the store holds, or that it
holds none (138).
Cargo reads its registry over the sparse protocol, so the host’s one
serving process serves a Cargo layout. A checkout’s
.cargo/config.toml, the publisher’s and the consumer’s alike, holds
one line for it, committed once:
[registries.timber]index = "sparse+http://127.0.0.1:7420/agentplot/consumer/cargo/"The address is the host’s process at its one name and port, with the repository’s owner and name in the path, the same on every host and in every checkout (114). timber writes no cargo configuration, and no credential into one.
A consumer declares a family crate by its requirement, and needs no lockfile before its first sync:
[dependencies]fam-a = { version = "1", registry = "timber" }timber synccargo buildtimber sync renders the layout at .timber/layouts/cargo/: the
family crates the checkout’s Cargo.lock pins; for each crate a
member’s manifest declares in timber, by its own table or inherited
from workspace.dependencies, that no lockfile pins yet, the newest
version the policy admits within its requirement; and every family
crate a held crate requires, through every level (137, 140). It prints
each requirement, what required it and the version held for it, and
the host’s process serves the layout: its configuration, an index file
per crate listing the versions held, and each crate. Cargo then resolves
within what the layout lists and writes the lockfile, each family crate
pinned at the served address with its checksum. The address names no
home, checkout or store, and is the same on every host, so the lockfile
names no host (49).
A version the policy refuses is left out of its crate’s index file, so
Cargo never selects it, and sync’s answer names the version and the
claim found wanting (99). A request for its crate, from Cargo or anyone,
is answered 403 carrying the same words, which Cargo prints under
body: after the status it got. A crate the store does not name is
answered 404, and one whose source cannot be read 502, each with
that source’s own words (58, 59).
Layouts under a policy
Section titled “Layouts under a policy”timber sync fills each ecosystem’s layout in the checkout after the
cache. Each bound projection says what the checkout’s lockfile pins; one
with no lockfile is passed over, and no layout of it is made. Each pin is
found in the store by its ecosystem, name and version alone, through the
name artifact/<ecosystem>/<name>@<version> and the version’s index
(138), and the layout holds the lockfile’s versions and no other (50). A
pin the store does not name, as most third-party packages are, is
answered absent and refuses nothing (51).
Each version is judged under a policy before the layout holds it (47,
113), and the policy is a stack. The consuming repository’s policy file
is read at the landed revision sync runs for, never from the checkout
(65), and where it writes a [layout], that line judges every version.
Where it writes none, with a file that has no [layout] or with no
policy file at all, each version is judged under its publisher’s: the
layout-policy claim the publish attached to the version’s index, which a
publish attaches only where the publisher’s own file writes a
[layout]. Where the index carries no such claim that counts, the
version is judged under the given policy for a layout, which admits a
version the gate accepted and no other (C.10). Every version thus has a
policy, and the answer and the record name the one that judged it: the
consumer’s own line, the publisher’s at the revision its claim names, or
the given.
Every claim a consumer reads, the publisher’s layout-policy claim and
each claim a policy requires among them, counts through a signer the
consumer trusts for it (C.10). A repository whose file names signers
reads under its file alone: a claim counts through the signers its
[signers] lets make it, and the given’s gate is the signers it lets
claim acceptance. Only for a claim its file names no signer for, and
for every claim where it has no policy file, does it read through the
host’s trusted signers: the host’s own signer, the one [signing]
names, by the public half beside its key (signing.pub beside
signing), and the signers its bindings file names, one table each, by
the key the signer is verified by:
[trust.gate]ssh = "ssh-ed25519 AAAA… gate@box"So a laptop consumes what it published itself, its own acceptance counting with nothing written. The one host that stands as the gate of a repository whose file names no accepting signer does so for publishing, not for reading: a consumer’s given never counts acceptance by its file’s one publisher, only by the host’s trusted signers. A publisher’s policy that requires a claim counts it only through a signer it names that the consumer trusts for that claim, verified by the key the consumer trusts it by.
A version is held only when each claim its policy requires, in its order, is attached to its index or its artifact by a signer the policy names (47, 9). A version refused is named with its index, the first claim found wanting and the signers checked, and sync prints it, so the client’s own “no matching version” is never the only word; the version leaves the layout on that sync (99).
A layout is at .timber/layouts/<ecosystem>/ under the checkout’s
working tree, the same place on every host, so the client’s own
configuration names it once and the lockfile names no host (49).
.timber/ ignores itself to git. The host keeps what each layout
holds under the checkout’s own git directory, at
timber/layouts/<ecosystem>.json, a file any reader opens, rebuilt by
the next sync if it is deleted (61 to 63).
Every read of a layout comes before anything is written. Where the store or the policy cannot be read, or the render fails, the layout is left as it was, and sync answers what it holds, when it was last rendered and under which policy, beside the source’s own words; it never answers an absent version as refused, or a refused one as absent (51, 58). The exit is the worst answer among the cache’s entries and the pins that are not absent.
Adding one
Section titled “Adding one”A projection profile implements the one projection interface and nothing of the core, and reaches the store only through the store seam. It passes the one conformance suite, which holds it to Parts A and B; a profile that fails the suite is not one (93).