Skip to content

feat(core): typed Vta/Auth error variants distinct from Config#100

Merged
stormer78 merged 2 commits into
mainfrom
feat/r18-typed-vta-auth-errors
Jun 11, 2026
Merged

feat(core): typed Vta/Auth error variants distinct from Config#100
stormer78 merged 2 commits into
mainfrom
feat/r18-typed-vta-auth-errors

Conversation

@stormer78

Copy link
Copy Markdown
Contributor

Task R18 (remediation plan, Phase R3 — structural).

Problem

build_runtime_vta_client (openvtc-core/src/config/mod.rs) mapped VTA session failures and auth failures into the catch-all OpenVTCError::Config(String), so callers couldn't tell a retryable network/auth failure from genuine config corruption (which warrants a reset).

Fix

Added two thiserror variants — Vta(String) ("VTA Error: {0}", connection/session/transport) and Auth(String) ("Auth Error: {0}", challenge-response). Repointed the two runtime-fault sites; left the genuine config problems (non-VTA key backend, REST selected but vta_url empty) as Config.

Caller guidance: the TUI startup path had one catch-all "Couldn't load configuration!" (reset-framing) for any error; added a Vta(_) | Auth(_) arm printing "Couldn't reach the VTA!" + an actionable hint (re-authenticate / check VTA reachable), reserving the reset/setup path for real Config errors.

Tests

Variant rendering + a Vta/AuthConfig (reset-trigger) invariant. Boundary: live connect/auth paths need a real VTA, so the classification is tested at the variant level. Gate: fmt/clippy -D warnings/test --workspace green (core 142).

…ures (R18)

build_runtime_vta_client mapped VTA DIDComm-session and challenge-response
auth failures into the catch-all OpenVTCError::Config, so callers could not
tell a retryable VTA/auth fault from genuine config corruption (which warrants
a reset).

Add OpenVTCError::Vta (connection/session/transport) and OpenVTCError::Auth
(challenge-response). Repoint the DIDComm session-open failure to Vta and the
challenge_response failure to Auth. The non-VTA-backend and empty-vta_url sites
stay Config (genuine config problems). The TUI load path now surfaces
'check VTA / re-auth' guidance for Vta/Auth and reserves reset-style messaging
for Config.

Signed-off-by: Glenn Gore <glenn.g@affinidi.com>
@stormer78 stormer78 requested a review from a team as a code owner June 11, 2026 12:32
@stormer78 stormer78 merged commit 7573827 into main Jun 11, 2026
11 of 13 checks passed
@stormer78 stormer78 deleted the feat/r18-typed-vta-auth-errors branch June 11, 2026 12:43
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