Skip to content

feat(diagnostics): get_vaultpilot_config_status — read-only config snapshot - #148

Merged
szhygulin merged 1 commit into
mainfrom
feat/config-status-tool
Apr 25, 2026
Merged

feat(diagnostics): get_vaultpilot_config_status — read-only config snapshot#148
szhygulin merged 1 commit into
mainfrom
feat/config-status-tool

Conversation

@szhygulin

Copy link
Copy Markdown
Collaborator

Summary

Item 2.1 (server-side half) from claude-work/HIGH-plan-broad-audience-onboarding.md. Ships the diagnostic tool the future agent-guided /setup skill will call to know what the user's already configured. Independently useful for triage today.

Branched directly off latest main (post-#147 + #145).

What ships

New tool get_vaultpilot_config_status registered in src/index.ts and backed by src/modules/diagnostics/index.ts. Read-only, pure local I/O — reads ~/.vaultpilot-mcp/config.json and inspects process.env. No RPC calls, no network.

Output shape (every field is non-secret)

Field Type Notes
configPath + configFileExists + serverVersion strings + boolean Where the server reads / writes its config
rpc.<chain>.source (EVM, per chain) enum env-var | provider-key-env | provider-key-config | custom-url-config | public-fallback
rpc.solana.source enum env-var | config-url | public-fallback
apiKeys.{etherscan,oneInch,tronGrid,walletConnectProjectId} { set: boolean, source: "env-var" | "config" | "unset" } Boolean only — values never leak
pairings.{solana,tron}.count integer Counts, not addresses
pairings.walletConnect.sessionTopicSuffix string | undefined Last 8 chars only, matching get_ledger_status convention
preflightSkill.{expectedPath, installed} string + boolean Respects VAULTPILOT_SKILL_MARKER_PATH override

Strict no-secrets contract

The output is booleans, counts, source-classification enums, and an 8-char topic suffix. Never raw API keys, RPC URLs, or session topics. A dedicated test plants seven distinct secrets across env vars + config and asserts none appear in the serialized response.

Test plan

  • npm test848/848 pass (+18 new diagnostics tests).
  • npm run build — clean.
  • Coverage: 5 EVM RPC source-classification branches, 3 Solana branches, env-vs-config priority, WC topic-suffix extraction, pairings count, preflight-skill detection + override, no-secrets sweep.
  • Manual: invoke the tool against a fresh install + a fully-configured install and eyeball the output.

Deferred

The agent-guided /setup slash command (the SKILL side of item 2.1) is a separate external repo (vaultpilot-setup-skill) — out of scope. This tool is the contract the skill will call against.

🤖 Generated with Claude Code

…apshot

Item 2.1 (server-side half) from claude-work/HIGH-plan-broad-audience-
onboarding.md. Ships the diagnostic tool the future agent-guided
/setup skill (separate repo) will call to know what the user's
already configured. Independently useful for triage today: "is my
config the way I think it is?"

## What ships

New tool `get_vaultpilot_config_status` registered in `src/index.ts`
and backed by `src/modules/diagnostics/index.ts`. Read-only, pure
local I/O — reads `~/.vaultpilot-mcp/config.json` and inspects
`process.env`. No RPC calls, no network.

## Output shape (every field is non-secret)

- `configPath` + `configFileExists` + `serverVersion`.
- `rpc.<chain>.source` per EVM chain — one of `env-var` /
  `provider-key-env` / `provider-key-config` / `custom-url-config` /
  `public-fallback`. Mirrors the priority order in
  `src/config/chains.ts:resolveRpcUrlRaw` so the diagnostic answer
  matches what the resolver actually produces.
- `rpc.solana.source` — `env-var` / `config-url` / `public-fallback`.
- `apiKeys.{etherscan,oneInch,tronGrid,walletConnectProjectId}` —
  `{ set: boolean, source: "env-var" | "config" | "unset" }`.
- `pairings.solana.count`, `pairings.tron.count` — integer counts
  (never the addresses).
- `pairings.walletConnect.sessionTopicSuffix` — last 8 chars only,
  matching the existing `get_ledger_status` convention. Full topic
  is never returned.
- `preflightSkill.{expectedPath, installed}` — boolean install state
  + the marker path we checked (respects
  `VAULTPILOT_SKILL_MARKER_PATH` override).

## Strict no-secrets contract

The output deliberately surfaces only booleans, counts, source-
classification enums, and a session-topic suffix. Test
`never echoes any planted secret value anywhere in the output`
plants seven distinct secrets across env vars + config and asserts
none of them appear in the serialized response.

## Tests

`test/diagnostics-config-status.test.ts` — 18 cases covering:
- Five EVM RPC source-classification branches per chain.
- Three Solana RPC source-classification branches.
- API-key env-vs-config priority.
- WC session-topic suffix extraction (full topic must NOT leak).
- Pairings count from persisted config.
- Preflight-skill detection + `VAULTPILOT_SKILL_MARKER_PATH` override.
- The strict no-secrets sweep.

## Verification

- `npm test` — 848/848 pass (+18 new diagnostics tests).
- `npm run build` — clean TS.
- README "Tools" section gains the new tool with a short summary +
  the no-secrets-contract note.

## Deferred

Agent-guided `/setup` slash command (the SKILL side of item 2.1) is
a separate external repo (`vaultpilot-setup-skill`) — out of scope
for this PR. This tool is the contract the skill will call against.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@szhygulin
szhygulin merged commit 019a797 into main Apr 25, 2026
3 checks passed
@szhygulin
szhygulin deleted the feat/config-status-tool branch April 25, 2026 02:14
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