feat(lifecycle): strengthen governed state transitions#35
Conversation
Restart RFC phases on content amendments and migrate stored signatures. Allow unreleased work items to reopen, enforce ADR projection ownership, and add guarded latest-release undo while preserving release syntax.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (9)
🚧 Files skipped from review as they are similar to previous changes (5)
📝 WalkthroughWalkthroughThis PR adds ADR projection-ownership validation, expands RFC and Work Item lifecycle rules, introduces guarded latest-release undo support, updates CLI routing and diagnostics, adds schema migration for RFC signatures, and refreshes governance specifications, records, documentation, and regression tests. ChangesGovernance lifecycle and correction flows
Estimated code review effort: 5 (Critical) | ~120 minutes Sequence Diagram(s)sequenceDiagram
participant Operator
participant CommandRouter
participant UndoRelease
participant ReleasesFile
participant WorkLifecycle
Operator->>CommandRouter: govctl release undo <expected-version>
CommandRouter->>UndoRelease: dispatch ReleaseUndo
UndoRelease->>ReleasesFile: load and check newest version
ReleasesFile-->>UndoRelease: release history
UndoRelease->>ReleasesFile: remove newest entry or delete empty file
UndoRelease-->>Operator: undo result and changelog hint
Operator->>WorkLifecycle: reopen previously released Work Item
WorkLifecycle->>ReleasesFile: check release references
ReleasesFile-->>WorkLifecycle: item is unreleased
WorkLifecycle-->>Operator: Work Item becomes active
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/validate/mod.rs (1)
90-98: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winFix the diagnostic code for placeholder context.
It appears there is a copy-paste error here. The diagnostic for placeholder context is reusing
DiagnosticCode::W0103AdrNoRefsfrom the check above it. Please update it to the appropriate diagnostic code for placeholder context.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/validate/mod.rs` around lines 90 - 98, Update the diagnostic code used in the placeholder-context check within the validation logic to the dedicated code for missing or placeholder context, rather than W0103AdrNoRefs. Keep the existing message, condition, and diagnostic path unchanged.gov/adr/ADR-0034-use-toml-as-the-canonical-storage-format-for-all-governance-artifacts.toml (1)
44-53: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick winRemove implementation plans from ADRs.
As per the coding guidelines, ADRs must explain design choices and consequences, and must not be turned into mini-RFCs or implementation plans. These files contain explicit implementation steps, phase rollouts, and task tracking criteria, which violate this rule.
gov/adr/ADR-0034-use-toml-as-the-canonical-storage-format-for-all-governance-artifacts.toml#L44-L53: Remove theImplementation Notessection to comply with the ADR guidelines.gov/adr/ADR-0049-adopt-read-only-cockpit-model-for-tui-v2.toml#L36-L41: Remove theImplementation Notessection to comply with the ADR guidelines.gov/adr/ADR-0031-unified-artifact-edit-engine-with-ssot-and-format-adapters.toml#L75-L87: Remove theMigration PlanandCompletion Criteriasections as they act as a step-by-step implementation plan.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@gov/adr/ADR-0034-use-toml-as-the-canonical-storage-format-for-all-governance-artifacts.toml` around lines 44 - 53, Remove the implementation-plan sections from all three ADRs: delete the “Implementation Notes” section in gov/adr/ADR-0034-use-toml-as-the-canonical-storage-format-for-all-governance-artifacts.toml (lines 44-53) and gov/adr/ADR-0049-adopt-read-only-cockpit-model-for-tui-v2.toml (lines 36-41), and delete the “Migration Plan” and “Completion Criteria” sections in gov/adr/ADR-0031-unified-artifact-edit-engine-with-ssot-and-format-adapters.toml (lines 75-87), preserving the ADR decision and consequence content.Source: Coding guidelines
🧹 Nitpick comments (1)
src/ui/messages/artifact.rs (1)
166-180: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueOmit unnecessary
.to_string()allocation.Since
owo-colorsimplements its styling traits for any type that implementsDisplay, you can call.green()directly on theusizevalue and avoid the intermediate string allocation.♻️ Proposed refactor
- work_item_count.to_string().green() + work_item_count.green()(Note: The same optimization can also be applied to
release_createdon line 157 outside this change block.)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/ui/messages/artifact.rs` around lines 166 - 180, Update release_undone to call green() directly on the work_item_count usize instead of converting it with to_string(), preserving the existing colored output. Apply the same allocation-free styling to the work-item count in release_created as well.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/validate/lifecycle/tests.rs`:
- Around line 200-205: Add the #[test] attribute directly above
test_work_status_done_to_active so the test runner discovers and executes this
transition test.
---
Outside diff comments:
In
`@gov/adr/ADR-0034-use-toml-as-the-canonical-storage-format-for-all-governance-artifacts.toml`:
- Around line 44-53: Remove the implementation-plan sections from all three
ADRs: delete the “Implementation Notes” section in
gov/adr/ADR-0034-use-toml-as-the-canonical-storage-format-for-all-governance-artifacts.toml
(lines 44-53) and gov/adr/ADR-0049-adopt-read-only-cockpit-model-for-tui-v2.toml
(lines 36-41), and delete the “Migration Plan” and “Completion Criteria”
sections in
gov/adr/ADR-0031-unified-artifact-edit-engine-with-ssot-and-format-adapters.toml
(lines 75-87), preserving the ADR decision and consequence content.
In `@src/validate/mod.rs`:
- Around line 90-98: Update the diagnostic code used in the placeholder-context
check within the validation logic to the dedicated code for missing or
placeholder context, rather than W0103AdrNoRefs. Keep the existing message,
condition, and diagnostic path unchanged.
---
Nitpick comments:
In `@src/ui/messages/artifact.rs`:
- Around line 166-180: Update release_undone to call green() directly on the
work_item_count usize instead of converting it with to_string(), preserving the
existing colored output. Apply the same allocation-free styling to the work-item
count in release_created as well.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f6688dca-0b92-4e7d-944d-9083fa9dfb6d
⛔ Files ignored due to path filters (24)
tests/snapshots/test_changelog__changelog_errors.snapis excluded by!**/*.snaptests/snapshots/test_changelog__changelog_render.snapis excluded by!**/*.snaptests/snapshots/test_changelog__changelog_setup.snapis excluded by!**/*.snaptests/snapshots/test_describe__describe_basic.snapis excluded by!**/*.snaptests/snapshots/test_describe__describe_in_initialized_project.snapis excluded by!**/*.snaptests/snapshots/test_describe__describe_with_context_active_work_item.snapis excluded by!**/*.snaptests/snapshots/test_describe__describe_with_context_draft_rfc.snapis excluded by!**/*.snaptests/snapshots/test_describe__describe_with_context_empty_project.snapis excluded by!**/*.snaptests/snapshots/test_describe__describe_with_context_normative_impl_phase_rfc.snapis excluded by!**/*.snaptests/snapshots/test_describe__describe_with_context_normative_spec_phase_rfc.snapis excluded by!**/*.snaptests/snapshots/test_describe__describe_with_context_normative_test_phase_rfc.snapis excluded by!**/*.snaptests/snapshots/test_describe__describe_with_context_proposed_adr.snapis excluded by!**/*.snaptests/snapshots/test_describe__describe_with_context_queued_work_items.snapis excluded by!**/*.snaptests/snapshots/test_help__rfc_root_help.snapis excluded by!**/*.snaptests/snapshots/test_lifecycle__accept_already_accepted_fails.snapis excluded by!**/*.snaptests/snapshots/test_lifecycle__accept_rejected_adr_fails.snapis excluded by!**/*.snaptests/snapshots/test_lifecycle__advance_backwards_fails.snapis excluded by!**/*.snaptests/snapshots/test_lifecycle__advance_draft_to_impl_fails.snapis excluded by!**/*.snaptests/snapshots/test_lifecycle__advance_skip_phase_fails.snapis excluded by!**/*.snaptests/snapshots/test_lifecycle__deprecate_clause_already_deprecated_fails.snapis excluded by!**/*.snaptests/snapshots/test_lifecycle__deprecate_clause_superseded_fails.snapis excluded by!**/*.snaptests/snapshots/test_lifecycle__finalize_already_normative_fails.snapis excluded by!**/*.snaptests/snapshots/test_lifecycle__finalize_draft_to_deprecated.snapis excluded by!**/*.snaptests/snapshots/test_lifecycle__finalize_normative_to_deprecated.snapis excluded by!**/*.snap
📒 Files selected for processing (97)
.claude/agents/adr-reviewer.md.claude/skills/adr-writer/SKILL.mdCHANGELOG.mddocs/rfc/RFC-0000.mddocs/rfc/RFC-0001.mddocs/rfc/RFC-0002.mddocs/rfc/RFC-0006.mddocs/rfc/RFC-0007.mdgov/adr/ADR-0021-resource-scoped-render-commands-for-single-item-rendering.tomlgov/adr/ADR-0029-path-based-nested-field-addressing-for-artifact-edits.tomlgov/adr/ADR-0030-parser-strategy-for-path-based-field-expressions.tomlgov/adr/ADR-0031-unified-artifact-edit-engine-with-ssot-and-format-adapters.tomlgov/adr/ADR-0034-use-toml-as-the-canonical-storage-format-for-all-governance-artifacts.tomlgov/adr/ADR-0037-canonical-edit-surface-for-nested-artifact-mutation.tomlgov/adr/ADR-0038-keep-adr-schema-discussion-oriented-and-avoid-broad-migration.tomlgov/adr/ADR-0040-controlled-vocabulary-tags-for-governance-artifacts.tomlgov/adr/ADR-0049-adopt-read-only-cockpit-model-for-tui-v2.tomlgov/adr/ADR-0050-preserve-direct-clause-supersession-chains.tomlgov/adr/ADR-0051-scope-terminal-lifecycle-states-to-revision-and-release-boundaries.tomlgov/adr/ADR-0052-assign-adr-projection-structure-to-canonical-authoring-surfaces.tomlgov/adr/ADR-0053-use-guarded-latest-only-undo-for-local-release-cuts.tomlgov/config.tomlgov/rfc/RFC-0000/clauses/C-ADR-PROJECTION-OWNERSHIP.tomlgov/rfc/RFC-0000/clauses/C-PHASE-LIFECYCLE.tomlgov/rfc/RFC-0000/clauses/C-RELEASE-DEF.tomlgov/rfc/RFC-0000/clauses/C-SUMMARY.tomlgov/rfc/RFC-0000/clauses/C-WORK-DEF.tomlgov/rfc/RFC-0000/rfc.tomlgov/rfc/RFC-0001/clauses/C-RFC-PHASE.tomlgov/rfc/RFC-0001/clauses/C-WORK-STATUS.tomlgov/rfc/RFC-0001/rfc.tomlgov/rfc/RFC-0002/clauses/C-CRUD-VERBS.tomlgov/rfc/RFC-0002/clauses/C-GLOBAL-COMMANDS.tomlgov/rfc/RFC-0002/clauses/C-LIFECYCLE-VERBS.tomlgov/rfc/RFC-0002/clauses/C-RESOURCE-MODEL.tomlgov/rfc/RFC-0002/clauses/C-RESOURCES.tomlgov/rfc/RFC-0002/rfc.tomlgov/rfc/RFC-0003/rfc.tomlgov/rfc/RFC-0004/rfc.tomlgov/rfc/RFC-0006/rfc.tomlgov/rfc/RFC-0007/rfc.tomlgov/schema/release.schema.jsongov/schema/work.schema.jsongov/work/2026-07-15-enforce-adr-projection-ownership.tomlgov/work/2026-07-15-reopen-unreleased-completed-work-items.tomlgov/work/2026-07-15-resolve-lifecycle-compliance-audit-gaps.tomlgov/work/2026-07-15-restart-rfc-phase-lifecycle-on-content-bumps.tomlgov/work/2026-07-15-support-undoing-the-latest-release-cut.tomlsrc/cli/commands.rssrc/cli/common/targets.rssrc/cli/help.rssrc/cli/mod.rssrc/cli/resources/rfc.rssrc/cmd/describe/catalog.rssrc/cmd/lifecycle/adr.rssrc/cmd/lifecycle/clause.rssrc/cmd/lifecycle/mod.rssrc/cmd/lifecycle/release.rssrc/cmd/lifecycle/rfc.rssrc/cmd/lifecycle/rfc_supersede.rssrc/cmd/migrate/mod.rssrc/cmd/migrate/rfc_signatures.rssrc/cmd/move_.rssrc/command_router/execute/builtin.rssrc/command_router/parsed.rssrc/command_router/plan.rssrc/command_router/tests/help.rssrc/command_router/tests/lock_disposition.rssrc/command_router/tests/mod.rssrc/command_router/tests/routing.rssrc/diagnostic/code/metadata.rssrc/diagnostic/code/mod.rssrc/model/release.rssrc/parse/toml_io.rssrc/signature/mod.rssrc/signature/tests.rssrc/ui/messages/artifact.rssrc/validate/adr_projection.rssrc/validate/lifecycle/mod.rssrc/validate/lifecycle/tests.rssrc/validate/mod.rssrc/validate/releases.rstests/adr_gate_tests/accept.rstests/changelog_tests/release_workflow.rstests/error_tests/adr_projection.rstests/error_tests/mod.rstests/error_tests/release.rstests/lifecycle_tests/adr.rstests/lifecycle_tests/clause.rstests/lifecycle_tests/rfc_cases/advance.rstests/lifecycle_tests/rfc_cases/bump.rstests/lifecycle_tests/rfc_cases/deprecation.rstests/lifecycle_tests/rfc_cases/finalize.rstests/lock_tests/concurrency.rstests/test_lock.rstests/test_migrate.rstests/test_move.rs
💤 Files with no reviewable changes (3)
- src/cli/common/targets.rs
- src/model/release.rs
- gov/adr/ADR-0021-resource-scoped-render-commands-for-single-item-rendering.toml
| fn test_work_status_done_to_active() { | ||
| assert!(is_valid_work_transition( | ||
| WorkItemStatus::Done, | ||
| WorkItemStatus::Active | ||
| )); | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Add missing #[test] attribute.
The test_work_status_done_to_active function is missing the #[test] attribute, meaning it will be completely ignored by the test runner.
🐛 Proposed fix
+#[test]
fn test_work_status_done_to_active() {
assert!(is_valid_work_transition(
WorkItemStatus::Done,
WorkItemStatus::Active
));
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| fn test_work_status_done_to_active() { | |
| assert!(is_valid_work_transition( | |
| WorkItemStatus::Done, | |
| WorkItemStatus::Active | |
| )); | |
| } | |
| #[test] | |
| fn test_work_status_done_to_active() { | |
| assert!(is_valid_work_transition( | |
| WorkItemStatus::Done, | |
| WorkItemStatus::Active | |
| )); | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/validate/lifecycle/tests.rs` around lines 200 - 205, Add the #[test]
attribute directly above test_work_status_done_to_active so the test runner
discovers and executes this transition test.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Restart RFC phases on content amendments and migrate stored signatures. Allow unreleased work items to reopen, enforce ADR projection ownership, and add guarded latest-release undo while preserving release syntax.
Summary by CodeRabbit
release undoto correct the newest local release when the expected version matches.