Skip to content

Explain and safely narrow C# incremental update expansion - #5358

Merged
Widthdom merged 4 commits into
mainfrom
fix-issue5347
Sep 12, 2026
Merged

Explain and safely narrow C# incremental update expansion#5358
Widthdom merged 4 commits into
mainfrom
fix-issue5347

Conversation

@Widthdom

@Widthdom Widthdom commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Small C# scoped refreshes could re-extract nearly every C# file because static-interface and member-reference contracts required workspace expansion. This change explains that work and narrows re-extraction only when complete source-input evidence proves the workspace lookup inputs unchanged.

Fixes #5347

Changes

  • Add bounded csharp_workspace_expansion diagnostics with the trigger, decision, original/expanded/final target counts, and preflight phase costs. Successful CLI updates and persisted CLI/MCP status share the same object; configuration-driven full scans identify their fallback.
  • Preserve the complete workspace scan and source/configuration barriers. An optional, run-bound fingerprint permits a narrower main pass for independent instance-only edits. It binds project-marker evidence from the same validated expansion scan. Missing evidence, changed contributing sources/order, configuration or binary builds, hooks/custom extractors, filters, incomplete readiness, and races retain conservative behavior.
  • Keep rename/deletion cleanup, untouched references, generated suppression, cancellation, and verified-HEAD provenance. Full/other indexing paths invalidate the optional proof; existing databases require no migration.

Validation

  • CI formatting follow-up: make lint passed after formatting two C# files; the Release test-project build passed with zero warnings/errors, and the affected metadata regression passed on both .NET 8 and .NET 9. This follow-up changes whitespace only.
  • Release solution build: zero warnings/errors.
  • Relevant update/status/JSON snapshot regressions: .NET 8 208 passed; .NET 9 205 passed, 3 existing framework skips.
  • Final focused run: 20 passed on each of .NET 8 and .NET 9, comprising thirteen new Explain and safely narrow C# workspace expansion during incremental refresh #5347 cases and seven JSON snapshots. Coverage includes full-index symbol/graph parity, Git verification, contracts/members, renames/removals, configuration/generated/filter transitions, cancellation/races, bounded metadata, fingerprint ordering/budgets, project-marker changes and budget exhaustion between scans, case-only rename peak counts, and quiet fallback output.
  • Changelog validation and git diff --check passed.
  • Isolated 99-C#-file Git fixture, using an old-ref database for each comparison: an independent edit updated 1 file / 1,777 bytes / 1,850 ms, versus 99 / 170,819 / 2,720 ms for the same edit with the optional proof removed. A shared member-target rename retained expansion: 99 / 170,821 / 3,478 ms. These are file-loop bytes and persisted durations; the C# prepass still examined about 171 KB. Source/graph data and freshness matched the conservative/full controls. Full measurements and limitations are in the documentation; these single runs do not establish a general speedup.
  • Exact historical workload reproduced in a detached checkout with fresh binaries at both refs and a private database verified at the old ref: 24 Git paths → 1,424 scanned, 1,410 updated, 14 removed, 39,061,997 bytes, 154,465 ms persisted duration. Root/manifest freshness and source/graph completeness passed at both refs.

Documentation

  • Bilingual contract and measurement notes: docs/csharp-update-expansion.md, with English/Japanese developer/testing-guide updates.
  • Changelog fragment: changelog.d/unreleased/5347.changed.md; CHANGELOG.md is unchanged.
  • AGENT_GUIDE.md updates the shared status contract. No agent entry-point files were changed.

Review and scope

Two Codex adversarial passes identified project-marker proof, case-only rename diagnostics, quiet-output behavior, and a follow-up marker-scan race. All findings were fixed with behavioral regressions. The final race/budget cases fail before the fix and pass afterward, with conservative/full extraction controls. Review followed the repository's two-round limit; the final fix was verified by tests. Final root/manifest freshness and completeness checks passed at the committed HEAD, and immediate/persisted expansion diagnostics matched. Only #5347 is in scope; no unrelated follow-up issue was identified.

@Widthdom
Widthdom merged commit f0889b9 into main Sep 12, 2026
11 checks passed
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.

Explain and safely narrow C# workspace expansion during incremental refresh

1 participant