Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions AGENT_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ CI watching must be bounded. Do not loop indefinitely.

## Status Contract

- Scoped-update `csharp_workspace_expansion` and successful `last_index_run.csharp_workspace_expansion` share bounded trigger/decision codes, target counts, and preflight costs. Preserve conservative fallback and all workspace snapshot guards when using the optional source-input fingerprint to narrow C# re-extraction; see `docs/csharp-update-expansion.md` for proof invalidation and measurement semantics.

- Size-cap omissions use the shared CLI/MCP partial outcome policy (#5295). `size_omissions` exposes up to 20 sanitized 512-character paths, authoritative count/truncation metadata, and known omission-time byte evidence. Never infer a larger admission policy from omitted file rows. Repair requires an explicit reviewed limit or deliberate exclusion followed by a full scan; preserve successful graph rows and keep freshness separate from completeness.

- `status --json` and related JSON/MCP payloads currently expose the trust fields documented in `DEVELOPER_GUIDE.md` (the README links to that reference), including `fold_ready`, `fold_ready_reason`, `graph_table_available`, `graph_data_current`, `index_complete`, `index_incomplete_reasons`, `symbol_kind_filter_provenance_available`, `symbol_kind_filter`, `symbols_dropped_by_kind_filter`, `issues_table_available`, `file_issues_data_current`, `migration_in_progress`, `sql_graph_contract_ready`, `sql_graph_contract_degraded_reason`, `hotspot_family_ready`, `hotspot_family_degraded_reason`, `language_readiness`, `csharp_symbol_name_ready`, `csharp_metadata_target_ready`, `csharp_metadata_target_degraded_reason`, `indexed_head_commit`, `workspace_verified_head_sha`, `worktree_head_changed`, `indexed_head_sha`, `indexed_head_branch`, `indexed_head_timestamp`, `commits_ahead_of_indexed_head`, `head_freshness`, `index_writer_version`, `index_newer_than_reader`, `index_newer_than_reader_reason`, `unknown_extension_file_count`, `unknown_extension_files`, `unknown_extension_files_truncated`, `unknown_extension_file_path_limit`, `unknown_extension_extension_counts`, `unknown_extension_category_counts`, `unknown_extension_groups`, `unknown_extension_group_count`, `unknown_extension_groups_truncated`, `unknown_extension_group_limit`, `unknown_extension_group_omitted_count`, `unknown_extension_guidance`, `extractors`, `git_executable`, `github_cli_executable`, `path_case_sensitive`, `data_dir`, `data_dir_source`, `data_dir_mode`, `db_file_mode`, `database_permission_policy`, `database_permission_diagnostics`, `mac_profile`, `mac_profile_diagnostics`, `db_size_bytes`, `wal_size_bytes`, `db_pragma_settings` (`journal_mode`, `synchronous`, `wal_autocheckpoint`, `busy_timeout_ms`, `page_count`, `freelist_count`, `page_size`, `auto_vacuum`), `prepared_command_cache` (`count`, `capacity`, `hit_count`, `miss_count`, `eviction_count`), `maintenance_guidance`, WAL checkpoint diagnostics (`read_only_fallback`, `wal_checkpoint_attempted`, `wal_checkpoint_succeeded`, `wal_checkpoint_skipped_reason`, `wal_checkpoint_failure_reason`, `wal_checkpoint_busy`, `wal_checkpoint_log_page_count`, `wal_checkpoint_checkpointed_page_count`, `wal_checkpoint_remaining_page_count`, `read_only_immutable_fallback`, `wal_stale_snapshot_risk`, `wal_stale_snapshot_reason`), `symbol_kinds`, `symbols_by_language`, status kind cap metadata (`symbol_kind_limit`, `symbol_kind_name_limit`, `symbol_kind_total_count`, `symbol_kind_omitted_count`, `symbol_kind_names_truncated`, `symbols_by_language_kind_total_counts`, `symbols_by_language_kind_omitted_counts`, `symbols_by_language_kind_names_truncated`), `process`, `last_index_run`, `last_failed_or_partial_index_run`, `last_failed_or_partial_index_run.progress_persisted`, `last_failed_or_partial_index_run.recovery_hint`, `last_failed_or_partial_index_run.file_errors`, `status_metadata_diagnostics`, `last_workspace_freshened_at`, `hooks`, `hook_diagnostics`, `trust_overrides`, MCP-only `mcp_session`, `mcp.rate_limit.bucket_limit`, `mcp.rate_limit.bucket_limit_rejection_count`, and the `status --check`-only `stale_after_seconds` / `index_age_seconds` threshold audit fields and `repair_commands`.
Expand Down
18 changes: 18 additions & 0 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Developer Guide

## C# scoped-update expansion (#5347)

See [C# update scope diagnostics](docs/csharp-update-expansion.md#english) for the
immediate/persisted `csharp_workspace_expansion` contract, phase-cost semantics,
and conservative source-input proof. Narrow only after the expanded pre-write
barrier; keep all source/configuration snapshots for final validation. The optional
proof must be invalidated before mutation and on other successful indexing paths.


## Batch project-root snapshot reuse (#5339)

Children inheriting a batch reader resolve the project root, persisted path-case
Expand Down Expand Up @@ -4570,6 +4579,15 @@ API version 1 の互換性を維持し、新しい guard scope は contract vers

# 開発者ガイド

## C# 部分更新の展開(#5347)

直後の出力と保存済み `csharp_workspace_expansion` の契約、工程別コストの意味、
保守的なソース入力証拠は [C# 更新範囲の診断](docs/csharp-update-expansion.md#日本語)
を参照してください。展開後の書き込み前検証を通過してから対象を絞り、全ソース・設定の
スナップショットを最終検証まで維持します。最適化用の証拠は変更前と、別の索引経路の
成功時に無効化してください。


## batch のプロジェクトルート解決におけるスナップショット再利用(#5339)

batch reader を継承する子コマンドは、プロジェクトルート、保存済みの大小文字区別設定、
Expand Down
27 changes: 27 additions & 0 deletions TESTING_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ whole-query authority and page-window omissions cannot inherit page-only evidenc
Cycle summary variants share the existing ranked-SCC fixture in
`QueryCommandRunnerTests`; run these and dependency query regressions on net8/net9.

## C# update expansion coverage (#5347)

Run `--filter FullyQualifiedName~Issue5347` on net8/net9 alongside the existing
C# update, source-evidence, snapshot-barrier and metadata-reader regressions.
Use one small contract/member/consumer fixture for independent edits and full-index
symbol/graph comparisons; preserve rename/deletion, configuration, cancellation,
and malformed persisted-telemetry controls. Include project-marker scope/budget changes,
case-only rename peak counts, and quiet full-scan fallbacks. Phase durations are diagnostics, not
wall-clock assertions. Tests using existing global update hooks stay in the SQLite
pool sensitive collection and restore hooks in `finally`.
Exercise marker creation and budget exhaustion between the initial and expanded
scans, comparing the same timing with a conservative database and full C# extraction.


`Extract_CSharpStaticLambdaGate_BoundsRepeatedSameLineDeclarations` checks 64
same-line static methods with a warmed 2 MiB allocation ceiling on both runtimes,
including C#, Razor, Blazor and CSHTML. Preserve all identities, raw start columns,
Expand Down Expand Up @@ -1430,6 +1444,19 @@ limit 1/2/3/4、空結果・フィルター・グラフ欠落、batch の
`QueryCommandRunnerTests` の既存の SCC 順位 fixture を共有し、依存クエリの回帰と
併せて net8/net9 で実行します。

## C# 更新対象の展開テスト(#5347)

`--filter FullyQualifiedName~Issue5347` を net8/net9 で、既存の C# 更新、ソース証拠、
スナップショット検証、メタデータ読み取りの回帰テストとともに実行します。小さな契約・
メンバー・利用側の共通フィクスチャで、独立した編集と全量索引のシンボル・グラフを比較し、
rename・削除、設定変更、キャンセル、不正な保存済み診断を検証してください。プロジェクト
境界と探索上限の変更、大小文字だけの rename の最大件数、quiet 指定時の全走査への切り替えも含めます。工程時間は
診断値とし、実時間の閾値をテスト条件にしません。既存のグローバル更新フックを使うテストは
SQLite pool sensitive collection に配置し、`finally` で復元します。
初期走査と展開走査の間でマーカーを追加する場合や探索上限に達する場合も検証し、
同じタイミングで変化する保守的な DB 更新と、C# の全量抽出結果を比較してください。


#5339 は #5332 の fixture に正常な `files --format count --json` の batch を追加し、
3件・12件ともスナップショット3個分のコピー量を上限として、件数・鮮度・確定性の出力を検証します。
メタデータがある場合と欠落する場合の両方で、reader 取得後に元 DB のルート、大小文字区別設定、
Expand Down
18 changes: 18 additions & 0 deletions changelog.d/unreleased/5347.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
category: changed
issues:
- 5347
affected:
- src/CodeIndex/Cli/IndexCommandRunner.Update.CSharpPreflight.cs
- src/CodeIndex/Indexer/CSharpStaticInterfacePrepass.cs
- src/CodeIndex/Models/CSharpWorkspaceExpansion.cs
- docs/csharp-update-expansion.md
---

## English

- **Explain C# incremental-update expansion and reduce proven independent work (#5347)** — scoped updates report bounded trigger/decision, original/expanded/final target counts, and preflight phase costs in immediate output and persisted status. Matching complete source-input evidence can narrow re-extraction while retaining workspace snapshot guards; missing evidence, contract/configuration changes, hooks, filters and incomplete inputs retain conservative processing.

## 日本語

- **C# 差分更新の展開理由を示し、独立性を確認できた処理量を削減 (#5347)** — 部分更新の直後の出力と保存済み status に、上限付きの契機・判断、元/展開後/最終対象数、前処理の工程別コストを出力します。完全なソース入力の証拠が一致する場合は全体スナップショット検証を維持して再抽出対象を絞り、証拠不足、契約・設定変更、フック、フィルター、不完全な入力では保守的な処理を継続します。
Loading
Loading