Skip to content

[WRONG BRANCH] fix(scripts): name the size exemptions after the reason they exist (#4706) - #4757

Merged
lidge-jun merged 6 commits into
codex/rg2-lab-sync-activation-guardfrom
codex/rg3-ratchet-generated-exemptions
Sep 16, 2026
Merged

lidge-jun merged 6 commits into
codex/rg2-lab-sync-activation-guardfrom
codex/rg3-ratchet-generated-exemptions

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Sep 16, 2026

Copy link
Copy Markdown
Owner

Summary

GENERATED_PATHS exempted twelve files from every size cap, and eleven of them were hand-maintained: the nine dashboard locale catalogues (en describes itself as the TKey source of truth), the hand-curated frontier-benchmarks.json, and scripts/model-metadata.source.json — which is the generator's input. Its output, src/generated/model-metadata.ts, is 108 lines and was scanned normally, so the one file the list was named after was the one file it did not describe.

Exempting catalogues and data snapshots is a reasonable policy. Calling them generated is what invites the next hand-written file onto the list, because a name is a claim that nothing checks.

The exemption is now three exact allowlists, each carrying the reason it exists:

List Holds Why exempt
GENERATED_PATHS src/adapters/cursor/gen/agent_pb.ts Machine output; the line count is a fact about protoc-gen-es.
I18N_CATALOG_PATHS the nine locale catalogues They grow by one line per interface string in nine locales at once, so a cap would block every new string in the dashboard rather than any oversized module.
DATA_SNAPSHOT_PATHS frontier-benchmarks.json, model-metadata.source.json Records, not code: size tracks how much was recorded, and splitting one would hide provenance.

EXEMPT_PATHS is their union. The verdict and the baseline field are renamed GENERATEDEXEMPT to match; loadBaseline still accepts the old key, so a branch written before the rename loads instead of failing with a shape error that explains nothing.

The classification is now checkable against the files themselves rather than against its own name: every path in GENERATED_PATHS must carry a generator banner, and no path in the other two lists may. The positive control sits on the other side — the generator's real output carries the banner, is not exempt, and is scanned under a cap.

Because the whole exemption rests on --update never turning an exemption into a cap, that is now asserted directly, alongside the Math.min rule that only ever lowers one.

No file's effective size policy changes: all twelve paths remain exempt, the repository scan is unchanged, and no interface file is modified by this PR.

Closes #4706

Verification

Local test suites, individual test files, bun run typecheck, bun run test, bun run test:changed, the dashboard build and dependency installation were NOT RUN — the maintainer forbids local suite execution in this lane, since a local test run previously deleted real ~/.opencodex data.

What was done instead:

  • The ratchet's own check path was run read-only against the working tree with the updated baseline: file-size ratchet passed. scanRepo + evaluate report zero offenders, and the EXEMPT rows equal EXEMPT_PATHS exactly. That scan includes the files this lane's earlier layers add.
  • All 18 assertions this PR adds were evaluated ahead of time against the shipped code: 18/18 match, including the banner oracle for all twelve paths, the disjointness and union checks, and the three update-rule cases.
  • The banner oracle was confirmed empirically before it was asserted: exactly one of the twelve matches /@generated|DO NOT EDIT|Do not edit/ in its first twelve lines, and src/generated/model-metadata.ts matches as the positive control.
  • No references outside scripts/ and tests/: structure/, docs-site/, .github/ and AGENTS.md name neither the constant nor the baseline field, so the rename has no documentation surface to drift from.
  • Transpile check of the script and its test. No test was executed.
  • Hosted CI for this layer runs on the lane tip, which contains this commit; this layer's own commit carries [skip ci] under the maintainer-approved DEV-STACK-08 tip-only policy.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

…4706) [skip ci]

GENERATED_PATHS exempted twelve files from every size cap, and eleven of them
were hand-maintained: nine i18n catalogues, a hand-curated benchmarks snapshot,
and the model-metadata generator's INPUT. Its output, src/generated/model-
metadata.ts, is 108 lines and was scanned normally, so the one file the list was
named after was the one file it did not describe.

Exempting catalogues and data snapshots is a reasonable policy. Calling them
generated is what invites the next hand-written file onto the list, because a
name is a claim nothing checks.

The exemption is now three exact allowlists, each carrying its own reason.
GENERATED_PATHS holds only agent_pb.ts, which opens with a protoc-gen-es banner.
I18N_CATALOG_PATHS holds the nine locale catalogues, exempt because they grow by
one line per UI string in nine locales at once, so a cap would block every new
string in the GUI rather than any oversized module. DATA_SNAPSHOT_PATHS holds
the two records whose size tracks how much was recorded. EXEMPT_PATHS is their
union, and the verdict and baseline field are renamed from GENERATED to EXEMPT
to match. loadBaseline still accepts the old key so a branch written before the
rename loads instead of failing with a shape error that explains nothing.

