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/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/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/arc-deref-pattern"><img src="https://agentmods.dev/badge/rules/briangmilnes/apas-verus/arc-deref-pattern.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.00793 | $0.00793 |
| Opus 5.5 | $0.00317 | $0.00317 |
| Sonnet 5.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 3mo 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 — 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.
- 3mo ago 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 2mo ago), licensed MIT. It adds 793 tokens to every session, about $0.0032 per session on Opus 5.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.
arc-deref-pattern compared with cursor rules from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| arc-deref-patternbriangmilnes/APAS-VERUS | Cursor rule | 10 | 2mo ago | MIT | A | 793 | Cursor |
| rust-architectplatinoff/poolAI | Cursor rule | 4 | 2d ago | MIT | A | 3,367 | Cursor |
| rust-development-standardsbeettlle/pi-spine | Cursor rule | 3 | yesterday | MIT | A | 0 | Cursor |
| coreSaynaAI/sayna | Cursor rule | 319 | 6mo ago | Apache-2.0 | A | 1,582 | Cursor |
| ivolgaql-projectyellow-hammer/ivolgaql | Cursor rule | 7 | 1mo ago | MIT | A | 519 | Cursor |
| ivolgaql-parser-languageyellow-hammer/ivolgaql | Cursor rule | 7 | 1mo ago | MIT | A | 0 | Cursor |
| rust-pro-autoshahshrey/cursor-hub | Cursor rule | 15 | 24d ago | none | A | 516 | Cursor |