Skip to content

Restore per-path conflict resolution strategies in module discovery #72

@synthable

Description

@synthable

Problem

The refactoring to use ModuleRegistry has caused a regression in conflict resolution functionality. Previously, users could configure different conflict strategies for different module paths in modules.config.yml:

localModulePaths:
  - path: './strict-modules'
    onConflict: 'error'
  - path: './flexible-modules' 
    onConflict: 'warn'

However, the current ModuleRegistry implementation only supports a single global conflict strategy set at construction time.

Impact

  • Users can no longer have different conflict resolution behaviors for different module paths
  • This is a functional regression from the previous implementation
  • The configuration schema still allows per-path strategies but they're ignored

Potential Solutions

  1. Extend ModuleRegistry: Add support for per-source conflict strategies to the ModuleSource interface and ModuleRegistry implementation
  2. Multiple Registries: Use separate registries per conflict strategy and merge results
  3. CLI-level Resolution: Handle per-path conflict logic in the CLI layer while using 'warn' strategy in the registry

Current Workaround

The current implementation uses a global strategy for the entire registry, which means all paths inherit the same conflict resolution behavior.

Related Files

  • packages/copilot-instructions-cli/src/utils/module-discovery.ts
  • packages/ums-lib/src/core/registry/module-registry.ts
  • packages/ums-lib/src/types/index.ts (ModuleSource interface)

Priority: Medium - This affects advanced users who rely on per-path conflict strategies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions