Skip to content

fix: recognize structured rate claim windows - #88

Merged
karlwaldman merged 3 commits into
mainfrom
codex/cover-duration-rate-claims
Aug 11, 2026
Merged

fix: recognize structured rate claim windows#88
karlwaldman merged 3 commits into
mainfrom
codex/cover-duration-rate-claims

Conversation

@karlwaldman

@karlwaldman karlwaldman commented Aug 11, 2026

Copy link
Copy Markdown
Member

Summary

  • replace phrase-order alternations with a bounded semantic detector
  • require a non-duration numeric count, an API request/call/query/hit/credit noun, and a cadence/window token within one sentence span
  • choose the closest count to the action and cap both action-count distance and total claim span
  • strip generated HTML tags for detection while preserving sentence/code-comment boundaries
  • keep numeric claims in one semantic classifier and preserve the legacy classifier only for nonnumeric monthly station-limit wording
  • report every distinct finding in one file instead of hiding later matches behind the first match

Red-green proof

Requested red: the three final orderings failed on the prior head: 50 request limit per day, 50-call limit per day, and 50 requests allowed daily. The earlier four duration/order cases and seven permutation cases were also captured red before their fixes.

Review red: 50 API requests per month produced two classifications before c6fdd4a; the regression now requires exactly one finding.

Green:

  • 31 positive rate claims spanning arbitrary counts, action nouns, duration windows, order permutations, hyphens, and generated markup
  • 10 negative boundaries covering versions, tests, page records, retry counts, historical-range labels, code-comment timeouts, and unrelated sentences
  • 46 focused storefront tests
  • 458 passed / 13 skipped, 62.26% coverage on the complete CI-equivalent unit gate
  • Ruff, mypy across 46 source files, and 63-surface authored/generated scan: green
  • exact 1.12.4 wheel clean install, pip check, recursive RECORD scan, and keyless production demo: green

No v1.12.4 tag or PyPI artifact exists. Release will bind only the final replacement merge SHA after hosted and post-main verification.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The storefront claim validator now detects broader fixed-rate claim wording and reports every occurrence. Parameterized tests cover additional valid phrases and negative cases.

Changes

Fixed-rate claim validation

Layer / File(s) Summary
Broader fixed-rate patterns
scripts/validate_storefront_claims.py, tests/test_storefront_claims.py
The validator recognizes more request terms, time units, frequencies, windows, scopes, limits, quotas, and number formats. Tests cover valid and invalid phrases.
Report every matching occurrence
scripts/validate_storefront_claims.py
Claim scanning iterates over all matches for each pattern and reports each occurrence.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: recognizing structured rate claim windows.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/cover-duration-rate-claims

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.

❤️ Share

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

@karlwaldman

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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/validate_storefront_claims.py`:
- Around line 41-58: Deduplicate claim matches before reporting them so
identical (path, match.start(), match.end()) spans produce only one failure,
including overlapping FIXED_RATE classifications for “50 API requests per
month.” Update the result-collection logic around line 178 to retain one
occurrence per span, and add a regression test asserting this phrase yields
exactly one failure.
🪄 Autofix

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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3102e9ee-f918-40a1-a8d5-93f41a57df9e

📥 Commits

Reviewing files that changed from the base of the PR and between 6e3e543 and 2777d2f.

📒 Files selected for processing (2)
  • scripts/validate_storefront_claims.py
  • tests/test_storefront_claims.py

Comment thread scripts/validate_storefront_claims.py Outdated
@karlwaldman
karlwaldman merged commit ba974eb into main Aug 11, 2026
7 checks passed
@karlwaldman
karlwaldman deleted the codex/cover-duration-rate-claims branch August 11, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant