Skip to content

Conversation

@prosdev
Copy link
Collaborator

@prosdev prosdev commented Nov 25, 2025

Overview

Implements the foundation for centralized storage and configuration system as part of Issue #52.

Changes

Storage Infrastructure

  • ✅ Centralized storage paths: ~/.dev-agent/indexes/{repo-hash}/
  • ✅ Storage path utilities (getStoragePath, getStorageFilePaths, etc.)
  • ✅ Metadata management (metadata.json per repository)
  • ✅ Git remote normalization and hashing

Configuration System

  • ✅ New config schema with version, repository, and mcp sections
  • ✅ Environment variable templating (${VAR_NAME} syntax)
  • ✅ Config validation with detailed error messages
  • ✅ Changed config file location to .dev-agent/config.json
  • ✅ Backward compatibility with legacy fields

CLI Updates

  • ✅ All commands updated to use centralized storage (index, search, explore, plan, stats, update, clean, compact)
  • ✅ New dev storage migrate command for migrating local indexes
  • ✅ New dev storage info command for displaying storage information

MCP Server Updates

  • ✅ Updated to use centralized storage paths
  • ✅ Infrastructure for lazy loading (prefixed with _ for future use)

Test Organization

  • ✅ Reorganized all core tests to use __tests__ convention (15 test files moved)
  • ✅ Added unit tests for storage path and metadata utilities

Helper Scripts

  • ✅ GitHub issue helper script (gh-issue-add-subs.sh) for managing issue relationships

Testing

  • ✅ All tests passing
  • ✅ Type checking passing
  • ✅ Linting passing
  • ✅ Storage path resolution verified
  • ✅ Migration command tested

Related Issues

Closes #52

Commits

  • refactor(core): reorganize all tests to use __tests__ convention
  • feat(cli): implement new config system with schema validation
  • feat(cli): update commands to use centralized storage
  • feat(mcp-server): update to use centralized storage

Move all 15 test files from co-located to __tests__ directories
to align with convention used in mcp-server and subagents packages.

Implementation:
- Moved 15 test files to __tests__ directories across core package
- Updated all imports to use relative paths from __tests__ directories
- Fixed scanner test path calculation for new location
- Removed all old co-located test files
- Fixed linting errors (unused imports and variables)

Testing:
- All 15 test files reorganized
- Imports updated and verified
- No linting errors
- Path calculations corrected

Files reorganized:
- storage/__tests__/ (2 tests)
- events/__tests__/ (1 test)
- __tests__/ (root, 1 test)
- observability/__tests__/ (1 test)
- scanner/__tests__/ (1 test)
- vector/__tests__/ (3 tests)
- indexer/__tests__/ (3 tests)
- indexer/utils/__tests__/ (3 tests)

Issue: #52
Implement new configuration system for dev-agent with structured
schema, environment variable templating, and validation.

Implementation:
- New DevAgentConfig schema with version, repository, and mcp sections
- Environment variable templating support (${VAR_NAME} syntax)
- Config validation with detailed error messages
- Changed config file location to .dev-agent/config.json
- Backward compatibility with legacy fields
- Adapter configuration support for MCP adapters

Features:
- Structured repository configuration (path, excludePatterns, languages)
- MCP adapter configuration (enabled, source, settings)
- Environment variable resolution in config values
- Type-safe config loading and validation
- Config file discovery from current directory upward

Testing:
- Config validation covers all schema fields
- Environment variable resolution tested
- Backward compatibility maintained

Issue: #52
Update all CLI commands to use centralized storage paths instead
of project-local .dev-agent directories.

Implementation:
- Updated index, search, explore, plan, stats, update, clean, compact commands
- All commands now use getStoragePath() and getStorageFilePaths()
- Commands use centralized ~/.dev-agent/indexes/{repo-hash}/ structure
- Updated metadata handling to use centralized storage
- CLI registration updated for new storage command

Changes:
- index: uses centralized storage paths
- search: uses centralized storage paths
- explore: uses centralized storage paths
- plan: uses centralized storage paths
- stats: displays centralized storage information
- update: uses centralized storage paths
- clean: removes centralized storage instead of local files
- compact: uses centralized storage paths

Testing:
- All commands updated and verified
- Storage path resolution working correctly

Issue: #52
Update MCP server to use centralized storage paths for repository
indexes and GitHub state.

Implementation:
- Updated dev-agent-mcp.ts to use getStoragePath() and getStorageFilePaths()
- MCP server now uses centralized ~/.dev-agent/indexes/{repo-hash}/ structure
- Added infrastructure for lazy loading (prefixed with _ for future use)
- Updated RepositoryIndexer and GitHubIndexer to use centralized paths

Features:
- Centralized storage for all indexed repositories
- Lazy loading infrastructure (foundation for future optimization)
- Consistent storage paths across CLI and MCP server

Testing:
- MCP server updated and verified
- Storage path resolution working correctly

Issue: #52
@prosdev prosdev force-pushed the issue/storage-config-system branch from f76ffa5 to 48d7dce Compare November 25, 2025 13:39
@prosdev prosdev merged commit 7d2246c into main Nov 25, 2025
1 check passed
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.

Foundation: Storage + Config System

1 participant