Skip to main content

Module registry

Module registry 

Source
Expand description

Adapter auto-detection registry and selection.

Provides detect_adapter() which auto-detects the appropriate VCS adapter for a project, and select_adapter() which resolves a named adapter from configuration with auto-detection fallback.

§Resolution order

When an adapter name is given (e.g., adapter = "perforce"):

  1. Check built-in adapters: git, svn, perforce, none.
  2. Check for an installed plugin via find_vcs_plugin():
    • .ta/plugins/vcs/<name>/plugin.toml
    • ~/.config/ta/plugins/vcs/<name>/plugin.toml
    • ta-submit-<name> on $PATH
  3. Warn and fall back to auto-detection.

§§15 compliance enforcement

When loading any VCS adapter (built-in or external plugin), the registry validates §15 compliance:

  • If an adapter’s protected_submit_targets() is non-empty but verify_not_on_protected_target() is a no-op, a tracing::warn! is emitted.
  • External plugins that declare "protected_targets" capability signal full §15 compliance. Plugins without this capability receive a debug notice.

Constants§

TA_VERSION
TA version string used in plugin handshakes.

Functions§

detect_adapter
Auto-detect the appropriate VCS adapter for the given project root.
detect_adapter_with_config
Auto-detect the appropriate VCS adapter, passing through config (co-author, branch prefix, etc.) to the detected adapter.
enforce_section15
Enforce §15 VCS Submit Invariant on any loaded adapter.
enforce_section15_plugin
Enforce §15 on an external plugin and warn if protected_targets capability is missing.
known_adapters
List all known built-in adapter names.
select_adapter
Select an adapter by name from configuration, with auto-detection fallback.
select_adapter_with_sync
Select an adapter with full configuration including sync settings.