Reef and Packages
Reef is Chelis's package and shell distribution layer. This chapter
covers the day-to-day workflow: what's bundled with the compiler, how
to install shells, how chelis reef build works, and what the
lockfile records.
Runtime vs Shells
Section titled “Runtime vs Shells”Chelis distinguishes a single runtime from a family of substitutable shells:
chelis-stdis the language runtime. It is compiler-bundled. Every Chelis program depends on it implicitly the same way a Rust program depends oncore/std. It version-marches with the toolchain and is never installed via reef.- Shells (
nautilus,coral,shoals,school,octant,c-earchin,hydronnx,beacon,economoist,calcify,hull,whale,hello-chelis) are distributable libraries that build on the runtime; users install them via reef.
The runtime bytes (the chelis-std source archive and .chb shell)
are embedded into the chelis binary at compile time via the
chelis-std-bundle crate. The reef loader serves them directly when
a project depends on chelis-std; the local registry is not
consulted for the runtime.
Package Manifest
Section titled “Package Manifest”Every reef package has a reef.toml:
[package]name = "demo"version = "<version>"compiler = "=<version>"module_prefix = "Demo"
[dependencies]nautilus = { version = "<version>" }Package source normally lives under src/. Module declarations should line up with the
manifest module_prefix; for example, src/nn/linear.ch in the manifest above would
declare a module under Demo.Nn.Linear.
The compiler = pin is exact (no version ranges in this round) and
implicitly declares the chelis-std runtime version: a project that
pins an exact compiler version automatically gets chelis-std at the
runtime version that compiler ships. You can also list chelis-std
explicitly in [dependencies] (the installer soft-verifies that the
declared version matches the bundled version, mismatches surface a
typed error), but it is never required.
Install Paths
Section titled “Install Paths”chelis reef install accepts four sources, used independently:
# Discover packages under a chelis monorepo checkout (offline).chelis reef install --from-monorepo <path>
# Fetch a single shell from the canonical hosting org's GitHub# release. Authentication is required (the canonical repos are# private); GITHUB_TOKEN must be set or `gh auth token` must work.chelis reef install --from-github <org>/<repo>@<tag>
# Install a topo-ordered set of shells. With no arguments, uses the# built-in default list.chelis reef install --bootstrap [<org>/<repo>@<tag> ...]
# Re-fetch every dependency from its lockfile-recorded remote origin# and verify against the lockfile's pinned hashes.chelis reef install --from-lockfileAll four paths use the same validation+placement helper
(install_validated_artifact_pair): SHA256-verify the archive and
shell, check name/version agreement, place under
$CHELIS_REEF_HOME/packages/<name>/<version>/. Local registry state
is byte-identical regardless of which install path produced it.
chelis-std is not installable
Section titled “chelis-std is not installable”chelis reef install --bootstrap chelis-std@<v> is rejected with a
typed BootstrapError::RuntimeNotABootstrapTarget, naming both the
requested version and the compiler's bundled version. The runtime
ships with the compiler; there is no separate install step.
Asset naming
Section titled “Asset naming”Each shell's GitHub release attaches two assets per published version:
<name>-<version>.tar.zst: the source archive<name>-<version>.chb: the prebuilt shell artifact
Note the convention: the tag is v<version> (with the leading
v), but the asset filenames are <name>-<version>.{tar.zst,chb}
without the leading v. Both forms are accepted by the
<org>/<repo>@<tag> parser (@v<version> and @<version> are equivalent).
Auto-fetch During Build
Section titled “Auto-fetch During Build”chelis reef build is auto-fetch-by-default: if a dependency is
missing from the local registry, the build attempts to fetch it from
the canonical hosting org (or from the remote_origin recorded in
the lockfile, when present) before falling back to the
"missing-from-registry" error. Pass --no-auto-fetch to disable this
fallback.
The result of all four items above is that a fresh dev environment's onboarding is just:
git clone <project>export GITHUB_TOKEN=$(gh auth token)chelis reef buildAuto-fetch handles the rest. GITHUB_TOKEN is mandatory because the
canonical-org shell repositories are private; the install path
hard-fails with a clear error if no token is available.
Lockfile
Section titled “Lockfile”reef.lock records every resolved dependency as a tuple of
(name, version, source-kind, compiler-pin, archive_sha256, shell_sha256). The source-kind discriminator (LockSource) has
three variants:
Path: a path-source dependency (rare; mostly for local development)LocalRegistry { remote_origin }: installed from the local registry. The optionalremote_originrecords where the bytes were originally fetched from, in scheme-tagged URI form (currentlygithub://<org>/<repo>@<tag>); lockfiles that omit the field round-trip cleanly without it.Bundled { compiler_version }: the chelis-std runtime, served from the compiler binary's embedded bundle. Recorded for auditability, so a lockfile reader can see which compiler version supplied the runtime bytes.
Project-driven blanket synthesis: every reef.toml's compiler =
pin is itself the runtime declaration. build_lockfile therefore
records a LockSource::Bundled chelis-std entry on every project,
regardless of whether the project listed chelis-std in
[dependencies]. Lockfiles produced by older compilers that recorded
chelis-std as LocalRegistry are auto-migrated to Bundled on read
and rewritten on the next chelis reef build.
Import Syntax
Section titled “Import Syntax”import Std.Init.Kaiming(..)import Nautilus.LinAlg(matmul_wrap, transpose)Std.* resolves to the bundled chelis-std runtime; other module
prefixes (Nautilus.*, Coral.*, Shoals.*, School.*, Octant.*,
Beacon.*, Economoist.*, Calcify.*, Hull.*, Whale.*) resolve
to whichever version the lockfile pins.
Typical Workflow
Section titled “Typical Workflow”chelis reef init demo --module-prefix Demo --output democd demo# Edit reef.toml to pin compiler version and any shells you need.chelis reef buildEnvironment Variables
Section titled “Environment Variables”CHELIS_REEF_HOME: local registry root. Default is~/.chelis/reef.GITHUB_TOKEN: required for any remote fetch (--from-github,--bootstrap, auto-fetch during build). Falls back togh auth tokenif unset.CHELIS_REEF_GITHUB_BASE_API,CHELIS_REEF_GITHUB_BASE: test-fixture overrides for the GitHub API and download base URLs. Production use defaults tohttps://api.github.comandhttps://github.comrespectively.
Concurrent Builds
Section titled “Concurrent Builds”chelis reef build is safe to run concurrently across independent
working trees. The local registry is protected by file locks
(flock); two builds racing for the same package serialize cleanly
without corrupting the registry.
See Also
Section titled “See Also”spec/design/reef_distribution.md: full distribution design, including error categories and acceptance oracles.spec/design/chelis_canonical_reference.md§5: runtime-vs-shell distinction and the canonical shell roster.spec/design/phase3j_pre_release.md: release contract and downstream pinning policy.