Skip to content

fix(lifecycle): preserve supersession history and atomicity#32

Merged
lucifer1004 merged 1 commit into
mainfrom
bugfix
Jun 29, 2026
Merged

fix(lifecycle): preserve supersession history and atomicity#32
lucifer1004 merged 1 commit into
mainfrom
bugfix

Conversation

@lucifer1004

@lucifer1004 lucifer1004 commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Keep clause supersession as direct historical edges with iterative cycle validation. Restore prior artifact contents when multi-file lifecycle operations return errors. Clarify the RFC-0002 failure-atomicity boundary and add regression coverage.

Summary by CodeRabbit

  • New Features
    • Added hardened clause supersession chain support, including qualified cross-RFC replacements and preservation of direct historical replacement links.
  • Bug Fixes
    • Hardened clause supersede/validation: rejects missing, self-referential, and cyclic targets; prevents stack overflows on large acyclic graphs; improves malformed-input safety by stopping before mutations.
    • Made lifecycle/rfc artifact writes failure-atomic with rollback restoration and rollback-failure diagnostics.
  • Tests
    • Expanded lifecycle and validation failure-path coverage for supersession chains, cycles, and non-mutating error cases.
  • Chores
    • Updated governance docs/work items and RFC/ADR specs with the new supersession and atomicity contracts.

@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9cfdaf48-14e4-4b60-94c2-84a4f271e509

📥 Commits

Reviewing files that changed from the base of the PR and between 6722e8c and cc1daaf.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • tests/snapshots/test_errors__broken_superseded_check.snap is excluded by !**/*.snap
📒 Files selected for processing (30)
  • .claude-plugin/marketplace.json
  • .claude/.claude-plugin/plugin.json
  • CHANGELOG.md
  • Cargo.toml
  • docs/rfc/RFC-0001.md
  • docs/rfc/RFC-0002.md
  • gov/adr/ADR-0050-preserve-direct-clause-supersession-chains.toml
  • gov/releases.toml
  • gov/rfc/RFC-0001/clauses/C-CLAUSE-STATUS.toml
  • gov/rfc/RFC-0001/rfc.toml
  • gov/rfc/RFC-0002/clauses/C-LIFECYCLE-VERBS.toml
  • gov/rfc/RFC-0002/rfc.toml
  • gov/work/2026-06-28-harden-clause-lifecycle-review-paths.toml
  • gov/work/2026-06-28-harden-clause-supersession-validation.toml
  • gov/work/2026-06-28-make-artifact-writes-failure-atomic.toml
  • gov/work/2026-06-28-support-clause-supersession-chains.toml
  • src/cmd/lifecycle/clause.rs
  • src/cmd/lifecycle/rfc.rs
  • src/cmd/lifecycle/rfc_clause_versions.rs
  • src/cmd/lifecycle/rfc_supersede.rs
  • src/diagnostic/code/metadata.rs
  • src/diagnostic/code/mod.rs
  • src/validate/fields/mod.rs
  • src/validate/mod.rs
  • src/validate/rfc.rs
  • src/write/mod.rs
  • tests/error_tests/rfc_clause_cases/check.rs
  • tests/lifecycle_tests/clause.rs
  • tests/lifecycle_tests/rfc_cases/bump.rs
  • tests/lifecycle_tests/rfc_cases/finalize.rs
✅ Files skipped from review due to trivial changes (7)
  • Cargo.toml
  • .claude-plugin/marketplace.json
  • .claude/.claude-plugin/plugin.json
  • gov/work/2026-06-28-make-artifact-writes-failure-atomic.toml
  • gov/work/2026-06-28-support-clause-supersession-chains.toml
  • gov/adr/ADR-0050-preserve-direct-clause-supersession-chains.toml
  • gov/rfc/RFC-0001/rfc.toml
🚧 Files skipped from review as they are similar to previous changes (21)
  • src/validate/mod.rs
  • gov/work/2026-06-28-harden-clause-supersession-validation.toml
  • src/cmd/lifecycle/clause.rs
  • src/cmd/lifecycle/rfc_supersede.rs
  • src/diagnostic/code/metadata.rs
  • src/diagnostic/code/mod.rs
  • gov/work/2026-06-28-harden-clause-lifecycle-review-paths.toml
  • tests/lifecycle_tests/rfc_cases/bump.rs
  • tests/lifecycle_tests/rfc_cases/finalize.rs
  • docs/rfc/RFC-0001.md
  • gov/rfc/RFC-0001/clauses/C-CLAUSE-STATUS.toml
  • gov/rfc/RFC-0002/rfc.toml
  • src/cmd/lifecycle/rfc_clause_versions.rs
  • gov/rfc/RFC-0002/clauses/C-LIFECYCLE-VERBS.toml
  • tests/error_tests/rfc_clause_cases/check.rs
  • docs/rfc/RFC-0002.md
  • src/validate/rfc.rs
  • src/cmd/lifecycle/rfc.rs
  • src/validate/fields/mod.rs
  • src/write/mod.rs
  • tests/lifecycle_tests/clause.rs

📝 Walkthrough

Walkthrough

This PR updates clause supersession rules and validation, adds related diagnostics and tests, and introduces atomic file writes with rollback semantics used by RFC bump, finalize, and supersede lifecycle commands.

Changes

Clause Supersession Chain Support

Layer / File(s) Summary
Supersession rules and governance records
docs/rfc/RFC-0001.md, gov/rfc/RFC-0001/clauses/C-CLAUSE-STATUS.toml, gov/rfc/RFC-0001/rfc.toml, gov/adr/ADR-0050-preserve-direct-clause-supersession-chains.toml, gov/work/2026-06-28-support-clause-supersession-chains.toml, gov/work/2026-06-28-harden-clause-lifecycle-review-paths.toml, gov/work/2026-06-28-harden-clause-supersession-validation.toml, src/diagnostic/code/mod.rs, src/diagnostic/code/metadata.rs, gov/releases.toml, CHANGELOG.md
Updates clause supersession normative text, RFC metadata/changelog entries, ADR-0050, work items, diagnostics, release records, and changelog notes for the new supersession semantics.
Clause target normalization and self-cycle rejection
src/validate/fields/mod.rs, src/validate/mod.rs, src/cmd/lifecycle/clause.rs
Normalizes supersession targets, permits cross-RFC replacement targets, rejects self-supersession, and validates superseded_by before clause writes.
Supersession graph validation and cycle detection
src/validate/rfc.rs, tests/error_tests/rfc_clause_cases/check.rs
Builds the supersession graph, checks missing targets, detects cycles, and adds check-mode coverage for missing, single-RFC, and cross-RFC cycle cases.
Clause supersede lifecycle checks
tests/lifecycle_tests/clause.rs
Adds lifecycle coverage for same-RFC shorthand, chained supersession, historical edge preservation, cross-RFC replacement, and rejection paths for invalid replacement transitions.

Atomic File Writes and Lifecycle Transactions

Layer / File(s) Summary
Atomic writes and rollback support
src/write/mod.rs
Replaces direct writes with atomic temp-file writes, resolves symlink targets, and adds file transactions with rollback and rollback-failure diagnostics.
RFC path selection and pending clause updates
src/cmd/lifecycle/rfc_clause_versions.rs
Adds RFC update path discovery, returns updated clause IDs from pending-version filling, and removes UI emission from the helper.
Lifecycle commands wrapped in transactions
src/cmd/lifecycle/rfc.rs, src/cmd/lifecycle/rfc_supersede.rs
Wraps RFC bump, finalize, and supersede write sequences in file transactions and moves UI output to use transaction results.
Failure-atomic lifecycle specs and tests
docs/rfc/RFC-0002.md, gov/rfc/RFC-0002/clauses/C-LIFECYCLE-VERBS.toml, gov/rfc/RFC-0002/rfc.toml, gov/work/2026-06-28-make-artifact-writes-failure-atomic.toml, tests/lifecycle_tests/rfc_cases/bump.rs, tests/lifecycle_tests/rfc_cases/finalize.rs, Cargo.toml, .claude-plugin/marketplace.json, .claude/.claude-plugin/plugin.json
Updates lifecycle atomicity requirements, governance metadata, versioned release records, and failure-path tests to assert byte-for-byte preservation on command errors.

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~90 minutes

Possibly related PRs

  • govctl-org/govctl#30: Also touches RFC lifecycle bump behavior and signature refresh flow in src/cmd/lifecycle/rfc.rs.

Poem

🐇 I hopped through clauses, neat and clear,
With chains and writes held close and dear.
A rollback blink, a temp-file song,
Keeps bytes intact when things go wrong.
Superseded paths still know their way,
And rabbit paws approve this day.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the two main lifecycle changes: preserving supersession history and making lifecycle operations atomic.
Docstring Coverage ✅ Passed Docstring coverage is 96.72% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bugfix

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jun 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.88008% with 73 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/write/mod.rs 82.42% 55 Missing ⚠️
src/cmd/lifecycle/rfc_clause_versions.rs 86.66% 6 Missing ⚠️
src/cmd/lifecycle/rfc.rs 86.84% 5 Missing ⚠️
src/validate/fields/mod.rs 75.00% 5 Missing ⚠️
src/cmd/lifecycle/rfc_supersede.rs 93.33% 1 Missing ⚠️
src/validate/rfc.rs 98.76% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 (1)
src/cmd/lifecycle/clause.rs (1)

47-60: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Resolve --by before the lookup. validate_field accepts same-RFC shorthand like C-NEW, but require_replacement_clause_toml_path(config, by) still sees the raw value and can reject it before normalization. Normalize by against clause_id first, or run the existence check on the normalized target.

🤖 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/cmd/lifecycle/clause.rs` around lines 47 - 60, The replacement lookup in
the clause lifecycle flow is using the raw `by` value before shorthand
normalization, so fix `clause` handling to resolve `--by` against `clause_id`
before calling `require_replacement_clause_toml_path`. Use the same
normalization logic as `validate_field` for `superseded_by`, then perform the
existence/path check on the normalized target so shorthand like `C-NEW` is
accepted consistently.
🧹 Nitpick comments (4)
gov/adr/ADR-0050-preserve-direct-clause-supersession-chains.toml (1)

44-46: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Keep the ADR out of implementation-spec territory.

This subsection prescribes validation and consumer behavior, which belongs in the RFC/work-item trail rather than the ADR itself. As per coding guidelines, gov/adr/*.toml: ADRs must explain design choices and consequences; do not turn them into mini-RFCs or implementation plans.

Suggested trim
-### Implementation Notes
-
-Validation of persisted history follows references across RFCs and checks graph integrity. Consumers may traverse direct edges when they need the latest reachable replacement.
🤖 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-0050-preserve-direct-clause-supersession-chains.toml` around
lines 44 - 46, The ADR’s “Implementation Notes” section is too prescriptive and
drifts into RFC/work-item territory. Trim the
`ADR-0050-preserve-direct-clause-supersession-chains.toml` content so it only
states the design choice and its consequences, and remove
validation/consumer-behavior guidance from this subsection. Keep the language in
the ADR focused on the supersession-chain rationale, not on how `direct edges`
should be traversed or validated.

Source: Coding guidelines

tests/error_tests/rfc_clause_cases/check.rs (1)

228-233: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Assert E0212 in the new cycle checks.

These assertions only pin the message text, so a regression that emits the wrong diagnostic code would still pass even though this change introduces E0212 as the cycle-specific contract.

Proposed assertion update
-    assert!(
-        output.contains("Clause supersession cycle detected"),
-        "output: {output}"
-    );
+    assert!(
+        output.contains("error[E0212]: Clause supersession cycle detected"),
+        "output: {output}"
+    );
@@
-        output.contains(
-            "Clause supersession cycle detected: RFC-0001:C-ONE -> RFC-0002:C-TWO -> RFC-0001:C-ONE"
-        ),
+        output.contains(
+            "error[E0212]: Clause supersession cycle detected: RFC-0001:C-ONE -> RFC-0002:C-TWO -> RFC-0001:C-ONE"
+        ),
         "output: {output}"
     );

Also applies to: 322-329

🤖 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 `@tests/error_tests/rfc_clause_cases/check.rs` around lines 228 - 233, The new
cycle-check tests only verify the message text, so they can miss a regression
where the diagnostic code is wrong. Update the assertions in the relevant
`check.rs` cycle cases to also assert the emitted code is `E0212`, alongside the
existing `"Clause supersession cycle detected"` text, using the same
`run_commands` output checks.
tests/lifecycle_tests/clause.rs (1)

386-390: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Pin E0212 in the lifecycle self-replacement test.

This is the direct regression for the new validate_field path, so matching only the message will miss an accidental diagnostic-code remap.

Proposed assertion update
-    assert!(
-        output.contains("Cannot supersede a clause with itself: RFC-0001:C-ONE"),
-        "output: {output}"
-    );
+    assert!(
+        output.contains("error[E0212]: Cannot supersede a clause with itself: RFC-0001:C-ONE"),
+        "output: {output}"
+    );
🤖 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 `@tests/lifecycle_tests/clause.rs` around lines 386 - 390, Update the lifecycle
self-replacement test in clause.rs to assert the diagnostic code E0212 in
addition to the existing message. The current check around the self-supersede
output only matches the text, so adjust the test case that exercises the
validate_field path to verify the emitted diagnostic code symbol alongside
“Cannot supersede a clause with itself: RFC-0001:C-ONE”, while keeping the
existing exit status assertion.
tests/lifecycle_tests/rfc_cases/bump.rs (1)

297-299: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cover the other success-only UI lines too.

This only rejects Bumped RFC-0001. If Added change: or Set RFC-0001:C-PENDING.since = ... leaks before rollback, the test still passes. Add negative assertions for those strings so the output contract is covered end-to-end.

🤖 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 `@tests/lifecycle_tests/rfc_cases/bump.rs` around lines 297 - 299, The rollback
test in the bump RFC case only asserts that the success message is absent, so it
can miss other leaked success-only UI lines. Update the assertions around the
existing output checks to also verify that the output does not contain the other
success strings, including the ones emitted by the bump flow such as the
change-added message and the RFC-0001 pending-since update. Keep the checks near
the existing output.contains assertions so the output contract is covered
end-to-end.
🤖 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/cmd/lifecycle/rfc_clause_versions.rs`:
- Around line 22-38: The clause scanning logic is swallowing read/load failures
by using filter_map(Result::ok) and read_clause(...).ok(), which lets invalid or
unreadable pending clauses be skipped silently. Update the pending-clause
collection flow in the rfc_clause_versions helper (the code using read_dir,
read_clause, and paths.extend) to return the first directory/entry/read error
instead of filtering it out. Keep the .toml filtering, but propagate failures
from directory iteration and clause loading so bump/finalize cannot advance with
missing or unchanged pending clauses.

---

Outside diff comments:
In `@src/cmd/lifecycle/clause.rs`:
- Around line 47-60: The replacement lookup in the clause lifecycle flow is
using the raw `by` value before shorthand normalization, so fix `clause`
handling to resolve `--by` against `clause_id` before calling
`require_replacement_clause_toml_path`. Use the same normalization logic as
`validate_field` for `superseded_by`, then perform the existence/path check on
the normalized target so shorthand like `C-NEW` is accepted consistently.

---

Nitpick comments:
In `@gov/adr/ADR-0050-preserve-direct-clause-supersession-chains.toml`:
- Around line 44-46: The ADR’s “Implementation Notes” section is too
prescriptive and drifts into RFC/work-item territory. Trim the
`ADR-0050-preserve-direct-clause-supersession-chains.toml` content so it only
states the design choice and its consequences, and remove
validation/consumer-behavior guidance from this subsection. Keep the language in
the ADR focused on the supersession-chain rationale, not on how `direct edges`
should be traversed or validated.

In `@tests/error_tests/rfc_clause_cases/check.rs`:
- Around line 228-233: The new cycle-check tests only verify the message text,
so they can miss a regression where the diagnostic code is wrong. Update the
assertions in the relevant `check.rs` cycle cases to also assert the emitted
code is `E0212`, alongside the existing `"Clause supersession cycle detected"`
text, using the same `run_commands` output checks.

In `@tests/lifecycle_tests/clause.rs`:
- Around line 386-390: Update the lifecycle self-replacement test in clause.rs
to assert the diagnostic code E0212 in addition to the existing message. The
current check around the self-supersede output only matches the text, so adjust
the test case that exercises the validate_field path to verify the emitted
diagnostic code symbol alongside “Cannot supersede a clause with itself:
RFC-0001:C-ONE”, while keeping the existing exit status assertion.

In `@tests/lifecycle_tests/rfc_cases/bump.rs`:
- Around line 297-299: The rollback test in the bump RFC case only asserts that
the success message is absent, so it can miss other leaked success-only UI
lines. Update the assertions around the existing output checks to also verify
that the output does not contain the other success strings, including the ones
emitted by the bump flow such as the change-added message and the RFC-0001
pending-since update. Keep the checks near the existing output.contains
assertions so the output contract is covered end-to-end.
🪄 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: cc8073dc-7a63-4428-aadc-f7fe3ef5ac10

📥 Commits

Reviewing files that changed from the base of the PR and between 3add6d5 and 7d78cff.

⛔ Files ignored due to path filters (1)
  • tests/snapshots/test_errors__broken_superseded_check.snap is excluded by !**/*.snap
📒 Files selected for processing (23)
  • CHANGELOG.md
  • docs/rfc/RFC-0001.md
  • docs/rfc/RFC-0002.md
  • gov/adr/ADR-0050-preserve-direct-clause-supersession-chains.toml
  • gov/rfc/RFC-0001/clauses/C-CLAUSE-STATUS.toml
  • gov/rfc/RFC-0001/rfc.toml
  • gov/rfc/RFC-0002/clauses/C-LIFECYCLE-VERBS.toml
  • gov/rfc/RFC-0002/rfc.toml
  • gov/work/2026-06-28-harden-clause-supersession-validation.toml
  • gov/work/2026-06-28-make-artifact-writes-failure-atomic.toml
  • gov/work/2026-06-28-support-clause-supersession-chains.toml
  • src/cmd/lifecycle/clause.rs
  • src/cmd/lifecycle/rfc.rs
  • src/cmd/lifecycle/rfc_clause_versions.rs
  • src/cmd/lifecycle/rfc_supersede.rs
  • src/diagnostic/code/metadata.rs
  • src/diagnostic/code/mod.rs
  • src/validate/fields/mod.rs
  • src/validate/rfc.rs
  • src/write/mod.rs
  • tests/error_tests/rfc_clause_cases/check.rs
  • tests/lifecycle_tests/clause.rs
  • tests/lifecycle_tests/rfc_cases/bump.rs

