Skip to content

fix: guard upload limits in production builds - #1441

Merged
BigSimmo merged 36 commits into
mainfrom
codex/issue-ledger-upload-parity
Jul 30, 2026
Merged

fix: guard upload limits in production builds#1441
BigSimmo merged 36 commits into
mainfrom
codex/issue-ledger-upload-parity

Conversation

@BigSimmo

@BigSimmoBigSimmo commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add a provider-free upload-limit parity guard using Next production dotenv precedence.
  • Run it in static/cheap gates and before production builds.
  • Feed Docker's MAX_UPLOAD_MB build argument to the checker-only UPLOAD_LIMIT_PARITY_SERVER_MB, then remove MAX_UPLOAD_MB from the Next build process so application env validation never mistakes an empty build argument for a runtime value.
  • Keep the public and server build arguments aligned in Docker CI.
  • Close the verified issue-ledger items carried by this branch and preserve current-main ledger changes.

RAG impact: no retrieval behaviour change — build configuration, tests, and documentation only.

Verification

  • Upload-parity self-test passed on final code, including the Docker isolation contract.
  • Explicit MAX_UPLOAD_MB=150 / NEXT_PUBLIC_MAX_UPLOAD_MB=150 parity passed.
  • tests/ci-cache-safety.test.ts — 13/13 passed after current-main sync.
  • GitHub Actions pins, outstanding-issues guard, branch-review-ledger guard, docs links/scripts, changed-file Prettier, and git diff --check passed.
  • Previous exact-head ordinary production build passed; its app-image job exposed the empty-ARG Zod failure that the final Docker isolation fix addresses.
  • Exact-final-head hosted CI is running and remains the merge gate.
  • Provider-backed/release checks were not run; this change does not require them.

Review and risk

  • Final follow-up review record is committed for code head 3f7c89f5e2660ec1505719ab3208013e873dc79e; current head adds only that append-only record.
  • Both original review findings are fixed: production env precedence matches Next, and Docker receives the server limit only for the parity check.
  • Risk is low but intentionally blocking: a mismatched client/server limit now fails the build instead of shipping inconsistent behavior.
  • Rollback is a normal revert; there is no data migration, deployment, or provider mutation.

@coderabbitai

coderabbitaiBot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in:27 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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 08469f55-0c23-435c-91be-6752b40c75f1

📥 Commits

Reviewing files that changed from the base of the PR and between 015f2a9 and dbfd306.

📒 Files selected for processing (13)
  • .claude/skills/gates/SKILL.md
  • .github/workflows/ci.yml
  • .github/workflows/docker-image.yml
  • CLAUDE.md
  • Dockerfile
  • docs/branch-review-ledger.md
  • docs/deployment-architecture.md
  • docs/outstanding-issues.md
  • docs/scripts-index.md
  • package.json
  • scripts/check-upload-limit-parity.mjs
  • tests/ci-cache-safety.test.ts
  • tests/ui-therapy-nav-scroll.spec.ts

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

@supabase

supabaseBot commented Jul 30, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@BigSimmo
BigSimmo marked this pull request as ready for review July 30, 2026 11:24

@chatgpt-codex-connectorchatgpt-codex-connectorBot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit:f661dfe56a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment threadpackage.json
Comment threadscripts/check-upload-limit-parity.mjs Outdated
@github-actions

github-actionsBot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

CI triage

CI failed on this PR. Automated classification of the 2 failed job(s):

  • Container images / app-imageneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.
  • PR requiredneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.

Compared with main CI run #6987 (cancelled).

Classification is evidence routing, not permission to ignore a failure. Exact quarantined Playwright identities remain governed by the flake ledger.

@BigSimmo
BigSimmo enabled auto-merge (squash) July 30, 2026 13:40
@BigSimmo
BigSimmo disabled auto-merge July 30, 2026 14:12
@BigSimmoBigSimmo changed the title chore: close ledger items and guard upload limitsfix: guard upload limits in production buildsJul 30, 2026
@BigSimmo
BigSimmo enabled auto-merge (squash) July 30, 2026 15:30
@BigSimmo
BigSimmo disabled auto-merge July 30, 2026 15:33
@BigSimmo
BigSimmo enabled auto-merge (squash) July 30, 2026 15:42
@BigSimmo
BigSimmo disabled auto-merge July 30, 2026 15:48
@BigSimmo
BigSimmo enabled auto-merge (squash) July 30, 2026 15:53
@BigSimmo
BigSimmo merged commit d8b034c into mainJul 30, 2026
26 checks passed
@BigSimmo
BigSimmo deleted the codex/issue-ledger-upload-parity branch July 30, 2026 16:02
BigSimmo pushed a commit that referenced this pull request Jul 30, 2026
Fifth consecutive genuine conflict on docs/outstanding-issues.md,
confirmed with git merge-tree before acting.
Main's d8b034c (PR #1441) deleted three rows from the Open items table
and archived none of them: #85, which that PR genuinely resolved by
adding check-upload-limit-parity.mjs; #119, a duplicate of #122; and
#105, which is open and unresolved — its LoadingPanel half is still
unverified. This resolution mirrors main on #85 and #119, which were
dispositionable, and keeps #105, which was not.
#105 survived only because this resolution was done row by row and then
diffed with column padding normalised away. Taking either side wholesale
would have lost it silently, which is what AGENTS.md forbids for this
file and what appears to have happened upstream.
Filed as #148: check:outstanding-issues validates duplicate ids, ids in
both tables, stale markers and malformed rows, but never compares
against the previous revision, so a row that simply disappears is
invisible to it in verify:cheap and static-pr alike. The fix is a
deletion check against the merge base, not a union merge driver — #133
removed that driver deliberately and reinstating it would bring back the
duplicate-row damage it was removed to stop.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01361jh3eYVjJCzXWjAhdZiF
BigSimmo pushed a commit that referenced this pull request Jul 30, 2026
Resolves the docs/outstanding-issues.md conflict against #1441 and #1470. That
file deliberately carries no merge driver (#133), so overlapping edits conflict
loudly rather than being silently concatenated.
Resolved by the prescribed recipe: rebuilt the file from origin/main and
re-applied only this branch's own change (the #86 row's "Hydration SHIPPED
(#101)" edit). Verified the result has an identical row count and an identical
id set to origin/main, so #1470's closures were preserved and nothing was
dropped; the only content delta against main is that one row.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GGEBHp4Seoh1jK1vGTNtYS
Sign up for freeto 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

@BigSimmo