The classification is now checkable against the files themselves: every path in
GENERATED_PATHS must carry a generator banner, and no path in the other two
lists may. The positive control is the generator's real output, which carries
the banner, is not exempt, and is scanned under a cap.

The exemption relies on --update never turning an exemption into a cap, so that
is asserted directly alongside the Math.min rule that only ever lowers one.

Closes #4706
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 16, 2026 02:21
@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • ^dev$
  • ^preview$

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: c19e3533-9b73-4326-a4f6-fa9f1ba25f22

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@github-actions

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-16T02:24:17.396112Z 2ace217 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added the bug Something isn't working label Sep 16, 2026
@lidge-jun

Copy link
Copy Markdown
Owner Author

리뷰 · 우선순위 76 / 80

이 PR은 파일 크기 래칫(scripts/file-size-ratchet.ts)이 면제 목록을 GENERATED_PATHS라는 한 이름으로 묶어 두었던 거짓 주장을 고친다. 현재 dev HEAD는 3070d64d8 (package 2.57.0)이고, 그 tip의 기준선 JSON(tests/fixtures/file-size-baseline.json)은 여전히 키 generated 아래에 열두 경로를 넣는다. 그중 실제로 생성기 배너(@generated by protoc-gen-es)를 가진 것은 src/adapters/cursor/gen/agent_pb.ts 하나뿐이다. 나머지 아홉 개 gui/src/i18n/*.ts 카탈로그는 en.ts 스스로 TKey 소스라고 말하고, frontier-benchmarks.jsonscripts/model-metadata.source.json은 손으로 고치는 기록·생성기 입력이다. 정작 생성기 출력인 src/generated/model-metadata.ts (배너 Do not edit by hand, ~108줄)은 면제가 아니라 일반 캡으로 스캔된다. 이름이 틀리면 다음 손글 파일도 ‘generated’로 올라가기 쉽다. 이 PR은 면제를 세 목록으로 나눈다: GENERATED_PATHS(기계 출력 agent_pb.ts만), I18N_CATALOG_PATHS(아홉 locale — 한 UI 문자열이 아홉 파일에 동시에 한 줄씩 늘어나서 캡이 모듈 비대화를 막는 게 아니라 GUI 문자열 추가를 막음), DATA_SNAPSHOT_PATHS(기록 두 개). 합집합이 EXEMPT_PATHS이고 판정·기준선 필드도 GENERATEDEXEMPT로 맞춘다. loadBaseline은 옛 키 generated도 읽어, 이름 바꾸기 전 브랜치가 뜻 없는 shape 오류로 죽지 않게 한다. 테스트는 세 목록이 서로소·합=면제·길이 12·파일이 실제로 있는지, generated만 배너를 갖는지, 생성기 실출력이 배너를 가지면서 면제가 아닌지, --update가 면제에 캡을 만들지 않고 기존 캡을 Math.min으로만 내리는지를 단언한다. 정책상 열두 경로의 실효 면제는 그대로라서 스캔 결과 offender 집합은 안 바뀐다. 이슈 #4706을 닫는다. types.ts/config.ts 분할·pre-split monolith 재편집과는 무관하다.

베이스 codex/rg2-lab-sync-activation-guard - dev가 아니다. 스택은 #4747(rg1 home-guard) → #4754(rg2 Lab activation walk, #4704) → 이 PR(rg3). 머지는 앞 레이어가 dev에 오른 뒤, 또는 retarget 후에 안전하다.
커밋 2ace217bf [skip ci] - DEV-STACK-08 tip-only와 맞다. 지금 rollup은 resolve-pr/label/hygiene/enforce-target/CodeRabbit SUCCESS이고 unit·typecheck 전체 suite는 이 head에 없다. tip CI에 의존한다.
경로 tests/ci-workflows/file-size-ratchet.test.ts (주석) - 시드 설명에 ‘Exempt exempt paths’처럼 단어가 겹친 줄이 있다. 동작과 무관하나 다음 터치에서 한 단어로 다듬으면 읽기가 좋다.
경로 scripts/file-size-ratchet.ts EXEMPT_PATHS - 배열을 만든 뒤 .sort()한다. 새 배열이라 변이 자체는 괜찮고, 기준선 JSON 순서와도 맞춘다. locale 기본 정렬이 의도인지 한 번만 확인하면 충분하다.
경로 loadBaseline 호환 - 옛 generated 키를 exempt로 읽는다. 스택·포크 브랜치가 깨지지 않는 선택이다. 다만 오래 두면 두 키가 섞인 기준선이 남을 수 있으니, 머지 후 문서/다음 레이어에서 새 키만 쓰도록 정리할지는 선택이다.

메인테이너의 판단이 필요한 지점

너의 추천
KEEP. 이름·분류·배너 오라클·업데이트 불변식이 맞고, 실효 캡 정책은 안 바뀐다. types/config 분할 무관하니 close-don't-rebase 대상이 아니다. 추천: 스택 앞단(#4754, 필요하면 #4747)이 dev에 오른 것을 확인한 뒤 머지하고 #4706을 닫는다. 로컬 full suite는 이번 레인 금지 그대로 두고, tip hosted CI만 본다.

이 댓글은 grok-bot이 작성했습니다

…de splits (#4711)

The architecture pages and structure/runtime.md still described the module
ownership that existed before the facade splits of the last release train, so a
reader following them landed in a file that no longer contains the code.

Routing now lives in src/server/index/serve-options.ts, request preparation in
src/server/responses/request-prepare.ts, and bridge conversion in src/bridge/
sse.ts and src/bridge/response-json.ts. src/bridge.ts is seven lines of
re-exports. The pages named the pre-split files in every locale, so fixing only
the English source would have left seven translations contradicting it.

The facade paragraph also carried three counts -- seven, nine and five leaf
modules -- that were already 26, 42 and 53. Counts that must be recounted on
every split are a drift source rather than information, so they are gone; what
replaces them is the distinction the counts were standing in for. A facade is
the stable import path, not the implementation, and each step of the request
flow now names the module that owns the code.

structure/runtime.md gets the same correction on five ownership claims, and
points at structure/transports/responses.md, which already carries the
post-split owner inventory for the Responses surface.

Scope is deliberately narrow: only claims about which module owns which
responsibility change. No prose about behaviour is rewritten, and no locale
receives a translation it did not already have.

Closes #4711
@lidge-jun

Copy link
Copy Markdown
Owner Author

Cascading downward. The file-size ratchet's generated exemptions split into three exact allowlists, validated by the files themselves rather than by name: only the generated list may carry a generator banner, and the other two must not.

Evidence at the verified tip baaf691 (tree 3728219b8b5c1758a768108e4b69b648fa0828f6), from dispatch run 35053542913:

  • test 1-4/4, macos 1-2/2 and macos control all completed with conclusion success, confirmed through the check-runs API rather than the check rollup. windows 1/6 through 6/6 all succeeded, as did gates, storage policy, api usage, docker smoke, keyring and npm-global on three platforms, and the aggregate ci check.
  • A dispatch run is the evidence here rather than the pull-request run, and that is not incidental. This lane's tip layer changes only documentation, so the changes path filter skips every heavy job on a pull_request event while the aggregate check still reports green. Because the layers below carry [skip ci], the pull-request signal alone would have covered nothing at all. The dispatch runs against the tip tree, which contains all four layers.
  • The dispatch ran at commit c086fda, whose tree is byte-identical to this tip's tree. The lane re-absorbed dev from the bottom layer upward afterwards to keep each pull request's diff to its own layer (5 / 1 / 3 / 9 files); only the merge order changed, so the run remains valid evidence for this tree.
  • windows 5/6 failed once with EPERM ... rm ocx-management-auth-* at tests/helpers/remove-tree.ts:38 and passed on re-run. That is pre-existing Windows behaviour, not a regression from this lane: the guard added here runs once before the retry loop, line 38 is the existing rethrow-after-retries path, the raised error is rmSync's EPERM rather than a guard refusal, the identical code passed in run 35050601423, and src/config/paths.ts:57 already documents hardenConfigDir() leaving icacls.exe holding the directory. The retry budget being too small under six concurrent Windows shards is filed separately as [Bug]: the Windows removal retry budget is 2.5 seconds and is exceeded under shard load #4789.
  • git merge-tree --write-tree origin/dev <tip> reports a clean merge.
  • Ancestry verified so each layer closes as MERGED: rg1, rg2 and rg3 are all ancestors of this tip.

Chained-child stacks merge top-down, so this lands in the parent branch and cascades to dev.

Maintainer integration decision under MAINTAINERS.md / AGENTS.md: a maintainer with maintain or admin access may integrate into dev without a second maintainer approval, recording the decision and exact-head CI evidence.

@lidge-jun
lidge-jun merged commit 9af2b0c into codex/rg2-lab-sync-activation-guard Sep 16, 2026
7 checks passed
@lidge-jun
lidge-jun deleted the codex/rg3-ratchet-generated-exemptions branch September 16, 2026 05:05
@github-actions github-actions Bot changed the title fix(scripts): name the size exemptions after the reason they exist (#4706) [WRONG BRANCH] fix(scripts): name the size exemptions after the reason they exist (#4706) Sep 16, 2026
@github-actions

github-actions Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

⏳ DRAFT

  • wrong target branch (codex/rg2-lab-sync-activation-guard); retarget to dev.

What to do

  • Retarget this PR to dev — all contributions go to dev.

Its title has been prefixed with [WRONG BRANCH].
Automatic draft conversion failed (token cannot change draft status). Please convert this pull request to a draft manually. The required enforce-target check will keep failing until every issue above is resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant