Skip to content

Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection.

feat(ui): the question index — what Atlas answers, honestly

Martin Vogeled8a45c9d985
diff --git a/graph-ui/src/App.tsx b/graph-ui/src/App.tsx
index 3216922e2..bc51e3540 100644
--- a/graph-ui/src/App.tsx
+++ b/graph-ui/src/App.tsx
@@ -270,6 +270,7 @@ export function App() {
onOpenModules={() => navigate({ tab: "modules" })}
onOpenFlows={() => navigate({ tab: "flows" })}
onOpenDashboard={() => navigate({ tab: "dashboard" })}
+ onOpenTab={(tab) => navigate({ tab })}
/>
) : activeTab === "modules" && selectedProject ? (
<ModulesTab
diff --git a/graph-ui/src/components/OverviewTab.tsx b/graph-ui/src/components/OverviewTab.tsx
index 3e73f4299..b79d57254 100644
--- a/graph-ui/src/components/OverviewTab.tsx
+++ b/graph-ui/src/components/OverviewTab.tsx
@@ -20,6 +20,13 @@ import {
} from "../lib/regions";
import { surprisingCouplings, suggestedQuestions } from "../lib/firstread";
import { kneeCount, findingKey, isDismissed, dismiss } from "../lib/findings";
+import {
+ QUESTION_FAMILIES,
+ questionStatusCounts,
+ type QuestionStatus,
+ type QuestionTab,
+} from "../lib/questions";
+import { useUiMessages } from "../lib/i18n";
import { AddToPromptButton } from "./PromptBasket";
import type { RegionsPayload } from "../lib/types";
@@ -30,6 +37,7 @@ interface OverviewTabProps {
onOpenModules: () => void;
onOpenFlows: () => void;
onOpenDashboard: () => void;
+ onOpenTab: (tab: QuestionTab) => void;
}
interface HotspotRow {
@@ -106,6 +114,142 @@ function Slot({
);
}
+/* Status glyph for the question index — the shape carries the state
+ * (filled / half / hollow), the color is redundant with the word chip,
+ * never color-only. */
+function StatusGlyph({ status }: { status: QuestionStatus }) {
+ const tone =
+ status === "answers"
+ ? "text-good"
+ : status === "partial"
+ ? "text-warn"
+ : "text-foreground/40";
+ return (
+ <svg
+ width="10"
+ height="10"
+ viewBox="0 0 10 10"
+ className={`shrink-0 ${tone}`}
+ aria-hidden="true"
+ >
+ {status === "answers" ? (
+ <circle cx="5" cy="5" r="4" fill="currentColor" />
+ ) : status === "partial" ? (
+ <>
+ <circle cx="5" cy="5" r="3.5" fill="none" stroke="currentColor" />
+ <path d="M5 1.5 A3.5 3.5 0 0 0 5 8.5 Z" fill="currentColor" />
+ </>
+ ) : (
+ <circle cx="5" cy="5" r="3.5" fill="none" stroke="currentColor" />
+ )}
+ </svg>
+ );
+}
+
+/* "What can Atlas answer?" — the 18 developer-question families as an
+ * honest scorecard: answered, partially answered, or not answered yet.
+ * Collapsed by default; the header summary is derived from the data. */
+function QuestionIndex({ onOpenTab }: { onOpenTab: (tab: QuestionTab) => void }) {
+ const t = useUiMessages();
+ const [open, setOpen] = useState(() => {
+ try {
+ return localStorage.getItem("cbm-questions-open") === "1";
+ } catch {
+ return false;
+ }
+ });
+ const toggle = () => {
+ setOpen((value) => {
+ try {
+ localStorage.setItem("cbm-questions-open", value ? "0" : "1");
+ } catch {
+ /* ignore */
+ }
+ return !value;
+ });
+ };
+ const counts = questionStatusCounts(QUESTION_FAMILIES);
+ const statusWord: Record<QuestionStatus, string> = {
+ answers: t.questions.answers,
+ partial: t.questions.partial,
+ lacks: t.questions.lacks,
+ };
+ const statusTone: Record<QuestionStatus, string> = {
+ answers: "text-good/90",
+ partial: "text-warn/90",
+ lacks: "text-foreground/40",
+ };
+
+ return (
+ <div className="bg-card border border-border/50 rounded-md mb-5">
+ <button
+ onClick={toggle}
+ className="flex items-center gap-3 w-full text-left px-4 py-2.5 group"
+ >
+ <p className="text-[12px] uppercase tracking-widest text-foreground/40 group-hover:text-foreground/60 transition-colors">
+ {t.questions.title}
+ </p>
+ <span className="text-[12px] text-foreground/35 tabular-nums truncate ml-auto shrink-1">
+ {t.questions.summary(counts.answers, counts.partial, counts.lacks)}
+ </span>
+ <span className="text-[11px] text-foreground/40 shrink-0">
+ {open ? "▾" : "▸"}
+ </span>
+ </button>
+ {open && (
+ <div className="border-t border-border/30 py-1">
+ {QUESTION_FAMILIES.map((family) => {
+ const tab = family.tab;
+ const inner = (clickable: boolean) => (
+ <>
+ <span className="flex items-center gap-1.5 w-[76px] shrink-0 pt-[2px]">
+ <StatusGlyph status={family.status} />
+ <span className={`text-[11px] ${statusTone[family.status]}`}>
+ {statusWord[family.status]}
+ </span>
+ </span>
+ <span className="flex-1 min-w-0">
+ <span
+ className={`block text-[13px] text-foreground/85 ${
+ clickable
+ ? "group-hover/question:text-primary transition-colors"
+ : ""
+ }`}
+ >
+ {family.question}
+ </span>
+ {(family.hint || family.gap) && (
+ <span className="block text-[12px] text-foreground/40 mt-0.5">
+ {family.hint}
+ {family.hint && family.gap && " · "}
+ {family.gap && `${t.questions.missingPrefix} ${family.gap}`}
+ </span>
+ )}
+ </span>
+ </>
+ );
+ /* Only rows with a destination are buttons — no fake affordance;
+ * for the rest the hint carries the "how". */
+ return tab ? (
+ <button
+ key={family.id}
+ onClick={() => onOpenTab(tab)}
+ className="flex items-start gap-3 w-full text-left px-4 py-2 hover:bg-surface-3 transition-colors group/question"
+ >
+ {inner(true)}
+ </button>
+ ) : (
+ <div key={family.id} className="flex items-start gap-3 px-4 py-2">
+ {inner(false)}
+ </div>
+ );
+ })}
+ </div>
+ )}
+ </div>
+ );
+}
+
/* All displayed regions' cohesion values as an inline dot strip — a bare
* value invites misreading (0.4 can be the tightest region on the map or
* the loosest). This region's dot is emphasized; the tick is the median. */
@@ -158,6 +302,7 @@ export function OverviewTab({
onOpenModules,
onOpenFlows,
onOpenDashboard,
+ onOpenTab,
}: OverviewTabProps) {
const [arch, setArch] = useState<ArchitectureJson | null>(null);
const [regions, setRegions] = useState<RegionsPayload | null>(null);
@@ -309,6 +454,9 @@ export function OverviewTab({
</a>
</div>
+ {/* The scorecard: what can Atlas answer? */}
+ <QuestionIndex onOpenTab={onOpenTab} />
+
{/* The four slots: is anything wrong? */}
<div className="grid grid-cols-2 lg:grid-cols-4 gap-3 mb-5">
<Slot
diff --git a/graph-ui/src/lib/i18n.ts b/graph-ui/src/lib/i18n.ts
index 63b8680b9..74c0ae36b 100644
--- a/graph-ui/src/lib/i18n.ts
+++ b/graph-ui/src/lib/i18n.ts
@@ -80,6 +80,15 @@ export const messages = {
close: "Close",
clickForMore: "click for more →",
},
+ questions: {
+ title: "What can Atlas answer?",
+ answers: "answers",
+ partial: "partial",
+ lacks: "not yet",
+ missingPrefix: "missing:",
+ summary: (answers: number, partial: number, lacks: number) =>
+ `${answers} answered · ${partial} partial · ${lacks} not yet`,
+ },
control: {
panel: "Control Panel",
totalCpu: "Total CPU",
@@ -171,6 +180,15 @@ export const messages = {
close: "关闭",
clickForMore: "点击查看更多 →",
},
+ questions: {
+ title: "Atlas 能回答什么?",
+ answers: "已回答",
+ partial: "部分",
+ lacks: "暂缺",
+ missingPrefix: "缺少:",
+ summary: (answers: number, partial: number, lacks: number) =>
+ `${answers} 已回答 · ${partial} 部分 · ${lacks} 暂缺`,
+ },
control: {
panel: "控制面板",
totalCpu: "总 CPU",
diff --git a/graph-ui/src/lib/questions.test.ts b/graph-ui/src/lib/questions.test.ts
new file mode 100644
index 000000000..cd18a5789
--- /dev/null
+++ b/graph-ui/src/lib/questions.test.ts
@@ -0,0 +1,44 @@
+import { describe, expect, it } from "vitest";
+import { QUESTION_FAMILIES, questionStatusCounts } from "./questions";
+
+describe("QUESTION_FAMILIES", () => {
+ it("carries exactly 18 families with unique ids F1..F18", () => {
+ expect(QUESTION_FAMILIES).toHaveLength(18);
+ expect(QUESTION_FAMILIES.map((family) => family.id)).toEqual(
+ Array.from({ length: 18 }, (_, index) => `F${index + 1}`),
+ );
+ });
+
+ it("phrases every family as a non-empty question", () => {
+ for (const family of QUESTION_FAMILIES) {
+ expect(family.question.trim(), family.id).not.toBe("");
+ expect(family.question.endsWith("?"), family.id).toBe(true);
+ }
+ });
+
+ it("names the gap wherever the answer is partial or missing", () => {
+ for (const family of QUESTION_FAMILIES) {
+ if (family.status === "partial" || family.status === "lacks") {
+ expect(family.gap?.trim(), family.id).toBeTruthy();
+ }
+ }
+ });
+
+ it("points every answered family somewhere — a tab or a hint", () => {
+ for (const family of QUESTION_FAMILIES) {
+ if (family.status === "answers") {
+ expect(family.tab !== undefined || family.hint !== undefined, family.id).toBe(
+ true,
+ );
+ }
+ }
+ });
+
+ it("derives the scorecard counts from the data", () => {
+ const counts = questionStatusCounts(QUESTION_FAMILIES);
+ expect(counts.answers + counts.partial + counts.lacks).toBe(
+ QUESTION_FAMILIES.length,
+ );
+ expect(questionStatusCounts([])).toEqual({ answers: 0, partial: 0, lacks: 0 });
+ });
+});
diff --git a/graph-ui/src/lib/questions.ts b/graph-ui/src/lib/questions.ts
new file mode 100644
index 000000000..c391435c9
--- /dev/null
+++ b/graph-ui/src/lib/questions.ts
@@ -0,0 +1,161 @@
+/* The question index — Atlas's honest scorecard. Twenty years of
+ * developer-information-needs research reduces to 18 question families;
+ * this module says, per family, whether Atlas answers it, answers it
+ * partially, or does not answer it yet. Honesty about the gaps is a
+ * deliberate product feature — the wording is not softened.
+ * The question/hint/gap strings stay English for now: content-i18n is a
+ * separate queued pass (UI chrome around them is translated in i18n.ts). */
+import type { TabId } from "./types";
+
+export type QuestionStatus = "answers" | "partial" | "lacks";
+
+/* Only the project tabs a question row can navigate to. */
+export type QuestionTab = Extract<
+ TabId,
+ "overview" | "modules" | "graph" | "flows" | "changes" | "dashboard"
+>;
+
+export interface QuestionFamily {
+ id: string;
+ question: string;
+ status: QuestionStatus;
+ tab?: QuestionTab;
+ /* Where to look / how to get there when a tab alone isn't enough. */
+ hint?: string;
+ /* What's missing — required for partial and lacks. */
+ gap?: string;
+}
+
+export const QUESTION_FAMILIES: QuestionFamily[] = [
+ {
+ id: "F1",
+ question: "Where is the code that does X?",
+ status: "answers",
+ tab: "graph",
+ hint: "Galaxy + Modules + ⌘K search; scent shows where a term concentrates",
+ },
+ {
+ id: "F2",
+ question: "What calls this — and what does it call?",
+ status: "answers",
+ hint: "Open any symbol (⌘K) — callers and callees with resolution confidence",
+ },
+ {
+ id: "F3",
+ question: "If I change this, what breaks — and what must I retest?",
+ status: "partial",
+ tab: "changes",
+ gap: "Blast radius covers the uncommitted diff only; hypothetical per-symbol impact and tests-to-run are planned",
+ },
+ {
+ id: "F4",
+ question: "Is this dead? Can I remove it safely?",
+ status: "partial",
+ tab: "dashboard",
+ gap: "Dead candidates list what has no recorded callers; the caveats you must check first are in the wiki entry",
+ },
+ {
+ id: "F5",
+ question: "What code caused this behavior?",
+ status: "partial",
+ tab: "flows",
+ gap: "Flows are static journeys; observed executions (traces) are not surfaced in the UI yet",
+ },
+ {
+ id: "F6",
+ question: "When does this actually run, and under what conditions?",
+ status: "answers",
+ hint: "Open any symbol — the trigger tree shows guards, dispatch, and what it triggers",
+ },
+ {
+ id: "F7",
+ question: "Why was it built this way?",
+ status: "partial",
+ hint: "Symbol view: docs, ADR panel, file history",
+ gap: "Docstrings, ADRs and commit subjects are linked; the symbol→PR/issue→decision chain is not built yet",
+ },
+ {
+ id: "F8",
+ question: "Did I follow this codebase's conventions?",
+ status: "lacks",
+ gap: "Conventions conformance is not derived yet — planned",
+ },
+ {
+ id: "F9",
+ question: "What tests cover this?",
+ status: "partial",
+ tab: "dashboard",
+ hint: "Tested symbols card; per-symbol 'Tested by'",
+ gap: "TESTS-edge reach is shown per symbol; change→test selection is planned",
+ },
+ {
+ id: "F10",
+ question: "Where is the risk — what should we fix first?",
+ status: "answers",
+ tab: "dashboard",
+ hint: "Churn × complexity hero with the knee-based head and cost sentence",
+ },
+ {
+ id: "F11",
+ question: "What are the components — and are the boundaries respected?",
+ status: "answers",
+ tab: "overview",
+ hint: "Regions, boundary spanners, unusually-coupled pairs",
+ },
+ {
+ id: "F12",
+ question: "What changed here, and what changes together with it?",
+ status: "partial",
+ hint: "Symbol view: file history and co-change",
+ gap: "File-granular only; symbol-level evolution is not tracked",
+ },
+ {
+ id: "F13",
+ question: "Who knows this code — who should I ask?",
+ status: "partial",
+ hint: "Symbol view: file history authors",
+ gap: "Top authors with evidence per file; a dedicated who-can-help view is planned — never a leaderboard",
+ },
+ {
+ id: "F14",
+ question: "Does this dependency upgrade reach my code — what breaks?",
+ status: "lacks",
+ gap: "External dependency reachability is not modelled yet — planned",
+ },
+ {
+ id: "F15",
+ question: "How do I use this API idiomatically?",
+ status: "partial",
+ hint: "Symbol view: snippets and near-clones",
+ gap: "Deliberately not invested — LLMs answer idiom questions well; Atlas shows real call sites and near-clones instead",
+ },
+ {
+ id: "F16",
+ question: "Is this bug report legit — how hard is it to fix?",
+ status: "partial",
+ tab: "overview",
+ hint: "Needs attention (Overview) + Changes risk",
+ gap: "Needs-attention ranks code-side difficulty; there is no issue-tracker join",
+ },
+ {
+ id: "F17",
+ question: "What did the agent touch — and what did it not look at?",
+ status: "lacks",
+ gap: "Agent-diff provenance is not built yet — planned",
+ },
+ {
+ id: "F18",
+ question: "What do I hand my agent so it doesn't guess?",
+ status: "answers",
+ hint: "The Prompt composer collects cited evidence; flows copy as mermaid; the handout is one click",
+ },
+];
+
+/* Derived, never hard-coded — the scorecard header counts itself. */
+export function questionStatusCounts(
+ families: QuestionFamily[],
+): Record<QuestionStatus, number> {
+ const counts: Record<QuestionStatus, number> = { answers: 0, partial: 0, lacks: 0 };
+ for (const family of families) counts[family.status] += 1;
+ return counts;
+}
diff --git a/graph-ui/tsconfig.tsbuildinfo b/graph-ui/tsconfig.tsbuildinfo
index 7a0ebc233..708e20d26 100644
--- a/graph-ui/tsconfig.tsbuildinfo
+++ b/graph-ui/tsconfig.tsbuildinfo
@@ -1 +1 @@
-{"root":["./src/app.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/api/rpc.ts","./src/components/changestab.tsx","./src/components/commandk.tsx","./src/components/controltab.tsx","./src/components/dashboardtab.tsx","./src/components/displaysettingsmenu.tsx","./src/components/edgelines.tsx","./src/components/errorboundary.tsx","./src/components/filterpanel.tsx","./src/components/flowstab.tsx","./src/components/graphloader.tsx","./src/components/graphscene.test.ts","./src/components/graphscene.tsx","./src/components/graphtab.deadcode.test.tsx","./src/components/graphtab.filters.test.tsx","./src/components/graphtab.regions.test.tsx","./src/components/graphtab.test.ts","./src/components/graphtab.tsx","./src/components/halolayer.tsx","./src/components/metricchip.tsx","./src/components/minimap.tsx","./src/components/missedcallout.tsx","./src/components/modulestab.tsx","./src/components/nodecloud.tsx","./src/components/nodedetailpanel.showmore.test.tsx","./src/components/nodedetailpanel.test.tsx","./src/components/nodedetailpanel.tsx","./src/components/nodelabels.tsx","./src/components/nodetooltip.tsx","./src/components/overviewtab.tsx","./src/components/projectcard.tsx","./src/components/projectswitcher.tsx","./src/components/promptbasket.tsx","./src/components/regionpanel.tsx","./src/components/regiontooltip.tsx","./src/components/resizehandle.tsx","./src/components/sidebar.tsx","./src/components/statstab.test.tsx","./src/components/statstab.tsx","./src/components/symboltab.tsx","./src/components/tabbar.tsx","./src/components/triggertree.tsx","./src/components/wikihovercard.test.tsx","./src/components/wikihovercard.tsx","./src/components/wikipanel.test.tsx","./src/components/wikipanel.tsx","./src/components/wikitier.ts","./src/components/ui/badge.tsx","./src/components/ui/button.tsx","./src/components/ui/card.tsx","./src/components/ui/checkbox.tsx","./src/components/ui/input.tsx","./src/components/ui/scroll-area.tsx","./src/components/ui/separator.tsx","./src/hooks/usegraphdata.test.ts","./src/hooks/usegraphdata.ts","./src/hooks/useprojects.ts","./src/lib/atlas.test.ts","./src/lib/atlas.ts","./src/lib/colors.ts","./src/lib/complexity.test.ts","./src/lib/complexity.ts","./src/lib/composer.ts","./src/lib/density.test.ts","./src/lib/density.ts","./src/lib/findings.test.ts","./src/lib/findings.ts","./src/lib/firstread.ts","./src/lib/flowgroup.test.ts","./src/lib/flowgroup.ts","./src/lib/i18n.test.ts","./src/lib/i18n.ts","./src/lib/regions.test.ts","./src/lib/regions.ts","./src/lib/treemap.ts","./src/lib/types.ts","./src/lib/utils.ts","./src/lib/why.test.ts","./src/lib/why.ts","./src/lib/whyfetch.ts","./src/test/setup.ts","./src/wiki/entries.test.ts","./src/wiki/entries.ts"],"version":"5.9.3"}
\ No newline at end of file
+{"root":["./src/app.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/api/rpc.ts","./src/components/changestab.tsx","./src/components/commandk.tsx","./src/components/controltab.tsx","./src/components/dashboardtab.tsx","./src/components/displaysettingsmenu.tsx","./src/components/edgelines.tsx","./src/components/errorboundary.tsx","./src/components/filterpanel.tsx","./src/components/flowstab.tsx","./src/components/graphloader.tsx","./src/components/graphscene.test.ts","./src/components/graphscene.tsx","./src/components/graphtab.deadcode.test.tsx","./src/components/graphtab.filters.test.tsx","./src/components/graphtab.regions.test.tsx","./src/components/graphtab.test.ts","./src/components/graphtab.tsx","./src/components/halolayer.tsx","./src/components/metricchip.tsx","./src/components/minimap.tsx","./src/components/missedcallout.tsx","./src/components/modulestab.tsx","./src/components/nodecloud.tsx","./src/components/nodedetailpanel.showmore.test.tsx","./src/components/nodedetailpanel.test.tsx","./src/components/nodedetailpanel.tsx","./src/components/nodelabels.tsx","./src/components/nodetooltip.tsx","./src/components/overviewtab.tsx","./src/components/projectcard.tsx","./src/components/projectswitcher.tsx","./src/components/promptbasket.tsx","./src/components/regionpanel.tsx","./src/components/regiontooltip.tsx","./src/components/resizehandle.tsx","./src/components/sidebar.tsx","./src/components/statstab.test.tsx","./src/components/statstab.tsx","./src/components/symboltab.tsx","./src/components/tabbar.tsx","./src/components/triggertree.tsx","./src/components/wikihovercard.test.tsx","./src/components/wikihovercard.tsx","./src/components/wikipanel.test.tsx","./src/components/wikipanel.tsx","./src/components/wikitier.ts","./src/components/ui/badge.tsx","./src/components/ui/button.tsx","./src/components/ui/card.tsx","./src/components/ui/checkbox.tsx","./src/components/ui/input.tsx","./src/components/ui/scroll-area.tsx","./src/components/ui/separator.tsx","./src/hooks/usegraphdata.test.ts","./src/hooks/usegraphdata.ts","./src/hooks/useprojects.ts","./src/lib/atlas.test.ts","./src/lib/atlas.ts","./src/lib/colors.ts","./src/lib/complexity.test.ts","./src/lib/complexity.ts","./src/lib/composer.ts","./src/lib/density.test.ts","./src/lib/density.ts","./src/lib/findings.test.ts","./src/lib/findings.ts","./src/lib/firstread.ts","./src/lib/flowgroup.test.ts","./src/lib/flowgroup.ts","./src/lib/i18n.test.ts","./src/lib/i18n.ts","./src/lib/questions.test.ts","./src/lib/questions.ts","./src/lib/regions.test.ts","./src/lib/regions.ts","./src/lib/treemap.ts","./src/lib/types.ts","./src/lib/utils.ts","./src/lib/why.test.ts","./src/lib/why.ts","./src/lib/whyfetch.ts","./src/test/setup.ts","./src/wiki/entries.test.ts","./src/wiki/entries.ts"],"version":"5.9.3"}
\ No newline at end of file