Comment thread src/cmd/lifecycle/rfc_clause_versions.rs Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
tests/lifecycle_tests/clause.rs (1)

78-127: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Also run check after persisting the shorthand edge.

This test confirms the CLI stores C-NEW, but it never exercises the follow-on validation path. src/cmd/lifecycle/clause.rs:41-75 persists the raw --by value, and src/validate/fields/mod.rs:96-136 only normalizes same-RFC shorthand later during validation. Adding a trailing check here would catch regressions where shorthand edges are written successfully but fail subsequent scans.

Suggested test tightening
             &[
                 "clause",
                 "supersede",
                 "RFC-0001:C-OLD",
                 "--by",
                 "C-NEW",
                 "--force",
             ],
             &["clause", "get", "RFC-0001:C-OLD", "superseded_by"],
+            &["check"],
         ],
     )?;
@@
     assert!(
         output.contains("$ govctl clause get RFC-0001:C-OLD superseded_by\nC-NEW\nexit: 0"),
         "output: {output}"
     );
+    assert!(output.ends_with("exit: 0\n\n"), "output: {output}");
     Ok(())
 }
🤖 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 `@tests/lifecycle_tests/clause.rs` around lines 78 - 127, This test only
verifies that clause supersede stores the shorthand replacement, but it does not
cover the later validation path. Update the lifecycle test in
test_supersede_clause_accepts_same_rfc_shorthand_replacement to run a trailing
check after the supersede/get sequence so it exercises the normalization flow in
clause supersede handling and the validation logic that resolves same-RFC
shorthand in validate::fields.
🤖 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 `@tests/lifecycle_tests/rfc_cases/bump.rs`:
- Around line 314-327: The lifecycle test in bump.rs is setting C-PENDING.toml
to read-only, but atomic_write_file writes through a temp file in the parent
directory, so this does not reliably trigger a failure. Update the failing setup
in the RFC bump test to block writes at the clauses directory level (or
otherwise prevent temp-file creation/rename) so the rollback path is exercised
deterministically, and keep the existing run_commands assertion flow unchanged.

