The shell unit lookup and model discovery can disagree on depth, and the cache never refreshes
Table of Contents
This page is a capture in the inbox bucket of the product backlog — a pre-sprint idea, not yet pulled into a sprint as a story.
1. What
core.py's _shell_command_units globs *.org and */*.org. A comment
says that this depth must match discover_models(), but no test checks it.
Add a test that both functions find the same model files. The function also
has an lru_cache keyed on the directory string, and nothing clears it. A
long-lived pytest session that edits models can read stale data. Clear the
cache in the test fixtures, or key it on something that changes when the
models change.
2. Why
The review of PR #2496 found this. If the two depths drift, an opted-in entity can have a unit that the aggregator does not register, and the drift gate does not see it.
3. References
projects/ores.codegen/src/codegen/core.py:_shell_command_units.projects/ores.codegen/src/codegen/org_loader.py:discover_models.