Skip to content

AI Assistant ​

Current responsibility: freeze the browser selection, collect typed evidence through existing workbench services, compose a cited answer, and navigate back to cited layers or values. The first version uses a deterministic FakeProvider. No real provider or tool execution is wired. The assistant does not import ACT, override ACT verdicts, or execute arbitrary tools. See the parent scope, repository rules, and the development task guide.

Change Guide ​

GoalEdit hereConditional / reused path
Change evidence display or navigationAssistantView.tsxworkspace / app composition only if navigation props change.
Add facts from an existing servicecollect_evidence in explain.py, test_assistant.pyEdit the supplying module only when its public query lacks the data. Preserve frozen context and citation resolution.
Change fake-provider wordingFakeProvider in explain.pyNo prose-pinning tests. Add/update behavior checks only for changed structured fields or evidence semantics.
Change request/response contractschemas.py, explain.py, consuming view; generate wire typesRoutes/client/hooks only when endpoints, arguments or mutation handling change.
Integrate a real providerAI-02: add a bounded provider adapter and configuration, then evaluate it separatelyExisting fake-provider tests remain deterministic; they do not validate a real provider. No execution tools are currently wired.

New wire fields require npm run gen:types. AI-03 is node evidence, AI-04 is authorized plan execution; both remain separate from today's read-only explanation flow.

Flow Diagram ​

BlockImplementation and contract
ContextSelectionContext and the context object in AssistantView.tsx. It is copied at request time and returned with the answer.
Evidence collectioncollect_evidence in explain.py. Reads existing module services, checks model and run identity, and records ACT verdict, coverage, and layer facts.
ProviderFakeProvider.compose in explain.py. Deterministic templates over facts. It is not a language model.
Citation checkexplain in explain.py. Every cited ID must exist in the collected evidence map or the request fails.
HTTPassistant_providers and assistant_explain in routes.py.
ViewAssistantView renders observation, interpretation, hypothesis, or missing sections and navigates only to evidence with a layer ID.
Neighbor handoffworkspace receives navigation. analysis, bab, verification, and model_spec remain owners of their services. See the parent flow diagram.

Validation ​

Run this module's existing test command:

bash
.venv/bin/python -m pytest visual_bench/assistant

Observable behavior: the provider list marks the fake provider available and real providers not configured, an answer returns its frozen context and resolved evidence, clicking a layer evidence chip navigates to that layer, and a context mismatch fails explicitly. These are validation instructions, not a new test result.

Reference and Backlog ​

Current files and routes

Current Files and Routes ​

FileResponsibility
schemas.pySelectionContext, ExplainRequest, ExplainResponse, EvidenceRef, AnswerSection, and ProviderList.
explain.pyFreezes context, collects evidence through wb.models, wb.runs, wb.bab, and wb.analysis, composes with a provider, and rejects unresolved citations.
routes.pyGET /api/assistant/providers and POST /api/assistant/explain.
api.tsProvider query and explain request client.
hooks.tsProvider query and explain mutation.
AssistantView.tsxQuestion input, provider status, answer sections, evidence chips, and layer or neuron navigation.
test_assistant.pyCitation resolution, frozen context, ACT verdict passthrough, and context mismatch.
Task acceptance, rationale, and planned capabilities

Tasks and Acceptance ​

IDDeliverableDepends onCompletion evidence
AI-01Define context/evidence/tools with fake providerVER-01, WS-02Tools validate arguments and preserve frozen context; malicious instructions in tool data cannot change scope.
AI-02Integrate one provider for layer/stage evidence explanationAI-01, ANA-01A selected real layer/stage of a completed run produces an answer whose evidence links resolve to the exact ACT stage data; missing evidence and provider failure remain explicit; manual GUI remains usable.
AI-03Extend evidence explanation to committed BaB nodesAI-02, BAB-01A real unresolved node produces an evidence-linked answer bound to its run/node/revision; summary-only coverage is stated rather than filled in.
AI-04Implement versioned plan execution and evaluationAI-03, VER-04Authorized steps share command IDs across retries; stale plans stop dependents; reviewed research cases record correctness, evidence support, latency, and use.

Current status: AI-01 has a first-version fake provider and typed evidence; executable tools are not implemented. AI-02, AI-03, and AI-04 are planned.

Provider and tool adapters should stay small. Plans should be versioned and bounded, and retries must not reapply completed commands. A valid evidence reference proves identity and availability, not that an interpretation is correct. Evaluate interpretation separately.

Planned operations are explain, proposePlan, executePlan, and cancelSession. Implemented equivalents are the explain function, FakeProvider, and direct calls to workbench services. Planned files such as providers.py, tools.py, and orchestration.py do not exist yet.

Owner: B owns orchestration, C owns interaction, and A reviews scientific explanations. On completion, record exact commands, provider versions, real samples, and unverified behavior.