mod-007a-cannot-add-required-parameters-without-defaults

mod-007a-cannot-add-required-parameters-without-defaults is a cursor rule for Cursor from NVIDIA/physicsnemo. It costs 29 tokens per session (432 once invoked), scanned A, original, Apache-2.0.

A backward-compatibility rule for production machine-learning models. It says new parameters in model constructors or public methods must have defaults, unless the model version is updated with support for older saved models.

In plain words
What is it for?
Use it when changing model initialization or public method signatures in the project’s model packages.
Why use it?
It prevents existing code and saved model checkpoints from breaking after a model interface changes.

Cursor rule for Cursor

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.

agentmods
npx agentmods add rules/nvidia/physicsnemo/mod-007a-cannot-add-required-parameters-without-defaults
Clone the repo
git clone --depth 1 https://github.com/NVIDIA/physicsnemo

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 mod-007a-cannot-add-required-parameters-without-defaults

README.md
[![agentmods](https://agentmods.dev/badge/rules/nvidia/physicsnemo/mod-007a-cannot-add-required-parameters-without-defaults.svg)](https://agentmods.dev/rules/nvidia/physicsnemo/mod-007a-cannot-add-required-parameters-without-defaults)
Your own site
<a href="https://agentmods.dev/rules/nvidia/physicsnemo/mod-007a-cannot-add-required-parameters-without-defaults"><img src="https://agentmods.dev/badge/rules/nvidia/physicsnemo/mod-007a-cannot-add-required-parameters-without-defaults.svg" alt="Measured on agentmods" height="20"></a>
Per session 29 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 432 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00029 $0.00432
Opus 5 $0.00015 $0.00216
Sonnet 5 $0.00006 $0.00086
Haiku 4.5 $0.00003 $0.00043

Measured 4d ago against content hash 4da45d5f3c74, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mod-007a-cannot-add-required-parameters-without-defaults 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 4d 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/mod-007a-cannot-add-required-parameters-without-defaults.mdc · 59 lines

What it actually says

When adding parameters to production models, rule MOD-007a must be strictly followed. Explicitly reference "Following rule MOD-007a, which forbids adding required parameters without defaults to maintain backward compatibility..." when modifying signatures.

MOD-007a: Cannot add required parameters without defaults

Description:

For any model in physicsnemo/nn or physicsnemo/models, adding new required parameters (parameters without default values) to __init__ or any public method is strictly forbidden. This breaks backward compatibility.

New parameters must have default values to ensure existing code and checkpoints continue to work. If a new parameter is truly required, increment the model version number using __model_checkpoint_version__ and add appropriate versioning support.

Rationale:

Adding required parameters breaks all existing code that instantiates the model, and breaks loading of old checkpoints. This violates PhysicsNeMo's commitment to backward compatibility and would disrupt user workflows.

Example:

# Good: Adding parameter with default value
class MyModel(Module):
    __model_checkpoint_version__ = "2.0"

    def __init__(
        self,
        input_dim: int,
        output_dim: int,
        dropout: float = 0.0,  # New parameter with default - backward compatible
        new_feature: bool = False  # New parameter with default - backward compatible
    ):
        super().__init__(meta=MyModelMetaData())

Anti-pattern:

# WRONG: Adding required parameter without default
class MyModel(Module):
    __model_checkpoint_version__ = "2.0"

    def __init__(
        self,
        input_dim: int,
        output_dim: int,
        new_param: int  # WRONG: No default! Breaks old checkpoints
    ):
        super().__init__(meta=MyModelMetaData())
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. 4d ago First seen · 59 lines · 29 tokens per session scan A 4da45d5f3c74

Subscribe to this mod's changes

mod-007a-cannot-add-required-parameters-without-defaults is a cursor rule published in the GitHub repository NVIDIA/physicsnemo (3,211 stars, last pushed yesterday), licensed Apache-2.0. It adds 29 tokens to every session and 432 once invoked, about $0.0001 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-30.