(janitor/dedupe): consolidate code review terminal reasons onto db enum - #5672
Merged
Conversation
CODE_REVIEW_TERMINAL_REASONS (packages/db) and CLOUD_AGENT_TERMINAL_REASONS (packages/worker-utils) carried the same 38-literal list of code review terminal reasons, kept in sync manually and guarded by a parity test in apps/web. A mismatch between the two would make the orchestrator send a reason the callback allowlist rejects (or the worker's zod enum silently coerce a valid reason to undefined). The db list is the authoritative persistence enum, and worker-utils already depends on @kilocode/db, so the dependency direction is clean: - packages/db: CODE_REVIEW_TERMINAL_REASONS is now documented as the single source of truth. - packages/worker-utils/cloud-agent-next-client: delete the duplicated array and type; re-export them from @kilocode/db/schema-types under the existing CLOUD_AGENT_TERMINAL_REASONS / CloudAgentTerminalReason names so the public API for code-review-infra is unchanged. - apps/web: drop the now-trivial list parity test. No behavior change: the two lists were byte-identical.
Contributor
Author
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Reviewed by grok-4.6 · Input: 135.3K · Output: 11.9K · Cached: 286K Review guidance: REVIEW.md from base branch |
pandemicsyn
approved these changes
Aug 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Consolidates the duplicated code review terminal reason enum so it has a single owner.
CODE_REVIEW_TERMINAL_REASONS(packages/db/schema-types.ts) andCLOUD_AGENT_TERMINAL_REASONS(packages/worker-utils/cloud-agent-next-client.ts) were two byte-identicalas constarrays of the same 38 literals, kept in sync manually and guarded by a parity test inapps/web. A mismatch would make the orchestrator send a reason the callback allowlist rejects, or make the worker's zod enum silently coerce a valid reason toundefinedvia.catch(undefined).packages/dbis the authoritative owner (the persistence enum), andworker-utilsalready depends on@kilocode/db, so the dependency direction is clean.Changes
CODE_REVIEW_TERMINAL_REASONSas the single source of truth.@kilocode/db/schema-typesunder the existingCLOUD_AGENT_TERMINAL_REASONS/CloudAgentTerminalReasonnames socode-review-infra's public import surface is unchanged.No behavior change — the two lists were byte-identical.
Verification
pnpm --filter @kilocode/db typecheck— passpnpm --filter @kilocode/worker-utils typecheck— passpnpm --filter kilo-code-review-worker typecheck— passpnpm --filter @kilocode/worker-utils test— 28 files / 357 tests passoxlinton changed files — 0 warnings / 0 errorsNote: the
apps/webjest suite could not be run in this environment (it requires shared PostgreSQL), but the only web change is removing an import and a now-redundant describe block from a test file.