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.
npx agentmods add rules/briangmilnes/apas-verus/arc-deref-patterngit 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/arc-deref-pattern)<a href="https://agentmods.dev/rules/briangmilnes/apas-verus/arc-deref-pattern"><img src="https://agentmods.dev/badge/rules/briangmilnes/apas-verus/arc-deref-pattern.svg" alt="Measured on agentmods" 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 | $0.00793 | $0.00793 |
| Opus 5 | $0.00396 | $0.00396 |
| Sonnet 5 | $0.00159 | $0.00159 |
| Haiku 4.5 | $0.00079 | $0.00079 |
Grade A, and why
arc-deref-pattern 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 yesterday.
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 — 85 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Anti-Pattern: "Closures Can't Capture Data with Specs"
The Wrong Assumption
When implementing parallel (Mt) algorithms in Verus, do NOT assume:
- "Closures can't capture
ArraySeqMtEphS<T>with specs" - "Arc prevents verification because Verus can't deref it"
- "
Send + 'staticclosures can't reference ghost variables likespec_f" - "The only way to verify this is to make it sequential"
These are FALSE. The pattern below solves all of them.
The Pattern: Factor Verification Away from Concurrency
Problem
join closures need Send + 'static. The verified algorithm needs f: &F (for direct Fn trait spec access). Arc<F> is opaque to Verus — you can't deref it with spec guarantees.
Solution
-
Factor the verified algorithm into a helper that takes
f: &F:fn reduce_contract_verified<T, F>(a: &ArraySeqMtEphS<T>, f: &F, ...) -> (result: T) requires f.requires(...), ... ensures result == ... decreases a.spec_len(), { /* Full proof here — identical to StEph version */ } -
The trait impl delegates through Arc deref:
fn reduce_contract_parallel(a, f: Arc<F>, ...) -> (result: T) { reduce_contract_verified(a, &*f, Ghost(spec_f), id) } -
Small external_body helpers for Arc-specific operations:
#[verifier::external_body] pub fn call_f<T, F>(f: &Arc<F>, a: &T, b: &T) -> (result: T) requires f.requires((a, b)), ensures f.ensures((a, b), result), { (**f)(a, b) } -
Parallel primitives as external_body with strong specs:
#[verifier::external_body] pub fn contract_parallel<T, F>(a, f: &Arc<F>, Ghost(spec_f), half) -> (b: ArraySeqMtEphS<T>) ensures b.spec_index(j) == spec_f(a.spec_index(2*j), a.spec_index(2*j+1)), { /* Uses join internally */ }
Trust Boundaries
| Helper | Trust | Obviousness |
|---|---|---|
call_f |
Arc deref preserves function | Trivially correct |
contract_parallel |
Parallel loop computes pairs | Auditable in 10 lines |
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.
- yesterday First seen · 85 lines · 793 tokens per session scan A 1c4d27117e85
arc-deref-pattern is a cursor rule published in the GitHub repository briangmilnes/APAS-VERUS (10 stars, last pushed 1mo ago), licensed MIT. It adds 793 tokens to every session, about $0.0040 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-module-refactor
Use when splitting Rust modules, moving tests, tightening visibility, or preserving facades during refactors.
rust-architect
PoolAI — Rust Architect workflow: runtime stack, MSYS2, target/ disk, pre-push checks, docs sync.
rust-development-standards
Rust development standards: idioms, style, anti-patterns (Rust 2021 edition, 2024 where applicable).
cube-engine
Use when changing Rust puzzle state, moves, notation, scrambles, or validation.
ivolgaql-project
Общие принципы ИволгаQL (MVP, Rust, русский UX, TCP).