Skip to content

refactor: stop using deprecated "sloppy" interface option#11931

Merged
mergify[bot] merged 1 commit intomasterfrom
markm-stop-using-sloppy-option
Feb 3, 2026
Merged

refactor: stop using deprecated "sloppy" interface option#11931
mergify[bot] merged 1 commit intomasterfrom
markm-stop-using-sloppy-option

Conversation

@erights
Copy link
Copy Markdown
Member

@erights erights commented Sep 14, 2025

closes: #XXXX
refs: #XXXX

Description

The copilot text at #11931 (review) seems like a fine description.

This PR refactors the codebase to replace the deprecated "sloppy" interface option with the newer "defaultGuards: 'passable'" option in Marshal interface definitions.

Updates interface definitions from { sloppy: true } to { defaultGuards: 'passable' }
Updates associated comments to reflect the new interface option terminology
Maintains the same functional behavior while using the current API

Security Considerations

Should be semantically identical, but easier to understand, so slight security improvement

Scaling Considerations

none

Documentation Considerations

If we can stop using sloppy completely, perhaps we can avoid documenting it in normal developer-facing documentation.

Testing Considerations

Adequate testing already in heap-classes.test.js in @endo/exo

Upgrade Considerations

Since we still support the deprecated option at this time, none.

Summary by CodeRabbit

  • Refactor
    • Updated interface guard configurations to use standardized validation policies across multiple components, enhancing internal consistency and robustness.

@erights erights self-assigned this Sep 14, 2025
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0ca5765
Status: ✅  Deploy successful!
Preview URL: https://6fa28407.agoric-sdk.pages.dev
Branch Preview URL: https://markm-stop-using-sloppy-opti.agoric-sdk.pages.dev

View logs

};

const ZCFSeatI = M.interface('ZCFSeat', {}, { sloppy: true });
const ZCFSeatI = M.interface('ZCFSeat', {}, { defaultGuards: 'passable' });
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This strikes me as a particular dangerous place to omit explicit method guards. Am I missing something?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This question is not relevant to this PR though. Just asking.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the codebase to replace the deprecated "sloppy" interface option with the newer "defaultGuards: 'passable'" option in Marshal interface definitions.

  • Updates interface definitions from { sloppy: true } to { defaultGuards: 'passable' }
  • Updates associated comments to reflect the new interface option terminology
  • Maintains the same functional behavior while using the current API

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
packages/zoe/src/contractFacet/zcfSeat.js Updates ZCFSeat interface to use defaultGuards instead of sloppy
packages/internal/src/typeGuards.js Updates UnguardedHelperI interface and comment
packages/inter-protocol/src/vaultFactory/vaultManager.js Updates helper interface definition and comment
packages/inter-protocol/src/price/fluxAggregatorKit.js Updates creator interface to use defaultGuards with multi-line formatting

rekmarks added a commit to endojs/endo that referenced this pull request Sep 17, 2025
Refs: #1831, Agoric/agoric-sdk#11931

## Description

We wish to visibly deprecate the `sloppy` option of `@endo/patterns`
interface guards. To avoid an explosion of `@typedef` blocks, we migrate
the `@endo/patterns` types to TypeScript and then add the minimally
required `@deprecated` tags.

### Security Considerations

N/A

### Scaling Considerations

N/A

### Documentation Considerations

N/A

### Testing Considerations

This modifies the implementation of the `@endo/patterns` types, but
should not modify them. Since the number of lines changed is larged, we
should attempt to convince ourselves that the types are in fact the
same.

### Compatibility Considerations

N/A

### Upgrade Considerations

Deprecates but does not remove the `sloppy` option. `NEWS.md` is
updated.
Copy link
Copy Markdown
Member

@michaelfig michaelfig left a comment

Choose a reason for hiding this comment

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

LGTM!

@erights erights force-pushed the markm-stop-using-sloppy-option branch from 0ca5765 to 8a708e3 Compare February 3, 2026 03:40
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 3, 2026

📝 Walkthrough

Walkthrough

Guard configuration in four interface declarations is updated from sloppy: true to defaultGuards: 'passable' across the inter-protocol, zoe, and internal packages. No API surface, control flow, or runtime behavior is altered—only the validation policy for these interfaces is changed.

Changes

Cohort / File(s) Summary
Inter-Protocol Guard Updates
packages/inter-protocol/src/price/fluxAggregatorKit.js, packages/inter-protocol/src/vaultFactory/vaultManager.js
Replaced sloppy: true with defaultGuards: 'passable' in creatorFacet and helper interface declarations; helper comment updated to reflect the new guard policy.
Core Library Guard Updates
packages/internal/src/typeGuards.js, packages/zoe/src/contractFacet/zcfSeat.js
Updated UnguardedHelperI and ZCFSeatI interface declarations to use defaultGuards: 'passable' instead of sloppy: true.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 No more sloppy guards, we tighten the way,
With passable defaults, stricter today,
Four interfaces now stand firm and true,
Safer validations in all that we do! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main refactoring change across multiple files: replacing deprecated 'sloppy' interface options with 'defaultGuards: passable'.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch markm-stop-using-sloppy-option

Comment @coderabbitai help to get the list of available commands and usage tips.

@erights erights marked this pull request as ready for review February 3, 2026 03:47
@erights erights added the automerge:squash Automatically squash merge label Feb 3, 2026
@mergify mergify Bot merged commit 74b2609 into master Feb 3, 2026
123 checks passed
@mergify mergify Bot deleted the markm-stop-using-sloppy-option branch February 3, 2026 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge:squash Automatically squash merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants