Skip to content

Fix trimmed JSON extraction worker failures - #4710

Merged
Widthdom merged 3 commits into
mainfrom
fix-issue4709
Jul 22, 2026
Merged

Fix trimmed JSON extraction worker failures#4710
Widthdom merged 3 commits into
mainfrom
fix-issue4709

Conversation

@Widthdom

Copy link
Copy Markdown
Owner

Summary

  • replace reflection-based JSON property-name serialization in symbol and dependency-lock extraction with trim-safe JsonEncodedText encoding
  • replace the large-JSON fallback's reflection-based string deserialization with bounded JsonDocument parsing while preserving malformed-surrogate fallback behavior
  • add focused JSON/package-lock coverage plus a published trimmed CLI regression covering version.json, Stryker configuration, package-lock.json, and JSON Schema inputs

Root cause and impact

Published trimmed builds disable reflection-based System.Text.Json serialization. Two extraction-worker code paths serialized runtime property-name strings through JsonSerializer, so valid keys such as $schema and node_modules/... could terminate isolated extraction and leave a rebuild partial. The replacement uses trim-safe primitives and preserves the existing bounded fallback contract for malformed large JSON.

A successful published rebuild now finishes complete and stamps the current index_writer_version; partial runs continue to preserve the previous successful writer stamp as designed.

Validation

  • dotnet test CodeIndex.sln -c Release --no-build -p:UseSharedCompilation=false --logger "console;verbosity=quiet" — net8.0: 9,773 passed, 7 skipped; net9.0: 9,306 passed, 413 skipped
  • focused Issue v1.39.3: JSON symbol-extraction worker fails with JsonSerializerIsReflectionDisabled, leaving rebuilt index partial #4709 and large-JSON fallback tests on net8.0 and net9.0
  • dotnet build CodeIndex.sln -c Release -p:UseSharedCompilation=false
  • dotnet build CodeIndex.sln -c Debug -p:UseSharedCompilation=false
  • make lint
  • dotnet run --project tools/CodeIndex.Changelog --no-restore -- check
  • manual macOS arm64 self-contained trimmed publish, rebuild, and status --check --json smoke: complete index, no file errors, writer version 1.39.3
  • two-round Codex adversarial review; the first finding was fixed and the second review found no actionable issue

Documentation and changelog

  • document the published trimmed JSON worker regression test in both English and Japanese sections of TESTING_GUIDE.md
  • add bilingual fragment changelog.d/unreleased/4709.fixed.md
  • no README or developer-guide contract change is needed because this restores the already documented trimmed-build behavior

Fixes #4709

@Widthdom
Widthdom marked this pull request as ready for review July 22, 2026 03:34
@Widthdom
Widthdom merged commit edcf0de into main Jul 22, 2026
8 checks passed
@Widthdom
Widthdom deleted the fix-issue4709 branch July 22, 2026 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v1.39.3: JSON symbol-extraction worker fails with JsonSerializerIsReflectionDisabled, leaving rebuilt index partial

1 participant