diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-06 10:50:10 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-06 10:50:10 -0500 |
| commit | fdc5f550d35d97272e3e5cac2f46ca7f892dda09 (patch) | |
| tree | b501eaa84d4ed69e1833d71b4b20468f50c00926 /tests/test-duet-classify-path.el | |
| parent | 04f9eb281529965c4aff9ca9176b549fac4ae30f (diff) | |
| download | duet-fdc5f550d35d97272e3e5cac2f46ca7f892dda09.tar.gz duet-fdc5f550d35d97272e3e5cac2f46ca7f892dda09.zip | |
feat: add the transport-backend registry and contract checks
This is the seam every transport plugs into (Phase 2 in the design spec). A duet-backend struct carries a scorer, a command builder, capability flags, and contract metadata; duet-register-backend keeps a registry where re-registering a name replaces the prior backend, which is how a user or plugin overrides a built-in. duet--select-backend asks every backend to score an endpoint pair and picks the lowest cost, breaking ties toward the most recently registered.
The failure-normalizer interface turns a raw process failure into a class, a cause, evidence, a safety outcome, and next actions. Backends supply a pattern table via duet-define-cli-failure-patterns; anything unmatched falls back to a minimal normalizer that covers launch failure, missing executable, stall, signal, and unknown exit. This is what will let DUET explain a failure instead of dumping stderr.
Secrets are redacted before they reach a log: a pattern keeps its group-1 field label and strips the value, and a backend with no secret surface declares :none rather than an empty pattern list, so a forgotten declaration (nil) stays distinguishable from a deliberate one.
The tiered contract checks (minimum, publishable, capability) return a list of violations a backend author asserts is empty in one ERT test. The built-in rsync and TRAMP backends register through this same API in Phase 3, once their command builders land; here the machinery is exercised by fake backends.
Diffstat (limited to 'tests/test-duet-classify-path.el')
0 files changed, 0 insertions, 0 deletions
