Define durable value handles and selectors #25

Merged
JayKobe6k merged 3 commits from issue-10-durable-value-handles into main 2026-09-04 21:30:14 +00:00
Owner

Summary

  • define strict revision-aware ctv1 value handles from parser-independent semantic and portable source identity
  • add typed exact-name selector resolution with not-found, ambiguity, stale-revision, and index-mismatch outcomes
  • require canonical handles on value search matches and parse handles at the CLI boundary
  • document the identity, serialization, and repository contracts

Closes #10

Tests

  • nix develop --command cargo fmt --all -- --check
  • nix develop --command cargo lint
  • nix develop --command cargo test --all-targets --all-features
  • nix develop --command cargo doc --no-deps --all-features
  • nix develop --command cargo check --target x86_64-pc-windows-gnu --all-features
## Summary - define strict revision-aware `ctv1` value handles from parser-independent semantic and portable source identity - add typed exact-name selector resolution with not-found, ambiguity, stale-revision, and index-mismatch outcomes - require canonical handles on value search matches and parse handles at the CLI boundary - document the identity, serialization, and repository contracts Closes #10 ## Tests - `nix develop --command cargo fmt --all -- --check` - `nix develop --command cargo lint` - `nix develop --command cargo test --all-targets --all-features` - `nix develop --command cargo doc --no-deps --all-features` - `nix develop --command cargo check --target x86_64-pc-windows-gnu --all-features`
Define durable value handles
All checks were successful
Validate / Formatting, linting, and tests (push) Successful in 2m6s
Validate / Formatting, linting, and tests (pull_request) Successful in 2m7s
20d3d946b0
JayKobe6k left a comment

Found one actionable defect in durable occurrence identity.

Found one actionable defect in durable occurrence identity.
@ -0,0 +1279,4 @@
match site {
ValueOccurrenceSite::Source(anchor) => {
self.bytes(&[0]);
self.anchor(anchor);
Author
Owner

[P1] Source-backed occurrences need a discriminator beyond their anchor. The existing TWICE(seed) fixture produces two distinct operand uses, but Clang reports both with spelling offset 298 and expansion offset 292. Since they also share translation unit, scope, declaration, and Operand semantic, this hashes identical input and assigns both uses one handle, conflating lineage nodes and edges. Please include a deterministic structural ordinal or path alongside the anchor and cover this macro case.

[P1] Source-backed occurrences need a discriminator beyond their anchor. The existing `TWICE(seed)` fixture produces two distinct operand uses, but Clang reports both with spelling offset 298 and expansion offset 292. Since they also share translation unit, scope, declaration, and `Operand` semantic, this hashes identical input and assigns both uses one handle, conflating lineage nodes and edges. Please include a deterministic structural ordinal or path alongside the anchor and cover this macro case.
Include compilation context in value identity
Some checks failed
Validate / Formatting, linting, and tests (push) Failing after 1m59s
Validate / Formatting, linting, and tests (pull_request) Successful in 2m14s
cdbe3245bf
Author
Owner

Review comment #1073: Fixed in 0c4065a (with compilation-context identity completed in cdbe324). Source-backed identities now hash a deterministic structural ordinal in addition to the full spelling/expansion anchor, and the repeated TWICE(seed) references are covered as distinct occurrences. Tests: nix develop --command cargo test --lib application::value::tests::repeated_macro_argument_uses_do_not_share_occurrence_identity -- --exact; nix develop --command cargo test --all-targets --all-features; nix develop --command cargo lint; Windows all-target check.

Review comment #1073: Fixed in 0c4065a (with compilation-context identity completed in cdbe324). Source-backed identities now hash a deterministic structural ordinal in addition to the full spelling/expansion anchor, and the repeated `TWICE(seed)` references are covered as distinct occurrences. Tests: `nix develop --command cargo test --lib application::value::tests::repeated_macro_argument_uses_do_not_share_occurrence_identity -- --exact`; `nix develop --command cargo test --all-targets --all-features`; `nix develop --command cargo lint`; Windows all-target check.
Sign in to join this conversation.
No description provided.