Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/briangmilnes/APAS-VERUSWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/briangmilnes/apas-verus/threading-not-external-body)<a href="https://agentmods.dev/rules/briangmilnes/apas-verus/threading-not-external-body"><img src="https://agentmods.dev/badge/rules/briangmilnes/apas-verus/threading-not-external-body/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/briangmilnes/apas-verus/threading-not-external-body"><img src="https://agentmods.dev/badge/rules/briangmilnes/apas-verus/threading-not-external-body.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00519 | $0.00519 |
| Opus 5 | $0.00260 | $0.00260 |
| Sonnet 5 | $0.00104 | $0.00104 |
| Haiku 4.5 | $0.00052 | $0.00052 |
Grade A, and why
threading-not-external-body scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 53 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Threading Is Not an Excuse for external_body
Do NOT slap #[verifier::external_body] on a function just because it uses threads.
The Pattern
A parallel algorithm has two parts:
- Structural logic — splitting, combining, maintaining invariants. This is verifiable.
- Thread spawning — the actual
spawn,join,Arc,ParaPair!calls. This is not verifiable in Verus.
Wrap only the thread-spawning boundary in external_body, not the whole algorithm. The structural logic (preconditions, postconditions, loop invariants, combination proofs) should be verified.
The Only Acceptable Hole
The only proof hole a threaded algorithm should have at the spawn boundary is:
#[verifier::external_body]
fn parallel_wrapper(args: ...) -> (result: ...)
requires ...
ensures ...
{
// exec code that spawns threads and calls verified inner functions
}
The only acceptable proof hole for threading is at the thread-divergence boundary — where a spawned thread might not return. Use:
{ assume(false); diverge(); }
The assume(false) introduces the contradiction; diverge() satisfies Verus's return-type obligation so the function body type-checks. This is strictly for modeling thread divergence (a thread that never joins), not a general-purpose escape hatch.
Do NOT
- Do NOT mark an entire recursive algorithm
external_bodybecause one level usesParaPair!. - Do NOT use
external_bodyto avoid writing loop invariants or combination proofs. - Do NOT treat "parallel" as synonymous with "unverifiable."
Do
- Use
HFSchedulerMtEph(help-first scheduler, Chap02) as the default threading primitive. Itsjoinfunction handles fork-join parallelism directly insideverus!with named closures (seefork-join-inside-verusrule). Reach forParaPair!or rawthread::spawnonly when the scheduler doesn't fit. - Extract f64 arithmetic into small
external_bodyhelpers with tightensures. - Keep the structural proof (splitting, combining, invariants) inside
verus!. - Audit every
external_body— ask: "Is this truly unverifiable, or am I being lazy?"
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 53 lines · 519 tokens per session scan A 6c099ae7bd83
threading-not-external-body is a cursor rule published in the GitHub repository briangmilnes/APAS-VERUS (10 stars, last pushed 1mo ago), licensed MIT. It adds 519 tokens to every session, about $0.0026 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other cursor rules, from other repositories
core
Core STT/TTS abstraction layer documentation.
rust-architect
PoolAI — Rust Architect workflow: runtime stack, MSYS2, target/ disk, pre-push checks, docs sync.
rust-module-refactor
Use when splitting Rust modules, moving tests, tightening visibility, or preserving facades during refactors.
rust-development-standards
Rust development standards: idioms, style, anti-patterns (Rust 2021 edition, 2024 where applicable).
ivolgaql-project
General development rules for ИволгаQL, an early-stage Rust project with a command-line and TCP server interface. They define the project structure, Russian user experience, coding conventions, testing, builds, and commit-message format.
rust-native-architecture
Enforces native-first architecture and crate boundary rules for the nca workspace.