Skip to content

fix: prevent stale source cache results and preserve warm workspace continuity - #35

Merged
linnnn89 merged 2 commits into
mainfrom
codex/runtime-cache-continuity
Sep 10, 2026
Merged

fix: prevent stale source cache results and preserve warm workspace continuity#35
linnnn89 merged 2 commits into
mainfrom
codex/runtime-cache-continuity

Conversation

@linnnn89

@linnnn89 linnnn89 commented Sep 10, 2026

Copy link
Copy Markdown
Owner

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

  • Local core: 373/373, including type checking, locked native build, production stdio and delivery validation.
  • Local desktop: 35/35, owner-death, native tray and two-instance tray/Roslyn workflow passed.
  • Real Roslyn Gateway: 22 scenarios passed; error contracts: 16 passed.
  • Final PR head 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.
  • Eight runtime regression cases include same-size edits with restored mtime, new/deleted files, deep/untracked inputs, missing disk/memory overflow and two actual cache processes.
  • Actual Roslyn cancellation probe retained the same Host PID and snapshot. Same-root confirmation and heartbeat complete while a prior query remains blocked.

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.

@linnnn89
linnnn89 merged commit 7d53fda into main Sep 10, 2026
6 checks passed
@linnnn89
linnnn89 deleted the codex/runtime-cache-continuity branch September 10, 2026 06:57
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.

1 participant