Skip to content

feat(rfc): support in-version spec authoring#36

Merged
lucifer1004 merged 2 commits into
mainfrom
dev
Jul 16, 2026
Merged

feat(rfc): support in-version spec authoring#36
lucifer1004 merged 2 commits into
mainfrom
dev

Conversation

@lucifer1004

@lucifer1004 lucifer1004 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Added editing support for an RFC’s current changelog (including changelog.summary and categorized change lists) via rfc get/edit ... changelog.
  • Bug Fixes

    • Enforced exactly one matching “current” changelog entry per RFC version; reject historical/lifecycle-owned changelog edits.
    • Tightened lifecycle/phase transitions and sealing: spec → impl blocks pending clauses; clarified clause since assignment and pending handling.
    • Version-changing bumps now require normative status; changelog-only bumps (--change) update without changing RFC version.
  • Documentation

    • Updated CLI help and RFC/guide docs with refined lifecycle semantics and “Known Limitations.”
  • Tests

    • Added coverage for changelog editing, sealing/pending clause rules, and failure rollbacks.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e7f4bc7c-ab30-4eae-841a-d882a3d3214b

📥 Commits

Reviewing files that changed from the base of the PR and between 27f8109 and 95d71a9.

⛔ Files ignored due to path filters (1)
  • tests/snapshots/test_help__rfc_bump_help.snap is excluded by !**/*.snap
📒 Files selected for processing (21)
  • .claude/skills/gov/SKILL.md
  • .claude/skills/rfc-writer/SKILL.md
  • .claude/skills/spec/SKILL.md
  • AGENTS.md
  • CHANGELOG.md
  • docs/guide/rfcs.md
  • docs/rfc/RFC-0000.md
  • docs/rfc/RFC-0002.md
  • gov/rfc/RFC-0000/clauses/C-CLAUSE-DEF.toml
  • gov/rfc/RFC-0000/rfc.toml
  • gov/rfc/RFC-0002/clauses/C-LIFECYCLE-VERBS.toml
  • gov/rfc/RFC-0002/rfc.toml
  • gov/work/2026-07-16-address-valid-pr-review-follow-ups.toml
  • gov/work/2026-07-16-reject-version-bumps-for-non-normative-rfcs.toml
  • src/cli/resources/rfc.rs
  • src/cmd/edit/doc_target/rfc_changelog.rs
  • src/cmd/lifecycle/rfc.rs
  • src/validate/rfc.rs
  • src/write/mod.rs
  • tests/lifecycle_tests/rfc_cases/bump.rs
  • tests/lifecycle_tests/rfc_cases/deprecation.rs
🚧 Files skipped from review as they are similar to previous changes (13)
  • gov/rfc/RFC-0000/rfc.toml
  • gov/work/2026-07-16-address-valid-pr-review-follow-ups.toml
  • gov/rfc/RFC-0002/rfc.toml
  • src/cli/resources/rfc.rs
  • src/write/mod.rs
  • src/validate/rfc.rs
  • src/cmd/edit/doc_target/rfc_changelog.rs
  • CHANGELOG.md
  • src/cmd/lifecycle/rfc.rs
  • .claude/skills/spec/SKILL.md
  • docs/rfc/RFC-0000.md
  • gov/rfc/RFC-0002/clauses/C-LIFECYCLE-VERBS.toml
  • tests/lifecycle_tests/rfc_cases/bump.rs

📝 Walkthrough

Walkthrough

RFC lifecycle rules now enforce current-version changelog ownership, clause since assignment, phase sealing, and pending-clause rejection. CLI changelog editing, validation diagnostics, atomic clause creation, documentation, and lifecycle regression tests were added or updated.

Changes

RFC lifecycle and editing governance

Layer / File(s) Summary
Lifecycle and editing contracts
CHANGELOG.md, docs/guide/rfcs.md, docs/rfc/*, gov/rfc/*, gov/schema/*, gov/work/*, .claude/skills/*, AGENTS.md
RFC phase/status transitions, changelog ownership, clause version provenance, editing restrictions, lifecycle operation contracts, and authoring guidance were expanded.
Current changelog resolution and editing
src/cmd/edit/*, src/write/changelog/*, src/validate/rfc.rs, src/diagnostic/code/*
RFC changelog operations resolve exactly one entry matching the current RFC version, support controlled summary/category edits, and reject missing or duplicate current entries.
Clause and RFC lifecycle enforcement
src/cmd/lifecycle/*, src/cmd/new/artifacts/clause.rs, src/write/mod.rs
Clause creation assigns since only for normative spec RFCs, deprecated RFCs reject new clauses, spec-to-impl advancement rejects pending clauses, and changelog-only updates validate signature state with transactional rollback coverage.
Lifecycle and CLI regression coverage
tests/*
Tests cover changelog editing and validation, clause version assignment, rollback, phase sealing, amendment rejection, bump behavior, deprecation, fixtures, and help output.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Operator
  participant GovctlCLI
  participant RfcLifecycle
  participant ChangelogStore
  participant ClauseStore
  Operator->>GovctlCLI: edit changelog or advance RFC
  GovctlCLI->>RfcLifecycle: validate lifecycle operation
  RfcLifecycle->>ChangelogStore: resolve current RFC-version entry
  RfcLifecycle->>ClauseStore: inspect clause since values
  ClauseStore-->>RfcLifecycle: return pending or resolved clauses
  RfcLifecycle-->>GovctlCLI: persist edit, seal phase, or report diagnostic
Loading

Possibly related PRs

🚥 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 clearly summarizes the main change: enabling RFC authoring within the existing version during spec.
Docstring Coverage ✅ Passed Docstring coverage is 87.50% 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 dev

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 Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.07479% with 25 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/cmd/edit/doc_target/rfc_changelog.rs 90.98% 11 Missing ⚠️
src/write/changelog/mod.rs 79.54% 9 Missing ⚠️
src/write/mod.rs 89.47% 2 Missing ⚠️
src/cmd/edit/add.rs 90.90% 1 Missing ⚠️
src/cmd/edit/remove.rs 90.90% 1 Missing ⚠️
src/cmd/new/artifacts/clause.rs 96.87% 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: 4

🧹 Nitpick comments (1)
gov/schema/edit-ops.json (1)

656-728: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Enable "get" verb for nested changelog fields.

While "get" is enabled for the root changelog object, the individual sub-fields (summary, added, changed, etc.) lack "get" in their verbs arrays. This prevents users from inspecting specific fields directly via commands like govctl rfc get RFC-0002 changelog.summary, which is inconsistent with other artifacts (like adr or work) that allow querying nested items.

♻️ Proposed fix to allow `get` access

Apply the "get" verb to the scalar fields, list fields, and list item operations:

           {
             "name": "summary",
             "node": {
               "kind": "scalar",
-              "verbs": ["set"],
+              "verbs": ["get", "set"],
               "set_mode": { "type": "string" }
             }
           },
           {
             "name": "added",
             "node": {
               "kind": "list",
-              "verbs": ["add", "remove"],
+              "verbs": ["get", "add", "remove"],
               "text_key": null,
-              "item": { "kind": "scalar", "verbs": ["remove"] }
+              "item": { "kind": "scalar", "verbs": ["get", "remove"] }
             }
           },
           {
             "name": "changed",
             "node": {
               "kind": "list",
-              "verbs": ["add", "remove"],
+              "verbs": ["get", "add", "remove"],
               "text_key": null,
-              "item": { "kind": "scalar", "verbs": ["remove"] }
+              "item": { "kind": "scalar", "verbs": ["get", "remove"] }
             }
           },
           {
             "name": "deprecated",
             "node": {
               "kind": "list",
-              "verbs": ["add", "remove"],
+              "verbs": ["get", "add", "remove"],
               "text_key": null,
-              "item": { "kind": "scalar", "verbs": ["remove"] }
+              "item": { "kind": "scalar", "verbs": ["get", "remove"] }
             }
           },
           {
             "name": "removed",
             "node": {
               "kind": "list",
-              "verbs": ["add", "remove"],
+              "verbs": ["get", "add", "remove"],
               "text_key": null,
-              "item": { "kind": "scalar", "verbs": ["remove"] }
+              "item": { "kind": "scalar", "verbs": ["get", "remove"] }
             }
           },
           {
             "name": "fixed",
             "node": {
               "kind": "list",
-              "verbs": ["add", "remove"],
+              "verbs": ["get", "add", "remove"],
               "text_key": null,
-              "item": { "kind": "scalar", "verbs": ["remove"] }
+              "item": { "kind": "scalar", "verbs": ["get", "remove"] }
             }
           },
           {
             "name": "security",
             "node": {
               "kind": "list",
-              "verbs": ["add", "remove"],
+              "verbs": ["get", "add", "remove"],
               "text_key": null,
-              "item": { "kind": "scalar", "verbs": ["remove"] }
+              "item": { "kind": "scalar", "verbs": ["get", "remove"] }
             }
           }
🤖 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/schema/edit-ops.json` around lines 656 - 728, Update the nested changelog
field definitions under the RFC artifact’s changelog node to include "get" in
each field’s verbs array, covering summary, added, changed, deprecated, removed,
and security. Preserve their existing set/add/remove permissions and ensure list
item definitions retain their current remove operation.
🤖 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/edit/doc_target/rfc_changelog.rs`:
- Around line 20-30: Update apply_current_changelog_doc and the
CurrentChangelogView handling so edits to version and date are not silently
ignored: either reject any changes to these read-only fields before applying
updates, or explicitly persist them if they are intended to be editable. Ensure
set operations report failure for rejected changes and retain existing behavior
for editable changelog fields.
- Around line 63-80: Move the root-only path validation before the
render_target_from_doc call in the RFC changelog flow, and remove the redundant
output path so each valid root request emits the changelog exactly once. Keep
invalid nested requests returning E0804FieldNotEditable without rendering or
printing JSON.

In `@src/cmd/lifecycle/rfc.rs`:
- Around line 343-346: Update the RFC bump flow around pending_clause_ids and
fill_pending_clause_versions to execute pending-Clause release only when the RFC
has normative status. Keep draft RFC Clause versions pending across bumps, and
preserve the existing finalization behavior that assigns their since values.

In `@tests/lifecycle_tests/rfc_cases/deprecation.rs`:
- Around line 52-60: Strengthen the deprecation test around the run_commands
invocation for RFC-0001 by asserting that the command succeeds and does not emit
an error, or by verifying that rfc.toml reaches the expected deprecated status.
Keep the existing unchanged-clause and since-field assertions to validate the
remaining behavior.

---

Nitpick comments:
In `@gov/schema/edit-ops.json`:
- Around line 656-728: Update the nested changelog field definitions under the
RFC artifact’s changelog node to include "get" in each field’s verbs array,
covering summary, added, changed, deprecated, removed, and security. Preserve
their existing set/add/remove permissions and ensure list item definitions
retain their current remove operation.
🪄 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: 942583bb-aa3c-4ffb-874b-0dc1397bdc5c

📥 Commits

Reviewing files that changed from the base of the PR and between 0de59f8 and b4d37a7.

⛔ Files ignored due to path filters (7)
  • tests/snapshots/test_errors__legacy_flat_clause_toml_accepted.snap is excluded by !**/*.snap
  • tests/snapshots/test_errors__legacy_flat_rfc_toml_accepted.snap is excluded by !**/*.snap
  • tests/snapshots/test_errors__valid_clause_toml_wire_format.snap is excluded by !**/*.snap
  • tests/snapshots/test_errors__valid_rfc_toml_wire_format.snap is excluded by !**/*.snap
  • tests/snapshots/test_help__rfc_bump_help.snap is excluded by !**/*.snap
  • tests/snapshots/test_help__rfc_edit_help.snap is excluded by !**/*.snap
  • tests/snapshots/test_help__rfc_get_help.snap is excluded by !**/*.snap
