Skip to content

Improve install recovery and agent-friendly diagnostics UX #668

Description

@jununfly

This was generated by AI during triage.

Summary

From a coding-agent user experience perspective, ZCodeGraph is valuable because it turns a repository into a queryable code graph. That helps agents build structural understanding faster than using only file trees and text search: definitions, references, relationships, and impact areas become easier to discover.

During a recent run on /Users/bilibili/Documents/workspace/gitlab/app-public/skiko, zcodegraph init completed successfully and indexed 848 files, producing 13,258 nodes and 29,929 edges with the rust-hybrid engine. The high-level result was useful, but a few UX issues made the workflow harder to interpret and recover from.

What worked well

  • zcodegraph init gives a clear sense that indexing actually happened: file count, node count, edge count, and selected engine are all shown.
  • The generated graph helps an agent establish codebase structure earlier, reducing blind searching and lowering the chance of missing related files or call paths.
  • zcodegraph doctor --engine rust-hybrid --bundle --last-run is a useful next step when the index reports degraded health.
  • The diagnostic bundle path is deterministic enough to hand off for further investigation.

UX issues observed

1. Broken install state was hard to recover from

A previous global zcodegraph launcher existed at ~/.local/bin/zcodegraph, but it pointed to a missing local checkout path:

/Users/bilibili/Documents/workspace/jununfly/ZCodeGraph/dist/bin/zcodegraph.js

Because the shim target was gone, zcodegraph uninstall could not run. The user had to manually inspect and remove the stale launcher.

Suggested improvement: make the launcher or uninstall flow self-healing. If the target JS file is missing, zcodegraph uninstall should still be able to remove the stale shim, or at least print an explicit cleanup command.

2. Terminal progress output is noisy for agents and logs

The interactive progress bars are nice for a human terminal, but in agent/API logs they produce a lot of control characters and repeated progress lines.

Suggested improvement: add or document a stable non-interactive mode, such as:

  • --plain for clean human-readable logs
  • --json for machine-readable status
  • automatic non-TTY detection that disables animation

3. Fallback health: degraded needs a first-screen explanation

After indexing, the command printed:

Rust-hybrid appended 844 TypeScript fallback files
Fallback health: degraded
Run diagnostic bundle:
  zcodegraph doctor --engine rust-hybrid --bundle --last-run

This tells the user something is wrong or suboptimal, but not whether it is expected, severe, configuration-related, parser-related, or performance-related.

Suggested improvement: include a short explanation and immediate summary, for example:

  • why health is degraded
  • how many fallback files are expected vs unusual
  • the top fallback reason categories
  • a few representative file paths
  • whether the graph is still usable

4. Doctor bundle creation should print a short summary

doctor --bundle --last-run succeeded and printed only the bundle path:

.zcodegraph/diagnostics/bundles/2026-06-29T08-59-48-421Z-last-run

That confirms artifact creation, but does not help the user know what to inspect next.

Suggested improvement: after bundle creation, print a compact diagnostic summary, such as top warnings, fallback reason distribution, failed parser samples, and the most relevant files inside the bundle.

Suggested priority

  1. Make install/uninstall recover from stale or broken shims.
  2. Provide stable --plain / --json output for agent and CI usage.
  3. Make degraded fallback health immediately explainable.
  4. Add a brief doctor summary after bundle generation.

Why this matters

For coding agents, ZCodeGraph's strongest value is faster repository comprehension. The main UX gap is not the graph itself, but making command output recoverable, explainable, and stable enough for automated consumers.

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