K99: bump workspace MSRV to Rust 1.95 (Phase 0-K critical chain)#8
K99: bump workspace MSRV to Rust 1.95 (Phase 0-K critical chain)#8vanyastaff merged 5 commits intomainfrom
Conversation
…ate to all 12 members
K99 (Phase 0-K Kernel Cleanup, critical chain). First mechanical bump of the
flui-v2 hard-fork that turns MSRV from a declarative number into an enforced
invariant.
Changes:
- Cargo.toml: [workspace.package].rust-version = "1.85" -> "1.95"
- rust-toolchain.toml (new): pin channel = "1.95" with rustfmt + clippy
components; header documents that flake.nix's `fenix.latest` divergence
is intentional (Nix users get forward-compat radar; rustup users stay
pinned for reproducibility).
- clippy.toml: add `msrv = "1.95"` so MSRV-aware lints (manual_let_else,
redundant_pattern_matching, ...) consider the floor when deciding
whether a modern idiom is "available". Header documents the cross-file
contract (Cargo.toml -> clippy.toml -> rust-toolchain.toml must stay
in sync).
- 11 workspace member Cargo.toml: add `rust-version.workspace = true`.
Previously only flui-platform inherited; the other 11 members compiled
on whatever stable Rust the runner had, NOT the declared MSRV. With this
change all 12 workspace members enforce the declared floor:
* 7 lib crates (flui-a11y, flui-core, flui-macros, flui-material,
flui-navigator, flui-theme, flui-widgets)
* 3 examples (animation_demo, material_demo, nav_demo)
* 1 tooling (tooling/lock-checks)
- .ai-factory/plans/feature-K99-msrv-bump-1.95.md (new): full implementation
plan with 18 tasks, dependencies, and commit checkpoints.
Pre-flight audit findings:
- `cargo build --workspace` green on Rust 1.95.0 (43.58s).
- `cargo metadata` confirms Cargo.lock unchanged by declarative MSRV bump
(FREEZE policy adopted — no `cargo update` in K99 scope).
- `tooling/perf/` is an orphan (not in [workspace] members but Cargo.toml
references workspace deps). Out of K99 scope; deferred to K93 dead-code
triage.
BREAKING CHANGE: minimum Rust toolchain bumped from 1.85 to 1.95.
Hard-fork posture means we set MSRV unilaterally; no upstream-sync
commitment. Unlocks AFIT/RPITIT, edition-2024 lifetime captures, async
closures, let-chains, lazy_cell, unsafe extern, #[diagnostic::on_unimplemented]
for subsequent K-track specs.
Refs: K99 in .ai-factory/ROADMAP.md (Phase 0-K critical chain)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ard-compat radar docs(msrv): update MSRV references across AGENTS, DESCRIPTION, ARCHITECTURE, RESEARCH, rules/base.md to reflect Rust 1.95 K99 commit 3+4 (combined for atomicity). CI changes (.github/workflows/ci.yml): - Existing 5 jobs (check/clippy/test/format/windows-test-support) keep `dtolnay/rust-toolchain@stable`. With rust-toolchain.toml pinning the channel to "1.95", the action now respects that pin — these jobs become the de facto MSRV gate (cleaner than adding a redundant msrv-check job). - New `forward-compat` job: runs `rustup default stable && rustup update` to BYPASS the toolchain pin and check the workspace on the latest available stable Rust. Marked `continue-on-error: true` — non-blocking early-warning radar for upcoming Rust changes (deprecations, new lints, behavior shifts) so we know about them before the next MSRV bump. - Header comment block documents the gate architecture. Docs sweep: - AGENTS.md: MSRV 1.85 -> 1.95 in tech stack and "Respect MSRV" rule; added 7 positive idiom-prefer rules (AFIT/RPITIT, edition-2024 lifetime captures, async closures, let-chains, lazy_cell, unsafe extern, #[diagnostic::on_unimplemented]); cross-referenced the three-file synchronization invariant (Cargo.toml ↔ rust-toolchain.toml ↔ clippy.toml). - .ai-factory/DESCRIPTION.md: MSRV mentions updated to 1.95; added the three-file enforcement explanation and the flake.nix divergence note. - .ai-factory/ARCHITECTURE.md: tech-stack and Key Principle #11 updated to reflect 1.95 and the three-file invariant; idioms list added. - .ai-factory/RESEARCH.md: stale "target idioms 1.95+ when stable" wording replaced with "Rust 1.95 idioms" + actual unlocked-feature list. - .ai-factory/rules/base.md: MSRV rule bumped to 1.95; positive idiom-prefer rules mirrored from AGENTS.md so contributor guidance is consistent. - README.md: verified no MSRV mention — skipped (no-op task per plan). Plan file: feature-K99-msrv-bump-1.95.md task checkboxes updated for tasks 6-14. Refs: K99 in .ai-factory/ROADMAP.md (Phase 0-K critical chain) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
K99 commit 5+6 (combined). Spec (new): - docs/superpowers/specs/2026-05-08-K99-msrv-bump-1.95-design.md Full Context / Goals / Non-goals / Current state / Design / API surface / Migration / Testing / Open questions / Done criteria / Cross-references / Unblocks. Documents the three-file synchronization invariant (Cargo.toml ↔ rust-toolchain.toml ↔ clippy.toml), the FREEZE Cargo.lock policy, the intentional flake.nix divergence (fenix.latest as forward-compat radar for Nix users), the CI architecture (existing 5 jobs honor toolchain.toml = de facto MSRV gate; new forward-compat job is non-blocking radar), the bump cadence recommendation, and which K-specs this unblocks downstream (K15, K07, K05, K01, K02, K03 + SF01). Note: directory docs/superpowers/specs/ was recreated as part of K99 — the prior commit 95cb96e had aggressively deleted the entire docs/superpowers/ tree (commit message mentioned only gesture roadmap but the diff wiped all specs/plans/migrations). ROADMAP/AGENTS/RESEARCH still referenced the canonical path, so K99 restores it. ROADMAP closure: - K99 checkbox flipped (Phase 0-K critical chain entry). - Completed table: row added with date 2026-05-08 + brief summary. Plan file: feature-K99-msrv-bump-1.95.md final task checkboxes (15, 16) ticked. All 18 tasks done. Refs: K99 in .ai-factory/ROADMAP.md (Phase 0-K critical chain — DONE) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (10)
📝 WalkthroughWalkthroughThis PR completes the K99 milestone by bumping the workspace minimum supported Rust version from 1.85 to 1.95. Changes include updating root and per-crate Cargo.toml manifests, adding rust-toolchain.toml pinning, enabling clippy MSRV linting, adding a non-blocking forward-compat CI job, and synchronizing documentation across multiple project files. ChangesRust MSRV Bump to 1.95
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
Pull request overview
Raises and enforces the workspace MSRV at Rust 1.95 by synchronizing MSRV declarations across Cargo metadata, rustup toolchain pinning, and Clippy MSRV-aware lints, and by updating CI + documentation to match the new invariant. This supports the Phase 0‑K critical chain by ensuring all workspace members and CI actually run on the declared minimum toolchain.
Changes:
- Bump workspace
rust-versionto 1.95 and propagate MSRV inheritance to all workspace members viarust-version.workspace = true. - Add
rust-toolchain.toml(rustup pin) and configureclippy.tomlmsrv = "1.95"for MSRV-aware lints. - Update CI/docs/specs to reflect and document the new “three-file MSRV sync” invariant, and add a non-blocking forward-compat CI job.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| Cargo.toml | Bumps workspace rust-version to 1.95. |
| rust-toolchain.toml | Adds rustup toolchain pin to 1.95 + components. |
| clippy.toml | Enables MSRV-aware Clippy lints via msrv = "1.95". |
| .github/workflows/ci.yml | Documents MSRV gating and adds a forward-compat job (needs a fix to truly bypass the pin). |
| crates/flui-a11y/Cargo.toml | Inherits workspace MSRV via rust-version.workspace = true. |
| crates/flui-core/Cargo.toml | Inherits workspace MSRV via rust-version.workspace = true. |
| crates/flui-macros/Cargo.toml | Inherits workspace MSRV via rust-version.workspace = true. |
| crates/flui-material/Cargo.toml | Inherits workspace MSRV via rust-version.workspace = true. |
| crates/flui-navigator/Cargo.toml | Inherits workspace MSRV via rust-version.workspace = true. |
| crates/flui-theme/Cargo.toml | Inherits workspace MSRV via rust-version.workspace = true. |
| crates/flui-widgets/Cargo.toml | Inherits workspace MSRV via rust-version.workspace = true. |
| examples/animation_demo/Cargo.toml | Inherits workspace MSRV via rust-version.workspace = true. |
| examples/material_demo/Cargo.toml | Inherits workspace MSRV via rust-version.workspace = true. |
| examples/nav_demo/Cargo.toml | Inherits workspace MSRV via rust-version.workspace = true. |
| tooling/lock-checks/Cargo.toml | Inherits workspace MSRV via rust-version.workspace = true. |
| AGENTS.md | Updates MSRV references and adds guidance on “allowed idioms” (contains an invalid std path that should be corrected). |
| .ai-factory/rules/base.md | Updates MSRV rules and idiom guidance (contains an invalid std path that should be corrected). |
| .ai-factory/DESCRIPTION.md | Aligns MSRV documentation and enforcement explanation. |
| .ai-factory/ARCHITECTURE.md | Updates architecture principle for MSRV + sync invariant. |
| .ai-factory/RESEARCH.md | Aligns MSRV references in research summary. |
| .ai-factory/ROADMAP.md | Marks K99 complete and adds completion record. |
| .ai-factory/plans/feature-K99-msrv-bump-1.95.md | Adds implementation plan and validation checklist for K99. |
| docs/superpowers/specs/2026-05-08-K99-msrv-bump-1.95-design.md | Adds K99 design spec documenting rationale and enforcement approach (contains the same invalid std path reference). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Bypass rust-toolchain.toml (which pins the MSRV) and use the | ||
| # latest stable Rust as a forward-compat radar. If a deprecation, | ||
| # new lint, or behaviour change in a newer Rust would land before | ||
| # the next MSRV bump, this job surfaces it early. | ||
| - name: Install latest stable (override rust-toolchain.toml pin) | ||
| run: | | ||
| rustup update stable | ||
| rustup default stable | ||
| rustc --version | ||
|
|
||
| - uses: Swatinem/rust-cache@v2 | ||
|
|
||
| - name: Check workspace on latest stable | ||
| run: cargo check --workspace |
| - Edition-2024 lifetime captures (`-> impl Trait + use<'_>`) — express precise lifetime relationships in async/iterator return types without manual elision. | ||
| - Async closures (`async |...| { ... }`) — for callback-heavy APIs that need to await. | ||
| - `let-chains` (`if let Some(x) = ... && cond && let Some(y) = ...`) — collapse nested matches in reconciliation / lookup code. | ||
| - `lazy_cell::sync::OnceCell` from `std` (1.80+) — use instead of pulling in the `once_cell` crate. |
| - Edition-2024 lifetime captures (`-> impl Trait + use<'_>`) — for precise async/iterator return-type lifetimes. | ||
| - Async closures (`async |...| { ... }`) — for callback APIs that need to await. | ||
| - `let-chains` (`if let Some(x) = ... && cond && let Some(y) = ...`) — collapse nested matches. | ||
| - `lazy_cell::sync::OnceCell` from `std` — instead of pulling in the `once_cell` crate. |
| - Edition-2024 lifetime captures (`-> impl Trait + use<'_>`) — for precise async/iterator return-type lifetimes in K01 (Provider) and K05 (Element ctx-object). | ||
| - Async closures stable (1.85+) — for callback APIs used in K07 (token-based borrow) and SF05 (setState). | ||
| - `let-chains` (1.88, edition 2024) — collapses nested `if let` patterns in K02 (reconciliation). | ||
| - `lazy_cell::sync::OnceCell` (1.80+) — drops the `once_cell` crate dependency in K01. |
| - **K15** (Re-entrancy contract) — next K-spec; uses `let-chains` for nested-state matching and AFIT for async re-entry detection. | ||
| - **K07** (AppCell removal) — async closures and AFIT for token-based borrow callbacks. | ||
| - **K05** (Element ctx-object) — RPITIT for ergonomic `&mut ElementCx<'_>` returns. | ||
| - **K01** (Provider rewrite) — `lazy_cell::sync::OnceCell` to drop `once_cell` dependency; AFIT for per-Window InheritedRegistry async paths. |
The Lock-phase consistency checks step in .github/workflows/ci.yml runs: cargo run -q -p lock-checks -- check-stubs cargo run -q -p lock-checks -- check-platform-imports Both commands depend on: docs/fixtures/platform-expected-stubs.txt (12-file stub inventory) docs/reports/platform-imports.md (platform imports survey) These files were deleted on main in commit 95cb96e ("Remove outdated gesture roadmap and recognizer extension guide") even though that commit's stated scope was only gesture documentation. The regression broke CI for any PR (including K99) that hits the Lock-phase consistency checks step. Regenerated via the tool's own --bless / --emit flags: cargo run -p lock-checks -- check-stubs --bless cargo run -p lock-checks -- check-platform-imports --emit Both files are derived from current source code (no manual content), so regeneration is the canonical fix — restoring stale versions from git history would create false drift. Verified locally: - check-stubs reports "stub inventory in sync (12 files)" - check-platform-imports diff against live regeneration is empty Out of K99 scope strictly speaking, but landing it here unblocks the PR. Same regression would have surfaced on the next PR anyway. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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 `@AGENTS.md`:
- Line 124: The documented import `lazy_cell::sync::OnceCell` is incorrect;
replace it with the appropriate std types depending on threading needs: use
`std::sync::OnceLock` for one-time thread-safe init or `std::sync::LazyLock` for
thread-safe lazy init, or for single-threaded contexts use `std::cell::OnceCell`
or `std::cell::LazyCell` (available in 1.80+); update the AGENTS.md line that
references `lazy_cell::sync::OnceCell` to list these four correct `std` modules
and their intended uses so contributors aren't misled to the external
`once_cell` crate.
🪄 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: 89a66673-9005-4aa5-b01f-f8cc43df960e
📒 Files selected for processing (23)
.ai-factory/ARCHITECTURE.md.ai-factory/DESCRIPTION.md.ai-factory/RESEARCH.md.ai-factory/ROADMAP.md.ai-factory/plans/feature-K99-msrv-bump-1.95.md.ai-factory/rules/base.md.github/workflows/ci.ymlAGENTS.mdCargo.tomlclippy.tomlcrates/flui-a11y/Cargo.tomlcrates/flui-core/Cargo.tomlcrates/flui-macros/Cargo.tomlcrates/flui-material/Cargo.tomlcrates/flui-navigator/Cargo.tomlcrates/flui-theme/Cargo.tomlcrates/flui-widgets/Cargo.tomldocs/superpowers/specs/2026-05-08-K99-msrv-bump-1.95-design.mdexamples/animation_demo/Cargo.tomlexamples/material_demo/Cargo.tomlexamples/nav_demo/Cargo.tomlrust-toolchain.tomltooling/lock-checks/Cargo.toml
Two valid issues raised by Copilot review on PR #8: 1. **Forward-compat CI job did not actually bypass rust-toolchain.toml.** `rustup default stable` only changes the rustup global default; the repo-local rust-toolchain.toml override still takes precedence when cargo is invoked from inside the repo. So `cargo check` would have continued running on the pinned 1.95 toolchain — defeating the purpose of the forward-compat radar. Fix: set `RUSTUP_TOOLCHAIN=stable` as an env var on the cargo step. This overrides rust-toolchain.toml. Also added a `rustc --version` line right before `cargo check` to confirm the override actually applied (visible in CI logs). Switched the toolchain-install step to `rustup run stable rustc --version` for the same clarity reason. Updated comment block to explain why `rustup default` alone is insufficient. 2. **Invalid std module path `lazy_cell::sync::OnceCell`.** That path doesn't exist in std. The correct std replacements for `once_cell` crate are: - `std::sync::OnceLock` (1.70+) — replaces once_cell::sync::OnceCell - `std::sync::LazyLock` (1.80+) — replaces once_cell::sync::Lazy - `std::cell::OnceCell` (1.70+) — replaces once_cell::unsync::OnceCell - `std::cell::LazyCell` (1.80+) — replaces once_cell::unsync::Lazy The "lazy_cell" name was a feature-gate name during stabilization, not a module path. Leaving the invalid path in idiom-prefer rules would have led future K01 (Provider rewrite) and SF specs to write invalid imports. Fix: replaced all "lazy_cell::sync::OnceCell" mentions across: - AGENTS.md - .ai-factory/rules/base.md - docs/superpowers/specs/2026-05-08-K99-msrv-bump-1.95-design.md And tightened the more general "lazy_cell" mentions for consistency: - .ai-factory/ARCHITECTURE.md (Key Principle #11 idiom list) - .ai-factory/RESEARCH.md (goal statement and Rust 1.95 specifics) - .ai-factory/ROADMAP.md (K99 entry) - .ai-factory/plans/feature-K99-msrv-bump-1.95.md (Unlocked idioms) All references now point to the actual std types. No source code changes; docs + CI workflow only. `cargo fmt --check` remains clean. Refs: GitHub Copilot review on PR #8. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@coderabbitai already fixed in commit Verification on current HEAD (
No further action needed. |
|
Tip For best results, initiate chat on the files or code changes.
If you found this review helpful, would you consider giving us a shout-out on X? Thank you for using CodeRabbit! |
Summary
K99 — first spec in the Phase 0-K Kernel Cleanup critical chain. Turns flui-v2's MSRV declaration from cosmetic (declared 1.85, but only 1/12 workspace members enforced it; CI used
@stable) into a real, enforced invariant pinned to Rust 1.95.This unblocks the rest of the K-track (K15 → K07 → K05 → K01 → K02 → K03 → K04) by making AFIT/RPITIT, edition-2024 lifetime captures, async closures,
let-chains,lazy_cell,unsafe extern, and#[diagnostic::on_unimplemented]available for all subsequent specs.BREAKING CHANGE: minimum Rust toolchain raised from 1.85 → 1.95. Hard-fork posture means we set MSRV unilaterally; no upstream-sync commitment.
What changed
Three-file synchronization invariant established
Cargo.toml[workspace.package].rust-version"1.85"→"1.95"rust-toolchain.tomlchannel = "1.95"for rustup-based contributorsclippy.tomlmsrv = "1.95"so MSRV-aware lints become activeDrift between these three is now documented as a bug.
Per-member MSRV inheritance
11 workspace members previously omitted
rust-version.workspace = true(onlyflui-platformhad it). Added to all of them:flui-a11y,flui-core,flui-macros,flui-material,flui-navigator,flui-theme,flui-widgetsanimation_demo,material_demo,nav_demotooling/lock-checks12/12 workspace members now declare and enforce the MSRV.
CI converted from declarative to enforced
check/clippy/test/format/windows-test-support) keepdtolnay/rust-toolchain@stable— but withrust-toolchain.tomlpresent, that action defers to the pin. These jobs become the de facto MSRV gate.forward-compatjob: explicitly bypasses the toolchain pin viarustup default stable && rustup update, runscargo check --workspaceon latest stable. Markedcontinue-on-error: true— non-blocking early-warning radar for upcoming Rust changes.flake.nix(Nix users) intentionally stays onfenix.latest— complements the CI radar without forcing manual bumps on each MSRV change. Documented inrust-toolchain.tomlheader.Documentation aligned
AGENTS.md— MSRV refs updated; added 7 positive idiom-prefer rules (AFIT/RPITIT, edition-2024 lifetime captures, async closures, let-chains,lazy_cell,unsafe extern,#[diagnostic::on_unimplemented])..ai-factory/{DESCRIPTION,ARCHITECTURE,RESEARCH}.mdand.ai-factory/rules/base.md— MSRV refs aligned, three-file invariant documented, Key Principle #11 in ARCHITECTURE updated.docs/superpowers/specs/2026-05-08-K99-msrv-bump-1.95-design.md(Context / Goals / Non-goals / Design / API surface / Migration / Testing / Open questions / Done criteria / Cross-references / Unblocks)..ai-factory/ROADMAP.md— K99 entry checked off, completion row added (2026-05-08).Why
Per audit recorded in
.ai-factory/RESEARCH.md—flui-corehas 24+ structural issues (broken Provider, no Widget identity /Key,Render::&mut selfsemantics, undefined re-entrancy contract, AppCell, action globals, leaky coordinate-space type-safety, etc.) that block a healthy Framework tier. Phase 0-K Kernel Cleanup repays this debt sequentially. K99 is the first spec because every subsequent K-spec depends on Rust 1.95+ idioms.Cargo.lock policy
FREEZE — no
cargo update.cargo metadataconfirmed the declarative bump did not force any Cargo.lock changes. Dep updates are an orthogonal concern; deferred to a separate hygiene PR if a future need arises. Documented in spec § Migration.tooling/perforphanAudit (Task 2) found
tooling/perf/Cargo.tomldeclaresedition.workspace = truebut is NOT in[workspace] members— orphan with broken inheritance. Out of K99 scope; deferred to K93 (TODO/dead-code triage).docs/superpowers/specs/directory restoredThe previous commit on main (
95cb96e4a9, message: "Remove outdated gesture roadmap and recognizer extension guide") aggressively deleted the entiredocs/superpowers/tree even though the message mentioned only gesture docs. ROADMAP / AGENTS / RESEARCH continued to reference the canonical path. K99 restores the directory by adding the K99 design spec at the documented location.Validation gates
cargo build --workspace --all-featurescargo test --workspacecargo clippy --workspace --all-targets -- -D warningscargo fmt --all -- --checkTest plan
check,clippy,test,format,windows-test-support) passing on Rust 1.95 (viarust-toolchain.tomlpin).forward-compatjob runs on latest stable (currently same as MSRV; will start to diverge with future Rust releases). Allowed to fail.cargo build --workspace --all-featuresgreen on 1.95.cargo test --workspacegreen.cargo clippy --workspace --all-targets -- -D warningsclean.Cargo.tomlfiles haverust-version.workspace = true.Cargo.lockis unchanged (FREEZE policy).Roadmap linkage
K99 in
.ai-factory/ROADMAP.mdPhase 0-K critical chain. Unblocks K15, K07, K05, K01, K02, K03, K04.Spec
docs/superpowers/specs/2026-05-08-K99-msrv-bump-1.95-design.md🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
Chores
rust-toolchain.tomlto pin the Rust toolchain at version 1.95.Tests
forward-compatCI job to detect compatibility issues with the latest stable Rust toolchain.Documentation