Source Anchors
nockup-readme-contract
crates/nockup/README.md
nockup update, nockup project init, nockup package install
1-132
Documents Nockup's experimental status, local cache/toolchain workflow, manifest fields, template names, dependency commands, and untrusted-code security posture.
The README states Nockup is experimental, bootstraps ~/.nockup, scaffolds from nockapp.toml, installs Hoon dependencies, and treats template/dependency execution as untrusted code execution.
nockup-manifest-schema
crates/nockup/src/manifest.rs
HoonPackage, NockAppManifest, PackageMeta, DependencySpec, NockAppLock
1-154
Defines package metadata, template/template_commit fields, dependency specs, and lockfile records.
The manifest schema supports simple, versioned, and full git dependency specs plus lock entries with exact commit hashes.
nockup-template-init
crates/nockup/src/commands/init.rs
run, load_project_config, create_template_context, copy_template_directory
1-179
Scaffolds a new project from a cached template and applies manifest values through Handlebars.
The init command loads <project>.toml, resolves ~/.nockup/templates/<template>, rejects existing target directories, builds template context, copies template files, and processes libraries.
nockup-template-cache
crates/nockup/src/commands/common.rs
download_templates, clone_templates, has_existing_templates, copy_dir_recursive
69-240
Downloads or refreshes bundled templates and manifests from the canonical Nockchain repository.
Nockup clones nockchain/nockchain master, moves crates/nockup/templates and crates/nockup/manifests into ~/.nockup, and writes commit.toml with the fetched commit id.
nockup-toolchain-channel
crates/nockup/src/commands/common.rs
download_toolchain_files, clone_toolchain_files, get_target_identifier
241-360
Fetches channel manifests for the local architecture and writes cache config for stable/nightly tooling.
The common command code derives architecture identifiers, writes config.toml defaults, downloads release manifests for the active channel, and keeps channel binaries under ~/.nockup.
nockup-dependency-resolver
crates/nockup/src/resolver/engine.rs
Resolver::resolve, Resolver::resolve_dependency, dep_spec_to_git_spec, validate_source_files
1-430
Resolves dependencies recursively, fetches sources, validates requested .hoon files, loads transitive hoon.toml dependencies, and caches packages by exact commit.
The resolver records exact commits, converts specs into GitSpec values, checks cache, validates source files, loads transitive deps, and computes an install graph.
nockup-registry-install-path
crates/nockup/src/resolver/registry.rs
RegistryEntry, lookup, get_dependencies, to_git_spec
1-318
Maps registry packages and Typhoon registry entries into git source paths, install paths, file selections, and dependencies.
Registry entries carry git_url, path, install_path, and file; online registry lookup falls back to hardcoded entries and to_git_spec preserves install_path for package install.
nockup-resolved-graph-order
crates/nockup/src/resolver/types.rs
ResolvedPackage, ResolvedGraph, ResolvedGraph::compute_install_order
1-83
Defines resolved package metadata and topological install order with cycle detection.
ResolvedPackage stores exact commit, source_url, source_path, install_path, source_files, and dependencies; compute_install_order visits deps first and rejects cycles.
nockup-package-install-links
crates/nockup/src/commands/package/install.rs
run, link_registry_package, link_package_files, NockAppLock::save
1-360
Installs resolved packages into hoon/packages, creates symlinks into hoon/lib, hoon/sur, or registry install_path directories, and writes nockapp.lock.
Package install creates hoon/packages/lib/sur directories, uses install_path plus source_files for registry packages, sanitizes names/versions, and records exact git source commits in the lockfile.
nockup-cache-index
crates/nockup/src/cache.rs
PackageCache, PackageCache::cache_package, CacheIndex, CachedPackage
1-300
Tracks package cache identity under ~/.nockup/cache/packages with source URL, version spec, exact commit, timestamp, and cache index.
cache_package copies source into the package cache, records cached_at, and writes cache-index.json; the cache can list, prune, and find packages by version spec.
nockup-git-fetcher
crates/nockup/src/git_fetcher.rs
GitSpec, GitFetcher::fetch, resolve_branch, resolve_tag, checkout_commit
1-240
Fetches git dependencies by commit, tag, branch, or default branch and caches them by URL hash plus short commit.
GitFetcher resolves refs with git ls-remote, prefers commit > tag > branch > default, clones repos, checks out exact commits, and supports sparse checkout for subdirectories.