Repository navigation
Conversation
…tability Shifts the protocol to a Lore-root centric coordinate system. Anchors GitClient execution at the loreRoot and uses the --relative flag to ensure all stored paths are relative to the project boundary rather than the Git repository root. This resolves critical drift detection failures in subdirectories (lore stale) and provides automatic isolation in monorepo environments. Root discovery now strictly respects .git boundaries, preventing context leakage between unrelated repositories. Lore-id: b112559e Constraint: GitClient MUST execute from loreRoot Constraint: PathResolver MUST normalize user inputs relative to loreRoot Constraint: Discovery commands MUST implicitly scope to '.' when loreRoot != gitRoot Constraint: ConfigLoader MUST stop upward search at .git boundaries Tested: Verified monorepo isolation with manual project-a/project-b scenario Tested: Confirmed 'lore stale' drift detection in nested subdirectories Tested: All 435 unit tests passing including updated PathResolver suite Tested: Verified boundary safety in nested-Git repository scenarios Confidence: high Scope-risk: moderate Reversibility: clean Assisted-by: Gemini:CLI [lore-protocol]
Introduces an isScoped flag to AtomRepository that conditionalizes implicit path scoping. When Lore is initialized in a subproject (loreRoot != gitRoot), queries are automatically scoped to the project directory to provide isolation. When standing at the repository root, Lore operates in global mode, showing all atoms including empty commits. This ensures full visibility at the top level while maintaining clean isolation within individual projects. Lore-id: deec0524 Constraint: Discovery commands MUST only scope to '.' when isScoped is true Constraint: Empty commits MUST be visible at the Git root Tested: Added unit tests for isScoped guard in AtomRepository.test.ts Tested: Verified dual-mode behavior (Global vs Isolated) with manual monorepo scenario Tested: All 41 AtomRepository tests passing Confidence: high Assisted-by: Gemini:CLI [lore-protocol]
Ian-stetsenko
left a comment
There was a problem hiding this comment.
Thanks for the thorough write-up in #60; the diagnosis is correct. The actual stale fix is small, though, and the monorepo layer riding along has problems I cannot merge:
isScopedis true for every Windows single-repo user.main.tscomparesloreRoot(built withpath.join, backslashes) togitRoot(fromrev-parse --show-toplevel, forward slashes) as strings. Confirmed on my machine:C:\Users\...\lore protocolvsC:/Users/.../lore protocol. Result:-- .is appended to every query on Windows. Compare withpath.relative(a, b) === ''or realpath both.findByCommitHash+-- .returns the wrong commit.git log -1 <hash> -- .returns the first ancestor touching the pathspec, not<hash>. Verified in this repo:git log -1 72a2c9b -- src/commandsreturnsdf430f1.lore why(via blame) can then attribute a line to another commit's atom. Never add a pathspec to a-1 <hash>lookup.lore log <path>regresses from subdirectories.log.tsstill passes raw paths to git, but git now runs at the root.toGitLogArgsMulti()was written for exactly this and has no caller.- The
.githalt inConfigLoadersilently drops user-level~/.lore/config.tomlmerging, with no test or changelog line.
Proposed split:
- PR A (closes #60, I will merge fast): anchor
GitClientat the git root;PathResolvernormalisation wired into every command includinglog; one test provingstaledrift is cwd-independent. NoisScoped, no--relative, no.lorediscovery. - PR B (design first, in #60): lore-root discovery and monorepo scoping, with the root comparison fixed, hash lookups never scoped, an explicit opt-in config key, docs and changelog.
Note: main now has #66 and #67 merged; PR A will need filesChanged on any new RawCommit literals in tests.
…drift countCommitsSince received repository-relative paths (as git reports them) but ran `git rev-list -- <path>` from the current directory, so from a nested directory the pathspec matched nothing and `lore stale` reported zero drift. The `:(top)` pathspec magic anchors the path at the repo root regardless of cwd. Covered by a real-git integration test that runs the client from a subdirectory. Closes #60. Diagnosed by c-ferrier in #60 and #61; the monorepo scoping proposed there is left for a follow-up design. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Update: the Closing this PR because its remaining content is the monorepo layer (lore-root discovery, implicit |
This PR implements a strict Lore-root centric coordinate system for all paths within the protocol.
Key Changes:
Closes #60