rwlock-predicate-naming

rwlock-predicate-naming is a cursor rule for Cursor from briangmilnes/APAS-VERUS. It costs 621 tokens per session, scanned A, original, MIT.

A naming and design rule for RwLockPredicate structures, which describe the conditions that must remain true for data protected by a read-write lock. Each predicate is named after its module and must contain a meaningful invariant.

In plain words
What is it for?
Use it when creating or reviewing lock predicates, choosing their names, storing construction-time proof data, and writing their invariants.
Why use it?
It keeps lock-related proof code consistent and ensures that a predicate actually describes protected data instead of accepting every value.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when creating or reviewing lock predicates, choosing their names, storing construction-time proof data, and writing their invariants.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/briangmilnes/apas-verus/rwlock-predicate-naming
Install

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.

Clone the repo
git clone --depth 1 https://github.com/briangmilnes/APAS-VERUS

Made for: Cursor.

Wrote 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.

agentmods badge for rwlock-predicate-naming

README.md
[![agentmods](https://agentmods.dev/badge/rules/briangmilnes/apas-verus/rwlock-predicate-naming.svg)](https://agentmods.dev/rules/briangmilnes/apas-verus/rwlock-predicate-naming)
Your own site
<a href="https://agentmods.dev/rules/briangmilnes/apas-verus/rwlock-predicate-naming"><img src="https://agentmods.dev/badge/rules/briangmilnes/apas-verus/rwlock-predicate-naming.svg" alt="Measured on agentmods" height="20"></a>
Per session 621 This file is loaded in full into every session.
When invoked 621 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00621 $0.00621
Opus 5 $0.00311 $0.00311
Sonnet 5 $0.00124 $0.00124
Haiku 4.5 $0.00062 $0.00062

Measured 7d ago against content hash 8faa7957adc5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

rwlock-predicate-naming 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 7d 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.

.cursor/rules/apas-verus/rwlock-predicate-naming.mdc · 63 lines

How it starts

The opening of the file, as written. The whole thing — 63 lines — stays where its author put it; the contents beside it link to each section on GitHub.

RwLockPredicate Naming Convention

Every RwLockPredicate struct follows the ModuleInv naming convention: for module X, the predicate struct is XInv. Modules with multiple locks use a disambiguating infix (e.g., XDimInv, XMemoInv, XKeysInv, XEdgesInv).

Pattern

pub struct FooMtEphInv {
    pub ghost some_state: SomeType,
}

impl<T: Bounds> RwLockPredicate<LockedType<T>> for FooMtEphInv {
    open spec fn inv(self, v: LockedType<T>) -> bool {
        // Real invariant — never just `true`.
        [email protected]() <= usize::MAX as nat
    }
}

Rules

  1. Name after the module, not the operation. ArraySeqMtEphInv, not NinjectInv. BSTTreapMtEphInv, not TreapLinkWf.

  2. Carry real invariants. The inv function should constrain the locked value meaningfully. A predicate returning true is a proof hole — it says the lock protects nothing.

  3. Use ghost fields when the invariant needs context. If the invariant references values known only at construction time (e.g., input dimensions, source sequences), store them as pub ghost fields on the struct.

  4. No dummy structs. Do not create unit structs (struct Wf;) with trivial true invariants. If you cannot yet write a real invariant, document it as a known hole and file it for follow-up.

Multi-Lock Modules

When a module has multiple RwLocks protecting different data, disambiguate with an infix:

Module Lock Purpose Struct Name
MatrixChainMtEph dimensions vector MatrixChainMtEphDimInv
MatrixChainMtEph memoization table MatrixChainMtEphMemoInv
OptBinSearchTreeMtEph keys vector OptBSTMtEphKeysInv
OptBinSearchTreeMtEph memo table OptBSTMtEphMemoInv
SpanTreeMtEph spanning edges SpanTreeMtEphEdgesInv
SpanTreeMtEph validity flag SpanTreeMtEphValidInv

Do NOT

  • Do NOT name predicates Wf, Pred, Guard, or after the locked type.
  • Do NOT use spec_fn(V) -> bool with a trivial lambda — use a named struct with a real invariant.
  • Do NOT return true from inv without explicit approval and a documented reason.

Read the full file on GitHub · 63 lines

Changes

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.

  1. 7d ago First seen · 63 lines · 621 tokens per session scan A 8faa7957adc5

Subscribe to this mod's changes

rwlock-predicate-naming is a cursor rule published in the GitHub repository briangmilnes/APAS-VERUS (10 stars, last pushed 1mo ago), licensed MIT. It adds 621 tokens to every session, about $0.0031 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-08-31.