fix: prevent stale source cache results and preserve warm workspace continuity - #35
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and behavior
Source changes inside an untracked Git directory or beyond the bounded workspace fingerprint could return old source and declarations as successful complete results. Concurrent cache pruning could also leave an in-memory hit pointing to a deleted overflow file. Repeated same-root confirmations reset healthy Roslyn state, or blocked queries while draining; cancelling a confirmation could incorrectly require recovery.
This change validates builtin pack reuse against the actual selected file contents, re-enumerates bounded text inputs and reuses declaration parsing within the existing memory budget. Missing overflow files become cache misses. Healthy same-root confirmation preserves Host/snapshot identity without draining active queries, while real rebind and typed restart/cleanup failures retain recovery protection. It also includes the preceding unmerged FIFO mutex cancellation cleanup and native acceptance diagnostics.
Validation
5d1ae3749976a9995fadbd8c2fe24de8f67ed0d8: Windows Node 22/24 CI and all CodeQL analyses passed. Node 22 logs confirm the complete chain: Roslyn Host 58, Roslyn Gateway 22, owner-death, Repomix owner-death and manual-release all executed successfully.One initial Roslyn integration run failed because its old test treated workspace_open as a cancellation drain barrier. It now observes the actual in-flight request count within the same eight-second budget before retaining strict process-exit assertions; all 22 scenarios then passed. Historical intermittent WPF/tray failures remain documented rather than claimed fixed.
The acceptance process observer additionally rejects parent-PID reuse using creation order. The first Node 22 CI run incorrectly included an older csrss.exe through recycled PID 744, expanding seven actual Host descendants into 138 processes. A deterministic regression and replay of that receipt retain all real descendants while excluding the stale edges; the local Roslyn Gateway 22-scenario run then passed. This does not alter production process cleanup or relax exit assertions. The first failed CI did not execute the later owner-death, Repomix owner-death or manual-release commands; the entire Node 22 chain must pass on the final head before merge.
All 14 repository Markdown files are synchronized, including bilingual README, architecture/sequence diagrams, configuration and managed Skill manuals, security/contributor guidance and roadmap. Local documentation validation covered UTF-8, code fences and 96 relative links; historical failures remain in the work log.
Remaining scope
Connection-level project binding (N1), complete admission/argument budgets (N3), other shared-storage/UI concurrency cases, actual third-party client adoption and long-running resource measurements remain planned. Overflow files have no permanent cross-call lease; builtin results are based on bounded reads, not an atomic whole-workspace snapshot. Automatic release remains off, with manual release available in settings. No new dependencies or actual consumer configuration changes.
Detailed evidence and roadmap reconciliation are in docs/codex_worklog.md. GitHub CI for this PR is the authority for the pushed commit; the recorded local build has pre-commit revision metadata.