Skip to content

refactor(node): use raw Taffy node IDs - #54

Merged
hyfdev merged 5 commits into
mainfrom
refactor/raw-taffy-node-id
Aug 23, 2026
Merged

refactor(node): use raw Taffy node IDs#54
hyfdev merged 5 commits into
mainfrom
refactor/raw-taffy-node-id

Conversation

@hyfdev

@hyfdev hyfdev commented Aug 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • expose each public NodeId as the raw Taffy u64 bigint with a compile-time TypeScript brand
  • remove tree tokens, creation serials, owner and liveness registries, and their public error codes
  • make tree and lifetime correctness a caller precondition while retaining bigint/u64 input checks
  • document and regression-test native invalid-key panic containment
  • update and re-vouch the affected PCR decisions and public documentation

Contract

A NodeId is supported only while its node is live and only with the TaffyTree that returned it. Independent trees may issue equal raw values. Forged, foreign, and stale in-range values are unsupported and have no stable error classification.

Verification

  • pnpm vp run check
  • pnpm vp run check:wasm
  • git diff --check

Copilot AI lite review requested due to automatic review settings August 23, 2026 09:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@hyfdev hyfdev changed the title refactor(node): use raw Taffy node IDs refactor(node)!: use raw Taffy node IDs Aug 23, 2026
@hyfdev

hyfdev commented Aug 23, 2026

Copy link
Copy Markdown
Owner Author

Adversarial review

Reviewed the change by trying to break these assumptions:

  • public values are bit-for-bit the raw Taffy u64 NodeId
  • every caller-supplied NodeId reaches the bigint/u64 representation check
  • context and measure maps remain consistent with the receiving tree
  • every native tree access stays inside the panic-containment boundary
  • removed tests cover only the retired owner/liveness contract
  • Native, Wasm, generated declarations, public docs, and PCR state agree

Findings fixed during the review:

  1. Added one direct public-versus-native raw-value test and one multi-NodeId representation/atomicity test without restoring per-method matrices.
  2. Removed remaining claims about stable NodeId codes and owner/liveness validation from the binding and Wasm records.
  3. Clarified that NodeId representation failures use TypeError while other numeric range failures use RangeError.
  4. Kept concrete foreign-ID behavior out of regression tests because it is explicitly unsupported.

The project owner classified this PR as a normal refactor rather than a breaking release change, so its squash title remains refactor(node): use raw Taffy node IDs.

No unresolved implementation findings remain. Local pnpm vp run check and pnpm vp run check:wasm pass. GitHub CI is 6/6 green across Ubuntu, Windows, Wasm, Node, Rust, and the PR-title check.

@hyfdev hyfdev changed the title refactor(node)!: use raw Taffy node IDs refactor(node): use raw Taffy node IDs Aug 23, 2026
@hyfdev
hyfdev merged commit 8e06dfc into main Aug 23, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants