Discover the canonical rules directory by walking up the directory tree from
this module's location until a directory containing agent_rules/ is found.
The rules live at the repo root (agent_rules/) rather than inside this
package, so they can be copied wholesale into consumer projects (e.g. by
mdaa init) with their repo-root-relative references intact. Resolving via
an upward search — rather than a fixed parent-count — keeps the default
stable if the build output depth or the package's position in the repo
changes.
Discover the canonical rules directory by walking up the directory tree from this module's location until a directory containing
agent_rules/is found.The rules live at the repo root (
agent_rules/) rather than inside this package, so they can be copied wholesale into consumer projects (e.g. bymdaa init) with their repo-root-relative references intact. Resolving via an upward search — rather than a fixed parent-count — keeps the default stable if the build output depth or the package's position in the repo changes.