class-ai-agent 1.6.2 → 1.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,17 +15,32 @@ OntoSight complements CodeGraph MCP — use `codegraph_*` for structural facts i
15
15
  | Kiro | `.kiro/steering/ontosight.md` | `.kiro/references/ontosight.md` |
16
16
  | Antigravity | `.agent/rules/ontosight.md` | `.agents/references/ontosight.md` |
17
17
 
18
+ ## Project graph fidelity
19
+
20
+ OntoSight loads nodes from `.codegraph/codegraph.db` under **`[project-path]`** (default: shell `cwd`). To ensure the browser shows **this workspace's** graph:
21
+
22
+ 1. Resolve workspace root (absolute path).
23
+ 2. Run `codegraph_status({ projectPath: "<workspace-root>" })` before OntoSight.
24
+ 3. Pass **absolute workspace root** as `[project-path]` — never bare `.` when root is known.
25
+ 4. Seed `--symbol` / `--task` from `codegraph_*` queries using the **same** `projectPath`.
26
+ 5. After launch, verify terminal output: printed project path and topology symbols belong to this repo.
27
+
28
+ See **Project graph fidelity** in [`.cursor/rules/ontosight.mdc`](../rules/ontosight.mdc).
29
+
18
30
  ## Quick start
19
31
 
32
+ Replace `<workspace-root>` with the absolute path to the open workspace:
33
+
20
34
  ```bash
21
35
  # Full project — seeds from highest fan-in symbols
22
- npx @royalsolution/ontosight@0.2.0 .
36
+ npx @royalsolution/ontosight@0.2.0 "<workspace-root>"
23
37
 
24
38
  # Seed around a symbol (optionally scoped to a path)
25
- npx @royalsolution/ontosight@0.2.0 . --symbol view_graph --path src/auth/
39
+ # --symbol must exist in this project (confirm via codegraph_search first)
40
+ npx @royalsolution/ontosight@0.2.0 "<workspace-root>" --symbol <name> --path src/auth/
26
41
 
27
42
  # Task-scoped subgraph (keyword FTS seeding)
28
- npx @royalsolution/ontosight@0.2.0 . --task "auth flow" --hops 2 --max-nodes 200
43
+ npx @royalsolution/ontosight@0.2.0 "<workspace-root>" --task "auth flow" --hops 2 --max-nodes 200
29
44
  ```
30
45
 
31
46
  Auto-creates the CodeGraph index when `.codegraph/codegraph.db` is missing (unless `ONTOSIGHT_SKIP_AUTO_INIT=1`).
