Research-Stack/4-Infrastructure/NoDupeLabs/docs/reference/IMPORT_PATH_MAPPING.md

5.6 KiB

Import Path Mapping for NoDupeLabs Project

Overview

This document maps the old import paths to the new import paths after the project restructuring.

Path Mapping

Database Module

  • Old: nodupe.core.database.connectionNew: nodupe.tools.databases.connection
  • Old: nodupe.core.database.filesNew: nodupe.tools.databases.files
  • Old: nodupe.core.database.repository_interfaceNew: nodupe.tools.databases.repository_interface
  • Old: nodupe.core.database.schemaNew: nodupe.tools.databases.schema
  • Old: nodupe.core.database.queryNew: nodupe.tools.databases.query
  • Old: nodupe.core.database.databaseNew: nodupe.tools.databases.database

Hashing Module

  • Old: nodupe.core.hasherNew: nodupe.tools.hashing.hasher_logic
  • Old: nodupe.core.hasher_interfaceNew: nodupe.tools.hashing.hasher_logic

Archive Module

  • Old: nodupe.core.archive_interfaceNew: nodupe.tools.archive.archive_logic

MIME Module

  • Old: nodupe.core.mime_interfaceNew: nodupe.tools.mime.mime_logic

Compression Module

  • Old: nodupe.core.compressionNew: nodupe.tools.compression_standard.engine_logic

Time Sync Module

  • Old: nodupe.core.time_syncNew: nodupe.tools.time_sync.time_sync_logic

File System Module

  • Old: nodupe.core.filesystemNew: nodupe.tools.os_filesystem.fs_logic

Scanner Engine Module

  • Old: nodupe.core.scan.processorNew: nodupe.tools.scanner_engine.processor
  • Old: nodupe.core.scan.walkerNew: nodupe.tools.scanner_engine.walker
  • Old: nodupe.core.scan.hasherNew: nodupe.tools.hashing.hasher_logic
  • Old: nodupe.core.scan.progressNew: nodupe.tools.scanner_engine.progress
  • Old: nodupe.core.scan.file_infoNew: nodupe.tools.scanner_engine.file_info
  • Old: nodupe.core.incrementalNew: nodupe.tools.scanner_engine.incremental

Cache Modules

  • Old: nodupe.core.cache.embedding_cacheNew: nodupe.tools.ml.embedding_cache
  • Old: nodupe.core.cache.hash_cacheNew: nodupe.tools.hashing.hash_cache
  • Old: nodupe.core.cache.query_cacheNew: nodupe.tools.databases.query_cache

Security Module

  • Old: nodupe.core.securityNew: nodupe.tools.security_audit.security_logic

Maintenance Module

  • Old: nodupe.core.maintenanceNew: nodupe.tools.maintenance.manager_logic

API Modules

  • Old: nodupe.core.api.validationNew: nodupe.core.api.validation
  • Old: nodupe.core.api.codesNew: nodupe.core.api.codes
  • Old: nodupe.core.api.ipcNew: nodupe.core.api.ipc

Tool System Modules

  • Old: nodupe.core.tool_system.registryNew: nodupe.core.tool_system.registry
  • Old: nodupe.core.tool_system.loaderNew: nodupe.core.tool_system.loader
  • Old: nodupe.core.tool_system.discoveryNew: nodupe.core.tool_system.discovery
  • Old: nodupe.core.tool_system.lifecycleNew: nodupe.core.tool_system.lifecycle
  • Old: nodupe.core.tool_system.baseNew: nodupe.core.tool_system.base
  • Old: nodupe.core.tool_system.accessible_baseNew: nodupe.core.tool_system.accessible_base

Core Modules (Unchanged)

  • nodupe.core.config
  • nodupe.core.container
  • nodupe.core.loader
  • nodupe.core.main
  • nodupe.core.errors
  • nodupe.core.version
  • nodupe.core.deps
  • nodupe.core.limits
  • nodupe.core.logging_system

Fixes Applied

Test File Import Fixes

The following test files have been updated to use the new import paths:

  1. Cache Tests (tests/core/cache/):

    • test_embedding_cache.pynodupe.tools.ml.embedding_cache
    • test_hash_cache.pynodupe.tools.hashing.hash_cache
    • test_query_cache.pynodupe.tools.databases.query_cache
  2. Scanner Tests (tests/core/):

    • test_file_walker.pynodupe.tools.scanner_engine.walker, nodupe.tools.scanner_engine.file_info
    • test_file_processor.pynodupe.tools.scanner_engine.processor, nodupe.tools.scanner_engine.walker
    • test_file_hasher.pynodupe.tools.hashing.hasher_logic
    • test_file_info.pynodupe.tools.scanner_engine.file_info
    • test_progress_tracker.pynodupe.tools.scanner_engine.progress
    • test_incremental.pynodupe.tools.scanner_engine.incremental

Module Import Fixes

The following module files have been fixed to resolve broken imports:

  1. nodupe/tools/ml/init.py - Removed broken from .ml_tool import register_tool import
  2. nodupe/tools/scanner_engine/init.py - Fixed imports to include proper exports
  3. nodupe/tools/archive/archive_logic.py - Fixed imports to use correct paths:
    • nodupe.tools.compression_standard.engine_logic
    • nodupe.tools.mime.mime_logic
    • nodupe.core.archive_interface
    • nodupe.core.container
  4. nodupe/tools/mime/mime_logic.py - Fixed import to use nodupe.core.mime_interface

Current Status

  • Initial State: 36 errors, 734 tests collected
  • Current State: 33 errors, 794 tests collected
  • Tests Resolved: 60 more tests now collecting successfully
  • Errors Reduced: 3 fewer errors

Remaining Work

The following test files still have import errors that need to be resolved:

  • test_plugins.py
  • test_progress_tracker.py (may need re-check)
  • test_rollback.py
  • test_rollback_idempotent.py
  • test_security.py
  • test_time_sync_failure_rules.py
  • test_time_sync_utils.py
  • test_validators.py
  • Various integration and performance tests