📒 Files selected for processing (45)
  • CHANGELOG.md
  • docs/guide/rfcs.md
  • docs/rfc/RFC-0000.md
  • docs/rfc/RFC-0001.md
  • docs/rfc/RFC-0002.md
  • gov/rfc/RFC-0000/clauses/C-CLAUSE-DEF.toml
  • gov/rfc/RFC-0000/clauses/C-PHASE-LIFECYCLE.toml
  • gov/rfc/RFC-0000/clauses/C-RFC-DEF.toml
  • gov/rfc/RFC-0000/clauses/C-STATUS-LIFECYCLE.toml
  • gov/rfc/RFC-0000/rfc.toml
  • gov/rfc/RFC-0001/clauses/C-GATE-CONDITIONS.toml
  • gov/rfc/RFC-0001/clauses/C-RFC-PHASE.toml
  • gov/rfc/RFC-0001/rfc.toml
  • gov/rfc/RFC-0002/clauses/C-LIFECYCLE-VERBS.toml
  • gov/rfc/RFC-0002/rfc.toml
  • gov/schema/edit-ops.json
  • gov/schema/edit-ops.schema.json
  • gov/work/2026-07-16-allow-in-version-rfc-authoring-during-spec.toml
  • src/cli/resources/rfc.rs
  • src/cmd/edit/add.rs
  • src/cmd/edit/doc_target/mod.rs
  • src/cmd/edit/doc_target/rfc_changelog.rs
  • src/cmd/edit/doc_target/set.rs
  • src/cmd/edit/get.rs
  • src/cmd/edit/remove.rs
  • src/cmd/edit/rules.rs
  • src/cmd/lifecycle/mod.rs
  • src/cmd/lifecycle/rfc.rs
  • src/cmd/lifecycle/rfc_clause_versions.rs
  • src/cmd/new/artifacts/clause.rs
  • src/diagnostic/code/metadata.rs
  • src/diagnostic/code/mod.rs
  • src/validate/rfc.rs
  • src/write/changelog/mod.rs
  • src/write/changelog/tests.rs
  • src/write/mod.rs
  • tests/common/fixtures.rs
  • tests/edit_tests/rfc.rs
  • tests/error_tests/rfc_clause_cases/check.rs
  • tests/error_tests/rfc_clause_cases/wire_format.rs
  • tests/lifecycle_tests/clause.rs
  • tests/lifecycle_tests/rfc_cases/advance.rs
  • tests/lifecycle_tests/rfc_cases/bump.rs
  • tests/lifecycle_tests/rfc_cases/deprecation.rs
  • tests/test_help.rs

