Files
markitect-main/tools/debug_paths.py
tegwick dbbf06db89
Some checks failed
Test Suite / unit-tests (3.11) (push) Has been cancelled
Test Suite / unit-tests (3.12) (push) Has been cancelled
Test Suite / integration-tests (push) Has been cancelled
Test Suite / e2e-tests (push) Has been cancelled
Test Suite / performance-tests (push) Has been cancelled
Test Suite / code-quality (push) Has been cancelled
Test Suite / security-scan (push) Has been cancelled
Test Suite / test-summary (push) Has been cancelled
refactor: Consolidate tools and add tooling optimizer agent
- Moved debug_paths.py from src/markitect/tools/ to tools/ for centralized tool organization
- Added tooling-optimizer agent specification to replace agent_tooling_optimizer.py script
- Updated .gitignore to allow debug_paths.py as legitimate tool (not temporary debug file)
- Removed empty src/markitect/tools/ directory

Organization: All development tools now consolidated in tools/ directory
Agent: Converted standalone script to proper Claude Code agent specification
Tooling: Improved discoverability and maintenance of development utilities

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-03 02:02:57 +02:00

51 lines
1.4 KiB
Python

import tempfile
from pathlib import Path
from click.testing import CliRunner
from markitect.shared.cli import cli
from markitect.ast_cache import ASTCache
# Create test similar to failing test
temp_dir = tempfile.mkdtemp()
cache_dir = Path(temp_dir) / ".ast_cache"
# Create test file
test_file = Path(temp_dir) / "test.md"
test_file.write_text("# Test")
print(f"Temp dir: {temp_dir}")
print(f"Cache dir: {cache_dir}")
print(f"Test file: {test_file}")
# Create cache like test does
cache = ASTCache(cache_dir)
cache.cache_file(test_file)
# Check cache files exist
cache_files = list(cache_dir.glob("*.ast.json"))
print(f"Cache files created: {len(cache_files)}")
print(f"Cache files: {cache_files}")
# Now run CLI in temp dir context
runner = CliRunner()
# Test 1: In current working directory
print("\n=== Test 1: Current working directory ===")
result1 = runner.invoke(cli, ['cache-clean'])
print(f"Exit code: {result1.exit_code}")
print(f"Output: {repr(result1.output)}")
# Test 2: Change working directory
print(f"\n=== Test 2: Change to temp directory ===")
import os
original_cwd = os.getcwd()
os.chdir(temp_dir)
result2 = runner.invoke(cli, ['cache-clean'])
print(f"Exit code: {result2.exit_code}")
print(f"Output: {repr(result2.output)}")
# Check what remains
cache_files_after = list(cache_dir.glob("*.ast.json"))
print(f"Cache files after: {len(cache_files_after)}")
os.chdir(original_cwd)