Harden spelling policy runtime - #58
Conversation
Bound local masking expressions and require cache metadata to match the requested shared authority. Fail closed on tracked-file read errors while continuing to skip non-UTF-8 content. Remove whole-test exclusions by constructing deliberate negative fixtures at runtime, and cover the strict regex, cache, scanner and phrase contracts with focused regressions.
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 11 minutes Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. 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: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (19)
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughTighten ignore-regex and file-exclusion validation, scope stale HTTP cache reuse to matching sources, precompile harvesting matchers, propagate file-read errors, and expand spelling and refresh regression coverage. ChangesTypos rollout validation and harvesting
Sequence Diagram(s)sequenceDiagram
participant Caller
participant refresh_base
participant _refresh_http
participant CacheMetadata
participant StaleCache
Caller->>refresh_base: request source refresh
refresh_base->>_refresh_http: refresh URL
_refresh_http->>CacheMetadata: load persisted source
_refresh_http->>StaleCache: reuse cache when source matches
_refresh_http-->>refresh_base: result or source-scoped error
refresh_base-->>Caller: refreshed or cached data
Possibly related PRs
Poem
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error, 4 warnings)
✅ Passed checks (15 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/typos_rollout.py`:
- Around line 69-209: Decompose the regex-safety functionality from
scripts/typos_rollout.py into a dedicated submodule, moving _GroupState,
_RepetitionScanner, _has_unsafe_repetition, _compile_policy_pattern, and their
required dependencies together. Update imports and call sites to preserve
existing behavior, and similarly separate cache-refresh and harvesting
functionality as needed so each module remains under the 400-logical-line limit.
- Around line 1084-1087: In the phrase-matcher loop, rename the unused `phrase`
unpacked variable to the project’s conventional ignored-variable name (such as
`_`) while preserving the existing `correction` and `matcher` bindings and loop
behavior.
- Around line 441-444: Update the normalization logic around normalized and
UNIVERSAL_FILE_GLOBS to use pathlib for removing redundant leading "./" segments
instead of manual startswith checks and slicing. Preserve the existing strip and
casefold behavior, and ensure repeated "./" prefixes normalize consistently
before the membership check.
- Around line 39-41: Update the REPETITION regular expression used by
_RepetitionScanner to also match Python’s {,n} quantifier form, while preserving
existing matches for {n}, {n,}, and {n,m}. Use the expanded pattern specified by
the review comment.
In `@tests/test_typos_rollout.py`:
- Around line 213-246: Extract the duplicated Path.read_text denial setup into a
shared pytest fixture or factory in tests/typos_rollout_test_support.py,
preserving delegation for non-target paths and the configurable PermissionError
message. In tests/test_typos_rollout.py lines 213-246, replace the inline
deny_target closure in test_harvest_repository_propagates_file_read_failures
with the shared helper; make the same replacement in
tests/test_typos_spelling_gate.py lines 177-206 within
test_phrase_checker_propagates_file_read_failures.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 56498df3-3f93-46ba-87bb-88bc1d00dc70
📒 Files selected for processing (7)
scripts/typos_rollout.pytests/test_typos_rollout.pytests/test_typos_rollout_http_security.pytests/test_typos_rollout_semantics.pytests/test_typos_spelling_gate.pytypos.local.tomltypos.toml
💤 Files with no reviewable changes (2)
- typos.local.toml
- typos.toml
Split the shared rollout runtime into focused modules while retaining the existing facade. Recognize every Python repetition form, add property coverage, and bound refresh and read diagnostics. Document the operational contracts and consolidate test fixtures so consumers can inherit one reviewed implementation.
|
@coderabbitai review |
✅ Action performedReview finished.
|
All five actionable threads were addressed in 6e602ac, replied to with green local and hosted evidence, and resolved. CodeRabbit completed its current-head review successfully with no new unresolved threads.
Summary
fixtures; and
Context
This is the shared-foundation follow-up to #57. Consumer review exposed runtime
enforcement gaps that must be fixed at the authority before the next estate
cohort is published. The implementation preserves narrow proper-name regexes,
including the official
GitHub Flavored Markdownspelling, and keeps theshared
hand-writtentohandwrittenphrase correction intact.No repository roadmap item or implementation issue was found for this bounded
rollout follow-up.
Validation
make ci: 181 tests and 3 snapshots;typos.tomlbyte-current;exclusion rejection;
OSErrorpropagation and non-UTF-8 skipping; andManifest SHA-256:
e5d78d21f188815f66edb09d4ecdabe437f6edc2b58c8c1999e02989c51eb98d.