@@ -34,7 +49,7 @@ Auto-creates the CodeGraph index when `.codegraph/codegraph.db` is missing (unle
34
49
 
35
50
  | Flag | Description | Default |
36
51
  |------|-------------|---------|
37
- | `[project-path]` | Project root containing `.codegraph/` | `.` (cwd) |
52
+ | `[project-path]` | Project root containing `.codegraph/` | `.` (cwd) — **prefer absolute workspace root** |
38
53
  | `--path <dir>` | Limit symbols to files under this path | — |
39
54
  | `--symbol <name>` | Seed symbol for BFS subgraph expansion | auto (fan-in) |
40
55
  | `--task <text>` | Natural-language seed (keyword match) | — |
@@ -48,17 +63,19 @@ Auto-creates the CodeGraph index when `.codegraph/codegraph.db` is missing (unle
48
63
  ### Symbol the user named
49
64
 
50
65
  ```text
51
- 1. codegraph_search({ query: "view_graph" }) → confirm file + kind
66
+ 0. codegraph_status({ projectPath: "<workspace-root>" })
67
+ 1. codegraph_search({ query: "<name>", projectPath: "<workspace-root>" }) → confirm file + kind
52
68
  2. Tell user what you found
53
- 3. npx @royalsolution/ontosight@0.2.0 . --symbol view_graph --path <dir-from-search>
69
+ 3. npx @royalsolution/ontosight@0.2.0 "<workspace-root>" --symbol <name> --path <dir-from-search>
54
70
  ```
55
71
 
56
72
  ### Feature area ("how does auth work?")
57
73
 
58
74
  ```text
59
- 1. codegraph_context({ task: "authentication flow", maxNodes: 20 })
75
+ 0. codegraph_status({ projectPath: "<workspace-root>" })
76
+ 1. codegraph_context({ task: "authentication flow", maxNodes: 20, projectPath: "<workspace-root>" })
60
77
  2. Summarize key symbols in chat
61
- 3. npx @royalsolution/ontosight@0.2.0 . --task "authentication flow" --hops 2 --max-nodes 200
78
+ 3. npx @royalsolution/ontosight@0.2.0 "<workspace-root>" --task "authentication flow" --hops 2 --max-nodes 200
62
79
  ```
63
80
 
64
81
  ### Impact analysis demonstration
@@ -70,18 +87,19 @@ When the user wants to **know** or **see** impact (blast radius, what breaks, do
70
87
  **Workflow:**
71
88
 
72
89
  ```text
73
- 1. codegraph_search({ query: "<symbol>" }) → confirm file + kind
74
- 2. codegraph_impact({ query: "<symbol>" }) ranked blast radius
90
+ 0. codegraph_status({ projectPath: "<workspace-root>" })
91
+ 1. codegraph_search({ query: "<symbol>", projectPath: "<workspace-root>" }) confirm file + kind
92
+ 2. codegraph_impact({ query: "<symbol>", projectPath: "<workspace-root>" }) → ranked blast radius
75
93
  3. Read skills/ui-ux-pro-max/IMPACT-DEMO.md → UX presentation checklist
76
94
  4. Optional: ui-ux-pro-max chart/ux searches (see playbook)
77
95
  5. Summarize in chat (seed, ranked table, what graph shows)
78
- 6. npx @royalsolution/ontosight@0.2.0 . --symbol <name> --path <dir> --hops 3 --max-nodes 200
96
+ 6. npx @royalsolution/ontosight@0.2.0 "<workspace-root>" --symbol <name> --path <dir> --hops 3 --max-nodes 200
79
97
  ```
80
98
 
81
- **Example:**
99
+ **Example** (replace paths and symbol with values from `codegraph_search` in **this** project):
82
100
 
83
101
  ```bash
84
- npx @royalsolution/ontosight@0.2.0 . --symbol deleteUser --path src/services/ --hops 3 --max-nodes 200
102
+ npx @royalsolution/ontosight@0.2.0 "/path/to/workspace" --symbol deleteUser --path src/services/ --hops 3 --max-nodes 200
85
103
  ```
86
104
 
87
105
  **UX:** Always text summary before opening the browser; include a ranked table of top impacted symbols (accessible alternative to graph-only). See [IMPACT-DEMO.md](../skills/ui-ux-pro-max/IMPACT-DEMO.md).
@@ -91,8 +109,9 @@ npx @royalsolution/ontosight@0.2.0 . --symbol deleteUser --path src/services/ --
91
109
  ### Index missing
92
110
 
93
111
  ```bash
112
+ cd "<workspace-root>"
94
113
  npx @colbymchenry/codegraph init -i
95
- # or let the OntoSight wrapper auto-init (default)
114
+ # or let the OntoSight wrapper auto-init (default) — only when [project-path] is correct
96
115
  ```
97
116
 
98
117
  ## Environment variables
@@ -109,7 +128,7 @@ npx @colbymchenry/codegraph init -i
109
128
  | Node 20+ | For `npx @royalsolution/ontosight@0.2.0` |
110
129
  | Python 3.11+ | Used by `ontosight-codegraph` |
111
130
  | uv (recommended) or pipx | Wrapper tries `uvx` first, then `pipx run` |
112
- | CodeGraph index | `.codegraph/codegraph.db` in project root |
131
+ | CodeGraph index | `.codegraph/codegraph.db` in workspace root |
113
132
 
114
133
  ## What the user sees
115
134
 
@@ -117,11 +136,16 @@ npx @colbymchenry/codegraph init -i
117
136
  2. OntoSight opens in the browser with the call subgraph, critical-node highlights, and a CodeGraph query panel for live reloads.
118
137
  3. Process stays running until the user closes the server (Ctrl+C in terminal).
119
138
 
139
+ **Verify fidelity:** confirm the printed **project path** matches workspace root and topology symbols are files under that project — not another repo. If mismatch, stop and re-run with the corrected absolute path.
140
+
120
141
  ## Troubleshooting
121
142
 
122
143
  | Issue | Action |
123
144
  |-------|--------|
124
- | `CodeGraph index not found` | Run `npx @colbymchenry/codegraph init -i` or remove `ONTOSIGHT_SKIP_AUTO_INIT` |
145
+ | Browser shows symbols from another repo | Re-run with absolute workspace root as `[project-path]`; delete stray `.codegraph/` in wrong cwd if auto-init ran there |
146
+ | Empty or generic graph | Run `codegraph init -i` in workspace root; seed with `--symbol` from `codegraph_search` in this project |
147
+ | MCP and OntoSight disagree | Align paths: same root for MCP `projectPath` and OntoSight `[project-path]` |
148
+ | `CodeGraph index not found` | Run `npx @colbymchenry/codegraph init -i` in workspace root or remove `ONTOSIGHT_SKIP_AUTO_INIT` |
125
149
  | `Neither uv nor pipx found` | Install uv: `curl -LsSf https://astral.sh/uv/install.sh \| sh` |
126
150
  | Subgraph truncated warning | Add `--symbol`, `--task`, or `--path`; lower scope before raising `--max-nodes` |
127
151
  | Stale symbols after edits | Wait ~2s for CodeGraph watcher sync, or re-run init |
@@ -32,6 +32,8 @@ For interactive call-graph UI (user asks to "show the graph" or explore architec
32
32
 
33
33
  For **impact demonstration** requests ("show impact", "blast radius", "what breaks if I change X"), run `codegraph_impact` first, present a text summary, then open OntoSight — never stop at MCP text alone when the user wants to see or show impact.
34
34
 
35
+ **Project graph fidelity:** OntoSight is a separate CLI — MCP `${workspaceFolder}` binding does not apply automatically. Pass the **same workspace root** to OntoSight's `[project-path]` as you use for `projectPath` on `codegraph_*` calls when MCP cwd detection is wrong. Run `codegraph_status` before opening OntoSight; seeds (`--symbol`, `--task`) must come from queries against that same index. See **Project graph fidelity** in **`.cursor/rules/ontosight.mdc`**.
36
+
35
37
  ### Tool parameters (do not mix)
36
38
 
37
39
  | Tool | Required arg | Optional cap | Wrong args → error |
@@ -20,6 +20,44 @@ See **`.cursor/rules/codegraph.mdc`** for MCP usage and **`.cursor/references/on
20
20
 
21
21
  Rule of thumb: gather facts with CodeGraph MCP; open OntoSight when visualization helps the human explore complexity you already identified.
22
22
 
23
+ ### Project graph fidelity
24
+
25
+ OntoSight reads nodes from `.codegraph/codegraph.db` under the **`[project-path]`** argument (default: shell `cwd`). The browser must show **this workspace's** project graph — never a foreign repo or auto-init index from the wrong directory.
26
+
27
+ **Mandatory preflight** (before any OntoSight run):
28
+
29
+ 1. Resolve **workspace root** (Cursor `${workspaceFolder}` / absolute path from user context).
30
+ 2. `codegraph_status({ projectPath: "<workspace-root>" })` when MCP may be on wrong cwd; otherwise default.
31
+ 3. If index missing → `npx @colbymchenry/codegraph init -i` **in workspace root** (ask user on large repos).
32
+ 4. If MCP returns "wrong project" / path mismatch → pass `projectPath` on all subsequent `codegraph_*` calls.
33
+
34
+ **Hard rule:** Do not open OntoSight until `.codegraph/codegraph.db` exists under the **target workspace root**.
35
+
36
+ **Absolute project path** — never rely on bare `.` when workspace root is known:
37
+
38
+ ```bash
39
+ # Required when workspace root is known
40
+ npx @royalsolution/ontosight@0.2.0 "/absolute/path/to/workspace" \
41
+ --symbol <name> --path <dir>
42
+ ```
43
+
44
+ Pass workspace root as the **first positional `[project-path]`** argument. Optionally set shell `cwd` to workspace root as well — but always pass the absolute path.
45
+
46
+ **Seed binding** — seeds must come from the same project's CodeGraph index:
47
+
48
+ | Seed mode | Requirement |
49
+ |-----------|-------------|
50
+ | `--symbol` | Name **must** come from `codegraph_search` / `codegraph_context` with the **same** `projectPath`; `--path` must match the directory prefix of the returned file path |
51
+ | `--task` | Only after `codegraph_context({ task, maxNodes })`; prefer `--symbol` when user named a symbol |
52
+ | Default (no seed) | Full-project exploration only; still require absolute workspace path |
53
+
54
+ **Anti-patterns (explicit ban):**
55
+
56
+ - Do not use README/doc example symbols (`view_graph`, `deleteUser`) unless `codegraph_search` confirms they exist in **this** project.
57
+ - Do not run OntoSight from a subdirectory with bare `.` — auto-init may index the wrong tree.
58
+
59
+ **After launch:** confirm OntoSight terminal output shows the correct **project path** and topology symbols under that project. If mismatch → stop and re-run with corrected absolute path.
60
+
23
61
  ### When to run OntoSight
24
62
 
25
63
  Run (or suggest) OntoSight when the user:
@@ -41,12 +79,13 @@ Do **not** run OntoSight to collect agent context — that duplicates CodeGraph
41
79
 
42
80
  **Workflow** (mandatory order):
43
81
 
44
- 1. `codegraph_search({ query: "<symbol>" })` — confirm name, file, kind
45
- 2. `codegraph_impact({ query: "<symbol>" })` — ranked blast radius (chat facts)
82
+ 0. `codegraph_status({ projectPath: "<workspace-root>" })` — verify index at workspace root
83
+ 1. `codegraph_search({ query: "<symbol>", projectPath: "<workspace-root>" })` — confirm name, file, kind
84
+ 2. `codegraph_impact({ query: "<symbol>", projectPath: "<workspace-root>" })` — ranked blast radius (chat facts)
46
85
  3. Read **`.cursor/skills/ui-ux-pro-max/IMPACT-DEMO.md`** — presentation checklist (use your tool's skills path: `.claude/skills/`, `.kiro/skills/`, `.agents/skills/`)
47
86
  4. Optional: run ui-ux-pro-max searches from the playbook for chart/UX framing
48
87
  5. Summarize in chat: seed symbol, top impacted callers, risk tier, what the graph will highlight
49
- 6. `npx @royalsolution/ontosight@0.2.0 . --symbol <name> --path <dir> --hops 3 --max-nodes 200`
88
+ 6. `npx @royalsolution/ontosight@0.2.0 "<workspace-root>" --symbol <name> --path <dir> --hops 3 --max-nodes 200`
50
89
 
51
90
  **Hop guidance:** use `--hops 3` (or `4` for deep trees) for impact demos; prefer `--path` over raising `--max-nodes` when truncated.
52
91
 
@@ -56,25 +95,29 @@ Do **not** run OntoSight to collect agent context — that duplicates CodeGraph
56
95
 
57
96
  **Symbol the user named:**
58
97
 
59
- 1. `codegraph_search({ query: "<name>" })` → confirm file + kind
98
+ 0. `codegraph_status({ projectPath: "<workspace-root>" })`
99
+ 1. `codegraph_search({ query: "<name>", projectPath: "<workspace-root>" })` → confirm file + kind
60
100
  2. Summarize in chat
61
- 3. `npx @royalsolution/ontosight@0.2.0 . --symbol <name> --path <dir-from-search>`
101
+ 3. `npx @royalsolution/ontosight@0.2.0 "<workspace-root>" --symbol <name> --path <dir-from-search>`
62
102
 
63
103
  **Feature area ("how does auth work?"):**
64
104
 
65
- 1. `codegraph_context({ task: "authentication flow", maxNodes: 20 })`
105
+ 0. `codegraph_status({ projectPath: "<workspace-root>" })`
106
+ 1. `codegraph_context({ task: "authentication flow", maxNodes: 20, projectPath: "<workspace-root>" })`
66
107
  2. Summarize key symbols in chat
67
- 3. `npx @royalsolution/ontosight@0.2.0 . --task "authentication flow" --hops 2 --max-nodes 200`
108
+ 3. `npx @royalsolution/ontosight@0.2.0 "<workspace-root>" --task "authentication flow" --hops 2 --max-nodes 200`
68
109
 
69
110
  **Large repo:** prefer `--path` or `--symbol` before raising `--max-nodes`.
70
111
 
71
112
  ### Commands
72
113
 
114
+ Replace `<workspace-root>` with the absolute path to the open workspace (never bare `.` when root is known):
115
+
73
116
  ```bash
74
- npx @royalsolution/ontosight@0.2.0 .
75
- npx @royalsolution/ontosight@0.2.0 . --symbol <name> --path <dir>
76
- npx @royalsolution/ontosight@0.2.0 . --task "auth flow" --hops 2 --max-nodes 200
77
- npx @royalsolution/ontosight@0.2.0 . --symbol <name> --path <dir> --hops 3 --max-nodes 200
117
+ npx @royalsolution/ontosight@0.2.0 "<workspace-root>"
118
+ npx @royalsolution/ontosight@0.2.0 "<workspace-root>" --symbol <name> --path <dir>
119
+ npx @royalsolution/ontosight@0.2.0 "<workspace-root>" --task "auth flow" --hops 2 --max-nodes 200
120
+ npx @royalsolution/ontosight@0.2.0 "<workspace-root>" --symbol <name> --path <dir> --hops 3 --max-nodes 200
78
121
  ```
79
122
 
80
123
  Auto-creates the CodeGraph index when `.codegraph/codegraph.db` is missing (unless `ONTOSIGHT_SKIP_AUTO_INIT=1`). Ask the user before auto-init on very large repos.
@@ -86,4 +129,4 @@ Auto-creates the CodeGraph index when `.codegraph/codegraph.db` is missing (unle
86
129
  | Node 20+ | For `npx @royalsolution/ontosight@0.2.0` |
87
130
  | Python 3.11+ | Used by `ontosight-codegraph` |
88
131
  | uv (recommended) or pipx | Wrapper tries `uvx` first, then `pipx run` |
89
- | CodeGraph index | `.codegraph/codegraph.db` in project root |
132
+ | CodeGraph index | `.codegraph/codegraph.db` in workspace root |
@@ -46,7 +46,7 @@ Use for: summary-before-graph; tell the user what OntoSight is loading and what
46
46
 
47
47
  ## Chat summary template
48
48
 
49
- Present this **before** running `npx @royalsolution/ontosight@0.2.0`:
49
+ Present this **before** running `npx @royalsolution/ontosight@0.2.0` (with absolute workspace root as `[project-path]`):
50
50
 
51
51
  ### 1. Seed
52
52
 
@@ -71,10 +71,10 @@ Group by risk: **direct callers** (highest) vs **transitive** (lower).
71
71
 
72
72
  ### 4. Action
73
73
 
74
- Short line: *"Opening interactive impact graph…"* then run:
74
+ Short line: *"Opening interactive impact graph…"* then run (replace `<workspace-root>` with absolute workspace path):
75
75
 
76
76
  ```bash
77
- npx @royalsolution/ontosight@0.2.0 . --symbol <name> --path <dir-from-search> --hops 3 --max-nodes 200
77
+ npx @royalsolution/ontosight@0.2.0 "<workspace-root>" --symbol <name> --path <dir-from-search> --hops 3 --max-nodes 200
78
78
  ```
79
79
 
80
80
  ---
@@ -90,12 +90,13 @@ npx @royalsolution/ontosight@0.2.0 . --symbol <name> --path <dir-from-search> --
90
90
  ## Full agent workflow
91
91
 
92
92
  ```text
93
- 1. codegraph_search({ query: "<symbol>" })
94
- 2. codegraph_impact({ query: "<symbol>" })
93
+ 0. codegraph_status({ projectPath: "<workspace-root>" }) → verify index at workspace root
94
+ 1. codegraph_search({ query: "<symbol>", projectPath: "<workspace-root>" })
95
+ 2. codegraph_impact({ query: "<symbol>", projectPath: "<workspace-root>" })
95
96
  3. Read this file (IMPACT-DEMO.md)
96
97
  4. Optional: ui-ux-pro-max chart/ux searches above
97
98
  5. Chat summary (template sections 1–3)
98
- 6. npx @royalsolution/ontosight@0.2.0 . --symbol <name> --path <dir> --hops 3 --max-nodes 200
99
+ 6. npx @royalsolution/ontosight@0.2.0 "<workspace-root>" --symbol <name> --path <dir> --hops 3 --max-nodes 200
99
100
  ```
100
101
 
101
102
  See **`.cursor/references/ontosight.md`** for flags and troubleshooting.
@@ -79,12 +79,14 @@ Example — correct:
79
79
  |-------|--------|
80
80
  | `task must be a non-empty string` | Use `task` (not `query`) on `codegraph_context`; use `maxNodes` (not `limit`). For `/resume`, read `.agent/SESSION.md` instead. |
81
81
  | MCP “not initialized” | Run `npx @colbymchenry/codegraph init -i` in project root |
82
+ | MCP wrong project / path mismatch | Pass `projectPath: "<workspace-root>"` on all `codegraph_*` calls; use the same root for OntoSight `[project-path]` |
82
83
  | MCP not connecting | Reload Cursor; verify `.cursor/mcp.json`; test `npx @colbymchenry/codegraph serve --mcp` |
83
84
  | Stale symbols after edit | Wait ~2s for watcher sync, or check staleness banner in tool output |
84
85
  | Init failed during install | Run `npx @colbymchenry/codegraph init -i` manually |
86
+ | OntoSight shows wrong project's graph | Pass absolute workspace root to OntoSight (not bare `.`); run `codegraph_status` first — see [`.cursor/references/ontosight.md`](ontosight.md) |
85
87
 
86
88
  ## Visualization (OntoSight)
87
89
 
88
- For interactive call-graph exploration in the browser, use **[OntoSight](https://www.npmjs.com/package/@royalsolution/ontosight)** (`npx @royalsolution/ontosight@0.2.0`). Gather facts with `codegraph_*` first; open OntoSight when the user wants a visual UI. See [`.cursor/references/ontosight.md`](ontosight.md).
90
+ For interactive call-graph exploration in the browser, use **[OntoSight](https://www.npmjs.com/package/@royalsolution/ontosight)** (`npx @royalsolution/ontosight@0.2.0`). Gather facts with `codegraph_*` first; open OntoSight when the user wants a visual UI. Pass the **absolute workspace root** as `[project-path]` (not bare `.`) so the browser loads this project's graph. See [`.cursor/references/ontosight.md`](ontosight.md).
89
91
 
90
92
  Upstream: [colbymchenry/codegraph](https://github.com/colbymchenry/codegraph)
@@ -15,17 +15,32 @@ OntoSight complements CodeGraph MCP — use `codegraph_*` for structural facts i
15
15
  | Kiro | `.kiro/steering/ontosight.md` | `.kiro/references/ontosight.md` |
16
16
  | Antigravity | `.agent/rules/ontosight.md` | `.agents/references/ontosight.md` |
17
17
 
18
+ ## Project graph fidelity
19
+
20
+ OntoSight loads nodes from `.codegraph/codegraph.db` under **`[project-path]`** (default: shell `cwd`). To ensure the browser shows **this workspace's** graph:
21
+
22
+ 1. Resolve workspace root (absolute path).
23
+ 2. Run `codegraph_status({ projectPath: "<workspace-root>" })` before OntoSight.
24
+ 3. Pass **absolute workspace root** as `[project-path]` — never bare `.` when root is known.
25
+ 4. Seed `--symbol` / `--task` from `codegraph_*` queries using the **same** `projectPath`.
26
+ 5. After launch, verify terminal output: printed project path and topology symbols belong to this repo.
27
+
28
+ See **Project graph fidelity** in [`.cursor/rules/ontosight.mdc`](../rules/ontosight.mdc).
29
+
18
30
  ## Quick start
19
31
 
32
+ Replace `<workspace-root>` with the absolute path to the open workspace:
33
+
20
34
  ```bash
21
35
  # Full project — seeds from highest fan-in symbols
22
- npx @royalsolution/ontosight@0.2.0 .
36
+ npx @royalsolution/ontosight@0.2.0 "<workspace-root>"
23
37
 
24
38
  # Seed around a symbol (optionally scoped to a path)
25
- npx @royalsolution/ontosight@0.2.0 . --symbol view_graph --path src/auth/
39
+ # --symbol must exist in this project (confirm via codegraph_search first)
40
+ npx @royalsolution/ontosight@0.2.0 "<workspace-root>" --symbol <name> --path src/auth/
26
41
 
27
42
  # Task-scoped subgraph (keyword FTS seeding)
28
- npx @royalsolution/ontosight@0.2.0 . --task "auth flow" --hops 2 --max-nodes 200
43
+ npx @royalsolution/ontosight@0.2.0 "<workspace-root>" --task "auth flow" --hops 2 --max-nodes 200
29
44
  ```
30
45
 
31
46
  Auto-creates the CodeGraph index when `.codegraph/codegraph.db` is missing (unless `ONTOSIGHT_SKIP_AUTO_INIT=1`).
@@ -34,7 +49,7 @@ Auto-creates the CodeGraph index when `.codegraph/codegraph.db` is missing (unle
34
49
 
35
50
  | Flag | Description | Default |
36
51
  |------|-------------|---------|
37
- | `[project-path]` | Project root containing `.codegraph/` | `.` (cwd) |
52
+ | `[project-path]` | Project root containing `.codegraph/` | `.` (cwd) — **prefer absolute workspace root** |
38
53
  | `--path <dir>` | Limit symbols to files under this path | — |
39
54
  | `--symbol <name>` | Seed symbol for BFS subgraph expansion | auto (fan-in) |
40
55
  | `--task <text>` | Natural-language seed (keyword match) | — |
@@ -48,17 +63,19 @@ Auto-creates the CodeGraph index when `.codegraph/codegraph.db` is missing (unle
48
63
  ### Symbol the user named
49
64
 
50
65
  ```text
51
- 1. codegraph_search({ query: "view_graph" }) → confirm file + kind
66
+ 0. codegraph_status({ projectPath: "<workspace-root>" })
67
+ 1. codegraph_search({ query: "<name>", projectPath: "<workspace-root>" }) → confirm file + kind
52
68
  2. Tell user what you found
53
- 3. npx @royalsolution/ontosight@0.2.0 . --symbol view_graph --path <dir-from-search>
69
+ 3. npx @royalsolution/ontosight@0.2.0 "<workspace-root>" --symbol <name> --path <dir-from-search>
54
70
  ```
55
71
 
56
72
  ### Feature area ("how does auth work?")
57
73
 
58
74
  ```text
59
- 1. codegraph_context({ task: "authentication flow", maxNodes: 20 })
75
+ 0. codegraph_status({ projectPath: "<workspace-root>" })
76
+ 1. codegraph_context({ task: "authentication flow", maxNodes: 20, projectPath: "<workspace-root>" })
60
77
  2. Summarize key symbols in chat
61
- 3. npx @royalsolution/ontosight@0.2.0 . --task "authentication flow" --hops 2 --max-nodes 200
78
+ 3. npx @royalsolution/ontosight@0.2.0 "<workspace-root>" --task "authentication flow" --hops 2 --max-nodes 200
62
79
  ```
63
80
 
64
81
  ### Impact analysis demonstration
@@ -70,18 +87,19 @@ When the user wants to **know** or **see** impact (blast radius, what breaks, do
70
87
  **Workflow:**
71
88
 
72
89
  ```text
73
- 1. codegraph_search({ query: "<symbol>" }) → confirm file + kind
74
- 2. codegraph_impact({ query: "<symbol>" }) ranked blast radius
90
+ 0. codegraph_status({ projectPath: "<workspace-root>" })
91
+ 1. codegraph_search({ query: "<symbol>", projectPath: "<workspace-root>" }) confirm file + kind
92
+ 2. codegraph_impact({ query: "<symbol>", projectPath: "<workspace-root>" }) → ranked blast radius
75
93
  3. Read skills/ui-ux-pro-max/IMPACT-DEMO.md → UX presentation checklist
76
94
  4. Optional: ui-ux-pro-max chart/ux searches (see playbook)
77
95
  5. Summarize in chat (seed, ranked table, what graph shows)
78
- 6. npx @royalsolution/ontosight@0.2.0 . --symbol <name> --path <dir> --hops 3 --max-nodes 200
96
+ 6. npx @royalsolution/ontosight@0.2.0 "<workspace-root>" --symbol <name> --path <dir> --hops 3 --max-nodes 200
79
97
  ```
80
98
 
81
- **Example:**
99
+ **Example** (replace paths and symbol with values from `codegraph_search` in **this** project):
82
100
 
83
101
  ```bash
84
- npx @royalsolution/ontosight@0.2.0 . --symbol deleteUser --path src/services/ --hops 3 --max-nodes 200
102
+ npx @royalsolution/ontosight@0.2.0 "/path/to/workspace" --symbol deleteUser --path src/services/ --hops 3 --max-nodes 200
85
103
  ```
86
104
 
87
105
  **UX:** Always text summary before opening the browser; include a ranked table of top impacted symbols (accessible alternative to graph-only). See [IMPACT-DEMO.md](../skills/ui-ux-pro-max/IMPACT-DEMO.md).
@@ -91,8 +109,9 @@ npx @royalsolution/ontosight@0.2.0 . --symbol deleteUser --path src/services/ --
91
109
  ### Index missing
92
110
 
93
111
  ```bash
112
+ cd "<workspace-root>"
94
113
  npx @colbymchenry/codegraph init -i
95
- # or let the OntoSight wrapper auto-init (default)
114
+ # or let the OntoSight wrapper auto-init (default) — only when [project-path] is correct
96
115
  ```
97
116
 
98
117
  ## Environment variables
@@ -109,7 +128,7 @@ npx @colbymchenry/codegraph init -i
109
128
  | Node 20+ | For `npx @royalsolution/ontosight@0.2.0` |
110
129
  | Python 3.11+ | Used by `ontosight-codegraph` |
111
130
  | uv (recommended) or pipx | Wrapper tries `uvx` first, then `pipx run` |
112
- | CodeGraph index | `.codegraph/codegraph.db` in project root |
131
+ | CodeGraph index | `.codegraph/codegraph.db` in workspace root |
113
132
 
114
133
  ## What the user sees
115
134
 
@@ -117,11 +136,16 @@ npx @colbymchenry/codegraph init -i
117
136
  2. OntoSight opens in the browser with the call subgraph, critical-node highlights, and a CodeGraph query panel for live reloads.
118
137
  3. Process stays running until the user closes the server (Ctrl+C in terminal).
119
138
 
139
+ **Verify fidelity:** confirm the printed **project path** matches workspace root and topology symbols are files under that project — not another repo. If mismatch, stop and re-run with the corrected absolute path.
140
+
120
141
  ## Troubleshooting
121
142
 
122
143
  | Issue | Action |
123
144
  |-------|--------|
124
- | `CodeGraph index not found` | Run `npx @colbymchenry/codegraph init -i` or remove `ONTOSIGHT_SKIP_AUTO_INIT` |
145
+ | Browser shows symbols from another repo | Re-run with absolute workspace root as `[project-path]`; delete stray `.codegraph/` in wrong cwd if auto-init ran there |
146
+ | Empty or generic graph | Run `codegraph init -i` in workspace root; seed with `--symbol` from `codegraph_search` in this project |
147
+ | MCP and OntoSight disagree | Align paths: same root for MCP `projectPath` and OntoSight `[project-path]` |
148
+ | `CodeGraph index not found` | Run `npx @colbymchenry/codegraph init -i` in workspace root or remove `ONTOSIGHT_SKIP_AUTO_INIT` |
125
149
  | `Neither uv nor pipx found` | Install uv: `curl -LsSf https://astral.sh/uv/install.sh \| sh` |
126
150
  | Subgraph truncated warning | Add `--symbol`, `--task`, or `--path`; lower scope before raising `--max-nodes` |
127
151
  | Stale symbols after edits | Wait ~2s for CodeGraph watcher sync, or re-run init |
@@ -46,7 +46,7 @@ Use for: summary-before-graph; tell the user what OntoSight is loading and what
46
46
 
47
47
  ## Chat summary template
48
48
 
49
- Present this **before** running `npx @royalsolution/ontosight@0.2.0`:
49
+ Present this **before** running `npx @royalsolution/ontosight@0.2.0` (with absolute workspace root as `[project-path]`):
50
50
 
51
51
  ### 1. Seed
52
52
 
@@ -71,10 +71,10 @@ Group by risk: **direct callers** (highest) vs **transitive** (lower).
71
71
 
72
72
  ### 4. Action
73
73
 
74
- Short line: *"Opening interactive impact graph…"* then run:
74
+ Short line: *"Opening interactive impact graph…"* then run (replace `<workspace-root>` with absolute workspace path):
75
75
 
76
76
  ```bash
77
- npx @royalsolution/ontosight@0.2.0 . --symbol <name> --path <dir-from-search> --hops 3 --max-nodes 200
77
+ npx @royalsolution/ontosight@0.2.0 "<workspace-root>" --symbol <name> --path <dir-from-search> --hops 3 --max-nodes 200
78
78
  ```
79
79
 
80
80
  ---
@@ -90,12 +90,13 @@ npx @royalsolution/ontosight@0.2.0 . --symbol <name> --path <dir-from-search> --
90
90
  ## Full agent workflow
91
91
 
92
92
  ```text
93
- 1. codegraph_search({ query: "<symbol>" })
94
- 2. codegraph_impact({ query: "<symbol>" })
93
+ 0. codegraph_status({ projectPath: "<workspace-root>" }) → verify index at workspace root
94
+ 1. codegraph_search({ query: "<symbol>", projectPath: "<workspace-root>" })
95
+ 2. codegraph_impact({ query: "<symbol>", projectPath: "<workspace-root>" })
95
96
  3. Read this file (IMPACT-DEMO.md)
96
97
  4. Optional: ui-ux-pro-max chart/ux searches above
97
98
  5. Chat summary (template sections 1–3)
98
- 6. npx @royalsolution/ontosight@0.2.0 . --symbol <name> --path <dir> --hops 3 --max-nodes 200
99
+ 6. npx @royalsolution/ontosight@0.2.0 "<workspace-root>" --symbol <name> --path <dir> --hops 3 --max-nodes 200
99
100
  ```
100
101
 
101
102
  See **`.cursor/references/ontosight.md`** for flags and troubleshooting.
@@ -32,6 +32,8 @@ For interactive call-graph UI (user asks to "show the graph" or explore architec
32
32
 
33
33
  For **impact demonstration** requests ("show impact", "blast radius", "what breaks if I change X"), run `codegraph_impact` first, present a text summary, then open OntoSight — never stop at MCP text alone when the user wants to see or show impact.
34
34
 
35
+ **Project graph fidelity:** OntoSight is a separate CLI — MCP `${workspaceFolder}` binding does not apply automatically. Pass the **same workspace root** to OntoSight's `[project-path]` as you use for `projectPath` on `codegraph_*` calls when MCP cwd detection is wrong. Run `codegraph_status` before opening OntoSight; seeds (`--symbol`, `--task`) must come from queries against that same index. See **Project graph fidelity** in **`.kiro/rules/ontosight.md`**.
36
+
35
37
  ### Tool parameters (do not mix)
36
38
 
37
39
  | Tool | Required arg | Optional cap | Wrong args → error |
@@ -20,6 +20,44 @@ See **`.kiro/rules/codegraph.md`** for MCP usage and **`.kiro/references/ontosig
20
20
 
21
21
  Rule of thumb: gather facts with CodeGraph MCP; open OntoSight when visualization helps the human explore complexity you already identified.
22
22
 
23
+ ### Project graph fidelity
24
+
25
+ OntoSight reads nodes from `.codegraph/codegraph.db` under the **`[project-path]`** argument (default: shell `cwd`). The browser must show **this workspace's** project graph — never a foreign repo or auto-init index from the wrong directory.
26
+
27
+ **Mandatory preflight** (before any OntoSight run):
28
+
29
+ 1. Resolve **workspace root** (Cursor `${workspaceFolder}` / absolute path from user context).
30
+ 2. `codegraph_status({ projectPath: "<workspace-root>" })` when MCP may be on wrong cwd; otherwise default.
31
+ 3. If index missing → `npx @colbymchenry/codegraph init -i` **in workspace root** (ask user on large repos).
32
+ 4. If MCP returns "wrong project" / path mismatch → pass `projectPath` on all subsequent `codegraph_*` calls.
33
+
34
+ **Hard rule:** Do not open OntoSight until `.codegraph/codegraph.db` exists under the **target workspace root**.
35
+
36
+ **Absolute project path** — never rely on bare `.` when workspace root is known:
37
+
38
+ ```bash
39
+ # Required when workspace root is known
40
+ npx @royalsolution/ontosight@0.2.0 "/absolute/path/to/workspace" \
41
+ --symbol <name> --path <dir>
42
+ ```
43
+
44
+ Pass workspace root as the **first positional `[project-path]`** argument. Optionally set shell `cwd` to workspace root as well — but always pass the absolute path.
45
+
46
+ **Seed binding** — seeds must come from the same project's CodeGraph index:
47
+
48
+ | Seed mode | Requirement |
49
+ |-----------|-------------|
50
+ | `--symbol` | Name **must** come from `codegraph_search` / `codegraph_context` with the **same** `projectPath`; `--path` must match the directory prefix of the returned file path |
51
+ | `--task` | Only after `codegraph_context({ task, maxNodes })`; prefer `--symbol` when user named a symbol |
52
+ | Default (no seed) | Full-project exploration only; still require absolute workspace path |
53
+
54
+ **Anti-patterns (explicit ban):**
55
+
56
+ - Do not use README/doc example symbols (`view_graph`, `deleteUser`) unless `codegraph_search` confirms they exist in **this** project.
57
+ - Do not run OntoSight from a subdirectory with bare `.` — auto-init may index the wrong tree.
58
+
59
+ **After launch:** confirm OntoSight terminal output shows the correct **project path** and topology symbols under that project. If mismatch → stop and re-run with corrected absolute path.
60
+
23
61
  ### When to run OntoSight
24
62
 
25
63
  Run (or suggest) OntoSight when the user:
@@ -41,12 +79,13 @@ Do **not** run OntoSight to collect agent context — that duplicates CodeGraph
41
79
 
42
80
  **Workflow** (mandatory order):
43
81
 
44
- 1. `codegraph_search({ query: "<symbol>" })` — confirm name, file, kind
45
- 2. `codegraph_impact({ query: "<symbol>" })` — ranked blast radius (chat facts)
82
+ 0. `codegraph_status({ projectPath: "<workspace-root>" })` — verify index at workspace root
83
+ 1. `codegraph_search({ query: "<symbol>", projectPath: "<workspace-root>" })` — confirm name, file, kind
84
+ 2. `codegraph_impact({ query: "<symbol>", projectPath: "<workspace-root>" })` — ranked blast radius (chat facts)
46
85
  3. Read **`.kiro/skills/ui-ux-pro-max/IMPACT-DEMO.md`** — presentation checklist (use your tool's skills path: `.claude/skills/`, `.kiro/skills/`, `.agents/skills/`)
47
86
  4. Optional: run ui-ux-pro-max searches from the playbook for chart/UX framing
48
87
  5. Summarize in chat: seed symbol, top impacted callers, risk tier, what the graph will highlight
49
- 6. `npx @royalsolution/ontosight@0.2.0 . --symbol <name> --path <dir> --hops 3 --max-nodes 200`
88
+ 6. `npx @royalsolution/ontosight@0.2.0 "<workspace-root>" --symbol <name> --path <dir> --hops 3 --max-nodes 200`
50
89
 
51
90
  **Hop guidance:** use `--hops 3` (or `4` for deep trees) for impact demos; prefer `--path` over raising `--max-nodes` when truncated.
52
91
 
@@ -56,25 +95,29 @@ Do **not** run OntoSight to collect agent context — that duplicates CodeGraph
56
95
 
57
96
  **Symbol the user named:**
58
97
 
59
- 1. `codegraph_search({ query: "<name>" })` → confirm file + kind
98
+ 0. `codegraph_status({ projectPath: "<workspace-root>" })`
99
+ 1. `codegraph_search({ query: "<name>", projectPath: "<workspace-root>" })` → confirm file + kind
60
100
  2. Summarize in chat
61
- 3. `npx @royalsolution/ontosight@0.2.0 . --symbol <name> --path <dir-from-search>`
101
+ 3. `npx @royalsolution/ontosight@0.2.0 "<workspace-root>" --symbol <name> --path <dir-from-search>`
62
102
 
63
103
  **Feature area ("how does auth work?"):**
64
104
 
65
- 1. `codegraph_context({ task: "authentication flow", maxNodes: 20 })`
105
+ 0. `codegraph_status({ projectPath: "<workspace-root>" })`
106
+ 1. `codegraph_context({ task: "authentication flow", maxNodes: 20, projectPath: "<workspace-root>" })`
66
107
  2. Summarize key symbols in chat
67
- 3. `npx @royalsolution/ontosight@0.2.0 . --task "authentication flow" --hops 2 --max-nodes 200`
108
+ 3. `npx @royalsolution/ontosight@0.2.0 "<workspace-root>" --task "authentication flow" --hops 2 --max-nodes 200`
68
109
 
69
110
  **Large repo:** prefer `--path` or `--symbol` before raising `--max-nodes`.
70
111
 
71
112
  ### Commands
72
113
 
114
+ Replace `<workspace-root>` with the absolute path to the open workspace (never bare `.` when root is known):
115
+
73
116
  ```bash
74
- npx @royalsolution/ontosight@0.2.0 .
75
- npx @royalsolution/ontosight@0.2.0 . --symbol <name> --path <dir>
76
- npx @royalsolution/ontosight@0.2.0 . --task "auth flow" --hops 2 --max-nodes 200
77
- npx @royalsolution/ontosight@0.2.0 . --symbol <name> --path <dir> --hops 3 --max-nodes 200
117
+ npx @royalsolution/ontosight@0.2.0 "<workspace-root>"
118
+ npx @royalsolution/ontosight@0.2.0 "<workspace-root>" --symbol <name> --path <dir>
119
+ npx @royalsolution/ontosight@0.2.0 "<workspace-root>" --task "auth flow" --hops 2 --max-nodes 200
120
+ npx @royalsolution/ontosight@0.2.0 "<workspace-root>" --symbol <name> --path <dir> --hops 3 --max-nodes 200
78
121
  ```
79
122
 
80
123
  Auto-creates the CodeGraph index when `.codegraph/codegraph.db` is missing (unless `ONTOSIGHT_SKIP_AUTO_INIT=1`). Ask the user before auto-init on very large repos.
@@ -86,4 +129,4 @@ Auto-creates the CodeGraph index when `.codegraph/codegraph.db` is missing (unle
86
129
  | Node 20+ | For `npx @royalsolution/ontosight@0.2.0` |
87
130
  | Python 3.11+ | Used by `ontosight-codegraph` |
88
131
  | uv (recommended) or pipx | Wrapper tries `uvx` first, then `pipx run` |
89
- | CodeGraph index | `.codegraph/codegraph.db` in project root |
132
+ | CodeGraph index | `.codegraph/codegraph.db` in workspace root |