Skip to content

fix(patterns)!: Account for the compactOrdered "~" prefix when computing coverage#3053

Open
gibson042 wants to merge 17 commits intomasterfrom
gibson-3046-narrow-rankcover
Open

fix(patterns)!: Account for the compactOrdered "~" prefix when computing coverage#3053
gibson042 wants to merge 17 commits intomasterfrom
gibson-3046-narrow-rankcover

Conversation

@gibson042
Copy link
Member

Fixes #3046
Fixes #3051
Fixes #3052

Description

  • Update functions for computing covering bounds to account for the "~" prefix of format "compactOrdered".
  • Improve getRankCover implementations and output, particularly for non-Key CopyArrays that have an all-Keys prefix.
  • Add property-based testing for getRankCover.
  • Fix bugs uncovered by that testing.

Security Considerations

None known; the bugs do not seem to be exploitable in the hardened environment relied upon by @endo/patterns.

Scaling Considerations

n/a

Documentation Considerations

Functions that assume the absence of an encoding prefix have been marked as deprecated in both JSDoc comments and in NEWS.md.

Testing Considerations

New and improved.

Compatibility Considerations

The included fix for #3052 results in the range corresponding with an unknown kind matcher covering all (and only) tagged values, effectively precluding the addition of any new pass style in the future. That could instead be changed to e.g. cover all values (à la M.any()), or to maintain the existing behavior of throwing an exception.

Upgrade Considerations

These improvements should be harmless to include, and AFAICT will have only minor effects on agoric-sdk because that system does not even use compactOrdered, let alone support composite collection keys in durable storage.

@changeset-bot
Copy link

changeset-bot bot commented Feb 6, 2026

⚠️ No Changeset found

Latest commit: 31c8b54

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

* Same upper and lower bound for a Key.
* Bounds for M.nat() match M.gte(0n).
* The inclusive upper bound for M.lte(x) is x.
…..])`

Use a prefix derived from the leading key elements.
Fixes #3046
@gibson042 gibson042 force-pushed the gibson-3046-narrow-rankcover branch from 5fd2b94 to 4a911fc Compare February 6, 2026 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant