Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f80bcf1
docs(ast): bound the attribute-value reach gap
dekobon Nov 6, 2026
472c35d
fix(ci): audit all eight lockfiles with cargo-deny
dekobon Nov 6, 2026
2f980ab
docs(deny): name git deps in the wildcard exemption
dekobon Nov 6, 2026
f2cb74f
docs(nargs): name the average-below-min exception
dekobon Nov 6, 2026
dbfdcbc
docs(book): drop a restating NArgs sentence
dekobon Nov 6, 2026
19dbf0e
perf(ast): read Doxygen conditionals by kind id
dekobon Nov 6, 2026
d65786a
docs(ast): tighten the #1795 comments
dekobon Nov 6, 2026
20775cd
refactor(roles): add owner under / not_under lists
dekobon Nov 6, 2026
8f5bee3
test(roles): pin parent-list rejections in Rust
dekobon Nov 6, 2026
62a4575
fix(find): render nested matches in linear time
dekobon Nov 6, 2026
3e96eb7
refactor: simplify the batch's new code paths
dekobon Nov 6, 2026
d032768
test(dump): pin find's colours and its UTF-8 rule
dekobon Nov 6, 2026
f864093
test(deny): pin the version floor and run steps
dekobon Nov 6, 2026
553334a
test(roles): pin a parent list on a parentless node
dekobon Nov 6, 2026
3ccbb4a
fix: address the batch's whole-branch review
dekobon Nov 6, 2026
135fda7
docs(mutation): name the gates #1794 moved
dekobon Nov 6, 2026
33d7233
docs(changelog): add batch 2026-11-05 entries
dekobon Nov 6, 2026
6a6a453
fix(find): print nested matches whole to 64 levels
dekobon Nov 6, 2026
3c35e9b
fix(perturb): read cargo failures from each target's list
dekobon Nov 6, 2026
f6bed19
feat(perturb): add a unittest runner
dekobon Nov 6, 2026
b7e344f
fix(deny): ban h2 below 0.4.16, which --workspace makes a live guard
dekobon Nov 7, 2026
9bd5f1d
test(nargs): pin the aggregate exception the docs state
dekobon Nov 7, 2026
a237ddc
fix(roles): refuse an empty payer parent list from a fragment too
dekobon Nov 7, 2026
c42a9bb
docs: fixes from the batch's prose and performance reviews
dekobon Nov 7, 2026
f6e0ccf
fix(security): bump actix-http and actix-web past four RUSTSEC adviso…
dekobon Nov 7, 2026
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
4 changes: 2 additions & 2 deletions .bca-baseline.toml
Original file line number Diff line number Diff line change
Expand Up @@ -365,13 +365,13 @@ value = 5.0
path = "big-code-analysis-ast/src/roles/mod.rs"
qualified = "<file>"
metric = "loc.ploc"
value = 920.0
value = 895.0

[[entry]]
path = "big-code-analysis-ast/src/roles/mod.rs"
qualified = "<file>"
metric = "loc.sloc"
value = 2226.0
value = 2250.0

[[entry]]
path = "big-code-analysis-ast/src/tools.rs"
Expand Down
11 changes: 10 additions & 1 deletion .claude/rules/grammar-dispatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,14 @@ rg -n 'ElseIf \{ absent' big-code-analysis-ast/src/roles/*.rs # the co
| the owner is the sole statement of the `else:` block (`else_clause → block → if_statement`, #276) | hand-written gate on the row; the Checker is `Branch ∧ ElseIf`, so the `elif_clause` the row also owns stays false | Python |
| `absent` row — the trait default `false` | — | Elixir (`cond` and nested `if/else`, no chain to collapse) |

A gate that is only the owner's parent kind is not a `fn` at all
since #1794: spell it on the row as `K(under [P, ..])` or
`K(not_under [P, ..])`, which the Python reader and the derived suite
then see. The `ElseIf` family keeps its emitters because their gates
read more than the parent (the clause's previous sibling, the outer
`if`), and because a `fn` stays in cargo-mutants' reach where a row
list does not (`docs/development/mutation_testing.md`).

Two things that list is worth reading for. The dedicated-clause row
exists because some grammars emit an `elif_clause` / `ElsifClause` /
`Elseif` node with no nested `if` to inspect at all — a shape neither
Expand Down Expand Up @@ -192,7 +200,8 @@ deliberate double count is a visible choice at the consumer, never an
accident on the row. The compound-operator case above is still the
consumer's: the row owns `not in` and pays its token, and returning
`Unknown` for the inner `not` *under* the compound is a parent guard
in the classifier, which a row cannot spell.
in the classifier, which a row cannot spell: a payer takes
`under [..]`, never `not_under` (#1794).

## 6. Narrow a dispatch set with a gate, never by deletion

Expand Down
1 change: 1 addition & 0 deletions .claude/rules/macro-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ it. Where each kind of rationale goes:
| --- | --- |
| the grammar fact a row encodes — what the construct's nodes are, how they nest, why an alias is listed or left off | a `//` comment on the line above the row, inside the invocation |
| why a gate exists and what it reads (`gated_by f`, `text_gated_by f`) | the `///` doc on the gate `fn` beside the table |
| why an owner is gated `under [..]` / `not_under [..]` its parents — a gate with no `fn` to carry it | the `//` comment above the row, as the grammar fact it is |
| why a kind the author considered is not on the row | the `excludes [K "why"]` string itself — it is read by the coverage gate and printed with the residue |
| which consumer reads which projection, and why it counts there | at the consumer, in `big-code-analysis` |
| the shape of the macro — what `owns`, `pays`, `opens` mean | `roles/mod.rs` only, never a row comment |
Expand Down
4 changes: 3 additions & 1 deletion .claude/rules/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ corrected under #1539.
(to the second) and size both match. A same-length edit such as `min` →
`max`, restored within the same second, therefore runs stale bytecode on
the next import. In #1562 that produced "isolated test fails, full run
passes" results that described the cache, not the code. Delete the
passes" results that described the cache, not the code. For a `unittest`
subject, `utils/perturb.py`'s `"runner": "unittest"` handles this: every
run reads no existing `.pyc` and writes none. By hand, delete the
module's `__pycache__` before the sweep, then run every step with
`python3 -B` (or `PYTHONDONTWRITEBYTECODE=1`). `-B` stops new writes, but
a `.pyc` written before the sweep is still read.
Expand Down
24 changes: 22 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -675,9 +675,23 @@ jobs:
with:
fetch-depth: 1
submodules: false
- uses: EmbarkStudios/cargo-deny-action@3c6349835b2b7b196a839186cb8b78e02f7b5f25 # v2.1.1
# cargo-deny resolves each graph with `cargo metadata`, so it needs a
# cargo; the action this replaced brought its own in a container.
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # stable tip
with:
toolchain: stable
# 0.20.2 is what `cargo-deny-action` v2.1.1 shipped. install-action
# checks the release tarball against the sha256 in its own manifest,
# which the action's SHA pin fixes. Keep this pin equal to the one in
# deny-advisories.yml; `utils/check-deny-manifests-test.py` fails
# when they differ.
- uses: taiki-e/install-action@86f7a0ffb25f40114606501a311ebcfaf882ea32 # v2.88.0
with:
command: check advisories bans licenses sources
tool: cargo-deny@0.20.2
# Every tracked Cargo.lock, not only the root's (#1823): the seven
# `[workspace].exclude` crates resolve graphs of their own, and until
# this ran per manifest only Scorecard read them, after merge.
- run: ./utils/check-deny-manifests.sh advisories bans licenses sources

license-audit:
name: license-audit
Expand Down Expand Up @@ -944,6 +958,12 @@ jobs:
run: python3 -B utils/check-grammar-build-watch.py
- name: check-grammar-build-watch self-tests (explicit)
run: python3 -B -m unittest -q utils/check-grammar-build-watch-test.py
# The `deny` job runs utils/check-deny-manifests.sh for real (#1823).
# Its self-tests pin what that job cannot show on a green run: every
# manifest and every check is invoked, a ninth lockfile fails, and
# both deny workflows still call the script on one cargo-deny pin.
- name: check-deny-manifests self-tests (explicit)
run: python3 -m unittest -q utils/check-deny-manifests-test.py
# Defensive twin for the grammar-marker-sync gate (#400): bumping
# the notification-only marker in tree-sitter-{mozjs,mozcpp}/
# Cargo.toml without re-running the matching generate-*.sh
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/deny-advisories.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Advisories

# Weekly `cargo-deny check advisories` against the default branch's
# lockfile (#1815).
# Weekly `cargo-deny check advisories` against every lockfile the default
# branch tracks (#1815): the root's and the seven `[workspace].exclude`
# crates', through `utils/check-deny-manifests.sh` (#1823).
#
# The `deny` job in ci.yml runs on push and pull request only, so an
# advisory published between pushes is seen only by Dependabot or the
Expand Down Expand Up @@ -47,6 +48,13 @@ jobs:
fetch-depth: 1
submodules: false
persist-credentials: false
- uses: EmbarkStudios/cargo-deny-action@3c6349835b2b7b196a839186cb8b78e02f7b5f25 # v2.1.1
# The same toolchain, cargo-deny pin and script as ci.yml's `deny`
# job, so the weekly run audits exactly the graphs a pull request
# does. See that job for why each step is there.
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # stable tip
with:
command: check advisories
toolchain: stable
- uses: taiki-e/install-action@86f7a0ffb25f40114606501a311ebcfaf882ea32 # v2.88.0
with:
tool: cargo-deny@0.20.2
- run: ./utils/check-deny-manifests.sh advisories
13 changes: 12 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ repos:
- id: perturb-test
name: perturb-test
language: system
files: '^utils/perturb(-test)?\.py$'
files: '^utils/perturb(-test|_unittest_recorder)?\.py$'
entry: python3 -B -m unittest -q utils/perturb-test.py
pass_filenames: false
- id: coverage-diff-test
Expand Down Expand Up @@ -636,6 +636,17 @@ repos:
entry: python3 -B -m unittest -q utils/check-grammar-build-watch-test.py
pass_filenames: false

# Self-tests for utils/check-deny-manifests.sh, which only the two
# `deny` workflow jobs run for real (#1823). Fires on a lockfile too,
# because a ninth tracked Cargo.lock is what the live-tree case
# exists to catch, and on both workflows, whose wiring it pins.
- id: check-deny-manifests-test
name: check-deny-manifests-test
language: system
files: '^(utils/check-deny-manifests(\.sh|-test\.py)|\.github/workflows/(ci|deny-advisories)\.yml|(.+/)?Cargo\.lock)$'
entry: python3 -m unittest -q utils/check-deny-manifests-test.py
pass_filenames: false

# The `enums/` crate is workspace-excluded, so the workspace
# clippy/test hooks above never touch it. Add a dedicated check
# so warnings here cannot drift (see #164).
Expand Down
34 changes: 25 additions & 9 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ and `cargo run -p big-code-analysis-web --`.
Each gate resolves the repository root from its own location
(`Path(__file__).resolve().parents[1]`) rather than the cwd, so it
runs correctly from anywhere; callers invoke them as `utils/<name>`.
`check-deny-manifests.sh` (#1823) is a gate `make pre-commit` does
not run, because it needs the network: the two `deny` workflow jobs
call it to run cargo-deny once per tracked `Cargo.lock`, and `make
pre-commit` runs only its `*-test.py`, against a stubbed cargo-deny.
`check-grammar-crate.py`, `check-grammars-crates.sh`,
`patch-coverage.py` and `verify-name-only-churn.py` are not gates:
they take their paths as arguments or run against the cwd. Nor are
Expand All @@ -121,7 +125,10 @@ and `cargo run -p big-code-analysis-web --`.
the lesson-102 truncation sweep; `perturb.py` is the
`.claude/rules/testing.md` perturbation driver, which refuses a
target that is modified, untracked, ignored or absent and restores
from memory; `coverage-diff.py` compares two `llvm-cov` reports by
from memory, under a `cargo` or a `unittest` runner — the latter runs
`perturb_unittest_recorder.py` in place of `-m unittest`, unittest's
own `main` recording each outcome as data, since a test can print
anything the report prints; `coverage-diff.py` compares two `llvm-cov` reports by
covered count. The extension tables,
grammar-pin reader, byte-level subprocess capture and manifest
shape the three drift drivers share live in `drift_common.py`,
Expand Down Expand Up @@ -707,14 +714,23 @@ what keeps the job quiet. See

**Advisories** is the fifth
(`.github/workflows/deny-advisories.yml`, #1815): `cargo-deny check
advisories` against `main`'s lockfile every Monday. The `deny` job in
`ci.yml` runs the same check — plus bans, licences and sources, which
do not age — on push, pull request and dispatch, never on a schedule,
so between pushes an advisory is seen by Dependabot or Scorecard or not
at all; a RUSTSEC `unsound` / `unmaintained` entry has no Dependabot
path. A red run is the signal and no issue is filed. The fix is the
same as for a red `deny` job: move the lockfile past the advisory, or
add a documented `ignore` to `deny.toml`.
advisories` every Monday against all eight lockfiles `main` tracks —
the root's and the seven `[workspace].exclude` crates', each a graph of
its own — through `utils/check-deny-manifests.sh` (#1823). The `deny`
job in `ci.yml` runs the same script over the same eight, adding bans,
licences and sources, which do not age, on push, pull request and
dispatch, never on a schedule. So between pushes an advisory is seen by
Dependabot or Scorecard or not at all; a RUSTSEC `unsound` /
`unmaintained` entry has no Dependabot path. A red run is the signal
and no issue is filed. The fix is the same as for a red `deny` job:
move the lockfile past the advisory, or add a documented `ignore` to
`deny.toml`, which is keyed by advisory id and so covers all eight
graphs. The root's graph is rooted at every workspace member
(`--workspace`), not at the `big-code-analysis` package alone. A ninth
tracked lockfile fails the script until its `EXPECTED_LOCKFILES` and
the self-test's `CRATE_DIRS` are raised; an excluded crate that tracks
no lockfile fails `utils/check-excluded-manifests.py` instead, since
the script cannot see a graph with nothing to list.

For snapshot test changes, run `cargo insta test --review` and accept or
reject each snapshot rather than blindly updating files.
Expand Down
90 changes: 88 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ for historical reference.

### Added

- **A weekly `cargo-deny check advisories` run** against `main`'s
lockfile (`.github/workflows/deny-advisories.yml`, #1815). The
- **A weekly `cargo-deny check advisories` run** against every
lockfile `main` tracks (`.github/workflows/deny-advisories.yml`,
#1815; all eight since #1823, under Fixed). The
`deny` job in `ci.yml` runs on push and pull request only, so an
advisory published between pushes was seen by Dependabot or the
Scorecard job or not at all — and a RUSTSEC `unsound` or
Expand Down Expand Up @@ -283,6 +284,35 @@ for historical reference.

### Changed

- **`bca find` elides matches nested past 64 levels on one row**
(#1416). From the 65th level of single-row matches nested in one
another, a match prints `…` in place of each match nested in it,
whose own line prints that text. Above that depth nothing changes:
output is byte-identical to before, colour included, which held for
every file of the serde, pdf.js and DeepSpeech corpora under `-t all`
and `-t call_expression`; their deepest same-row nesting is 42, in
pdf.js. The renderer is reached through two new `#[doc(hidden)]`
re-exports, `dump_found_with_color` and `write_found`, which exist
for the CLI and the scaling bench and are
outside the stability contract (`STABILITY.md`).
- **A `role_table!` owner may carry a parent list** (#1794).
`K(under [P, ..])` admits the owner only under one of the listed
parent kinds and `K(not_under [P, ..])` only under none of them,
read from the walk's ancestor chain. A list fills the owner's one
gate slot, so it excludes `gated_by`, `text_gated_by` and
`holds_payer`; it must name a kind, as a payer's `under [..]` now
must too; it sets `CHAIN_GATED`; and it names kinds it tests rather
than claims, so the three role baselines are unchanged.
`utils/role_tables.py` reads both directions. Five gate fns move onto
their rows: Python's `under_case_clause`, the TypeScript family's
`under_enum_body`, Groovy's `not_in_an_import`, and Java's
`not_a_class_literal` and `not_in_a_directive`. cargo-mutants does
not visit a macro token tree, so the four that were plain fns are no
longer mutation-tested; each moved list was instead flipped and
dropped by `utils/perturb.py` and failed a named test. No output
changes: a drift-oracle sweep over the six languages, 7,028 outputs
in 14 views, found 0 differing for the first four, and the fifth
expands to the parent test its fn spelled.
- **The agent-feedback recipe documents the OpenCode V2 install**
(#1811). The
book had only the legacy V1 example and a pointer to the shipped V2
Expand Down Expand Up @@ -1078,6 +1108,38 @@ for historical reference.

### Fixed

- **`bca find` renders nested matches in linear time** (#1416). Each
match was rendered by its own `dump_node_with_color` call, which
chose its connector by climbing from the root with `Node::parent`:
`O(depth)` per match, 98% of the 397 ms that 4,000 nested Tcl braces
took. Each single-row match also printed its whole span, so a match
nested k deep had its bytes printed k times: 16 MB of output for an
8 KB file. A file's matches now render in one pass, with no parent
climbs, and past 64 levels of nesting a match elides what is nested
in it (see Changed), so that input prints 751 KB and twice the depth
prints twice the output. `make
bench-scaling` prices it with the `find/tcl-nested-braces` probe
beside a `count` control.
- **The `deny` CI job and the weekly advisories run audit all eight
lockfiles** (#1823). Both ran cargo-deny from the repository root
and so read only the root `Cargo.lock`. The seven
`[workspace].exclude` crates (`enums`, `fuzz` and the five vendored
`tree-sitter-*` grammars) each resolve a graph of their own, which
only Scorecard read, on `main`, after merge: RUSTSEC-2026-0374 sat in
`enums/Cargo.lock` that way until #1822.
`utils/check-deny-manifests.sh` now runs cargo-deny once per tracked
`Cargo.lock` against the root `deny.toml`, with `--locked`, and roots
the root's graph at every workspace member (`--workspace`; the
library package alone left 155 of 374 crates unread). It fails when
the tracked count is not eight, and `check-excluded-manifests.py`
fails an excluded crate that tracks no lockfile, so no graph enters
unaudited. Both jobs install cargo-deny 0.20.2 through the SHA-pinned
`taiki-e/install-action`, and the script refuses an older one, since
0.20 moved `--config` to the top level. The new graphs needed three
narrow fixes: `enums` states the repository's MPL-2.0, `fuzz`'s
`libfuzzer-sys` takes a crate-scoped NCSA exception, and
`allow-wildcard-paths` exempts `fuzz`'s version-less path
dependency, which it allows only in `publish = false` crates.
- **`npa` / `npm` (C++, Mozcpp) read the two non-templated
member-pointer spellings the grammars' error recovery misparses**
(#1807). `int S::*getPd();` is a method returning a pointer to a data
Expand Down Expand Up @@ -1642,6 +1704,18 @@ for historical reference.

### Performance

- The Doxygen documentation binding of C, C++, Mozcpp and
Objective-C reads preprocessor conditionals by kind id (#1795).
`preproc_conditional` compared five `kind()` strings, and
`conditional_declares` asked it up to three times of each
non-conditional child. Each dialect now tests its `DocTarget` row's
conditional owners with an `is_preproc_conditional_kind` beside its
table, held to the old names over every runtime id, and each child
is classified once. In `make bench-walk` the two nested-conditional
doc shapes run 24% and 12% faster in all 8 interleaved release
rounds; the real corpus slice is within noise (0.999). Output is
byte-identical: a drift-oracle sweep of 42,728 outputs over the four
dialects found 0 differing.
- `loc`: a file with no `\`-continuation row skips the bare-row scan
(`credit_bare_continuation_rows`) at every node, in every language
that runs it (Bash, Tcl, iRules, C, C++, Mozcpp, Objective-C, Ruby,
Expand Down Expand Up @@ -1672,6 +1746,18 @@ for historical reference.

### Security

- Cleared RUSTSEC-2026-0446, -0448 and -0455 (`actix-http` 3.19.0:
request smuggling through malformed chunked trailers, and two
unbounded-decompression memory exhaustions) and RUSTSEC-2026-0447
(`actix-web` 4.18.1: compressed request bodies exhausting memory
before extractor limits apply) by moving `actix-http` 3.19.0 →
3.20.3 and `actix-web` 4.18.1 → 4.18.2. `brotli` 9.0.0 → 9.1.1 and
`brotli-decompressor` 6.0.1 → 6.3.0 moved with them, and `base64`
0.22.1 left the lockfile; no other package version or checksum did.
All four were red under `cargo-deny check advisories` on `main`,
where the `deny` job and the weekly run had reported them since
their publication; `utils/check-deny-manifests.sh` now passes all
four checks on all eight lockfiles.
- Cleared GHSA-q54r-jf2p-rfr2 (Dependabot alert 90, high) by moving
`gix` 0.89.0 → 0.90.0, with the rest of the gitoxide family
advancing to its latest compatible release in step: 52 gitoxide
Expand Down
Loading
Loading