Repository navigation
refactor: centralize lifecycle policy - #61
Conversation
PR Summary by QodoCentralize lifecycle states and transition policy across layers
AI Description
Diagram
High-Level Assessment
Files changed (9)
|
Code Review by QodoContext used✅ Compliance rules (platform):
15 rules 1.
|
PR approved by QodoAll merge criteria satisfied — approved by default policy |
Qodo Fixer🍒 Ready to be cherry-picked — ✅ Merged (0) · ☑ Fixed (1) 🔗 Fix PR: #63 This fix PR was closed automatically. Its branch is preserved so you can cherry pick the changes into the original PR. Prompt for coding agent Process — 1 fixed
|
|
Code review by qodo was updated up to the latest commit 465d72e |
Summary
sourceStateandtargetStateconsistently for lifecycle direction across domain, persistence, service, and test codeTASK_STATUS_VALUESarray to state-schemaz.enum()boundariesWhy
Follow-up to #38.
Lifecycle values such as
verifyingandreviewingwere repeated across runtime layers. That made a vocabulary change vulnerable to drift and forced transition policy to be maintained in more than one place. This refactor centralizes the domain vocabulary and topology while keeping the existing CLI, wire, database, and migration contracts unchanged. The directional namessourceStateandtargetStatemake transition logic explicit without changing persistedfrom_stateandto_statefields. State schemas now consume the canonical values array explicitly, avoiding ambiguity at the Zod boundary without an unsafe tuple assertion.Impact
There is no intended user-facing or persisted-contract change. Existing lifecycle strings, ordering, transition behavior, JSON output, CLI errors, legacy migration behavior, and packaged execution remain compatible.
Validation
npm run check— 16 test files and 159 tests passed, followed by build and packaged-install smoke verificationnpm run security:dependencies— passed the high-severity threshold; the existing low-severity esbuild advisory remains tracked by Upgrade esbuild when tsup supports the fixed release #46activenormalization, and invalid status rejectiongit diff --check origin/main...HEADfromortoundersrc/ortests/Review focus
src/domain/types.tsfor lifecycle vocabulary ownershipsrc/domain/lifecycle.tsfor structural topology ownership and directional namingsrc/domain/session-transition.tsfor guard-requirement derivation and directional namingsrc/schemas/state.tsfor canonical values-array validation