Skip to content

refactor(vta): adopt vta-sdk connect_auto, delete duplicated transport branch (R22)#107

Merged
stormer78 merged 1 commit into
mainfrom
r22-vta-connect-auto
Jun 12, 2026
Merged

refactor(vta): adopt vta-sdk connect_auto, delete duplicated transport branch (R22)#107
stormer78 merged 1 commit into
mainfrom
r22-vta-connect-auto

Conversation

@stormer78

Copy link
Copy Markdown
Contributor

Problem

The DIDComm-vs-REST VTA connect branch — transport selection, the
rest_fallback derivation, and the empty-vta_url rule — was hand-rolled
identically in two places:

  • did-git-sign/src/vta.rs::authenticate
  • openvtc-core/src/config/mod.rs::build_runtime_vta_client

That logic is SDK-level knowledge. The upstream issue
(OpenVTC/verifiable-trust-infrastructure#366) proposed VtaClient::connect_auto,
which shipped in vta-sdk 0.11 as connect_auto(AutoConnect) -> ConnectedVta.

Fix

  • Bump vta-sdk 0.100.11.
  • build_runtime_vta_client delegates to connect_auto. A small
    map_connect_error preserves the R18 error taxonomy:
    VtaError::ValidationOpenVTCError::Config (bad on-disk config, e.g.
    empty REST url), VtaError::AuthOpenVTCError::Auth, everything else
    (network / DIDComm session open) → OpenVTCError::Vta.
  • did-git-sign keeps its application-level policy — caller-side REST
    token cache + transient-failure retry — but routes the actual connect
    through connect_auto via a new connect_with_retry. The cached-token
    short-circuit is now explicitly gated on the REST transport
    (mediator_did.is_none()), matching the prior implicit gating; the
    empty-access-token guard is preserved on the REST path.

Behavior notes

  • Identical for DIDComm-capable and REST-only VTAs.
  • One intentional, benign change: retry now covers the DIDComm path too (it
    previously wrapped only the REST challenge-response). A transient mediator
    hiccup is worth a second attempt on either transport; bounded by
    MAX_AUTH_RETRIES = 2.

Tests / gate

  • cargo fmt --all, cargo clippy --workspace --all-targets -- -D warnings,
    cargo test --workspace — all green.
  • Existing validate_credentials unit tests in did-git-sign unchanged and
    passing.
  • Reviewed the diff against the published connect_auto semantics for
    error-mapping fidelity, cache gating, and the empty-token guard — no
    correctness regressions.

Follow-up (pre-existing, out of scope)

did-git-sign::authenticate returns the VtaClient to callers that never call
shutdown(), leaking the DIDComm session per git commit. This is identical
in the deleted code
(not a regression). Worth a separate fix giving
did-git-sign a with_didcomm-style scoped shutdown, mirroring
openvtc-core::with_runtime_vta_client.

🤖 Generated with Claude Code

…t branch (R22)

The DIDComm-vs-REST connect branch — transport selection, the `rest_fallback`
derivation, and the empty-URL rule — was hand-rolled identically in two places:
`did-git-sign/src/vta.rs::authenticate` and
`openvtc-core/src/config/mod.rs::build_runtime_vta_client`. That logic is
SDK-level knowledge, so vta-sdk 0.11 now exposes `VtaClient::connect_auto`
(upstream issue OpenVTC/verifiable-trust-infrastructure#366).

- Bump vta-sdk 0.10 -> 0.11.
- `build_runtime_vta_client` delegates to `connect_auto`; a small
  `map_connect_error` keeps the R18 error taxonomy (Validation -> Config,
  Auth -> Auth, else -> Vta).
- `did-git-sign` keeps its application-level policy (caller-side REST token
  cache + transient-failure retry) but routes the actual connect through
  `connect_auto` via a new `connect_with_retry`. Retry now covers the DIDComm
  path too — a benign improvement; a transient mediator hiccup is worth a
  second attempt on either transport.

Behavior is otherwise identical for DIDComm-capable and REST-only VTAs.

Gate: cargo fmt, clippy -D warnings, test --workspace all green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Glenn Gore <glenn.g@affinidi.com>
@stormer78 stormer78 requested a review from a team as a code owner June 12, 2026 05:29
@stormer78 stormer78 merged commit 2ab9ed2 into main Jun 12, 2026
11 of 13 checks passed
@stormer78 stormer78 deleted the r22-vta-connect-auto branch June 12, 2026 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant