From 4ceb6cce4246243ff44b1f6d09adb63c19183364 Mon Sep 17 00:00:00 2001 From: tegwick Date: Fri, 24 Oct 2025 20:08:48 +0200 Subject: [PATCH] fix: make AssetManager registry path relative to storage_path by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a robust fix for test registry isolation that addresses the root cause: when AssetManager is created with only storage_path, the registry now defaults to storage_path.parent/asset_registry.json instead of cwd/asset_registry.json. Benefits: - Tests using temp directories automatically get isolated registries - No need to manually fix every test file - Consistent behavior: registry stays with the asset storage - Explicit registry_path still works for custom configurations This makes the AssetManager behavior more intuitive and prevents test artifacts from contaminating the production asset registry. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- markitect/assets/manager.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/markitect/assets/manager.py b/markitect/assets/manager.py index f9ad2fa8..9b2e6090 100644 --- a/markitect/assets/manager.py +++ b/markitect/assets/manager.py @@ -64,8 +64,10 @@ class AssetManager: assets_config.get('storage_path', DEFAULT_ASSETS_DIR) ).resolve() + # Default registry path should be relative to storage_path, not cwd + default_registry_path = self.storage_path.parent / DEFAULT_REGISTRY_FILENAME self.registry_path = Path( - assets_config.get('registry_path', DEFAULT_REGISTRY_FILENAME) + assets_config.get('registry_path', default_registry_path) ).resolve() self.database_path = Path(