Repository navigation
refactor: land god-file round 1 (cleanup, service, kiro) - #4495
Conversation
Pure-move split of src/storage/cleanup.ts (3141 lines) into src/storage/cleanup/ leaves: types, paths, db, satellite, pending, reconcile, staging, preview, execute, restore. The original file remains a facade re-exporting every public name. No behavior change; no consumer edits.
Pure-move split of src/service.ts (5558 lines) into src/service/ leaves: state (paths/install-state), guards (ownership/auth/manager-command), health (port resolution + serving checks), launchd, systemd, windows-scheduler (schtasks + elevation finalize), windows-taskxml (task XML build/verify), windows-ops (Windows install/stop/uninstall + stage tracking), repair, orchestration (install/uninstall/stop dispatch), diagnostics, cli (arg parsing/dispatch). src/service.ts is now a facade re-exporting every original export. One semantic-preserving adjustment: import.meta.dir at the old file depth is carried by serviceSourceDir in state.ts.
…eaves [skip ci] Hosted CI on the stack tip went red because source-contract tests still read the 30-line facade at src/service.ts. Point each assertion at the owning leaf so the existing oracles keep their original strings, slices, and negative matches. Import-specifier depth is the only assertion text that changed, because the leaves sit one directory lower.
… [skip ci] Hosted CI shard 2/4 still read src/service.ts from launchd-repair.test.ts. Point each slice at the owning leaf and keep the original assertion strings.
Pure-move split of the 2319-line kiro.ts god file into src/adapters/kiro/ leaves: wire.ts (wire identity/constants + message shapes), usage.ts (token estimation + message-text walkers), reasoning.ts (reasoning mode + thinking-tag injection), conversation.ts (capability + conversation-state validation), payload.ts (buildKiroPayload assembly), stream.ts (eventstream parsing + bounded fallback), adapter.ts (createKiroAdapter). kiro.ts is now a thin facade re-exporting the same public surface. Zero behavior change; no consumer edits.
The Kiro implementation now lives under src/adapters/kiro/, with src/adapters/kiro.ts as the facade. Keep the structure map aligned so structure:check still names a path inside the owned area.
dev landed #4425 on the old src/service.ts after this stack branched. Carry the LogonTrigger UserId and the matching source-contract tests into src/service/windows-taskxml.ts so a non-elevated install still registers without asking for UAC.
Keep the service facade. The Windows logon-trigger fix from #4425 is already in src/service/windows-taskxml.ts.
Merge the god-file round 1 stack: storage/cleanup, service, and kiro facades.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (45)
📝 WalkthroughWalkthroughThe change splits Kiro, service, and storage-cleanup implementations into focused modules. It adds Kiro request and stream handling, cross-platform service management, archived-session cleanup and restore flows, structure documentation, and updated source-location tests. ChangesArchived storage cleanup
Cross-platform service management
Kiro provider adapter
Estimated code review effort: 5 (Critical) | ~120 minutes Change: Refactor ✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 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 |
|
✅ Deterministic PR hygiene checks passed. |
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. |
…-round1-merge refactor: land god-file round 1 (cleanup, service, kiro)
God-file round 1 stack already merged with current dev. Facades for storage/cleanup, service, and kiro. Source-contract tests retargeted to owning leaves. Windows logon-trigger fix from #4425 lives in src/service/windows-taskxml.ts.
Summary
God-file round 1 stack, already merged with current
dev.src/storage/cleanup.ts,src/service.ts, andsrc/adapters/kiro.tsstay as facades over cohesive leaves.Verification
Checklist
Summary by CodeRabbit
New Features
Bug Fixes
Documentation