Path Resolution
All path-scoped commands (lore context, lore constraints, etc.) accept a <target> argument. The resolution algorithm depends on the target type.
Target Types
Section titled “Target Types”| Input | Type | Resolution |
|---|---|---|
src/auth/interceptor.ts | File | git log -- <file> |
src/auth/interceptor.ts:45-80 | Line range | git log -L 45,80:<file> |
src/auth/ | Directory | git log -- <dir> (recursive) |
src/auth/**/*.ts | Glob | git log -- <expanded paths> |
Default Behavior: Exact Match
Section titled “Default Behavior: Exact Match”By default, Lore queries return trailers only from commits that directly touched the target path. This is predictable, fast, and maps directly to git log --.
Widening with --scope
Section titled “Widening with --scope”For cross-file context, use --scope <name> to match the conventional commit scope:
# Only commits that touched this exact filelore constraints src/auth/interceptor.ts
# All commits scoped to "auth" regardless of which files they touchedlore constraints --scope auth--scope matches the (scope) in conventional commit subject lines: fix(auth): ... matches --scope auth.
Following References with --follow
Section titled “Following References with --follow”# Include trailers from atoms linked via Related/Supersedes/Depends-onlore context src/auth/interceptor.ts --follow--follow transitively resolves all Related:, Supersedes:, and Depends-on: links from the matched atoms, up to a configurable depth (default: 3, configurable in .lore/config.toml).
Why Not Walk Up the Directory Tree?
Section titled “Why Not Walk Up the Directory Tree?”Implicit directory walking (querying src/auth/interceptor.ts also returns results from src/auth/ and src/) was considered and rejected:
- It’s unpredictable — users can’t tell which constraints came from which scope
- It’s slow on large repos
--scopeprovides a better mechanism for cross-file context- An agent that needs broader context can run
lore constraints src/auth/(directory) explicitly