chore: debt cleanup — app layer, keymap, CI tooling - #109
Conversation
Reviewer's GuideMaintainability-focused cleanup across CI workflows, Cargo configuration, app state types, keymap tests, and documentation/comments, with no functional behavior changes but added invariants and clearer configuration rationale. Sequence diagram for updated user menu loading error handlingsequenceDiagram
actor Caller
participant user_menu
participant paths
Caller->>user_menu: load_menu_with_warnings(panel_dir, filename)
user_menu->>paths: user_menu_path()
paths-->>user_menu: global
user_menu->>user_menu: locate_menu_file_with_global(panel_dir, global.as_deref())
alt menu_found
user_menu-->>Caller: Ok(LoadedMenu)
else menu_not_found
user_menu->>user_menu: format("No user menu file found (searched: {}/.mc.menu, {})")
user_menu-->>Caller: Err(String)
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The
keybindings_are_grouped_by_modetest can be simplified and made more efficient by tracking the last seen mode and a set of completed modes rather than repeatedly callingcontainson aVec, which would more directly express the "no mode may reappear after a different mode" invariant. - The error message construction in
load_menu_with_warningsnow has a small block of logic to deriveglobal_display; if similar messaging is needed elsewhere, consider extracting this into a helper to avoid duplicating the(no global menu path configured)handling.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `keybindings_are_grouped_by_mode` test can be simplified and made more efficient by tracking the last seen mode and a set of completed modes rather than repeatedly calling `contains` on a `Vec`, which would more directly express the "no mode may reappear after a different mode" invariant.
- The error message construction in `load_menu_with_warnings` now has a small block of logic to derive `global_display`; if similar messaging is needed elsewhere, consider extracting this into a helper to avoid duplicating the `(no global menu path configured)` handling.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Greptile SummaryThis PR performs application-layer and CI maintenance without changing normal application behavior.
Confidence Score: 4/5The release concurrency behavior should be fixed before merging because moving a tag during an active run can publish binaries from the superseded commit. Same-tag runs are serialized while the older run is allowed to finish, so it can publish artifacts built from the old tag event before the updated run starts. Files Needing Attention: .github/workflows/release.yml
|
| Filename | Overview |
|---|---|
| .github/workflows/release.yml | Adds timeouts and same-tag serialization, but retaining obsolete runs can publish stale artifacts after a tag is moved. |
| .github/workflows/rust.yml | Adds ref-scoped cancellation, a job timeout, and explicit Bash shells without an identified correctness issue. |
| Cargo.toml | Updates package exclusions and release panic behavior; no actionable regression was established. |
| src/app/types/app_state.rs | Replaces the manual UiState default with an equivalent derived implementation. |
| src/app/user_menu.rs | Preserves menu lookup semantics while reporting the actual configured global menu path. |
| src/app/keymap.rs | Adds a test enforcing the mode-contiguity invariant required by help generation. |
Reviews (1): Last reviewed commit: "chore: debt — app types, keymap, CI time..." | Re-trigger Greptile
|
|
||
| concurrency: | ||
| group: release-${{ github.ref }} | ||
| cancel-in-progress: false |
There was a problem hiding this comment.
|
I've completed a thorough review. Here is my assessment. Review SummaryOverall: High-quality, well-scoped debt cleanup. Approve. All CI gates verified green locally: Verified Correct (no issues)
opencode.yml trigger removal — Correct. The removed Minor Observation (non-blocking)
Rust Best Practices & Conventions
No bugs, no quality concerns, no convention violations found. |
concurrency cancel-in-progress: false let an obsolete run finish and publish stale binaries when a tag is force-moved. flip to true so the newer tag push cancels the older run. Fixes Greptile P1 on PR #109.
ReviewI independently verified the diff (built, ran the new test, One real issue — orphaned function (created by this PR)The
Since it's One latent footgun — worth a comment, not a code change
However, with abort semantics On the other reviewers' comments
Verified correct (no concerns)
Recommendation: merge after addressing the orphaned |


Summary
Maintainability debt cleanup (audit PR-18). No behavior changes. All CI gates pass:
cargo fmt,cargo clippy --locked --all-targets -- -D warnings,cargo test --locked(302 passed),cargo build --release --locked.Fixed (14 findings)
CI workflows
timeout-minutes: 10to the review job.issue_comment/pull_request_review_commenttriggers (the job-levelif: github.event_name == 'pull_request'guaranteed they could never fire) and the now-redundant guard.concurrency: release-${{ github.ref }}group to prevent racing release runs on retags.timeout-minutes: 30(build) andtimeout-minutes: 10(release).shell: bashto allrun:steps.concurrency: rust-${{ github.ref }}withcancel-in-progress: true.Cargo.toml
panic = "abort"to[profile.release](nocatch_unwindin production code; test-only usage runs under dev profile).excludeto includedocs/.App types / keymap
DefaultonMenuSource(Global), replacedUiState's 22-line hand-writtenDefaultwith a derive.keybindings_are_grouped_by_modecontiguity test: fails if a binding is added out of mode-group order, preventing duplicated/interspersed headers in help output.CompareMode::ALLdrift-guard comment (variant_count is still unstable as of 1.95; magic number retained with explanation).Docs / comments
sanitize_for_displaycomment (used in production, not test-only).~/.config/lc/menuerror message to render the actualpaths::user_menu_path().Deferred (51 findings)
Deferred by category:
Total: 65 findings — 14 fixed, 51 deferred.
Summary by Sourcery
Clean up maintainability debt across the app layer, keymap tests, configuration, and CI workflows without changing runtime behavior.
Bug Fixes:
Enhancements:
Build:
CI:
Documentation:
Tests: