Skip to content

chore(governance): add scoped PR-size exception for PR #583 (#532) - #586

Merged
qnbs merged 1 commit into
mainfrom
chore/pr-583-size-exception
Sep 3, 2026
Merged

chore(governance): add scoped PR-size exception for PR #583 (#532)#586
qnbs merged 1 commit into
mainfrom
chore/pr-583-size-exception

Conversation

@qnbs

@qnbsqnbs commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a scoped config/pr-size-exceptions.json entry for PR #583 (issue #532 E2E startup/navigation nondeterminism), mirroring the precedent set by #576 for PR #564.

check-pr-size.mjs loads the exception registry from the PR's base ref, so PR #583 cannot self-authorize this — it must land on main first, then #583 rebases onto it so its own merge-base picks up this entry.

Why #583 needs it

#583's review-convergence (CodeRabbit, cubic, Amazon Q, and direct maintainer review) surfaced real defects requiring a genuine architectural fix — a shared IDB reset-gate covering every long-lived connection in the app (9 modules). The gate fails closed: a registered connection-closer failure rejects beginIdbReset() (after every closer, including the failing one, has still had its chance to run) so wipeAllAppData() aborts before any database deletion on an unproven teardown, and a closer registered while the reset is draining joins that same awaited barrier instead of racing ahead of it as fire-and-forget. A centralized beginIdbOpenAdmission()/isIdbOpenStillValid() pair closes a further gap: an open that starts after a reset already bumped the generation would otherwise still match at completion, so every opener also refuses to start a fresh open while a reset is in progress — and every reset closer now also invalidates its own module's pending open flight (not just the already-open connection), so the first post-reset caller starts a genuinely fresh attempt instead of reusing one already doomed to reject. deleteAllIndexedDBDatabases() uses Promise.allSettled so a fast-rejecting deletion can't release the gate while another is still outstanding, and only targets database names it can prove it owns (exact KNOWN_DB_NAMES plus the worldscript-localfirst- prefix), never assuming ownership just because enumeration returned a name. It also closes several stale-open-completion single-flight races via an identity token, a synchronous indexedDB.open() throw that could permanently memoize a rejected open promise, a test-reset helper that swapped the fake IndexedDB factory without releasing its cached connection, and a transient reset-denial NOOP that was indistinguishable from an intentional one.

Since #583 was created, main has moved forward through PR #590 (locale-independent Settings navigation — independently shipping the same fix#583's own five UI/helper files originally introduced, leaving those five files at zero net diff now) and PR #592 (factory-reset persistence-admission/drain-coordinator fix, issues #591/#593 — overlapping several of #583's own files, reconciled by layering both mechanisms inside wipeAllAppData()).

Scope — recomputed from an actual rebase, not carried forward

