feat(show): add current and archival projections#38
Conversation
|
Warning Review limit reached
Next review available in: 40 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (15)
📒 Files selected for processing (46)
📝 WalkthroughWalkthroughThis change adds current and archival projections to ChangesShow projection modes
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant CLI
participant CommandRouter
participant ShowHandler
participant Renderer
participant Output
CLI->>CommandRouter: Submit show id, format, and history flag
CommandRouter->>ShowHandler: Execute show request
ShowHandler->>Renderer: Select Current or Archive projection
Renderer-->>ShowHandler: Render projected content
ShowHandler->>Output: Serialize structured or print human output
Output-->>CLI: Return show result
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 (1)
src/cmd/guard.rs (1)
111-157: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
--historyhas no effect on guard output —_projectionis computed and discarded.The
Toml | Table | Plainarm computesRenderProjection::Archive/Currentbased onhistorybut binds it to_projectionand never passes it anywhere;print_toml(&guard.spec, ...)is called unconditionally. Unlike RFC/ADR/Work/Clause (src/cmd/render/show.rs), which thread the selected projection intorender_*_with_projection, guard show silently ignoreshistoryfor its only non-JSON/YAML output path. A user runninggovctl show guard <id> --historygets exactly the same output as without the flag, even though the flag passed validation (line 119) implying it should matter.If guards genuinely have no lifecycle/obsolete state to suppress, the projection computation here is vestigial and should be removed (or the whole
historyacceptance for guard show should be reconsidered). If they do have such state, this needs to actually gate output like the other resource types.🐛 Remove dead projection code, or wire it up
ShowOutputFormat::Toml | ShowOutputFormat::Table | ShowOutputFormat::Plain => { - let _projection = if history { - RenderProjection::Archive - } else { - RenderProjection::Current - }; print_toml( &guard.spec, DiagnosticCode::E1001GuardSchemaInvalid, "Failed to serialize guard TOML", id, )?; }🤖 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/guard.rs` around lines 111 - 157, Resolve the unused history behavior in show_guard: either remove the vestigial RenderProjection computation and reconsider accepting history for guards if guards have no archive state, or thread the selected projection into the guard rendering path so --history changes output consistently with the other resource show commands. Do not leave _projection discarded while print_toml always renders guard.spec unchanged.
🧹 Nitpick comments (2)
docs/rfc/RFC-0002.md (1)
7-9: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winFix markdownlint MD028 (no-blanks-blockquote) violations.
The static analysis tool correctly flags these empty lines. Without a
>prefix on the blank lines separating the metadata items, markdownlint parses them as broken or fragmented blockquotes rather than a single cohesive metadata block, which degrades visual rendering in some Markdown viewers.
docs/rfc/RFC-0002.md#L7-L9: Add a>prefix to the blank lines on line 7 and line 9.docs/rfc/RFC-0000.md#L9-L9: Add a>prefix to the blank line.docs/rfc/RFC-0001.md#L9-L9: Add a>prefix to the blank line.docs/rfc/RFC-0003.md#L9-L9: Add a>prefix to the blank line.docs/rfc/RFC-0004.md#L9-L9: Add a>prefix to the blank line.🤖 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 `@docs/rfc/RFC-0002.md` around lines 7 - 9, Add a blockquote prefix to the blank metadata-separator lines in docs/rfc/RFC-0002.md lines 7-9, including both blank lines; apply the same change to the blank line at line 9 in docs/rfc/RFC-0000.md, docs/rfc/RFC-0001.md, docs/rfc/RFC-0003.md, and docs/rfc/RFC-0004.md, preserving the surrounding metadata content.Source: Linters/SAST tools
docs/rfc/RFC-0007.md (1)
8-11: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueFix markdownlint warning (MD028).
There is a blank line between the blockquote lines which triggers a
markdownlintwarning. You can fix this by either removing the blank line or adding a>to it.♻️ Proposed fix
> **Owners:** `@govctl-org` - +> > **Tags:** `tui`🤖 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 `@docs/rfc/RFC-0007.md` around lines 8 - 11, Update the RFC metadata blockquote around the Owners and Tags entries to remove the blank line or prefix it with `>` so the blockquote remains contiguous and satisfies markdownlint MD028.Source: Linters/SAST tools
🤖 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/clause.rs`:
- Around line 919-938: Strengthen the ordering assertions in the lifecycle test
by explicitly asserting that each required status or supersession label is
present before comparing its position with the placeholder text. Apply this to
both deprecated_history and superseded_history, including the superseded-by
label, so missing labels fail rather than relying on Option ordering.
---
Outside diff comments:
In `@src/cmd/guard.rs`:
- Around line 111-157: Resolve the unused history behavior in show_guard: either
remove the vestigial RenderProjection computation and reconsider accepting
history for guards if guards have no archive state, or thread the selected
projection into the guard rendering path so --history changes output
consistently with the other resource show commands. Do not leave _projection
discarded while print_toml always renders guard.spec unchanged.
---
Nitpick comments:
In `@docs/rfc/RFC-0002.md`:
- Around line 7-9: Add a blockquote prefix to the blank metadata-separator lines
in docs/rfc/RFC-0002.md lines 7-9, including both blank lines; apply the same
change to the blank line at line 9 in docs/rfc/RFC-0000.md,
docs/rfc/RFC-0001.md, docs/rfc/RFC-0003.md, and docs/rfc/RFC-0004.md, preserving
the surrounding metadata content.
In `@docs/rfc/RFC-0007.md`:
- Around line 8-11: Update the RFC metadata blockquote around the Owners and
Tags entries to remove the blank line or prefix it with `>` so the blockquote
remains contiguous and satisfies markdownlint MD028.
🪄 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: a258ac19-a31a-4cad-a8d9-878f8f99906f
⛔ Files ignored due to path filters (15)
tests/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_display_paths__render_rfc_display_path.snapis excluded by!**/*.snaptests/snapshots/test_help__adr_root_help.snapis excluded by!**/*.snaptests/snapshots/test_help__clause_root_help.snapis excluded by!**/*.snaptests/snapshots/test_help__rfc_root_help.snapis excluded by!**/*.snaptests/snapshots/test_lifecycle__bump_with_change.snapis excluded by!**/*.snap
📒 Files selected for processing (46)
.claude/skills/adr-writer/SKILL.md.claude/skills/rfc-writer/SKILL.md.claude/skills/spec/SKILL.mdCHANGELOG.mdCargo.tomldocs/guide/getting-started.mddocs/rfc/RFC-0000.mddocs/rfc/RFC-0001.mddocs/rfc/RFC-0002.mddocs/rfc/RFC-0003.mddocs/rfc/RFC-0004.mddocs/rfc/RFC-0006.mddocs/rfc/RFC-0007.mdgov/adr/ADR-0055-separate-current-show-projections-from-archival-rendering.tomlgov/releases.tomlgov/rfc/RFC-0002/clauses/C-SHOW-PROJECTION.tomlgov/rfc/RFC-0002/rfc.tomlgov/work/2026-07-20-expose-clause-lifecycle-status-in-rendered-output.tomlgov/work/2026-07-21-add-current-and-archival-show-projections.tomlsrc/cli/common/args.rssrc/cli/common/targets.rssrc/cli/help.rssrc/cli/resources/adr.rssrc/cli/resources/clause.rssrc/cli/resources/guard.rssrc/cli/resources/rfc.rssrc/cli/resources/work.rssrc/cmd/describe/catalog.rssrc/cmd/guard.rssrc/cmd/output.rssrc/cmd/output_tests.rssrc/cmd/render/show.rssrc/command_router/execute/mod.rssrc/command_router/mod.rssrc/command_router/plan.rssrc/command_router/tests/lock_disposition.rssrc/render/adr.rssrc/render/mod.rssrc/render/rfc.rssrc/render/tests/adr.rssrc/render/tests/mod.rssrc/render/tests/rfc.rssrc/render/work.rssrc/resource_plan/mod.rstests/lifecycle_tests/clause.rstests/test_show.rs
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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-0000.md`:
- Around line 8-11: Remove blank lines within the metadata blockquotes so each
RFC header remains contiguous: in docs/rfc/RFC-0000.md lines 8-11,
docs/rfc/RFC-0001.md lines 8-11, docs/rfc/RFC-0003.md lines 8-11,
docs/rfc/RFC-0004.md lines 8-11, and docs/rfc/RFC-0007.md lines 8-11 remove the
separator between Owners and Tags; in docs/rfc/RFC-0002.md lines 2-10 remove
separators between Version, Owners, and Tags.
🪄 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: dce4d11d-0ccc-4778-bed1-1559d5b13c9a
⛔ Files ignored due to path filters (15)
tests/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_display_paths__render_rfc_display_path.snapis excluded by!**/*.snaptests/snapshots/test_help__adr_root_help.snapis excluded by!**/*.snaptests/snapshots/test_help__clause_root_help.snapis excluded by!**/*.snaptests/snapshots/test_help__rfc_root_help.snapis excluded by!**/*.snaptests/snapshots/test_lifecycle__bump_with_change.snapis excluded by!**/*.snap
📒 Files selected for processing (46)
.claude/skills/adr-writer/SKILL.md.claude/skills/rfc-writer/SKILL.md.claude/skills/spec/SKILL.mdCHANGELOG.mdCargo.tomldocs/guide/getting-started.mddocs/rfc/RFC-0000.mddocs/rfc/RFC-0001.mddocs/rfc/RFC-0002.mddocs/rfc/RFC-0003.mddocs/rfc/RFC-0004.mddocs/rfc/RFC-0006.mddocs/rfc/RFC-0007.mdgov/adr/ADR-0055-separate-current-show-projections-from-archival-rendering.tomlgov/releases.tomlgov/rfc/RFC-0002/clauses/C-SHOW-PROJECTION.tomlgov/rfc/RFC-0002/rfc.tomlgov/work/2026-07-20-expose-clause-lifecycle-status-in-rendered-output.tomlgov/work/2026-07-21-add-current-and-archival-show-projections.tomlsrc/cli/common/args.rssrc/cli/common/targets.rssrc/cli/help.rssrc/cli/resources/adr.rssrc/cli/resources/clause.rssrc/cli/resources/guard.rssrc/cli/resources/rfc.rssrc/cli/resources/work.rssrc/cmd/describe/catalog.rssrc/cmd/guard.rssrc/cmd/output.rssrc/cmd/output_tests.rssrc/cmd/render/show.rssrc/command_router/execute/mod.rssrc/command_router/mod.rssrc/command_router/plan.rssrc/command_router/tests/lock_disposition.rssrc/render/adr.rssrc/render/mod.rssrc/render/rfc.rssrc/render/tests/adr.rssrc/render/tests/mod.rssrc/render/tests/rfc.rssrc/render/work.rssrc/resource_plan/mod.rstests/lifecycle_tests/clause.rstests/test_show.rs
🚧 Files skipped from review as they are similar to previous changes (36)
- src/render/tests/mod.rs
- gov/work/2026-07-20-expose-clause-lifecycle-status-in-rendered-output.toml
- gov/adr/ADR-0055-separate-current-show-projections-from-archival-rendering.toml
- gov/work/2026-07-21-add-current-and-archival-show-projections.toml
- src/resource_plan/mod.rs
- docs/rfc/RFC-0006.md
- Cargo.toml
- src/cli/resources/rfc.rs
- src/cli/resources/work.rs
- src/cli/resources/adr.rs
- src/cli/resources/clause.rs
- src/command_router/plan.rs
- gov/releases.toml
- .claude/skills/spec/SKILL.md
- src/cmd/output.rs
- src/command_router/tests/lock_disposition.rs
- CHANGELOG.md
- src/cli/resources/guard.rs
- docs/guide/getting-started.md
- src/command_router/mod.rs
- src/render/tests/adr.rs
- src/cli/common/args.rs
- src/command_router/execute/mod.rs
- src/cmd/output_tests.rs
- src/cli/help.rs
- src/render/mod.rs
- gov/rfc/RFC-0002/rfc.toml
- src/render/tests/rfc.rs
- gov/rfc/RFC-0002/clauses/C-SHOW-PROJECTION.toml
- src/cmd/guard.rs
- tests/test_show.rs
- tests/lifecycle_tests/clause.rs
- src/cmd/describe/catalog.rs
- src/cli/common/targets.rs
- src/render/rfc.rs
- src/cmd/render/show.rs
| > **Owners:** @govctl-org | ||
|
|
||
| > **Tags:** `core`, `schema`, `validation`, `lifecycle` | ||
|
|
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Keep RFC metadata blocks contiguous across all updated RFC documents.
The blank lines inside these blockquotes trigger markdownlint MD028. Remove the separators so each metadata header remains one contiguous blockquote.
docs/rfc/RFC-0000.md#L8-L11: remove the blank line betweenOwnersandTags.docs/rfc/RFC-0001.md#L8-L11: remove the blank line betweenOwnersandTags.docs/rfc/RFC-0002.md#L2-L10: remove the blank lines separatingVersion,Owners, andTags.docs/rfc/RFC-0003.md#L8-L11: remove the blank line betweenOwnersandTags.docs/rfc/RFC-0004.md#L8-L11: remove the blank line betweenOwnersandTags.docs/rfc/RFC-0007.md#L8-L11: remove the blank line betweenOwnersandTags.
🧰 Tools
🪛 markdownlint-cli2 (0.23.0)
[warning] 9-9: Blank line inside blockquote
(MD028, no-blanks-blockquote)
📍 Affects 6 files
docs/rfc/RFC-0000.md#L8-L11(this comment)docs/rfc/RFC-0001.md#L8-L11docs/rfc/RFC-0002.md#L2-L10docs/rfc/RFC-0003.md#L8-L11docs/rfc/RFC-0004.md#L8-L11docs/rfc/RFC-0007.md#L8-L11
🤖 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 `@docs/rfc/RFC-0000.md` around lines 8 - 11, Remove blank lines within the
metadata blockquotes so each RFC header remains contiguous: in
docs/rfc/RFC-0000.md lines 8-11, docs/rfc/RFC-0001.md lines 8-11,
docs/rfc/RFC-0003.md lines 8-11, docs/rfc/RFC-0004.md lines 8-11, and
docs/rfc/RFC-0007.md lines 8-11 remove the separator between Owners and Tags; in
docs/rfc/RFC-0002.md lines 2-10 remove separators between Version, Owners, and
Tags.
Source: Linters/SAST tools
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Summary by CodeRabbit
shownow defaults to a current view, omitting obsolete body content for deprecated/superseded RFCs, clauses, and ADRs.--historyto retrieve the complete archived body content.--historyis rejected with structured output.