Skip to content

Dev#22

Merged
lucifer1004 merged 3 commits into
mainfrom
dev
Jun 9, 2026
Merged

Dev#22
lucifer1004 merged 3 commits into
mainfrom
dev

Conversation

@lucifer1004

@lucifer1004 lucifer1004 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Loop commands now display plan freshness (fresh/stale) in list and show outputs
    • Loop listing and show expose plan info in JSON and table/plain formats
  • Bug Fixes

    • Loop execution rejects stale cached dependency closures before opening new rounds
    • Corrected release archive metadata resolution for Unix and Windows formats
  • Documentation

    • Governance loop guidance and recommended workflows clarified (when to use/replan)
    • RFC and changelog updated to document skill-bundle installation behavior
  • Tests

    • Added integration and listing tests covering stale-plan detection and output changes

@coderabbitai

coderabbitai Bot commented Jun 9, 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: e425b8d9-3392-497f-888c-997e5539dcc6

📥 Commits

Reviewing files that changed from the base of the PR and between 674dc87 and 9104a17.

📒 Files selected for processing (15)
  • .claude/skills/gov/SKILL.md
  • .claude/skills/wi-writer/SKILL.md
  • CHANGELOG.md
  • Cargo.toml
  • build.rs
  • docs/guide/recommended-workflows.md
  • gov/work/2026-06-09-detect-stale-loop-plans.toml
  • src/cmd/loop_cmd/execution/mod.rs
  • src/cmd/loop_cmd/mod.rs
  • src/cmd/loop_cmd/output.rs
  • src/cmd/loop_cmd/state.rs
  • src/cmd/self_update_tests.rs
  • tests/loop_tests/scope.rs
  • tests/loop_tests/surface_cases/listing.rs
  • tests/test_agent_dir.rs
✅ Files skipped from review due to trivial changes (2)
  • .claude/skills/gov/SKILL.md
  • docs/guide/recommended-workflows.md
🚧 Files skipped from review as they are similar to previous changes (10)
  • Cargo.toml
  • src/cmd/loop_cmd/mod.rs
  • gov/work/2026-06-09-detect-stale-loop-plans.toml
  • tests/loop_tests/surface_cases/listing.rs
  • src/cmd/self_update_tests.rs
  • src/cmd/loop_cmd/execution/mod.rs
  • build.rs
  • tests/test_agent_dir.rs
  • tests/loop_tests/scope.rs
  • src/cmd/loop_cmd/state.rs

📝 Walkthrough

Walkthrough

Adds loop plan freshness detection (compute/display/validate, block open-round until replanned), generates skill assets at build time and uses them in sync/init, and hard-codes cargo-binstall archive URLs; includes RFC/docs/work-item updates and tests.

Changes

Loop Plan Freshness Detection

Layer / File(s) Summary
Plan status types and freshness computation
src/cmd/loop_cmd/state.rs
Introduces LoopPlanStatus enum with Fresh/Stale variants and functions to detect whether a stored loop plan matches the current dependency closure from loaded work items by comparing resolved items and dependencies.
Plan status output and command integration
src/cmd/loop_cmd/mod.rs, src/cmd/loop_cmd/output.rs
LoopListEntry gains a plan field; show and list compute plan status and pass it into output formatting; loop printing refactored to conditionally display plan status.
Execution blocking on stale plans
src/cmd/loop_cmd/execution/mod.rs
open_round calls ensure_loop_plan_fresh at the start, rejecting execution and displaying a replan instruction if the stored plan is stale or unresolved.
Plan freshness integration tests
tests/loop_tests/scope.rs, tests/loop_tests/surface_cases/listing.rs
Verifies stale plan rejection with replan guidance, successful execution after replanning, and plain/JSON listing output including plan status (fresh or stale).

Build-time Skill Asset Generation

Layer / File(s) Summary
Build script asset generation
build.rs
Adds generate_skill_assets to recursively collect files from .claude/skills directories, emit OUT_DIR/skill_assets.rs with SKILL_ASSETS constant mapping paths to include_str! content, and rerun on .claude/skills/.claude/agents changes.
Command integration with generated assets
src/cmd/new/skills.rs
Removes hardcoded SKILL_TEMPLATES constant and replaces it with include! of generated skill_assets.rs; sync_skills iterates over generated assets instead.
Init-skills plugin exclusion test
tests/test_agent_dir.rs
Verifies init-skills does not create a project-local plugin-only init skill.

Cargo-binstall URL Configuration

Layer / File(s) Summary
Binstall download metadata update
Cargo.toml
Hard-codes default pkg-url to .tar.gz archive; adds x86_64-pc-windows-msvc override with .zip URL, aligning with GitHub Release asset naming.
Binstall metadata validation test
src/cmd/self_update_tests.rs
Expands test to parse and validate pkg-url, pkg-fmt, bin-dir, and Windows override fields against expected archive layout.

Governance and Documentation Updates

Layer / File(s) Summary
Loop usage and workflow guidance updates
.claude/skills/gov/SKILL.md, .claude/skills/wi-writer/SKILL.md, docs/guide/recommended-workflows.md
Clarifies loop usage for non-trivial governed execution with local evidence, distinguishes single-work-item loops from mechanical fragmentation, and adds stale-plan replan instruction.
RFC specifications and version bump
docs/rfc/RFC-0002.md, gov/rfc/RFC-0002/clauses/C-GLOBAL-COMMANDS.toml, gov/rfc/RFC-0002/rfc.toml
Bumps RFC-0002 to version 0.10.2; clarifies init-skills to document full bundled skill directory installation with references, assets, and scripts; adds changelog entry.
Work item definitions and changelog
gov/work/2026-06-08-fix-cargo-binstall-unix-asset-suffix.toml, gov/work/2026-06-08-support-bundled-skill-installation.toml, gov/work/2026-06-09-detect-stale-loop-plans.toml, CHANGELOG.md
Defines three completed work items with acceptance criteria; updates CHANGELOG with added/changed/fixed entries.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • govctl-org/govctl#9: Updates to Cargo.toml package.metadata.binstall configuration for cargo-binstall support and release asset handling.

Poem

🐰 Plans fresh as morning dew,
Skills compiled from stems anew,
Archives zipped and tarred with care,
Docs and tests hop everywhere,
A tiny rabbit cheers the repair.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 31.43% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Dev' is vague and generic, failing to convey any meaningful information about the changeset's primary purpose or scope. Replace with a descriptive title that summarizes the main changes, such as 'Support stale loop plan detection and bundled skill installation' or 'Add loop plan freshness validation and skill asset bundling.'
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.69767% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/cmd/loop_cmd/state.rs 86.53% 7 Missing ⚠️
src/cmd/loop_cmd/output.rs 95.23% 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: 3

🧹 Nitpick comments (1)
src/cmd/self_update_tests.rs (1)

131-140: ⚡ Quick win

Consider validating Windows override pkg-fmt for completeness.

The test validates the Windows override pkg-url but not pkg-fmt. Since Cargo.toml line 109 specifies pkg-fmt = "zip" for the Windows override, the test should verify this field to ensure the override is fully validated.

🧪 Suggested validation addition
     windows_pkg_url,
     "{ repo }/releases/download/v{ version }/govctl-v{ version }-{ target }.zip"
 );
+let windows_pkg_fmt = binstall
+    .get("overrides")
+    .and_then(|overrides| overrides.get("x86_64-pc-windows-msvc"))
+    .and_then(|windows| windows.get("pkg-fmt"))
+    .and_then(toml::Value::as_str)
+    .ok_or("missing package.metadata.binstall.overrides.x86_64-pc-windows-msvc.pkg-fmt")?;
+assert_eq!(windows_pkg_fmt, "zip");
🤖 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/self_update_tests.rs` around lines 131 - 140, The test currently
extracts and asserts windows_pkg_url (variable windows_pkg_url) but doesn't
validate the Windows override's "pkg-fmt"; update the test to also read the
"pkg-fmt" value from the same override chain (use the same
binstall.get(...).and_then(...).and_then(...).and_then(toml::Value::as_str).ok_or(...)
pattern targeting "pkg-fmt") and add an assertion (similar to assert_eq!) that
its value equals "zip" to match the Cargo.toml override.
🤖 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 `@build.rs`:
- Around line 16-17: Update the top-of-file comment that currently reads
"Project-local assets installed by `govctl init-skills`. Plugin/global-only
skills such as `init` are intentionally omitted." to include an inline RFC
clause citation (for example `[[RFC-0002:C-GLOBAL-COMMANDS]]`) immediately after
the invariant statement so the policy is traceable; locate that exact comment in
build.rs and append the RFC citation to the sentence describing omitted
plugin/global-only skills.

In `@Cargo.toml`:
- Around line 102-109: Add a one-line ADR citation comment above the
package.metadata.binstall section to record that the release asset naming
convention (pkg-url and pkg-fmt) implements ADR-0041; reference the section and
the Windows override by name (package.metadata.binstall and
package.metadata.binstall.overrides.x86_64-pc-windows-msvc) so reviewers can
trace this config back to ADR-0041.

In `@tests/test_agent_dir.rs`:
- Around line 34-38: The test currently only asserts the SKILL.md file absence
(variable init_skill); also assert the containing directory is not created by
constructing a path for the directory (e.g., let init_dir =
temp_dir.path().join(".claude/skills/init");) and add
assert!(!init_dir.exists(), "init is a plugin/global onboarding skill, not a
project-local init-skills asset") to ensure the directory itself is excluded;
update tests/test_agent_dir.rs accordingly (use the existing temp_dir and same
error message).

---

Nitpick comments:
In `@src/cmd/self_update_tests.rs`:
- Around line 131-140: The test currently extracts and asserts windows_pkg_url
(variable windows_pkg_url) but doesn't validate the Windows override's
"pkg-fmt"; update the test to also read the "pkg-fmt" value from the same
override chain (use the same
binstall.get(...).and_then(...).and_then(...).and_then(toml::Value::as_str).ok_or(...)
pattern targeting "pkg-fmt") and add an assertion (similar to assert_eq!) that
its value equals "zip" to match the Cargo.toml override.
🪄 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: 58464255-3031-4b97-85e1-8935d4e32102

📥 Commits

Reviewing files that changed from the base of the PR and between 2d3ef33 and 674dc87.

📒 Files selected for processing (21)
  • .claude/skills/gov/SKILL.md
  • .claude/skills/wi-writer/SKILL.md
  • CHANGELOG.md
  • Cargo.toml
  • build.rs
  • docs/guide/recommended-workflows.md
  • docs/rfc/RFC-0002.md
  • gov/rfc/RFC-0002/clauses/C-GLOBAL-COMMANDS.toml
  • gov/rfc/RFC-0002/rfc.toml
  • gov/work/2026-06-08-fix-cargo-binstall-unix-asset-suffix.toml
  • gov/work/2026-06-08-support-bundled-skill-installation.toml
  • gov/work/2026-06-09-detect-stale-loop-plans.toml
  • src/cmd/loop_cmd/execution/mod.rs
  • src/cmd/loop_cmd/mod.rs
  • src/cmd/loop_cmd/output.rs
  • src/cmd/loop_cmd/state.rs
  • src/cmd/new/skills.rs
  • src/cmd/self_update_tests.rs
  • tests/loop_tests/scope.rs
  • tests/loop_tests/surface_cases/listing.rs
  • tests/test_agent_dir.rs

Comment thread build.rs Outdated
Comment thread Cargo.toml
Comment thread tests/test_agent_dir.rs
Reject stale cached loop dependency closures before opening new rounds, and expose fresh/stale plan status in loop show/list.
@lucifer1004 lucifer1004 merged commit a1370e4 into main Jun 9, 2026
8 checks passed
@lucifer1004 lucifer1004 deleted the dev branch June 9, 2026 01:52
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