refactor(server): isolate the shell-hook side of system-env (split S09 L1/3) - #3585
refactor(server): isolate the shell-hook side of system-env (split S09 L1/3)#3585lidge-jun wants to merge 2 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
✅ Deterministic PR hygiene checks passed. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughChangesThe shell environment implementation moved to Shell environment and authentication markers
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The shell environment refactor preserves the public API and its lifecycle behavior without an actionable merge risk. Sequence Diagram(s)sequenceDiagram
participant SystemEnv
participant SystemEnvShell
participant ClaudeCLI
participant Zshrc
SystemEnv->>SystemEnvShell: reconcileShellHook(systemEnvInjected)
SystemEnvShell->>ClaudeCLI: inspect PATH for executable claude
ClaudeCLI-->>SystemEnvShell: installation status
alt Environment injected and CLI installed
SystemEnvShell->>Zshrc: install marker-guarded source hook
else Environment inactive or CLI absent
SystemEnvShell->>Zshrc: remove marker-guarded source hook
end
SystemEnvShell-->>SystemEnv: return hook state
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
리뷰 · 우선순위 50 / 80이 PR은 서버 쪽 현재 옮긴 내용은 대략 이렇게 읽히면 됩니다. 테스트 쪽은 types/config 대분할 캠페인 관점에서는 이 파일이 그 캠페인 대상이 아닙니다. 서버 관리 모듈을 크기·관심사 기준으로 나누는 S09 열차의 첫 칸이라, 무효화되어 close-don't-rebase 할 종류가 아닙니다. 우선순위는 순수 이동 잎 기준으로 중간대(50)로 둡니다. 사용자 기능은 그대로이고, 다만 위층 분할의 바닥이므로 막히면 스택 전체가 늦어집니다. CodeRabbit 요약이 “새 기능”처럼 읽히지만 실제로는 이동이므로 릴리즈 노트에 사용자 기능으로 올리지 마세요. 경로/심볼 메인테이너의 판단이 필요한 지점
너의 추천 이 댓글은 grok-bot이 작성했습니다 |
Ingwannu
left a comment
There was a problem hiding this comment.
Approved on exact head 1cab08d. I verified the extracted shell-hook declarations preserve their prior implementations, the original system-env path keeps its public facade exports, and the new leaf has no back-import into the facade or Compatibility Lab. Focused system-env/Claude management/visibility coverage plus the Lab and compatibility guards pass 107/107 under isolated HOME/OPENCODEX_HOME/CODEX_HOME; typecheck and privacy scan also pass. This is a behavior-preserving module split. The hosted macOS jobs are still running, so merge only after every required exact-head check is green.
|
Superseded by aggregate PR #3668, admin-merged into dev as 6585e6a after exact-head CI and tested-tree verification. This original PR was not individually merged; its rebased content and historical records were consolidated in #3668. The original branch is preserved. Further unimplemented debt layers remain deferred. |
Summary
src/server/system-env.ts(env-file path/marker mode,writeShellEnvFile/removeShellEnvFile,installShellHook/uninstallShellHook,claudeCodeCliInstalled,reconcileShellHook, and theSystemEnvDepsresolver type — lines 15–242) moves verbatim tosrc/server/system-env-shell.ts(238 lines).system-env.tskeeps launchctl injection, tracking, rollback and the effective-model env computation (310 lines) and re-exports the five public shell functions plus the type, so all 12 previously exported names stay importable from the original path (14 importers unchanged).catalog_busyhandling in the residual are untouched.devlog/_plan/260905_now_split_train/270_server_system_env.md; rules003_parent_decisions.md(PURE-MOVE-SIZE-01).Stack (S09 server-management; merge bottom-up):
Base: dev; layer 2 depends on this one. Review this PR's diff only (3 files, +261/−234; non-move diff 39 lines). Move-aware view:
git diff --color-moved=dimmed-zebra dev...HEAD.Verification
bun run typecheck→ exit 0tests/lab/core-lab-boundary.test.ts tests/codex-integration/compatibility-manifest.test.ts→ 23 pass / 0 fail (system-envis reachable from the PROTECTEDmanagement-api.tsroot; the leaf stays Lab-free)uninstallShellHookfailsclaude-shell-hook.test.ts:127; replacing thecatalog_busycondition fails the source oracle atmodel-visibility-management-api.test.ts:78; a Lab import in the leaf fails the boundary guard with the chainmanagement-api → system-env → system-env-shell → lab/paths.bun run privacy:scan→ passed;git diff --check dev...HEADclean.installShellHookandgetShellEnvFilePath; leaf has no back-edge; residual still owns thecatalog_busybranch.lidge) at this exact SHA: recorded in the devlog doc.Checklist
Summary by CodeRabbit
New Features
Bug Fixes