Exact 65-file allowlist (84 incl. 19 generated public/locales/*/bundle.json), maxNonExemptMeaningfulLines: 1611, maxCommits: 14 — measured directly via check-pr-size.mjs against a real rebase of #583 onto current main, not estimated or copied from an earlier snapshot. (An earlier version of this PR carried 70/1753/21, computed before that rebase existed — superseded.)

Review-thread state was not re-verified as part of this recompute and must be checked live against the current #583 PR before it merges, independent of this file-scope/line-ceiling exception.

This recompute also found and fixed a latent bug in check-pr-size.mjs itself: when an exception's own ceiling legitimately exceeds TIERS.absolute (30 files/3000 lines/15 commits — the entire point of granting one), evaluatePrSize() fell through to selectSeverity() against that fixed tier instead of treating the exception's own ceiling as authoritative, so a fully-satisfied wide exception still reported blocking:true. Neither #539 (maxFiles:30, at the tier's own boundary) nor #564 (maxFiles:3) had ever exercised this path — #583 is the first exception wide enough to expose it. Fixed with a regression test, verified end-to-end against the real rebased #583 branch (PR_SIZE_EXCEPTION=APPLIED outcome=within target).

17 of the 65 files are locales/*/sidebar.json with only a trailing-newline diff — they already lacked a final newline on main, and Biome's format-on-commit hook re-adds one the moment any of them is staged for any reason in this PR. This could not be reverted for real without skipping the pre-commit hook, so they remain in the allowlist with that diff.

Test plan

@codeant-ai

codeant-aiBot commented Sep 2, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

StatusCommitStarted (UTC)Finished (UTC)
✅ Incremental review completede1f733bSep 03, 2026 · 17:1817:19
✅ Incremental review completedddf9523Sep 03, 2026 · 15:1815:18
✅ Incremental review completed0de8c10Sep 02, 2026 · 18:4818:49
✅ Incremental review completedea34858Sep 02, 2026 · 15:5916:00
✅ Incremental review completed3a2a82aSep 02, 2026 · 14:2614:27

@codeant-ai

codeant-aiBot commented Sep 2, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@vercel

vercelBot commented Sep 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated
worldscript-studioReadyReadyPreviewSep 3, 2026 5:19pm UTC

@sourcery-ai

sourcery-aiBot commented Sep 2, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds a base-ref-visible, tightly constrained PR-size exception for PR #583 so its reviewed architectural and localization changes can exceed the normal file-count ceiling without broadly weakening size enforcement.

File-Level Changes

ChangeDetailsFiles
Adds a narrowly scoped PR-size exception for PR #583, using an explicit allowlist and bounded size/commit limits.config/pr-size-exceptions.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitaiBot commented Sep 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Essentials

Run ID: 6a7d97d7-88ea-4eed-86ae-1478da17b265

📥 Commits

Reviewing files that changed from the base of the PR and between 041f20e and ddf9523.

📒 Files selected for processing (4)
  • README.md
  • config/pr-size-exceptions.json
  • scripts/check-pr-size.mjs
  • tests/unit/tooling/checkPrSize.test.ts

Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.


📝 Walkthrough

Walkthrough

The PR adds a configured size exception for PR #583, changes exception severity handling, adds regression coverage, and updates README test-count references.

Changes

PR size exception handling

Layer / File(s)Summary
Exception limits and regression coverage
config/pr-size-exceptions.json, scripts/check-pr-size.mjs, tests/unit/tooling/checkPrSize.test.ts
PR #583 receives dedicated file, commit, and meaningful-line limits. Compliant exceptions return exception severity, while exceeded limits return blocking absolute severity. Tests cover a wide exception above the standard absolute tier.

Test count documentation

Layer / File(s)Summary
README test-count references
README.md
The README updates four test-count references from 7,369+ to 7,370+.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk:⚪ Minimal · up to e1f73

This change adds the scoped PR #583 size exception, makes configured exception limits authoritative, and updates related documentation. No current merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (2 skipped: 2 …Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check nameStatusExplanation
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title clearly and concisely describes the primary change: adding a scoped PR-size exception for PR #583. It is consistent with the pull request objectives and changeset.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/pr-583-size-exception

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

@what-the-diff

Copy link
Copy Markdown

PR Summary

  • Improvements to Startup/Navigation Process: This update includes details about managing exceptions linked to inconsistencies or unpredictability during system start-up or navigating through the system. It mainly affects the project termed qnbs/WorldScript-Studio.

  • Clear Restrictions for Contributions: Clear boundaries have been set for any additions or changes to the project, inclusive of the maximum number of files that can be altered (85), the maximum number of updates or new elements (10 commits), and the maximum number of lines that can contain significant changes (1500 lines).

  • Defined Scope of Change: The scope of this update is defined by specifying the exact file paths that can be modified - these include components, regional settings, backend services, and testing files.

  • Rationale for Exception Cases: The reason for exceptions in the system has been elaborated on. It points out multiple issues identified during system review that demanded significant design changes and corrections, including modifications for multi-language support (Internationalization or i18n).

@deepsource-io

deepsource-ioBot commented Sep 2, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in 49159dc...e1f733b on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall GradeSecurity

Reliability

Complexity

Hygiene

Code Review Summary

AnalyzerStatusUpdated (UTC)Details
DockerSep 3, 2026 5:18p.m.Review ↗
PythonSep 3, 2026 5:18p.m.Review ↗
RustSep 3, 2026 5:18p.m.Review ↗
ShellSep 3, 2026 5:18p.m.Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@codeant-aicodeant-aiBot added the size:M This PR changes 30-99 lines, ignoring generated files label Sep 2, 2026
codescene-access[bot]

This comment was marked as outdated.

@codeant-ai

codeant-aiBot commented Sep 2, 2026

Copy link
Copy Markdown

🏁 CodeAnt Quality Gate Results

Commit:e1f733ba
Scan Time: 2026-09-03 17:26:42 UTC

✅ Overall Status: PASSED

Quality Gate Details

Quality GateStatusDetails
Secrets✅ PASSED0 secrets found
Duplicate Code✅ PASSED0.0% duplicated
SAST✅ PASSEDNo security issues
Bugs✅ PASSEDRating S: No bugs
IAC✅ PASSEDRating S: No issues

View Full Results

@sourcery-aisourcery-aiBot 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.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@amazon-q-developeramazon-q-developerBot 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.

Review Summary

This PR adds a scoped exception for PR #583 to the pr-size-exceptions.json governance file. The structure follows the established pattern from previous exceptions.

Critical Issue Found

There's a logic error in the maxFiles configuration: it's set to 85 while the allowedPaths array contains exactly 81 entries. According to the PR description, this should be an "exact 81-file allowlist" with no wildcards. The 4-file gap between maxFiles and the actual path count would incorrectly permit files outside the intended allowlist.

Please fix this mismatch to ensure the exception enforces the exact file list as intended.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

Comment threadconfig/pr-size-exceptions.json Outdated

@cubic-dev-aicubic-dev-aiBot 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.

All reported issues were addressed across 1 file

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment threadconfig/pr-size-exceptions.json Outdated
@codecov

codecovBot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

codescene-access[bot]

This comment was marked as outdated.

codescene-access[bot]

This comment was marked as outdated.

@cubic-dev-aicubic-dev-aiBot 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.

All reported issues were addressed across 1 file (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

Comment threadconfig/pr-size-exceptions.json Outdated
codescene-access[bot]

This comment was marked as outdated.

codescene-access[bot]

This comment was marked as outdated.

@cubic-dev-aicubic-dev-aiBot 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.

All reported issues were addressed across 1 file (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

Comment threadconfig/pr-size-exceptions.json Outdated
codescene-access[bot]

This comment was marked as outdated.

codescene-access[bot]

This comment was marked as outdated.

@github-actions

github-actionsBot commented Sep 2, 2026

Copy link
Copy Markdown

PR size is back within target — previous warning below is resolved.

@cubic-dev-aicubic-dev-aiBot 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.

All reported issues were addressed across 1 file (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

Comment threadconfig/pr-size-exceptions.json
@qnbs
qnbsforce-pushed the chore/pr-583-size-exception branch from 7136704 to ddf9523CompareSeptember 3, 2026 15:18
@codeant-aicodeant-aiBot added size:L This PR changes 100-499 lines, ignoring generated files and removed size:M This PR changes 30-99 lines, ignoring generated files labels Sep 3, 2026
@qnbs

qnbs commented Sep 3, 2026

Copy link
Copy Markdown
OwnerAuthor

Fully recomputed from scratch, not carried forward. Squashed the prior 7 commits (6 incremental recompute attempts + a stray temp commit, none verified against a real rebase or actual gate behavior) into one, freshly derived by actually rebasing #583 onto current main (which now carries #562, #592, #594).

New numbers: 65 governed files (84 incl. 19 generated locale bundles), 1611 meaningful lines, 14 commits — all lower than the previous 70/1753/21 estimate.

Two things the rebase revealed that no prior estimate could have known:

  1. fix(e2e): eliminate WelcomePortal startup/navigation nondeterminism (#532) #583 and fix(storage): make factory-reset recovery deterministic (#591, #593) #592 (issues fix(e2e): factory-reset reload can boot back into the last-active view instead of the WelcomePortal #591/fix(startup): factory-reset reload lands on Dashboard with a seeded project instead of WelcomePortal #593, merged separately) touch overlapping files. Reconciled by layering both mechanisms in wipeAllAppData(): fix(storage): make factory-reset recovery deterministic (#591, #593) #592's isFactoryResetInProgress()/coordinator-draining gate runs first, then fix(e2e): eliminate WelcomePortal startup/navigation nondeterminism (#532) #583's beginIdbReset() force-closes every other long-lived IDB connection the coordinators don't track.
  2. PR fix(e2e): make WelcomePortal recovery navigation locale-independent #590 (merged earlier, unrelated) had already independently shipped the same locale-independent Settings navigation fix fix(e2e): eliminate WelcomePortal startup/navigation nondeterminism (#532) #583 originally introduced across 5 files. Parallel convergent evolution left fix(e2e): eliminate WelcomePortal startup/navigation nondeterminism (#532) #583's own changes to those files with zero net diff against current main — correctly absent from allowedPaths now.

Also fixed a genuine bug in check-pr-size.mjs itself, found while verifying this exception actually works: when an exception's own ceiling legitimately exceeds TIERS.absolute (30 files/3000 lines/15 commits — the entire point of granting one), evaluatePrSize() fell through to selectSeverity() against that fixed tier anyway, so a fully-satisfied wide exception still reported blocking:true. Neither #539 (maxFiles:30, at the tier's own boundary) nor #564 (maxFiles:3) had ever exercised this path — #583 is the first exception wide enough to expose it. Added a regression test.

Verified end-to-end locally, not just by inspection: built a synthetic commit carrying this exact registry entry on top of real origin/main, then ran check-pr-size.mjs against it and the actual rebased #583 branch with a simulated GitHub PR event — exit 0, PR_SIZE_EXCEPTION=APPLIED outcome=within target ... scope=65/65 files ... commits=14/14.

Local validation: lint clean, typecheck clean, 57/57 tests green (including the new regression test), full ci:prepush PASS.

codescene-access[bot]

This comment was marked as outdated.

… check-pr-size.mjs exception-ceiling bug
Recomputed entirely from a genuine rebase of #583 onto current main
(which now carries #562, #592, and #594) rather than trusting the
historical 70 files / 1753 lines / 21 commits figures the earlier
commits on this branch carried forward.
The rebase itself revealed two things the prior estimate could not
have known:
1. #583 and #592 (the independent factory-reset persistence-admission
fix, issues #591/#593) touch overlapping files -- app/listenerMiddleware.ts,
services/factoryResetService.ts, services/crossProjectIndexService.ts,
and their tests. Reconciled by layering both mechanisms inside
wipeAllAppData(): #592's isFactoryResetInProgress()/coordinator-draining
gate runs first (blocks new Redux-listener writes, drains in-flight
ones), then #583's beginIdbReset() force-closes every other long-lived
IDB connection the coordinators do not track.
2. PR #590 (merged earlier, unrelated) had already independently shipped
the same locale-independent Settings/mobile-"More"-button navigation
fix#583 originally introduced across five files (components/SettingsView.tsx,
components/settings/SettingsModals.tsx, components/settings/DataSection.tsx,
components/Sidebar.tsx, tests/e2e/helpers.ts). Parallel convergent
evolution left #583's own changes to those files fully superseded --
zero net diff against current main -- so they are correctly absent
from allowedPaths.
Final measured diff: 65 governed files (84 incl. generated locale
bundles), 1611 meaningful lines, 14 commits -- exact ceilings, no
speculative headroom, computed directly via check-pr-size.mjs itself
against the real rebased branch.
That direct measurement also surfaced a latent bug in check-pr-size.mjs:
when an exception's own ceiling legitimately exceeds TIERS.absolute
(30 files/3000 lines/15 commits) -- the entire point of granting one --
evaluatePrSize() fell through to selectSeverity() against that fixed
tier instead of treating the exception's own ceiling as authoritative,
so a fully-satisfied wide exception still reported blocking:true.
Neither #539 (maxFiles:30, at the absolute tier's own boundary) nor
#564 (maxFiles:3, well under it) had ever exercised this path -- #583
is the first exception whose own scope is wide enough to expose it.
Fixed to short-circuit on exception.entry directly, verified against
a synthetic base commit carrying this fix plus the recomputed entry,
diffed against the actual rebased #583 branch (exit 0, PR_SIZE_EXCEPTION=APPLIED).
Added a regression test covering a wide exception ceiling that exceeds
the fixed absolute tier.
Squashes the prior five commits on this branch (four incremental
"recompute" attempts plus a stray temp commit), none of which had been
verified against a real rebase or the actual gate behavior.
@qnbs
qnbsforce-pushed the chore/pr-583-size-exception branch from ddf9523 to e1f733bCompareSeptember 3, 2026 17:18

@codescene-accesscodescene-accessBot 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.

Gates Passed
3 Quality Gates Passed

See analysis details in CodeScene

Quality Gate Profile:The Bare Minimum
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

@qnbs
qnbs merged commit 110371f into mainSep 3, 2026
40 checks passed
@qnbs
qnbs deleted the chore/pr-583-size-exception branch September 3, 2026 17:45
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:LThis PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@qnbs