Comment on lines +20 to +30
#[derive(Debug, Serialize, Deserialize)]
struct CurrentChangelogView {
version: String,
date: String,
summary: Option<String>,
added: Vec<String>,
changed: Vec<String>,
deprecated: Vec<String>,
removed: Vec<String>,
fixed: Vec<String>,
security: Vec<String>,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Do not silently discard edits to version and date.

These fields are exposed in the editable document, but apply_current_changelog_doc ignores them. A set operation can therefore succeed while persisting no requested change. Reject changes to read-only fields or apply them explicitly.

Proposed read-only validation
     let view: CurrentChangelogDoc = deserialize_edit_doc(doc, id)?;
     let entry = current_changelog_entry_mut(rfc)?;
+    if view.changelog.version != entry.version || view.changelog.date != entry.date {
+        return Err(Diagnostic::new(
+            DiagnosticCode::E0804FieldNotEditable,
+            "RFC changelog version and date are not editable",
+            id,
+        ));
+    }
     entry.notes = view.changelog.summary;

Also applies to: 158-171

🤖 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/edit/doc_target/rfc_changelog.rs` around lines 20 - 30, Update
apply_current_changelog_doc and the CurrentChangelogView handling so edits to
version and date are not silently ignored: either reject any changes to these
read-only fields before applying updates, or explicitly persist them if they are
intended to be editable. Ensure set operations report failure for rejected
changes and retain existing behavior for editable changelog fields.

Comment thread src/cmd/edit/doc_target/rfc_changelog.rs
Comment thread src/cmd/lifecycle/rfc.rs
Comment thread tests/lifecycle_tests/rfc_cases/deprecation.rs

@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: 3

🤖 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 `@docs/rfc/RFC-0002.md`:
- Around line 397-398: Clarify requirement 7’s restoration baseline and rollback
semantics to cover the complete governed filesystem state, not only
byte-for-byte contents of pre-existing files. Explicitly define that rollback
removes artifacts created after the baseline, restores deleted artifacts and
their contents, and restores relevant metadata/state; keep requirement 8’s
lifecycle exceptions unchanged.

In `@gov/rfc/RFC-0000/clauses/C-STATUS-LIFECYCLE.toml`:
- Line 14: Remove the duplicated [content] table header in the TOML document,
leaving exactly one declaration before its associated fields so the file parses
successfully.

In `@src/validate/rfc.rs`:
- Around line 35-52: Add the RFC clause citations RFC-0000:C-RFC-DEF and
RFC-0002:C-LIFECYCLE-VERBS to the diagnostic emitted by the
current-changelog-count check in the RFC validation flow. Keep the existing
count validation, diagnostic codes, and message unchanged while associating the
invariant with both cited clauses.
🪄 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: 0fc5246d-94c7-4966-9b8a-92b752952989

📥 Commits

Reviewing files that changed from the base of the PR and between b4d37a7 and 07efb73.

⛔ Files ignored due to path filters (7)
  • tests/snapshots/test_errors__legacy_flat_clause_toml_accepted.snap is excluded by !**/*.snap
  • tests/snapshots/test_errors__legacy_flat_rfc_toml_accepted.snap is excluded by !**/*.snap
  • tests/snapshots/test_errors__valid_clause_toml_wire_format.snap is excluded by !**/*.snap
  • tests/snapshots/test_errors__valid_rfc_toml_wire_format.snap is excluded by !**/*.snap
  • tests/snapshots/test_help__rfc_bump_help.snap is excluded by !**/*.snap
  • tests/snapshots/test_help__rfc_edit_help.snap is excluded by !**/*.snap
  • tests/snapshots/test_help__rfc_get_help.snap is excluded by !**/*.snap
📒 Files selected for processing (49)
  • .claude/skills/gov/SKILL.md
  • .claude/skills/rfc-writer/SKILL.md
  • .claude/skills/spec/SKILL.md
  • AGENTS.md
  • CHANGELOG.md
  • docs/guide/rfcs.md
  • docs/rfc/RFC-0000.md
  • docs/rfc/RFC-0001.md
  • docs/rfc/RFC-0002.md
  • gov/rfc/RFC-0000/clauses/C-CLAUSE-DEF.toml
  • gov/rfc/RFC-0000/clauses/C-PHASE-LIFECYCLE.toml
  • gov/rfc/RFC-0000/clauses/C-RFC-DEF.toml
  • gov/rfc/RFC-0000/clauses/C-STATUS-LIFECYCLE.toml
  • gov/rfc/RFC-0000/rfc.toml
  • gov/rfc/RFC-0001/clauses/C-GATE-CONDITIONS.toml
  • gov/rfc/RFC-0001/clauses/C-RFC-PHASE.toml
  • gov/rfc/RFC-0001/rfc.toml
  • gov/rfc/RFC-0002/clauses/C-LIFECYCLE-VERBS.toml
  • gov/rfc/RFC-0002/rfc.toml
  • gov/schema/edit-ops.json
  • gov/schema/edit-ops.schema.json
  • gov/work/2026-07-16-allow-in-version-rfc-authoring-during-spec.toml
  • src/cli/resources/rfc.rs
  • src/cmd/edit/add.rs
  • src/cmd/edit/doc_target/mod.rs
  • src/cmd/edit/doc_target/rfc_changelog.rs
  • src/cmd/edit/doc_target/set.rs
  • src/cmd/edit/get.rs
  • src/cmd/edit/remove.rs
  • src/cmd/edit/rules.rs
  • src/cmd/lifecycle/mod.rs
  • src/cmd/lifecycle/rfc.rs
  • src/cmd/lifecycle/rfc_clause_versions.rs
  • src/cmd/new/artifacts/clause.rs
  • src/diagnostic/code/metadata.rs
  • src/diagnostic/code/mod.rs
  • src/validate/rfc.rs
  • src/write/changelog/mod.rs
  • src/write/changelog/tests.rs
  • src/write/mod.rs
  • tests/common/fixtures.rs
  • tests/edit_tests/rfc.rs
  • tests/error_tests/rfc_clause_cases/check.rs
  • tests/error_tests/rfc_clause_cases/wire_format.rs
  • tests/lifecycle_tests/clause.rs
  • tests/lifecycle_tests/rfc_cases/advance.rs
  • tests/lifecycle_tests/rfc_cases/bump.rs
  • tests/lifecycle_tests/rfc_cases/deprecation.rs
  • tests/test_help.rs
🚧 Files skipped from review as they are similar to previous changes (36)
  • gov/schema/edit-ops.schema.json
  • src/diagnostic/code/metadata.rs
  • src/write/mod.rs
  • tests/test_help.rs
  • src/cmd/edit/get.rs
  • src/cmd/edit/rules.rs
  • gov/rfc/RFC-0000/clauses/C-RFC-DEF.toml
  • gov/rfc/RFC-0002/rfc.toml
  • src/cmd/edit/remove.rs
  • gov/rfc/RFC-0000/clauses/C-CLAUSE-DEF.toml
  • gov/rfc/RFC-0001/clauses/C-RFC-PHASE.toml
  • CHANGELOG.md
  • tests/lifecycle_tests/clause.rs
  • tests/lifecycle_tests/rfc_cases/deprecation.rs
  • tests/error_tests/rfc_clause_cases/check.rs
  • tests/error_tests/rfc_clause_cases/wire_format.rs
  • gov/rfc/RFC-0000/clauses/C-PHASE-LIFECYCLE.toml
  • src/cmd/new/artifacts/clause.rs
  • gov/rfc/RFC-0000/rfc.toml
  • src/cmd/edit/doc_target/set.rs
  • src/cmd/edit/add.rs
  • gov/schema/edit-ops.json
  • src/write/changelog/tests.rs
  • src/write/changelog/mod.rs
  • gov/work/2026-07-16-allow-in-version-rfc-authoring-during-spec.toml
  • src/diagnostic/code/mod.rs
  • src/cmd/lifecycle/rfc_clause_versions.rs
  • gov/rfc/RFC-0001/clauses/C-GATE-CONDITIONS.toml
  • docs/guide/rfcs.md
  • docs/rfc/RFC-0001.md
  • tests/lifecycle_tests/rfc_cases/advance.rs
  • tests/edit_tests/rfc.rs
  • src/cmd/edit/doc_target/rfc_changelog.rs
  • tests/lifecycle_tests/rfc_cases/bump.rs
  • src/cmd/lifecycle/rfc.rs
  • gov/rfc/RFC-0002/clauses/C-LIFECYCLE-VERBS.toml

Comment thread docs/rfc/RFC-0002.md Outdated
"lifecycle",
]

[content]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Duplicated TOML table header.

The [content] table header is duplicated, which causes a TOML syntax error.

🐛 Proposed fix
-[content]
-[content]
+[content]

[incorrect_review_comment]

🤖 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/rfc/RFC-0000/clauses/C-STATUS-LIFECYCLE.toml` at line 14, Remove the
duplicated [content] table header in the TOML document, leaving exactly one
declaration before its associated fields so the file parses successfully.

Comment thread src/validate/rfc.rs
Comment on lines +35 to +52
let current_changelog_count = rfc
.rfc
.changelog
.iter()
.filter(|entry| entry.version == rfc.rfc.version)
.count();
if current_changelog_count != 1 {
let code = if current_changelog_count == 0 {
DiagnosticCode::E0111RfcNoChangelog
} else {
DiagnosticCode::E0115RfcCurrentChangelogInvalid
};
result.diagnostics.push(Diagnostic::new(
DiagnosticCode::W0101RfcNoChangelog,
"RFC has no changelog entries (hint: run `govctl rfc bump`)",
code,
format!(
"RFC must contain exactly one changelog entry for current version {} (found {})",
rfc.rfc.version, current_changelog_count
),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Search for changelog rules in normative RFCs
rg -i -C 3 "changelog" gov/rfc/

Repository: govctl-org/govctl

Length of output: 35658


Add the RFC clause citation for the current-changelog check. RFC-0000:C-RFC-DEF defines the invariant: an RFC must have exactly one current changelog entry whose version matches the RFC version. RFC-0002:C-LIFECYCLE-VERBS restates the same current-entry rule.

🤖 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/rfc.rs` around lines 35 - 52, Add the RFC clause citations
RFC-0000:C-RFC-DEF and RFC-0002:C-LIFECYCLE-VERBS to the diagnostic emitted by
the current-changelog-count check in the RFC validation flow. Keep the existing
count validation, diagnostic codes, and message unchanged while associating the
invariant with both cited clauses.

Source: Coding guidelines

@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)
tests/lifecycle_tests/rfc_cases/bump.rs (1)

729-730: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Fix cross-platform compilation error.

This test unconditionally imports and uses std::os::unix::fs::PermissionsExt, which will cause a compilation error on non-Unix platforms (such as Windows). You must gate the test with #[cfg(unix)] as is done with the permission rollback tests in src/write/mod.rs.

🐛 Proposed fix
+#[cfg(unix)]
 fn test_failed_bump_preserves_files_without_success_output() -> common::TestResult {
     use std::os::unix::fs::PermissionsExt;
🤖 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 729 - 730, Gate
test_failed_bump_preserves_files_without_success_output with #[cfg(unix)] so its
Unix-only PermissionsExt import and usage are excluded on non-Unix platforms,
matching the existing permission rollback tests in src/write/mod.rs.
🧹 Nitpick comments (2)
.claude/skills/rfc-writer/SKILL.md (1)

140-160: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add governing RFC citations to the normative lifecycle guidance.

The new phase, amendment, compatibility, and clause-versioning rules should be directly traceable to authoritative governance artifacts.

  • .claude/skills/rfc-writer/SKILL.md#L140-L160: cite the RFC clauses governing phase-aware authoring and clause since assignment.
  • AGENTS.md#L86-L89,102-L109: cite the RFC clauses governing status/phase compatibility and lifecycle transitions.
🤖 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 @.claude/skills/rfc-writer/SKILL.md around lines 140 - 160, Add governing RFC
clause citations to the normative lifecycle guidance in
.claude/skills/rfc-writer/SKILL.md at lines 140-160, covering phase-aware
authoring and Clause since assignment. Also add citations in AGENTS.md at lines
86-89 and 102-109 for the status/phase compatibility and lifecycle-transition
rules, using the authoritative RFC clause references without changing the
guidance itself.

Source: Coding guidelines

tests/lifecycle_tests/rfc_cases/bump.rs (1)

393-393: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Fix the field name from notes to summary.

The test populates historical["notes"], but the changelog schema defines summary as the correct field name. Although this doesn't break the test, correcting it avoids schema confusion.

♻️ Proposed fix
-    historical["notes"] = toml::Value::String("Historical summary".to_string());
+    historical["summary"] = toml::Value::String("Historical summary".to_string());
🤖 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` at line 393, Update the historical
changelog fixture assignment in the bump test from the schema-invalid `notes`
key to the defined `summary` key, preserving the existing `"Historical summary"`
value.
🤖 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 @.claude/skills/rfc-writer/SKILL.md:
- Around line 145-147: Update the post-spec version-bump rule in the phase
transition guidance to apply only to content-changing normative RFC or Clause
edits. Explicitly exempt lifecycle-approved metadata and changelog-only updates,
while preserving the existing amendment and release requirements for qualifying
edits in impl, test, or stable.

---

Outside diff comments:
In `@tests/lifecycle_tests/rfc_cases/bump.rs`:
- Around line 729-730: Gate
test_failed_bump_preserves_files_without_success_output with #[cfg(unix)] so its
Unix-only PermissionsExt import and usage are excluded on non-Unix platforms,
matching the existing permission rollback tests in src/write/mod.rs.

---

Nitpick comments:
In @.claude/skills/rfc-writer/SKILL.md:
- Around line 140-160: Add governing RFC clause citations to the normative
lifecycle guidance in .claude/skills/rfc-writer/SKILL.md at lines 140-160,
covering phase-aware authoring and Clause since assignment. Also add citations
in AGENTS.md at lines 86-89 and 102-109 for the status/phase compatibility and
lifecycle-transition rules, using the authoritative RFC clause references
without changing the guidance itself.

In `@tests/lifecycle_tests/rfc_cases/bump.rs`:
- Line 393: Update the historical changelog fixture assignment in the bump test
from the schema-invalid `notes` key to the defined `summary` key, preserving the
existing `"Historical summary"` value.
🪄 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: a0636dd4-996c-417d-bac9-530e72c3f741

📥 Commits

Reviewing files that changed from the base of the PR and between 07efb73 and c473ae3.

⛔ Files ignored due to path filters (1)
  • tests/snapshots/test_help__rfc_bump_help.snap is excluded by !**/*.snap
📒 Files selected for processing (21)
  • .claude/skills/gov/SKILL.md
  • .claude/skills/rfc-writer/SKILL.md
  • .claude/skills/spec/SKILL.md
  • AGENTS.md
  • CHANGELOG.md
  • docs/guide/rfcs.md
  • docs/rfc/RFC-0000.md
  • docs/rfc/RFC-0002.md
  • gov/rfc/RFC-0000/clauses/C-CLAUSE-DEF.toml
  • gov/rfc/RFC-0000/rfc.toml
  • gov/rfc/RFC-0002/clauses/C-LIFECYCLE-VERBS.toml
  • gov/rfc/RFC-0002/rfc.toml
  • gov/work/2026-07-16-address-valid-pr-review-follow-ups.toml
  • gov/work/2026-07-16-reject-version-bumps-for-non-normative-rfcs.toml
  • src/cli/resources/rfc.rs
  • src/cmd/edit/doc_target/rfc_changelog.rs
  • src/cmd/lifecycle/rfc.rs
  • src/validate/rfc.rs
  • src/write/mod.rs
  • tests/lifecycle_tests/rfc_cases/bump.rs
  • tests/lifecycle_tests/rfc_cases/deprecation.rs
🚧 Files skipped from review as they are similar to previous changes (9)
  • src/cli/resources/rfc.rs
  • src/validate/rfc.rs
  • tests/lifecycle_tests/rfc_cases/deprecation.rs
  • .claude/skills/spec/SKILL.md
  • CHANGELOG.md
  • src/cmd/edit/doc_target/rfc_changelog.rs
  • src/cmd/lifecycle/rfc.rs
  • docs/guide/rfcs.md
  • gov/rfc/RFC-0002/clauses/C-LIFECYCLE-VERBS.toml

Comment thread .claude/skills/rfc-writer/SKILL.md
Reject version-changing bumps for draft and deprecated RFCs while preserving changelog-only updates.
Clarify rollback restoration state and strengthen lifecycle regression coverage.
@lucifer1004
lucifer1004 merged commit 0f9e501 into main Jul 16, 2026
8 checks passed
@lucifer1004
lucifer1004 deleted the dev branch July 16, 2026 13:07
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