Fix test failures and rename Makefile targets for consistency

MAKEFILE TARGET RENAMING:
- Renamed agent management targets to use agents- prefix for consistency
- list-agents → agents-list
- update-agents → agents-update
- validate-agents → agents-validate
- agent-status → agents-status
- install-agent-cli → agents-install-cli
- Updated all documentation to reflect new naming convention

TEST FIXES:
- Fixed backup directory collision in tests by adding microseconds and counter
- Improved dependency detection to be more precise and avoid false positives
- Updated dependency parsing to support YAML frontmatter dependencies
- Fixed test expectations to match actual validation behavior
- All 24 tests now passing

DEPENDENCY SYSTEM IMPROVEMENTS:
- Enhanced dependency extraction from YAML frontmatter (dependencies, depends_on, requires)
- More precise agent reference detection in content
- Better handling of explicit vs implicit dependencies
- Improved validation error reporting

This ensures consistent naming convention (setup-, standards-, agents-) across
all Makefile targets while fixing test reliability issues.

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-10-19 08:03:45 +02:00
parent 38965c1d4a
commit 873120c2d3
7 changed files with 89 additions and 58 deletions

View File

@@ -128,6 +128,7 @@ description: Base agent with no dependencies
dependent_agent = """---
name: dependent-agent
description: Agent that depends on base-agent
dependencies: ["base-agent"]
---
# Dependent Agent
@@ -138,6 +139,7 @@ This agent uses base-agent for functionality.
complex_agent = """---
name: complex-agent
description: Agent with multiple dependencies
dependencies: ["base-agent", "dependent-agent"]
---
# Complex Agent
@@ -188,23 +190,26 @@ description: A valid agent
# Valid Agent
"""
# Create invalid agent (missing required fields)
invalid_agent = """---
description: Missing name field
# Create agent with missing dependency
missing_dep_agent = """---
name: missing-dep-agent
description: Agent with missing dependency
dependencies: ["non-existent-agent"]
---
# Invalid Agent
# Missing Dependency Agent
"""
(tmp_path / "agent-valid-agent.md").write_text(valid_agent)
(tmp_path / "agent-invalid-agent.md").write_text(invalid_agent)
(tmp_path / "agent-missing-dep-agent.md").write_text(missing_dep_agent)
registry = AgentRegistry(tmp_path)
errors = registry.validate_agents()
# The invalid agent should not be loaded, so no validation errors
# (it fails during loading)
assert len(errors) == 0 # Because invalid agents aren't loaded
# Should have one error for missing dependency
assert len(errors) == 1
assert "missing-dep-agent" in errors
assert "Missing dependency: non-existent-agent" in errors["missing-dep-agent"]
def test_agent_category_determination():