Skip to content

Commit baba4a0

Browse files
committed
fix(ci): pin rust-toolchain to 1.92.0 matching rust-toolchain.toml
1 parent 08f1c73 commit baba4a0

2 files changed

Lines changed: 60 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
- name: Install Rust
8888
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # stable
8989
with:
90-
toolchain: stable
90+
toolchain: "1.92.0"
9191

9292
- name: Cache Cargo
9393
uses: actions/cache@v5
@@ -142,7 +142,7 @@ jobs:
142142
- name: Install Rust
143143
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # stable
144144
with:
145-
toolchain: stable
145+
toolchain: "1.92.0"
146146

147147
- name: Cache Cargo
148148
uses: actions/cache@v5

QA.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,61 @@
161161
`Vec<(PathBuf, String)>` BEFORE applying the cap) and tree-sitter
162162
parse trees, NOT lexical similarity. Lexical fixes only show up on
163163
repos with many fragments + dense term overlap.
164+
165+
## Local pre-commit Environment
166+
167+
- Repo uses `.venv/bin/python`. `pip install -e .` and `maturin develop`
168+
must be invoked via `python -m pip` and `python -m maturin` (or after
169+
`source .venv/bin/activate`); `maturin` from homebrew installs into the
170+
wrong env and `_diffctx` won't be importable
171+
- `import-linter` pre-commit hook depends on `treemapper` being importable
172+
from the venv — requires `_diffctx` to be built (`maturin develop --release
173+
--features python`). Don't `SKIP=lint-imports` — fix the env.
174+
- `name-tests-test` hook treats every `tests/**/*.py` as a candidate test
175+
and demands `test_*.py` naming. Add fixture dirs to its `exclude:` regex
176+
in `.pre-commit-config.yaml`. Currently excluded: `diffctx/tests/fixtures/garbage/.*\.py`
177+
178+
## Cargo features and `dep:` syntax
179+
180+
- Optional tree-sitter grammars are split into `lang-core` (top-15) and
181+
`lang-extra` (long-tail) features in `diffctx/Cargo.toml`. Default is
182+
`["lang-core", "lang-extra"]` so `cargo build` is unchanged
183+
- **WATCH OUT**: `feature = ["dep:tree-sitter-X"]` SUPPRESSES the auto-feature
184+
named `tree-sitter-X`. `#[cfg(feature = "tree-sitter-X")]` will then
185+
evaluate to false and the language won't load. Use bare names without
186+
`dep:` so the auto-feature is preserved
187+
- Adding a new grammar: bump optional dep in `[dependencies]`, append to the
188+
matching feature list (`lang-core` or `lang-extra`) WITHOUT `dep:` prefix,
189+
add `#[cfg]`-gated insert in `tree_sitter_strategy.rs::LANGUAGE_CACHE`
190+
191+
## actionlint context restrictions
192+
193+
- `${{ env.X }}` is BANNED inside `env:` blocks at any level (workflow, job,
194+
step). Available contexts inside `env:` are: github, inputs, matrix,
195+
needs, secrets, vars
196+
- Fix: inline literal values, or read `$X` from shell scripts in `run:` (the
197+
surrounding env vars from outer scope are inherited as shell vars)
198+
199+
## SonarCloud exclusions
200+
201+
- `sonar.exclusions=diffctx/tests/fixtures/garbage/**` — fixture files
202+
intentionally have unused params (S1172) and dead code; they simulate
203+
"fake real code" as negative-test distractors
204+
205+
## Cognitive Complexity Backlog
206+
207+
`python:S3776` issues that cross the 15 threshold and weren't refactored in
208+
this QA pass (touching benchmark code = regression risk on v1 results):
209+
210+
- `benchmarks/baselines/aider_baseline.py:112` (28→15)
211+
- `benchmarks/baselines/aider_baseline.py:135` (23→15)
212+
- `benchmarks/baselines/bm25_baseline.py:41` (32→15)
213+
- `benchmarks/aggregate_sweep.py:100` (23→15)
214+
- `benchmarks/adapters/multi_swebench.py:100` (17→15)
215+
- `benchmarks/diffctx_eval_fn.py:70` (18→15)
216+
- `benchmarks/adapters/evaluator.py:49` (32→15)
217+
- `scripts/bake_bench_cache.py:72` (16→15)
218+
219+
Tactic from earlier passes (already in this file): extract `_collect_result`
220+
helpers and `_print_*_header`/`_print_*_dump` blocks. Pair with v2 evaluation
221+
re-run so any drift is caught.

0 commit comments

Comments
 (0)