Skip to content

Path Resolution

All path-scoped commands (lore context, lore constraints, etc.) accept a <target> argument. The resolution algorithm depends on the target type.

InputTypeResolution
src/auth/interceptor.tsFilegit log -- <file>
src/auth/interceptor.ts:45-80Line rangegit log -L 45,80:<file>
src/auth/Directorygit log -- <dir> (recursive)
src/auth/**/*.tsGlobgit log -- <expanded paths>

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 --.

For cross-file context, use --scope <name> to match the conventional commit scope:

Terminal window
# Only commits that touched this exact file
lore constraints src/auth/interceptor.ts
# All commits scoped to "auth" regardless of which files they touched
lore constraints --scope auth

--scope matches the (scope) in conventional commit subject lines: fix(auth): ... matches --scope auth.

Terminal window
# Include trailers from atoms linked via Related/Supersedes/Depends-on
lore 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).

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
  • --scope provides a better mechanism for cross-file context
  • An agent that needs broader context can run lore constraints src/auth/ (directory) explicitly