You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do not add mutable static caches, shared `StringBuilder` instances, reused `MatchCollection` enumerators, or singleton scanner state to extractor code. If a future extractor needs cross-call memoization, use an explicit thread-safe collection and add a targeted parallel regression test that proves deterministic output under concurrent calls.
131
131
132
+
### Symbol Kind Taxonomy
133
+
134
+
`symbols.kind`, `symbols.container_kind`, and `symbol_references.container_kind` use the public symbol kind taxonomy below. New extractors must register new kind values in `SymbolKindCatalog` before writing them so schema checks, writer validation, CLI filters, and downstream JSON consumers stay aligned.
135
+
136
+
| Kind | Current producers / meaning | Graph behavior |
137
+
|---|---|---|
138
+
|`accessor`| Accessor declarations when extracted separately from their owning property | Search/filter symbol |
139
+
|`annotation`| Annotation declarations or annotation-like language constructs | Metadata/search symbol |
140
+
|`async_function`| JavaScript/TypeScript async function declarations | Callable definition; participates in callers/callees through reference rows |
141
+
|`async_generator`| JavaScript/TypeScript async generator declarations | Callable definition; participates in callers/callees through reference rows |
142
+
|`attribute`| Razor attributes and metadata-like declarations | Context/search symbol; not a call edge by itself |
143
+
|`associatedtype`| Swift associated type declarations | Type-like definition target |
144
+
|`class`| Class declarations across object-oriented languages | Definition target and container |
145
+
|`class_hook`| Python class hook methods such as dunder hooks reclassified from functions | Callable/search symbol |
146
+
|`code`| Markdown fenced or structured code blocks | Search/outline symbol |
147
+
|`constant`| Constant declarations where the language distinguishes them | Search/filter symbol |
148
+
|`delegate`| C# / F# delegate declarations | Callable type definition and container-like target |
149
+
|`enum`| Enum declarations | Definition target and container |
150
+
|`event`| Event declarations | Search/filter symbol |
151
+
|`field`| Field declarations where distinct from properties | Search/filter symbol |
152
+
|`file_module`| File-scoped module/package declarations | Namespace-like context symbol |
153
+
|`function`| Functions, methods, constructors, delegates, tasks, and callable bindings that do not have a narrower kind | Primary callable definition; participates in callers/callees through reference rows |
154
+
|`generator`| JavaScript/TypeScript generator declarations | Callable definition; participates in callers/callees through reference rows |
|`implements`| Razor `@implements` directives | Context/search symbol |
158
+
|`import`| Imports, using directives, aliases, and package includes | Search/filter symbol |
159
+
|`interface`| Interface declarations | Definition target and container |
160
+
|`lambda`| Named lambda/arrow bindings | Callable definition; participates in callers/callees through reference rows |
161
+
|`layout`| Razor layout directives | Context/search symbol |
162
+
|`method`| Languages or hooks that explicitly distinguish methods from functions | Callable definition; participates in callers/callees through reference rows |
163
+
|`module`| Module declarations | Definition target and container |
164
+
|`namespace`| Namespace declarations | Definition target and container |
165
+
|`operator`| C# operator overload and conversion operator declarations | Callable definition; participates in callers/callees through reference rows |
166
+
|`object`| Object-literal/object container context used by nested extracted symbols | Container context |
167
+
|`package`| Package declarations | Namespace-like context symbol |
168
+
|`property`| Properties and property-like fields | Definition target; not treated as a call edge by itself |
169
+
|`procedure`| Procedure declarations in languages such as Fortran | Callable definition |
170
+
|`program`| Program block declarations in languages such as Fortran | Definition target and container |
171
+
|`protocol`| Protocol declarations in languages that distinguish protocols from interfaces | Definition target and container |
172
+
|`reference`| Secondary extracted symbolic references, such as HTML classes or metadata keys | Search/filter symbol |
173
+
|`rule`| CSS/SCSS rule container context used by nested references | Container context |
174
+
|`route`| Razor route directives | Context/search symbol |
175
+
|`service`| Service declarations in IDL/protobuf-like languages | Definition target and container |
176
+
|`specialization`| C++ template specialization declarations | Definition target for specialized type/function forms |
177
+
|`struct`| Struct declarations | Definition target and container |
|`use`| Generic usage relationship when no narrower reference kind applies |
222
+
132
223
### Status freshness age threshold
133
224
134
225
`status --check` keeps the DB/worktree checksum comparison in `IndexFreshnessChecker`, but the user-facing age hint threshold is resolved in `QueryCommandRunner`: CLI `--stale-after <duration>` wins over `CDIDX_STALE_AFTER`, which wins over `.cdidxrc.json`'s `stale_after`, then the 24-hour default. Supported duration suffixes are `m`, `h`, and `d`. JSON output includes `stale_after_seconds` and `index_age_seconds` only for `--check`, so clients can confirm which threshold was applied without inferring it from text.
135
226
227
+
### Workspace version pinning
228
+
229
+
On startup, `cdidx` walks up from the current directory looking for `.cdidx-version`. The first non-empty line is treated as the required CLI version for that workspace. A mismatch prints a warning and continues by default; `--strict-version` or `CDIDX_STRICT_VERSION=1` turns the mismatch into exit code `64` (`EX_USAGE`). This check is advisory and does not rewrite the file. Use it to keep teams on the same binary when index contracts or query behavior differ between releases.
230
+
231
+
### Release freshness and upgrade checks
232
+
233
+
`cdidx --check-updates` and `cdidx status --check-updates` query the GitHub latest-release endpoint through `UpdateChecker`, using the same 24-hour cache and `CDIDX_DISABLE_UPDATE_CHECK=1` opt-out as the `--version` hint. `cdidx upgrade --check-only` reuses that check. `cdidx upgrade` is intentionally a thin wrapper around the signed release installer: it downloads `install.sh`, verifies the current binary directory is writable, sets `CDIDX_INSTALL_DIR` to that directory, and runs the installer for the latest release.
234
+
136
235
### Degradation reason codes
137
236
138
237
Readiness degradation reason codes are centralized in `DegradationReasonCodes`. Add new codes there with human text, a recommended action, and an alternative action before emitting them from readers, CLI, or MCP payloads.
@@ -1033,17 +1132,29 @@ lifecycle breadcrumbs to a per-user daily log. The log path follows
1033
1132
`XDG_CACHE_HOME/cdidx/logs/`, `XDG_RUNTIME_DIR/cdidx/logs/`, then the
1034
1133
platform default: `%LOCALAPPDATA%\cdidx\logs\` on Windows,
1035
1134
`~/Library/Logs/cdidx/` on macOS, or `~/.local/state/cdidx/logs/` on Linux.
1036
-
The file name is `stderr-YYYYMMDD.log`, and the logger keeps only the newest
1037
-
30 daily files. Repository-local development runs from `src/CodeIndex/bin/...`
1038
-
and `tests/.../bin/...` are excluded by default so ordinary build/test cycles
1039
-
do not accumulate persistent logs. Set `CDIDX_DISABLE_PERSISTENT_LOG=1` to opt
1040
-
out entirely; the toggle accepts `1`, `true`, `yes`, or `on`
1041
-
case-insensitively. Use `CDIDX_GLOBAL_TOOL_LOG_DIR` to redirect the log
1042
-
directory during testing or packaging.
1135
+
Each candidate is probed with a create/write/delete round trip before the
1136
+
logger commits to it, so read-only state/cache/runtime mounts fall through to
1137
+
the next candidate instead of losing the first log write. The file name is
1138
+
`stderr-YYYYMMDD.log`, timestamps inside the file are ISO-8601 UTC
1139
+
(`yyyy-MM-ddTHH:mm:ss.fffZ`) using invariant culture, and the logger keeps
1140
+
only the newest 30 daily files. Repository-local development runs from
1141
+
`src/CodeIndex/bin/...` and `tests/.../bin/...` are excluded by default so
1142
+
ordinary build/test cycles do not accumulate persistent logs. Set
1143
+
`CDIDX_DISABLE_PERSISTENT_LOG=1` to opt out entirely; the toggle accepts `1`,
1144
+
`true`, `yes`, or `on` case-insensitively. Use
1145
+
`CDIDX_GLOBAL_TOOL_LOG_DIR` to redirect the log directory during testing or
1146
+
packaging.
1043
1147
Set `CDIDX_FORCE_GLOBAL_TOOL_LOG=1` to force lifecycle logging for local
1044
1148
package smoke tests or launcher diagnostics even when the executable path looks
1045
1149
like a development build; `CDIDX_DISABLE_PERSISTENT_LOG` still wins when both
1046
1150
are set.
1151
+
Unhandled exceptions keep stderr concise but write the full exception chain and
1152
+
stack trace to the lifecycle log for post-mortem diagnostics. Logged command
1153
+
arguments are minimally redacted by default: secret-looking `--flag=value`
1154
+
pairs, values following secret-looking flags, URI passwords, and long token-like
1155
+
hex/base64 strings are replaced with `<redacted>`. `CDIDX_LOG_REDACT=none`
1156
+
preserves raw arguments for controlled local debugging, while
1157
+
`CDIDX_LOG_REDACT=full` also replaces path-like arguments with a stable hash.
|`search`| One JSON object per result, with CLI query metadata such as `api_version`, `query`, path, line range, snippet, highlights, and truncation details. | Tool result content contains equivalent search-result objects using MCP serialization and tool-call framing. | Result semantics are shared, but the outer envelope and field casing follow the called surface. |
| Extensibility and feedback | Post-extraction hooks from `~/.config/cdidx/hooks/*.dll` or `CDIDX_HOOKS_DIR` can enrich symbols and references. `cdidx suggestions` lists, inspects, and exports local suggestion history, with fuzzy MCP suggestion deduplication controlled by CLI, env, or `.cdidxrc.json`. |
120
120
| Language coverage | 78 detected languages, with symbol and graph support where available. |
121
-
| Updates |`cdidx --version` checks GitHub releases at most once per day and appends a newer-release hint when one is available. Set `CDIDX_DISABLE_UPDATE_CHECK=1` to suppress the check. |
121
+
| Updates |`cdidx --version` checks GitHub releases at most once per day and appends a newer-release hint when one is available. Use `cdidx --check-updates` or `cdidx status --check-updates` for an explicit freshness check, and `cdidx upgrade` to reinstall the latest GitHub release via `install.sh`. Set `CDIDX_DISABLE_UPDATE_CHECK=1` to suppress checks. |
122
+
123
+
### Upgrade and uninstall
124
+
125
+
`cdidx upgrade --check-only` reports whether a newer GitHub release is available. `cdidx upgrade` downloads the current `install.sh`, refuses unwritable install directories, and reruns the installer with `CDIDX_INSTALL_DIR` pointed at the current binary directory.
126
+
127
+
Direct `install.sh` installs can be removed with:
128
+
129
+
```bash
130
+
bash ./install.sh --uninstall
131
+
bash ./install.sh --uninstall --purge-cache
132
+
```
133
+
134
+
The uninstaller removes files placed next to the `cdidx` binary and can optionally remove `~/.cache/cdidx`. It does not remove project `.cdidx/` directories, shell profile PATH edits, shell completion scripts, Homebrew installs, or .NET global-tool installs.
122
135
123
136
The documented `status --json` trust contract covers these fields:
Copy file name to clipboardExpand all lines: USER_GUIDE.md
+22-2Lines changed: 22 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ cdidx suggestions list # Review local AI feedback history
30
30
cdidx mcp # Start MCP server for AI tools
31
31
```
32
32
33
-
78 languages supported. 24 MCP tools. Incremental updates. Zero config.
33
+
78 languages supported. 24 registered MCP tools. Incremental updates. Zero config.
34
34
35
35
| Topic | Link |
36
36
|---|---|
@@ -1764,7 +1764,7 @@ OpenAI Codex CLI (`codex.json` or `~/.codex/config.json`):
1764
1764
1765
1765
Once configured, the AI can directly call these tools:
1766
1766
1767
-
The MCP `tools/list`descriptions include compact English/Japanese usage examplesfor the primary search and navigation tools, so AI clients can discover valid argument shapes directly from the server response.
1767
+
The MCP `tools/list`response includes an `examples` array for every registered tool, so AI clients can discover valid`tools/call` argument shapes directly from the server response.
1768
1768
1769
1769
| Tool | Description |
1770
1770
|---|---|
@@ -1809,6 +1809,26 @@ Graph-oriented MCP tools such as `references`, `callers`, and `callees` also ret
1809
1809
1810
1810
All MCP tools include `annotations` (`readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`) so AI clients can auto-approve safe read-only queries without prompting the user.
1811
1811
1812
+
#### MCP error responses
1813
+
1814
+
MCP JSON-RPC failures use the standard `error` object. Clients should route on
1815
+
`error.code` and, when present, `error.data.category`; do not parse
1816
+
`error.message`, which is human-facing diagnostic text.
1817
+
1818
+
| Code | Meaning | Client action |
1819
+
|---|---|---|
1820
+
|`-32700`| Parse error or frame too large | Fix the JSON/frame size before retrying |
|`-32601`| Method not found or disabled tool | Check server version and `tools/list`|
1823
+
|`-32602`| Invalid params, unknown tool, or bad protocol version | Fix arguments or negotiate a supported version |
1824
+
|`-32603`| Internal error | Surface the failure and inspect server stderr |
1825
+
|`-32000`| Rate limited | Retry after the reported delay |
1826
+
|`-32001`| Permission denied | Provide the configured auth token |
1827
+
|`-32010`| Index missing | Run `cdidx index <projectPath>` first |
1828
+
|`-32011`| Index stale/schema mismatch | Rebuild or refresh the index |
1829
+
|`-32012`| Index corrupted/unreadable | Rebuild the index from source |
1830
+
|`-32015`| Request cancelled | Retry if the client still needs the result |
1831
+
1812
1832
#### Optional HTTP transport
1813
1833
1814
1834
By default `cdidx mcp` speaks JSON-RPC over stdin/stdout, which is what every config example above uses. AI clients that prefer to keep one warm server running across many requests — instead of paying subprocess-spawn cost per call — can switch the transport to HTTP:
-**Rejected malformed persisted kind values (#1691)** — new schemas add CHECK constraints for symbol/reference kind columns, and writer paths fail fast when extractors try to persist unregistered kind values.
-**Out-of-range query numeric flags now fail closed (#1700)** — numeric options such as `--depth 999999999` return usage errors instead of being silently coerced or clamped.
0 commit comments