Skip to content

ci: gate construct-cli with cargo fmt, clippy, test, and an MSRV check - #27

Merged
UnbreakableMJ merged 3 commits into
mainfrom
ci-cargo-job
Aug 5, 2026
Merged

ci: gate construct-cli with cargo fmt, clippy, test, and an MSRV check#27
UnbreakableMJ merged 3 commits into
mainfrom
ci-cargo-job

Conversation

@UnbreakableMJ

Copy link
Copy Markdown
Contributor

Why

construct-cli/ is the only real build surface in this repo — everything else is markdown — and it was entirely ungated. The existing lint job runs reuse lint, config validation, and the description cap; it never invokes cargo.

That is how a clippy break (items_after_test_module in src/sources/skillmd.rs) sat unnoticed on main until #26 tripped over it and had to fix it as a drive-by.

Jobs added

Job Runs Toolchain
cargo fmt --check, clippy --all-targets -- -D warnings, test stable
msrv cargo check --all-features 1.82 (the declared rust-version)

Both use Swatinem/rust-cache.

Decisions worth reviewing

Stable for the gate, MSRV separately. Pinning the main gate to 1.82 would freeze clippy lints and rustfmt output at whatever that release emitted. Keeping MSRV as its own job also means an MSRV bump is a visible, deliberate change rather than something that rides along with a dependency update. It runs check, not test — dev-dependencies are not bound by the MSRV the crate advertises to consumers.

Not path-filtered. A path-filtered job reports nothing at all when skipped, which makes it unusable as a required status check. With the cache, a markdown-only PR is cheap enough that always running is the better trade.

cargo audit deliberately excluded. A newly published advisory would redden main for a reason unrelated to the change under review. It stays a local step before adding a dependency (Standard §3.3). If it belongs in CI later, a scheduled job is the right shape — not a PR gate.

Docs

construct-cli/AGENTS.md now records what is gated and what is not, including why cargo audit is absent and why a clippy finding should be fixed rather than pinned around. Its peer CLAUDE.md got the identical edit but is gitignored, so it is not in this diff — the two remain identical apart from their self-reference line, as that file pair requires.

Verification

The workflow YAML parses under .github/validate-configs.py (309 config files, 0 failed). Locally: cargo fmt --check, cargo clippy --all-targets -- -D warnings, and cargo test (40 passed) are all clean on this branch.

The msrv job is unverified locally — I had no 1.82 toolchain to hand, so this PR is the first real test of it. If it fails, the fix is either a rust-version bump in Cargo.toml to match what the code actually needs, or dropping the job; I'll resolve it here before merge rather than land a red gate.

🤖 Generated with Claude Code

construct-cli/ is the only real build surface in this repo — everything else is
markdown — and it was entirely ungated. The lint job never invokes cargo, which
is how a clippy break (items_after_test_module in src/sources/skillmd.rs) sat
unnoticed on main until #26 tripped over it.

Two new jobs:

- `cargo` — fmt --check, clippy --all-targets -D warnings, test. Runs on
  stable, since pinning the gate to the MSRV would freeze clippy lints and
  rustfmt output at whatever 1.82 emitted.
- `msrv` — cargo check against the `rust-version` declared in Cargo.toml
  (1.82), kept separate so an MSRV bump is a visible, deliberate change rather
  than something that rides along with a dependency update. `check` rather than
  `test`, because dev-dependencies are not bound by the MSRV the crate
  advertises to consumers.

Both use Swatinem/rust-cache. Deliberately not path-filtered: a filtered job
reports nothing when skipped, which makes it unusable as a required status
check, and the cache makes a markdown-only PR cheap enough that always running
is the better trade.

cargo audit is deliberately excluded. A newly published advisory would redden
main for a reason unrelated to the change under review; it stays a local step
before adding a dependency (Standard §3.3). If it belongs in CI later, a
scheduled job is the right shape, not a PR gate.

construct-cli/AGENTS.md and CLAUDE.md document what is gated and what is not.
They remain identical apart from their self-reference line, as that file pair
requires.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

UnbreakableMJ and others added 2 commits August 5, 2026 09:11
The new msrv job did its job on its first run: `cargo check` under 1.82 failed
before compiling a single line of our code. The locked dependency tree pins
indexmap 2.14.0, whose manifest requires the `edition2024` Cargo feature —
stabilized in 1.85 — so 1.82 could not even parse the tree.

`rust-version = "1.82"` was therefore a fiction, and had been for as long as
that dependency had been locked. Nothing caught it because nothing ever built
the crate on the version it claimed to support.

Corrected to 1.85 and the job pinned to match, with the reasoning recorded in
Cargo.toml so the next person raising it knows to re-measure rather than guess.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
At 1.85 the resolver got far enough to report the real constraint instead of
failing to parse: darling 0.23.0 and instability 0.3.12 — both transitive, via
ratatui — require 1.88.0.

So the floor is set by the locked dependency tree, not by this crate's own
source, and 1.85 was only the first of two hurdles (indexmap's `edition2024`
requirement). Recorded both in Cargo.toml so the next reader knows the number
tracks dependencies and must be re-measured, not reasoned about.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@UnbreakableMJ
UnbreakableMJ merged commit 12fc11d into main Aug 5, 2026
3 checks passed
@UnbreakableMJ
UnbreakableMJ deleted the ci-cargo-job branch August 5, 2026 09:13
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