Skip to content

Some bugfixes#30

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

Some bugfixes#30
lucifer1004 merged 3 commits into
mainfrom
dev

Conversation

@lucifer1004

@lucifer1004 lucifer1004 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

Release Notes

  • New Features

    • Added --work to loop run to target specific work items within an existing loop.
  • Removed

    • Removed --max-rounds from loop run.
    • Removed max_rounds from new loop round artifacts.
  • Changed

    • Loop failure semantics no longer rely on round counts alone, including when resuming loops.
    • RFC version bumps now reject empty/metadata-only bumps unless RFC/clause content was amended.
  • Bug Fixes

    • Improved bare reference warnings to include field/line and matched context; updated related diagnostic codes/tests.

Remove --max-rounds from loop run and round artifacts, and treat round counts as audit metadata only. Continue accepting legacy round.max_rounds fields on read so old loop state can be resumed.
Refuse rfc bump when a stored amendment signature exists and no RFC or clause content changed.
Keep rendered projection signatures separate from RFC amendment content signatures.
@coderabbitai

coderabbitai Bot commented Jun 16, 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: a89a20bb-215d-45a9-9b38-a54fe59d9db7

📥 Commits

Reviewing files that changed from the base of the PR and between bd6f070 and ec6f384.

📒 Files selected for processing (7)
  • CHANGELOG.md
  • gov/work/2026-06-15-reject-empty-rfc-bumps.toml
  • gov/work/2026-06-15-remove-loop-max-rounds-semantics.toml
  • gov/work/2026-06-15-report-bare-reference-warning-source.toml
  • src/validate/bracket_refs.rs
  • tests/error_tests/rfc_clause_cases/check.rs
  • tests/error_tests/work.rs
✅ Files skipped from review due to trivial changes (1)
  • CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (5)
  • gov/work/2026-06-15-reject-empty-rfc-bumps.toml
  • gov/work/2026-06-15-remove-loop-max-rounds-semantics.toml
  • tests/error_tests/rfc_clause_cases/check.rs
  • tests/error_tests/work.rs
  • src/validate/bracket_refs.rs

📝 Walkthrough

Walkthrough

This PR delivers three independent features: removes --max-rounds from govctl loop run and reclassifies round_count as pure audit metadata (RFC-0006 v0.5.0); adds RFC empty-bump rejection via a new content-only signature comparison and E0113RfcBumpNoAmendment error (RFC-0002 v0.10.3); and enriches W0112 bare-reference warnings with per-field line numbers and context snippets via a new TextSource struct.

Changes

Remove loop max-rounds semantics (RFC-0006 v0.5.0)

Layer / File(s) Summary
LoopRoundMeta and round schema
src/loop_state/mod.rs, src/loop_state/validation/round.rs, src/loop_state/tests.rs, gov/schema/loop-round.schema.json, gov/schema/SCHEMA.md
LoopRoundMeta replaces pub max_rounds: u32 with a private legacy_max_rounds: Option<u32> (skip_serializing), LoopRoundRecord::open drops the param, max_rounds>=1 validation is removed, JSON schema and SCHEMA.md remove the field, and a new test verifies legacy TOML round-trips without max_rounds.
Remove E1211LoopInvalidMaxRounds diagnostic
src/diagnostic/code/mod.rs, src/diagnostic/code/metadata.rs
DiagnosticCode loses the E1211LoopInvalidMaxRounds variant and its "E1211" metadata mapping.
CLI and command routing
src/cli/loop_cmd.rs, src/command_router/plan.rs, src/command_router/parsed.rs, src/command_router/execute/builtin.rs, src/command_router/tests/*
LoopCommand::Run removes max_rounds and adds target_work_ids (--work); BuiltinOp::LoopRun drops the max_rounds field; routing and execution wiring updated accordingly; test fixtures updated to match.
Loop execution engine
src/cmd/loop_cmd/execution/mod.rs
run() drops max_rounds validation; open_round removes the param; ready_work_for_round returns Vec<String> instead of ReadyWork (no per-item failure tracking); loop_failure_message emits a generic message.
RFC-0006 spec and governance
docs/rfc/RFC-0006.md, gov/rfc/RFC-0006/clauses/*, gov/rfc/RFC-0006/rfc.toml, gov/work/2026-06-15-remove-loop-max-rounds-semantics.toml
RFC-0006 bumped to v0.5.0; all clauses tighten round_count-as-audit-metadata normative text; work item and changelog updated.
Loop tests
tests/common/loop_helpers.rs, tests/loop_tests/*
Removes loop_run_with_max_rounds helper and all call sites; updates lifecycle assertions (round record lacks max_rounds, blocked-round opens round 2 instead of failing); adds a test confirming --max-rounds is rejected by the CLI; updates scope, listing, and schema-validation test fixtures.

Reject empty RFC version bumps (RFC-0002 v0.10.3)

Layer / File(s) Summary
Content-only RFC signature and is_rfc_amended
src/signature/mod.rs, src/signature/tests.rs
compute_rfc_content_signature strips signature, version, and changelog before hashing; is_rfc_amended compares stored sig against content sig first, then full sig; unit tests verify amendment detection across changelog-only and clause-text changes.
RFC bump gating logic
src/cmd/lifecycle/rfc.rs
bump() computes refresh_signature_after_write; calls new ensure_rfc_has_content_amendment (emits E0113) for version bumps; uses should_refresh_signature_after_changelog_only for changelog-only paths; post-write refresh is now conditional.
Add E0113RfcBumpNoAmendment diagnostic
src/diagnostic/code/mod.rs, src/diagnostic/code/metadata.rs
DiagnosticCode gains E0113RfcBumpNoAmendment variant and its "E0113" metadata mapping.
RFC-0002 spec, governance, and changelog
docs/rfc/RFC-0002.md, gov/rfc/RFC-0002/clauses/C-LIFECYCLE-VERBS.toml, gov/rfc/RFC-0002/rfc.toml, gov/work/2026-06-15-reject-empty-rfc-bumps.toml
RFC-0002 bumped to v0.10.3; normative rfc bump rejection requirements added to spec and clause; gov metadata and signature updated; work item WI-2026-06-15-002 added.
RFC bump rejection integration tests
tests/lifecycle_tests/rfc_cases/bump.rs
Three new snapshot-based tests: rejects empty patch bump after baseline, rejects changelog-only bump after baseline, and verifies --change does not clear pending amendment state.

W0112 bare-reference warning enrichment

Layer / File(s) Summary
TextSource struct and scanner refactoring
src/validate/bracket_refs.rs
New TextSource<'a> pairs path with a field string; scan_rfc_reference_hierarchy, scan_adr_reference_hierarchy, scan_work_reference_syntax, and scan_reference_hierarchy all accept TextSource; all RFC/ADR/work call sites build TextSource with computed field names.
bare_artifact_reference_warning with line/context
src/validate/bracket_refs.rs
bare_artifact_reference_warning receives TextSource, full text, and match byte offset; computes 1-based line number and whitespace-collapsed truncated context snippet; diagnostic message now includes field, line, and context.
W0112 tests and work item
src/validate/bracket_refs.rs, tests/error_tests/rfc_clause_cases/check.rs, tests/error_tests/work.rs, gov/work/2026-06-15-report-bare-reference-warning-source.toml, CHANGELOG.md
Unit tests pass TextSource and assert new message format; integration tests for ADR and work artifacts check granular field-level diagnostics; work item WI-2026-06-15-003 and CHANGELOG entry added.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • govctl-org/govctl#26: Also modifies src/validate/bracket_refs.rs and the W0112 bare-artifact-reference diagnostic pipeline—directly in the same code path extended by this PR.
  • govctl-org/govctl#22: Touches the same loop execution flow (open_round, loop listing/status handling) that this PR refactors to remove max_rounds-driven logic.
  • govctl-org/govctl#19: Modifies the same src/validate/bracket_refs.rs reference-hierarchy validation to handle bare artifact ID mentions and hierarchy-warning diagnostics, which this PR further enriches.

Poem

🐇 Hop hop, away with --max-rounds today,
No more budget flags to get in the way!
round_count is just audit, it won't seal your fate,
And empty RFC bumps? We firmly say "wait!"
W0112 now shows field, line, and context too —
A tidy spring clean, from this rabbit to you! 🌸

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Some bugfixes' is vague and generic, using non-descriptive language that fails to convey the actual scope or nature of changes in this changeset. Revise the title to clearly describe the primary changes, such as: 'Remove loop max-rounds semantics and RFC bump validation' or 'Refactor loop round protocol and RFC lifecycle requirements'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 96.61% 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.

✏️ 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 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.37097% with 9 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/cmd/loop_cmd/execution/mod.rs 63.63% 4 Missing ⚠️
src/validate/bracket_refs.rs 97.72% 4 Missing ⚠️
src/signature/mod.rs 96.15% 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: 2

🤖 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 `@gov/work/2026-06-15-reject-empty-rfc-bumps.toml`:
- Line 17: The description field in this work item contains normative contract
language that specifies detailed rules about RFC version bumps and what
constitutes valid amendments. Per coding guidelines, work item descriptions must
be non-normative and should not encode contract language that belongs in RFC/ADR
text. Rewrite the description to be concise and descriptive of the
implementation scope and expected outcomes (e.g., what validation will be
implemented and tested), and add a reference to the relevant RFC clause instead
of spelling out the normative rules. Remove the detailed contract language about
content amendments, bookkeeping, and baseline bumps, keeping only a brief
description of what the work item accomplishes.

In `@gov/work/2026-06-15-remove-loop-max-rounds-semantics.toml`:
- Line 14: The `description` field on line 14 contains normative language using
"must" and "must not" statements, which should not appear in work item
descriptions according to coding guidelines. Remove the normative language
(specifically the statements about "govctl must no longer accept or persist
max-rounds" and "loop failure must not be inferred from round count alone") and
reframe the description to focus on the execution scope—what is being removed
and why (the loop rounds should function as audit checkpoints only)—while
keeping the RFC reference. Move the specific normative requirements to the
RFC/ADR text instead of embedding them in this field.
🪄 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: e7ca9b54-edf5-4957-9afa-7948a92e0c1a

📥 Commits

Reviewing files that changed from the base of the PR and between aa0fab9 and a5b890c.

⛔ Files ignored due to path filters (3)
  • tests/snapshots/test_lifecycle__bump_change_does_not_clear_pending_amendment.snap is excluded by !**/*.snap
  • tests/snapshots/test_lifecycle__bump_rejects_changelog_only_after_signature_baseline.snap is excluded by !**/*.snap
  • tests/snapshots/test_lifecycle__bump_rejects_empty_bump_after_signature_baseline.snap is excluded by !**/*.snap
📒 Files selected for processing (41)
  • CHANGELOG.md
  • docs/rfc/RFC-0002.md
  • docs/rfc/RFC-0006.md
  • gov/rfc/RFC-0002/clauses/C-LIFECYCLE-VERBS.toml
  • gov/rfc/RFC-0002/rfc.toml
  • gov/rfc/RFC-0006/clauses/C-LOOP-COMMAND-SURFACE.toml
  • gov/rfc/RFC-0006/clauses/C-LOOP-LIFECYCLE.toml
  • gov/rfc/RFC-0006/clauses/C-LOOP-RESUMPTION.toml
  • gov/rfc/RFC-0006/clauses/C-LOOP-STATE-STORAGE.toml
  • gov/rfc/RFC-0006/clauses/C-ROUND-EXECUTION.toml
  • gov/rfc/RFC-0006/rfc.toml
  • gov/schema/SCHEMA.md
  • gov/schema/loop-round.schema.json
  • gov/work/2026-06-15-reject-empty-rfc-bumps.toml
  • gov/work/2026-06-15-remove-loop-max-rounds-semantics.toml
  • gov/work/2026-06-15-report-bare-reference-warning-source.toml
  • src/cli/loop_cmd.rs
  • src/cmd/lifecycle/rfc.rs
  • src/cmd/loop_cmd/execution/mod.rs
  • src/command_router/execute/builtin.rs
  • src/command_router/parsed.rs
  • src/command_router/plan.rs
  • src/command_router/tests/lock_disposition.rs
  • src/command_router/tests/routing.rs
  • src/diagnostic/code/metadata.rs
  • src/diagnostic/code/mod.rs
  • src/loop_state/mod.rs
  • src/loop_state/tests.rs
  • src/loop_state/validation/round.rs
  • src/signature/mod.rs
  • src/signature/tests.rs
  • src/validate/bracket_refs.rs
  • tests/common/loop_helpers.rs
  • tests/error_tests/rfc_clause_cases/check.rs
  • tests/error_tests/work.rs
  • tests/lifecycle_tests/rfc_cases/bump.rs
  • tests/loop_tests/execution_cases/lifecycle.rs
  • tests/loop_tests/mod.rs
  • tests/loop_tests/scope.rs
  • tests/loop_tests/surface_cases/listing.rs
  • tests/loop_tests/surface_cases/validation.rs
💤 Files with no reviewable changes (8)
  • src/command_router/parsed.rs
  • src/loop_state/validation/round.rs
  • tests/common/loop_helpers.rs
  • src/command_router/tests/lock_disposition.rs
  • src/command_router/plan.rs
  • src/cli/loop_cmd.rs
  • src/command_router/tests/routing.rs
  • gov/schema/SCHEMA.md

Comment thread gov/work/2026-06-15-reject-empty-rfc-bumps.toml Outdated
Comment thread gov/work/2026-06-15-remove-loop-max-rounds-semantics.toml 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

🤖 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 `@gov/work/2026-06-15-report-bare-reference-warning-source.toml`:
- Line 17: The description field in the work item contains normative phrasing
("should identify ...") that prescribes specific behavior, which violates the
guideline that work-item descriptions must not introduce normative requirements.
Reword the description field to remove prescriptive language and instead frame
it as implementation traceability to already-defined RFC/ADR requirements that
specify this behavior. Replace the current prescriptive statements with language
that references existing requirements rather than introducing new ones.
🪄 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: e77d412e-4317-4c94-8f06-b3b066c367af

📥 Commits

Reviewing files that changed from the base of the PR and between aa0fab9 and bd6f070.

⛔ Files ignored due to path filters (3)
  • tests/snapshots/test_lifecycle__bump_change_does_not_clear_pending_amendment.snap is excluded by !**/*.snap
  • tests/snapshots/test_lifecycle__bump_rejects_changelog_only_after_signature_baseline.snap is excluded by !**/*.snap
  • tests/snapshots/test_lifecycle__bump_rejects_empty_bump_after_signature_baseline.snap is excluded by !**/*.snap
📒 Files selected for processing (41)
  • CHANGELOG.md
  • docs/rfc/RFC-0002.md
  • docs/rfc/RFC-0006.md
  • gov/rfc/RFC-0002/clauses/C-LIFECYCLE-VERBS.toml
  • gov/rfc/RFC-0002/rfc.toml
  • gov/rfc/RFC-0006/clauses/C-LOOP-COMMAND-SURFACE.toml
  • gov/rfc/RFC-0006/clauses/C-LOOP-LIFECYCLE.toml
  • gov/rfc/RFC-0006/clauses/C-LOOP-RESUMPTION.toml
  • gov/rfc/RFC-0006/clauses/C-LOOP-STATE-STORAGE.toml
  • gov/rfc/RFC-0006/clauses/C-ROUND-EXECUTION.toml
  • gov/rfc/RFC-0006/rfc.toml
  • gov/schema/SCHEMA.md
  • gov/schema/loop-round.schema.json
  • gov/work/2026-06-15-reject-empty-rfc-bumps.toml
  • gov/work/2026-06-15-remove-loop-max-rounds-semantics.toml
  • gov/work/2026-06-15-report-bare-reference-warning-source.toml
  • src/cli/loop_cmd.rs
  • src/cmd/lifecycle/rfc.rs
  • src/cmd/loop_cmd/execution/mod.rs
  • src/command_router/execute/builtin.rs
  • src/command_router/parsed.rs
  • src/command_router/plan.rs
  • src/command_router/tests/lock_disposition.rs
  • src/command_router/tests/routing.rs
  • src/diagnostic/code/metadata.rs
  • src/diagnostic/code/mod.rs
  • src/loop_state/mod.rs
  • src/loop_state/tests.rs
  • src/loop_state/validation/round.rs
  • src/signature/mod.rs
  • src/signature/tests.rs
  • src/validate/bracket_refs.rs
  • tests/common/loop_helpers.rs
  • tests/error_tests/rfc_clause_cases/check.rs
  • tests/error_tests/work.rs
  • tests/lifecycle_tests/rfc_cases/bump.rs
  • tests/loop_tests/execution_cases/lifecycle.rs
  • tests/loop_tests/mod.rs
  • tests/loop_tests/scope.rs
  • tests/loop_tests/surface_cases/listing.rs
  • tests/loop_tests/surface_cases/validation.rs
💤 Files with no reviewable changes (8)
  • src/loop_state/validation/round.rs
  • src/command_router/parsed.rs
  • gov/schema/SCHEMA.md
  • src/command_router/tests/lock_disposition.rs
  • src/command_router/plan.rs
  • src/command_router/tests/routing.rs
  • tests/common/loop_helpers.rs
  • src/cli/loop_cmd.rs

Comment thread gov/work/2026-06-15-report-bare-reference-warning-source.toml Outdated
Include scanned field, field-local line, and source context in W0112 bare artifact reference warnings so users can locate offending governed prose.
@lucifer1004 lucifer1004 merged commit 8bb0f5d into main Jun 16, 2026
8 checks passed
@lucifer1004 lucifer1004 deleted the dev branch June 16, 2026 21:19
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