v0.21.0 Phase 1 Keyed-Pack and Hashing-Prerequisite Review
Result
Phase 1 is complete. Mapping literals and keyed forwarding now use one typed key/value entry from parsing through native execution. The standard numeric surface supplies the four exact u64 mixing operations admitted by Phase 0, and standard internals own a narrow target entropy adapter. No collection storage or compiler-known Map behavior entered this phase.
The review found one material transport defect during implementation: interface-method matching initially retained only the primary key type plus a keyed-pack flag. A required ...entries: K: V could therefore lose V before conformance comparison. Required parameters now carry the complete ArgumentPackType, substitutions traverse both components, and a focused negative test rejects a value-type mismatch. No unresolved Phase 1 finding remains.
Semantic Authority
ArgumentPack<T>is the sole checked representation of ordinary and keyed packs.ArgumentPackType::Keyed { key, value }remains intact in callable signatures, interface requirements, literal selection, ownership checks, origin analysis, and editor presentation.- Parsing recognizes a keyed entry only after parsing its key expression and consuming the entry colon. It does not infer mapping meaning from token lookahead or from a known collection name.
TypeKind::PackEntryis a compiler-owned transport type, not a source type. Source formatting, diagnostics, and type presentation use the declared key/value pack contract and cannot expose the internal carrier.- The old target/MIR
sequenceplanning names were generalized topack_literal; the distinction between literal-owned and call-owned packs is an enum rather than a boolean convention.
Ownership and ABI
- One keyed entry occupies one argument-pack lane and keeps one entry identity through checked, target, MIR, machine, and ARM64 lowering.
- Key and value projections are independently typed. A consumer may move or destroy each component without reconstructing two unrelated packs or relying on an alternating-value convention.
- Cleanup tests prove that an unconsumed key and value are each destroyed exactly once. Forwarding and mapping-literal native tests prove that transport preserves both components and their order.
- Target specialization consumes the typed pack plan supplied by the preceding responsibility. It does not reparse source syntax or repeat literal selection.
Numeric Boundary
u64.wrapping_add,u64.wrapping_mul,u64.bit_xor, andu64.rotate_rightare ordinary public methods implemented by private exact-contract primitives.- Primitive identity and ABI are centralized in
PrimitiveRoleand the target primitive-contract registry. ARM64 selection receives those roles and emits the corresponding add, multiply, exclusive-OR, or variable rotate instruction; it does not recognize source function names. - Wrapping operations bypass normal arithmetic overflow traps intentionally. A native conformance test covers modulo addition and multiplication, XOR, and rotation including the low-six-bit amount rule.
Entropy Boundary
std/internal/hashowns seed acquisition. Its Darwin adapter asks the existing package-internal syscall boundary to fill exactly eight bytes and terminates on failure.- The adapter returns only
u64; operating-system handles, syscall numbers, and errno policy do not cross into the future hashing or collection surface. - The raw seed function remains private until a Phase 2 hashing consumer exists. This avoids publishing an unused package API merely to anticipate that consumer; Phase 2 must expose the smallest consumed internal contract rather than making the syscall adapter public.
Source and Tooling
- Keyed declarations, direct entries, forwarding, mapping literals, empty
[:], and keyed loop binding have parser, formatter, AST JSON, diagnostic, and native coverage from the keyed-pack implementation commit. - Hover and signature presentation retain both key and value types. They consume checked pack evidence and do not recover keyed structure from source punctuation.
- The standard source dependency audit explicitly records only the
internal/hashdependencies oninternal/os/darwinandptr. No collection implementation or public hash algorithm was added.
Evidence
cargo test -p nocter-arm64 --quietcargo test -p nocter-conformance --quietcargo test -p nocter-discovery authored_standard_library_is_one_discoverable_declaration_unitcargo test --workspace --quietcargo fmt --all --checknode docs/build-docs.jsgit diff --check
All commands passed on 2026-08-30. The full workspace test retained one existing ignored test and reported no failure.