nocter-declarations
Responsibility
Own the immutable, syntax-independent declaration graph and its namespaces, visibility, callable, requirement, standard-role, and target metadata. Define the sparse structural-constant and dense final-value products without evaluating either one.
Contract
The crate supplies domain types, builders, and validated immutable products. It knows semantic identities and normalized declaration relationships but not source text, syntax trees, editor coordinates, or checking internals.
Internal Responsibilities
- declaration and member arenas
- one sparse structural-constant table and one independently validated dense declaration-value table, both separate from constant and static metadata
- module, import, and prelude namespaces
- callable execution, guarantees, their closed compatibility policy, canonical input/result provenance graphs, constant, and requirement contracts
- explicit block or expression body forms, with constant and static initializers represented by ordinary semantic body identities rather than embedded syntax
- canonical interface dependency paths,
Self-inheritance closure, and effective member identities - visibility and path contracts
- accepted/recovery admission shapes
Invariants
- Builders reserve and define every declaration identity exactly once before metadata freeze.
PreparedDeclarationProgramowns a sparse structural-constant builder; it is a construction-only capability and cannot cross into checking. Its consuming finish transition validates that table and publishes checking admission without pretending ordinary initializers are already executed. - Graph/type integrity, structural-constant integrity, and final declaration-value integrity are validated independently.
- Namespace lookup consumes frozen tables rather than iterating declarations.
- A selected import is validated against the exact authored name/target pair in its target module namespace. Re-exported targets may retain an original declaration owner in another module; the import validator does not confuse physical declaration ownership with exported surface ownership.
- A declaration identity never contains a source range or rendered name.
- Authored callable execution and guarantees are declaration data; consumers do not rediscover modifiers from syntax or result shapes.
- One declaration-owned policy classifies incompatible callable kind, execution, and guarantee combinations. Checking projects that source-independent violation to diagnostics; consumers do not maintain parallel modifier matrices.
- Generic application validation compares one ordered parameter-domain schema with one ordered value sequence. Callers cannot substitute a type-only arity rule.
- Callable input provenance stores resolved receiver and parameter identities. Source spellings, header walk order, and body inference cannot enter that graph.
- Invalid or incomplete graphs cannot be constructed as accepted programs.
DeclarationProgramcontains graph/type metadata only. Declaration records never embed evaluated constant or static payloads. Accepted and recovery declaration branches carry only structural constants;CheckedProgramlater owns the dense final value table.- Every constant and immutable static owns exactly one expression-form body. Every callable, destruction, and test implementation owns a block-form body. Integrity validation proves both directions of each relationship before the graph can leave construction.
- An accepted immutable program may create owned checking branches without rebuilding declaration decisions; every branch preserves semantic IDs and the type-authority lineage.
- Interface prerequisite cycles and effective member collisions cannot cross the accepted-program boundary.
- Dependency-cycle validation follows every interface predicate; member inheritance follows only
contextual
Self impl Interfacepredicates.