Skip to content

engine: SourceVariable.model_name reads like the owning model #558

Closed

Description

@bpowers

Owner decision: rename the field, or close because the doc comment is enough.

SourceVariable.model_name holds the model a Module variable instantiates and is empty for every other variable; it is not the model the variable belongs to (that is owner_model).
The field's doc comment now says so, but the name still invites the misreading.

Fix

Recommended: rename it to referenced_model_name, the name the sync code already uses for the same value.
It is a mechanical change across about 20 call sites in db.rs and db/.
Alternative: close, relying on the doc comment.

Pointers

  • src/simlin-engine/src/db/input.rs: SourceVariable
  • src/simlin-engine/src/db/sync.rs: referenced_model_name

Activity

  1. added
    engine
    hygiene
    on Jun 8, 2026
  2. changed the title [-]engine: SourceVariable.model_name is a misnamed correctness trap (it is the Module reference target, empty for non-Module vars -- not the owning model)[/-] [+]engine: SourceVariable.model_name reads like the owning model[/+] on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enginehygiene

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions