Skip to content

fix(tests): bundle lane A — test hygiene, desktop restart guard and README inventory counts - #5672

Merged
lidge-jun merged 8 commits into
devfrom
codex/260923-bundle-a-tests-hygiene
Sep 23, 2026
Merged

lidge-jun merged 8 commits into
devfrom
codex/260923-bundle-a-tests-hygiene

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

Bundle lane A of the 260923 PR-consolidation round: six test-hygiene and README-accuracy fixes carried onto current dev, one commit per carried PR, each with the original author's Co-authored-by trailer.

Supersedes #5482
Supersedes #5607
Supersedes #5570
Supersedes #5605
Supersedes #5630
Supersedes #5340

Refs #5439 — its first half (the batched runner cannot run on macOS: GNU timeout, mapfile) was already fixed on dev by #5456. Its second half (failure counts that depend on batch size) comes from the cross-file leaks that #5570, #5605 and #5607 fix here; tests/server/config.test.ts already restores its cwd, and the single-owner spend-ledger errors are the intended owned-spend-home contract.

Credit:

Co-authored-by: Fred Amartey 43480311+FredAmartey@users.noreply.github.com
Co-authored-by: terin 100397903+sh940701@users.noreply.github.com
Co-authored-by: codingbo 9621077+codingbooo@users.noreply.github.com

Follow-up noted during review, not changed here: gui/src/use-codex-restart.ts ignores desktopApp.reason for every desktop skip reason on dev (unsupported platform, no targets, restart in flight, ...), so a skipped desktop restart with no running app-server reads as success. test_environment only occurs in armed test processes, so this bundle does not widen that gap.

Verification

The full local suite was not run: the round's owner runs bun run test once after every lane has landed. Focused runs on the lane head, all in one Bun process per line:

  • bun run typecheck — pass
  • bun run structure:check — pass; bun run privacy:scan — pass; git diff --check origin/dev..HEAD — clean
  • bun test tests/ci-workflows/file-size-ratchet.test.ts tests/ci-workflows/repo-hygiene.test.ts tests/test-layout.test.ts tests/test-layout-tooling.test.ts — 42 pass, 0 fail
  • bun test tests/ci-workflows/docs-readme-memory-inventory.test.ts tests/ci-workflows/docs-readme-translation-parity.test.ts tests/ci-workflows/docs-link-targets.test.ts — 93 pass, 0 fail
  • bun test tests/images — 217 pass, 0 fail (12 files in one process)
  • bun test tests/adapters/abort-race.test.ts tests/adapters/anthropic/anthropic-quota-dispatch.test.ts tests/claude-integration/claude-code-thought-signature-scope.test.ts tests/routing/routing-policy-surface-parity.test.ts — 28 pass, 0 fail
  • bun test tests/images/gemini-inline.test.ts tests/images/loop.test.ts — 82 pass, 0 fail
  • bun test tests/clients/desktop-app-restart.test.ts tests/clients/desktop-app-restart-posix.test.ts tests/clients/desktop-restart-handoff.test.ts tests/ci-workflows/test-home-guard.test.ts — 83 pass, 0 fail
  • The 26 files fix(tests): restore the sandbox home after every test file #5570 touches plus service-secrets → winsw → service-tier-capability in one process — 710 pass, 6 fail. The six are tests/codex-integration/issue-914-transport-attribution.test.ts, which fails 6/6 identically at origin/dev in this checkout because the worktree lives under ~/.codex and the file's temp directory trips the real-Codex-home guard; hosted CI checks out elsewhere.

Each candidate got a read-only gpt-6-sol soundness review before carrying, and the final branch got a gpt-6-sol adversarial review: one P2 (dashboard ignores the new skip reason) was withdrawn after the evidence above, one P3 (devlog EOF blank lines) was fixed. Exact-head hosted CI is the remaining gate.

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.

Summary by CodeRabbit

  • Bug Fixes

    • Prevented test runs from triggering an unintended desktop app restart; the CLI now reports when a restart is skipped in a guarded test environment.
    • Improved test isolation so environment settings and mocked modules are restored reliably between tests.
  • Documentation

    • Updated memory inventory details across README translations, including retained-store counts and the note that native control replay storage is not evicted.
    • Added checks to keep the documented inventory counts aligned across locales.

lidge-jun and others added 7 commits September 23, 2026 19:11
Carries #5482.

Co-authored-by: Fred Amartey <43480311+FredAmartey@users.noreply.github.com>
…s them

Carries #5607.

Co-authored-by: Fred Amartey <43480311+FredAmartey@users.noreply.github.com>
Carries #5570 (both PR commits, including the CodeRabbit ordering fix).

Co-authored-by: Fred Amartey <43480311+FredAmartey@users.noreply.github.com>
Carries #5605. Folded review fix: each file restores only the module
snapshots it actually captured, so a beforeAll that failed partway
cannot install an empty module, and z-handler-activation restores its
overrides in a finally block so a failed directory removal cannot leave
them installed for later files in the process.

Co-authored-by: Fred Amartey <43480311+FredAmartey@users.noreply.github.com>
Carries #5630. restartCodexDesktopApp returns the skipped reason
test_environment when the test preload armed OCX_TEST_HOME_GUARD and no
execFile was injected, and the CLI reports that skip. Folded review fix:
structure/runtime.md documents the guarded outcome next to the CLI
restart scope it owns.

Co-authored-by: terin <100397903+sh940701@users.noreply.github.com>
… them

Carries #5340, rebuilt on dev after #5615 and #5638 so their README and
locale prose stays intact. Folded review fixes: dev now registers 14
retained stores, and native_control_replay is pinned (evictOldest
returns 0), so every page says 14 and names the one store the budget
never evicts; the guard's header drops the numbers that had gone stale;
readme/i18n-manifest.json carries the hash of the final README.md.

Co-authored-by: codingbo <9621077+codingbooo@users.noreply.github.com>
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 23, 2026 10:12
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 23, 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-23T10:19:46.826078Z c127caa 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

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Sep 23, 2026
@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository: lidge-jun/opencodex/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 3466202f-fbd0-4793-85c9-e0a3f7250c4a

📥 Commits

Reviewing files that changed from the base of the PR and between 685321e and 7a05c65.

📒 Files selected for processing (55)
  • README.md
  • devlog/_plan/260923_bundle_a_tests_hygiene/000_triage.md
  • devlog/_plan/260923_bundle_a_tests_hygiene/010_build.md
  • devlog/_plan/260923_bundle_a_tests_hygiene/020_delivery.md
  • readme/README.fr.md
  • readme/README.ja.md
  • readme/README.ko.md
  • readme/README.ru.md
  • readme/README.tr.md
  • readme/README.zh-CN.md
  • readme/README.zh-TW.md
  • readme/i18n-manifest.json
  • scripts/test-layout/layout.json
  • src/cli/restart-scope.ts
  • src/codex/desktop-app-restart.ts
  • structure/runtime.md
  • tests/adapters/abort-race.test.ts
  • tests/adapters/key-failover.test.ts
  • tests/ci-workflows/docs-readme-memory-inventory.test.ts
  • tests/claude-integration/claude-code-thought-signature-scope.test.ts
  • tests/clients/desktop-app-restart-posix.test.ts
  • tests/clients/desktop-app-restart.test.ts
  • tests/codex-integration/codex-account-store-refresh-classification.test.ts
  • tests/codex-integration/codex-account-store.test.ts
  • tests/codex-integration/codex-entitlement-identity-read-fence.test.ts
  • tests/codex-integration/codex-transition-state-adoption.test.ts
  • tests/codex-integration/issue-914-transport-attribution.test.ts
  • tests/fixtures/test-layout-expected.json
  • tests/helpers/translator-budget.ts
  • tests/images/download-cap-default.test.ts
  • tests/images/loop-reasoning-replay.test.ts
  • tests/images/loop.test.ts
  • tests/images/z-fulfill.test.ts
  • tests/images/z-handler-activation.test.ts
  • tests/lab/lab-automation-coderabbit-regressions.test.ts
  • tests/lab/lab-automation-final-coderabbit-regressions.test.ts
  • tests/lab/lab-automation-management-http.test.ts
  • tests/lab/lab-automation-review-regressions.test.ts
  • tests/lab/lab-automation.test.ts
  • tests/lab/lab-evidence-ledger.test.ts
  • tests/lab/lab-evidence-sanitization.test.ts
  • tests/lab/lab-fabric-task.test.ts
  • tests/lab/lab-live-probe.test.ts
  • tests/lab/lab-live-review-regressions.test.ts
  • tests/lab/lab-live-sandbox.test.ts
  • tests/lab/lab-post-merge-hardening.test.ts
  • tests/lab/lab-public-surfaces.test.ts
  • tests/lab/lab-read-surfaces.test.ts
  • tests/responses/responses-snapshot-repair-server.test.ts
  • tests/routing/routing-policy-surface-parity.test.ts
  • tests/server/config.test.ts
  • tests/server/management-provider-pinsless-validation.test.ts
  • tests/server/management-provider-proto-override.test.ts
  • tests/service/process-state.test.ts
  • tests/service/service-secrets.test.ts
 ________________________________________________________________________________
< Alea Iacta Est, Bugs Delenda Est. The die is cast, the bugs must be destroyed. >
 --------------------------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@lidge-jun

Copy link
Copy Markdown
Owner Author

리뷰 · 우선순위 63 / 80

이 묶음은 세 가지를 고칩니다. 테스트가 옆 테스트를 망치지 않게 하고, 테스트를 돌릴 때 개발자 컴퓨터의 진짜 Codex 앱이 꺼졌다 켜지지 않게 하며, README에 적힌 메모리 개수를 코드와 같게 맞춥니다. 기준 브랜치는 dev입니다. 따로 열려 있던 여섯 PR의 내용을 여기로 가져왔습니다.

한 프로세스에서 테스트 파일을 여러 개 돌리면 이런 일이 났습니다. 앞 파일이 모듈을 가짜로 바꾸면 뒷 파일이 그 가짜를 봅니다. 홈 폴더 변수를 지워 버리면 뒷 파일이 진짜 홈을 건드릴 수 있습니다. 번역에 쓰는 예산은, 이 도우미를 맨 처음 불러온 파일에서만 치워졌습니다. 각각 그 자리를 고쳤습니다.

데스크톱 재시작은 테스트가 가짜 실행기를 넣지 않았고 OCX_TEST_HOME_GUARD가 1이면, 앱을 찾기 전에 test_environment라고 하고 멈춥니다. NODE_ENV=test만으로는 막지 않습니다. 사람이 그 값으로 ocx를 실행하면 재시작은 그대로 됩니다.

README는 "36종류"라는 합계를 뺐습니다. 그 합계를 계산해 줄 코드가 없기 때문입니다. 유지 저장소 14개, 관찰 버퍼 4개, 상태 저장소 등록 28개로 적습니다. 14개 가운데 native_control_replay는 예산이 비우지 않습니다. 영어와 번역 7개가 같은 숫자를 말하는지 테스트가 확인합니다. readme/i18n-manifest.json의 해시는 이 커밋의 README.md와 같습니다.

tests/helpers/translator-budget.ts - 테스트 도중에 만든 예산은 그 테스트가 끝나면 치웁니다. 테스트 밖에서 만든 예산은 afterEach에 남겼는데, 이 훅은 도우미를 처음 불러온 파일에만 붙습니다. 그다음 파일이 테스트 시작 전에만 예산을 만들면 치울 곳이 없습니다.

listCodexDesktopAppPids - 재시작 함수는 테스트에서 실제 앱을 끄지 않습니다. 같은 흐름에서 그 직전에 부르는 이 함수는 여전히 실제 앱의 프로세스 목록을 읽습니다. 앱을 종료하지는 않습니다.

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

이 PR이 대체한다고 적은 #5482, #5607, #5570, #5605, #5630, #5340은 아직 열려 있습니다. 둘 다 머지하면 같은 수정이 두 번 들어옵니다.

로컬에서 전체 테스트는 돌리지 않았습니다. 작성자는 이 헤드에서 타입체크, 구조 검사, 관련 파일만 돌렸다고 적었습니다. tests/codex-integration/issue-914-transport-attribution.test.ts 6개는 작업 폴더가 ~/.codex 아래에 있어서 실패하고, dev에서도 같다고 합니다. 호스트 CI가 이 커밋에서 통과하는지를 보면 됩니다. 지금 이 헤드의 체크는 CodeRabbit이 대기 중입니다.

대시보드가 데스크톱 재시작을 건너뛴 이유를 성공처럼 보여주는 문제는 작성자가 이번 묶음 밖으로 빼 두었습니다. 그 가드는 테스트 프로세스에서만 켜지므로, 이번 diff가 넓힌 구멍은 아닙니다.

너의 추천

호스트 CI가 헤드 7a05c65에서 통과하면 dev에 머지하세요. 머지한 뒤 위의 여섯 PR은 닫으세요. 번역 예산이 테스트 밖에서 남는 부분은 따라오는 작은 수정으로 충분하고, 이번 머지를 막을 정도는 아닙니다.

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

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