Skip to content

fix(git): classify declaration-language comments so prose-only can see them - #856

Merged
wenzowski merged 2 commits into
mainfrom
claude/ci-warm-both-poles-cg7jpu
Sep 4, 2026
Merged

fix(git): classify declaration-language comments so prose-only can see them#856
wenzowski merged 2 commits into
mainfrom
claude/ci-warm-both-poles-cg7jpu

Conversation

@wenzowski

@wenzowski wenzowski commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

prose-only could not fire over .rego, .toml, .yml/.yaml or .pkl.
without_comments knew four extensions — .md, .rs, the shell family, and
extensionless mise-tasks/ programs — the languages a consumer writes PROGRAMS
in, which is the set CLOUD-827's shell predecessor classified. This repository
keeps most of its prose somewhere else: ~40 policy modules, the config
authority, the pipeline document, the workflows. All of them took the
unrecognised-extension fall-through, whose remainder is the whole file, so a
comment-only change to any of them read as a code change.

Measured on this branch's own first commit: a 121→71-comment trim of one policy
module, nothing else in the diff, batten check --rule prose-only exit 0, a
full required matrix spent on a change CI does not judge. That is precisely the
instance CLOUD-827 exists to price, and it walked past because the classifier
had never been told what a .rego comment looks like.

.rego, .toml, .yml/.yaml are #; .pkl is // — Java-family, where
# is not a comment marker at all. The fall-through's direction is unchanged
and still right for a genuinely unknown extension: it admits rather than
blocks, and only blocking is unrecoverable by waiting.

Both tiers, because the load-time one cannot see this class: git::tests pins
the table one assertion per extension, and crates/batten/tests/it/prose_only.rs
drives the compiled engine over a real origin/main for all four. Every
existing case in that suite is a .rs, .md, .bats or extensionless program
— the same blind spot one layer up, and the reason the gap survived.

Also here, from the first commit: policy/release-provision-parity.rego trimmed
235→185 lines, 121→71 comment, because most of the comment was a second copy of
CLOUD-1431. Predicate, test_ rules and verdicts untouched.

DO-NOT-CLOSE CLOUD-1431

CLOUD-1431 was closed by #851, which landed that gate. Nothing here completes
it. CLOUD-827's gate is what this repairs, and CLOUD-827 is Done — the row's
mechanism shipped; this is a class of input it could not read.

https://claude.ai/code/session_01Gyg9qwjPd1PeJRS9b3LqxN

@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

Next included review available in 53 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 8ff2f1ba-141d-4cf6-affd-783fd1ce3141

📥 Commits

Reviewing files that changed from the base of the PR and between b66ab96 and 1105c21.

📒 Files selected for processing (2)
  • crates/batten/src/git.rs
  • crates/batten/tests/it/prose_only.rs

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 9f3decd3-82e6-41ea-b9f2-3b395f23686f

📥 Commits

Reviewing files that changed from the base of the PR and between fe4ad5d and b66ab96.

📒 Files selected for processing (3)
  • crates/batten/src/git.rs
  • crates/batten/tests/it/prose_only.rs
  • policy/release-provision-parity.rego

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

without_comments now strips comments from Rego, TOML, YAML, and Pkl files. Unit and integration tests verify comment removal, unknown-extension behavior, and prose-only findings. Documentation comments in release-provision-parity.rego are condensed without changing policy logic.

Merge Risk: ⚪ Minimal · up to b66ab

The change is merge-ready with no concrete current-head risk identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. (1 skipped: 1 …
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.
Title check ✅ Passed The title clearly and concisely describes the main change: classifying comments in declaration-language files so prose-only detection works.
Description check ✅ Passed The description directly explains the classification gap, the affected extensions, the policy documentation changes, and the added tests.
✨ 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 claude/ci-warm-both-poles-cg7jpu

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.

@wenzowski
wenzowski marked this pull request as ready for review September 4, 2026 18:48
@wenzowski
wenzowski force-pushed the claude/ci-warm-both-poles-cg7jpu branch from 260f037 to 34a7d44 Compare September 4, 2026 18:48
@wenzowski wenzowski changed the title docs(policy): stop restating CLOUD-1431 inside its own module fix(git): classify declaration-language comments so prose-only can see them Sep 4, 2026
…e them

`without_comments` knew four extensions — `.md`, `.rs`, the shell family,
and extensionless `mise-tasks/` programs. Those are the languages a
consumer writes PROGRAMS in, which is the set CLOUD-827's shell
predecessor classified. A declarative consumer keeps most of its prose
somewhere else: policy modules, config, pipeline documents, workflows.
Every one of those took the unrecognised-extension fall-through, whose
remainder is the whole file, so a comment-only change to any of them read
as a code change and `prose-only` could not fire over it.

Measured 2026-09-04, on this branch's own first commit: a 121-to-71
comment trim of one policy module, nothing else in the diff, `batten
check --rule prose-only` exit 0, and a full required matrix spent on a
change CI does not judge. That is precisely the instance CLOUD-827 exists
to price.

`.rego`, `.toml`, `.yml`/`.yaml` are `#`; `.pkl` is `//` — Java-family,
where `#` is not a comment marker at all, so one table for everything
`#`-ish would have kept real code in the remainder and dropped commented
lines from it.

The fall-through's direction is unchanged and still right for a genuinely
unknown extension: it admits the branch rather than blocking it, and only
blocking is unrecoverable by waiting. What was wrong was calling these
unknown.

Both tiers, because the load-time one cannot see this class:

* `git::tests` pins the table, one assertion per extension, so one arm's
  presence cannot stand in for the rest;
* `crates/batten/tests/it/prose_only.rs` drives the compiled engine over a
  real `origin/main` for all four, which is the tier that proves the
  remainder comparison the ENGINE builds now reaches them. Every existing
  case in that file is a `.rs`, `.md`, `.bats` or extensionless program —
  the same blind spot one layer up, and the reason the gap survived.

Refs: CLOUD-827
`clippy::match_same_arms` is `-D warnings` here, so `Some("pkl") => "//"`
beside `Some("rs") => "//"` does not compile, and neither does the
declaration-language arm beside the shell family's. Two arms now, one per
marker.

The grouping a reader wants is not the grouping the lint permits, so it
moves into the comments: `.pkl` sits with Rust because it is Java-family
and `#` is not a comment marker there at all, which is the one thing about
this table worth getting wrong slowly.

Both test doc comments said "removing an arm" where the removable unit is
now a token, and the per-extension cases matter more for it: seven
extensions share two arms, so a case per extension is the only
granularity the table itself no longer provides.

Refs: CLOUD-827
@wenzowski
wenzowski force-pushed the claude/ci-warm-both-poles-cg7jpu branch from b66ab96 to 1105c21 Compare September 4, 2026 20:36
@sonarqubecloud

sonarqubecloud Bot commented Sep 4, 2026

Copy link
Copy Markdown

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

@wenzowski

Copy link
Copy Markdown
Contributor Author

/fast-forward

@wenzowski
wenzowski merged commit 1105c21 into main Sep 4, 2026
11 of 12 checks passed
@wenzowski
wenzowski deleted the claude/ci-warm-both-poles-cg7jpu branch September 4, 2026 20:48
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