@fodx/codelens 2.4.1 → 2.5.1

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.
package/docs/routing.md CHANGED
@@ -5,27 +5,30 @@
5
5
 
6
6
  ## When to use codelens tools
7
7
 
8
- Prefer the codelens tools for code **discovery** they keep the context window
9
- lean and are branch-scoped. They are guidance, not an absolute mandate: use the
10
- right tool for the job.
11
-
12
- 0. Call `cl_current` to confirm the index state. Installed MCP configs auto-index
13
- missing branch indexes in the background; if `status` is `indexing`, wait or
14
- retry shortly and use `indexingStartedAt`/`indexingAgeMs` to decide whether it
15
- looks stuck. If `status` remains `missing`, call `cl_refresh` explicitly.
16
-
17
- Prefer codelens when:
18
- - you don't know the exact name/string (semantic or conceptual search via `cl_search`)
19
- - you need broad orientation in one call (`cl_explore`) "how does X work?", flows, or unfamiliar areas
20
- - you need relationships importers, tests, callers (`cl_related`) — or blast radius before edits (`cl_impact`)
21
- - you need a per-file outline / repo map (`cl_map`)
22
- - the repo is large or unfamiliar, or you'd otherwise grep + read many files
23
- - branch-scoped correctness matters (results won't leak across branches)
24
-
25
- Then use `cl_expand` to read the exact current content of a chosen target (it
26
- reads from disk never stale), and `cl_save`/`cl_load` to persist working
27
- context across compaction. If a query result has `stale:true`, read that file
28
- from disk before relying on indexed snippets/edges.
8
+ Use the codelens tools for code **discovery** before broad raw searches or bulk
9
+ file reads. They keep the context window lean and are branch-scoped. Choose the
10
+ tool by intent:
11
+
12
+ 1. Unknown area, conceptual question, execution flow, or unfamiliar subsystem:
13
+ start with `cl_explore` for grouped previews plus relationships.
14
+ 2. Find a symbol, behavior, or likely implementation location: use ranked hybrid
15
+ `cl_search` for compact handles.
16
+ 3. Find callers, importers, tests, or dependencies of a known file: use
17
+ `cl_related`.
18
+ 4. Assess blast radius before changing shared code: use `cl_impact`. Pass
19
+ `symbol` + `path` when both are known; pass `path` alone for module/file
20
+ impact when the symbol is uncertain.
21
+ 5. Get a cheap structural outline without reading whole files: use `cl_map`.
22
+ 6. Read exact current content after choosing a target: use `cl_expand` or a raw
23
+ read. Persist important context across compaction with `cl_save`/`cl_load`.
24
+
25
+ Call `cl_current` when index readiness is uncertain. Installed MCP configs
26
+ background-index missing branches; if `status` is `indexing`, wait or retry and
27
+ use `indexingStartedAt`/`indexingAgeMs` to judge whether it looks stuck. If
28
+ `status` remains `missing`, call `cl_refresh` explicitly.
29
+
30
+ If a query result has `stale:true` or `freshness:"partial"`, read that file from
31
+ disk before relying on indexed snippets/edges.
29
32
 
30
33
  If `cl_current.inGitRepo` is false or `repo` points outside the current
31
34
  workspace, CodeLens is not attached to this workspace. Tell the user to restart
@@ -41,9 +44,9 @@ not silently fall back to raw `find`/`grep` for discovery.
41
44
  - you're **verifying** exact code, logs, or user-supplied paths
42
45
  - the user explicitly asks for raw command output
43
46
 
44
- The routing is about **discovery**, not a ban on raw reads. Don't force codelens
45
- for a known exact lookup; don't fall back to bulk grep when you don't know what
46
- you're looking for.
47
+ The routing is about **discovery**, not a ban on raw reads. Do not start with
48
+ broad `grep`, `find`, or bulk `read` when the target is unknown or the question
49
+ concerns relationships. Do not force codelens for a known exact lookup either.
47
50
 
48
51
  ## Branch safety
49
52
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fodx/codelens",
3
- "version": "2.4.1",
3
+ "version": "2.5.1",
4
4
  "description": "Local, branch-aware code search & relation graph. SQLite FTS5 + tree-sitter symbols + source-graph edges, exposed as an MCP server and CLI. No chat LLM required.",
5
5
  "license": "MIT",
6
6
  "type": "module",