Skip to content

Migrate Jim rope byte coordinates off GraphQL Int narrowing #285

Description

@flyingrobots

Classification

Width-preservation debt at the transitional GraphQL/Wesley boundary.

Problem

Jim's authoritative rope facts use non-negative u64 byte lengths and coordinates. The GraphQL corridor maps Int to signed Rust i32, so PR #282 correctly added a pre-admission obstruction when a checkpoint basis exceeds i32::MAX.

That obstruction preserves truth, but it leaves an artificial ~2 GiB capability ceiling and repeats narrowing seams anywhere rope byte coordinates cross the generated contract.

Evidence

Why it matters

Byte positions are authoritative coordinates, not presentation integers. A lossy or artificially narrow ABI either rejects valid rope states or tempts callers to cast, truncate, or create a side channel.

Constraints

  • Keep the current checked conversion and typed obstruction until a width-preserving ABI exists.
  • Never truncate, wrap, stringify ad hoc, or copy native identity/codec logic into TypeScript.
  • Preserve deterministic little-endian encoding and explicit negative-value rejection.
  • If Edict supersedes this GraphQL corridor first, solve the width contract in Edict and close this compatibility migration honestly.

Acceptance criteria

  • Resolve or consume the fixed-width profile from Keep Wesley profile-neutral for deterministic contract extensions wesley#651, or document the equivalent Edict-native type.
  • Inventory authoritative rope byte lengths, offsets, and ranges that cross the generated ABI.
  • Replace GraphQL Int at those authority boundaries with an explicitly width-preserving non-negative type.
  • Regenerate Rust and TypeScript-facing artifacts without manual edits.
  • Remove only narrowing checks that become provably unnecessary.
  • Witness zero, i32::MAX, i32::MAX + 1, and u64::MAX or the declared maximum.
  • Negative and out-of-domain wire inputs fail closed before admission.
  • Existing create/replace/checkpoint identities and receipts remain opaque.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    causal-ropeCausal rope text authority roadmapenhancementNew feature or requestsliceImplementable roadmap slicetext-authorityText authority and storage invariantswork-in-progressCycle or PR is intentionally in progress and not ready to merge

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions