Identify Owning Module Before Editing

CHANGE-IDENTIFY-OWNING-MODULE-BEFORE-EDITING

Summary

Find the component that owns the concept before adding or moving logic. That keeps invariants, tests, and future maintenance close to the responsible code.

Rule

Identify the owning module before editing.

Why

Editing the first file that mentions a behavior can put new logic in a caller, facade, test helper, or adapter that does not own the concept. Identifying the owning module first keeps invariants, tests, and documentation near the code responsible for the behavior.

Helps

  • Reduces scattered fixes and makes future readers find the behavior where they expect it.

Limits

A narrow caller-side adaptation is fine when the caller truly owns the variation. Move inward only when the concept or invariant belongs there.

Agent Instruction

Identify the owning module before editing because editing the first file that mentions a behavior can
put new logic in a caller, facade, test helper, or adapter that does not own the concept.

Mechanisms

Supported by code search, module README or crate-root docs, existing test locations, ownership comments, and review that asks where the concept belongs.

References