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"):
- Check built-in adapters:
git,svn,perforce,none. - Check for an installed plugin via
find_vcs_plugin():.ta/plugins/vcs/<name>/plugin.toml~/.config/ta/plugins/vcs/<name>/plugin.tomlta-submit-<name>on$PATH
- 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 butverify_not_on_protected_target()is a no-op, atracing::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_targetscapability 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.