Skip to content

[Observability] Surface inference trace paths and token diagnostics in web results #109

Description

@agorevski

Finding

The web backend now returns trace paths and per-function prompt diagnostics, but the browser UI does not show them in the final results.

Evidence

  • web/app.py:506-525 writes inference traces and attaches trace_path to the trace payload.
  • web/app.py:540-581 collects prompt/token/truncation diagnostics.
  • web/app.py:601-623 includes those diagnostics in each function_results item.
  • web/app.py:1612-1628 sends trace_path in the SSE result event.
  • web/static/app.js:1224-1257 handles final results by rendering TAC, Solidity, analysis, and function mapping only.
  • web/static/app.js:670-680 defines Function Mapping columns for bytecode function, resolved name, confidence, source, status, elapsed, and error; there is no diagnostics/trace column, and rg finds no trace_path or diagnostics references in web/static/app.js.

Impact

A user can see poor Solidity in the web app but has no visible pointer to the saved trace or token/truncation diagnostics needed to debug whether the problem was lookup provenance, prompt truncation, generation config, or model output. Maintainers must inspect network responses or server files manually.

Recommended fix

Render the trace path and key prompt diagnostics in the results UI. Add a compact diagnostics card and/or expandable per-function details with TAC tokens before/after, prompt tokens, generated tokens, truncation status, source, and trace path.

Acceptance criteria

  • Successful, partial, and error results show the saved trace path when the API provides it.
  • Function Mapping or an adjacent diagnostics panel displays per-function token/truncation diagnostics.
  • The UI clearly flags truncated functions and links them to the generated output.
  • Frontend tests or documented manual checks cover the displayed diagnostics for SSE results.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions