nocter-package
Responsibility
Parse package declarations, identify package roots, resolve dependency intent and exact selections, and freeze one deterministic package graph from an immutable filesystem view.
Contract
The crate reads package metadata and installed exact packages through the syntax-owned source provider contract but does not know whether parse work is direct or reused. Its graph entry also receives the source-identity domain selected by compiler computation; package code uses the domain to ingest sources but does not create revision policy. It does not download, mutate lock state, choose compiler semantics, or publish files. Acquisition and mutation use separate crates.
Internal Responsibilities
- package declaration decoding, including source-specific exact-selection fields
- one closed package-field schema and one validated exact-selection representation
- revision-local package-root source catalog and canonical package identity
- dependency graph resolution
- verified package-store and exact-selection overlays for validation
- retained package-root parse products shared by topology probing and graph loading
Invariants
index.nctwith#packageis the sole package-root declaration.- Dependency aliases never replace canonical package identities.
- The compiler-selected standard package must declare
name: "std"and the exact release carried by itsStandardPackageinput before its graph can close. - Each dependency declaration is the sole syntax authority for both its source intent and optional exact selection; no parallel alias-to-lock map is decoded from source.
- An authored exact selection stores the validated
ExactDependencyLock; downstream resolution cannot bypass validation or reconstruct a lock from trusted text. - Resolution is deterministic and independent of filesystem enumeration order.
- One root catalog retains the exact bytes and result behind every package-boundary decision. Package loading binds the same retained parse product to its semantic source identity, while discovery reuses the decision instead of reopening, reparsing, or reclassifying the root.
- An overlay is an input view, not authority to publish persistent state.
- A remote package root enters resolution only through the content-integrity capability produced by
nocter-package-cache; a directory basename orindex.nctalone cannot establish exactness. - An effective provisional selection is checked against its dependency source before package lookup or acquisition can begin.
- Production graph loading and resolution require a caller-owned syntax provider and retained root catalog plus a caller-owned source-identity domain; convenience direct parsing and fresh domains are confined to tests.