Expand description
Typed build-dependency identities (manifest §7, §32; MVP 5).
Incremental builds need to name what a cached artifact depends on before
they can decide whether it is stale. This module supplies the vocabulary:
DependencyKind is the coarse category and DependencyId is the typed,
deterministic identity. Both are pure value types: there is no dirty-node
invalidation, content hashing, or persistent cache here. Those later slices
(see docs/incremental-dependencies.md) consume these identities.
§Scope
Only inputs with a real, stable identity today are modelled: file-backed
inputs (their canonical project path, see ProjectPath) and labels (their
reference name). Categories the design note sketches but cannot yet identify
deterministically: Node and Style bundles (their ids are still
defaulted), packages, layout inputs (no real layout key until paragraph
hashing lands, §4.4), and layout outputs: are deferred until they have a
genuine identity scheme, rather than modelled as placeholders that would
collide.
§What is intentionally not modelled yet
- Content boundaries. A
DependencyIdnames a dependency; it does not hash the bytes behind it. For bibliography inputs that pairing has landed asBibliographyDependency, which couples aDependencyId::bibliographyidentity with a [ContentHash] boundary (the bytes are hashed bymos_bib::bibliography_content_hash). Other categories still carry identity only. - Serialization format.
DependencyIdderivesEq/Ord/Hashso it can key in-memory maps and sets deterministically. The byte-exact on-disk form is deferred to the persistent-cache slice;Displayis a stable, debuggable view, not the wire format.
Structs§
- Bibliography
Dependency - A bibliography input paired with its content-hash boundary.
- Project
Path - A canonical, project-relative resource path used as a file dependency’s identity.
Enums§
- Dependency
Id - A typed, deterministic identity for one build dependency.
- Dependency
Kind - The category of a build dependency.
- Project
Path Error - Error returned when a path cannot be used as a project-relative dependency identity.
Functions§
- normalize 🔒
- Lexically canonicalize a project-relative path: fold
\to/, drop./empty segments, resolve.., and NFC-normalize. No filesystem access. - starts_
with_ 🔒windows_ drive