refactor: code cleanup Q1 2026#61
Conversation
…ergeConfigs, remove stale docs - Extract buildBaseEnvVars and getTelegramStatusWebhooks into shared env-builder module - Simplify mergeConfigs with generic mergeConfigLayer helper (eliminates ~60 lines of duplication) - Delete stale slack-agent-system-architecture.md (packages/slack was removed in commit 46637a0) Closes #59 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The else-if branch handling single hours was a duplicate of the comma-
separated hours branch condition, causing the no-dupe-else-if lint error.
Added hour.includes(',') to the first branch to distinguish the two cases.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Night Watch PR FixChanges made:
CI Failures Fixed:
Night Watch PR Reviewer |
…ressions Verify shallow-merge semantics for providerEnv, boardProvider; replace semantics for roadmapScanner, jobProviders; and env-layer merge stacking. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Additional Tests AddedNew test coverage:
Night Watch PR Reviewer |
DiffGuard AI AnalysisAI Review Summary🏆 Overall Score: 88/100 This PR delivers a high-quality refactoring that consolidates duplicated environment building logic across CLI commands, adds comprehensive test coverage, fixes a cron parsing bug, and removes deprecated documentation. The changes improve maintainability without altering existing functionality. ✅ Key Strengths
🐛 Bugs Found
📝 Issues Found
🔚 Conclusion Analyzed using z-ai/glm-5 |
DiffGuard AI AnalysisAI Review Summary🏆 Overall Score: 92/100 The PR successfully refactors CLI commands to extract shared environment variable building logic, removes deprecated documentation, and adds comprehensive test coverage. The code is clean, well-documented, and follows TypeScript best practices. ✅ Key Strengths
🔚 Conclusion Analyzed using z-ai/glm-5 |
Summary
This PR implements code cleanup tasks from issue #59 to reduce maintenance burden and improve code quality:
Extract shared env-var utilities - Created
packages/cli/src/commands/shared/env-builder.tswithbuildBaseEnvVarsandgetTelegramStatusWebhooksfunctions, eliminating ~40 lines of duplication across 4 command files (run.ts, review.ts, qa.ts, slice.ts)Simplify mergeConfigs - Replaced the two-pass manual merge in
packages/core/src/config.tswith a genericmergeConfigLayerhelper, reducing ~90 lines to ~30 lines while preserving exact semanticsDelete stale docs - Removed
docs/slack-agent-system-architecture.mdwhich described the deletedpackages/slacksystemChanges
New files:
packages/cli/src/commands/shared/env-builder.ts- Shared env-var building utilitiespackages/cli/src/__tests__/commands/shared/env-builder.test.ts- 17 tests for the new moduleModified files:
packages/cli/src/commands/run.ts- Uses sharedbuildBaseEnvVarspackages/cli/src/commands/review.ts- Uses sharedbuildBaseEnvVarspackages/cli/src/commands/qa.ts- Uses shared utilities, removes localgetTelegramStatusWebhookspackages/cli/src/commands/slice.ts- Uses shared utilities, removes localgetTelegramStatusWebhookspackages/core/src/config.ts- SimplifiedmergeConfigswithmergeConfigLayerhelperDeleted files:
docs/slack-agent-system-architecture.md- Stale documentationTest Results
yarn verifypassesCloses #59