refactor: consolidate skill docs, add anti-drift tests, and apply audit fixes

DLO-13: Restructure vlm-library-workflow skill as safety contract layer.
- Rewrite SKILL.md (69 lines): safety contract, execution threshold semantics,
  six-step high-risk loop, decision rules, phase skeleton
- Delete redundant references (cli-reference, workflow, command-recipes, dev-guide)
- Add triage.md (failure mapping + preflight) and dev-map.md (module→test mapping)
- Add tests/test_docs_consistency.py: 78 parametrized tests verifying documented
  vlm commands exist in CLI registry
- Add CSV path mismatch test to test_plan_review.py (4th safety gate path)
- Delete vlm-expert.skill (Gemini package, 7 months stale) and README Gemini section

DLO-2 audit fixes: rate limiter injection, symmetric quarantine categories,
review-plan safety gates, parser improvements, planner validation.

CLI modularization: commands/ directory with one module per command group.
This commit is contained in:
windyboy
2026-09-25 13:50:09 +08:00
parent c7a55190d7
commit dfa18ed405
35 changed files with 1116 additions and 621 deletions
+16 -9
View File
@@ -82,19 +82,26 @@ class TestQuarantineManager:
assert expected_quarantine_path.exists()
assert expected_quarantine_path.read_text() == "test content"
def test_quarantine_anime_file_rejected(self, manager, config):
"""Test that quarantining anime files returns a failed result."""
def test_quarantine_anime_file_round_trip(self, manager, config):
"""Test that quarantining and restoring anime files works."""
# Create a test anime file
anime_file = config.library_root / "anime" / "Test Anime.mkv"
anime_file.write_text("test content")
result = manager.quarantine_file(anime_file)
assert result.success is False
assert "Quarantine not supported for category 'anime'" in (result.error_message or "")
assert result.success is True
expected_quarantine_path = config.library_root / "anime" / ".quarantine" / "Test Anime.mkv"
assert not anime_file.exists()
assert expected_quarantine_path.exists()
assert expected_quarantine_path.read_text() == "test content"
# Verify file was not moved
# Restore and verify round trip
restore_result = manager.restore_from_quarantine(expected_quarantine_path)
assert restore_result.success is True
assert anime_file.exists()
assert anime_file.read_text() == "test content"
assert not expected_quarantine_path.exists()
def test_quarantine_other_file_rejected(self, manager, config):
"""Test that quarantining other files returns a failed result."""
@@ -590,7 +597,7 @@ class TestQuarantineListing:
def test_list_quarantined_invalid_category(self, manager, config):
"""Test listing with invalid category returns empty list."""
entries = manager.list_quarantined(category="anime")
entries = manager.list_quarantined(category="unconfigured")
assert entries == []
entries = manager.list_quarantined(category="other")
@@ -906,7 +913,7 @@ class TestQuarantineRestoration:
category = manager._determine_category_from_quarantine(outside)
assert category is None
# Unsupported category
anime = config.library_root / "anime" / ".quarantine" / "Anime.mkv"
category = manager._determine_category_from_quarantine(anime)
# Unsupported category (directory not in configured categories)
other = config.library_root / "other" / ".quarantine" / "Other.mkv"
category = manager._determine_category_from_quarantine(other)
assert category is None