Skip to content

Commit 9188078

Browse files
committed
Merge origin/main into fix-issue1727-1729
2 parents 9993e35 + cc8d10a commit 9188078

39 files changed

Lines changed: 1459 additions & 152 deletions

DEVELOPER_GUIDE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,14 @@ Do not add mutable static caches, shared `StringBuilder` instances, reused `Matc
224224

225225
`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.
226226

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+
227235
### Degradation reason codes
228236

229237
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.

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,20 @@ file completion.
118118
| Drift checks | `cdidx diff <db1> <db2>` compares schema, file, symbol, and reference deltas with stable exit codes: `0` identical, `1` drift, `2` schema mismatch, `3` unreadable DB. |
119119
| 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`. |
120120
| 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.
122135

123136
The documented `status --json` trust contract covers these fields:
124137

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
category: fixed
3+
issues:
4+
- 1700
5+
affected:
6+
- tests/CodeIndex.Tests/QueryCommandRunnerTests.cs
7+
---
8+
9+
## English
10+
11+
- **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.
12+
13+
## 日本語
14+
15+
- **範囲外の query 数値フラグを fail-closed にしました (#1700)**`--depth 999999999` のような数値 option は silent な補正や clamp ではなく usage error を返します。
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
category: fixed
3+
issues:
4+
- 1705
5+
- 1801
6+
affected:
7+
- src/CodeIndex/Cli/QueryCommandRunner.cs
8+
- tests/CodeIndex.Tests/QueryCommandRunnerTests.cs
9+
---
10+
11+
## English
12+
13+
- **Unknown query flags now fail closed (#1705, #1801)** — query commands reject unknown dash-prefixed tokens unless the user explicitly passes them after `--`.
14+
15+
## 日本語
16+
17+
- **未知の query flag を fail-closed にしました (#1705, #1801)** — query command は、ユーザーが明示的に `--` の後ろへ置いた場合を除き、未知の dash 始まり token を拒否します。
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
category: added
3+
issues:
4+
- 1732
5+
affected:
6+
- src/CodeIndex/Mcp/McpToolHandlers.cs
7+
- src/CodeIndex/Mcp/McpToolDefinitions.cs
8+
- tests/CodeIndex.Tests/McpServerTests.cs
9+
---
10+
11+
## English
12+
13+
- **Added MCP `countOnly` probing for large result sets (#1732)**`search`, `references`, `callers`, `callees`, and `impact_analysis` can now return count metadata plus a small top-file histogram without row payloads.
14+
15+
## 日本語
16+
17+
- **大きな結果セット向けに MCP `countOnly` プローブを追加しました (#1732)**`search``references``callers``callees``impact_analysis` が、行 payload を返さずに件数 metadata と小さな top-file histogram を返せるようになりました。
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
category: added
3+
issues:
4+
- 1744
5+
affected:
6+
- src/CodeIndex/Cli/ProgramRunner.cs
7+
- src/CodeIndex/Cli/ConsoleUi.cs
8+
- README.md
9+
---
10+
11+
## English
12+
13+
- **Added `cdidx upgrade` for release self-upgrades (#1744)**`upgrade` checks GitHub release freshness, supports `--check-only`, refuses unwritable install directories, and reruns the signed `install.sh` installer for the latest release.
14+
15+
## 日本語
16+
17+
- **リリース自己更新用の `cdidx upgrade` を追加しました (#1744)**`upgrade` は GitHub release の鮮度を確認し、`--check-only` をサポートし、書き込み不能なインストール先を拒否したうえで最新リリース向けに署名済み `install.sh` を再実行します。
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
category: fixed
3+
issues:
4+
- 1745
5+
affected:
6+
- src/CodeIndex/Mcp/McpServer.cs
7+
- src/CodeIndex/Mcp/McpToolHandlers.cs
8+
- tests/CodeIndex.Tests/McpServerTests.cs
9+
---
10+
11+
## English
12+
13+
- **MCP tool responses now have a server-wide byte ceiling (#1745)** — oversized responses fail with structured `response_too_large` metadata instead of being serialized and written unbounded.
14+
15+
## 日本語
16+
17+
- **MCP ツール応答にサーバー全体の byte 上限を追加しました (#1745)** — 過大な応答は無制限に直列化・書き込みされず、構造化された `response_too_large` metadata を持つエラーになります。
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
category: added
3+
issues:
4+
- 1748
5+
affected:
6+
- src/CodeIndex/Cli/ProgramRunner.cs
7+
- src/CodeIndex/Cli/QueryCommandRunner.cs
8+
- src/CodeIndex/Cli/UpdateChecker.cs
9+
- README.md
10+
---
11+
12+
## English
13+
14+
- **Added explicit update checks (#1748)**`cdidx --check-updates` and `cdidx status --check-updates` now use the cached GitHub latest-release check so operators can ask for version freshness without running an upgrade.
15+
16+
## 日本語
17+
18+
- **明示的な更新確認を追加しました (#1748)**`cdidx --check-updates``cdidx status --check-updates` がキャッシュ付き GitHub latest-release 確認を使うようになり、upgrade せずにバージョン鮮度を確認できます。
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
category: added
3+
issues:
4+
- 1750
5+
affected:
6+
- install.sh
7+
- README.md
8+
---
9+
10+
## English
11+
12+
- **Added installer uninstall mode (#1750)**`install.sh --uninstall` removes files installed next to the `cdidx` binary and `--purge-cache` can also remove the per-user cdidx cache, while documenting what remains manual.
13+
14+
## 日本語
15+
16+
- **インストーラーに uninstall モードを追加しました (#1750)**`install.sh --uninstall``cdidx` バイナリ横に配置されたファイルを削除し、`--purge-cache` ではユーザー単位の cdidx キャッシュも削除できます。手動で残るものも明示します。
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
category: added
3+
issues:
4+
- 1752
5+
affected:
6+
- src/CodeIndex/Cli/ProgramRunner.cs
7+
- DEVELOPER_GUIDE.md
8+
---
9+
10+
## English
11+
12+
- **Added workspace version pin warnings (#1752)**`.cdidx-version` now warns when the running CLI version differs from the workspace pin, and `--strict-version` / `CDIDX_STRICT_VERSION=1` can turn the mismatch into exit code 64.
13+
14+
## 日本語
15+
16+
- **ワークスペースのバージョン固定警告を追加しました (#1752)**`.cdidx-version` と実行中 CLI のバージョンが異なる場合に警告し、`--strict-version` / `CDIDX_STRICT_VERSION=1` で不一致を exit code 64 にできます。

0 commit comments

Comments
 (0)