Skip to content

feat(path): implement Lore-root centric pathing#61

Open
c-ferrier wants to merge 2 commits into
Ian-stetsenko:mainfrom
c-ferrier:feat/lore-root-centric-paths
Open

feat(path): implement Lore-root centric pathing#61
c-ferrier wants to merge 2 commits into
Ian-stetsenko:mainfrom
c-ferrier:feat/lore-root-centric-paths

Conversation

@c-ferrier

@c-ferrier c-ferrier commented May 21, 2026

Copy link
Copy Markdown
Contributor

This PR implements a strict Lore-root centric coordinate system for all paths within the protocol.

Key Changes:

  • Anchored Execution: Anchors GitClient execution at the loreRoot to ensure a consistent environment regardless of terminal CWD.
  • Normalization: Uses git diff-tree --relative to ensure all stored paths are relative to the project boundary, making atoms portable and fixing lore stale drift detection in subdirectories.
  • Isolation: Discovery commands now implicitly scope to '.' when loreRoot != gitRoot, providing robust monorepo support.
  • Security: Root discovery now halts at .git/ boundaries to prevent context leakage between unrelated repositories.

Closes #60

…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]
@c-ferrier c-ferrier requested a review from Ian-stetsenko as a code owner May 21, 2026 02:49
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]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Critical Pathing Inconsistency: lore stale Failures and lack of Monorepo Isolation

1 participant