Skip to content

Commit f587646

Browse files
committed
Merge remote-tracking branch 'origin/main' into codex/fix-issue1613-1703-1919
# Conflicts: # src/CodeIndex/Mcp/McpToolHandlers.cs # tests/CodeIndex.Tests/ConsoleUiTests.cs
2 parents 86d97ed + f3db7b0 commit f587646

109 files changed

Lines changed: 4774 additions & 189 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/dotnet.yml

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,41 @@ jobs:
182182
run: dotnet build tests/CodeIndex.Tests/CodeIndex.Tests.csproj --configuration Release --framework ${{ matrix.test-framework }} --no-restore
183183

184184
- name: Test
185-
run: dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj --configuration Release --framework ${{ matrix.test-framework }} --no-build --nologo --logger "trx;LogFileName=test_results.trx" --results-directory ./TestResults
185+
shell: pwsh
186+
run: |
187+
$testArgs = @(
188+
"test",
189+
"tests/CodeIndex.Tests/CodeIndex.Tests.csproj",
190+
"--configuration", "Release",
191+
"--framework", "${{ matrix.test-framework }}",
192+
"--no-build",
193+
"--nologo",
194+
"--settings", "tests/CodeIndex.Tests/CodeIndex.Tests.runsettings",
195+
"--blame-crash",
196+
"--blame-hang",
197+
"--blame-hang-timeout", "5m",
198+
"--logger", "trx;LogFileName=test_results.trx",
199+
"--results-directory", "./TestResults"
200+
)
201+
202+
dotnet @testArgs
203+
$firstExitCode = $LASTEXITCODE
204+
if ($firstExitCode -eq 0) {
205+
exit 0
206+
}
207+
208+
Write-Warning "Initial test run failed with exit code $firstExitCode. Rerunning once to classify possible flakiness."
209+
dotnet @testArgs
210+
$retryExitCode = $LASTEXITCODE
211+
if ($retryExitCode -eq 0) {
212+
New-Item -ItemType Directory -Force -Path ./TestResults | Out-Null
213+
"Initial test run failed, but the single retry passed. Treat this run as flaky and inspect TRX/blame artifacts." |
214+
Set-Content -Encoding UTF8 ./TestResults/flaky-retry.txt
215+
Write-Warning "Tests passed on retry; uploaded TestResults include flaky-retry.txt."
216+
exit 0
217+
}
218+
219+
exit $retryExitCode
186220
187221
- name: Summarize TRX telemetry
188222
if: always()
@@ -194,7 +228,14 @@ jobs:
194228
with:
195229
name: TestResults-${{ matrix.os }}-${{ matrix.test-framework }}
196230
if-no-files-found: warn
197-
path: TestResults/**/*.trx
231+
path: |
232+
TestResults/**/*.trx
233+
TestResults/**/*.txt
234+
TestResults/**/*.xml
235+
TestResults/**/*.dmp
236+
TestResults/**/*.dump
237+
TestResults/**/*Sequence*.xml
238+
TestResults/**/*.hangdump
198239
199240
- name: Publish
200241
if: matrix.os == 'ubuntu-latest' && matrix.test-framework == 'net8.0'

AGENT_GUIDE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ CI watching must be bounded. Do not loop indefinitely.
131131

132132
## Status Contract
133133

134-
- `status --json` and related JSON/MCP payloads currently expose the trust fields documented in `README.md` and `DEVELOPER_GUIDE.md`, including `fold_ready`, `fold_ready_reason`, `graph_table_available`, `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`, `csharp_symbol_name_ready`, `csharp_metadata_target_ready`, `csharp_metadata_target_degraded_reason`, `indexed_head_commit`, `worktree_head_changed`, `index_writer_version`, `index_newer_than_reader`, `index_newer_than_reader_reason`, `unknown_extension_file_count`, `path_case_sensitive`, `data_dir`, `data_dir_source`, `data_dir_mode`, `mac_profile`, `db_pragma_settings` (`journal_mode`, `synchronous`, `wal_autocheckpoint`, `page_count`, `freelist_count`, `page_size`), `hooks`, MCP-only `mcp_session`, and the `status --check`-only `stale_after_seconds` / `index_age_seconds` threshold audit fields.
134+
- `status --json` and related JSON/MCP payloads currently expose the trust fields documented in `README.md` and `DEVELOPER_GUIDE.md`, including `fold_ready`, `fold_ready_reason`, `graph_table_available`, `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`, `csharp_symbol_name_ready`, `csharp_metadata_target_ready`, `csharp_metadata_target_degraded_reason`, `indexed_head_commit`, `worktree_head_changed`, `index_writer_version`, `index_newer_than_reader`, `index_newer_than_reader_reason`, `unknown_extension_file_count`, `path_case_sensitive`, `data_dir`, `data_dir_source`, `data_dir_mode`, `mac_profile`, `db_size_bytes`, `wal_size_bytes`, `db_pragma_settings` (`journal_mode`, `synchronous`, `wal_autocheckpoint`, `page_count`, `freelist_count`, `page_size`), `symbols_by_language`, `process`, `last_index_run`, `hooks`, MCP-only `mcp_session`, and the `status --check`-only `stale_after_seconds` / `index_age_seconds` threshold audit fields.
135135
- When any readiness field is degraded, the CLI adds `degraded_root_cause`, `degraded_reason`, `recommended_action`, `alternative_action`, and `readiness_degradations[]`. `degraded_root_cause` is the primary stable machine code; `readiness_degradations[]` lists every degraded field with `root_cause`, human reason, and remediation strings.
136136
- `issues_table_available` reports physical `file_issues` table presence only. `file_issues_data_current` reports whether the table is also stamped current for the active index generation.
137137
- `index_writer_version` records the `cdidx` version that last wrote to the DB (stamped into `codeindex_meta` as `cdidx_writer_version` on every full scan, update, and MCP index). `index_newer_than_reader` flips to `true` whenever any persisted numeric contract stamp in `codeindex_meta` (or unknown `PRAGMA user_version` readiness bits) exceeds the current binary's compiled maximum, so an older CLI re-opening a DB written by a newer CLI degrades loudly with an audit trail instead of silently dropping back to text-search fallbacks. `index_newer_than_reader_reason` enumerates the specific newer-than-reader stamps.
@@ -140,6 +140,7 @@ CI watching must be bounded. Do not loop indefinitely.
140140
- `status` also surfaces `.cdidx` data-directory permissions via `data_dir_mode` on POSIX filesystems. New `.cdidx` data directories are forced to `0700`; the field is omitted on Windows, URI DBs, or when the directory mode cannot be inspected.
141141
- `status` also surfaces filesystem case-sensitivity via `path_case_sensitive`, stamped on every successful `cdidx index` run (full scan AND partial update, plus MCP-driven indexes) from `core.ignorecase` + a live filesystem probe. `true` means the volume is case-sensitive (`Foo.cs` and `foo.cs` are distinct); `false` means case-insensitive. Omitted on legacy DBs that predate the stamp. Use it to audit path-equality decisions on case-sensitive APFS, WSL NTFS / dev-drive, and ReFS mounts where the prior OS-keyed heuristic could mis-classify the workspace (#1546).
142142
- `status` also surfaces Linux mandatory-access-control context via `mac_profile` when `/proc/self/attr/current` or `/proc/self/attr/exec` indicates an AppArmor or SELinux profile. It is omitted on non-Linux hosts, unconstrained processes, or unreadable proc attributes (#1768).
143+
- `status` also surfaces DB/WAL size, per-language symbol-kind histograms, current process heap/GC/working-set metrics, and the last successful index run metadata. `process` is captured at status-call time; `last_index_run` is persisted at the end of successful CLI and MCP index runs and can include a peak-memory summary when CLI `--memory-trace` was used.
143144
- MCP `status` also surfaces session diagnostics via `mcp_session`. It is not persisted DB state; it includes the current `log_level`, captured `roots`, optional `client_info`, and optional `client_capabilities`.
144145
- Keep `README.md`, `DEVELOPER_GUIDE.md`, and this file synchronized if this contract changes.
145146

0 commit comments

Comments
 (0)