diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
index 6a8633c7..084e6cae 100644
--- a/.devcontainer/Dockerfile
+++ b/.devcontainer/Dockerfile
@@ -1,6 +1,7 @@
-# Dev container matching CI (GitHub Actions ubuntu-22.04-8-cores + dtolnay/rust-toolchain@stable)
-# Pin Rust to match CI's stable channel — this is the critical version.
-# 1.96.0 = current stable on the CI runners; 1.94 fails the workspace build
+# Dev container matching CI (.github/workflows/ci.yml — every job runs on
+# ubuntu-24.04, or vars.BIG_RUNNER, with dtolnay/rust-toolchain@stable).
+# CI resolves `stable` at run time; this image pins the concrete release so a
+# container rebuild is reproducible. 1.94 fails the workspace build
# (sysinfo 0.39.3 requires rustc >= 1.95).
FROM rust:1.96.0-bookworm
@@ -29,28 +30,41 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libdbus-1-3 \
&& rm -rf /var/lib/apt/lists/*
-# Python 3.12 (matches CI: actions/setup-python@v5 with python-version: "3.12")
+# Python. CI pins 3.12 (actions/setup-python@v6 with python-version: "3.12");
+# this base image is Debian bookworm, whose `python3` is 3.11. That is the one
+# knowingly unsynced version here — the interpreters are NOT identical, so a
+# green container run is not proof of the CI matrix.
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
python3-pip \
python3-venv \
&& rm -rf /var/lib/apt/lists/*
-# Node 20 (matches CI: actions/setup-node@v4 with node-version: 20)
-RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
- && apt-get install -y --no-install-recommends nodejs=20.* \
+# Node 22 (matches CI: actions/setup-node@v6 with node-version 22.x in the
+# `VS Code Extension` and `Shipwright Binary Gate` jobs — the ones this container
+# reproduces through `make test` / `make build`. Only the website-build job,
+# which this image does not run, pins Node 20.)
+RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
+ && apt-get install -y --no-install-recommends nodejs=22.* \
&& rm -rf /var/lib/apt/lists/*
-# Rust components (matches CI: dtolnay/rust-toolchain@stable with components)
-RUN rustup component add rustfmt clippy
+# Rust components + targets (matches CI: dtolnay/rust-toolchain@stable with
+# `rustfmt, clippy` in Lint, `llvm-tools-preview` in Rust Tests & Coverage — the
+# component cargo-llvm-cov needs — and the wasm32-wasip2 target in Zed Extension)
+RUN rustup component add rustfmt clippy llvm-tools-preview \
+ && rustup target add wasm32-wasip2
# Rust cargo tools (pinned)
RUN cargo install cargo-llvm-cov --version 0.8.4 --locked \
&& cargo install cargo-audit --version 0.22.2 --locked
# Python packages (pinned — ruff MUST match CI and the ruff_* crate tag in
-# Cargo.toml: pip install debugpy ruff==0.15.17)
-RUN pip install --break-system-packages debugpy==1.8.14 ruff==0.15.17
+# Cargo.toml). pytest drives the Neovim e2e harness (scripts/test-nvim.sh) and is
+# pinned to CI's version; jinja2/markdown/tomlkit are the REAL python/typing
+# conformance harness's own runtime deps, installed unpinned exactly as CI does.
+RUN pip install --break-system-packages \
+ debugpy==1.8.14 ruff==0.15.17 pytest==9.1.1 \
+ jinja2 markdown tomlkit
# GitHub CLI (for PR creation, issue management)
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \
@@ -66,15 +80,50 @@ RUN curl -fsSL https://raw.githubusercontent.com/nektos/act/master/install.sh |
# Claude Code CLI
RUN npm install -g @anthropic-ai/claude-code
+# Lua coverage for the Neovim suite. CI runs `luarocks install --local luacov`
+# into the runner's HOME; installing it system-wide here puts it on the default
+# LUA_PATH, so `make _test_nvim` finds it without an `eval "$(luarocks path)"`.
+RUN apt-get update && apt-get install -y --no-install-recommends luarocks \
+ && luarocks install luacov \
+ && rm -rf /var/lib/apt/lists/*
+
# Match CI environment variables
ENV CARGO_TERM_COLOR=always
ENV RUSTFLAGS="-D warnings"
-# Create a non-root user so Claude Code can use --dangerously-skip-permissions
+# Create a non-root user so Claude Code can use --dangerously-skip-permissions.
+# It is created BEFORE the Homebrew bootstrap below because Homebrew refuses to
+# install as root and its installer expects passwordless sudo.
RUN useradd -m -s /bin/bash -u 1000 dev \
&& mkdir -p /workspace \
- && chown -R dev:dev /workspace /usr/local/cargo /usr/local/rustup
+ && chown -R dev:dev /workspace /usr/local/cargo /usr/local/rustup \
+ && apt-get update \
+ && apt-get install -y --no-install-recommends sudo git procps file build-essential \
+ && echo 'dev ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/dev \
+ && chmod 0440 /etc/sudoers.d/dev \
+ && rm -rf /var/lib/apt/lists/*
USER dev
+# Homebrew — the package manager scripts/install-deslop.sh drives, and the one
+# the CI Lint job uses to install the deslop gate. That script relies on the
+# runner already having brew; a Debian image has to bootstrap it.
+RUN NONINTERACTIVE=1 /bin/bash -c \
+ "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
+ENV PATH="/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:${PATH}"
+
+# Neovim — `make test` runs the basilisk.nvim e2e suite (`make _test_nvim`) and
+# scripts/audit.sh gates on it. basilisk.nvim requires 0.11+ (its health.lua
+# hard-errors below that, and lua/basilisk/lsp.lua uses the 0.11-only
+# vim.lsp.config/vim.lsp.enable); CI covers that floor and nightly via
+# rhysd/action-setup-vim. Debian bookworm's nvim predates 0.11, so it comes from
+# brew here — audit.sh re-verifies the floor before the suite runs either way.
+RUN brew install neovim
+
+# deslop duplication gate — `make lint` runs it ([CI-DESLOP]). Installed with the
+# repo's own script, byte-for-byte the step the CI Lint job runs, so the CLI here
+# is the same latest release CI gates on.
+COPY --chown=dev:dev scripts/install-deslop.sh /tmp/install-deslop.sh
+RUN bash /tmp/install-deslop.sh && rm /tmp/install-deslop.sh
+
WORKDIR /workspace
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 132a36f4..8a3fbd6c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -99,8 +99,12 @@ jobs:
website/*|benchmarks/status/*|crates/basilisk-checker/src/rules/*) website=true ;;
# The conformance score + graded python/typing commit are stamped
# into these by scripts/gen_conformance_reference.py — editing
- # them re-runs the website job's stamp drift guard.
- README.md|README.zh.md|docs/specs/CHECKER-ARCHITECTURE-SPEC.md) website=true ;;
+ # them re-runs the website job's stamp drift guard. The published
+ # READMEs are generated from docs/readme/ ([README]), so touching
+ # a source OR a generated copy must re-run that guard too.
+ docs/readme/*|docs/specs/CHECKER-ARCHITECTURE-SPEC.md) website=true ;;
+ README.md|README.zh.md|README-pypi.md) website=true ;;
+ vscode-extension/README.md|vscode-extension/README.zh.md) website=true ;;
esac
# Route each changed path to the NARROWEST code scope that needs it.
# Pure docs / static site / benchmark tooling / CI YAML never reach a
@@ -174,11 +178,14 @@ jobs:
diff -u website/src/_data/rules.json /tmp/rules.json \
|| { echo "::error::rules.json is stale — run: python3 scripts/gen_rules_reference.py --data"; exit 1; }
- # The README/spec quote the live score + graded python/typing commit,
- # stamped by scripts/gen_conformance_reference.py on every scorer run;
- # fail if the committed text drifted from conformance_report.json so a
- # quoted commit can never go stale ([CHKARCH-CONFORMANCE]).
- - name: Check stamped conformance references are in sync with the report
+ # The README source/spec quote the live score + graded python/typing
+ # commit, stamped by scripts/gen_conformance_reference.py on every scorer
+ # run; fail if the committed text drifted from conformance_report.json so
+ # a quoted commit can never go stale ([CHKARCH-CONFORMANCE]). The same
+ # command then verifies that every published README still renders from
+ # docs/readme/ unchanged ([README-DRIFT]) — GitHub, the VSIX (Marketplace
+ # AND Open VSX), and PyPI cannot drift apart or be edited in place.
+ - name: Check stamped conformance references and generated READMEs
run: python3 scripts/gen_conformance_reference.py --check
- name: Build site
@@ -548,9 +555,13 @@ jobs:
with:
python-version: "3.12"
- - name: Install pytest and luarocks
+ - name: Install pytest, debugpy and luarocks
run: |
- pip install pytest==9.1.1
+ # debugpy is a real dependency of this job, not a nicety: the
+ # tests/dap specs drive basilisk's debug adapter end to end, and
+ # without it every one of them fails with "debugpy not found".
+ # Pinned to the same version as test-vscode and the devcontainer.
+ pip install pytest==9.1.1 debugpy==1.8.14
sudo apt-get install -y luarocks
luarocks install --local luacov
diff --git a/CLAUDE.md b/CLAUDE.md
index 7b68eb59..9b818e7b 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -166,7 +166,7 @@ Strict-by-default Python type checker and comprehensive LSP built in **Rust**. O
- **Parser**: `ruff_python_parser` (MIT, same as Ruff)
- **Incremental**: Salsa framework — sub-10ms incremental checks
- **Formatting**: `ruff_python_formatter` crate embedded in-process ([LSPFMT-ENGINE]); import hygiene reimplemented natively on the Ruff AST ([LSPFMT-IMPORTS]). The `ruff` CLI is NOT a runtime dependency — never spawn it.
-- **Parallelism**: Rayon (work-stealing, file-level)
+- **Concurrency**: Tokio in the LSP server (request multiplexing + `spawn_blocking`); analysis itself is single-threaded on one dedicated large-stack thread ([LSPARCH-ARCH-STACK])
- **No Pyright/mypy/Node.js** — zero TypeScript or Python runtime
## Migration to `lspkit`
diff --git a/Cargo.lock b/Cargo.lock
index 6ae3e1b1..e182218d 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -260,6 +260,7 @@ dependencies = [
"basilisk-resolver",
"basilisk-stubs",
"basilisk-test-utils",
+ "basilisk-typeshed-fetch",
"basilisk-uv",
"clap",
"colored",
@@ -325,6 +326,7 @@ dependencies = [
"basilisk-resolver",
"basilisk-stubs",
"basilisk-test-utils",
+ "basilisk-typeshed-fetch",
"basilisk-uv",
"dashmap 6.2.1",
"futures-util",
@@ -417,7 +419,6 @@ dependencies = [
"tempfile",
"thiserror",
"tracing",
- "ureq",
"zip",
]
@@ -443,6 +444,20 @@ dependencies = [
"serde_json",
]
+[[package]]
+name = "basilisk-typeshed-fetch"
+version = "0.0.0-PLACEHOLDER"
+dependencies = [
+ "basilisk-stubs",
+ "serde",
+ "serde_json",
+ "tempfile",
+ "thiserror",
+ "tracing",
+ "ureq",
+ "zip",
+]
+
[[package]]
name = "basilisk-uv"
version = "0.0.0-PLACEHOLDER"
diff --git a/Cargo.toml b/Cargo.toml
index 484c4dc7..e0b767ff 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -7,6 +7,7 @@ members = [
"crates/basilisk-checker",
"crates/basilisk-cli",
"crates/basilisk-stubs",
+ "crates/basilisk-typeshed-fetch",
"crates/basilisk-config",
"crates/basilisk-lsp",
"crates/basilisk-mojo",
@@ -73,6 +74,7 @@ basilisk-checker = { path = "crates/basilisk-checker" }
basilisk-lsp = { path = "crates/basilisk-lsp" }
basilisk-compiler = { path = "crates/basilisk-compiler" }
basilisk-stubs = { path = "crates/basilisk-stubs" }
+basilisk-typeshed-fetch = { path = "crates/basilisk-typeshed-fetch" }
basilisk-config = { path = "crates/basilisk-config" }
basilisk-common = { path = "crates/basilisk-common" }
basilisk-buildinfo = { path = "crates/basilisk-buildinfo" }
diff --git a/Makefile b/Makefile
index ffd95c82..e14b5afe 100644
--- a/Makefile
+++ b/Makefile
@@ -94,7 +94,7 @@ test: _audit
echo -e '\n\033[0;32m✓ All tests passed.\033[0m'
## lint: Run all linters/analyzers (read-only). Does NOT format.
-lint: _lint_rust _lint_vsix _lint_deslop
+lint: _lint_rust _lint_vsix _lint_deslop _lint_docs
## fmt: Format all code in-place
fmt: _fmt_rust _fmt_python _fmt_vsix
@@ -396,6 +396,7 @@ _lint_rust:
cargo check --workspace --all-targets && \
cargo clippy --workspace --all-targets -- -D warnings && \
cargo audit && \
+ bash scripts/check-dependency-shape.sh && \
echo -e '\033[0;32m✓ Rust lint passed\033[0m'
_lint_vsix:
@@ -411,6 +412,19 @@ _lint_deslop:
deslop . && \
echo -e '\033[0;32m✓ Deslop duplication gate passed\033[0m'
+# Generated-documentation drift gates. The published READMEs (GitHub, the VSIX
+# on both Marketplace and Open VSX, PyPI) are rendered from docs/readme/
+# ([README]), and the diagnostic reference data is generated from the checker
+# rule sources ([WEBSITE-ERROR-PAGES-DRIFT]) — editing either output by hand,
+# or editing a source without regenerating, fails here as it does in CI.
+_lint_docs:
+ @echo -e '\033[1m\033[0;36m▶ Checking generated documentation\033[0m' && \
+ python3 scripts/gen_readmes.py --check && \
+ python3 scripts/gen_rules_reference.py --data /tmp/basilisk-rules.json && \
+ diff -u website/src/_data/rules.json /tmp/basilisk-rules.json > /dev/null || \
+ { echo 'rules.json is stale — run: python3 scripts/gen_rules_reference.py --data'; exit 1; } && \
+ echo -e '\033[0;32m✓ Generated documentation is in sync\033[0m'
+
_fmt_rust:
@echo -e '\033[1m\033[0;36m▶ Formatting Rust\033[0m' && \
cargo fmt --all && \
diff --git a/README-pypi.md b/README-pypi.md
index 3f86a271..fb8062b6 100644
--- a/README-pypi.md
+++ b/README-pypi.md
@@ -1,67 +1,175 @@
-# Basilisk
+
+
+ The only Python type checker scoring 100% on the official python/typing conformance suite — and the fastest we’ve measured.
+ Complete open-source Python dev environment in Rust: type checker, language server, debugger, profiler, plus VS Code, Cursor, Zed & Neovim extensions. Strict by default.
+ Weighing up the best Python type checker for your codebase? Start with the scoreboard.
+
+
+> **You are reading the `basilisk-python` wheel listing** — the Basilisk CLI packaged for `pip`/`uv`. The distribution is named `basilisk-python` because `basilisk` was taken on PyPI; the installed command is still `basilisk`.
+
+
+ 100.0% PEP conformance — 141 of 141 tests in the official
+ python/typing
+ conformance suite (commit 6ef9f77), scored on the wheel-installed CLI in its default config by the real upstream harness.
+ We target python/typing@main and ratchet the score up only.
+
+
+## The only 100% checker — and the fastest according to our benchmarks
+
+Basilisk is the **only** Python type checker with a perfect score on the official
+[`python/typing` conformance suite](https://github.com/python/typing/blob/main/conformance/results/results.html):
+**100.0%** (141/141 files, 970 required errors caught, 0 false positives),
+measured by the real upstream harness on the wheel-installed CLI in its default config.
+
+
+
+
+
+And it is the **fastest checker we’ve measured** — median cold full-file check, from scratch:
+
+| Type checker | Median cold check |
+| --- | --- |
+| ⚡ **Basilisk** | **10 ms** |
+| zuban | 28 ms |
+| ty | 40 ms |
+| Pyrefly | 110 ms |
+| Pyright | 573 ms |
+| mypy | 574 ms |
+
+Median cold full-file check across 26 single-construct typing-spec stress fixtures on an Apple M4 Max — lower is better. Basilisk’s warm re-check drops to ~4 ms. Every figure is produced by [`hyperfine`](https://github.com/sharkdp/hyperfine) and committed per machine, so nothing here is hand-typed. **Clone the repo, run `make bench` on your own hardware, and send us the CSV — independent audits are welcome.** [Full benchmarks & methodology →](https://www.basilisk-python.dev/docs/benchmarks/)
+
+## Everything in one extension
+
+One extension replaces Pylance and gives you the whole workflow — no Node.js, no Python runtime, no pip, no npm. A single bundled Rust binary drives it all:
+
+- **Strict-by-default diagnostics** — inline as you type, incremental analysis powered by Salsa (the rust-analyzer engine)
+- **Autocomplete, hover, go-to-definition, find references, rename**
+- **Refactoring code actions** — extract, inline, move symbol, organize imports
+- **Integrated debugging** — F5 to debug via bundled debugpy; no separate extension
+- **Integrated profiling** — CPU heat map, flame graph, and a memory dashboard with leak detection
+- **Activity panel** — module tree with per-module type-health coverage, plus feature toggles
+- **Inlay hints** and **Ruff** formatting/import-organization, built in
+- **Standard-library types from [typeshed](https://github.com/python/typeshed)** — a complete `stdlib/` snapshot is compiled into the binary, so hover and diagnostics work offline with no configuration
+
+Every diagnostic teaches: rustc-style output with a `help`, a `note`, and a link to a per-rule explainer, so a red squiggle always tells you *why*. Basilisk **starts strict** and stays strict — the unconfigured default enables the complete typing-spec rule set, and strictness is dialled per rule, never by a mode.
-**Basilisk is the only Python type checker scoring 100%** on the
-[official `python/typing` conformance suite](https://github.com/python/typing/blob/main/conformance/results/results.html) —
-and the fastest we've measured. A complete, open-source Python development
-environment in Rust: type checker, language server, debugger, profiler, plus
-VS Code, Cursor, Zed & Neovim extensions. Strict by default.
+## Install
-- Website:
-- Conformance:
-- Source:
+**Editor extension** — install *Basilisk* from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=Nimblesite.basilisk) or [Open VSX](https://open-vsx.org/extension/Nimblesite/basilisk) (Cursor, Windsurf, and other forks read Open VSX). The Basilisk binary is bundled for macOS (Apple Silicon), Linux (x86_64, aarch64), and Windows (x86_64, aarch64) — nothing else to install. Zed and Neovim 0.10+ extensions are available too.
-This package (`basilisk-python`) bundles the native `basilisk` binary as a
-Python wheel so it can be installed with `pip`/`uv`. It is built from the **same
-source, at the same version**, as the binaries distributed via GitHub Releases,
-Homebrew and Scoop — every channel is stamped from the Cargo workspace version
-by `scripts/stamp-version.sh` in one release run. The wheel is compiled by its
-own `maturin --release` job, so the file itself is not byte-identical to the
-release archive's binary.
+**CLI** — on [PyPI as `basilisk-python`](https://pypi.org/project/basilisk-python/); the installed command is `basilisk`:
-> The distribution is named `basilisk-python` because the name `basilisk` was
-> already taken on PyPI. The installed command is still `basilisk`.
+```sh
+uv tool install basilisk-python # or: pipx install basilisk-python, pip install basilisk-python
+```
-## Install
+Also via Homebrew (`brew install Nimblesite/tap/basilisk`), Scoop (`scoop bucket add nimblesite https://github.com/Nimblesite/scoop-bucket && scoop install basilisk`), and [GitHub Releases](https://github.com/Nimblesite/Basilisk/releases). Every channel ships the same single Rust CLI, built from this repository at the same version, with no runtime dependencies. Point `basilisk.executablePath` at your own build to have the extension use it. Full options: [install guide](https://www.basilisk-python.dev/docs/installation/).
-```bash
-pip install basilisk-python
-# or
-uv tool install basilisk-python
-```
+## Try it
-## Use
+The [`examples/`](https://github.com/Nimblesite/Basilisk/blob/main/examples/) folder has ready-to-go Python files:
-```bash
-basilisk check path/to/your_code.py
-basilisk --version
+```sh
+basilisk check examples/bad.py # 8 typing-spec errors — always on, no config needed
+basilisk analyze examples/bad.py # the opt-in strictness warnings on the same file
+basilisk analyze examples/good.py # clean, even at full strictness
+basilisk check examples/mixed.py # one real type error
+basilisk check examples/ # the whole folder at once
```
-Machine-readable output for tooling:
+Machine-readable output for CI and tooling:
-```bash
+```sh
basilisk check path/to/your_code.py --output json --color never
```
-## Standard-library types
+The two commands read one rule universe split by provenance ([`CHKARCH-COMMANDS`](https://github.com/Nimblesite/Basilisk/blob/main/docs/specs/CHECKER-ARCHITECTURE-SPEC.md)): `check` reports
+the `pep`-tagged typing-spec rules and nothing else — that set is always on, and
+while a config table may grade one of them down to `warning`/`info`, none may
+switch it off. `analyze` reports the non-`pep` house rules, which stay silent
+until a table selects them. Only `analyze` emits `BSK-` diagnostics.
+
+## Standard-library types, always offline
+
+Basilisk resolves the standard library from [typeshed](https://github.com/python/typeshed),
+and checking **never downloads anything**. Out of the box it uses the complete
+typeshed `stdlib/` snapshot compiled into the binary, reporting the source as
+unpinned — so stdlib types work on a plane, behind a firewall, or in an
+air-gapped CI runner, with no configuration.
+
+Pin an exact commit with `typeshed-commit = "<40-char sha>"` under
+`[tool.basilisk]`. A pin does exactly one thing: it verifies, offline, that the
+typeshed tree in the local store hashes to that commit. If the commit is not on
+this machine the run fails hard with `NO SOURCE` rather than substituting
+another source — bring it down first with `basilisk typeshed download` (with no
+`--commit` it downloads the latest and writes the pin for you), or use the
+editor's **Download latest** button. Alternatively, point `typeshed-path` at
+your own typeshed tree. Full options:
+[configuration guide](https://www.basilisk-python.dev/docs/configuration/).
+
+## Development
+
+```sh
+cargo build # build all crates
+cargo test # run all tests
+cargo clippy # lint (zero warnings policy)
+cargo fmt # format
+```
+
+Rust 1.87+ required.
-Standard-library types come from [typeshed](https://github.com/python/typeshed).
-By default Basilisk verifies `python/typeshed@main` over HTTPS once per run and
-caches the gated archive for 24 hours; with no network it falls back to the
-complete typeshed `stdlib/` snapshot compiled into the binary, so offline and
-air-gapped runs still get stdlib types. Pin an exact commit with
-`typeshed-commit` under `[tool.basilisk]` in `pyproject.toml`, or skip the cache
-for a single run with `--no-typeshed-cache`.
+## Contributing
+
+Basilisk is built by a human + AI partnership, with the work split on purpose. See
+[CONTRIBUTING.md](https://github.com/Nimblesite/Basilisk/blob/main/CONTRIBUTING.md) — **For Humans** (testing, code-quality review,
+conformance/security audits, IDE feature parity, sharpening the AI instructions) and
+**For AI** (the technical execution, under the standing rules in [CLAUDE.md](https://github.com/Nimblesite/Basilisk/blob/main/CLAUDE.md)).
## Acknowledgments
-The bundled binary is built on [Ruff](https://github.com/astral-sh/ruff) by
-[Astral](https://astral.sh/) (MIT) and [typeshed](https://github.com/python/typeshed)
-(Apache-2.0, with MIT-licensed parts), among other open-source projects. The
-wheel carries the complete locked notices and license texts in its
-`.dist-info/licenses/` directory.
+Basilisk builds on the open-source community — with thanks to:
+
+- **[Astral](https://astral.sh/)** — [Ruff](https://github.com/astral-sh/ruff), whose parser, AST, and formatter crates Basilisk embeds (MIT). The foundation we rely on most.
+- **[typeshed](https://github.com/python/typeshed)** — standard-library type stubs (Apache-2.0, with MIT-licensed parts).
+- **[Salsa](https://github.com/salsa-rs/salsa)** — incremental query engine.
+- **[Rayon](https://github.com/rayon-rs/rayon)** — data parallelism.
+- **[tower-lsp](https://github.com/ebkalderon/tower-lsp)** — LSP scaffolding.
+- **[debugpy](https://github.com/microsoft/debugpy)** — debug adapter (bundled in the VS Code extension).
+- The [`python/typing`](https://github.com/python/typing) conformance suite.
+
+Full component list, selected licenses, and required notices: [NOTICES](https://github.com/Nimblesite/Basilisk/blob/main/NOTICES)
+and [RUST-DEPENDENCY-LICENSES](https://github.com/Nimblesite/Basilisk/blob/main/RUST-DEPENDENCY-LICENSES). Each published
+artifact carries its own copies: the VSIX ships Rust notices in
+`RUST-DEPENDENCY-LICENSES`, npm notices in `VSCODE-DEPENDENCY-LICENSES`, and
+debugpy's license and `ThirdPartyNotices.txt` inside `bundled/debugpy`; the
+wheel carries the complete locked notices in its `.dist-info/licenses/`
+directory.
+
+---
## License
-Basilisk source code is MIT licensed. This binary wheel also contains
-third-party components under the composite `License-Expression` and the exact
-license files shipped in `.dist-info/licenses/`.
+Basilisk source code is MIT licensed. Binary distributions also contain
+third-party components under the licenses shipped beside each artifact.
+
+Built by [NIMBLESITE PTY LTD](https://www.nimblesite.co).
diff --git a/README.md b/README.md
index 17bcd696..3a1b426b 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,6 @@
+
@@ -9,15 +12,19 @@
The only Python type checker scoring 100% on the official python/typing conformance suite — and the fastest we’ve measured.
Complete open-source Python dev environment in Rust: type checker, language server, debugger, profiler, plus VS Code, Cursor, Zed & Neovim extensions. Strict by default.
+ Weighing up the best Python type checker for your codebase? Start with the scoreboard.
+> **You are reading the Basilisk source repository** — the checker, language server, editor extensions, and website all live here.
+
@@ -51,24 +58,36 @@ And it is the **fastest checker we’ve measured** — median cold full-
Median cold full-file check across 26 single-construct typing-spec stress fixtures on an Apple M4 Max — lower is better. Basilisk’s warm re-check drops to ~4 ms. Every figure is produced by [`hyperfine`](https://github.com/sharkdp/hyperfine) and committed per machine, so nothing here is hand-typed. **Clone the repo, run `make bench` on your own hardware, and send us the CSV — independent audits are welcome.** [Full benchmarks & methodology →](https://www.basilisk-python.dev/docs/benchmarks/)
+## Everything in one extension
+
+One extension replaces Pylance and gives you the whole workflow — no Node.js, no Python runtime, no pip, no npm. A single bundled Rust binary drives it all:
+
+- **Strict-by-default diagnostics** — inline as you type, incremental analysis powered by Salsa (the rust-analyzer engine)
+- **Autocomplete, hover, go-to-definition, find references, rename**
+- **Refactoring code actions** — extract, inline, move symbol, organize imports
+- **Integrated debugging** — F5 to debug via bundled debugpy; no separate extension
+- **Integrated profiling** — CPU heat map, flame graph, and a memory dashboard with leak detection
+- **Activity panel** — module tree with per-module type-health coverage, plus feature toggles
+- **Inlay hints** and **Ruff** formatting/import-organization, built in
+- **Standard-library types from [typeshed](https://github.com/python/typeshed)** — a complete `stdlib/` snapshot is compiled into the binary, so hover and diagnostics work offline with no configuration
+Every diagnostic teaches: rustc-style output with a `help`, a `note`, and a link to a per-rule explainer, so a red squiggle always tells you *why*. Basilisk **starts strict** and stays strict — the unconfigured default enables the complete typing-spec rule set, and strictness is dialled per rule, never by a mode.
## Install
-The CLI is on [PyPI as `basilisk-python`](https://pypi.org/project/basilisk-python/) — install it as a standalone tool; the installed command is `basilisk`:
+**Editor extension** — install *Basilisk* from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=Nimblesite.basilisk) or [Open VSX](https://open-vsx.org/extension/Nimblesite/basilisk) (Cursor, Windsurf, and other forks read Open VSX). The Basilisk binary is bundled for macOS (Apple Silicon), Linux (x86_64, aarch64), and Windows (x86_64, aarch64) — nothing else to install. Zed and Neovim 0.10+ extensions are available too.
+
+**CLI** — on [PyPI as `basilisk-python`](https://pypi.org/project/basilisk-python/); the installed command is `basilisk`:
```sh
-uv tool install basilisk-python # or: pipx install basilisk-python
+uv tool install basilisk-python # or: pipx install basilisk-python, pip install basilisk-python
```
-Also available via Homebrew (`brew tap Nimblesite/tap && brew install basilisk`), Scoop, and
-[GitHub Releases](https://github.com/Nimblesite/Basilisk/releases) — every channel ships the same
-single Rust CLI, built from this repository at the same version, with no runtime dependencies.
-Full options: [install guide](https://www.basilisk-python.dev/docs/install-cli/).
+Also via Homebrew (`brew install Nimblesite/tap/basilisk`), Scoop (`scoop bucket add nimblesite https://github.com/Nimblesite/scoop-bucket && scoop install basilisk`), and [GitHub Releases](https://github.com/Nimblesite/Basilisk/releases). Every channel ships the same single Rust CLI, built from this repository at the same version, with no runtime dependencies. Point `basilisk.executablePath` at your own build to have the extension use it. Full options: [install guide](https://www.basilisk-python.dev/docs/installation/).
## Try it
-The `examples/` folder has ready-to-go Python files:
+The [`examples/`](examples/) folder has ready-to-go Python files:
```sh
basilisk check examples/bad.py # 8 typing-spec errors — always on, no config needed
@@ -78,39 +97,36 @@ basilisk check examples/mixed.py # one real type error
basilisk check examples/ # the whole folder at once
```
+Machine-readable output for CI and tooling:
+
+```sh
+basilisk check path/to/your_code.py --output json --color never
+```
+
The two commands read one rule universe split by provenance ([`CHKARCH-COMMANDS`](docs/specs/CHECKER-ARCHITECTURE-SPEC.md)): `check` reports
the `pep`-tagged typing-spec rules and nothing else — that set is always on, and
while a config table may grade one of them down to `warning`/`info`, none may
switch it off. `analyze` reports the non-`pep` house rules, which stay silent
until a table selects them. Only `analyze` emits `BSK-` diagnostics.
-## Standard-library types, online or offline
+## Standard-library types, always offline
-Basilisk resolves the standard library from [typeshed](https://github.com/python/typeshed).
-By default it verifies `python/typeshed@main` over HTTPS once per run, gates and
-caches the archive for up to 24 hours, and reports the source as unpinned. With no
-network — or on any download failure — it falls back to the complete typeshed
-`stdlib/` snapshot compiled into the binary, so stdlib types still work offline.
+Basilisk resolves the standard library from [typeshed](https://github.com/python/typeshed),
+and checking **never downloads anything**. Out of the box it uses the complete
+typeshed `stdlib/` snapshot compiled into the binary, reporting the source as
+unpinned — so stdlib types work on a plane, behind a firewall, or in an
+air-gapped CI runner, with no configuration.
Pin an exact commit with `typeshed-commit = "<40-char sha>"` under
-`[tool.basilisk]`; its cache is re-hashed on every reuse and remains until eviction
-or caching is disabled. The pin fails closed rather than substituting another
-commit. Alternatively, point `typeshed-path` at your own typeshed tree. Full options:
+`[tool.basilisk]`. A pin does exactly one thing: it verifies, offline, that the
+typeshed tree in the local store hashes to that commit. If the commit is not on
+this machine the run fails hard with `NO SOURCE` rather than substituting
+another source — bring it down first with `basilisk typeshed download` (with no
+`--commit` it downloads the latest and writes the pin for you), or use the
+editor's **Download latest** button. Alternatively, point `typeshed-path` at
+your own typeshed tree. Full options:
[configuration guide](https://www.basilisk-python.dev/docs/configuration/).
-
-
-## Editors
-
-One extension, the whole workflow: strict-by-default diagnostics, autocomplete, hover, go-to-definition, refactoring code actions, debugging, and profiling. No Node.js or Python runtime — a single Rust binary drives it all.
-
-- **VS Code, Cursor & Windsurf** — install from [Open VSX](https://open-vsx.org/)
-- **Zed** • **Neovim 0.10+**
-
-Every diagnostic teaches: rustc-style output with a `help`, a `note`, and a link to a per-rule explainer. See the [full diagnostic reference](https://www.basilisk-python.dev/docs/rules/) and the [install guide](https://www.basilisk-python.dev/docs/installation/).
-
-
-
## Development
```sh
@@ -129,7 +145,6 @@ Basilisk is built by a human + AI partnership, with the work split on purpose. S
conformance/security audits, IDE feature parity, sharpening the AI instructions) and
**For AI** (the technical execution, under the standing rules in [CLAUDE.md](CLAUDE.md)).
-
## Acknowledgments
Basilisk builds on the open-source community — with thanks to:
@@ -143,9 +158,12 @@ Basilisk builds on the open-source community — with thanks to:
- The [`python/typing`](https://github.com/python/typing) conformance suite.
Full component list, selected licenses, and required notices: [NOTICES](NOTICES)
-and [RUST-DEPENDENCY-LICENSES](RUST-DEPENDENCY-LICENSES).
-
-
+and [RUST-DEPENDENCY-LICENSES](RUST-DEPENDENCY-LICENSES). Each published
+artifact carries its own copies: the VSIX ships Rust notices in
+`RUST-DEPENDENCY-LICENSES`, npm notices in `VSCODE-DEPENDENCY-LICENSES`, and
+debugpy's license and `ThirdPartyNotices.txt` inside `bundled/debugpy`; the
+wheel carries the complete locked notices in its `.dist-info/licenses/`
+directory.
---
diff --git a/README.zh.md b/README.zh.md
index 31821243..62a1c830 100644
--- a/README.zh.md
+++ b/README.zh.md
@@ -1,3 +1,6 @@
+
-它也是**我们测试过最快的检查器** —— 从零冷启动的全文件检查中位数:
+它也是**我们测得最快的检查器** — 从零开始的整文件冷检查中位数:
-| 类型检查器 | 冷启动检查中位数 |
+| 类型检查器 | 冷检查中位数 |
| --- | --- |
| ⚡ **Basilisk** | **10 ms** |
| zuban | 28 ms |
@@ -50,56 +57,71 @@ Basilisk 是**唯一**在官方
| Pyright | 573 ms |
| mypy | 574 ms |
-在 Apple M4 Max 上,跨 26 个单一类型构造压力测试样本的冷启动全文件检查中位数 —— 数值越低越好。Basilisk 的热重检查可降至约 4 ms。每个数字均由 [`hyperfine`](https://github.com/sharkdp/hyperfine) 生成并按机器提交,没有一个是手写的。**克隆仓库,在你自己的硬件上运行 `make bench`,并把 CSV 发给我们 —— 欢迎社区独立复核。** [完整基准测试与方法论(英文)→](https://www.basilisk-python.dev/docs/benchmarks/)
+在 Apple M4 Max 上对 26 个单一构造的类型规范压力用例测得的整文件冷检查中位数 — 越低越好。Basilisk 的热重检查可降至约 4 ms。每个数字都由 [`hyperfine`](https://github.com/sharkdp/hyperfine) 产生并按机器提交,没有一个是手写的。**克隆仓库,在你自己的硬件上运行 `make bench`,并把 CSV 发给我们 — 欢迎独立复核。** [完整基准与方法论 →](https://www.basilisk-python.dev/zh/docs/benchmarks/)
+
+## 一个扩展,覆盖全部
+
+一个扩展即可取代 Pylance 并提供完整工作流 —— 无需 Node.js、无需 Python 运行时、无需 pip、无需 npm。一切由单一捆绑的 Rust 二进制文件驱动:
+
+- **默认严格的诊断** —— 随输入实时呈现,由 Salsa(rust-analyzer 的引擎)提供增量分析
+- **自动补全、悬停信息、跳转到定义、查找引用、重命名**
+- **重构代码操作** —— 提取、内联、移动符号、整理导入
+- **集成调试** —— 按 F5 即可通过捆绑的 debugpy 调试;无需额外扩展
+- **集成性能分析** —— CPU 热力图、火焰图,以及带泄漏检测的内存面板
+- **活动面板** —— 模块树与逐模块的类型健康度覆盖率,并可切换功能开关
+- 内置 **Inlay hints** 与 **Ruff** 格式化/导入整理
+- **来自 [typeshed](https://github.com/python/typeshed) 的标准库类型** —— 完整的 `stdlib/` 快照已编译进二进制文件,因此悬停与诊断在离线且零配置的情况下依然可用
+
+每条诊断都有教育意义:rustc 风格的输出,附带 `help`、`note` 以及指向每条规则详解页的链接,因此一条红色波浪线总能告诉你*为什么*。Basilisk **一开始就严格**并始终严格 —— 未配置的默认值即启用完整的类型规范规则集,严格程度按规则微调,而不是靠模式切换。
## 安装
-CLI 已发布到 [PyPI,包名为 `basilisk-python`](https://pypi.org/project/basilisk-python/)——请将其作为独立工具安装,安装后的命令是 `basilisk`:
+**编辑器扩展** —— 从 [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=Nimblesite.basilisk) 或 [Open VSX](https://open-vsx.org/extension/Nimblesite/basilisk) 安装 *Basilisk*(Cursor、Windsurf 等分支读取 Open VSX)。Basilisk 二进制文件已为 macOS(Apple Silicon)、Linux(x86_64、aarch64)与 Windows(x86_64、aarch64)捆绑 —— 无需再安装其他东西。Zed 与 Neovim 0.10+ 的扩展同样可用。
+
+**命令行工具** —— 在 [PyPI 上名为 `basilisk-python`](https://pypi.org/project/basilisk-python/);安装后的命令是 `basilisk`:
```sh
-uv tool install basilisk-python # 或:pipx install basilisk-python
+uv tool install basilisk-python # 或:pipx install basilisk-python、pip install basilisk-python
```
-也可通过 Homebrew(`brew tap Nimblesite/tap && brew install basilisk`)、Scoop 以及
-[GitHub Releases](https://github.com/Nimblesite/Basilisk/releases) 安装——所有渠道分发的都是同一个
-Rust CLI,由本仓库同一版本构建,且没有任何运行时依赖。完整选项参见[安装指南](https://www.basilisk-python.dev/zh/docs/installation/)。
+也可通过 Homebrew(`brew install Nimblesite/tap/basilisk`)、Scoop(`scoop bucket add nimblesite https://github.com/Nimblesite/scoop-bucket && scoop install basilisk`)与 [GitHub Releases](https://github.com/Nimblesite/Basilisk/releases) 获取。每个渠道都发布同一个 Rust 命令行工具,由本仓库在同一版本构建,且没有运行时依赖。把 `basilisk.executablePath` 指向你自己的构建,扩展就会使用它。完整选项:[安装指南](https://www.basilisk-python.dev/zh/docs/installation/)。
-## 试用
+## 试一试
-`examples/` 文件夹中提供了可直接运行的 Python 文件:
+[`examples/`](examples/) 目录中有可直接运行的 Python 文件:
```sh
-basilisk check examples/bad.py # 8 个类型规范错误——始终启用,无需任何配置
-basilisk analyze examples/bad.py # 同一文件上可选启用的严格性警告
-basilisk analyze examples/good.py # 干净——即使在完全严格模式下
-basilisk check examples/mixed.py # 一个真实的类型错误
-basilisk check examples/ # 一次检查整个文件夹
+basilisk check examples/bad.py # 8 处类型规范错误 —— 始终启用,无需配置
+basilisk analyze examples/bad.py # 同一文件上可选的严格性警告
+basilisk analyze examples/good.py # 即使在完全严格下也是干净的
+basilisk check examples/mixed.py # 一处真实的类型错误
+basilisk check examples/ # 一次检查整个目录
```
-这两个命令读取的是同一套规则,只是按来源做了划分([`CHKARCH-COMMANDS`](docs/specs/CHECKER-ARCHITECTURE-SPEC.md)):`check` 只报告带
-`pep` 标签的类型规范规则——这组规则始终启用,配置表可以把其中某条降级为
-`warning`/`info`,但任何表都无法将其关闭;`analyze` 报告不带 `pep` 标签的自定
-规则,它们在被配置表选用之前始终保持沉默。只有 `analyze` 会输出 `BSK-` 诊断。
-
-## 标准库类型:在线与离线皆可
-
-Basilisk 从 [typeshed](https://github.com/python/typeshed) 解析标准库类型。默认情况下,
-它每次运行通过 HTTPS 校验一次 `python/typeshed@main`,对归档执行安全校验并缓存 24 小时,
-同时将来源标记为未固定(unpinned)。在没有网络或下载失败时,它会回退到编译进二进制文件中的
-完整 typeshed `stdlib/` 快照,因此标准库类型在离线状态下依然可用。
+供 CI 与工具使用的机器可读输出:
-在 `[tool.basilisk]` 中使用 `typeshed-commit = "<40 位 sha>"` 固定到某个确切提交
-(该配置失败即报错,绝不替换为其他提交),或用 `typeshed-path` 指向你自己的 typeshed
-目录树。完整选项参见[配置指南](https://www.basilisk-python.dev/zh/docs/configuration/)。
+```sh
+basilisk check path/to/your_code.py --output json --color never
+```
-## 编辑器
+这两条命令读取的是按来源划分的同一套规则宇宙([`CHKARCH-COMMANDS`](docs/specs/CHECKER-ARCHITECTURE-SPEC.md)):`check`
+只报告带 `pep` 标签的类型规范规则 —— 该集合始终启用,配置表虽可将其中某条
+降级为 `warning`/`info`,但都不能将其关闭。`analyze` 报告非 `pep` 的自有规则,
+它们在被配置表选用之前始终保持沉默。只有 `analyze` 会输出 `BSK-` 诊断。
-一个扩展,覆盖完整工作流:默认严格的诊断、自动补全、悬停信息、跳转到定义、重构代码操作、调试与性能分析。无需 Node.js 或 Python 运行时 —— 由单一 Rust 二进制文件驱动一切。
+## 标准库类型:始终离线
-- **VS Code、Cursor 与 Windsurf** —— 从 [Open VSX](https://open-vsx.org/) 安装
-- **Zed** • **Neovim 0.10+**
+Basilisk 从 [typeshed](https://github.com/python/typeshed) 解析标准库类型,
+而且检查**从不下载任何东西**。开箱即用时它使用编译进二进制文件的完整 typeshed
+`stdlib/` 快照,并将来源报告为未固定(unpinned)—— 因此在飞机上、防火墙后或
+隔离网络的 CI 中,标准库类型都无需配置即可使用。
-每条诊断都有教育意义:rustc 风格的输出,附带 `help`、`note` 以及指向每条规则详解页的链接。参见[完整诊断参考](https://www.basilisk-python.dev/zh/docs/rules/)与[安装指南](https://www.basilisk-python.dev/zh/docs/installation/)。
+在 `[tool.basilisk]` 中使用 `typeshed-commit = "<40 位 sha>"` 固定到某个确切提交。
+固定只做一件事:离线校验本地存储库中的 typeshed 树是否哈希为该提交。若该提交
+不在本机上,运行会以 `NO SOURCE` 硬失败,而不会替换为其他来源 —— 请先用
+`basilisk typeshed download` 取回(不带 `--commit` 时会下载最新提交并替你写入
+固定项),或使用编辑器中的 **Download latest** 按钮。或者,把 `typeshed-path`
+指向你自己的 typeshed 目录树。完整选项参见[配置指南](https://www.basilisk-python.dev/zh/docs/configuration/)。
## 开发
@@ -132,7 +154,11 @@ Basilisk 建立在开源社区之上 —— 特别感谢:
- [`python/typing`](https://github.com/python/typing) 一致性测试套件。
完整的组件、所选许可证与必要声明见 [NOTICES](NOTICES) 和
-[RUST-DEPENDENCY-LICENSES](RUST-DEPENDENCY-LICENSES)。
+[RUST-DEPENDENCY-LICENSES](RUST-DEPENDENCY-LICENSES)。每个发布的产物也各自
+携带副本:VSIX 在 `RUST-DEPENDENCY-LICENSES` 中提供 Rust 声明,在
+`VSCODE-DEPENDENCY-LICENSES` 中提供 npm 声明,并在 `bundled/debugpy` 内保留
+debugpy 自身的许可证与 `ThirdPartyNotices.txt`;wheel 则在 `.dist-info/licenses/`
+目录中携带完整的锁定声明。
---
diff --git a/VSCODE-DEPENDENCY-LICENSES b/VSCODE-DEPENDENCY-LICENSES
index 225bb1fe..8bc1432e 100644
--- a/VSCODE-DEPENDENCY-LICENSES
+++ b/VSCODE-DEPENDENCY-LICENSES
@@ -2,7 +2,7 @@ Basilisk VS Code Production Dependency Licenses
=================================================
Generated from the exact npm production graph selected by package-lock.json.
-Production graph SHA-256: 0cde329d95c6111d14152a9e04f4bd890377383c0fa5994f216c19b3834a0767
+Production graph SHA-256: 43f5f5fd0daae31342024112becb94923452b92c929a2820b1eb50eca7f9f186
Regenerate with: npm run licenses:update
===============================================================================
@@ -124,9 +124,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
===============================================================================
-brace-expansion 5.0.6
+brace-expansion 5.0.7
License: MIT
-Repository: git+ssh://git@github.com/juliangruber/brace-expansion.git
+Repository: git+https://github.com/juliangruber/brace-expansion.git
Source: LICENSE
SHA-256: 9c63a23124d68cd30cd316a94a1a0bca34f032786df6df69fc4b5f136bac8d2e
diff --git a/basilisk.nvim/tests/basilisk/commands_spec.lua b/basilisk.nvim/tests/basilisk/commands_spec.lua
index 321cbf88..55ad3fd2 100644
--- a/basilisk.nvim/tests/basilisk/commands_spec.lua
+++ b/basilisk.nvim/tests/basilisk/commands_spec.lua
@@ -1,5 +1,7 @@
--- Tests for basilisk.commands module.
+local command_desc = require("tests.command_desc")
+
describe("basilisk.commands", function()
local commands = require("basilisk.commands")
local config = require("basilisk.config")
@@ -160,14 +162,19 @@ describe("basilisk.commands", function()
describe("command descriptions", function()
it("all commands have descriptions", function()
local user_commands = vim.api.nvim_get_commands({})
+ local checked = 0
for name, cmd in pairs(user_commands) do
if name:match("^Basilisk") then
- assert.is_true(
- cmd.definition ~= nil and cmd.definition ~= "",
+ assert.is_not_nil(
+ command_desc.of(cmd),
name .. " should have a description"
)
+ checked = checked + 1
end
end
+ -- Guard the guard: if the prefix match ever stops finding commands, the
+ -- loop above passes vacuously and the whole check silently disappears.
+ assert.is_true(checked > 0, "no Basilisk commands were found to check")
end)
end)
end)
diff --git a/basilisk.nvim/tests/basilisk/memory_spec.lua b/basilisk.nvim/tests/basilisk/memory_spec.lua
index 223280fe..99dde6ba 100644
--- a/basilisk.nvim/tests/basilisk/memory_spec.lua
+++ b/basilisk.nvim/tests/basilisk/memory_spec.lua
@@ -9,6 +9,8 @@
--- 6. State Management — graceful degradation without LSP client
--- 7. Realistic Scenarios — real-world memory leak patterns
+local command_desc = require("tests.command_desc")
+
local function close_all_floats()
for _, win in ipairs(vim.api.nvim_list_wins()) do
local config = vim.api.nvim_win_get_config(win)
@@ -342,7 +344,7 @@ describe("memory — command registration", function()
local entry = all_cmds[cmd]
assert.truthy(entry, "command '" .. cmd .. "' should exist")
assert.truthy(
- entry.definition and #entry.definition > 0,
+ command_desc.of(entry),
"command '" .. cmd .. "' should have a description"
)
end
@@ -384,7 +386,7 @@ describe("memory — command registration", function()
local all_cmds = vim.api.nvim_get_commands({})
local entry = all_cmds["BasiliskMemLeak"]
assert.truthy(entry)
- local desc = entry.definition:lower()
+ local desc = assert(command_desc.of(entry), "BasiliskMemLeak has no description"):lower()
assert.truthy(
desc:find("memory") or desc:find("leak"),
"description should mention memory or leak"
@@ -395,7 +397,7 @@ describe("memory — command registration", function()
local all_cmds = vim.api.nvim_get_commands({})
local entry = all_cmds["BasiliskMemRefs"]
assert.truthy(entry)
- local desc = entry.definition:lower()
+ local desc = assert(command_desc.of(entry), "BasiliskMemRefs has no description"):lower()
assert.truthy(
desc:find("reference") or desc:find("memory"),
"description should mention references or memory"
diff --git a/basilisk.nvim/tests/basilisk/profiling_spec.lua b/basilisk.nvim/tests/basilisk/profiling_spec.lua
index 56c536a3..897e1d6e 100644
--- a/basilisk.nvim/tests/basilisk/profiling_spec.lua
+++ b/basilisk.nvim/tests/basilisk/profiling_spec.lua
@@ -11,6 +11,8 @@
--- 8. Heat Map Extmarks — apply/clear/highlight groups/multi-file
--- 9. Flamegraph Export — speedscope JSON temp file, edge cases
+local command_desc = require("tests.command_desc")
+
local function close_all_floats()
for _, win in ipairs(vim.api.nvim_list_wins()) do
local config = vim.api.nvim_win_get_config(win)
@@ -1263,7 +1265,7 @@ describe("profiler — command registration", function()
local entry = all_cmds[cmd]
assert.truthy(entry, "command '" .. cmd .. "' should exist")
assert.truthy(
- entry.definition and #entry.definition > 0,
+ command_desc.of(entry),
"command '" .. cmd .. "' should have a description"
)
end
diff --git a/basilisk.nvim/tests/command_desc.lua b/basilisk.nvim/tests/command_desc.lua
new file mode 100644
index 00000000..e64da524
--- /dev/null
+++ b/basilisk.nvim/tests/command_desc.lua
@@ -0,0 +1,43 @@
+--- Read a user command's description across the Neovim versions CI covers.
+---
+--- Supports [NVIM-DISTRIBUTION-CI]: the `test-nvim` matrix spans a Neovim
+--- release boundary, and `nvim_get_commands` reports a Lua-callback command's
+--- `desc` differently on either side of it:
+---
+--- * 0.11 / 0.12 — `definition` carries the description, `desc` is nil.
+--- * 0.13-dev — `definition` is the empty string, `desc` carries it.
+---
+--- A spec that reads only `definition` therefore does not check the
+--- description at all on the nightly leg; it compares "" against its
+--- non-empty assertion and fails every command that has a perfectly good
+--- `desc`. Reading only `desc` fails the 0.11 leg the same way. Every spec
+--- asserting on command descriptions goes through here so the requirement is
+--- stated once and holds on both legs.
+
+local M = {}
+
+--- The description Neovim reports for one `nvim_get_commands` entry.
+--- @param entry table one value from `vim.api.nvim_get_commands({})`
+--- @return string|nil description, or nil when the command genuinely has none
+function M.of(entry)
+ if entry == nil then
+ return nil
+ end
+ local text = entry.desc
+ if text == nil or text == "" then
+ text = entry.definition
+ end
+ if text == nil or text == "" then
+ return nil
+ end
+ return text
+end
+
+--- The description for one command name, or nil if the command is absent.
+--- @param name string user command name, e.g. "BasiliskInfo"
+--- @return string|nil
+function M.for_command(name)
+ return M.of(vim.api.nvim_get_commands({})[name])
+end
+
+return M
diff --git a/book/manuscript/08-imports-packages-stubs.md b/book/manuscript/08-imports-packages-stubs.md
index 385fbd70..b732a651 100644
--- a/book/manuscript/08-imports-packages-stubs.md
+++ b/book/manuscript/08-imports-packages-stubs.md
@@ -19,11 +19,12 @@ behavior.
## Typeshed and the standard library
Explain typeshed's role and which source the documented release actually used.
-By default Basilisk verifies `python/typeshed@main` at run time and reports the
-result as unpinned; the complete `stdlib/` snapshot compiled into the release is
-the offline fallback, not the normal source. Show `typeshed-commit` as the way a
-project makes standard-library information reproducible, and state that the pin
-fails closed rather than silently substituting another commit.
+Checking is offline: by default Basilisk uses the complete `stdlib/` snapshot
+compiled into the release and reports it as unpinned. Show `typeshed-commit` as
+the way a project makes standard-library information reproducible — a pin
+verifies, offline, that the tree in the local store hashes to that commit — and
+state that it fails closed with `NO SOURCE` rather than downloading anything or
+silently substituting another commit.
## Typed distributions and `py.typed`
diff --git a/conformance/test_typeshed_documentation.py b/conformance/test_typeshed_documentation.py
index 5870caea..8008333d 100644
--- a/conformance/test_typeshed_documentation.py
+++ b/conformance/test_typeshed_documentation.py
@@ -67,25 +67,29 @@ def test_six_step_mermaid_flow_is_retained_in_order(self) -> None:
self.assertLess(flow.index("5 ·"), flow.index("6 ·"))
def test_cache_pin_and_python_target_contract_has_no_contradiction(self) -> None:
- """The reuse window is split by whether the selection can move.
+ """Store entries are commits, so age and the network carry no meaning.
- `Latest` tracks the moving `main` reference, so its bytes must keep a
- stated expiry — documenting unbounded reuse there would promise a
- freshness the checker does not deliver. An exact pin is
+ The checker never downloads: the only sources are a pinned store entry
+ and a custom folder, so no document may describe a moving `latest`
+ selection, a refresh TTL, or any expiry window. A store entry is
content-addressed and re-hashed on every load, so age carries no
- information about it and the docs must say so rather than implying a
- pinned project needs the network. Both halves are asserted here so
- neither can be dropped silently.
+ information about it — reuse is unbounded and re-verified, and the pin
+ itself never expires or changes. Both the ban on freshness language and
+ the positive store contract are asserted here so neither can be
+ dropped silently.
"""
combined = "\n".join(document.read_text() for document in DOCUMENTS)
normalized = re.sub(r"\s+", " ", combined).lower()
for forbidden in (
- # Unqualified claims that caching never expires. The pin exemption
- # is always stated as scoped to a pin, never as a blanket property.
+ # Freshness/TTL language: with no downloads there is nothing to
+ # refresh, so any expiry window is a contradiction.
"without a refresh ttl",
+ "refresh ttl",
+ "24-hour",
+ "24 hours",
"cached indefinitely",
# A pin must never be presented as expiring: that was the defect
- # this contract now guards against.
+ # this contract originally guarded against.
"pins expire after 24 hours",
"an exact pin expires",
# Commit selection is never derived from the Python target.
@@ -94,21 +98,18 @@ def test_cache_pin_and_python_target_contract_has_no_contradiction(self) -> None
"default 3.12",
):
self.assertNotIn(forbidden, normalized)
- # The moving reference keeps a stated 24-hour bound.
- self.assertIn(
- "the 24-hour expiry bounds reuse of unpinned downloaded zip bytes only",
- normalized,
- )
- self.assertIn("latest expires after 24 hours", normalized)
- self.assertIn("after 24 hours", normalized)
- # The pin is exempt, and the reason is stated rather than asserted.
+ # The checker is offline: no download path exists at check time.
+ self.assertIn("the checker never downloads", normalized)
+ # Store reuse is unbounded, and the reason is stated rather than
+ # asserted: every load re-verifies the content address.
self.assertIn("reused regardless of age", normalized)
+ self.assertIn("re-verified by hashing every time", normalized)
+ self.assertIn("no expiry, no reuse policy, no cache-off mode", normalized)
self.assertIn(
- "every reuse re-hashes the zip against its recorded sha-256", normalized
+ "nothing is cached, nothing expires, a pin always verifies", normalized
)
# Identity stability is unchanged by any of the above.
self.assertIn("the pin never expires or changes", normalized)
- self.assertIn("exact commit identity never expires", normalized)
if __name__ == "__main__":
diff --git a/crates/basilisk-checker/README.md b/crates/basilisk-checker/README.md
index eaf676c7..27180e92 100644
--- a/crates/basilisk-checker/README.md
+++ b/crates/basilisk-checker/README.md
@@ -23,9 +23,9 @@ AST + resolved scopes + effective config ➜ [basilisk-checker] ➜ diagnostics
- **Live tagged registry** — provenance, PEP-category, and descriptive tags are
attached to rules and drive selection/classification.
- **Stub resolution** — resolves types via `basilisk-stubs`: the standard
- library from the pinned step-3 typeshed source—custom path, explicit commit,
- verified `main`, or complete bundled ZIP snapshot—followed by third-party
- packages in the specified order
+ library from the pinned step-3 typeshed source—a custom path, or a commit
+ verified offline against the local store, defaulting to the complete bundled
+ ZIP snapshot—followed by third-party packages in the specified order
([`python/typing@6ef9f77`](https://github.com/python/typing/blob/6ef9f7719ecfff09dad8724ef42b621fd994fb5e/docs/spec/distributing.rst)).
- **Gradual adoption** — project/path configuration and the LSP adoption store
let existing codebases record debt without changing the default rule set.
diff --git a/crates/basilisk-checker/src/cached.rs b/crates/basilisk-checker/src/cached.rs
index 5ca75b3c..b732cace 100644
--- a/crates/basilisk-checker/src/cached.rs
+++ b/crates/basilisk-checker/src/cached.rs
@@ -1,5 +1,5 @@
//! Implements [CHKCACHE-DIAG] / [CHKCACHE-DIAG-INTERN].
-//! See docs/specs/CHECKER-CACHE-SPEC.md#chkcache-entry
+//! See docs/specs/CHECKER-CACHE-SPEC.md#CHKCACHE-ENTRY
//!
//! Owned, serde-serialisable projection of [`Diagnostic`] for the result cache.
//!
diff --git a/crates/basilisk-checker/src/collection_inference.rs b/crates/basilisk-checker/src/collection_inference.rs
index db91006c..21661e22 100644
--- a/crates/basilisk-checker/src/collection_inference.rs
+++ b/crates/basilisk-checker/src/collection_inference.rs
@@ -1,4 +1,4 @@
-//! Implements [TYPEINF-COLLECTIONS] / [TYPEINF-EXCEEDS-CONTAINERS]. See docs/specs/CHECKER-TYPE-INFERENCE-SPEC.md#typeinf-collections
+//! Implements [TYPEINF-COLLECTIONS] / [TYPEINF-EXCEEDS-CONTAINERS]. See docs/specs/CHECKER-TYPE-INFERENCE-SPEC.md#TYPEINF-COLLECTIONS
//! Collection type inference for lists, dicts, sets, and tuples.
//!
//! [TYPEINF-EXCEEDS-CONTAINERS]: the union-of-element-types inference below is
diff --git a/crates/basilisk-checker/src/diagnostic.rs b/crates/basilisk-checker/src/diagnostic.rs
index d59beccb..c454c6e5 100644
--- a/crates/basilisk-checker/src/diagnostic.rs
+++ b/crates/basilisk-checker/src/diagnostic.rs
@@ -1,4 +1,4 @@
-//! Implements [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Diagnostic data types for Basilisk.
use basilisk_resolver::Span;
diff --git a/crates/basilisk-checker/src/exports.rs b/crates/basilisk-checker/src/exports.rs
index 19412bb6..74b7c54a 100644
--- a/crates/basilisk-checker/src/exports.rs
+++ b/crates/basilisk-checker/src/exports.rs
@@ -46,6 +46,7 @@ pub fn extract_exports(
source_path: source_path.to_path_buf(),
source_span: func.name_span,
signature: Some(signature),
+ docstring: func.docstring.clone(),
provenance: Some(TypeProvenance::Source),
methods: Vec::new(),
bases: Vec::new(),
@@ -66,6 +67,7 @@ pub fn extract_exports(
.map(|func| ExternalMethod {
name: func.name.clone(),
signature: build_function_signature(func, &resolved.source),
+ docstring: func.docstring.clone(),
})
.collect();
exports.push((
@@ -76,7 +78,8 @@ pub fn extract_exports(
type_annotation: None,
source_path: source_path.to_path_buf(),
source_span: class.name_span,
- signature: Some(format!("class {}", class.name)),
+ signature: Some(class_signature(&class.name, &class.bases)),
+ docstring: class.docstring.clone(),
provenance: Some(TypeProvenance::Source),
methods,
bases: class.bases.clone(),
@@ -101,6 +104,7 @@ pub fn extract_exports(
source_path: source_path.to_path_buf(),
source_span: var.name_span,
signature: None,
+ docstring: None,
provenance: Some(TypeProvenance::Source),
methods: Vec::new(),
bases: Vec::new(),
@@ -191,6 +195,19 @@ fn parse_stub_source(
.ok()
}
+/// The `class` line hover shows for an exported class.
+///
+/// The declared bases are part of the class's shape — they are what tells a
+/// reader where its inherited members come from — so they are rendered rather
+/// than dropped ([LSPARCH-FEATURES-HOVER]).
+fn class_signature(name: &str, bases: &[String]) -> String {
+ if bases.is_empty() {
+ format!("class {name}")
+ } else {
+ format!("class {name}({})", bases.join(", "))
+ }
+}
+
fn stub_module_exports(
stub: &StubModule,
stub_path: &Path,
@@ -210,6 +227,7 @@ fn stub_module_exports(
source_path: stub_path.to_path_buf(),
source_span: Span::new(0, 0),
signature: Some(basilisk_stubs::render_stub_signature(func)),
+ docstring: None,
provenance,
methods: Vec::new(),
bases: Vec::new(),
@@ -228,6 +246,7 @@ fn stub_module_exports(
.map(|method| ExternalMethod {
name: method.name.clone(),
signature: basilisk_stubs::render_stub_signature(method),
+ docstring: None,
})
.collect();
exports.push((
@@ -238,7 +257,8 @@ fn stub_module_exports(
type_annotation: None,
source_path: stub_path.to_path_buf(),
source_span: Span::new(0, 0),
- signature: Some(format!("class {}", class.name)),
+ signature: Some(class_signature(&class.name, &class.bases)),
+ docstring: None,
provenance,
methods,
bases: class.bases.clone(),
@@ -258,6 +278,7 @@ fn stub_module_exports(
source_path: stub_path.to_path_buf(),
source_span: Span::new(0, 0),
signature: None,
+ docstring: None,
provenance,
methods: Vec::new(),
bases: Vec::new(),
@@ -457,6 +478,7 @@ pub fn load_external_module_from_source_with_loader(
source_path: logical_path.to_path_buf(),
source_span: Span::new(0, 0),
signature: None,
+ docstring: None,
provenance,
methods: Vec::new(),
bases: Vec::new(),
diff --git a/crates/basilisk-checker/src/imports/resolve_tests.rs b/crates/basilisk-checker/src/imports/resolve_tests.rs
index 239f68a8..9751fe59 100644
--- a/crates/basilisk-checker/src/imports/resolve_tests.rs
+++ b/crates/basilisk-checker/src/imports/resolve_tests.rs
@@ -12,9 +12,7 @@ use std::sync::Arc;
use basilisk_stubs::typeshed::archive::{Archive, ArchiveEntry, ArchiveVfs};
use basilisk_stubs::typeshed::gittree::FileMode;
use basilisk_stubs::typeshed::snapshot::Snapshot;
-use basilisk_stubs::typeshed::source::{
- LicenseStatus, Provenance, SourceIdentity, SourceKind, Transport, TypeshedStatus,
-};
+use basilisk_stubs::typeshed::source::{LicenseStatus, SourceIdentity, SourceKind, TypeshedStatus};
use super::{resolve_module, resolve_module_with_importer, ActiveTypeshed, ImportSearchPaths};
@@ -65,11 +63,8 @@ fn custom_snapshot(modules: &[(&str, &str)]) -> ActiveTypeshed {
active_source: SourceKind::Custom,
commit: None,
tree: None,
- transport: Transport::CustomPath,
license_status: LicenseStatus::NotSupplied,
license_reference: None,
- provenance: Provenance::UserManaged,
- signed_release: false,
warnings: Vec::new(),
};
let snapshot = Snapshot::build(
diff --git a/crates/basilisk-checker/src/lib.rs b/crates/basilisk-checker/src/lib.rs
index 8181da84..65d40a3b 100644
--- a/crates/basilisk-checker/src/lib.rs
+++ b/crates/basilisk-checker/src/lib.rs
@@ -1,6 +1,6 @@
//! Implements [CHKARCH-ARCH-PIPELINE] and integrates the modules specified by
-//! [TYPEINF-SPEC] / [TYPEINF-IMPL]. See
-//! docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-arch-pipeline and
+//! [TYPEINF] / [TYPEINF-IMPL]. See
+//! docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-ARCH-PIPELINE and
//! docs/specs/CHECKER-TYPE-INFERENCE-SPEC.md#TYPEINF-IMPL.
//! Type checker for Basilisk.
//!
diff --git a/crates/basilisk-checker/src/param_infer.rs b/crates/basilisk-checker/src/param_infer.rs
index 2f6ab35c..2823f774 100644
--- a/crates/basilisk-checker/src/param_infer.rs
+++ b/crates/basilisk-checker/src/param_infer.rs
@@ -296,6 +296,7 @@ mod imported_globals_tests {
source_path: std::path::PathBuf::from("other.py"),
source_span: Span::new(0, 0),
signature: None,
+ docstring: None,
provenance: None,
methods: Vec::new(),
bases: Vec::new(),
diff --git a/crates/basilisk-checker/src/rule_tags.rs b/crates/basilisk-checker/src/rule_tags.rs
index 54698e46..cca7dd0c 100644
--- a/crates/basilisk-checker/src/rule_tags.rs
+++ b/crates/basilisk-checker/src/rule_tags.rs
@@ -1,4 +1,4 @@
-//! Implements [CHKTAG] from [CHKARCH-DIAG]. See docs/specs/CHECKER-RULE-TAGGING-SPEC.md#chktag
+//! Implements [CHKTAG] from [CHKARCH-DIAG]. See docs/specs/CHECKER-RULE-TAGGING-SPEC.md#CHKTAG
//!
//! Rule tagging. Basilisk classifies every rule with a flat set of string
//! *tags*, not a hierarchical category system. Each rule carries exactly one
diff --git a/crates/basilisk-checker/src/rules/aliases_implicit.rs b/crates/basilisk-checker/src/rules/aliases_implicit.rs
index 7dfbc669..a42ec46b 100644
--- a/crates/basilisk-checker/src/rules/aliases_implicit.rs
+++ b/crates/basilisk-checker/src/rules/aliases_implicit.rs
@@ -1,4 +1,4 @@
-//! Implements [`aliases_implicit`] from [CHKARCH-DIAG-IMMUTABILITY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-immutability
+//! Implements [`aliases_implicit`] from [CHKARCH-DIAG-IMMUTABILITY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-IMMUTABILITY
//! `aliases_implicit`: Invalid right-hand side for a `TypeAlias` annotation.
//!
//! PEP 613 requires that the RHS of an explicit `TypeAlias` annotation must be
diff --git a/crates/basilisk-checker/src/rules/aliases_newtype.rs b/crates/basilisk-checker/src/rules/aliases_newtype.rs
index 7213764d..8abf83f7 100644
--- a/crates/basilisk-checker/src/rules/aliases_newtype.rs
+++ b/crates/basilisk-checker/src/rules/aliases_newtype.rs
@@ -1,4 +1,4 @@
-//! Implements [`aliases_newtype`] from [CHKARCH-DIAG-STRUCTURAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-structural
+//! Implements [`aliases_newtype`] from [CHKARCH-DIAG-STRUCTURAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-STRUCTURAL
//! `aliases_newtype`: Invalid `NewType(...)` call.
//!
//! PEP 484 places restrictions on `NewType`:
diff --git a/crates/basilisk-checker/src/rules/aliases_recursive.rs b/crates/basilisk-checker/src/rules/aliases_recursive.rs
index 6b58caa6..88982676 100644
--- a/crates/basilisk-checker/src/rules/aliases_recursive.rs
+++ b/crates/basilisk-checker/src/rules/aliases_recursive.rs
@@ -1,4 +1,4 @@
-//! Implements [`aliases_recursive`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`aliases_recursive`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `aliases_recursive`: Cyclical type alias reference.
//!
//! A `TypeAlias`-annotated assignment whose RHS contains a forward-reference
diff --git a/crates/basilisk-checker/src/rules/aliases_type_statement.rs b/crates/basilisk-checker/src/rules/aliases_type_statement.rs
index a60d0bcb..e54c66c1 100644
--- a/crates/basilisk-checker/src/rules/aliases_type_statement.rs
+++ b/crates/basilisk-checker/src/rules/aliases_type_statement.rs
@@ -1,4 +1,4 @@
-//! Implements [`aliases_type_statement`] from [CHKARCH-DIAG-STRUCTURAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-structural
+//! Implements [`aliases_type_statement`] from [CHKARCH-DIAG-STRUCTURAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-STRUCTURAL
//! `aliases_type_statement`: Invalid RHS in a PEP 695 `type X = rhs` statement.
//!
//! PEP 695 requires the RHS of a `type` statement to be a valid type expression.
diff --git a/crates/basilisk-checker/src/rules/aliases_typealiastype.rs b/crates/basilisk-checker/src/rules/aliases_typealiastype.rs
index d52b087f..9c05a09d 100644
--- a/crates/basilisk-checker/src/rules/aliases_typealiastype.rs
+++ b/crates/basilisk-checker/src/rules/aliases_typealiastype.rs
@@ -1,4 +1,4 @@
-//! Implements [`aliases_typealiastype`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`aliases_typealiastype`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `aliases_typealiastype`: Invalid `TypeAliasType(...)` call.
//!
//! Detects violations in `TypeAliasType(...)` calls:
diff --git a/crates/basilisk-checker/src/rules/annotations_forward_refs/scope.rs b/crates/basilisk-checker/src/rules/annotations_forward_refs/scope.rs
index 127f5523..f0cd2a47 100644
--- a/crates/basilisk-checker/src/rules/annotations_forward_refs/scope.rs
+++ b/crates/basilisk-checker/src/rules/annotations_forward_refs/scope.rs
@@ -1,4 +1,4 @@
-//! Implements [`annotations_forward_refs`] from [CHKARCH-DIAG-IMMUTABILITY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-immutability
+//! Implements [`annotations_forward_refs`] from [CHKARCH-DIAG-IMMUTABILITY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-IMMUTABILITY
//! Module scope and circular annotation helpers for `annotations_forward_refs`.
//!
//! Contains helpers for building module scope name sets, detecting circular
diff --git a/crates/basilisk-checker/src/rules/annotations_forward_refs/type_checks.rs b/crates/basilisk-checker/src/rules/annotations_forward_refs/type_checks.rs
index e45072b3..b02256f3 100644
--- a/crates/basilisk-checker/src/rules/annotations_forward_refs/type_checks.rs
+++ b/crates/basilisk-checker/src/rules/annotations_forward_refs/type_checks.rs
@@ -1,4 +1,4 @@
-//! Implements [`annotations_forward_refs`] from [CHKARCH-DIAG-IMMUTABILITY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-immutability
+//! Implements [`annotations_forward_refs`] from [CHKARCH-DIAG-IMMUTABILITY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-IMMUTABILITY
//! Structural annotation validity checks for `annotations_forward_refs`.
//!
//! Contains pure functions for detecting structurally invalid type expressions
diff --git a/crates/basilisk-checker/src/rules/annotations_generators.rs b/crates/basilisk-checker/src/rules/annotations_generators.rs
index a10eee31..946db4ba 100644
--- a/crates/basilisk-checker/src/rules/annotations_generators.rs
+++ b/crates/basilisk-checker/src/rules/annotations_generators.rs
@@ -1,4 +1,4 @@
-//! Implements [`annotations_generators`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`annotations_generators`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `annotations_generators`: Generator return type and yield type violations.
//!
//! A generator function (one containing `yield` or `yield from`) must declare
diff --git a/crates/basilisk-checker/src/rules/annotations_generators_2/annotation.rs b/crates/basilisk-checker/src/rules/annotations_generators_2/annotation.rs
index cbb50353..98078db6 100644
--- a/crates/basilisk-checker/src/rules/annotations_generators_2/annotation.rs
+++ b/crates/basilisk-checker/src/rules/annotations_generators_2/annotation.rs
@@ -1,4 +1,4 @@
-//! Implements [`annotations_generators_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`annotations_generators_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Annotation parsing for `annotations_generators_2`.
//!
//! Provides utilities for recognising and decomposing generator-like return
diff --git a/crates/basilisk-checker/src/rules/annotations_generators_2/type_check.rs b/crates/basilisk-checker/src/rules/annotations_generators_2/type_check.rs
index 9fb47033..822614ec 100644
--- a/crates/basilisk-checker/src/rules/annotations_generators_2/type_check.rs
+++ b/crates/basilisk-checker/src/rules/annotations_generators_2/type_check.rs
@@ -1,4 +1,4 @@
-//! Implements [`annotations_generators_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`annotations_generators_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Type checking helpers for `annotations_generators_2`.
//!
//! Contains compatibility checks for yield/send/return types and the
diff --git a/crates/basilisk-checker/src/rules/annotations_generators_2/yield_scan.rs b/crates/basilisk-checker/src/rules/annotations_generators_2/yield_scan.rs
index 5107ca07..957de02e 100644
--- a/crates/basilisk-checker/src/rules/annotations_generators_2/yield_scan.rs
+++ b/crates/basilisk-checker/src/rules/annotations_generators_2/yield_scan.rs
@@ -1,4 +1,4 @@
-//! Implements [`annotations_generators_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`annotations_generators_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Yield expression scanning for `annotations_generators_2`.
//!
//! Provides a byte-level scanner that finds `yield` and `yield from`
diff --git a/crates/basilisk-checker/src/rules/annotations_generators_helpers.rs b/crates/basilisk-checker/src/rules/annotations_generators_helpers.rs
index 7f7156d8..e23340c5 100644
--- a/crates/basilisk-checker/src/rules/annotations_generators_helpers.rs
+++ b/crates/basilisk-checker/src/rules/annotations_generators_helpers.rs
@@ -1,4 +1,4 @@
-//! Implements [`annotations_generators`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`annotations_generators`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Helper functions for `annotations_generators`: Generator return type and yield type
//! violations.
//!
diff --git a/crates/basilisk-checker/src/rules/annotations_typeexpr.rs b/crates/basilisk-checker/src/rules/annotations_typeexpr.rs
index a6b18b83..74b3794d 100644
--- a/crates/basilisk-checker/src/rules/annotations_typeexpr.rs
+++ b/crates/basilisk-checker/src/rules/annotations_typeexpr.rs
@@ -1,4 +1,4 @@
-//! Implements [`annotations_typeexpr`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Implements [`annotations_typeexpr`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
//! `annotations_typeexpr`: Invalid type form — numeric literal used as type annotation.
//!
//! Type annotations must be type expressions, not literal values. Using a
diff --git a/crates/basilisk-checker/src/rules/assignment_compatibility/alias_match.rs b/crates/basilisk-checker/src/rules/assignment_compatibility/alias_match.rs
index 8c93aa41..9abe985f 100644
--- a/crates/basilisk-checker/src/rules/assignment_compatibility/alias_match.rs
+++ b/crates/basilisk-checker/src/rules/assignment_compatibility/alias_match.rs
@@ -1,4 +1,4 @@
-//! Implements [`assignment_compatibility`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Implements [`assignment_compatibility`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
//! Recursive type-alias value matching for `assignment_compatibility`.
//!
//! Legacy type aliases such as
diff --git a/crates/basilisk-checker/src/rules/assignment_compatibility/callable_check.rs b/crates/basilisk-checker/src/rules/assignment_compatibility/callable_check.rs
index e31037a1..325e8e1a 100644
--- a/crates/basilisk-checker/src/rules/assignment_compatibility/callable_check.rs
+++ b/crates/basilisk-checker/src/rules/assignment_compatibility/callable_check.rs
@@ -1,4 +1,4 @@
-//! Implements [`assignment_compatibility`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`assignment_compatibility`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Structural callable subtyping for callback protocols and `Callable` forms.
//!
//! E0014's name-based comparison cannot evaluate structural compatibility
diff --git a/crates/basilisk-checker/src/rules/assignment_compatibility/dataclass_check.rs b/crates/basilisk-checker/src/rules/assignment_compatibility/dataclass_check.rs
index 9bf53829..814c3345 100644
--- a/crates/basilisk-checker/src/rules/assignment_compatibility/dataclass_check.rs
+++ b/crates/basilisk-checker/src/rules/assignment_compatibility/dataclass_check.rs
@@ -1,4 +1,4 @@
-//! Implements [`assignment_compatibility`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Implements [`assignment_compatibility`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
//! Dataclass attribute assignment checking for `assignment_compatibility`.
//!
//! Validates module-level attribute assignments (`instance.field = value`)
diff --git a/crates/basilisk-checker/src/rules/assignment_compatibility/default_spec.rs b/crates/basilisk-checker/src/rules/assignment_compatibility/default_spec.rs
index ad4cc887..e338f1fa 100644
--- a/crates/basilisk-checker/src/rules/assignment_compatibility/default_spec.rs
+++ b/crates/basilisk-checker/src/rules/assignment_compatibility/default_spec.rs
@@ -1,4 +1,4 @@
-//! Implements [`assignment_compatibility`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`assignment_compatibility`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! PEP 696 default-specialization mismatch for bare generic class assignments.
//!
//! A bare reference to a generic class whose remaining free type parameters
diff --git a/crates/basilisk-checker/src/rules/assignment_compatibility/literal_parse.rs b/crates/basilisk-checker/src/rules/assignment_compatibility/literal_parse.rs
index ead48737..0e73abf7 100644
--- a/crates/basilisk-checker/src/rules/assignment_compatibility/literal_parse.rs
+++ b/crates/basilisk-checker/src/rules/assignment_compatibility/literal_parse.rs
@@ -1,4 +1,4 @@
-//! Implements [`assignment_compatibility`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Implements [`assignment_compatibility`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
//! Literal value parsing for `assignment_compatibility`.
//!
//! Provides functions that parse source-text representations of Python literals
diff --git a/crates/basilisk-checker/src/rules/assignment_compatibility/protocol_members.rs b/crates/basilisk-checker/src/rules/assignment_compatibility/protocol_members.rs
index 50f952b3..06ab7ab0 100644
--- a/crates/basilisk-checker/src/rules/assignment_compatibility/protocol_members.rs
+++ b/crates/basilisk-checker/src/rules/assignment_compatibility/protocol_members.rs
@@ -1,4 +1,4 @@
-//! Implements [`assignment_compatibility`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`assignment_compatibility`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Member-based protocol satisfaction (PEP 544): a class satisfies a protocol
//! when it provides every protocol member with a structurally compatible type.
diff --git a/crates/basilisk-checker/src/rules/assignment_compatibility/sig_model.rs b/crates/basilisk-checker/src/rules/assignment_compatibility/sig_model.rs
index 336b6556..24715e19 100644
--- a/crates/basilisk-checker/src/rules/assignment_compatibility/sig_model.rs
+++ b/crates/basilisk-checker/src/rules/assignment_compatibility/sig_model.rs
@@ -1,4 +1,4 @@
-//! Implements [`assignment_compatibility`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`assignment_compatibility`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Signature model for structural callable/protocol subtyping: parameter and
//! signature types, plus extraction from `ruff` AST class/function definitions.
diff --git a/crates/basilisk-checker/src/rules/assignment_compatibility/sig_subtype.rs b/crates/basilisk-checker/src/rules/assignment_compatibility/sig_subtype.rs
index 6fe3dcac..2789f6aa 100644
--- a/crates/basilisk-checker/src/rules/assignment_compatibility/sig_subtype.rs
+++ b/crates/basilisk-checker/src/rules/assignment_compatibility/sig_subtype.rs
@@ -1,4 +1,4 @@
-//! Implements [`assignment_compatibility`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`assignment_compatibility`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! The callable-subtyping algorithm from the typing spec: positional/keyword
//! matching, `*args`/`**kwargs` contravariance, defaults, and gradual forms.
diff --git a/crates/basilisk-checker/src/rules/assignment_compatibility/tuple_check.rs b/crates/basilisk-checker/src/rules/assignment_compatibility/tuple_check.rs
index e8037501..a4fa8f71 100644
--- a/crates/basilisk-checker/src/rules/assignment_compatibility/tuple_check.rs
+++ b/crates/basilisk-checker/src/rules/assignment_compatibility/tuple_check.rs
@@ -1,4 +1,4 @@
-//! Implements [`assignment_compatibility`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Implements [`assignment_compatibility`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
//! Tuple assignment checking for `assignment_compatibility`.
//!
//! Validates that re-assignments to tuple-annotated module variables are
diff --git a/crates/basilisk-checker/src/rules/assignment_compatibility/typeddict_struct.rs b/crates/basilisk-checker/src/rules/assignment_compatibility/typeddict_struct.rs
index d99a8040..dbc4c7ea 100644
--- a/crates/basilisk-checker/src/rules/assignment_compatibility/typeddict_struct.rs
+++ b/crates/basilisk-checker/src/rules/assignment_compatibility/typeddict_struct.rs
@@ -1,5 +1,5 @@
//! Implements [`assignment_compatibility`] from [CHKARCH-DIAG]. See
-//! docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//!
//! PEP 705-aware structural assignability for `TypedDict`-to-`TypedDict`
//! assignments. E0014's default `Named`-vs-`Named` comparison is name equality,
diff --git a/crates/basilisk-checker/src/rules/assignment_compatibility/typeform_check.rs b/crates/basilisk-checker/src/rules/assignment_compatibility/typeform_check.rs
index 86d3ed9b..33fd08d7 100644
--- a/crates/basilisk-checker/src/rules/assignment_compatibility/typeform_check.rs
+++ b/crates/basilisk-checker/src/rules/assignment_compatibility/typeform_check.rs
@@ -1,4 +1,4 @@
-//! Implements [`assignment_compatibility`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Implements [`assignment_compatibility`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
//! `TypeForm` validation for `assignment_compatibility`.
//!
//! When the declared type is `TypeForm[T]`, the RHS must be a valid type
diff --git a/crates/basilisk-checker/src/rules/callables_annotation.rs b/crates/basilisk-checker/src/rules/callables_annotation.rs
index e9d94f76..8a9bd10f 100644
--- a/crates/basilisk-checker/src/rules/callables_annotation.rs
+++ b/crates/basilisk-checker/src/rules/callables_annotation.rs
@@ -1,4 +1,4 @@
-//! Implements [`callables_annotation`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Implements [`callables_annotation`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
//! `callables_annotation`: Invalid type argument count or form.
//!
//! Certain generic types accept a fixed number of type arguments. This rule
diff --git a/crates/basilisk-checker/src/rules/callables_kwargs.rs b/crates/basilisk-checker/src/rules/callables_kwargs.rs
index 863c48ed..c9d96fa4 100644
--- a/crates/basilisk-checker/src/rules/callables_kwargs.rs
+++ b/crates/basilisk-checker/src/rules/callables_kwargs.rs
@@ -1,4 +1,4 @@
-//! Implements [`callables_kwargs`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`callables_kwargs`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `callables_kwargs`: Unpack[`TypedDict`] kwargs violations.
//!
//! Detects invalid uses of `**kwargs: Unpack[TypedDict]` in function signatures:
diff --git a/crates/basilisk-checker/src/rules/callables_protocol/hof_paramspec.rs b/crates/basilisk-checker/src/rules/callables_protocol/hof_paramspec.rs
index 55dd326e..0de98d39 100644
--- a/crates/basilisk-checker/src/rules/callables_protocol/hof_paramspec.rs
+++ b/crates/basilisk-checker/src/rules/callables_protocol/hof_paramspec.rs
@@ -1,4 +1,4 @@
-//! Implements [`callables_protocol`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`callables_protocol`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Higher-order `ParamSpec` argument validation (PEP 612).
//! Implements [TYPEINF-GENERICS-PARAMSPEC].
//!
diff --git a/crates/basilisk-checker/src/rules/callables_protocol/mod.rs b/crates/basilisk-checker/src/rules/callables_protocol/mod.rs
index 321b19e7..f8b26659 100644
--- a/crates/basilisk-checker/src/rules/callables_protocol/mod.rs
+++ b/crates/basilisk-checker/src/rules/callables_protocol/mod.rs
@@ -1,4 +1,4 @@
-//! Implements [`callables_protocol`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`callables_protocol`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `callables_protocol`: Callable call-site arity and argument validation.
//!
//! When a parameter is annotated as `Callable[[int, str], T]`, calls to that
diff --git a/crates/basilisk-checker/src/rules/callables_protocol/paramspec_components.rs b/crates/basilisk-checker/src/rules/callables_protocol/paramspec_components.rs
index bde73fa8..3747224d 100644
--- a/crates/basilisk-checker/src/rules/callables_protocol/paramspec_components.rs
+++ b/crates/basilisk-checker/src/rules/callables_protocol/paramspec_components.rs
@@ -1,4 +1,4 @@
-//! Implements [`callables_protocol`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`callables_protocol`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `ParamSpec` component rules (PEP 612): `P.args` / `P.kwargs` placement,
//! scoping, and transmission through `*args` / `**kwargs` forwarding calls.
diff --git a/crates/basilisk-checker/src/rules/callables_protocol_2/callable.rs b/crates/basilisk-checker/src/rules/callables_protocol_2/callable.rs
index 4173841c..d8476f8f 100644
--- a/crates/basilisk-checker/src/rules/callables_protocol_2/callable.rs
+++ b/crates/basilisk-checker/src/rules/callables_protocol_2/callable.rs
@@ -1,4 +1,4 @@
-//! Implements [`callables_protocol_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`callables_protocol_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Callable type parsing and compatibility checking for `callables_protocol_2`.
use basilisk_resolver::Span;
diff --git a/crates/basilisk-checker/src/rules/callables_protocol_2/checks.rs b/crates/basilisk-checker/src/rules/callables_protocol_2/checks.rs
index 35e445f8..4438d7d4 100644
--- a/crates/basilisk-checker/src/rules/callables_protocol_2/checks.rs
+++ b/crates/basilisk-checker/src/rules/callables_protocol_2/checks.rs
@@ -1,4 +1,4 @@
-//! Implements [`callables_protocol_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`callables_protocol_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Compatibility check functions for `callables_protocol_2`.
use std::collections::HashMap;
diff --git a/crates/basilisk-checker/src/rules/callables_protocol_2/context.rs b/crates/basilisk-checker/src/rules/callables_protocol_2/context.rs
index 29eecee7..08d2cbea 100644
--- a/crates/basilisk-checker/src/rules/callables_protocol_2/context.rs
+++ b/crates/basilisk-checker/src/rules/callables_protocol_2/context.rs
@@ -1,4 +1,4 @@
-//! Implements [`callables_protocol_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`callables_protocol_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Module context, function signatures, and protocol info for `callables_protocol_2`.
use ruff_python_ast::{self as ast, Expr, Stmt};
diff --git a/crates/basilisk-checker/src/rules/callables_protocol_2/protocol.rs b/crates/basilisk-checker/src/rules/callables_protocol_2/protocol.rs
index 66a74fb5..e10aee00 100644
--- a/crates/basilisk-checker/src/rules/callables_protocol_2/protocol.rs
+++ b/crates/basilisk-checker/src/rules/callables_protocol_2/protocol.rs
@@ -1,4 +1,4 @@
-//! Implements [`callables_protocol_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`callables_protocol_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Protocol compatibility checking for `callables_protocol_2`.
use basilisk_resolver::Span;
diff --git a/crates/basilisk-checker/src/rules/callables_subtyping.rs b/crates/basilisk-checker/src/rules/callables_subtyping.rs
index bc22b6e6..ce20c78c 100644
--- a/crates/basilisk-checker/src/rules/callables_subtyping.rs
+++ b/crates/basilisk-checker/src/rules/callables_subtyping.rs
@@ -1,4 +1,4 @@
-//! Implements [`callables_subtyping`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`callables_subtyping`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `callables_subtyping`: Callable subtyping violations (covariance / contravariance).
//!
//! Callable types are covariant with respect to return types and contravariant
diff --git a/crates/basilisk-checker/src/rules/calls_argument_count.rs b/crates/basilisk-checker/src/rules/calls_argument_count.rs
index daa14a97..fbdb29b7 100644
--- a/crates/basilisk-checker/src/rules/calls_argument_count.rs
+++ b/crates/basilisk-checker/src/rules/calls_argument_count.rs
@@ -1,4 +1,4 @@
-//! Implements [`calls_argument_count`] from [CHKARCH-DIAG-IMMUTABILITY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-immutability
+//! Implements [`calls_argument_count`] from [CHKARCH-DIAG-IMMUTABILITY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-IMMUTABILITY
//! `calls_argument_count`: Too few arguments in a function call.
//!
//! When a function is called with fewer positional arguments than it has
diff --git a/crates/basilisk-checker/src/rules/calls_argument_type.rs b/crates/basilisk-checker/src/rules/calls_argument_type.rs
index 269fa043..e77b242f 100644
--- a/crates/basilisk-checker/src/rules/calls_argument_type.rs
+++ b/crates/basilisk-checker/src/rules/calls_argument_type.rs
@@ -1,4 +1,4 @@
-//! Implements [`calls_argument_type`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Implements [`calls_argument_type`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
//! `calls_argument_type`: Argument type mismatch at a call site.
//!
//! When a function is called with a literal argument whose type is clearly
diff --git a/crates/basilisk-checker/src/rules/classes_classvar/args.rs b/crates/basilisk-checker/src/rules/classes_classvar/args.rs
index 0fc74a7c..9de4ac6a 100644
--- a/crates/basilisk-checker/src/rules/classes_classvar/args.rs
+++ b/crates/basilisk-checker/src/rules/classes_classvar/args.rs
@@ -1,4 +1,4 @@
-//! Implements [`classes_classvar`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-ownership
+//! Implements [`classes_classvar`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-OWNERSHIP
//! Argument validation helpers for `classes_classvar`: `ClassVar` argument correctness
//! checks and type-mismatch detection between the `ClassVar` inner type and the RHS.
diff --git a/crates/basilisk-checker/src/rules/classes_classvar/helpers.rs b/crates/basilisk-checker/src/rules/classes_classvar/helpers.rs
index 37c8cba3..54964065 100644
--- a/crates/basilisk-checker/src/rules/classes_classvar/helpers.rs
+++ b/crates/basilisk-checker/src/rules/classes_classvar/helpers.rs
@@ -1,4 +1,4 @@
-//! Implements [`classes_classvar`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-ownership
+//! Implements [`classes_classvar`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-OWNERSHIP
//! Shared helper utilities for `classes_classvar`: text-based `ClassVar` detection,
//! diagnostic construction, and the `TypeParamKind` classification enum.
diff --git a/crates/basilisk-checker/src/rules/classes_classvar/instance.rs b/crates/basilisk-checker/src/rules/classes_classvar/instance.rs
index 48243c70..07fe1abf 100644
--- a/crates/basilisk-checker/src/rules/classes_classvar/instance.rs
+++ b/crates/basilisk-checker/src/rules/classes_classvar/instance.rs
@@ -1,4 +1,4 @@
-//! Implements [`classes_classvar`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-ownership
+//! Implements [`classes_classvar`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-OWNERSHIP
//! Instance-level `ClassVar` violation checks for `classes_classvar`.
//!
//! Handles two cases:
diff --git a/crates/basilisk-checker/src/rules/classes_classvar/protocol.rs b/crates/basilisk-checker/src/rules/classes_classvar/protocol.rs
index 59912db2..fbdf7e74 100644
--- a/crates/basilisk-checker/src/rules/classes_classvar/protocol.rs
+++ b/crates/basilisk-checker/src/rules/classes_classvar/protocol.rs
@@ -1,4 +1,4 @@
-//! Implements [`classes_classvar`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-ownership
+//! Implements [`classes_classvar`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-OWNERSHIP
//! Protocol `ClassVar` conformance checks for `classes_classvar`.
//!
//! When a variable is typed as a `Protocol` with `ClassVar` attributes, the RHS
diff --git a/crates/basilisk-checker/src/rules/classes_override.rs b/crates/basilisk-checker/src/rules/classes_override.rs
index e1a1fe7b..a54f701d 100644
--- a/crates/basilisk-checker/src/rules/classes_override.rs
+++ b/crates/basilisk-checker/src/rules/classes_override.rs
@@ -1,4 +1,4 @@
-//! Implements [`classes_override`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Implements [`classes_override`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
//! `classes_override`: Incompatible method override.
//!
//! When a class method marked with `@override` has a different parameter
diff --git a/crates/basilisk-checker/src/rules/classes_override_2.rs b/crates/basilisk-checker/src/rules/classes_override_2.rs
index 2036019f..3083a069 100644
--- a/crates/basilisk-checker/src/rules/classes_override_2.rs
+++ b/crates/basilisk-checker/src/rules/classes_override_2.rs
@@ -1,4 +1,4 @@
-//! Implements [`classes_override_2`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Implements [`classes_override_2`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
//! `classes_override_2`: Incompatible class attribute override.
//!
//! When a child class declares an attribute that also exists in a same-module
diff --git a/crates/basilisk-checker/src/rules/classes_override_3.rs b/crates/basilisk-checker/src/rules/classes_override_3.rs
index 40e2936f..0949c137 100644
--- a/crates/basilisk-checker/src/rules/classes_override_3.rs
+++ b/crates/basilisk-checker/src/rules/classes_override_3.rs
@@ -1,4 +1,4 @@
-//! Implements [`classes_override_3`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-ownership
+//! Implements [`classes_override_3`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-OWNERSHIP
//! `classes_override_3`: `@override` on a method with no matching ancestor method.
//!
//! PEP 698 — a method decorated `@override` (or `typing.override`) must actually
diff --git a/crates/basilisk-checker/src/rules/constructors_call_init/helpers.rs b/crates/basilisk-checker/src/rules/constructors_call_init/helpers.rs
index f0e7804d..936e2fbb 100644
--- a/crates/basilisk-checker/src/rules/constructors_call_init/helpers.rs
+++ b/crates/basilisk-checker/src/rules/constructors_call_init/helpers.rs
@@ -1,4 +1,4 @@
-//! Implements [`constructors_call_init`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`constructors_call_init`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Helper functions for `constructors_call_init`: Constructor call errors.
use std::collections::HashMap;
diff --git a/crates/basilisk-checker/src/rules/constructors_call_new.rs b/crates/basilisk-checker/src/rules/constructors_call_new.rs
index ad484f63..46f71b6a 100644
--- a/crates/basilisk-checker/src/rules/constructors_call_new.rs
+++ b/crates/basilisk-checker/src/rules/constructors_call_new.rs
@@ -1,4 +1,4 @@
-//! Implements [`constructors_call_new`] from [CHKARCH-DIAG-OPTIONAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-optional
+//! Implements [`constructors_call_new`] from [CHKARCH-DIAG-OPTIONAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-OPTIONAL
//! `constructors_call_new`: Constructor call type mismatch with specialized generic class.
//!
//! When a generic class is called with explicit type arguments (e.g.
diff --git a/crates/basilisk-checker/src/rules/constructors_call_type/helpers.rs b/crates/basilisk-checker/src/rules/constructors_call_type/helpers.rs
index 2cc8affc..f17c6644 100644
--- a/crates/basilisk-checker/src/rules/constructors_call_type/helpers.rs
+++ b/crates/basilisk-checker/src/rules/constructors_call_type/helpers.rs
@@ -1,4 +1,4 @@
-//! Implements [`constructors_call_type`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`constructors_call_type`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Helper types and functions for `constructors_call_type`.
//!
//! Contains constructor signature resolution, argument type checking,
diff --git a/crates/basilisk-checker/src/rules/constructors_callable.rs b/crates/basilisk-checker/src/rules/constructors_callable.rs
index 90dc8856..1c98a3f9 100644
--- a/crates/basilisk-checker/src/rules/constructors_callable.rs
+++ b/crates/basilisk-checker/src/rules/constructors_callable.rs
@@ -1,4 +1,4 @@
-//! Implements [`constructors_callable`] from [CHKARCH-DIAG-CTOR-CALLABLE]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-ctor-callable
+//! Implements [`constructors_callable`] from [CHKARCH-DIAG-CTOR-CALLABLE]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-CTOR-CALLABLE
//! `constructors_callable`: Invalid call to a constructor-derived callable.
//!
//! Implements the typing spec rule "Converting a constructor to callable"
diff --git a/crates/basilisk-checker/src/rules/dataclasses_frozen.rs b/crates/basilisk-checker/src/rules/dataclasses_frozen.rs
index 2debbe0b..10736381 100644
--- a/crates/basilisk-checker/src/rules/dataclasses_frozen.rs
+++ b/crates/basilisk-checker/src/rules/dataclasses_frozen.rs
@@ -1,4 +1,4 @@
-//! Implements [`dataclasses_frozen`] from [CHKARCH-DIAG-STRUCTURAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-structural
+//! Implements [`dataclasses_frozen`] from [CHKARCH-DIAG-STRUCTURAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-STRUCTURAL
//! `dataclasses_frozen`: Assignment to attribute of a frozen dataclass instance, or invalid
//! frozen/non-frozen dataclass inheritance.
//!
diff --git a/crates/basilisk-checker/src/rules/dataclasses_hash.rs b/crates/basilisk-checker/src/rules/dataclasses_hash.rs
index d76c8b54..797b108f 100644
--- a/crates/basilisk-checker/src/rules/dataclasses_hash.rs
+++ b/crates/basilisk-checker/src/rules/dataclasses_hash.rs
@@ -1,4 +1,4 @@
-//! Implements [`dataclasses_hash`] from [CHKARCH-DIAG-COERCION]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-coercion
+//! Implements [`dataclasses_hash`] from [CHKARCH-DIAG-COERCION]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-COERCION
//! `dataclasses_hash`: Non-hashable dataclass assigned to a `Hashable`-annotated variable.
//!
//! A `@dataclass` with `eq=True` (the default) sets `__hash__` to `None` unless
diff --git a/crates/basilisk-checker/src/rules/dataclasses_inheritance.rs b/crates/basilisk-checker/src/rules/dataclasses_inheritance.rs
index 2ad00d9b..4d38ecc1 100644
--- a/crates/basilisk-checker/src/rules/dataclasses_inheritance.rs
+++ b/crates/basilisk-checker/src/rules/dataclasses_inheritance.rs
@@ -1,4 +1,4 @@
-//! Implements [`dataclasses_inheritance`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-ownership
+//! Implements [`dataclasses_inheritance`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-OWNERSHIP
//! `dataclasses_inheritance`: Dataclass field without a default after a field with a default.
//!
//! A dataclass synthesizes an `__init__` whose parameters follow field
diff --git a/crates/basilisk-checker/src/rules/dataclasses_kwonly.rs b/crates/basilisk-checker/src/rules/dataclasses_kwonly.rs
index 073225f0..dfd652dc 100644
--- a/crates/basilisk-checker/src/rules/dataclasses_kwonly.rs
+++ b/crates/basilisk-checker/src/rules/dataclasses_kwonly.rs
@@ -1,4 +1,4 @@
-//! Implements [`dataclasses_kwonly`] from [CHKARCH-DIAG-COERCION]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-coercion
+//! Implements [`dataclasses_kwonly`] from [CHKARCH-DIAG-COERCION]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-COERCION
//! `dataclasses_kwonly`: Dataclass constructor argument violations.
//!
//! Reports errors when:
diff --git a/crates/basilisk-checker/src/rules/dataclasses_match_args.rs b/crates/basilisk-checker/src/rules/dataclasses_match_args.rs
index 7d07c7c4..c3f5b7bc 100644
--- a/crates/basilisk-checker/src/rules/dataclasses_match_args.rs
+++ b/crates/basilisk-checker/src/rules/dataclasses_match_args.rs
@@ -1,4 +1,4 @@
-//! Implements [`dataclasses_match_args`] from [CHKARCH-DIAG-STRUCTURAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-structural
+//! Implements [`dataclasses_match_args`] from [CHKARCH-DIAG-STRUCTURAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-STRUCTURAL
//! `dataclasses_match_args`: Access to `__match_args__` on a dataclass with `match_args=False`.
//!
//! When `@dataclass(match_args=False)` is specified, Python does **not** generate
diff --git a/crates/basilisk-checker/src/rules/dataclasses_order.rs b/crates/basilisk-checker/src/rules/dataclasses_order.rs
index 2c754e8c..967f5a22 100644
--- a/crates/basilisk-checker/src/rules/dataclasses_order.rs
+++ b/crates/basilisk-checker/src/rules/dataclasses_order.rs
@@ -1,4 +1,4 @@
-//! Implements [`dataclasses_order`] from [CHKARCH-DIAG-COERCION]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-coercion
+//! Implements [`dataclasses_order`] from [CHKARCH-DIAG-COERCION]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-COERCION
//! `dataclasses_order`: Invalid ordering comparison of dataclass instances.
//!
//! When `@dataclass(order=True)`, Python synthesizes `__lt__`, `__le__`, `__gt__`,
diff --git a/crates/basilisk-checker/src/rules/dataclasses_postinit.rs b/crates/basilisk-checker/src/rules/dataclasses_postinit.rs
index 5b31c828..05b4bd1a 100644
--- a/crates/basilisk-checker/src/rules/dataclasses_postinit.rs
+++ b/crates/basilisk-checker/src/rules/dataclasses_postinit.rs
@@ -1,4 +1,4 @@
-//! Implements [`dataclasses_postinit`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`dataclasses_postinit`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `dataclasses_postinit`: `InitVar` field validation in dataclasses.
//!
//! Detects two categories of `InitVar` violations:
diff --git a/crates/basilisk-checker/src/rules/dataclasses_slots.rs b/crates/basilisk-checker/src/rules/dataclasses_slots.rs
index ac45af47..5768ba3d 100644
--- a/crates/basilisk-checker/src/rules/dataclasses_slots.rs
+++ b/crates/basilisk-checker/src/rules/dataclasses_slots.rs
@@ -1,4 +1,4 @@
-//! Implements [`dataclasses_slots`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`dataclasses_slots`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `dataclasses_slots`: Dataclass slots violations.
//!
//! Reports errors when:
diff --git a/crates/basilisk-checker/src/rules/dataclasses_transform_class/converter.rs b/crates/basilisk-checker/src/rules/dataclasses_transform_class/converter.rs
index 812632bf..8e72471b 100644
--- a/crates/basilisk-checker/src/rules/dataclasses_transform_class/converter.rs
+++ b/crates/basilisk-checker/src/rules/dataclasses_transform_class/converter.rs
@@ -1,4 +1,4 @@
-//! Implements [`dataclasses_transform_class`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`dataclasses_transform_class`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `dataclass_transform` field-specifier `converter` support (PEP 681).
//!
//! When a field specifier call carries `converter=fn`, the type accepted by
diff --git a/crates/basilisk-checker/src/rules/dataclasses_transform_class/helpers.rs b/crates/basilisk-checker/src/rules/dataclasses_transform_class/helpers.rs
index aa4430e8..65b05812 100644
--- a/crates/basilisk-checker/src/rules/dataclasses_transform_class/helpers.rs
+++ b/crates/basilisk-checker/src/rules/dataclasses_transform_class/helpers.rs
@@ -1,4 +1,4 @@
-//! Implements [`dataclasses_transform_class`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`dataclasses_transform_class`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Helper types and functions for `dataclasses_transform_class`.
//!
//! Contains data types for transform-class settings, source text parsing
diff --git a/crates/basilisk-checker/src/rules/dataclasses_transform_meta/helpers.rs b/crates/basilisk-checker/src/rules/dataclasses_transform_meta/helpers.rs
index 23061779..b83c65e3 100644
--- a/crates/basilisk-checker/src/rules/dataclasses_transform_meta/helpers.rs
+++ b/crates/basilisk-checker/src/rules/dataclasses_transform_meta/helpers.rs
@@ -1,4 +1,4 @@
-//! Implements [`dataclasses_transform_meta`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`dataclasses_transform_meta`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Helper types and AST collection functions for `dataclasses_transform_meta`.
//!
//! Contains data types describing `@dataclass_transform` metaclasses and
diff --git a/crates/basilisk-checker/src/rules/dataclasses_usage.rs b/crates/basilisk-checker/src/rules/dataclasses_usage.rs
index 0db83063..30d4120c 100644
--- a/crates/basilisk-checker/src/rules/dataclasses_usage.rs
+++ b/crates/basilisk-checker/src/rules/dataclasses_usage.rs
@@ -1,4 +1,4 @@
-//! Implements [`dataclasses_usage`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`dataclasses_usage`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `dataclasses_usage`: Type mismatch between a dataclass `field(default_factory=…)` and
//! the field's declared type annotation.
//!
diff --git a/crates/basilisk-checker/src/rules/dict_key_hashable.rs b/crates/basilisk-checker/src/rules/dict_key_hashable.rs
index e2f680f3..de2e8215 100644
--- a/crates/basilisk-checker/src/rules/dict_key_hashable.rs
+++ b/crates/basilisk-checker/src/rules/dict_key_hashable.rs
@@ -1,4 +1,4 @@
-//! Implements [`dict_key_hashable`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Implements [`dict_key_hashable`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
//! `dict_key_hashable`: Unhashable type used as a dict key.
//!
//! Lists, sets, and plain dicts are not hashable and cannot be used as
diff --git a/crates/basilisk-checker/src/rules/directives_assert_type.rs b/crates/basilisk-checker/src/rules/directives_assert_type.rs
index 7ba81dd9..90fd3be4 100644
--- a/crates/basilisk-checker/src/rules/directives_assert_type.rs
+++ b/crates/basilisk-checker/src/rules/directives_assert_type.rs
@@ -1,4 +1,4 @@
-//! Implements [`directives_assert_type`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-ownership
+//! Implements [`directives_assert_type`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-OWNERSHIP
//! `directives_assert_type`: Invalid `assert_type()` call.
//!
//! `assert_type(expr, Type)` must be called with exactly 2 positional arguments.
diff --git a/crates/basilisk-checker/src/rules/directives_assert_type_2.rs b/crates/basilisk-checker/src/rules/directives_assert_type_2.rs
index afd36761..3a18ab43 100644
--- a/crates/basilisk-checker/src/rules/directives_assert_type_2.rs
+++ b/crates/basilisk-checker/src/rules/directives_assert_type_2.rs
@@ -1,4 +1,4 @@
-//! Implements [`directives_assert_type_2`] from [CHKARCH-DIAG-STRUCTURAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-structural
+//! Implements [`directives_assert_type_2`] from [CHKARCH-DIAG-STRUCTURAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-STRUCTURAL
//! `directives_assert_type_2`: `assert_type()` type mismatch.
//!
//! `assert_type(expr, Type)` is a static-analysis directive that verifies the
diff --git a/crates/basilisk-checker/src/rules/directives_cast.rs b/crates/basilisk-checker/src/rules/directives_cast.rs
index 27bb903f..71bc2524 100644
--- a/crates/basilisk-checker/src/rules/directives_cast.rs
+++ b/crates/basilisk-checker/src/rules/directives_cast.rs
@@ -1,4 +1,4 @@
-//! Implements [`directives_cast`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-ownership
+//! Implements [`directives_cast`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-OWNERSHIP
//! `directives_cast`: Invalid `cast()` call.
//!
//! `typing.cast(typ, val)` must be called with exactly two positional arguments,
diff --git a/crates/basilisk-checker/src/rules/directives_deprecated/collect.rs b/crates/basilisk-checker/src/rules/directives_deprecated/collect.rs
index 547acf5e..49949871 100644
--- a/crates/basilisk-checker/src/rules/directives_deprecated/collect.rs
+++ b/crates/basilisk-checker/src/rules/directives_deprecated/collect.rs
@@ -1,4 +1,4 @@
-//! Implements [`directives_deprecated`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`directives_deprecated`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Collection helpers for `directives_deprecated`.
//!
//! Functions that scan an AST or source text to build maps of deprecated
diff --git a/crates/basilisk-checker/src/rules/directives_deprecated/decorators.rs b/crates/basilisk-checker/src/rules/directives_deprecated/decorators.rs
index 7ddffbd1..d9a9fc97 100644
--- a/crates/basilisk-checker/src/rules/directives_deprecated/decorators.rs
+++ b/crates/basilisk-checker/src/rules/directives_deprecated/decorators.rs
@@ -1,4 +1,4 @@
-//! Implements [`directives_deprecated`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`directives_deprecated`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Decorator detection helpers for `directives_deprecated`.
use ruff_python_ast::Expr;
diff --git a/crates/basilisk-checker/src/rules/directives_deprecated/types.rs b/crates/basilisk-checker/src/rules/directives_deprecated/types.rs
index 876382d8..772049e7 100644
--- a/crates/basilisk-checker/src/rules/directives_deprecated/types.rs
+++ b/crates/basilisk-checker/src/rules/directives_deprecated/types.rs
@@ -1,4 +1,4 @@
-//! Implements [`directives_deprecated`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`directives_deprecated`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Shared data types for `directives_deprecated`.
use std::collections::{HashMap, HashSet};
diff --git a/crates/basilisk-checker/src/rules/directives_deprecated/visit_expr.rs b/crates/basilisk-checker/src/rules/directives_deprecated/visit_expr.rs
index e283f45d..ce87769c 100644
--- a/crates/basilisk-checker/src/rules/directives_deprecated/visit_expr.rs
+++ b/crates/basilisk-checker/src/rules/directives_deprecated/visit_expr.rs
@@ -1,4 +1,4 @@
-//! Implements [`directives_deprecated`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`directives_deprecated`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Expression visitors and helpers for `directives_deprecated`.
//!
//! Contains `visit_expr_for_usage` and all expression-level deprecation checks.
diff --git a/crates/basilisk-checker/src/rules/directives_deprecated/visit_stmt.rs b/crates/basilisk-checker/src/rules/directives_deprecated/visit_stmt.rs
index a959e16e..23ff77b1 100644
--- a/crates/basilisk-checker/src/rules/directives_deprecated/visit_stmt.rs
+++ b/crates/basilisk-checker/src/rules/directives_deprecated/visit_stmt.rs
@@ -1,4 +1,4 @@
-//! Implements [`directives_deprecated`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`directives_deprecated`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Statement visitor for `directives_deprecated`.
//!
//! Contains `visit_stmt_for_usage` and helpers for assignment-related
diff --git a/crates/basilisk-checker/src/rules/directives_disjoint_base.rs b/crates/basilisk-checker/src/rules/directives_disjoint_base.rs
index 313e6534..98ecfe4f 100644
--- a/crates/basilisk-checker/src/rules/directives_disjoint_base.rs
+++ b/crates/basilisk-checker/src/rules/directives_disjoint_base.rs
@@ -1,4 +1,4 @@
-//! Implements [`directives_disjoint_base`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Implements [`directives_disjoint_base`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
//! `directives_disjoint_base`: PEP 800 disjoint bases.
//!
//! PEP 800 introduces `typing.disjoint_base`. A class is a *disjoint base* when
diff --git a/crates/basilisk-checker/src/rules/directives_reveal_type.rs b/crates/basilisk-checker/src/rules/directives_reveal_type.rs
index 65901990..3486823c 100644
--- a/crates/basilisk-checker/src/rules/directives_reveal_type.rs
+++ b/crates/basilisk-checker/src/rules/directives_reveal_type.rs
@@ -1,4 +1,4 @@
-//! Implements [`directives_reveal_type`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-ownership
+//! Implements [`directives_reveal_type`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-OWNERSHIP
//! `directives_reveal_type`: Invalid `reveal_type()` call.
//!
//! `reveal_type(expr)` must be called with exactly one positional argument.
diff --git a/crates/basilisk-checker/src/rules/directives_version_platform.rs b/crates/basilisk-checker/src/rules/directives_version_platform.rs
index 515862b2..9d15a6dc 100644
--- a/crates/basilisk-checker/src/rules/directives_version_platform.rs
+++ b/crates/basilisk-checker/src/rules/directives_version_platform.rs
@@ -1,4 +1,4 @@
-//! Implements [`directives_version_platform`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`directives_version_platform`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `directives_version_platform`: Variable defined only in dead version/platform branch.
//!
//! When `sys.version_info`, `sys.platform`, or `os.name` is compared against
diff --git a/crates/basilisk-checker/src/rules/enums_behaviors.rs b/crates/basilisk-checker/src/rules/enums_behaviors.rs
index 94cbbe47..e9238843 100644
--- a/crates/basilisk-checker/src/rules/enums_behaviors.rs
+++ b/crates/basilisk-checker/src/rules/enums_behaviors.rs
@@ -1,4 +1,4 @@
-//! Implements [`enums_behaviors`] from [CHKARCH-DIAG-IMMUTABILITY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-immutability
+//! Implements [`enums_behaviors`] from [CHKARCH-DIAG-IMMUTABILITY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-IMMUTABILITY
//! `enums_behaviors`: Invalid Enum subclassing.
//!
//! An Enum class with one or more defined members is implicitly final and
diff --git a/crates/basilisk-checker/src/rules/enums_expansion.rs b/crates/basilisk-checker/src/rules/enums_expansion.rs
index d8c914a2..e46f411b 100644
--- a/crates/basilisk-checker/src/rules/enums_expansion.rs
+++ b/crates/basilisk-checker/src/rules/enums_expansion.rs
@@ -1,4 +1,4 @@
-//! Implements [`enums_expansion`] from [CHKARCH-DIAG-COERCION]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-coercion
+//! Implements [`enums_expansion`] from [CHKARCH-DIAG-COERCION]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-COERCION
//! `enums_expansion`: `assert_type` with `Literal[Enum.MEMBER]` on enum-typed param.
//!
//! This rule detects when `assert_type()` is used with a `Literal[Enum.MEMBER]` type
diff --git a/crates/basilisk-checker/src/rules/enums_member_access.rs b/crates/basilisk-checker/src/rules/enums_member_access.rs
index 17afc521..90d2eeac 100644
--- a/crates/basilisk-checker/src/rules/enums_member_access.rs
+++ b/crates/basilisk-checker/src/rules/enums_member_access.rs
@@ -1,4 +1,4 @@
-//! Implements [`enums_definition`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Implements [`enums_definition`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
//! `enums_definition`: access to an enum member that does not exist for the target.
//!
//! Enum members may be defined conditionally on a statically-known check such as
diff --git a/crates/basilisk-checker/src/rules/enums_member_values.rs b/crates/basilisk-checker/src/rules/enums_member_values.rs
index 681ef2e0..d75a5bc8 100644
--- a/crates/basilisk-checker/src/rules/enums_member_values.rs
+++ b/crates/basilisk-checker/src/rules/enums_member_values.rs
@@ -1,4 +1,4 @@
-//! Implements [`enums_member_values`] from [CHKARCH-DIAG-COERCION]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-coercion
+//! Implements [`enums_member_values`] from [CHKARCH-DIAG-COERCION]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-COERCION
//! `enums_member_values`: Enum member value incompatible with `_value_` type annotation.
//!
//! When an enum class declares `_value_: T` (annotation-only, no value), all
diff --git a/crates/basilisk-checker/src/rules/enums_members.rs b/crates/basilisk-checker/src/rules/enums_members.rs
index 59add0e9..347ef289 100644
--- a/crates/basilisk-checker/src/rules/enums_members.rs
+++ b/crates/basilisk-checker/src/rules/enums_members.rs
@@ -1,4 +1,4 @@
-//! Implements [`enums_members`] from [CHKARCH-DIAG-IMMUTABILITY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-immutability
+//! Implements [`enums_members`] from [CHKARCH-DIAG-IMMUTABILITY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-IMMUTABILITY
//! `enums_members`: Enum member annotated with an explicit type.
//!
//! In an Enum class, members should NOT carry explicit type annotations.
diff --git a/crates/basilisk-checker/src/rules/enums_members_2.rs b/crates/basilisk-checker/src/rules/enums_members_2.rs
index 97155e13..0b0ed7cb 100644
--- a/crates/basilisk-checker/src/rules/enums_members_2.rs
+++ b/crates/basilisk-checker/src/rules/enums_members_2.rs
@@ -1,4 +1,4 @@
-//! Implements [`enums_members_2`] from [CHKARCH-DIAG-COERCION]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-coercion
+//! Implements [`enums_members_2`] from [CHKARCH-DIAG-COERCION]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-COERCION
//! `enums_members_2`: Non-member referenced in `Literal[EnumClass.X]` annotation.
//!
//! The `Literal[EnumClass.X]` type is only valid when `X` is an actual enum
diff --git a/crates/basilisk-checker/src/rules/explicit_any.rs b/crates/basilisk-checker/src/rules/explicit_any.rs
index 00d2843b..98151a7d 100644
--- a/crates/basilisk-checker/src/rules/explicit_any.rs
+++ b/crates/basilisk-checker/src/rules/explicit_any.rs
@@ -1,4 +1,4 @@
-//! Implements [BSK-0014] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Implements [BSK-0014] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
//! BSK-0014: Explicit `Any` annotation.
//!
//! Emitted as a `Warning` when a function parameter or return annotation is
diff --git a/crates/basilisk-checker/src/rules/generics_base_class.rs b/crates/basilisk-checker/src/rules/generics_base_class.rs
index 0cb5f375..e6f3f21b 100644
--- a/crates/basilisk-checker/src/rules/generics_base_class.rs
+++ b/crates/basilisk-checker/src/rules/generics_base_class.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_base_class`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Implements [`generics_base_class`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
//! `generics_base_class`: Duplicate `TypeVar` in a `Generic[...]` base.
//!
//! Each type parameter in `Generic[T1, T2, ...]` must be unique.
diff --git a/crates/basilisk-checker/src/rules/generics_base_class_2.rs b/crates/basilisk-checker/src/rules/generics_base_class_2.rs
index 199ee6c1..a6c6e432 100644
--- a/crates/basilisk-checker/src/rules/generics_base_class_2.rs
+++ b/crates/basilisk-checker/src/rules/generics_base_class_2.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_base_class_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_base_class_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `generics_base_class_2`: Inconsistent `TypeVar` ordering across base classes.
//!
//! When a class inherits from multiple generic bases that share a common
diff --git a/crates/basilisk-checker/src/rules/generics_base_class_3.rs b/crates/basilisk-checker/src/rules/generics_base_class_3.rs
index 0924eae0..90f5770f 100644
--- a/crates/basilisk-checker/src/rules/generics_base_class_3.rs
+++ b/crates/basilisk-checker/src/rules/generics_base_class_3.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_base_class_3`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_base_class_3`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `generics_base_class_3`: Invariant generic type mismatch at call site.
//!
//! When a function parameter expects a parameterised generic like
diff --git a/crates/basilisk-checker/src/rules/generics_basic.rs b/crates/basilisk-checker/src/rules/generics_basic.rs
index 69dec307..06aef6c6 100644
--- a/crates/basilisk-checker/src/rules/generics_basic.rs
+++ b/crates/basilisk-checker/src/rules/generics_basic.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_basic`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Implements [`generics_basic`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
//! `generics_basic`: `TypeVar` declared with exactly one constraint.
//!
//! PEP 484 requires a `TypeVar` to have either zero constraints (unconstrained)
diff --git a/crates/basilisk-checker/src/rules/generics_basic_2.rs b/crates/basilisk-checker/src/rules/generics_basic_2.rs
index 7eb382e7..0af615e4 100644
--- a/crates/basilisk-checker/src/rules/generics_basic_2.rs
+++ b/crates/basilisk-checker/src/rules/generics_basic_2.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_basic_2`] from [CHKARCH-DIAG-IMMUTABILITY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-immutability
+//! Implements [`generics_basic_2`] from [CHKARCH-DIAG-IMMUTABILITY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-IMMUTABILITY
//! `generics_basic_2`: Non-TypeVar argument in `Generic[...]` or `Protocol[...]`.
//!
//! PEP 484 requires that all arguments to `Generic[...]` and `Protocol[...]`
diff --git a/crates/basilisk-checker/src/rules/generics_basic_3/helpers.rs b/crates/basilisk-checker/src/rules/generics_basic_3/helpers.rs
index ad66e595..2c7cbcce 100644
--- a/crates/basilisk-checker/src/rules/generics_basic_3/helpers.rs
+++ b/crates/basilisk-checker/src/rules/generics_basic_3/helpers.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_basic_3`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_basic_3`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! All internal types, parsing, and checking logic for `generics_basic_3`.
use std::collections::HashMap;
diff --git a/crates/basilisk-checker/src/rules/generics_defaults.rs b/crates/basilisk-checker/src/rules/generics_defaults.rs
index 83ac3986..bcccc5d3 100644
--- a/crates/basilisk-checker/src/rules/generics_defaults.rs
+++ b/crates/basilisk-checker/src/rules/generics_defaults.rs
@@ -1,6 +1,6 @@
//! Implements [`generics_defaults`] from [CHKARCH-DIAG-OWNERSHIP] and
//! [TYPEINF-GENERICS-DEFAULTS]. See
-//! docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-ownership
+//! docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-OWNERSHIP
//! `generics_defaults`: Non-default `TypeVar` follows a default `TypeVar` in `Generic[...]`.
//!
//! PEP 696 §Ordering defines two ordering rules for type parameters in `Generic[...]`:
diff --git a/crates/basilisk-checker/src/rules/generics_defaults_2.rs b/crates/basilisk-checker/src/rules/generics_defaults_2.rs
index 79813daf..409e8bd4 100644
--- a/crates/basilisk-checker/src/rules/generics_defaults_2.rs
+++ b/crates/basilisk-checker/src/rules/generics_defaults_2.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_defaults_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_defaults_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `generics_defaults_2`: Incompatible `TypeVar` bound or constraint with its default.
//!
//! PEP 696 specifies two constraints on `TypeVar` defaults:
diff --git a/crates/basilisk-checker/src/rules/generics_defaults_referential.rs b/crates/basilisk-checker/src/rules/generics_defaults_referential.rs
index a4bdc4c9..9c2ec885 100644
--- a/crates/basilisk-checker/src/rules/generics_defaults_referential.rs
+++ b/crates/basilisk-checker/src/rules/generics_defaults_referential.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_defaults_referential`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_defaults_referential`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `generics_defaults_referential`: Invalid `TypeVar` default referencing another `TypeVar`.
//!
//! PEP 696 specifies constraints on `TypeVar` defaults that reference other `TypeVars`:
diff --git a/crates/basilisk-checker/src/rules/generics_defaults_referential_2.rs b/crates/basilisk-checker/src/rules/generics_defaults_referential_2.rs
index e80da98f..dd9a43c1 100644
--- a/crates/basilisk-checker/src/rules/generics_defaults_referential_2.rs
+++ b/crates/basilisk-checker/src/rules/generics_defaults_referential_2.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_defaults_referential_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_defaults_referential_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `generics_defaults_referential_2`: ```TypeVar``` default referential violations.
//!
//! PEP 696 defines rules for when a `TypeVar` default references another
diff --git a/crates/basilisk-checker/src/rules/generics_defaults_referential_2_helpers.rs b/crates/basilisk-checker/src/rules/generics_defaults_referential_2_helpers.rs
index 68b294fe..55f0c32a 100644
--- a/crates/basilisk-checker/src/rules/generics_defaults_referential_2_helpers.rs
+++ b/crates/basilisk-checker/src/rules/generics_defaults_referential_2_helpers.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_defaults_referential_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_defaults_referential_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Helper types and functions for `generics_defaults_referential_2`.
//!
//! Provides source-level parsing of `TypeVar` definitions, argument splitting,
diff --git a/crates/basilisk-checker/src/rules/generics_defaults_specialization.rs b/crates/basilisk-checker/src/rules/generics_defaults_specialization.rs
index 73b4408e..6ed910b9 100644
--- a/crates/basilisk-checker/src/rules/generics_defaults_specialization.rs
+++ b/crates/basilisk-checker/src/rules/generics_defaults_specialization.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_defaults_specialization`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_defaults_specialization`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `generics_defaults_specialization`: Wrong number of type arguments to a generic class or type alias.
//!
//! When a user-defined generic class has both required (non-default) and optional
diff --git a/crates/basilisk-checker/src/rules/generics_scoping.rs b/crates/basilisk-checker/src/rules/generics_scoping.rs
index 8ef18335..3fa40744 100644
--- a/crates/basilisk-checker/src/rules/generics_scoping.rs
+++ b/crates/basilisk-checker/src/rules/generics_scoping.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_scoping`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_scoping`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `generics_scoping`: Unbound type variable in scope.
//!
//! A type variable used in a type annotation must be "in scope" — i.e. it must
diff --git a/crates/basilisk-checker/src/rules/generics_self_attributes.rs b/crates/basilisk-checker/src/rules/generics_self_attributes.rs
index b37dece2..044b4b4f 100644
--- a/crates/basilisk-checker/src/rules/generics_self_attributes.rs
+++ b/crates/basilisk-checker/src/rules/generics_self_attributes.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_self_attributes`] from [CHKARCH-DIAG-OPTIONAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-optional
+//! Implements [`generics_self_attributes`] from [CHKARCH-DIAG-OPTIONAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-OPTIONAL
//! `generics_self_attributes`: Incompatible type for `Self`-typed attribute.
//!
//! When a class declares an attribute annotated with `Self` (or `Self | None`,
diff --git a/crates/basilisk-checker/src/rules/generics_self_basic.rs b/crates/basilisk-checker/src/rules/generics_self_basic.rs
index 80d46cd7..e2810a1a 100644
--- a/crates/basilisk-checker/src/rules/generics_self_basic.rs
+++ b/crates/basilisk-checker/src/rules/generics_self_basic.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_self_basic`] from [CHKARCH-DIAG-OPTIONAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-optional
+//! Implements [`generics_self_basic`] from [CHKARCH-DIAG-OPTIONAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-OPTIONAL
//! `generics_self_basic`: `Self` type violations in generics.
//!
//! This rule detects two kinds of `Self` type violations:
diff --git a/crates/basilisk-checker/src/rules/generics_self_protocols.rs b/crates/basilisk-checker/src/rules/generics_self_protocols.rs
index 0ba5ff69..3f05ecfc 100644
--- a/crates/basilisk-checker/src/rules/generics_self_protocols.rs
+++ b/crates/basilisk-checker/src/rules/generics_self_protocols.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_self_protocols`] from [CHKARCH-DIAG-OPTIONAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-optional
+//! Implements [`generics_self_protocols`] from [CHKARCH-DIAG-OPTIONAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-OPTIONAL
//! `generics_self_protocols`: Protocol `Self`-return conformance violation.
//!
//! When a `Protocol` declares a method returning `Self`, any class passed where
diff --git a/crates/basilisk-checker/src/rules/generics_self_usage.rs b/crates/basilisk-checker/src/rules/generics_self_usage.rs
index 242887bb..cf243c3f 100644
--- a/crates/basilisk-checker/src/rules/generics_self_usage.rs
+++ b/crates/basilisk-checker/src/rules/generics_self_usage.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_self_usage`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_self_usage`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `generics_self_usage`: `Self` type used in an invalid location.
//!
//! PEP 673 defines `Self` as a special type that refers to the current class.
diff --git a/crates/basilisk-checker/src/rules/generics_syntax_compatibility.rs b/crates/basilisk-checker/src/rules/generics_syntax_compatibility.rs
index f1a705b4..02107cb9 100644
--- a/crates/basilisk-checker/src/rules/generics_syntax_compatibility.rs
+++ b/crates/basilisk-checker/src/rules/generics_syntax_compatibility.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_syntax_compatibility`] from [CHKARCH-DIAG-IMMUTABILITY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-immutability
+//! Implements [`generics_syntax_compatibility`] from [CHKARCH-DIAG-IMMUTABILITY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-IMMUTABILITY
//! `generics_syntax_compatibility`: PEP 695 type parameter syntax mixed with traditional `TypeVars`.
//!
//! PEP 695 introduced a new syntax for declaring type parameters (`class Foo[T]`
diff --git a/crates/basilisk-checker/src/rules/generics_syntax_declarations.rs b/crates/basilisk-checker/src/rules/generics_syntax_declarations.rs
index 6195bf80..93ee2131 100644
--- a/crates/basilisk-checker/src/rules/generics_syntax_declarations.rs
+++ b/crates/basilisk-checker/src/rules/generics_syntax_declarations.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_syntax_declarations`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_syntax_declarations`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `generics_syntax_declarations`: Invalid PEP 695 type parameter bound or constraint.
//!
//! PEP 695 introduced a new syntax for declaring type parameters in class and
diff --git a/crates/basilisk-checker/src/rules/generics_syntax_declarations_2.rs b/crates/basilisk-checker/src/rules/generics_syntax_declarations_2.rs
index 077aabd6..fa5f0378 100644
--- a/crates/basilisk-checker/src/rules/generics_syntax_declarations_2.rs
+++ b/crates/basilisk-checker/src/rules/generics_syntax_declarations_2.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_syntax_declarations_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_syntax_declarations_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `generics_syntax_declarations_2`: Invalid attribute access on bounded type variable.
//!
//! When a PEP 695 type parameter has a bound (e.g., `T: str`), attribute
diff --git a/crates/basilisk-checker/src/rules/generics_syntax_scoping/alias_misuse.rs b/crates/basilisk-checker/src/rules/generics_syntax_scoping/alias_misuse.rs
index ee528566..4a204b67 100644
--- a/crates/basilisk-checker/src/rules/generics_syntax_scoping/alias_misuse.rs
+++ b/crates/basilisk-checker/src/rules/generics_syntax_scoping/alias_misuse.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_syntax_scoping`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_syntax_scoping`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! PEP 695 type-alias misuse (violation 7) and type-argument bound checks
//! (violation 8) for `generics_syntax_scoping`.
//!
diff --git a/crates/basilisk-checker/src/rules/generics_syntax_scoping/violations.rs b/crates/basilisk-checker/src/rules/generics_syntax_scoping/violations.rs
index e0cc39e7..7668ed2c 100644
--- a/crates/basilisk-checker/src/rules/generics_syntax_scoping/violations.rs
+++ b/crates/basilisk-checker/src/rules/generics_syntax_scoping/violations.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_syntax_scoping`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_syntax_scoping`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! AST-driven PEP 695 scoping checks (violations 1-6) for `generics_syntax_scoping`.
//!
//! Every check consumes [`basilisk_resolver::Pep695Scoping`] — facts derived
diff --git a/crates/basilisk-checker/src/rules/generics_type_erasure.rs b/crates/basilisk-checker/src/rules/generics_type_erasure.rs
index 0d3b8a6b..5eb41207 100644
--- a/crates/basilisk-checker/src/rules/generics_type_erasure.rs
+++ b/crates/basilisk-checker/src/rules/generics_type_erasure.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_type_erasure`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_type_erasure`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `generics_type_erasure`: Access to instance attribute on a class object.
//!
//! Instance attributes (annotations without `ClassVar` in the class body that
diff --git a/crates/basilisk-checker/src/rules/generics_typevartuple_args/mod.rs b/crates/basilisk-checker/src/rules/generics_typevartuple_args/mod.rs
index 774cf2d4..e2864796 100644
--- a/crates/basilisk-checker/src/rules/generics_typevartuple_args/mod.rs
+++ b/crates/basilisk-checker/src/rules/generics_typevartuple_args/mod.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_typevartuple_args`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_typevartuple_args`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `generics_typevartuple_args`: `TypeVarTuple` argument count mismatch.
//!
//! When a constructor with `TypeVarTuple` parameters is called, the number of
diff --git a/crates/basilisk-checker/src/rules/generics_typevartuple_args/star_args.rs b/crates/basilisk-checker/src/rules/generics_typevartuple_args/star_args.rs
index bb946969..de5e2673 100644
--- a/crates/basilisk-checker/src/rules/generics_typevartuple_args/star_args.rs
+++ b/crates/basilisk-checker/src/rules/generics_typevartuple_args/star_args.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_typevartuple_args`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_typevartuple_args`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Call-site validation for `*args` annotated with an unpacked tuple type
//! (PEP 646): `*args: *tuple[int, ...]`, `*args: *tuple[int, str]`, and
//! mixed forms like `*args: *tuple[int, *tuple[str, ...], str]`.
diff --git a/crates/basilisk-checker/src/rules/generics_typevartuple_basic.rs b/crates/basilisk-checker/src/rules/generics_typevartuple_basic.rs
index 7c6a9184..2bae769e 100644
--- a/crates/basilisk-checker/src/rules/generics_typevartuple_basic.rs
+++ b/crates/basilisk-checker/src/rules/generics_typevartuple_basic.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_typevartuple_basic`] from [CHKARCH-DIAG-STRUCTURAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-structural
+//! Implements [`generics_typevartuple_basic`] from [CHKARCH-DIAG-STRUCTURAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-STRUCTURAL
//! `generics_typevartuple_basic`: Invalid `TypeVar` / `TypeVarTuple` / `ParamSpec` keyword argument combination.
//!
//! PEP 484 / PEP 695 forbid certain combinations of keyword arguments in
diff --git a/crates/basilisk-checker/src/rules/generics_typevartuple_basic_2.rs b/crates/basilisk-checker/src/rules/generics_typevartuple_basic_2.rs
index 96c8524c..ce1b38b4 100644
--- a/crates/basilisk-checker/src/rules/generics_typevartuple_basic_2.rs
+++ b/crates/basilisk-checker/src/rules/generics_typevartuple_basic_2.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_typevartuple_basic_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_typevartuple_basic_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `generics_typevartuple_basic_2`: `TypeVarTuple` must be unpacked with `*` operator.
//!
//! When a `TypeVarTuple` is used in a generic class base list or as a direct
diff --git a/crates/basilisk-checker/src/rules/generics_typevartuple_basic_3.rs b/crates/basilisk-checker/src/rules/generics_typevartuple_basic_3.rs
index 960f7d99..8fbc11f7 100644
--- a/crates/basilisk-checker/src/rules/generics_typevartuple_basic_3.rs
+++ b/crates/basilisk-checker/src/rules/generics_typevartuple_basic_3.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_typevartuple_basic_3`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_typevartuple_basic_3`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `generics_typevartuple_basic_3`: `TypeVarTuple` variance/bounds/constraints violation.
//!
//! `TypeVarTuple` does not support specification of variance, bounds, or constraints.
diff --git a/crates/basilisk-checker/src/rules/generics_typevartuple_callable.rs b/crates/basilisk-checker/src/rules/generics_typevartuple_callable.rs
index 1d8416f6..05a8429c 100644
--- a/crates/basilisk-checker/src/rules/generics_typevartuple_callable.rs
+++ b/crates/basilisk-checker/src/rules/generics_typevartuple_callable.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_typevartuple_callable`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_typevartuple_callable`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `generics_typevartuple_callable`: `TypeVarTuple` callable/tuple argument mismatch.
//!
//! When a constructor (or function) links two parameters via a `TypeVarTuple`
diff --git a/crates/basilisk-checker/src/rules/generics_typevartuple_specialization.rs b/crates/basilisk-checker/src/rules/generics_typevartuple_specialization.rs
index dcc32650..de415995 100644
--- a/crates/basilisk-checker/src/rules/generics_typevartuple_specialization.rs
+++ b/crates/basilisk-checker/src/rules/generics_typevartuple_specialization.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_typevartuple_specialization`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_typevartuple_specialization`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `generics_typevartuple_specialization`: Multiple `TypeVarTuple` unpacks in generic or tuple type.
//!
//! Only a single `TypeVarTuple` unpack (`*Ts`) may appear in a type parameter
diff --git a/crates/basilisk-checker/src/rules/generics_typevartuple_specialization_2.rs b/crates/basilisk-checker/src/rules/generics_typevartuple_specialization_2.rs
index 20f55265..f9f734a4 100644
--- a/crates/basilisk-checker/src/rules/generics_typevartuple_specialization_2.rs
+++ b/crates/basilisk-checker/src/rules/generics_typevartuple_specialization_2.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_typevartuple_specialization_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_typevartuple_specialization_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `generics_typevartuple_specialization_2`: Invalid `TypeVarTuple` specialization of generic alias.
//!
//! Two related violations are detected:
diff --git a/crates/basilisk-checker/src/rules/generics_typevartuple_unpack.rs b/crates/basilisk-checker/src/rules/generics_typevartuple_unpack.rs
index f3c820ed..d305efb7 100644
--- a/crates/basilisk-checker/src/rules/generics_typevartuple_unpack.rs
+++ b/crates/basilisk-checker/src/rules/generics_typevartuple_unpack.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_typevartuple_unpack`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_typevartuple_unpack`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `generics_typevartuple_unpack`: `TypeVarTuple` unpack minimum type argument violation.
//!
//! When a function parameter has a type annotation containing a `TypeVarTuple`
diff --git a/crates/basilisk-checker/src/rules/generics_upper_bound.rs b/crates/basilisk-checker/src/rules/generics_upper_bound.rs
index 182a63ca..8c05aa95 100644
--- a/crates/basilisk-checker/src/rules/generics_upper_bound.rs
+++ b/crates/basilisk-checker/src/rules/generics_upper_bound.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_upper_bound`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_upper_bound`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `generics_upper_bound`: `TypeVar` upper bound violation at call site.
//!
//! When a function parameter is annotated with a `TypeVar` that has an upper
diff --git a/crates/basilisk-checker/src/rules/generics_upper_bound_2.rs b/crates/basilisk-checker/src/rules/generics_upper_bound_2.rs
index 70ddffd1..a5afa620 100644
--- a/crates/basilisk-checker/src/rules/generics_upper_bound_2.rs
+++ b/crates/basilisk-checker/src/rules/generics_upper_bound_2.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_upper_bound_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_upper_bound_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `generics_upper_bound_2`: `TypeVar` bound violation at call site.
//!
//! When a function has a parameter typed with a `TypeVar` that has a `bound`,
diff --git a/crates/basilisk-checker/src/rules/generics_variance.rs b/crates/basilisk-checker/src/rules/generics_variance.rs
index 55822c34..a64be4af 100644
--- a/crates/basilisk-checker/src/rules/generics_variance.rs
+++ b/crates/basilisk-checker/src/rules/generics_variance.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_variance`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_variance`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `generics_variance`: Variance incompatibility in base class parameterisation.
//!
//! When a class inherits from a generic base class (directly or through a type
diff --git a/crates/basilisk-checker/src/rules/generics_variance_inference/check.rs b/crates/basilisk-checker/src/rules/generics_variance_inference/check.rs
index 4aae9161..cbee7cfa 100644
--- a/crates/basilisk-checker/src/rules/generics_variance_inference/check.rs
+++ b/crates/basilisk-checker/src/rules/generics_variance_inference/check.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_variance_inference`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_variance_inference`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Method-call and constructor-call type checking for `generics_variance_inference`.
use std::collections::{HashMap, HashSet};
diff --git a/crates/basilisk-checker/src/rules/generics_variance_inference/collect.rs b/crates/basilisk-checker/src/rules/generics_variance_inference/collect.rs
index adec0f8c..eb3eabee 100644
--- a/crates/basilisk-checker/src/rules/generics_variance_inference/collect.rs
+++ b/crates/basilisk-checker/src/rules/generics_variance_inference/collect.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_variance_inference`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_variance_inference`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Collection helpers for `generics_variance_inference`.
use std::collections::HashMap;
diff --git a/crates/basilisk-checker/src/rules/generics_variance_inference/types.rs b/crates/basilisk-checker/src/rules/generics_variance_inference/types.rs
index 8b475a4d..84f4c8cb 100644
--- a/crates/basilisk-checker/src/rules/generics_variance_inference/types.rs
+++ b/crates/basilisk-checker/src/rules/generics_variance_inference/types.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_variance_inference`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_variance_inference`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Data types for `generics_variance_inference`.
use std::collections::{HashMap, HashSet};
diff --git a/crates/basilisk-checker/src/rules/generics_variance_inference/utils.rs b/crates/basilisk-checker/src/rules/generics_variance_inference/utils.rs
index 1cb4b130..4ad19085 100644
--- a/crates/basilisk-checker/src/rules/generics_variance_inference/utils.rs
+++ b/crates/basilisk-checker/src/rules/generics_variance_inference/utils.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_variance_inference`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_variance_inference`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Utility functions for `generics_variance_inference`.
use crate::rules::shared::contains_typevar_reference;
diff --git a/crates/basilisk-checker/src/rules/generics_variance_inference/variance.rs b/crates/basilisk-checker/src/rules/generics_variance_inference/variance.rs
index 1625accb..0840238f 100644
--- a/crates/basilisk-checker/src/rules/generics_variance_inference/variance.rs
+++ b/crates/basilisk-checker/src/rules/generics_variance_inference/variance.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_variance_inference`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_variance_inference`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Variance inference for `generics_variance_inference`.
//! Implements [TYPEINF-GENERICS-VARIANCE].
//!
diff --git a/crates/basilisk-checker/src/rules/generics_variance_inference/variance_check.rs b/crates/basilisk-checker/src/rules/generics_variance_inference/variance_check.rs
index 975ec652..7e8b9c96 100644
--- a/crates/basilisk-checker/src/rules/generics_variance_inference/variance_check.rs
+++ b/crates/basilisk-checker/src/rules/generics_variance_inference/variance_check.rs
@@ -1,4 +1,4 @@
-//! Implements [`generics_variance_inference`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`generics_variance_inference`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Variance assignment checking for `generics_variance_inference`.
//!
//! Checks module-level and function-body assignments for variance
diff --git a/crates/basilisk-checker/src/rules/guards.rs b/crates/basilisk-checker/src/rules/guards.rs
index ac46e560..33290c28 100644
--- a/crates/basilisk-checker/src/rules/guards.rs
+++ b/crates/basilisk-checker/src/rules/guards.rs
@@ -1,4 +1,4 @@
-//! Implements helpers for [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements helpers for [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Shared guard predicates used across multiple rules.
//!
//! These predicates identify Python typing patterns where strict annotation
diff --git a/crates/basilisk-checker/src/rules/historical_positional.rs b/crates/basilisk-checker/src/rules/historical_positional.rs
index d7e9adf1..f228923c 100644
--- a/crates/basilisk-checker/src/rules/historical_positional.rs
+++ b/crates/basilisk-checker/src/rules/historical_positional.rs
@@ -1,4 +1,4 @@
-//! Implements [`historical_positional`] from [CHKARCH-DIAG-OPTIONAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-optional
+//! Implements [`historical_positional`] from [CHKARCH-DIAG-OPTIONAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-OPTIONAL
//! `historical_positional`: Historical positional-only parameter violations.
//!
//! Before PEP 570 (Python 3.8), the convention for marking parameters as
diff --git a/crates/basilisk-checker/src/rules/imports_module_attribute/mod.rs b/crates/basilisk-checker/src/rules/imports_module_attribute/mod.rs
index badaa075..44559a21 100644
--- a/crates/basilisk-checker/src/rules/imports_module_attribute/mod.rs
+++ b/crates/basilisk-checker/src/rules/imports_module_attribute/mod.rs
@@ -1,4 +1,4 @@
-//! Implements [`imports_module_attribute`] from [CHKARCH-DIAG] / [CHKARCH-DIAG-STUB-MEMBER]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-stub-member
+//! Implements [`imports_module_attribute`] from [CHKARCH-DIAG] / [CHKARCH-DIAG-STUB-MEMBER]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-STUB-MEMBER
//! `imports_module_attribute`: Access to a module attribute the local stub does not declare.
//!
//! When `import X` resolves to an authoritative user/local or selected Typeshed
diff --git a/crates/basilisk-checker/src/rules/imports_module_attribute/tests.rs b/crates/basilisk-checker/src/rules/imports_module_attribute/tests.rs
index 4c475875..5a0db2fc 100644
--- a/crates/basilisk-checker/src/rules/imports_module_attribute/tests.rs
+++ b/crates/basilisk-checker/src/rules/imports_module_attribute/tests.rs
@@ -1,4 +1,4 @@
-//! Tests for [CHKARCH-DIAG-STUB-MEMBER]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-stub-member
+//! Tests for [CHKARCH-DIAG-STUB-MEMBER]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-STUB-MEMBER
use std::collections::HashMap;
use std::path::PathBuf;
diff --git a/crates/basilisk-checker/src/rules/imports_unresolved.rs b/crates/basilisk-checker/src/rules/imports_unresolved.rs
index 5e36c347..230fcb98 100644
--- a/crates/basilisk-checker/src/rules/imports_unresolved.rs
+++ b/crates/basilisk-checker/src/rules/imports_unresolved.rs
@@ -1,4 +1,4 @@
-//! Implements [`imports_unresolved`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Implements [`imports_unresolved`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
//! `imports_unresolved`: Unresolved import.
//!
//! Fires when an import cannot be resolved and the module is not part of the
diff --git a/crates/basilisk-checker/src/rules/lambda_missing_annotations.rs b/crates/basilisk-checker/src/rules/lambda_missing_annotations.rs
index 634b9781..7692579f 100644
--- a/crates/basilisk-checker/src/rules/lambda_missing_annotations.rs
+++ b/crates/basilisk-checker/src/rules/lambda_missing_annotations.rs
@@ -1,4 +1,4 @@
-//! Implements [BSK-0040] from [CHKARCH-DIAG-IMMUTABILITY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-immutability
+//! Implements [BSK-0040] from [CHKARCH-DIAG-IMMUTABILITY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-IMMUTABILITY
//! BSK-0040: Lambda function missing type annotations.
//!
//! Emitted when a lambda function is assigned to a variable without type annotations.
diff --git a/crates/basilisk-checker/src/rules/literals_literalstring.rs b/crates/basilisk-checker/src/rules/literals_literalstring.rs
index 065217cb..e4c2e487 100644
--- a/crates/basilisk-checker/src/rules/literals_literalstring.rs
+++ b/crates/basilisk-checker/src/rules/literals_literalstring.rs
@@ -1,4 +1,4 @@
-//! Implements [`literals_literalstring`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`literals_literalstring`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `literals_literalstring`: `LiteralString` and `Literal` assignment incompatibilities.
//!
//! Detects annotated local variables inside function bodies where the declared
diff --git a/crates/basilisk-checker/src/rules/literals_literalstring_helpers.rs b/crates/basilisk-checker/src/rules/literals_literalstring_helpers.rs
index efd085c0..9bf51c44 100644
--- a/crates/basilisk-checker/src/rules/literals_literalstring_helpers.rs
+++ b/crates/basilisk-checker/src/rules/literals_literalstring_helpers.rs
@@ -1,4 +1,4 @@
-//! Implements [`literals_literalstring`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`literals_literalstring`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Helper functions for `literals_literalstring`: `LiteralString` and `Literal` assignment
//! incompatibilities.
//!
diff --git a/crates/basilisk-checker/src/rules/literals_parameterizations.rs b/crates/basilisk-checker/src/rules/literals_parameterizations.rs
index 59f5b44e..1f8047fc 100644
--- a/crates/basilisk-checker/src/rules/literals_parameterizations.rs
+++ b/crates/basilisk-checker/src/rules/literals_parameterizations.rs
@@ -1,4 +1,4 @@
-//! Implements [`literals_parameterizations`] from [CHKARCH-DIAG-STRUCTURAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-structural
+//! Implements [`literals_parameterizations`] from [CHKARCH-DIAG-STRUCTURAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-STRUCTURAL
//! `literals_parameterizations`: Invalid `Literal` parameterization.
//!
//! PEP 586 restricts what values may appear inside `Literal[...]`.
diff --git a/crates/basilisk-checker/src/rules/literals_parameterizations_2.rs b/crates/basilisk-checker/src/rules/literals_parameterizations_2.rs
index 1f1fa945..71f8d483 100644
--- a/crates/basilisk-checker/src/rules/literals_parameterizations_2.rs
+++ b/crates/basilisk-checker/src/rules/literals_parameterizations_2.rs
@@ -1,4 +1,4 @@
-//! Implements [`literals_parameterizations_2`] from [CHKARCH-DIAG-COERCION]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-coercion
+//! Implements [`literals_parameterizations_2`] from [CHKARCH-DIAG-COERCION]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-COERCION
//! `literals_parameterizations_2`: `Literal["EnumClass.MEMBER"]` (string) used where
//! `Literal[EnumClass.MEMBER]` (enum member reference) is required.
//!
diff --git a/crates/basilisk-checker/src/rules/literals_semantics.rs b/crates/basilisk-checker/src/rules/literals_semantics.rs
index ce4a31d6..06701235 100644
--- a/crates/basilisk-checker/src/rules/literals_semantics.rs
+++ b/crates/basilisk-checker/src/rules/literals_semantics.rs
@@ -1,4 +1,4 @@
-//! Implements [`literals_semantics`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`literals_semantics`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `literals_semantics`: Augmented assignment widens `Literal` type.
//!
//! Implements the supported annotated slice of [TYPEINF-VARS-AUGMENTED]:
diff --git a/crates/basilisk-checker/src/rules/literals_semantics_2.rs b/crates/basilisk-checker/src/rules/literals_semantics_2.rs
index 295ac67e..04c7938f 100644
--- a/crates/basilisk-checker/src/rules/literals_semantics_2.rs
+++ b/crates/basilisk-checker/src/rules/literals_semantics_2.rs
@@ -1,4 +1,4 @@
-//! Implements [`literals_semantics_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`literals_semantics_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `literals_semantics_2`: Literal value assignment incompatibility.
//!
//! Detects two classes of Literal-related assignment errors inside function bodies:
diff --git a/crates/basilisk-checker/src/rules/match_exhaustiveness.rs b/crates/basilisk-checker/src/rules/match_exhaustiveness.rs
index 62b4341b..f6ccfa80 100644
--- a/crates/basilisk-checker/src/rules/match_exhaustiveness.rs
+++ b/crates/basilisk-checker/src/rules/match_exhaustiveness.rs
@@ -1,4 +1,4 @@
-//! Implements [`match_exhaustiveness`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Implements [`match_exhaustiveness`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
//! `match_exhaustiveness`: Non-exhaustive `match` statement.
//!
//! A value-dispatch `match` statement that has no irrefutable branch may fail
diff --git a/crates/basilisk-checker/src/rules/missing_attribute_annotation.rs b/crates/basilisk-checker/src/rules/missing_attribute_annotation.rs
index c5edbf5d..ce64c446 100644
--- a/crates/basilisk-checker/src/rules/missing_attribute_annotation.rs
+++ b/crates/basilisk-checker/src/rules/missing_attribute_annotation.rs
@@ -1,4 +1,4 @@
-//! Implements [BSK-0005] from [CHKARCH-DIAG-MISSING]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-missing
+//! Implements [BSK-0005] from [CHKARCH-DIAG-MISSING]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-MISSING
//! BSK-0005: Missing class attribute type annotation.
//!
//! Every class attribute declared in the class body must have an explicit type
diff --git a/crates/basilisk-checker/src/rules/missing_override_decorator.rs b/crates/basilisk-checker/src/rules/missing_override_decorator.rs
index 4eac8852..d1694896 100644
--- a/crates/basilisk-checker/src/rules/missing_override_decorator.rs
+++ b/crates/basilisk-checker/src/rules/missing_override_decorator.rs
@@ -1,4 +1,4 @@
-//! Implements [BSK-0025] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Implements [BSK-0025] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
//! BSK-0025: Missing `@override` decorator.
//!
//! When a class overrides a method that is also defined in one of its base
diff --git a/crates/basilisk-checker/src/rules/missing_parameter_annotation.rs b/crates/basilisk-checker/src/rules/missing_parameter_annotation.rs
index c50953e0..6f214cd0 100644
--- a/crates/basilisk-checker/src/rules/missing_parameter_annotation.rs
+++ b/crates/basilisk-checker/src/rules/missing_parameter_annotation.rs
@@ -1,4 +1,4 @@
-//! Implements [BSK-0001] from [CHKARCH-DIAG-MISSING]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-missing
+//! Implements [BSK-0001] from [CHKARCH-DIAG-MISSING]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-MISSING
//! BSK-0001: Missing parameter type annotation.
//! Implements the parameter-policy slice of [TYPEINF-REQUIRED] and the
//! receiver exemption shared by [TYPEINF-SPECIAL-SELF].
diff --git a/crates/basilisk-checker/src/rules/missing_return_annotation.rs b/crates/basilisk-checker/src/rules/missing_return_annotation.rs
index 0c64bb78..94548f23 100644
--- a/crates/basilisk-checker/src/rules/missing_return_annotation.rs
+++ b/crates/basilisk-checker/src/rules/missing_return_annotation.rs
@@ -1,4 +1,4 @@
-//! Implements [BSK-0002] from [CHKARCH-DIAG-MISSING]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-missing
+//! Implements [BSK-0002] from [CHKARCH-DIAG-MISSING]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-MISSING
//! BSK-0002: Missing return type annotation.
//!
//! Never fires where the current engine already infers the return type
diff --git a/crates/basilisk-checker/src/rules/missing_type_stubs/mod.rs b/crates/basilisk-checker/src/rules/missing_type_stubs/mod.rs
index 9b8acb85..034ed623 100644
--- a/crates/basilisk-checker/src/rules/missing_type_stubs/mod.rs
+++ b/crates/basilisk-checker/src/rules/missing_type_stubs/mod.rs
@@ -1,4 +1,4 @@
-//! Implements [BSK-0152] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [BSK-0152] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! BSK-0152: Missing type stubs for installed package.
//!
//! Fires when a package is imported and resolves to a `.py` source file (not
diff --git a/crates/basilisk-checker/src/rules/missing_vararg_annotation.rs b/crates/basilisk-checker/src/rules/missing_vararg_annotation.rs
index c138765b..d171b40d 100644
--- a/crates/basilisk-checker/src/rules/missing_vararg_annotation.rs
+++ b/crates/basilisk-checker/src/rules/missing_vararg_annotation.rs
@@ -1,4 +1,4 @@
-//! Implements [BSK-0004] from [CHKARCH-DIAG-MISSING]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-missing
+//! Implements [BSK-0004] from [CHKARCH-DIAG-MISSING]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-MISSING
//! BSK-0004: Missing `*args` / `**kwargs` type annotation.
//!
//! This house rule is off by default — the default configuration is pure PEP
diff --git a/crates/basilisk-checker/src/rules/missing_variable_type.rs b/crates/basilisk-checker/src/rules/missing_variable_type.rs
index 1c26d565..8b231260 100644
--- a/crates/basilisk-checker/src/rules/missing_variable_type.rs
+++ b/crates/basilisk-checker/src/rules/missing_variable_type.rs
@@ -1,4 +1,4 @@
-//! Implements [BSK-0003] from [CHKARCH-DIAG-MISSING]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-missing
+//! Implements [BSK-0003] from [CHKARCH-DIAG-MISSING]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-MISSING
//! BSK-0003: Missing variable type annotation.
//!
//! Fires when a module-level variable has no type annotation. This house rule
diff --git a/crates/basilisk-checker/src/rules/namedtuples_define_class.rs b/crates/basilisk-checker/src/rules/namedtuples_define_class.rs
index e4a87155..4552918c 100644
--- a/crates/basilisk-checker/src/rules/namedtuples_define_class.rs
+++ b/crates/basilisk-checker/src/rules/namedtuples_define_class.rs
@@ -1,4 +1,4 @@
-//! Implements [`namedtuples_define_class`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`namedtuples_define_class`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `namedtuples_define_class`: `NamedTuple` class definition errors.
//!
//! Detects several categories of `NamedTuple` definition errors:
diff --git a/crates/basilisk-checker/src/rules/namedtuples_define_functional.rs b/crates/basilisk-checker/src/rules/namedtuples_define_functional.rs
index ca8d5891..00c10bd1 100644
--- a/crates/basilisk-checker/src/rules/namedtuples_define_functional.rs
+++ b/crates/basilisk-checker/src/rules/namedtuples_define_functional.rs
@@ -1,4 +1,4 @@
-//! Implements [`namedtuples_define_functional`] from [CHKARCH-DIAG-COERCION]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-coercion
+//! Implements [`namedtuples_define_functional`] from [CHKARCH-DIAG-COERCION]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-COERCION
//! `namedtuples_define_functional`: Invalid argument in a `NamedTuple` constructor call.
//!
//! When a `NamedTuple` is instantiated using keyword arguments, Basilisk
diff --git a/crates/basilisk-checker/src/rules/namedtuples_type_compat.rs b/crates/basilisk-checker/src/rules/namedtuples_type_compat.rs
index 3ced3de8..13893203 100644
--- a/crates/basilisk-checker/src/rules/namedtuples_type_compat.rs
+++ b/crates/basilisk-checker/src/rules/namedtuples_type_compat.rs
@@ -1,4 +1,4 @@
-//! Implements [`namedtuples_type_compat`] from [CHKARCH-DIAG-OPTIONAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-optional
+//! Implements [`namedtuples_type_compat`] from [CHKARCH-DIAG-OPTIONAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-OPTIONAL
//! `namedtuples_type_compat`: `NamedTuple`-to-tuple type incompatibility.
//!
//! When a `NamedTuple` instance is assigned to a variable annotated with a
diff --git a/crates/basilisk-checker/src/rules/namedtuples_usage.rs b/crates/basilisk-checker/src/rules/namedtuples_usage.rs
index abefe71b..2c6c4d62 100644
--- a/crates/basilisk-checker/src/rules/namedtuples_usage.rs
+++ b/crates/basilisk-checker/src/rules/namedtuples_usage.rs
@@ -1,4 +1,4 @@
-//! Implements [`namedtuples_usage`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`namedtuples_usage`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `namedtuples_usage`: `NamedTuple` usage violations.
//!
//! Detects invalid usage of `NamedTuple` instances:
diff --git a/crates/basilisk-checker/src/rules/names_unbound.rs b/crates/basilisk-checker/src/rules/names_unbound.rs
index 16f555c8..2c90ebb9 100644
--- a/crates/basilisk-checker/src/rules/names_unbound.rs
+++ b/crates/basilisk-checker/src/rules/names_unbound.rs
@@ -1,4 +1,4 @@
-//! Implements [`names_unbound`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Implements [`names_unbound`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
//! `names_unbound`: Unbound variable on some code paths.
//!
//! When a function contains a `return ` statement and the name is
diff --git a/crates/basilisk-checker/src/rules/names_undefined.rs b/crates/basilisk-checker/src/rules/names_undefined.rs
index a785cf65..26797cbb 100644
--- a/crates/basilisk-checker/src/rules/names_undefined.rs
+++ b/crates/basilisk-checker/src/rules/names_undefined.rs
@@ -1,4 +1,4 @@
-//! Implements [`names_undefined`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Implements [`names_undefined`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
//! `names_undefined`: Undefined variable used in a return statement.
//!
//! Flags any name referenced in a `return` expression — bare (`return x`), the
diff --git a/crates/basilisk-checker/src/rules/narrowing_typeguard.rs b/crates/basilisk-checker/src/rules/narrowing_typeguard.rs
index daca6ce5..f0f6fd1d 100644
--- a/crates/basilisk-checker/src/rules/narrowing_typeguard.rs
+++ b/crates/basilisk-checker/src/rules/narrowing_typeguard.rs
@@ -1,4 +1,4 @@
-//! Implements [`narrowing_typeguard`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`narrowing_typeguard`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `narrowing_typeguard`: `TypeGuard` or `TypeIs` on method with no narrowing parameter.
//!
//! The typing spec requires that a `TypeGuard` or `TypeIs` function must have
diff --git a/crates/basilisk-checker/src/rules/narrowing_typeis.rs b/crates/basilisk-checker/src/rules/narrowing_typeis.rs
index 096c3da7..fcff72e8 100644
--- a/crates/basilisk-checker/src/rules/narrowing_typeis.rs
+++ b/crates/basilisk-checker/src/rules/narrowing_typeis.rs
@@ -1,4 +1,4 @@
-//! Implements [`narrowing_typeis`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`narrowing_typeis`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `narrowing_typeis`: TypeGuard/TypeIs return type incompatibility in callable arguments.
//!
//! When a function returning `TypeGuard[X]` or `TypeIs[X]` is passed as an
diff --git a/crates/basilisk-checker/src/rules/narrowing_typeis_2.rs b/crates/basilisk-checker/src/rules/narrowing_typeis_2.rs
index 9fe971cc..46643c94 100644
--- a/crates/basilisk-checker/src/rules/narrowing_typeis_2.rs
+++ b/crates/basilisk-checker/src/rules/narrowing_typeis_2.rs
@@ -1,4 +1,4 @@
-//! Implements [`narrowing_typeis_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`narrowing_typeis_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `narrowing_typeis_2`: `TypeIs` narrows to a type inconsistent with the input type.
//!
//! Per the typing spec: "It is an error to narrow to a type that is not
diff --git a/crates/basilisk-checker/src/rules/overloads_basic.rs b/crates/basilisk-checker/src/rules/overloads_basic.rs
index f466afb7..b1066c3e 100644
--- a/crates/basilisk-checker/src/rules/overloads_basic.rs
+++ b/crates/basilisk-checker/src/rules/overloads_basic.rs
@@ -1,4 +1,4 @@
-//! Implements [`overloads_basic`] from [CHKARCH-DIAG-OPTIONAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-optional
+//! Implements [`overloads_basic`] from [CHKARCH-DIAG-OPTIONAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-OPTIONAL
//! `overloads_basic`: No matching overload for subscript indexing.
//!
//! When a class defines overloaded `__getitem__` methods and a module-level
diff --git a/crates/basilisk-checker/src/rules/overloads_consistency.rs b/crates/basilisk-checker/src/rules/overloads_consistency.rs
index 90432b3a..3f29947f 100644
--- a/crates/basilisk-checker/src/rules/overloads_consistency.rs
+++ b/crates/basilisk-checker/src/rules/overloads_consistency.rs
@@ -1,4 +1,4 @@
-//! Implements [`overloads_consistency`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Implements [`overloads_consistency`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
//! `overloads_consistency`: Overlapping `@overload` signatures.
//!
//! Within a group of `@overload` functions for the same name, every overload
diff --git a/crates/basilisk-checker/src/rules/overloads_consistency_2.rs b/crates/basilisk-checker/src/rules/overloads_consistency_2.rs
index 78fecf44..a50c6d2b 100644
--- a/crates/basilisk-checker/src/rules/overloads_consistency_2.rs
+++ b/crates/basilisk-checker/src/rules/overloads_consistency_2.rs
@@ -1,4 +1,4 @@
-//! Implements [`overloads_consistency_2`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-ownership
+//! Implements [`overloads_consistency_2`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-OWNERSHIP
//! `overloads_consistency_2`: Inconsistent decorators across an overloaded method.
//!
//! The typing spec constrains how decorators may be spread across an
diff --git a/crates/basilisk-checker/src/rules/overloads_consistency_3.rs b/crates/basilisk-checker/src/rules/overloads_consistency_3.rs
index 4b988c83..293a0f5f 100644
--- a/crates/basilisk-checker/src/rules/overloads_consistency_3.rs
+++ b/crates/basilisk-checker/src/rules/overloads_consistency_3.rs
@@ -1,4 +1,4 @@
-//! Implements [`overloads_consistency_3`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Implements [`overloads_consistency_3`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
//! `overloads_consistency_3`: Overload implementation is inconsistent with its signatures.
//!
//! When an overload implementation is present the spec requires:
diff --git a/crates/basilisk-checker/src/rules/overloads_definitions.rs b/crates/basilisk-checker/src/rules/overloads_definitions.rs
index 3471ee4c..e8f5f86c 100644
--- a/crates/basilisk-checker/src/rules/overloads_definitions.rs
+++ b/crates/basilisk-checker/src/rules/overloads_definitions.rs
@@ -1,4 +1,4 @@
-//! Implements [`overloads_definitions`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Implements [`overloads_definitions`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
//! `overloads_definitions`: Missing `@overload` implementation.
//!
//! When a function name is defined multiple times and every definition carries
diff --git a/crates/basilisk-checker/src/rules/overloads_evaluation.rs b/crates/basilisk-checker/src/rules/overloads_evaluation.rs
index 6ddfdbed..75764b7c 100644
--- a/crates/basilisk-checker/src/rules/overloads_evaluation.rs
+++ b/crates/basilisk-checker/src/rules/overloads_evaluation.rs
@@ -1,4 +1,4 @@
-//! Implements [`overloads_evaluation`] from [CHKARCH-DIAG-OPTIONAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-optional
+//! Implements [`overloads_evaluation`] from [CHKARCH-DIAG-OPTIONAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-OPTIONAL
//! `overloads_evaluation`: Overload union expansion failure.
//!
//! When a function-body call passes a union-typed argument to an overloaded
diff --git a/crates/basilisk-checker/src/rules/protocols_class_objects.rs b/crates/basilisk-checker/src/rules/protocols_class_objects.rs
index 21e6c697..39e950a1 100644
--- a/crates/basilisk-checker/src/rules/protocols_class_objects.rs
+++ b/crates/basilisk-checker/src/rules/protocols_class_objects.rs
@@ -1,4 +1,4 @@
-//! Implements [`protocols_class_objects`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`protocols_class_objects`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `protocols_class_objects`: Protocol class used where `type[Proto]` is expected.
//!
//! The typing spec states: "Variables and parameters annotated with
diff --git a/crates/basilisk-checker/src/rules/protocols_class_objects_2.rs b/crates/basilisk-checker/src/rules/protocols_class_objects_2.rs
index 97d755be..10810225 100644
--- a/crates/basilisk-checker/src/rules/protocols_class_objects_2.rs
+++ b/crates/basilisk-checker/src/rules/protocols_class_objects_2.rs
@@ -1,4 +1,4 @@
-//! Implements [`protocols_class_objects_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`protocols_class_objects_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `protocols_class_objects_2`: Protocol class object violations.
//!
//! Detects two related violations involving Protocol classes and class objects:
diff --git a/crates/basilisk-checker/src/rules/protocols_definition.rs b/crates/basilisk-checker/src/rules/protocols_definition.rs
index b7fea1af..45dc565a 100644
--- a/crates/basilisk-checker/src/rules/protocols_definition.rs
+++ b/crates/basilisk-checker/src/rules/protocols_definition.rs
@@ -1,4 +1,4 @@
-//! Implements [`protocols_definition`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`protocols_definition`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `protocols_definition`: Protocol method sets self-attributes not declared in the Protocol.
//!
//! When a Protocol class defines a method (including `__init__`/`__new__`) that
diff --git a/crates/basilisk-checker/src/rules/protocols_definition_2/ast_index.rs b/crates/basilisk-checker/src/rules/protocols_definition_2/ast_index.rs
index 8422551c..3be85a1d 100644
--- a/crates/basilisk-checker/src/rules/protocols_definition_2/ast_index.rs
+++ b/crates/basilisk-checker/src/rules/protocols_definition_2/ast_index.rs
@@ -1,4 +1,4 @@
-//! Implements [`protocols_definition_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`protocols_definition_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! AST index for `protocols_definition_2` protocol conformance.
//!
//! E0121's structural checks need information the resolver's flattened
diff --git a/crates/basilisk-checker/src/rules/protocols_definition_2/call_args.rs b/crates/basilisk-checker/src/rules/protocols_definition_2/call_args.rs
index 19cb7d98..1484f1a7 100644
--- a/crates/basilisk-checker/src/rules/protocols_definition_2/call_args.rs
+++ b/crates/basilisk-checker/src/rules/protocols_definition_2/call_args.rs
@@ -1,4 +1,4 @@
-//! Implements [`protocols_definition_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`protocols_definition_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Protocol conformance for function-call arguments (`protocols_definition_2`).
//!
//! When a module-level function declares a parameter typed as an iterable of a
diff --git a/crates/basilisk-checker/src/rules/protocols_definition_2/conformance.rs b/crates/basilisk-checker/src/rules/protocols_definition_2/conformance.rs
index 7a8d803a..06d747e7 100644
--- a/crates/basilisk-checker/src/rules/protocols_definition_2/conformance.rs
+++ b/crates/basilisk-checker/src/rules/protocols_definition_2/conformance.rs
@@ -1,4 +1,4 @@
-//! Implements [`protocols_definition_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`protocols_definition_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Protocol member-kind conformance checks for `protocols_definition_2`.
//!
//! Beyond simple member-name presence, these checks verify that an
diff --git a/crates/basilisk-checker/src/rules/protocols_definition_2/mod.rs b/crates/basilisk-checker/src/rules/protocols_definition_2/mod.rs
index c3aceb56..3158b374 100644
--- a/crates/basilisk-checker/src/rules/protocols_definition_2/mod.rs
+++ b/crates/basilisk-checker/src/rules/protocols_definition_2/mod.rs
@@ -1,4 +1,4 @@
-//! Implements [`protocols_definition_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`protocols_definition_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `protocols_definition_2`: Protocol conformance violation in annotated assignment.
//!
//! Detects errors in annotated assignments at module level:
diff --git a/crates/basilisk-checker/src/rules/protocols_explicit.rs b/crates/basilisk-checker/src/rules/protocols_explicit.rs
index f37fd9aa..1f6198ae 100644
--- a/crates/basilisk-checker/src/rules/protocols_explicit.rs
+++ b/crates/basilisk-checker/src/rules/protocols_explicit.rs
@@ -1,4 +1,4 @@
-//! Implements [`protocols_explicit`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`protocols_explicit`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `protocols_explicit`: Direct instantiation of a Protocol class.
//!
//! Protocol classes define structural interfaces and cannot be instantiated
diff --git a/crates/basilisk-checker/src/rules/protocols_explicit_2.rs b/crates/basilisk-checker/src/rules/protocols_explicit_2.rs
index 8d1664db..12c70c8b 100644
--- a/crates/basilisk-checker/src/rules/protocols_explicit_2.rs
+++ b/crates/basilisk-checker/src/rules/protocols_explicit_2.rs
@@ -1,4 +1,4 @@
-//! Implements [`protocols_explicit_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`protocols_explicit_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `protocols_explicit_2`: Calling `super().method()` on an abstract method with no default
//! implementation.
//!
diff --git a/crates/basilisk-checker/src/rules/protocols_explicit_3.rs b/crates/basilisk-checker/src/rules/protocols_explicit_3.rs
index 02d4cb27..0266417a 100644
--- a/crates/basilisk-checker/src/rules/protocols_explicit_3.rs
+++ b/crates/basilisk-checker/src/rules/protocols_explicit_3.rs
@@ -1,4 +1,4 @@
-//! Implements [`protocols_explicit_3`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`protocols_explicit_3`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `protocols_explicit_3`: `super()` call on abstract protocol method with no default implementation.
//!
//! When a class explicitly implements a `Protocol` and one of its methods
diff --git a/crates/basilisk-checker/src/rules/protocols_generic/helpers.rs b/crates/basilisk-checker/src/rules/protocols_generic/helpers.rs
index 8f9ddf3a..e4e030f0 100644
--- a/crates/basilisk-checker/src/rules/protocols_generic/helpers.rs
+++ b/crates/basilisk-checker/src/rules/protocols_generic/helpers.rs
@@ -1,4 +1,4 @@
-//! Implements [`protocols_generic`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`protocols_generic`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Helper functions for `protocols_generic`: Generic protocol violations.
use std::collections::HashMap;
diff --git a/crates/basilisk-checker/src/rules/protocols_merging.rs b/crates/basilisk-checker/src/rules/protocols_merging.rs
index a66c7d2b..5c877442 100644
--- a/crates/basilisk-checker/src/rules/protocols_merging.rs
+++ b/crates/basilisk-checker/src/rules/protocols_merging.rs
@@ -1,4 +1,4 @@
-//! Implements [`protocols_merging`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`protocols_merging`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `protocols_merging`: Non-Protocol base class in a Protocol definition.
//!
//! Per PEP 544, a Protocol class may only inherit from other Protocol classes
diff --git a/crates/basilisk-checker/src/rules/protocols_modules.rs b/crates/basilisk-checker/src/rules/protocols_modules.rs
index c43af92c..491bd7a8 100644
--- a/crates/basilisk-checker/src/rules/protocols_modules.rs
+++ b/crates/basilisk-checker/src/rules/protocols_modules.rs
@@ -1,4 +1,4 @@
-//! Implements [`protocols_modules`] from [CHKARCH-DIAG-OPTIONAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-optional
+//! Implements [`protocols_modules`] from [CHKARCH-DIAG-OPTIONAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-OPTIONAL
//! `protocols_modules`: Module assigned to incompatible protocol type.
//!
//! When a module object is assigned to a variable typed as a `Protocol`, the
diff --git a/crates/basilisk-checker/src/rules/protocols_runtime_checkable.rs b/crates/basilisk-checker/src/rules/protocols_runtime_checkable.rs
index 00e1a3e1..aec1c226 100644
--- a/crates/basilisk-checker/src/rules/protocols_runtime_checkable.rs
+++ b/crates/basilisk-checker/src/rules/protocols_runtime_checkable.rs
@@ -1,4 +1,4 @@
-//! Implements [`protocols_runtime_checkable`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`protocols_runtime_checkable`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `protocols_runtime_checkable`: Protocol `isinstance`/`issubclass` violations.
//!
//! Per PEP 544:
diff --git a/crates/basilisk-checker/src/rules/protocols_runtime_checkable_2.rs b/crates/basilisk-checker/src/rules/protocols_runtime_checkable_2.rs
index 51d83640..ae4d7401 100644
--- a/crates/basilisk-checker/src/rules/protocols_runtime_checkable_2.rs
+++ b/crates/basilisk-checker/src/rules/protocols_runtime_checkable_2.rs
@@ -1,4 +1,4 @@
-//! Implements [`protocols_runtime_checkable_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`protocols_runtime_checkable_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `protocols_runtime_checkable_2`: Protocol `isinstance`/`issubclass` violations.
//!
//! Per PEP 544:
diff --git a/crates/basilisk-checker/src/rules/protocols_subtyping.rs b/crates/basilisk-checker/src/rules/protocols_subtyping.rs
index 600ad6db..397d184c 100644
--- a/crates/basilisk-checker/src/rules/protocols_subtyping.rs
+++ b/crates/basilisk-checker/src/rules/protocols_subtyping.rs
@@ -1,4 +1,4 @@
-//! Implements [`protocols_subtyping`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`protocols_subtyping`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `protocols_subtyping`: Protocol attribute tuple element type mismatch.
//!
//! When a class explicitly implements a `Protocol` and assigns to a
diff --git a/crates/basilisk-checker/src/rules/protocols_variance.rs b/crates/basilisk-checker/src/rules/protocols_variance.rs
index a3cc3653..54de50ea 100644
--- a/crates/basilisk-checker/src/rules/protocols_variance.rs
+++ b/crates/basilisk-checker/src/rules/protocols_variance.rs
@@ -1,4 +1,4 @@
-//! Implements [`protocols_variance`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`protocols_variance`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `protocols_variance`: Protocol variance violation.
//!
//! Detects when a Protocol class declares `TypeVar`s with incorrect variance
diff --git a/crates/basilisk-checker/src/rules/protocols_variance_2.rs b/crates/basilisk-checker/src/rules/protocols_variance_2.rs
index a115f77e..f9077e7d 100644
--- a/crates/basilisk-checker/src/rules/protocols_variance_2.rs
+++ b/crates/basilisk-checker/src/rules/protocols_variance_2.rs
@@ -1,4 +1,4 @@
-//! Implements [`protocols_variance_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`protocols_variance_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `protocols_variance_2`: Protocol `TypeVar` variance mismatch.
//!
//! When a generic protocol class declares a `TypeVar` as invariant but the
diff --git a/crates/basilisk-checker/src/rules/qualifiers_annotated/helpers.rs b/crates/basilisk-checker/src/rules/qualifiers_annotated/helpers.rs
index 25ae1596..b963334e 100644
--- a/crates/basilisk-checker/src/rules/qualifiers_annotated/helpers.rs
+++ b/crates/basilisk-checker/src/rules/qualifiers_annotated/helpers.rs
@@ -1,4 +1,4 @@
-//! Implements [`qualifiers_annotated`] from [CHKARCH-DIAG-IMMUTABILITY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-immutability
+//! Implements [`qualifiers_annotated`] from [CHKARCH-DIAG-IMMUTABILITY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-IMMUTABILITY
//! Helper functions for `qualifiers_annotated`: Invalid first argument to `Annotated[...]`.
//!
//! Contains annotation parsing utilities, type expression validity checks,
diff --git a/crates/basilisk-checker/src/rules/qualifiers_annotated_2.rs b/crates/basilisk-checker/src/rules/qualifiers_annotated_2.rs
index 5bfb3edb..012acc83 100644
--- a/crates/basilisk-checker/src/rules/qualifiers_annotated_2.rs
+++ b/crates/basilisk-checker/src/rules/qualifiers_annotated_2.rs
@@ -1,4 +1,4 @@
-//! Implements [`qualifiers_annotated_2`] from [CHKARCH-DIAG-STRUCTURAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-structural
+//! Implements [`qualifiers_annotated_2`] from [CHKARCH-DIAG-STRUCTURAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-STRUCTURAL
//! `qualifiers_annotated_2`: `Annotated[...]` requires at least two arguments.
//!
//! PEP 593 requires `Annotated` to be subscripted with at least two arguments:
diff --git a/crates/basilisk-checker/src/rules/qualifiers_final_annotation.rs b/crates/basilisk-checker/src/rules/qualifiers_final_annotation.rs
index af7d7f2a..dd56277d 100644
--- a/crates/basilisk-checker/src/rules/qualifiers_final_annotation.rs
+++ b/crates/basilisk-checker/src/rules/qualifiers_final_annotation.rs
@@ -1,4 +1,4 @@
-//! Implements [`qualifiers_final_annotation`] from [CHKARCH-DIAG-IMMUTABILITY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-immutability
+//! Implements [`qualifiers_final_annotation`] from [CHKARCH-DIAG-IMMUTABILITY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-IMMUTABILITY
//! `qualifiers_final_annotation`: `Final` used in an invalid position.
//!
//! PEP 591 restricts `Final[T]` to:
diff --git a/crates/basilisk-checker/src/rules/qualifiers_final_annotation_2.rs b/crates/basilisk-checker/src/rules/qualifiers_final_annotation_2.rs
index 19cba1e3..d9b86876 100644
--- a/crates/basilisk-checker/src/rules/qualifiers_final_annotation_2.rs
+++ b/crates/basilisk-checker/src/rules/qualifiers_final_annotation_2.rs
@@ -1,4 +1,4 @@
-//! Implements [`qualifiers_final_annotation_2`] from [CHKARCH-DIAG-STRUCTURAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-structural
+//! Implements [`qualifiers_final_annotation_2`] from [CHKARCH-DIAG-STRUCTURAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-STRUCTURAL
//! `qualifiers_final_annotation_2`: `Final` type qualifier annotation violations.
//!
//! Detects violations of PEP 591's rules for the `Final` qualifier, beyond the
diff --git a/crates/basilisk-checker/src/rules/qualifiers_final_decorator.rs b/crates/basilisk-checker/src/rules/qualifiers_final_decorator.rs
index e890ace8..0b8683e2 100644
--- a/crates/basilisk-checker/src/rules/qualifiers_final_decorator.rs
+++ b/crates/basilisk-checker/src/rules/qualifiers_final_decorator.rs
@@ -1,4 +1,4 @@
-//! Implements [`qualifiers_final_decorator`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-ownership
+//! Implements [`qualifiers_final_decorator`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-OWNERSHIP
//! `qualifiers_final_decorator`: `@final` decorator violations.
//!
//! Three violations are detected:
diff --git a/crates/basilisk-checker/src/rules/redundant_annotation.rs b/crates/basilisk-checker/src/rules/redundant_annotation.rs
index b315c7c7..0ffec5cd 100644
--- a/crates/basilisk-checker/src/rules/redundant_annotation.rs
+++ b/crates/basilisk-checker/src/rules/redundant_annotation.rs
@@ -1,4 +1,4 @@
-//! Implements [BSK-0050] from [CHKARCH-DIAG-STRUCTURAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-structural
+//! Implements [BSK-0050] from [CHKARCH-DIAG-STRUCTURAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-STRUCTURAL
//! BSK-0050: Redundant type annotation warning.
//!
//! Emits a warning when a type annotation is redundant because the inferred type
diff --git a/crates/basilisk-checker/src/rules/returns_compatibility.rs b/crates/basilisk-checker/src/rules/returns_compatibility.rs
index 7aad4f1e..37d6d0fa 100644
--- a/crates/basilisk-checker/src/rules/returns_compatibility.rs
+++ b/crates/basilisk-checker/src/rules/returns_compatibility.rs
@@ -1,4 +1,4 @@
-//! Implements [`returns_compatibility`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Implements [`returns_compatibility`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
//! `returns_compatibility`: Return type mismatch.
//!
//! Emitted as an `Error` when the literal value returned by a function is
diff --git a/crates/basilisk-checker/src/rules/returns_compatibility_2.rs b/crates/basilisk-checker/src/rules/returns_compatibility_2.rs
index 568f3177..72516fd6 100644
--- a/crates/basilisk-checker/src/rules/returns_compatibility_2.rs
+++ b/crates/basilisk-checker/src/rules/returns_compatibility_2.rs
@@ -1,4 +1,4 @@
-//! Implements [`returns_compatibility_2`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Implements [`returns_compatibility_2`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
//! `returns_compatibility_2`: Return type mismatch — inferred return type incompatible with annotation.
//!
//! When a function has a return type annotation, the inferred return type must be
diff --git a/crates/basilisk-checker/src/rules/shared.rs b/crates/basilisk-checker/src/rules/shared.rs
index f6d0b296..b155ecca 100644
--- a/crates/basilisk-checker/src/rules/shared.rs
+++ b/crates/basilisk-checker/src/rules/shared.rs
@@ -1,4 +1,4 @@
-//! Implements helpers for [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements helpers for [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Shared helper functions used across multiple type checking rules.
//!
//! Consolidated from duplicated implementations in individual rule modules
diff --git a/crates/basilisk-checker/src/rules/specialtypes_never.rs b/crates/basilisk-checker/src/rules/specialtypes_never.rs
index ba99c51f..3c803be2 100644
--- a/crates/basilisk-checker/src/rules/specialtypes_never.rs
+++ b/crates/basilisk-checker/src/rules/specialtypes_never.rs
@@ -1,4 +1,4 @@
-//! Implements [`specialtypes_never`] from [CHKARCH-DIAG-COERCION]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-coercion
+//! Implements [`specialtypes_never`] from [CHKARCH-DIAG-COERCION]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-COERCION
//! `specialtypes_never`: `-> NoReturn` / `-> Never` function can fall through.
//!
//! A function declared with a return type of `NoReturn` or `Never` must
diff --git a/crates/basilisk-checker/src/rules/specialtypes_never_2.rs b/crates/basilisk-checker/src/rules/specialtypes_never_2.rs
index 8cc5d126..89e023c2 100644
--- a/crates/basilisk-checker/src/rules/specialtypes_never_2.rs
+++ b/crates/basilisk-checker/src/rules/specialtypes_never_2.rs
@@ -1,4 +1,4 @@
-//! Implements [`specialtypes_never_2`] from [CHKARCH-DIAG-OPTIONAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-optional
+//! Implements [`specialtypes_never_2`] from [CHKARCH-DIAG-OPTIONAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-OPTIONAL
//! `specialtypes_never_2`: `Never` type compatibility violations.
//!
//! Detects type compatibility errors involving the `Never` bottom type:
diff --git a/crates/basilisk-checker/src/rules/specialtypes_promotions.rs b/crates/basilisk-checker/src/rules/specialtypes_promotions.rs
index ac4e8b83..c2fd94b2 100644
--- a/crates/basilisk-checker/src/rules/specialtypes_promotions.rs
+++ b/crates/basilisk-checker/src/rules/specialtypes_promotions.rs
@@ -1,4 +1,4 @@
-//! Implements [`specialtypes_promotions`] from [CHKARCH-DIAG-COERCION]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-coercion
+//! Implements [`specialtypes_promotions`] from [CHKARCH-DIAG-COERCION]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-COERCION
//! `specialtypes_promotions`: Access to an `int`-only attribute on a `float`-typed parameter.
//!
//! The Python typing spec (PEP 484 / typing spec §Special cases for float and complex)
diff --git a/crates/basilisk-checker/src/rules/specialtypes_type/helpers.rs b/crates/basilisk-checker/src/rules/specialtypes_type/helpers.rs
index 70e3448b..ddf153d9 100644
--- a/crates/basilisk-checker/src/rules/specialtypes_type/helpers.rs
+++ b/crates/basilisk-checker/src/rules/specialtypes_type/helpers.rs
@@ -1,4 +1,4 @@
-//! Implements [`specialtypes_type`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`specialtypes_type`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! AST utility helpers and predicate functions for `specialtypes_type`.
use ruff_python_ast::Expr;
diff --git a/crates/basilisk-checker/src/rules/stale_lock_file.rs b/crates/basilisk-checker/src/rules/stale_lock_file.rs
index c1f6b829..5e708a08 100644
--- a/crates/basilisk-checker/src/rules/stale_lock_file.rs
+++ b/crates/basilisk-checker/src/rules/stale_lock_file.rs
@@ -1,4 +1,4 @@
-//! Implements [BSK-0013] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Implements [BSK-0013] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
//! BSK-0013: Stale uv lock file.
//!
//! Fires when the `uv.lock` file is older than `pyproject.toml`, indicating
diff --git a/crates/basilisk-checker/src/rules/tuples_index.rs b/crates/basilisk-checker/src/rules/tuples_index.rs
index f2bd2303..5f5e399e 100644
--- a/crates/basilisk-checker/src/rules/tuples_index.rs
+++ b/crates/basilisk-checker/src/rules/tuples_index.rs
@@ -1,4 +1,4 @@
-//! Implements [`tuples_index`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`tuples_index`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `tuples_index`: Tuple index out of bounds.
//!
//! When a fixed-length `tuple[T1, T2, ...]` variable is indexed with a literal
diff --git a/crates/basilisk-checker/src/rules/tuples_index_2.rs b/crates/basilisk-checker/src/rules/tuples_index_2.rs
index 8161865c..642116bf 100644
--- a/crates/basilisk-checker/src/rules/tuples_index_2.rs
+++ b/crates/basilisk-checker/src/rules/tuples_index_2.rs
@@ -1,4 +1,4 @@
-//! Implements [`tuples_index_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`tuples_index_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `tuples_index_2`: Tuple index out of range.
//!
//! Detects subscript access on a fixed-length `tuple[T1, T2, ...]` parameter
diff --git a/crates/basilisk-checker/src/rules/tuples_type_compat/annotation.rs b/crates/basilisk-checker/src/rules/tuples_type_compat/annotation.rs
index 0473ca30..048bd354 100644
--- a/crates/basilisk-checker/src/rules/tuples_type_compat/annotation.rs
+++ b/crates/basilisk-checker/src/rules/tuples_type_compat/annotation.rs
@@ -1,4 +1,4 @@
-//! Implements [`tuples_type_compat`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`tuples_type_compat`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Tuple annotation parsing and compatibility helpers for `tuples_type_compat`.
use crate::rules::shared::split_top_level_commas;
diff --git a/crates/basilisk-checker/src/rules/tuples_type_compat/source.rs b/crates/basilisk-checker/src/rules/tuples_type_compat/source.rs
index c9ed0b93..3b34c716 100644
--- a/crates/basilisk-checker/src/rules/tuples_type_compat/source.rs
+++ b/crates/basilisk-checker/src/rules/tuples_type_compat/source.rs
@@ -1,4 +1,4 @@
-//! Implements [`tuples_type_compat`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`tuples_type_compat`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! Source text parsing helpers for `tuples_type_compat`.
use basilisk_resolver::Span;
diff --git a/crates/basilisk-checker/src/rules/tuples_type_form.rs b/crates/basilisk-checker/src/rules/tuples_type_form.rs
index ac6ae221..08805b3a 100644
--- a/crates/basilisk-checker/src/rules/tuples_type_form.rs
+++ b/crates/basilisk-checker/src/rules/tuples_type_form.rs
@@ -1,4 +1,4 @@
-//! Implements [`tuples_type_form`] from [CHKARCH-DIAG-IMMUTABILITY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-immutability
+//! Implements [`tuples_type_form`] from [CHKARCH-DIAG-IMMUTABILITY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-IMMUTABILITY
//! `tuples_type_form`: Multiple unbounded tuple components in a single tuple type.
//!
//! A `tuple[...]` type annotation may contain at most one unbounded component.
diff --git a/crates/basilisk-checker/src/rules/tuples_type_form_2.rs b/crates/basilisk-checker/src/rules/tuples_type_form_2.rs
index 46c88449..425e0601 100644
--- a/crates/basilisk-checker/src/rules/tuples_type_form_2.rs
+++ b/crates/basilisk-checker/src/rules/tuples_type_form_2.rs
@@ -1,4 +1,4 @@
-//! Implements [`tuples_type_form_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`tuples_type_form_2`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `tuples_type_form_2`: Invalid tuple type syntax.
//!
//! Validates tuple type annotations according to PEP 646 rules:
diff --git a/crates/basilisk-checker/src/rules/typeddicts_alt_syntax.rs b/crates/basilisk-checker/src/rules/typeddicts_alt_syntax.rs
index 5aa88d3a..c2a52def 100644
--- a/crates/basilisk-checker/src/rules/typeddicts_alt_syntax.rs
+++ b/crates/basilisk-checker/src/rules/typeddicts_alt_syntax.rs
@@ -1,4 +1,4 @@
-//! Implements [`typeddicts_alt_syntax`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-ownership
+//! Implements [`typeddicts_alt_syntax`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-OWNERSHIP
//! `typeddicts_alt_syntax`: Invalid `TypedDict(...)` functional-syntax call.
//!
//! The `TypedDict(name, {...})` functional syntax has several constraints:
diff --git a/crates/basilisk-checker/src/rules/typeddicts_class_syntax.rs b/crates/basilisk-checker/src/rules/typeddicts_class_syntax.rs
index ca61b0b3..278729c9 100644
--- a/crates/basilisk-checker/src/rules/typeddicts_class_syntax.rs
+++ b/crates/basilisk-checker/src/rules/typeddicts_class_syntax.rs
@@ -1,4 +1,4 @@
-//! Implements [`typeddicts_class_syntax`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Implements [`typeddicts_class_syntax`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
//! `typeddicts_class_syntax`: Method defined inside a `TypedDict` class.
//!
//! `TypedDict` classes (PEP 589) are restricted to key declarations only.
diff --git a/crates/basilisk-checker/src/rules/typeddicts_class_syntax_2.rs b/crates/basilisk-checker/src/rules/typeddicts_class_syntax_2.rs
index e4b7344b..8bd0ff54 100644
--- a/crates/basilisk-checker/src/rules/typeddicts_class_syntax_2.rs
+++ b/crates/basilisk-checker/src/rules/typeddicts_class_syntax_2.rs
@@ -1,4 +1,4 @@
-//! Implements [`typeddicts_class_syntax_2`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-ownership
+//! Implements [`typeddicts_class_syntax_2`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-OWNERSHIP
//! `typeddicts_class_syntax_2`: Invalid keyword argument in `TypedDict` class definition.
//!
//! `TypedDict` class syntax only accepts `total=True/False` as a keyword argument.
diff --git a/crates/basilisk-checker/src/rules/typeddicts_operations/type_consistency.rs b/crates/basilisk-checker/src/rules/typeddicts_operations/type_consistency.rs
index 4214712f..e4c9c124 100644
--- a/crates/basilisk-checker/src/rules/typeddicts_operations/type_consistency.rs
+++ b/crates/basilisk-checker/src/rules/typeddicts_operations/type_consistency.rs
@@ -1,4 +1,4 @@
-//! Implements [`typeddicts_operations`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`typeddicts_operations`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `TypedDict` type consistency checks (PEP 589 §5).
//!
//! Validates assignments where the RHS is a `TypedDict`-typed variable:
diff --git a/crates/basilisk-checker/src/rules/typeddicts_readonly.rs b/crates/basilisk-checker/src/rules/typeddicts_readonly.rs
index d06400e9..70f52774 100644
--- a/crates/basilisk-checker/src/rules/typeddicts_readonly.rs
+++ b/crates/basilisk-checker/src/rules/typeddicts_readonly.rs
@@ -1,4 +1,4 @@
-//! Implements [`typeddicts_readonly`] from [CHKARCH-DIAG-STRUCTURAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-structural
+//! Implements [`typeddicts_readonly`] from [CHKARCH-DIAG-STRUCTURAL]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-STRUCTURAL
//! `typeddicts_readonly`: Mutation of `ReadOnly` `TypedDict` fields
//!
//! Fields marked as `ReadOnly` in `TypedDict`s cannot be mutated through:
diff --git a/crates/basilisk-checker/src/rules/typeddicts_required.rs b/crates/basilisk-checker/src/rules/typeddicts_required.rs
index 38f774c1..eda3ae7c 100644
--- a/crates/basilisk-checker/src/rules/typeddicts_required.rs
+++ b/crates/basilisk-checker/src/rules/typeddicts_required.rs
@@ -1,4 +1,4 @@
-//! Implements [`typeddicts_required`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-ownership
+//! Implements [`typeddicts_required`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-OWNERSHIP
//! `typeddicts_required`: `Required` / `NotRequired` used in an invalid context.
//!
//! PEP 655 and the typing spec restrict `Required[T]` and `NotRequired[T]` to:
diff --git a/crates/basilisk-checker/src/rules/typeddicts_usage.rs b/crates/basilisk-checker/src/rules/typeddicts_usage.rs
index f4ccf464..00b9cdb5 100644
--- a/crates/basilisk-checker/src/rules/typeddicts_usage.rs
+++ b/crates/basilisk-checker/src/rules/typeddicts_usage.rs
@@ -1,4 +1,4 @@
-//! Implements [`typeddicts_usage`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag
+//! Implements [`typeddicts_usage`] from [CHKARCH-DIAG]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG
//! `typeddicts_usage`: `TypedDict` runtime violation.
//!
//! PEP 589 defines constraints on what you can do with `TypedDict` type objects at runtime:
diff --git a/crates/basilisk-checker/src/rules/undeclared_dependency_import.rs b/crates/basilisk-checker/src/rules/undeclared_dependency_import.rs
index 083b3b87..97f539b0 100644
--- a/crates/basilisk-checker/src/rules/undeclared_dependency_import.rs
+++ b/crates/basilisk-checker/src/rules/undeclared_dependency_import.rs
@@ -1,4 +1,4 @@
-//! Implements [BSK-0011] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Implements [BSK-0011] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
//! BSK-0011: Undeclared dependency import.
//!
//! Fires when an import resolves to a package that is only a transitive
diff --git a/crates/basilisk-checker/src/rules/unused_dependency.rs b/crates/basilisk-checker/src/rules/unused_dependency.rs
index 5155149f..583d7648 100644
--- a/crates/basilisk-checker/src/rules/unused_dependency.rs
+++ b/crates/basilisk-checker/src/rules/unused_dependency.rs
@@ -1,4 +1,4 @@
-//! Implements [BSK-0012] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Implements [BSK-0012] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
//! BSK-0012: Unused dependency.
//!
//! Fires when a package is declared in `[project.dependencies]` but no module
diff --git a/crates/basilisk-checker/src/span_util.rs b/crates/basilisk-checker/src/span_util.rs
index 910a9e71..6cbe4643 100644
--- a/crates/basilisk-checker/src/span_util.rs
+++ b/crates/basilisk-checker/src/span_util.rs
@@ -1,4 +1,4 @@
-//! Implements [CHKARCH-DIAG-PHILOSOPHY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-philosophy
+//! Implements [CHKARCH-DIAG-PHILOSOPHY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-PHILOSOPHY
//! Safe source-text slicing helpers for [`basilisk_resolver::Span`].
/// Extract the source text covered by a [`basilisk_resolver::Span`].
diff --git a/crates/basilisk-checker/src/types.rs b/crates/basilisk-checker/src/types.rs
index fe708645..7c8f1d26 100644
--- a/crates/basilisk-checker/src/types.rs
+++ b/crates/basilisk-checker/src/types.rs
@@ -1,6 +1,6 @@
//! Implements [TYPEINF-OVERVIEW], [TYPEINF-SUBTYPING], and
//! [TYPEINF-SPECIAL]. See
-//! docs/specs/CHECKER-TYPE-INFERENCE-SPEC.md#typeinf-overview
+//! docs/specs/CHECKER-TYPE-INFERENCE-SPEC.md#TYPEINF-OVERVIEW
//! Type representation for Basilisk's type inference engine.
//!
//! Annotation parsing logic lives in [`super::types_parsing`].
diff --git a/crates/basilisk-checker/src/types_parsing.rs b/crates/basilisk-checker/src/types_parsing.rs
index 0bd8e88f..f381c679 100644
--- a/crates/basilisk-checker/src/types_parsing.rs
+++ b/crates/basilisk-checker/src/types_parsing.rs
@@ -1,4 +1,4 @@
-//! Implements [TYPEINF-OVERVIEW]. See docs/specs/CHECKER-TYPE-INFERENCE-SPEC.md#typeinf-overview
+//! Implements [TYPEINF-OVERVIEW]. See docs/specs/CHECKER-TYPE-INFERENCE-SPEC.md#TYPEINF-OVERVIEW
//! Annotation parsing for [`InferredType`].
//!
//! Converts Python annotation text (e.g. `"list[int]"`, `"Callable[[str], bool]"`)
diff --git a/crates/basilisk-checker/src/types_star_tuples.rs b/crates/basilisk-checker/src/types_star_tuples.rs
index ba621b6a..c375928d 100644
--- a/crates/basilisk-checker/src/types_star_tuples.rs
+++ b/crates/basilisk-checker/src/types_star_tuples.rs
@@ -1,4 +1,4 @@
-//! Implements [TYPEINF-COLLECTIONS-TUPLES]. See docs/specs/CHECKER-TYPE-INFERENCE-SPEC.md#typeinf-collections
+//! Implements [TYPEINF-COLLECTIONS-TUPLES]. See docs/specs/CHECKER-TYPE-INFERENCE-SPEC.md#TYPEINF-COLLECTIONS
//! Homogeneous (`tuple[X, ...]`) and PEP 646 unpacked (`*tuple[...]`/`*Ts`)
//! tuple matching, used by [`InferredType::is_assignable_to`]
//! ([TYPEINF-SUBTYPING-IMPL]).
diff --git a/crates/basilisk-checker/tests/bound_signature_tests.rs b/crates/basilisk-checker/tests/bound_signature_tests.rs
index 3f50e063..10915550 100644
--- a/crates/basilisk-checker/tests/bound_signature_tests.rs
+++ b/crates/basilisk-checker/tests/bound_signature_tests.rs
@@ -95,12 +95,9 @@ fn pyi_mutation_flows_through_no_hand_table() {
selection: basilisk_stubs::typeshed::source::SourceSelection::Custom {
path: root.path().to_string_lossy().into_owned(),
},
- verify_content: true,
- use_cache: false,
- url_template: None,
+ store_path: None,
};
- let snapshot = basilisk_stubs::typeshed::runtime::production_manager(request, None)
- .expect("custom manager")
+ let snapshot = basilisk_stubs::typeshed::runtime::production_manager(request)
.snapshot()
.expect("custom generation activates");
let resolved = resolve_with_snapshot("value = ''.join('wrong')\n", snapshot);
diff --git a/crates/basilisk-checker/tests/cached_tests.rs b/crates/basilisk-checker/tests/cached_tests.rs
index 6c62f45b..ebf9a00a 100644
--- a/crates/basilisk-checker/tests/cached_tests.rs
+++ b/crates/basilisk-checker/tests/cached_tests.rs
@@ -1,5 +1,5 @@
//! Tests for [CHKCACHE-DIAG] / [CHKCACHE-DIAG-INTERN].
-//! See docs/specs/CHECKER-CACHE-SPEC.md#chkcache-entry
+//! See docs/specs/CHECKER-CACHE-SPEC.md#CHKCACHE-ENTRY
#![allow(clippy::allow_attributes, clippy::unwrap_used, clippy::expect_used)]
//! Crate-boundary tests for the serde-friendly diagnostic projection and the
//! `&'static` code interner used on cache replay.
diff --git a/crates/basilisk-checker/tests/checker/classes_override_3_tests.rs b/crates/basilisk-checker/tests/checker/classes_override_3_tests.rs
index 67be642e..aa9cbf24 100644
--- a/crates/basilisk-checker/tests/checker/classes_override_3_tests.rs
+++ b/crates/basilisk-checker/tests/checker/classes_override_3_tests.rs
@@ -1,4 +1,4 @@
-//! Tests for [`classes_override_3`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-ownership
+//! Tests for [`classes_override_3`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-OWNERSHIP
// Integration tests for classes_override_3: @override with no matching ancestor method.
use super::common::*;
diff --git a/crates/basilisk-checker/tests/checker/dataclasses_inheritance_tests.rs b/crates/basilisk-checker/tests/checker/dataclasses_inheritance_tests.rs
index e7d859d1..0be1f91f 100644
--- a/crates/basilisk-checker/tests/checker/dataclasses_inheritance_tests.rs
+++ b/crates/basilisk-checker/tests/checker/dataclasses_inheritance_tests.rs
@@ -1,4 +1,4 @@
-//! Tests for [`dataclasses_inheritance`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-ownership
+//! Tests for [`dataclasses_inheritance`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-OWNERSHIP
// Integration tests for dataclasses_inheritance: dataclass field without a default after one with a default.
use super::common::*;
diff --git a/crates/basilisk-checker/tests/checker/overloads_consistency_2_tests.rs b/crates/basilisk-checker/tests/checker/overloads_consistency_2_tests.rs
index f85cfc12..e059a3e9 100644
--- a/crates/basilisk-checker/tests/checker/overloads_consistency_2_tests.rs
+++ b/crates/basilisk-checker/tests/checker/overloads_consistency_2_tests.rs
@@ -1,4 +1,4 @@
-//! Tests for [`overloads_consistency_2`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-ownership
+//! Tests for [`overloads_consistency_2`] from [CHKARCH-DIAG-OWNERSHIP]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-OWNERSHIP
// Integration tests for overloads_consistency_2: inconsistent decorators across an overload group.
use super::common::*;
diff --git a/crates/basilisk-checker/tests/checker/overloads_consistency_3_tests.rs b/crates/basilisk-checker/tests/checker/overloads_consistency_3_tests.rs
index 316f2bc4..6bee7b12 100644
--- a/crates/basilisk-checker/tests/checker/overloads_consistency_3_tests.rs
+++ b/crates/basilisk-checker/tests/checker/overloads_consistency_3_tests.rs
@@ -1,4 +1,4 @@
-//! Tests for [`overloads_consistency_3`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Tests for [`overloads_consistency_3`] from [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
// Integration tests for overloads_consistency_3: overload implementation inconsistent with its signatures.
use super::common::*;
diff --git a/crates/basilisk-checker/tests/fp_elimination_tests.rs b/crates/basilisk-checker/tests/fp_elimination_tests.rs
index c0bcc347..cc7ab64b 100644
--- a/crates/basilisk-checker/tests/fp_elimination_tests.rs
+++ b/crates/basilisk-checker/tests/fp_elimination_tests.rs
@@ -1,4 +1,4 @@
-//! Tests for [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#chkarch-diag-typesafety
+//! Tests for [CHKARCH-DIAG-TYPESAFETY]. See docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-DIAG-TYPESAFETY
//! Coarse e2e tests locking in the `assignment_compatibility` false-positive eliminations from
//! the completed false-positive elimination campaign.
//!
diff --git a/crates/basilisk-checker/tests/import_apply_tests.rs b/crates/basilisk-checker/tests/import_apply_tests.rs
index 5be65b0c..b823f645 100644
--- a/crates/basilisk-checker/tests/import_apply_tests.rs
+++ b/crates/basilisk-checker/tests/import_apply_tests.rs
@@ -20,9 +20,7 @@ use basilisk_resolver::scope::{ImportResolution, PackageDepKind, UnresolvedReaso
use basilisk_stubs::typeshed::archive::{Archive, ArchiveEntry, ArchiveVfs};
use basilisk_stubs::typeshed::gittree::FileMode;
use basilisk_stubs::typeshed::snapshot::Snapshot;
-use basilisk_stubs::typeshed::source::{
- LicenseStatus, Provenance, SourceIdentity, SourceKind, Transport, TypeshedStatus,
-};
+use basilisk_stubs::typeshed::source::{LicenseStatus, SourceIdentity, SourceKind, TypeshedStatus};
use basilisk_uv::PackageRegistry;
mod import_support;
@@ -322,11 +320,8 @@ fn make_custom_typeshed(stdlib_files: &[(&str, &str)]) -> Arc {
active_source: SourceKind::Custom,
commit: None,
tree: None,
- transport: Transport::CustomPath,
license_status: LicenseStatus::NotSupplied,
license_reference: None,
- provenance: Provenance::UserManaged,
- signed_release: false,
warnings: Vec::new(),
};
let uri_identity = identity.uri_component();
diff --git a/crates/basilisk-checker/tests/import_support/mod.rs b/crates/basilisk-checker/tests/import_support/mod.rs
index 7ab3399b..52d2ede4 100644
--- a/crates/basilisk-checker/tests/import_support/mod.rs
+++ b/crates/basilisk-checker/tests/import_support/mod.rs
@@ -17,9 +17,7 @@ use basilisk_resolver::scope::{ImportKind, ImportResolution};
use basilisk_stubs::typeshed::archive::{Archive, ArchiveEntry, ArchiveVfs};
use basilisk_stubs::typeshed::gittree::FileMode;
use basilisk_stubs::typeshed::snapshot::Snapshot;
-use basilisk_stubs::typeshed::source::{
- LicenseStatus, Provenance, SourceIdentity, SourceKind, Transport, TypeshedStatus,
-};
+use basilisk_stubs::typeshed::source::{LicenseStatus, SourceIdentity, SourceKind, TypeshedStatus};
static TEST_CTR: AtomicU64 = AtomicU64::new(0);
@@ -89,11 +87,8 @@ pub fn custom_typeshed_snapshot(files: &[(&str, &str)]) -> ActiveTypeshed {
active_source: SourceKind::Custom,
commit: None,
tree: None,
- transport: Transport::CustomPath,
license_status: LicenseStatus::NotSupplied,
license_reference: None,
- provenance: Provenance::UserManaged,
- signed_release: false,
warnings: Vec::new(),
};
let uri_identity = identity.uri_component();
diff --git a/crates/basilisk-checker/tests/inference_all_tests.rs b/crates/basilisk-checker/tests/inference_all_tests.rs
index 1d4674ab..7a5f6635 100644
--- a/crates/basilisk-checker/tests/inference_all_tests.rs
+++ b/crates/basilisk-checker/tests/inference_all_tests.rs
@@ -1,4 +1,4 @@
-//! External tests for [TYPEINF-SPEC], [TYPEINF-OVERVIEW], [TYPEINF-INFERRED],
+//! External tests for [TYPEINF], [TYPEINF-OVERVIEW], [TYPEINF-INFERRED],
//! [TYPEINF-ALGO], [TYPEINF-VARS], [TYPEINF-SUBTYPING],
//! [TYPEINF-SUBTYPING-IMPL], [TYPEINF-SPECIAL], [TYPEINF-IMPL],
//! [TYPEINF-EXCEEDS], [TYPEINF-EXCEEDS-NOUNKNOWN], and
diff --git a/crates/basilisk-checker/tests/rule_tags_tests.rs b/crates/basilisk-checker/tests/rule_tags_tests.rs
index aff11b4f..b4edf4f7 100644
--- a/crates/basilisk-checker/tests/rule_tags_tests.rs
+++ b/crates/basilisk-checker/tests/rule_tags_tests.rs
@@ -1,4 +1,4 @@
-//! Implements [CHKTAG-TESTS] from [CHKTAG]. See docs/specs/CHECKER-RULE-TAGGING-SPEC.md#chktag-tests
+//! Implements [CHKTAG-TESTS] from [CHKTAG]. See docs/specs/CHECKER-RULE-TAGGING-SPEC.md#CHKTAG-TESTS
//!
//! Coarse e2e for the rule tagging system: every shipping rule code resolves to
//! a valid, conflict-free tag set, and the user-facing invariants hold —
diff --git a/crates/basilisk-checker/tests/typeshed_snapshot_integration_tests.rs b/crates/basilisk-checker/tests/typeshed_snapshot_integration_tests.rs
index 12604700..1e110ec5 100644
--- a/crates/basilisk-checker/tests/typeshed_snapshot_integration_tests.rs
+++ b/crates/basilisk-checker/tests/typeshed_snapshot_integration_tests.rs
@@ -20,9 +20,7 @@ use basilisk_stubs::types::{StubTarget, StubTargetPlatform};
use basilisk_stubs::typeshed::archive::{Archive, ArchiveEntry, ArchiveVfs};
use basilisk_stubs::typeshed::gittree::FileMode;
use basilisk_stubs::typeshed::snapshot::Snapshot;
-use basilisk_stubs::typeshed::source::{
- LicenseStatus, Provenance, SourceIdentity, SourceKind, Transport, TypeshedStatus,
-};
+use basilisk_stubs::typeshed::source::{LicenseStatus, SourceIdentity, SourceKind, TypeshedStatus};
use basilisk_test_utils::EventDb;
fn entry(path: &str, source: &str) -> ArchiveEntry {
@@ -59,11 +57,8 @@ fn micropython_snapshot() -> Arc {
active_source: SourceKind::Custom,
commit: None,
tree: None,
- transport: Transport::CustomPath,
license_status: LicenseStatus::NotSupplied,
license_reference: None,
- provenance: Provenance::UserManaged,
- signed_release: false,
warnings: Vec::new(),
};
Arc::new(
diff --git a/crates/basilisk-cli/Cargo.toml b/crates/basilisk-cli/Cargo.toml
index d45be296..d5dab931 100644
--- a/crates/basilisk-cli/Cargo.toml
+++ b/crates/basilisk-cli/Cargo.toml
@@ -19,6 +19,9 @@ basilisk-common.workspace = true
basilisk-db.workspace = true
basilisk-uv.workspace = true
basilisk-stubs.workspace = true
+# The user-invoked download surface ([STUBRES-TYPESHED-DOWNLOAD]); reachable
+# only from `basilisk typeshed download`, never from check/analyze.
+basilisk-typeshed-fetch.workspace = true
clap.workspace = true
# Shipwright `--version` / `--version --json` contract emitter.
shipwright = "0.10.0"
@@ -35,6 +38,8 @@ tracing-subscriber.workspace = true
[dev-dependencies]
basilisk-test-utils = { workspace = true, features = ["checker"] }
basilisk-stubs.workspace = true
+# The offline fake-GitHub fixture for the `typeshed download` CLI tests.
+basilisk-typeshed-fetch = { workspace = true, features = ["test-support"] }
tempfile = "3"
[build-dependencies]
diff --git a/crates/basilisk-cli/README.md b/crates/basilisk-cli/README.md
index 40610510..23424046 100644
--- a/crates/basilisk-cli/README.md
+++ b/crates/basilisk-cli/README.md
@@ -15,8 +15,8 @@ basilisk check src/ --output json # JSON output for tooling
## Key concepts
- **Pipeline orchestration** — calls `basilisk-parser` → `basilisk-resolver` → `basilisk-checker` in sequence for each file.
-- **Parallel file checking** — uses Rayon for work-stealing parallelism across files.
-- **Exit codes** — `0` (clean), `1` (type errors found), `3` (internal error).
+- **Analysis-sized stack** — every subcommand is dispatched through `basilisk_lsp::runtime::run_with_analysis_stack`, so the recursive resolver and checker cannot overflow the default main-thread stack on deeply nested expressions ([LSPARCH-ARCH-STACK](../../docs/specs/LSP-ARCHITECTURE-SPEC.md#LSPARCH-ARCH-STACK)). Collected files are then checked in a single sequential pass on that thread.
+- **Exit codes** — `0` (completed without error diagnostics), `1` (error diagnostics were found), `2` (invalid configuration), `3` (internal failure). See [CHKARCH-CLI-EXITCODES](../../docs/specs/CHECKER-ARCHITECTURE-SPEC.md#CHKARCH-CLI-EXITCODES).
- **Output formats** — human-readable rustc-style (default) and JSON for editor/CI integration.
## Dependencies
@@ -28,8 +28,8 @@ basilisk check src/ --output json # JSON output for tooling
| `basilisk-checker` | Type checking |
| `basilisk-config` | Configuration |
| `basilisk-stubs` | Type stubs |
+| `basilisk-lsp` | LSP server (`basilisk lsp`) and the analysis-stack runtime |
| `clap` | CLI argument parsing |
-| `rayon` | Parallel file processing |
## Status
diff --git a/crates/basilisk-cli/src/cache_check.rs b/crates/basilisk-cli/src/cache_check.rs
index b9055b2d..a762bf27 100644
--- a/crates/basilisk-cli/src/cache_check.rs
+++ b/crates/basilisk-cli/src/cache_check.rs
@@ -1,5 +1,5 @@
//! Implements [CHKCACHE-CLI] / [CHKCACHE-FINGERPRINT].
-//! See docs/specs/CHECKER-CACHE-SPEC.md#chkcache-cli
+//! See docs/specs/CHECKER-CACHE-SPEC.md#CHKCACHE-CLI
//!
//! CLI glue for the opt-in result cache: turns the `--cache*` flags into a
//! [`CacheContext`], wraps the per-file cold check with a lookup/store, and
@@ -224,7 +224,7 @@ mod tests {
use basilisk_stubs::typeshed::gittree::{FileMode, Oid};
use basilisk_stubs::typeshed::snapshot::Snapshot;
use basilisk_stubs::typeshed::source::{
- LicenseStatus, Provenance, SourceIdentity, SourceKind, Transport, TypeshedStatus,
+ LicenseStatus, SourceIdentity, SourceKind, TypeshedStatus,
};
use super::{build_context, typeshed_snapshot_identity, CacheContext, CacheOptions};
@@ -238,23 +238,12 @@ mod tests {
},
commit: identity.commit(),
tree: identity.commit(),
- transport: if matches!(identity, SourceIdentity::Custom { .. }) {
- Transport::CustomPath
- } else {
- Transport::Codeload
- },
license_status: if matches!(identity, SourceIdentity::Custom { .. }) {
LicenseStatus::NotSupplied
} else {
LicenseStatus::Approved
},
license_reference: None,
- provenance: if matches!(identity, SourceIdentity::Custom { .. }) {
- Provenance::UserManaged
- } else {
- Provenance::GithubTlsAttested
- },
- signed_release: false,
warnings: Vec::new(),
};
let archive = Archive::new(vec![
diff --git a/crates/basilisk-cli/src/main.rs b/crates/basilisk-cli/src/main.rs
index 956f0c1b..8c6c4977 100644
--- a/crates/basilisk-cli/src/main.rs
+++ b/crates/basilisk-cli/src/main.rs
@@ -18,9 +18,7 @@ use shipwright_manifest::{ExecutableKind, Language};
use tracing::error;
use crate::output::{render_diagnostics, render_diagnostics_json, ColorMode, OutputFormat};
-use crate::pipeline::{
- collect_and_check_with_overrides, pluralise, DiagnosticScope, PipelineError, TypeshedOverrides,
-};
+use crate::pipeline::{collect_and_check, pluralise, DiagnosticScope, PipelineError};
mod adopt;
mod cache_check;
@@ -31,6 +29,7 @@ mod mcp;
mod output;
mod pipeline;
mod stubs;
+mod typeshed_cli;
#[cfg(test)]
use stubs::{cache_stub, find_package_source, run as run_stubs, StubAction, StubGenModeArg};
@@ -80,19 +79,6 @@ struct CheckArgs {
/// Print cache hit/miss counts to stderr after checking.
#[arg(long)]
cache_stats: bool,
- #[command(flatten)]
- typeshed: TypeshedArgs,
-}
-
-#[derive(clap::Args, Default)]
-struct TypeshedArgs {
- /// Download and validate Typeshed afresh for this run, then discard it.
- #[arg(long)]
- no_typeshed_cache: bool,
- /// Waive Git-tree content attestation for this run. Safety, shape, and
- /// license gates still run and the source is reported as UNVERIFIED.
- #[arg(long)]
- no_typeshed_verification: bool,
}
// Implements [CHKARCH-CLI-COMMANDS]: the `check`/`analyze` core commands
@@ -167,6 +153,13 @@ enum Command {
#[arg(long, default_value = ".", value_name = "DIR")]
workspace: std::path::PathBuf,
},
+ /// Manage the verified typeshed store. Downloading happens ONLY here (and
+ /// via the editor's Download buttons) — checking never downloads
+ /// ([STUBRES-TYPESHED-DOWNLOAD]).
+ Typeshed {
+ #[command(subcommand)]
+ action: typeshed_cli::TypeshedAction,
+ },
/// Manage type stubs for untyped packages.
Stubs {
#[command(subcommand)]
@@ -269,7 +262,11 @@ fn main() -> ExitCode {
Ok(code) => code,
Err(err) => {
error!(%err, "analysis thread failed");
- 1
+ // 3 = internal failure ([CHKARCH-CLI-EXITCODES]). This path is
+ // the analysis thread failing to run at all, which is never a
+ // finding about the user's code — reporting 1 here would tell a
+ // CI consumer "error diagnostics were found" when none were.
+ 3
}
};
ExitCode::from(exit_code)
@@ -318,6 +315,7 @@ fn run_command(command: Command) -> u8 {
1
}
},
+ Command::Typeshed { action } => typeshed_cli::run(action),
Command::Stubs { action } => stubs::run(action),
Command::CreateStub(args) => stubs::run_create_stub(args),
}
@@ -339,16 +337,7 @@ fn run_scoped_check(args: &CheckArgs, scope: DiagnosticScope) -> u8 {
stats: args.cache_stats,
};
let mut stats = cache_check::CacheStats::default();
- let result = collect_and_check_with_overrides(
- &args.paths,
- &cache,
- &mut stats,
- scope,
- TypeshedOverrides {
- no_cache: args.typeshed.no_typeshed_cache,
- no_verification: args.typeshed.no_typeshed_verification,
- },
- );
+ let result = collect_and_check(&args.paths, &cache, &mut stats, scope);
if cache.stats {
stats.report();
}
@@ -443,25 +432,54 @@ mod tests {
cache: false,
cache_dir: None,
cache_stats: false,
- typeshed: TypeshedArgs::default(),
}
}
+ /// [STUBRES-TYPESHED-OFFLINE]: the retired one-run waiver flags are gone —
+ /// there is no cache to skip and no verification to switch off, so a
+ /// command using them must fail to parse rather than silently no-op.
#[test]
- fn check_cli_accepts_one_run_typeshed_cache_and_verification_overrides() {
- let cli = Cli::try_parse_from([
+ fn check_cli_rejects_retired_typeshed_waiver_flags() {
+ for flag in ["--no-typeshed-cache", "--no-typeshed-verification"] {
+ assert!(
+ Cli::try_parse_from(["basilisk", "check", "example.py", flag]).is_err(),
+ "retired flag must be rejected: {flag}"
+ );
+ }
+ }
+
+ /// [STUBRES-TYPESHED-DOWNLOAD]: the download surface parses — latest by
+ /// default, or one exact `--commit`.
+ #[test]
+ fn typeshed_download_cli_parses_latest_and_exact_forms() {
+ let latest = Cli::try_parse_from(["basilisk", "typeshed", "download"])
+ .expect("download latest must parse");
+ let Command::Typeshed {
+ action: typeshed_cli::TypeshedAction::Download { commit, .. },
+ } = latest.command
+ else {
+ panic!("expected typeshed download");
+ };
+ assert!(commit.is_none(), "no --commit means latest");
+
+ let exact = Cli::try_parse_from([
"basilisk",
- "check",
- "example.py",
- "--no-typeshed-cache",
- "--no-typeshed-verification",
+ "typeshed",
+ "download",
+ "--commit",
+ "83c2518a9e6abbda0c44592c3483de459198f887",
])
- .expect("documented Typeshed flags must parse");
- let Command::Check { args } = cli.command else {
- panic!("expected check command");
+ .expect("download --commit must parse");
+ let Command::Typeshed {
+ action: typeshed_cli::TypeshedAction::Download { commit, .. },
+ } = exact.command
+ else {
+ panic!("expected typeshed download");
};
- assert!(args.typeshed.no_typeshed_cache);
- assert!(args.typeshed.no_typeshed_verification);
+ assert_eq!(
+ commit.as_deref(),
+ Some("83c2518a9e6abbda0c44592c3483de459198f887")
+ );
}
/// An isolated project that opts the annotation house rule in, holding
@@ -825,7 +843,6 @@ mod tests {
cache: false,
cache_dir: None,
cache_stats: false,
- typeshed: TypeshedArgs::default(),
},
});
let _ = std::fs::remove_dir_all(&dir);
@@ -848,7 +865,6 @@ mod tests {
cache: true,
cache_dir: Some(cache_dir),
cache_stats: true,
- typeshed: TypeshedArgs::default(),
},
});
let _ = std::fs::remove_dir_all(&dir);
diff --git a/crates/basilisk-cli/src/mcp.rs b/crates/basilisk-cli/src/mcp.rs
index c3691aec..11e22733 100644
--- a/crates/basilisk-cli/src/mcp.rs
+++ b/crates/basilisk-cli/src/mcp.rs
@@ -229,7 +229,7 @@ fn initialize_response(id: Value, params: Option<&Value>, lifecycle: &mut Lifecy
"version": env!("CARGO_PKG_VERSION"),
"description": "Read-only Basilisk service status"
},
- "instructions": "Use basilisk_typeshed_status to inspect the active standard-library source and its provenance warnings."
+ "instructions": "Use basilisk_typeshed_status to inspect the active standard-library source and its status warnings."
}),
)
}
@@ -239,7 +239,7 @@ fn tools_result() -> Value {
"tools": [{
"name": STATUS_TOOL,
"title": "Typeshed source status",
- "description": "Return the active typeshed source, exact commit/tree identities, transport, licensing state, and ordered warnings.",
+ "description": "Return the active typeshed source, exact commit/tree identities, licensing state, and ordered warnings.",
"inputSchema": {
"type": "object",
"additionalProperties": false
@@ -249,7 +249,9 @@ fn tools_result() -> Value {
"readOnlyHint": true,
"destructiveHint": false,
"idempotentHint": true,
- "openWorldHint": true
+ // Resolution is offline by construction [STUBRES-TYPESHED-OFFLINE]:
+ // status never contacts an upstream, so the tool is closed-world.
+ "openWorldHint": false
},
"execution": { "taskSupport": "forbidden" }
}]
@@ -262,7 +264,7 @@ fn status_schema() -> Value {
"properties": {
"active_source": {
"type": "string",
- "enum": ["custom", "exact-commit", "latest", "bundled"]
+ "enum": ["custom", "exact-commit", "bundled"]
},
"commit_identity": {
"anyOf": [
@@ -276,20 +278,11 @@ fn status_schema() -> Value {
{ "type": "null" }
]
},
- "transport": {
- "type": "string",
- "enum": ["custom-path", "embedded-zip", "codeload", "mirror"]
- },
- "provenance": {
- "type": "string",
- "enum": ["github-tls-attested", "bundle-vetted", "unverified", "user-managed"]
- },
"license_status": {
"type": "string",
"enum": ["approved", "changed", "not supplied"]
},
"license_reference": { "type": ["string", "null"] },
- "signed_release": { "type": "boolean" },
"warnings": {
"type": "array",
"items": {
@@ -304,8 +297,8 @@ fn status_schema() -> Value {
}
},
"required": [
- "active_source", "commit_identity", "tree_identity", "transport",
- "provenance", "license_status", "license_reference", "signed_release", "warnings"
+ "active_source", "commit_identity", "tree_identity",
+ "license_status", "license_reference", "warnings"
],
"additionalProperties": false
})
@@ -377,31 +370,21 @@ fn error_response(id: Value, code: i64, message: &str) -> Value {
fn status_for_workspace(workspace: &Path) -> Result {
let config = basilisk_lsp::config::load_analysis_config(workspace);
let request = basilisk_lsp::config::typeshed_request(&config)?;
- let manager =
- basilisk_stubs::typeshed::runtime::production_manager(request, config.typeshed_cache_path)
- .map_err(|error| error.to_string())?;
+ let manager = basilisk_stubs::typeshed::runtime::production_manager(request);
let status = manager.status().map_err(|error| error.to_string())?;
Ok(status_document(&status))
}
+/// The active source IS the trust story — custom = user-managed, bundled =
+/// build-vetted, exact commit = attested at download and re-proven offline —
+/// so there are no separate transport/provenance fields to drift out of sync
+/// ([STUBRES-TYPESHED-WARN]).
fn status_document(status: &basilisk_stubs::typeshed::source::TypeshedStatus) -> Value {
- let transport = match status.transport {
- basilisk_stubs::typeshed::source::Transport::CustomPath => "custom-path",
- basilisk_stubs::typeshed::source::Transport::EmbeddedZip => "embedded-zip",
- basilisk_stubs::typeshed::source::Transport::Codeload => "codeload",
- basilisk_stubs::typeshed::source::Transport::Mirror => "mirror",
- };
let license_status = match status.license_status {
basilisk_stubs::typeshed::source::LicenseStatus::Approved => "approved",
basilisk_stubs::typeshed::source::LicenseStatus::Changed => "changed",
basilisk_stubs::typeshed::source::LicenseStatus::NotSupplied => "not supplied",
};
- let provenance = match status.provenance {
- basilisk_stubs::typeshed::source::Provenance::GithubTlsAttested => "github-tls-attested",
- basilisk_stubs::typeshed::source::Provenance::Unverified => "unverified",
- basilisk_stubs::typeshed::source::Provenance::BundleVetted => "bundle-vetted",
- basilisk_stubs::typeshed::source::Provenance::UserManaged => "user-managed",
- };
let warnings: Vec = status
.warnings
.iter()
@@ -415,11 +398,8 @@ fn status_document(status: &basilisk_stubs::typeshed::source::TypeshedStatus) ->
"active_source": status.active_source.as_str(),
"commit_identity": commit.as_deref(),
"tree_identity": tree.as_deref(),
- "transport": transport,
- "provenance": provenance,
"license_status": license_status,
"license_reference": status.license_reference.as_deref(),
- "signed_release": status.signed_release,
"warnings": warnings
})
}
diff --git a/crates/basilisk-cli/src/mcp/tests.rs b/crates/basilisk-cli/src/mcp/tests.rs
index 7aa86145..c86e81fe 100644
--- a/crates/basilisk-cli/src/mcp/tests.rs
+++ b/crates/basilisk-cli/src/mcp/tests.rs
@@ -5,15 +5,12 @@ fn status() -> Value {
"active_source": "bundled",
"commit_identity": "0123456789012345678901234567890123456789",
"tree_identity": "abcdefabcdefabcdefabcdefabcdefabcdefabcd",
- "transport": "embedded-zip",
- "provenance": "bundle-vetted",
"license_status": "approved",
"license_reference": "typeshed://LICENSE",
- "signed_release": false,
"warnings": [
- { "code": "UNPINNED", "message": "Pin current to make this reproducible" },
- { "code": "DOWNLOAD FAILED", "message": "Using bundled fallback" },
- { "code": "UNVERIFIED", "message": "Contents were not checked" }
+ { "code": "UNPINNED", "message": "Pin a commit to make this reproducible" },
+ { "code": "LICENSE CHANGED", "message": "Basilisk update/review required" },
+ { "code": "USER-MANAGED SOURCE", "message": "Folder supplies its own license" }
]
})
}
@@ -92,14 +89,14 @@ fn lifecycle_lists_and_calls_structured_status() -> Result<(), String> {
.get(1)
.and_then(|warning| warning.get("code"))
.and_then(Value::as_str),
- Some("DOWNLOAD FAILED")
+ Some("LICENSE CHANGED")
);
assert_eq!(
warnings
.get(2)
.and_then(|warning| warning.get("code"))
.and_then(Value::as_str),
- Some("UNVERIFIED")
+ Some("USER-MANAGED SOURCE")
);
Ok(())
}
@@ -127,15 +124,27 @@ fn tool_contract_declares_closed_output_and_honest_annotations() {
);
assert_eq!(
result
- .pointer("/tools/0/outputSchema/properties/transport/enum/0")
+ .pointer("/tools/0/outputSchema/properties/active_source/enum/0")
.and_then(Value::as_str),
- Some("custom-path")
+ Some("custom")
);
assert_eq!(
result
- .pointer("/tools/0/outputSchema/properties/signed_release/type")
+ .pointer("/tools/0/outputSchema/properties/license_status/enum/2")
.and_then(Value::as_str),
- Some("boolean")
+ Some("not supplied")
+ );
+ assert!(
+ result
+ .pointer("/tools/0/outputSchema/properties/transport")
+ .is_none(),
+ "the closed envelope must not resurrect the removed transport field"
+ );
+ assert!(
+ result
+ .pointer("/tools/0/outputSchema/properties/signed_release")
+ .is_none(),
+ "the closed envelope must not resurrect the removed signed_release field"
);
assert_eq!(
result
@@ -147,7 +156,9 @@ fn tool_contract_declares_closed_output_and_honest_annotations() {
result
.pointer("/tools/0/annotations/openWorldHint")
.and_then(Value::as_bool),
- Some(true)
+ Some(false),
+ "status resolution is offline by construction [STUBRES-TYPESHED-OFFLINE] — \
+ the tool must declare itself closed-world"
);
}
@@ -176,7 +187,7 @@ fn acquisition_failure_is_a_tool_error_without_partial_status() -> Result<(), St
#[test]
fn shared_custom_status_projects_to_the_closed_mcp_envelope() {
use basilisk_stubs::typeshed::source::{
- LicenseStatus, Provenance, SourceKind, StatusWarning, Transport, TypeshedStatus,
+ LicenseStatus, SourceKind, StatusWarning, TypeshedStatus,
};
use basilisk_stubs::typeshed::warning::{TypeshedWarning, UnpinnedKind};
@@ -184,11 +195,8 @@ fn shared_custom_status_projects_to_the_closed_mcp_envelope() {
active_source: SourceKind::Custom,
commit: None,
tree: None,
- transport: Transport::CustomPath,
license_status: LicenseStatus::NotSupplied,
license_reference: None,
- provenance: Provenance::UserManaged,
- signed_release: false,
warnings: StatusWarning::list(&[
TypeshedWarning::UserManaged,
TypeshedWarning::Unpinned(UnpinnedKind::CustomFolder),
@@ -199,21 +207,21 @@ fn shared_custom_status_projects_to_the_closed_mcp_envelope() {
document.get("active_source").and_then(Value::as_str),
Some("custom")
);
- assert_eq!(
- document.get("transport").and_then(Value::as_str),
- Some("custom-path")
- );
- assert_eq!(
- document.get("signed_release").and_then(Value::as_bool),
- Some(false)
- );
assert_eq!(
document.get("license_status").and_then(Value::as_str),
Some("not supplied")
);
- assert_eq!(
- document.get("provenance").and_then(Value::as_str),
- Some("user-managed")
+ assert!(
+ document.get("transport").is_none(),
+ "active_source IS the trust story — no transport field may reappear"
+ );
+ assert!(
+ document.get("provenance").is_none(),
+ "active_source IS the trust story — no provenance field may reappear"
+ );
+ assert!(
+ document.get("signed_release").is_none(),
+ "active_source IS the trust story — no signed_release field may reappear"
);
assert!(document.pointer("/warnings/0/severity").is_none());
assert_eq!(
@@ -276,6 +284,118 @@ fn negotiation_and_notification_order_follow_lifecycle() -> Result<(), String> {
Ok(())
}
+/// [MCP-STDIO]: every malformed request shape gets the prescribed JSON-RPC
+/// error — nothing is silently dropped and nothing kills the session.
+#[test]
+fn malformed_request_shapes_each_get_the_prescribed_error() -> Result<(), String> {
+ let responses = exchange(&[
+ json!([1, 2, 3]),
+ json!({"jsonrpc":"2.0","id":true,"method":"ping"}),
+ json!({"jsonrpc":"2.0","id":4}),
+ json!({"jsonrpc":"1.0","id":5,"method":"ping"}),
+ ])?;
+ let codes: Vec