---

Nitpick comments:
In `@tests/lifecycle_tests/clause.rs`:
- Around line 78-127: This test only verifies that clause supersede stores the
shorthand replacement, but it does not cover the later validation path. Update
the lifecycle test in
test_supersede_clause_accepts_same_rfc_shorthand_replacement to run a trailing
check after the supersede/get sequence so it exercises the normalization flow in
clause supersede handling and the validation logic that resolves same-RFC
shorthand in validate::fields.
🪄 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: 59a38ae0-461f-4beb-a20e-29bb55f8de2c

📥 Commits

Reviewing files that changed from the base of the PR and between 7d78cff and 841c64b.

⛔ Files ignored due to path filters (1)
  • tests/snapshots/test_errors__broken_superseded_check.snap is excluded by !**/*.snap
📒 Files selected for processing (26)
  • CHANGELOG.md
  • docs/rfc/RFC-0001.md
  • docs/rfc/RFC-0002.md
  • gov/adr/ADR-0050-preserve-direct-clause-supersession-chains.toml
  • gov/rfc/RFC-0001/clauses/C-CLAUSE-STATUS.toml
  • gov/rfc/RFC-0001/rfc.toml
  • gov/rfc/RFC-0002/clauses/C-LIFECYCLE-VERBS.toml
  • gov/rfc/RFC-0002/rfc.toml
  • gov/work/2026-06-28-harden-clause-lifecycle-review-paths.toml
  • gov/work/2026-06-28-harden-clause-supersession-validation.toml
  • gov/work/2026-06-28-make-artifact-writes-failure-atomic.toml
  • gov/work/2026-06-28-support-clause-supersession-chains.toml
  • src/cmd/lifecycle/clause.rs
  • src/cmd/lifecycle/rfc.rs
  • src/cmd/lifecycle/rfc_clause_versions.rs
  • src/cmd/lifecycle/rfc_supersede.rs
  • src/diagnostic/code/metadata.rs
  • src/diagnostic/code/mod.rs
  • src/validate/fields/mod.rs
  • src/validate/mod.rs
  • src/validate/rfc.rs
  • src/write/mod.rs
  • tests/error_tests/rfc_clause_cases/check.rs
  • tests/lifecycle_tests/clause.rs
  • tests/lifecycle_tests/rfc_cases/bump.rs
  • tests/lifecycle_tests/rfc_cases/finalize.rs
✅ Files skipped from review due to trivial changes (5)
  • gov/work/2026-06-28-make-artifact-writes-failure-atomic.toml
  • gov/work/2026-06-28-harden-clause-supersession-validation.toml
  • CHANGELOG.md
  • gov/rfc/RFC-0001/rfc.toml
  • gov/adr/ADR-0050-preserve-direct-clause-supersession-chains.toml
🚧 Files skipped from review as they are similar to previous changes (16)
  • src/diagnostic/code/metadata.rs
  • gov/work/2026-06-28-support-clause-supersession-chains.toml
  • gov/rfc/RFC-0002/clauses/C-LIFECYCLE-VERBS.toml
  • src/cmd/lifecycle/clause.rs
  • gov/rfc/RFC-0002/rfc.toml
  • src/cmd/lifecycle/rfc_supersede.rs
  • gov/rfc/RFC-0001/clauses/C-CLAUSE-STATUS.toml
  • docs/rfc/RFC-0001.md
  • tests/error_tests/rfc_clause_cases/check.rs
  • src/validate/rfc.rs
  • src/diagnostic/code/mod.rs
  • docs/rfc/RFC-0002.md
  • src/cmd/lifecycle/rfc.rs
  • src/validate/fields/mod.rs
  • src/cmd/lifecycle/rfc_clause_versions.rs
  • src/write/mod.rs

Comment thread tests/lifecycle_tests/rfc_cases/bump.rs Outdated
Keep clause supersession as direct historical edges with iterative cycle validation.
Restore prior artifact contents when multi-file lifecycle operations return errors.
Clarify the RFC-0002 failure-atomicity boundary and add regression coverage.
@lucifer1004 lucifer1004 merged commit 23cdc42 into main Jun 29, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant