From 216e4bd48b0f5cef2e140e7bec6b0691761af8e1 Mon Sep 17 00:00:00 2001 From: Riccardo Tacconi Date: Wed, 29 Apr 2026 19:22:15 +0100 Subject: [PATCH] chore: gitignore .cursor/ and drop tracked Cursor rules --- .../rules/git-commit-no-tool-attribution.mdc | 14 -------- .cursor/rules/git-pr-workflow.mdc | 15 -------- .cursor/rules/kcore-console-tui.mdc | 34 ------------------ .cursor/rules/nix-develop-shell.mdc | 36 ------------------- .cursor/rules/non-interactive-automation.mdc | 17 --------- .cursor/rules/rust-quality-checks.mdc | 19 ---------- .gitignore | 6 ++-- 7 files changed, 3 insertions(+), 138 deletions(-) delete mode 100644 .cursor/rules/git-commit-no-tool-attribution.mdc delete mode 100644 .cursor/rules/git-pr-workflow.mdc delete mode 100644 .cursor/rules/kcore-console-tui.mdc delete mode 100644 .cursor/rules/nix-develop-shell.mdc delete mode 100644 .cursor/rules/non-interactive-automation.mdc delete mode 100644 .cursor/rules/rust-quality-checks.mdc diff --git a/.cursor/rules/git-commit-no-tool-attribution.mdc b/.cursor/rules/git-commit-no-tool-attribution.mdc deleted file mode 100644 index 7fe95bd..0000000 --- a/.cursor/rules/git-commit-no-tool-attribution.mdc +++ /dev/null @@ -1,14 +0,0 @@ ---- -description: Keep git commits, PRs, and all output free of editor/AI tool branding -alwaysApply: true ---- - -# No tool attribution — anywhere - -- Do **not** append lines such as `Made-with: Cursor`, `Co-authored-by: Cursor`, `Generated by Cursor`, or similar tool/AI branding to: - - Commit messages - - Pull request titles or bodies - - Code comments - - Documentation - - Any other generated output -- Use factual content only. Never reference the tool that produced the change. diff --git a/.cursor/rules/git-pr-workflow.mdc b/.cursor/rules/git-pr-workflow.mdc deleted file mode 100644 index 3c2ae71..0000000 --- a/.cursor/rules/git-pr-workflow.mdc +++ /dev/null @@ -1,15 +0,0 @@ ---- -description: Never push to main; use pull requests so CI and required checks run before merge -alwaysApply: true ---- - -# Git workflow — pull requests, not direct pushes to `main` - -- Do **not** push to the default branch (`main`). Never run `git push origin main`, `git push --set-upstream origin main` while on `main`, or equivalent that updates `origin/main` directly. -- Ship changes by pushing a **feature branch** and opening a **pull request** into `main` so repository quality checks (CI, required reviews, Semgrep, etc.) run before merge. -- When asked to land work: create or use a branch such as `fix/…` or `feat/…`, commit there, `git push -u origin `, then create the PR (`gh pr create --base main …` or the GitHub UI). Do not merge locally into `main` and push unless the user explicitly overrides this rule for an emergency. - -## Examples - -- Good: `git checkout -b fix/issue-123 && git push -u origin fix/issue-123` → open PR targeting `main`. -- Bad: committing on `main` and `git push origin main`. diff --git a/.cursor/rules/kcore-console-tui.mdc b/.cursor/rules/kcore-console-tui.mdc deleted file mode 100644 index aff0154..0000000 --- a/.cursor/rules/kcore-console-tui.mdc +++ /dev/null @@ -1,34 +0,0 @@ ---- -description: Standards for the Rust Ratatui appliance console -globs: crates/kcore-console/**/*.rs,modules/kcore-branding.nix,packaging/systemd/kcore-console.service,docs/appliance-console.md,docs/user/appliance-console.md -alwaysApply: false ---- - -# kcore Console TUI - -The local appliance console is a Rust TUI in `crates/kcore-console` using -Ratatui with the crossterm backend. Keep it product-grade and read-only: - -- Production mode must never expose a shell. `q`, `Esc`, and `Ctrl+C` must not - exit in default mode; only `--dev` may exit interactively. -- Inventory collection must not block rendering. Use a worker/thread/channel or - another non-blocking path for NIC, disk, API, and diagnostics refresh. -- Treat missing host data as normal. Display `—` instead of panicking or leaving - empty cells for unavailable sysfs, `ip`, `lsblk`, API, or systemd data. -- Keep UI code separate from collection code: `ui/` renders `AppState`; - `inventory/` reads Linux/API state; `app.rs` owns navigation and selection. -- Use Ratatui widgets (`Block`, `Paragraph`, `Table`, `Tabs`, `List`, `Gauge` - when useful) and keep the visual language dark, clean, and appliance-like. -- If changing `modules/kcore-branding.nix`, verify gettys and `autovt@` remain - disabled so `tty2`-`tty6` cannot show login prompts. -- Add or update focused tests for parsing, formatting, navigation, and - production-vs-dev exit policy whenever behavior changes. - -Before shipping a console change, run at least: - -```bash -nix develop -c cargo fmt -nix develop -c cargo test -p kcore-console -nix develop -c cargo clippy -p kcore-console --all-targets -- --deny warnings -nix build .#kcore-console -``` diff --git a/.cursor/rules/nix-develop-shell.mdc b/.cursor/rules/nix-develop-shell.mdc deleted file mode 100644 index 3a44c01..0000000 --- a/.cursor/rules/nix-develop-shell.mdc +++ /dev/null @@ -1,36 +0,0 @@ ---- -description: Run dev tools (cargo, gh, nixfmt, kani, etc.) inside `nix develop` so PATH resolves -alwaysApply: true ---- - -# Use `nix develop` for all dev tooling - -This repository pins its developer toolchain in `flake.nix`. The host shell does -**not** have `cargo`, `rustc`, `gh`, `nixfmt`, `cargo-audit`, `cargo-kani`, -`grpcurl`, `protoc`, `cloud-hypervisor`, `statix`, or `deadnix` on `PATH`. - -For any command that needs one of those, prefix it with `nix develop --command` -(or run it from inside an interactive `nix develop` shell): - -```bash -nix develop --command cargo test --workspace -nix develop --command cargo clippy --all-targets -- --deny warnings -nix develop --command gh pr list -nix develop --command gh pr create --base main --head fix/foo --title "…" --body "…" -nix develop --command nixfmt --check $(find . -name '*.nix' -not -path './result*') -``` - -Do **not** assume a missing binary means it is uninstalled — check with -`nix develop --command which ` first. Notably: - -- `gh` (GitHub CLI) **is** in the dev shell. Use it from `nix develop` for PRs, - issues, checks, and reviews instead of falling back to manual web URLs. -- `cargo`, `cargo-audit`, `cargo-kani`, `nixfmt`, `protoc`, `grpcurl`, - `cloud-hypervisor`, `statix`, `deadnix` are also dev-shell-only. - -Pre-commit and pre-push git hooks already wrap themselves in `nix develop`, so -manual `git commit` / `git push` work from the host shell. But anything you run -yourself (tests, linters, gh, …) must go through the dev shell. - -If a one-off `Shell` invocation fails with `command not found`, retry with -`nix develop --command …` before concluding the tool is missing. diff --git a/.cursor/rules/non-interactive-automation.mdc b/.cursor/rules/non-interactive-automation.mdc deleted file mode 100644 index e6732c2..0000000 --- a/.cursor/rules/non-interactive-automation.mdc +++ /dev/null @@ -1,17 +0,0 @@ ---- -description: Require non-interactive behavior for automation and installer scripts -alwaysApply: true ---- - -# Non-Interactive Automation Scripts - -When writing or editing automation, installer, or provisioning scripts: - -- Do not require interactive input (`read`, prompts, confirmations) in default execution paths. -- Prefer explicit non-interactive flags and defaults (for example `--yes`, `--non-interactive`, `--force`). -- Use bounded waits/timeouts for potentially blocking commands (for example `timeout 120s ...`). -- Fail fast with clear error messages and non-zero exit codes when prerequisites are missing. -- Keep scripts idempotent where practical; safely handle partially applied prior runs. -- Log major phases and exact failing step to aid remote debugging. - -If an interactive path is needed for local/manual use, gate it behind an explicit flag and keep automation mode non-interactive. diff --git a/.cursor/rules/rust-quality-checks.mdc b/.cursor/rules/rust-quality-checks.mdc deleted file mode 100644 index bd27e73..0000000 --- a/.cursor/rules/rust-quality-checks.mdc +++ /dev/null @@ -1,19 +0,0 @@ ---- -description: Run Rust and Nix quality checks after edits to catch CI issues locally -alwaysApply: true ---- - -# Rust & Nix quality checks - -After making substantive edits to Rust (`.rs`) or Nix (`.nix`) files, run the following checks **before committing**: - -1. **Rust formatting**: `cargo fmt` (auto-fix) or `cargo fmt --check` (verify). -2. **Clippy**: `cargo clippy --all-targets -- --deny warnings` — treat all warnings as errors. -3. **Nix formatting**: `find . -name '*.nix' -not -path './result*' -exec nixfmt {} +` (auto-fix) or with `--check` (verify). -4. **Tests**: `cargo test --workspace`. - -The shortcut `make check` runs clippy + fmt + audit + lint-nix in one command. - -- Fix any clippy warnings immediately rather than suppressing them, unless the lint is a false positive on a framework pattern (e.g. `result_large_err` on gRPC handlers returning `tonic::Status`). -- Never commit code that fails `cargo fmt --check` or `nixfmt --check`. -- Git hooks in `scripts/hooks/` enforce formatting on pre-commit and clippy+tests on pre-push. They are installed automatically when entering `nix develop`. diff --git a/.gitignore b/.gitignore index 6f85a0e..d7626e6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ -/.cursor/* -!/.cursor/rules/ -!/.cursor/rules/** +# Cursor IDE: agent rules and local IDE config (not shared via git) +.cursor/ + /target /result /result-*