Skip to content

feat: Add filesystem nodes to complement code graph nodes#5

Merged
rysweet merged 5 commits intomainfrom
feature/filesystem-nodes-4
Jul 30, 2025
Merged

feat: Add filesystem nodes to complement code graph nodes#5
rysweet merged 5 commits intomainfrom
feature/filesystem-nodes-4

Conversation

@rysweet
Copy link
Owner

@rysweet rysweet commented Jul 30, 2025

Summary

Implements filesystem nodes feature to provide a complementary view of the codebase from a filesystem perspective. This feature creates nodes representing files and directories in the filesystem and connects them to existing code nodes.

Implementation

New Node Types

  • FILESYSTEM: Base type for filesystem nodes
  • FILESYSTEM_FILE: Represents a file in the filesystem
  • FILESYSTEM_DIRECTORY: Represents a directory

New Relationship Types

  • IMPLEMENTS: Connects filesystem files to the code nodes they contain
  • DEPENDS_ON: For file dependencies (future use)
  • FILESYSTEM_CONTAINS: Parent directory -> child file/directory
  • REFERENCED_BY_DESCRIPTION: When LLM descriptions mention file paths

Key Components

  1. FilesystemFileNode - Node class for files with metadata (size, extension, last_modified)
  2. FilesystemDirectoryNode - Node class for directories with child relationships
  3. FilesystemGraphGenerator - Traverses filesystem and creates nodes/relationships
  4. Integration - Added to ProjectGraphCreator as optional post-processing step

Features

  • Filesystem nodes are created after AST/symbol nodes
  • IMPLEMENTS relationships connect files to their code contents
  • Supports file metadata (size, permissions, timestamps)
  • Integrates with LLM descriptions to detect file references
  • Respects existing skip patterns for files/directories

Testing

  • Created comprehensive test suite covering node creation and relationships
  • Manual testing confirms feature works correctly
  • Test output shows proper creation of filesystem nodes and IMPLEMENTS relationships

Configuration

Enable via environment variable:

ENABLE_FILESYSTEM_NODES=true

Or programmatically:

graph_builder = GraphBuilder(
    root_path="/path/to/project",
    enable_filesystem_nodes=True
)

Benefits

  1. Enhanced Navigation: Navigate from code to file location and vice versa
  2. File Organization Insights: Understand how code is organized in the filesystem
  3. Dependency Analysis: Foundation for file-level dependency tracking
  4. Cross-Reference Support: Connect LLM descriptions to actual files

Example Output

Filesystem Nodes:
  Files: 2
  Directories: 2

Relationships:
  IMPLEMENTS: 6 (connecting filesystem files to code nodes)
  FILESYSTEM_CONTAINS: 6 (directory structure)

Closes #4

🤖 Generated with Claude Code

rysweet and others added 5 commits July 29, 2025 21:43
- Add new node types: FILESYSTEM, FILESYSTEM_FILE, FILESYSTEM_DIRECTORY
- Add new relationship types: IMPLEMENTS, DEPENDS_ON, FILESYSTEM_CONTAINS, REFERENCED_BY_DESCRIPTION
- Create FilesystemFileNode and FilesystemDirectoryNode classes
- Implement FilesystemGraphGenerator for traversing and creating filesystem nodes
- Integrate filesystem generation into ProjectGraphCreator
- Add enable_filesystem_nodes parameter to GraphBuilder
- Create IMPLEMENTS relationships between filesystem files and code nodes
- Support detection of file references in LLM descriptions

The feature provides a complementary view of the codebase from a filesystem
perspective, enabling queries about file organization and dependencies.

Closes #4

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
…agents/

These files were accidentally removed and have now been restored from commit 175caf7
- Added comprehensive git safety instructions to prevent accidental file deletion
- Instructions cover checking git status, preserving uncommitted files, and recovery steps
- Added .github to .blarignore to exclude GitHub-specific files from graph analysis
- Created BlarPlusGitignore.md with detailed instructions
- Includes problem statement, technical analysis, and implementation plan
- Specifies testing requirements and success criteria
- Follows the established prompt format from other files in prompts/
@rysweet rysweet merged commit 1ce3f53 into main Jul 30, 2025
rysweet pushed a commit that referenced this pull request Aug 3, 2025
rysweet added a commit that referenced this pull request Aug 3, 2025
feat: Add filesystem nodes to complement code graph nodes
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.

Add filesystem nodes to complement code graph nodes

1 participant

Comments