Skip to content

refactor(graph): expose tracked-markdown path check for watcher (DIP) #68

Description

@MarcoPorcellato

Problem

LogseqGraphWatcher closure calls graph._resolved_path_is_tracked_markdown(path) — a private method on the entity/use-case boundary. External adapter code (watchdog handler) reaches through the abstraction.

Clean Architecture lens

Aspect Assessment
Ring Use Case (LogseqGraph + watcher adapter)
SOLID DIP / ISP — watchers should depend on a narrow public protocol, not _-prefixed internals
Uncle Bob Boundaries: keep framework details (watchdog) outside; graph exposes intent-revealing API

Proposed Solution

def is_tracked_markdown_path(self, path: Path) -> bool:
    """Return True if ``path`` is a pages/ or journals/ markdown file in this graph."""
    return self._resolved_path_is_tracked_markdown(path)
  • Watcher uses public method only
  • Unit test in tests/test_graph.py (watcher ignore vs accept paths)

Out of scope

  • Rewriting watcher debounce logic

Definition of Done

  • No private graph calls from LogseqGraphWatcher
  • make all passes

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention or skill is welcome

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions