Harden pattern dispatch and error contracts for 3.1 - #151
Conversation
|
Warning Review limit reached
Next review available in: 50 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details鈿欙笍 Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 馃搾 Files selected for processing (9)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Hardens the internal pattern-dispatch implementation and codifies 3.1-compatible error/pattern contracts, including documentation and CI enforcement.
Changes:
- Route
starts_with/ends_with/containsthrough a private classifier while keepingStrPattern::as_str_pattern+StrPatternImplas compatibility shims. - Add downstream-style contract tests for pattern dispatch and error signature/display/source behavior.
- Introduce API compatibility documentation and a GitHub Actions workflow that gates minor-release semver compatibility vs
origin/main.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/api_contract.rs | Adds integration tests that lock in downstream-callable compatibility surfaces and error contracts. |
| src/error.rs | Updates Error docs to clarify 3.1 compatibility and Utf8Error wrapping behavior. |
| src/cheetah_string/query.rs | Switches query methods to use the new private pattern classifier. |
| src/cheetah_string/pattern.rs | Introduces classifier enum + sealed classification method; keeps as_str_pattern/StrPatternImpl as a shim. |
| scripts/tests/test_repository_contracts.py | Enforces repository-level contracts around private dispatch and pinned semver workflow semantics. |
| README.md | Updates migration wording to reflect the safe 24-byte layout status. |
| CHANGELOG.md | Notes the dispatch hardening and compatibility workflow additions; updates migration wording. |
| API.md | Documents the exact pattern + error contract matrix and local reproduction steps. |
| .github/workflows/api-compatibility.yml | Adds a pinned workflow that runs cargo-semver-checks against origin/main under minor rules. |
馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| pub enum StrPatternKind<'a> { | ||
| Char(char), | ||
| Str(&'a str), | ||
| } |
Summary
starts_with,ends_with, andcontainsthrough a private sealed pattern classifierStrPattern::as_str_patternand its dispatch value as unchanged 3.1 compatibility surfaceschar,&str,&String, constructor errors, substring errors, display, and source chainingAPI.mdorigin/mainCompatibility
cargo-semver-checkspassed 196 checks againstorigin/main; no semver update is requireddocs/ordocs/rocketmq-docare includedVerification
Closes #150