Repository navigation
refactor(ci): shard product-file line-count ratchet - #9942
Merged
Merged
Conversation
Replace the shared ratchet baseline with deterministic ownership-scoped JSON shards.\n\nKeep same-PR downward ratcheting intact, validate shard placement and aggregation, and load the legacy baseline at historical refs so the migration does not weaken transition checks.
Git-on-my-level
force-pushed
the
refactor/shard-product-line-ratchets
branch
from
July 18, 2026 01:09
c49e7da to
aebb888
Compare
Member
Author
Omi monitor — rebase conflict resolved, CI greenThe PR was What changed
Verification
PR is now |
undivisible
pushed a commit
to undivisible/omi
that referenced
this pull request
Sep 29, 2026
## Summary - Replace the shared product-file line-count baseline with 15 deterministic, ownership-scoped JSON shards. - Keep file caps and `raise_justifications` together in the same shard, with no mutable global index/manifest. - Preserve mandatory same-PR downward ratcheting; a post-merge writer is deliberately **not** made authoritative. - Load the legacy monolithic baseline at historical refs so this migration preserves raise/removal validation for branches spanning the transition. ## Why The monolithic baseline received 35 commits in roughly 46 hours and became a conflict hotspot for unrelated backend, Rust, and macOS work. PR BasedHardware#9853 had to reconcile it repeatedly while rebasing. The new `baseline_shard_relative()` uses only stable source-path ownership rules: - `backend/{database,routers,utils,other}` - `desktop-rust` - immediate `Desktop/Sources/<subsystem>` Swift shards, plus a `root` shard This avoids replacing the hotspot with a central registry. The checker aggregates shards in memory and rejects duplicate, misplaced, unsupported, or orphaned entries. ## Sol critique incorporated - Keep same-PR downward updates: a nonblocking post-merge bot would permit a source to regrow against its stale higher cap before the bot writes the reduction. - Rewrite only the shard(s) owning changed source paths. - Keep each justification beside its cap and validate global aggregation. - Support legacy-at-base and sharded-at-head transition validation. ## Verification - `python3 -m py_compile .github/scripts/check_product_file_line_count_ratchet.py .github/scripts/test_check_product_file_line_count_ratchet.py` - `python3 .github/scripts/test_check_product_file_line_count_ratchet.py` — 8 passed - `python3 .github/scripts/test_run_checks.py` — 20 passed - `python3 .github/scripts/check_product_file_line_count_ratchet.py --changed-files /tmp/omi-ratchet-changed-files.txt --base origin/main` - confirmed the 44 file caps and 31 justifications match the legacy baseline exactly across 15 shards Failure-Class: none <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/9942?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
raise_justificationstogether in the same shard, with no mutable global index/manifest.Why
The monolithic baseline received 35 commits in roughly 46 hours and became a conflict hotspot for unrelated backend, Rust, and macOS work. PR #9853 had to reconcile it repeatedly while rebasing.
The new
baseline_shard_relative()uses only stable source-path ownership rules:backend/{database,routers,utils,other}desktop-rustDesktop/Sources/<subsystem>Swift shards, plus arootshardThis avoids replacing the hotspot with a central registry. The checker aggregates shards in memory and rejects duplicate, misplaced, unsupported, or orphaned entries.
Sol critique incorporated
Verification
python3 -m py_compile .github/scripts/check_product_file_line_count_ratchet.py .github/scripts/test_check_product_file_line_count_ratchet.pypython3 .github/scripts/test_check_product_file_line_count_ratchet.py— 8 passedpython3 .github/scripts/test_run_checks.py— 20 passedpython3 .github/scripts/check_product_file_line_count_ratchet.py --changed-files /tmp/omi-ratchet-changed-files.txt --base origin/mainFailure-Class: none