Skip to content

feat(diag): diag@vt agent extension + vt doctor CLI#5

Merged
timqi merged 1 commit into
mainfrom
diag-doctor
Jul 20, 2026
Merged

feat(diag): diag@vt agent extension + vt doctor CLI#5
timqi merged 1 commit into
mainfrom
diag-doctor

Conversation

@timqi

@timqi timqi commented Jul 20, 2026

Copy link
Copy Markdown
Owner

What

  • diag@vt — new read-only agent extension: reports cache modes/TTLs, how the agent classifies THIS connection (context basis), live grants scoped to the caller's own context, run@vt/audit-push status. No Touch ID, never cached, not audit-pushed, and it does not reset the idle clock (a polling loop can't keep grants alive). Relayed over --forward-real-agent so a remote vt doctor can ask why its cache doesn't hit.
  • vt doctor — config values with env-vs-config.toml source attribution + permission lint, VT_BACKEND routing decision, agent probe + diag@vt report with per-cache human explanations, worker reachability.
  • resolve_cache_contextclassify_cache_context returning {context, basis} (behavior unchanged; wrapper kept; no ? early-returns so each fallible lookup names its basis).

Why

Cache behavior (TTY gate, ssh narrowing, pwd keys, modes defaulting to none) is individually justified but compositionally opaque — the observable symptom is just "Touch ID prompted again". Design + codex-expert review record: docs/diag-design.md.

Verification

  • Linux: cargo test (167), just check green; vt doctor exercised end-to-end on a configured host (config attribution, routing, no-agent probe, worker 404-reachable all correct).
  • macOS agent code (handle_diag, classify refactor, new unit tests) needs this CI run — it doesn't compile on Linux hosts.

🤖 Generated with Claude Code

diag@vt is a read-only, VT_AUTH-gated agent extension (no Touch ID, never
cached, not audit-pushed, and it does not reset the idle clock so polling
cannot keep grants alive). It reports cache modes/TTLs, the caller's own
context classification with a basis tag, and live grants scoped to that
context only. Relayed over --forward-real-agent so a remote vt doctor can
diagnose its own connection.

vt doctor (cross-platform) prints config values with env-vs-config.toml
source attribution, the VT_BACKEND routing decision, the agent's diag@vt
report with human explanations per cache, and worker reachability.

resolve_cache_context is refactored into classify_cache_context returning
{context, basis}; behavior unchanged (thin wrapper preserved, precedence
order kept, no ?-early-returns so each fallible lookup names its basis).

Design + review record: docs/diag-design.md
@timqi
timqi merged commit 2d8232f into main Jul 20, 2026
4 checks passed
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