Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ split-debuginfo = "unpacked"
t = "nextest run --no-capture"
qt = "nextest run --no-fail-fast --no-capture"
ci = "nextest run --profile ci --no-capture"
c = "clippy --all-targets"
c = "clippy --all-targets --features tokio,json"
b = "build --all-targets"
2 changes: 1 addition & 1 deletion .cursorrules
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## Quick Commands

```bash
cargo fmt && cargo clippy --all-targets && cargo nextest run
cargo fmt && cargo clippy --all-targets --features tokio,json && cargo nextest run

# Or use the convenient aliases defined in .cargo/config.toml
cargo c && cargo t
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/welcome.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ echo ""
echo " Auditing & Quality:"
echo " cargo audit # Security vulnerability check"
echo " cargo deny check # License/dependency check"
echo " cargo clippy --all-targets # Linting"
echo " cargo clippy --all-targets --features tokio,json # Linting"
echo " cargo shear # Unused dependency detection"
echo " cargo spellcheck # Documentation spelling"
echo " cargo geiger # Unsafe code audit"
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
- No `panic!()` or `todo!()`
- All fallible operations return `Result`
- [ ] I have added tests that prove my fix is effective or my feature works
- [ ] I have run `cargo fmt && cargo clippy --all-targets` with no warnings
- [ ] I have run `cargo fmt && cargo clippy --all-targets --features tokio,json` with no warnings
- [ ] I have run `cargo nextest run` and all tests pass

### If Applicable
Expand Down
36 changes: 8 additions & 28 deletions .github/workflows/ci-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,12 @@ on:
- '**.rs'
- 'docs/**'
- 'wiki/**'
- 'scripts/sync-wiki.py'
- 'scripts/check-wiki-consistency.py'
- 'scripts/validate-wiki-output.py'
- 'scripts/tests/test_sync_wiki.py'
- 'scripts/tests/test_check_wiki_consistency.py'
- 'scripts/**'
- '.markdownlint.json'
- '.markdown-link-check.json'
- '.lychee.toml'
- '.vale.ini'
- '.vale/**'
- 'scripts/check-links.sh'
- 'scripts/verify-markdown-code.sh'
- 'scripts/check-code-fence-syntax.sh'
- '.github/workflows/ci-docs.yml'
pull_request:
branches: [main]
Expand All @@ -29,19 +22,12 @@ on:
- '**.rs'
- 'docs/**'
- 'wiki/**'
- 'scripts/sync-wiki.py'
- 'scripts/check-wiki-consistency.py'
- 'scripts/validate-wiki-output.py'
- 'scripts/tests/test_sync_wiki.py'
- 'scripts/tests/test_check_wiki_consistency.py'
- 'scripts/**'
- '.markdownlint.json'
- '.markdown-link-check.json'
- '.lychee.toml'
- '.vale.ini'
- '.vale/**'
- 'scripts/check-links.sh'
- 'scripts/verify-markdown-code.sh'
- 'scripts/check-code-fence-syntax.sh'
- '.github/workflows/ci-docs.yml'
workflow_dispatch:

Expand Down Expand Up @@ -174,10 +160,10 @@ jobs:
run: python scripts/check-wiki-consistency.py

# ============================================================================
# WIKI SYNC DRY-RUN - Validate wiki generation on PRs
# SCRIPT TESTS & WIKI DRY-RUN - Run all script tests and validate wiki generation
# ============================================================================
wiki-sync-dry-run:
name: Wiki Sync Dry-Run
name: Script Tests & Wiki Dry-Run
runs-on: ubuntu-latest

steps:
Expand All @@ -188,17 +174,11 @@ jobs:
with:
python-version: '3.12'

- name: Install pytest
run: pip install pytest
- name: Install test dependencies
run: pip install pytest pyyaml

- name: Run wiki sync tests
run: python -m pytest scripts/tests/test_sync_wiki.py -v

- name: Run wiki validation tests
run: python -m pytest scripts/tests/test_validate_wiki_output.py -v

- name: Run wiki consistency tests
run: python -m pytest scripts/tests/test_check_wiki_consistency.py -v
- name: Run script tests
run: python -m pytest scripts/tests/ -v

- name: Generate wiki (dry-run)
run: python scripts/sync-wiki.py --dest wiki-test-output
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ jobs:
run: cargo fmt --check

- name: Run clippy
run: cargo clippy --all-targets -- -D warnings
run: cargo clippy --all-targets --features tokio,json -- -D warnings

# Miri undefined behavior check (cross-platform, optimized)
#
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-safety.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ jobs:
# Run clippy with nursery lints enabled
# These are experimental but useful for catching additional issues
# Lints from Cargo.toml are already applied; here we add nursery
cargo clippy --all-targets -- \
cargo clippy --all-targets --features tokio,json -- \
-D warnings \
-W clippy::nursery \
-A clippy::significant_drop_tightening \
Expand Down Expand Up @@ -462,7 +462,7 @@ jobs:
# - clippy::unimplemented: unimplemented!() macros
# - clippy::unreachable: unreachable!() macros
# - clippy::indexing_slicing: unchecked array/slice indexing
if cargo clippy --lib -- \
if cargo clippy --lib --features tokio,json -- \
-D clippy::panic \
-D clippy::unwrap_used \
-D clippy::expect_used \
Expand Down Expand Up @@ -552,7 +552,7 @@ jobs:
echo "- Review any warnings in the individual job logs"
echo "- Replace \`.unwrap()\` with proper error handling where possible"
echo "- Ensure all \`panic!\` calls are intentional and documented"
echo "- Run \`cargo clippy --all-targets\` locally before pushing"
echo "- Run \`cargo clippy --all-targets --features tokio,json\` locally before pushing"
} >> "$GITHUB_STEP_SUMMARY"

- name: Check for critical failures
Expand Down
10 changes: 5 additions & 5 deletions .llm/context.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
## Quick Commands

```bash
cargo fmt && cargo clippy --all-targets && cargo nextest run --no-capture # Pre-commit
cargo fmt && cargo clippy --all-targets --features tokio,json && cargo nextest run --no-capture # Pre-commit
cargo c && cargo t # Aliases from .cargo/config.toml
typos # Spell check (CI enforced)
cargo test --features z3-verification -- --nocapture # Z3 proofs (slow)
Expand Down Expand Up @@ -197,15 +197,15 @@ Consolidate integration tests into a single crate (`tests/it/main.rs`). Anti-pat

## Mandatory Linting

- **After Rust changes:** `cargo fmt && cargo clippy --all-targets` (or `cargo c`)
- **After Rust changes:** `cargo fmt && cargo clippy --all-targets --features tokio,json` (or `cargo c`)
- **After workflow changes:** `actionlint` (no exceptions)
- **After doc changes:** `cargo doc --no-deps`
- **After markdown changes:** `npx markdownlint 'file.md' --config .markdownlint.json --fix`
- **After `.llm/` changes:** All `.md` files under `.llm/` must be **300 lines or fewer** (enforced by pre-commit hook `llm-line-limit`)
- **Link validation:** `./scripts/check-links.sh`
- **Spell check:** `typos`
- **Vale (advisory):** `vale docs/` -- checks prose quality, non-blocking in CI
- **Full pre-commit:** `cargo fmt && cargo clippy --all-targets && cargo nextest run --no-capture`
- **Full pre-commit:** `cargo fmt && cargo clippy --all-targets --features tokio,json && cargo nextest run --no-capture`

## Skill Code Examples

Expand Down Expand Up @@ -236,7 +236,7 @@ When changing public APIs, update: rustdoc comments (source of truth), README.md
## Quality Checklist

- [ ] `cargo fmt` run
- [ ] `cargo clippy --all-targets` passes
- [ ] `cargo clippy --all-targets --features tokio,json` passes
- [ ] All tests pass (`cargo nextest run`)
- [ ] Tests for new functionality included
- [ ] Rustdoc comments with examples
Expand All @@ -248,7 +248,7 @@ When changing public APIs, update: rustdoc comments (source of truth), README.md

## For Agents

When spawning sub-agents or using Task tools: the sub-agent MUST run `cargo fmt` and verify `cargo clippy --all-targets` passes on any modified files. If the sub-agent cannot run these, the parent agent must run them after receiving changes.
When spawning sub-agents or using Task tools: the sub-agent MUST run `cargo fmt` and verify `cargo clippy --all-targets --features tokio,json` passes on any modified files. If the sub-agent cannot run these, the parent agent must run them after receiving changes.

---

Expand Down
1 change: 1 addition & 0 deletions .llm/skills/async-rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ Use bounded channels (`mpsc::channel(100)`) to prevent memory exhaustion. Never

| Pitfall | Fix |
|---------|-----|
| `#[track_caller]` on `async fn` | Not supported; extract a sync helper or remove the attribute |
| `std::thread::sleep` in async | `tokio::time::sleep().await` |
| Forgetting to `.await` futures | Futures are lazy -- nothing happens without await |
| `std::sync::Mutex` held across `.await` | Use `tokio::sync::Mutex` or release before await |
Expand Down
4 changes: 2 additions & 2 deletions .llm/skills/ci-debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
| Error Pattern | Category | Quick Fix |
|---------------|----------|-----------|
| `cargo fmt --check` fails | Formatting | `cargo fmt` |
| Clippy warnings | Linting | `cargo clippy --fix --allow-dirty` |
| Clippy warnings | Linting | `cargo clippy --all-targets --features tokio,json --fix --allow-dirty` |
| Test assertion failures | Test logic | `RUST_BACKTRACE=1 cargo test name -- --nocapture` |
| `VERIFICATION RESULT: FAILURE` | Kani | Verify assertion matches impl; add `#[kani::unwind(N)]` |
| `linker cc not found` | Cross-compilation | Check Cross.toml, avoid unstable image tags |
Expand All @@ -34,7 +34,7 @@ cat .github/workflows/ci-*.yml | grep "run:"

# Common reproductions
cargo fmt --check
cargo clippy --all-targets -- -D warnings
cargo clippy --all-targets --features tokio,json -- -D warnings
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps
cargo nextest run test_name --no-capture
cargo kani --harness proof_function_name
Expand Down
6 changes: 3 additions & 3 deletions .llm/skills/refactoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@

```bash
# Pre-refactoring
cargo nextest run && cargo clippy --all-targets
cargo nextest run && cargo clippy --all-targets --features tokio,json

# After each change
cargo check && cargo nextest run

# Post-refactoring
cargo fmt && cargo clippy --all-targets && cargo nextest run
cargo fmt && cargo clippy --all-targets --features tokio,json && cargo nextest run
rg "unwrap\(\)|expect\(|panic!\(|todo!\(" src/
```

Expand Down Expand Up @@ -77,7 +77,7 @@ rg "unwrap\(\)|expect\(|panic!\(|todo!\(" src/

### Pre-Refactoring
- [ ] Tests pass: `cargo nextest run`
- [ ] No clippy warnings: `cargo clippy --all-targets`
- [ ] No clippy warnings: `cargo clippy --all-targets --features tokio,json`
- [ ] Git commit current changes

### Post-Refactoring
Expand Down
5 changes: 5 additions & 0 deletions .llm/skills/rust-pitfalls.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ Use `ok_or_else(|| ...)` when error construction allocates or is expensive. Use
- **`#[serde(default)]` on required fields:** Silently accepts missing data.
- **Enum representation:** Default serializes as `{"Active": null}`. Use `#[serde(rename_all = "snake_case")]`.

## Async Pitfalls

- **`#[track_caller]` on `async fn`:** Not supported by Rust. The attribute is silently ignored or triggers a clippy warning/error. Extract a sync helper that carries `#[track_caller]` and call it from the async fn, or remove the attribute entirely. A pre-commit grep hook catches this.

## Testing Pitfalls

- **Tests pass on panic:** Function panics before assertion is reached. Use `#[should_panic]` or `catch_unwind`.
Expand Down Expand Up @@ -135,3 +139,4 @@ Proofs must verify what they claim. If name says "independent", actually test mo
- [ ] `std::` types in loom tests
- [ ] `ok_or` vs `ok_or_else` for allocating errors
- [ ] Pattern matching: `match` not `if let` when fallback needs value
- [ ] `#[track_caller]` on async fn (not supported)
Loading
Loading