Skip to content

fix(sync): enforce V2 fair-use policy parity#10020

Merged
Git-on-my-level merged 3 commits into
mainfrom
codex/sync-v2-fair-use-parity
Jul 21, 2026
Merged

fix(sync): enforce V2 fair-use policy parity#10020
Git-on-my-level merged 3 commits into
mainfrom
codex/sync-v2-fair-use-parity

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • enforce the existing fresh-upload daily audio ceiling before Sync V2 can create staged or durable work
  • apply the stored subscription tier to fresh Sync V2 soft-cap evaluation, matching V1
  • preserve durable processing when the optional subscription read fails by falling back to the default tier with shared fallback telemetry
  • keep the durable coordinator within the checked Pyright complexity boundary by isolating the policy-only plan lookup

Closes #10002

Product invariants

none

Failure class

Failure-Class: none

This is a narrowly scoped V2 parity repair; no registered semantic failure class applies.

Verification

  • cd backend && .venv/bin/python -m pytest -q tests/unit/test_sync_v2.py tests/unit/test_sync_cloud_tasks.py tests/unit/test_fair_use_plan_aware.py (261 passed)
  • cd backend && BACKEND_PYTEST_WORKERS=4 bash test.sh
  • npm run test:sync-cloud-tasks-stack:emulator
  • backend/.venv/bin/python backend/scripts/scan_async_blockers.py --dirs backend/routers backend/utils
  • cd backend && bash scripts/typecheck.sh (0 errors)
  • .github/scripts/check_product_file_line_count_ratchet.py against origin/main

Review in cubic

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sync V2 fair-use parity fix (closes #10002) with tests, CI green. Approve-only — billing/quota-enforcement behavior change; Nik to land.

@Git-on-my-level

Copy link
Copy Markdown
Collaborator Author

@cursor address merge conflict

@cursor

cursor Bot commented Jul 21, 2026

Copy link
Copy Markdown

Merge conflict resolved and pushed.

Conflict: .github/scripts/product_file_line_count_ratchet_baseline/backend-routers.json — both main and this branch had updated line counts and raise_justifications entries.

Resolution:

  • Line counts set to current file sizes: chat.py 1577, developer.py 2195, mcp_sse.py 1858, sync.py 2035 (from this PR), users.py 2046
  • Kept raise_justifications from main (developer.py, mcp_sse.py, etc.) plus this PR’s sync.py entry for the fair-use daily ceiling

Verification:

  • Ratchet tests: 8 passed
  • Focused sync/fair-use tests: 261 passed

PR #10020 is now MERGEABLE (no remaining conflicts). CI may still be running (mergeStateStatus: UNSTABLE).

Open in Web Open in Cursor 

Reconcile backend-routers.json ratchet baseline with current line counts
from both branches and keep raise justifications from main plus the V2
fair-use sync.py entry from this PR.

Verification:
- python3 .github/scripts/test_check_product_file_line_count_ratchet.py (8 passed)
- cd backend && .venv/bin/python -m pytest -q tests/unit/test_sync_v2.py tests/unit/test_sync_cloud_tasks.py tests/unit/test_fair_use_plan_aware.py (261 passed)

Co-authored-by: David Zhang <Git-on-my-level@users.noreply.github.com>
@Git-on-my-level
Git-on-my-level merged commit d461e30 into main Jul 21, 2026
33 checks passed
@Git-on-my-level
Git-on-my-level deleted the codex/sync-v2-fair-use-parity branch July 21, 2026 02:11
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.

fix(sync): enforce the fair-use ceiling and plan-aware caps in V2

3 participants