Vinv

v0.0.5
io.github.VinvAI/vinv Checked 6 hours ago Published 3 months ago

Vinv runs, tests, and finds issues in your services — with zero code changes.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

vinv_query

Semantic code search over the prebuilt index of this workspace. Use INSTEAD of grep/glob when looking for code by meaning or behavior rather than an exact string — e.g. "where are auth tokens refreshed", "what validates uploads". Returns the most relevant symbols (functions/classes) ranked, with file paths and scores, in a single call.

ParameterTypeDescription
query *stringNatural-language search query.
top_knumberNumber of results (default 5).

vinv_index

Build or refresh Vinv's semantic code index for THIS workspace. The build runs in the BACKGROUND and this call returns IMMEDIATELY with status — it never blocks. Call with no arguments to start/refresh the index and read its status; pass rebuild=true to force a full rebuild from scratch. Until the first build completes, vinv_query returns a "still indexing" notice, so call this once up front on a fresh workspace, then poll it for readiness.

ParameterTypeDescription
rebuildbooleanForce a full rebuild from scratch (default false: incremental update when an index already exists).

vinv_deadcode

List Python definitions (functions, classes, methods) that NOTHING in the repository references — dead code — found by static analysis of the source. Needs no prebuilt index and no runtime, so it works immediately on any workspace and returns each unused symbol with its file and line. Use it to find safe-to-remove code; before deleting a reported symbol, still confirm it is not referenced dynamically (by name) or exported as public API.

ParameterTypeDescription
includestringOnly report definitions under this path prefix (e.g. "src/").
reasonsbooleanDate each symbol from git history and classify it as never-wired vs lost-its-callers (slower; needs git).
show_probablebooleanAlso include methods that may be overrides or duck-typed (higher recall, more false positives).

vinv_feedback

After you have acted on vinv_query results (opened the files, made the edit), call this once to record whether they helped, passing the vinv_decision_id from that response. Use reward in [-1,1], where 1 is fully useful and -1 is harmful. This trains retrieval for this workspace.

ParameterTypeDescription
decision_id *string
reward *number
outcomestringOptional short outcome label.

vinv_session

Read what Vinv has observed about this workspace at runtime, and drive its automated fix/optimize runs ("episodes"), from chat. READ: action="requests" (what became of each sweep/fix you QUEUED — a queued sweep does not always dispatch, and this is the only durable record of why one did not), action="trajectory" (every episode so far — what was tried, whether it verified, the reward, the standing goal, any disputes), action="status" (one-paragraph session summary), action="issues" (functions observed raising errors in captured runtime traces), action="hotspots" (the few functions where mos…

ParameterTypeDescription
action *stringOperation to perform.
budgetnumberEpisode budget for set_budget.
goalstringStanding goal for set_goal; an empty string clears it.
issuestringFor action="fix": what to investigate and fix.
kindstringFor action="playbook": which waste kind to get guidance and live evidence paths for.
servicestringFor action="fix": optional service name — the fix is then verified by replaying that service.
sweepstringFor action="run_sweep": which evidence seeds the queued run — runtime_errors (fix functions observed raising errors), hotspots (optimize where traced time concentrates), memory_trends (investigate l…

values_of

Value profile for a symbol across the captured run(s): per-argument and return type mix, null-rate, numeric/length ranges, and most-common values. Answers "what does this function actually receive and return at runtime" — use this for ground truth instead of inferring inputs/outputs from source.

ParameterTypeDescription
symbol *stringSymbol to inspect: a dotted qualname or a unique short name.

rank_suspects

Call FIRST when investigating a bug, error, or failing request/test: ranks symbols by fault suspiciousness (Ochiai SBFL) over the pass/fail spectra of all captured requests. Answers "which functions should I look at first for this failure" — cheaper and more targeted than reading source files.

ParameterTypeDescription
limitnumberMax suspects to return (default 20).

slice

Backward dynamic slice to a symbol: the caller chain from the request root down to it, annotated with the argument/return values observed at each frame. Answers "what flowed in to reach this call" — use when tracing how a bad value or state reached a function.

ParameterTypeDescription
symbol *stringSymbol to inspect: a dotted qualname or a unique short name.

relevant_to

Rank the codebase by graph relevance to one or more symbols you name — the SAME typed-edge personalized-PageRank walk that composed your context pack, re-anchored on your choice. Use when you have found symbols that matter and want what surrounds them, ranked: it answers "what else is relevant to THESE", which semantic search (vinv_query) and plain traversal (blast_radius) cannot. Returns walk mass per symbol so the ranking is auditable, and reports how many symbols it reached versus returned.

ParameterTypeDescription
symbols *arrayAnchor symbols — a bare name, a dotted qualname, or file:name to disambiguate.
budgetnumberMax symbols to return (default 40, ceiling 200).
max_hopsnumberOptional admission bound: only symbols within this many hops of an anchor may enter. Ranking is by walk mass regardless. Omit for unbounded.

blast_radius

Transitive callers (upstream) and callees (downstream) of a symbol in the observed call graph. Answers "if this is wrong, what could be implicated or affected".

ParameterTypeDescription
symbol *stringSymbol to inspect: a dotted qualname or a unique short name.
directionstringup = callers only, down = callees only, both (default).

why_did_this_run

The entry-point triggers and call paths that led to a symbol running. Answers "why was this function invoked".

ParameterTypeDescription
symbol *stringSymbol to inspect: a dotted qualname or a unique short name.

coverage_of

Execution coverage: with a symbol, its call count / ok-error / timing; without one, every executed symbol ranked by call volume. Answers "what ran and how much".

ParameterTypeDescription
symbolstringOptional symbol; omit for a whole-run overview.

callers_of

The observed direct callers of a symbol, with call counts. Answers "who calls this at runtime".

ParameterTypeDescription
symbol *stringSymbol to inspect: a dotted qualname or a unique short name.

vinv_ingest_run

Report a test run you performed, so it appears in the Journey and Findings views. Supply one entry per check with the unit you exercised, a scenario name, and the pass/fail verdict — the verdict is the one thing traces cannot supply. A unit is usually an HTTP endpoint ("METHOD /path"), but a repo with no service has units too: a CLI invocation ("RUN <command>") or a driven function ("CALL module.function"). Per-unit code coverage is joined automatically from the captures. Run this AFTER the work has been captured by tracelens.

ParameterTypeDescription
checks *arrayOne entry per check performed.
sourcestringWho produced this run, recorded as provenance (e.g. "claude-code e2e suite").

vinv_list_candidates

Ranked optimization candidates from the captured traces, each with the evidence behind it and a playbook for that class of waste (cache, fanout, n-plus-1, per-call, serial-async, wait, gc-pressure, alloc-churn, mem-leak). Read this before attempting any performance work — it reports what the traces actually measured, not a static guess.

ParameterTypeDescription
include_playbookbooleanInclude the full playbook text for each candidate (default true).
limitnumberMax candidates to return (default 10).

vinv_run_status

What vinv currently holds for this workspace: capture sessions, whether an external run has been ingested, endpoint/coverage/issue counts, and the number of ranked candidates. Call this to check whether an ingest landed.