Skip to content

fix(container): preserve routed catalogs through recreation - #3822

Merged
lidge-jun merged 6 commits into
devfrom
codex/platform-lane4-docker
Sep 7, 2026
Merged

fix(container): preserve routed catalogs through recreation#3822
lidge-jun merged 6 commits into
devfrom
codex/platform-lane4-docker

Conversation

@lidge-jun

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

Copy link
Copy Markdown
Owner

Summary

Docker-managed shutdown previously restored native Codex state and removed routed catalog rows despite their persistent volume. Set the existing service lifecycle mode in the runtime image so stop/recreate preserves those rows; no service manager is installed and shared CLI cleanup is unchanged.

Add an isolated real image build/start/recreate probe with a routed synthetic catalog. It verifies loaded configuration, expected first-start migrations, readiness, token admission, refused token replacement, effective restrictions, and exact post-start config/token/catalog preservation across replacement. The next PR connects it to CI.

Carries the source-build contract from #3421/#3604 and separate-home persistence from #3747; addresses the remaining #3449 lifecycle validation. Layer 3, based on #3819. Dashboard-driven restart and arbitrary custom mount migration remain outside this proof.

Verification

  • Final candidate: 6f2ad1ef32c113ff5827c58959c85cefa923b15c. Cross-platform CI, lane=all passed (26 successful jobs). The verification ref points to the same commit as the final PR.
  • Independent Astra high implementation review completed; container lifecycle and workflow changes received explicit independent security/contract reviews.
  • Documentation build passed on isolated Linux at this exact source snapshot: 425 pages.
  • Local test suites, typecheck, and Docker execution were not run, as instructed by the maintainer. Pushes use --no-verify.
  • Lower-layer expensive CI is deliberately omitted; only failed final checks triggered narrowed diagnosis. No lower-layer green is fabricated.
  • Earlier combined runs passed all six Windows shards, four Linux shards, and two macOS shards. They exposed Docker harness assumptions, a TypeScript 7 CLI requirement, and then a real container shutdown/catalog persistence defect. These were corrected. One earlier macOS full-control run failed an unchanged Cursor watchdog test; its cause remains unproven, with no timeout/skip workaround. Superseded runs are not final-head success evidence.

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.

Co-authored-by: Buseong Kim flight@skyline23.com
Co-authored-by: Ingwannu ingwannu@users.noreply.github.com

Maintainer integration

The repository owner explicitly authorized admin integration of this manual chain into dev. The final combined head 6f2ad1ef32c113ff5827c58959c85cefa923b15c passed all 26 CI jobs. One cancelled macOS shard was rerun with unchanged source, commands and limits; its original stall remains recorded rather than claimed fixed.

Independent integration review found no conflict with current dev a5f9c3497. A clean merge produced tree 2c51d5e8042011fe8362e267b224016c6061d684; the relevant OAuth/body/container tests passed there on isolated Linux (129 passed, zero failures). This focused result is distinct from the full CI proof on the combined PR head. The branch commits preserve original contributors through Co-authored-by trailers.

t and others added 2 commits September 7, 2026 07:39
…ip ci]

Report declared wire length, observed lower bounds, and decoded sizes without reading rejected payloads further or changing admission and retry policy. Follow up on #3573; thanks to @nowhere1975 for the content-free incident measurements. The issue remains open for exact compact-attempt evidence. Independent source review passed; final remote CI pending.
Exercise the source-build contract from #3421/#3604 and separate-home persistence from #3747 using disposable Docker resources. Preserve original token and both named volumes through container replacement; verify admission without upstream inference. Independent source/security review completed; actual Docker networking and runtime acceptance remain pending final CI.

Co-authored-by: Buseong Kim <flight@skyline23.com>

Co-authored-by: Ingwannu <ingwannu@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Sep 6, 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: Team

Run ID: f1ed9a47-717f-42f9-b4f1-b10d1566b2ae

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 github-actions Bot added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Sep 6, 2026
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

…ing [skip ci]

CI run 34064754947 built and started the image, then proved internal-only networking suppressed host port publication. Keep actual Compose networking and seed a checked loopback-only provider into disposable state before startup. Verify loaded configuration and hashes through recreation.

Co-authored-by: Buseong Kim <flight@skyline23.com>

Co-authored-by: Ingwannu <ingwannu@users.noreply.github.com>
@lidge-jun

Copy link
Copy Markdown
Owner Author

리뷰 · 우선순위 66 / 80

이 PR은 플랫폼 체인 3층입니다. 베이스는 #3819의 body 브랜치이고, 새 파일 하나 scripts/ci/docker-smoke.ts 만 추가합니다. 하는 일은 “소스 Dockerfile로 이미지를 진짜 빌드하고, 토큰을 넣고, 띄우고, 인증 없는 요청을 거절하는지 보고, 컨테이너를 강제로 다시 만든 뒤에도 이름 붙은 볼륨의 설정/토큰/카탈로그가 남는지”를 CI에서 자동으로 확인하는 것입니다.

지금 dev에는 Dockerfile, compose.yaml, docker/bootstrap-token.ts, 소스 빌드 가이드가 이미 있습니다. 그런데 Cross-platform CI에는 실제 이미지 빌드·기동·재생성 검사가 없습니다. #3421/#3604 소스 빌드 계약과 #3747 Codex-home 영속성, 관련 #3449를 호스트 픽스처만으로는 증명할 수 없다는 게 이 층의 이유입니다.

프로브는 랜덤 프로젝트명 ocx-smoke-… 과 전용 이미지 태그를 씁니다. 호환 매니페스트를 생성해 빌드한 뒤 원본 파일을 되돌립니다. stdin으로 일회용 토큰을 bootstrap-token에 넣고, 합성 카탈로그만 Codex 볼륨에 심습니다. 업스트림 추론(inference) 호출은 하지 않습니다. override로 기본 네트워크를 internal로 막고, 바인드는 127.0.0.1, restart는 no입니다. healthz/readyz, 잘못된·없는 토큰 401, 정확한 카탈로그 200, 토큰 재부트스트랩 거부, force-recreate 후 컨테이너 ID는 다르고 볼륨 이름·해시 증거는 같은지까지 봅니다.

보안/격리 면에서도 신경을 썼습니다. 로그에 인자·본문·토큰을 안 찍고, 자식 프로세스 출력 상한·타임아웃·프로세스 그룹 kill, cleanup 실패 시 프로브 실패 처리가 있습니다. 컨테이너 안 state probe는 파일 바이트 대신 sha256만 밖으로 보냅니다. ReadonlyRootfs, CapDrop ALL, no-new-privileges, non-root UID, 홈 700/파일 600도 확인합니다.

현재 dev 우선 과제(#3808 런타임, 2.46.0 패키징)와는 다른 축이지만, 릴리스 컷 전에 “문서에 적힌 Docker 계약이 CI에서 실제로 사는지”를 막는 값입니다. 프로바이더 추론·authless Desktop 기본값·Anthropic replay 재설계 같은 비목표는 건드리지 않습니다. types/config 분할에도 안 걸립니다. 다만 이 파일만 넣어도 CI가 자동 실행하진 않습니다. 4층 #3823이 워크플로에 꽂아야 게이트가 됩니다.

경로 scripts/ci/docker-smoke.ts networks.default.internal - 내부 네트워크와 호스트 포트 퍼블리시가 러너 Docker 버전에 따라 충돌할 수 있습니다. PR 본문도 runtime validation pending이라고 적었습니다. 최종 CI가 여기서 빨개질 첫 후보입니다.
경로 scripts/ci/docker-smoke.ts inspect HostIp === 127.0.0.1 - compose/OPENCODEX_BIND_ADDRESS 설정과 맞춰야 통과합니다. 현재 계약과 맞는지 최종 런으로 확인 필요.
경로 scripts/ci/docker-smoke.ts build() finally - 기존 compatibility-version.json 복원/삭제는 안전해 보이지만, 생성기가 디렉터리 안에 다른 파일을 남기면 rmdirSync가 실패할 수 있습니다. 현재 생성기 출력이 한 파일이면 OK.
심볼 acceptance()/request() - POST body는 합성 모델이고 인가된 추론을 보내지 않습니다. 범위 준수.

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

너의 추천
#3818#3819 다음 #3822. 머지는 최종 lane=all에서 docker-smoke 잡이 실제로 초록인 것을 본 뒤에 하세요. 프로브만 머지하고 CI 배선(#3823)을 미루면 회귀 감시가 안 생깁니다. 원 Docker 기여자 Buseong Kim / Ingwannu 트레일러 유지. 관련 이슈는 프로브 범위(소스 빌드·볼륨 재사용)만 언급하고 성급히 전부 닫지 마세요.

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

t and others added 3 commits September 7, 2026 08:01
The Docker diagnostic failed because loadConfig correctly rejects private destinations unless explicitly allowed. A bounded remote fixture reproduced the fallback and passed with the test-only flag. Validate the fixture before startup and report fixed seed-phase codes without exposing child errors.

Co-authored-by: Buseong Kim <flight@skyline23.com>

Co-authored-by: Ingwannu <ingwannu@users.noreply.github.com>
…eline [skip ci]

Remote source startup proved the expected tier/subagent migrations and schema-default persistence, followed by byte-stable second startup. Verify exact seed bytes before startup, six explicit migration/default additions at readiness, and an immutable post-start hash through bootstrap refusal and recreation.

Co-authored-by: Buseong Kim <flight@skyline23.com>

Co-authored-by: Ingwannu <ingwannu@users.noreply.github.com>
… ci]

Real Docker CI exposed foreground shutdown stripping routed catalog rows despite persistent volumes. Declare the existing service lifecycle mode in the runtime image so Docker-managed stop/recreate preserves routed state. Keep the routed fixture and exact-byte checks. Two independent lifecycle/security reviews accepted this bounded packaging change; isolated CLI before/after reproduced the defect and preservation with service mode.

Co-authored-by: Buseong Kim <flight@skyline23.com>

Co-authored-by: Ingwannu <ingwannu@users.noreply.github.com>
@lidge-jun lidge-jun changed the title test(container): exercise source-build lifecycle and persistence fix(container): preserve routed catalogs through recreation Sep 6, 2026
@github-actions github-actions Bot added bug Something isn't working and removed chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). labels Sep 6, 2026
@lidge-jun
lidge-jun marked this pull request as ready for review September 7, 2026 00:47
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 7, 2026 00:47
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 7, 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-07T00:51:07.698680Z 15fa571 Draft marked ready
ℹ️ 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.

@lidge-jun
lidge-jun changed the base branch from codex/platform-lane4-body to dev September 7, 2026 00:48
@lidge-jun
lidge-jun merged commit 5dee8cf into dev Sep 7, 2026
14 of 17 checks passed
@lidge-jun
lidge-jun deleted the codex/platform-lane4-docker branch September 7, 2026 00:49
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