Repository navigation
fix(graph): eliminate the compile-flake population (single compile driver + complete terminal write + search ordering) - #173
Conversation
… + complete terminal write + confirmed release path Reproduced at 2 cores (not the remembered wall-clock base-Full model — that mechanism is gone). Actual roots, all owner-side: - NodeTypeContractHandler ran Roslyn INLINE for a fresh NodeType (status==null treated as settled) concurrently with the watcher's first-build → loser reads the winner's mid-emit DLL → BadImageFormatException → deletes it → terminal Error forever. Now a single status-guarded dispatch (EnsureCompileDispatched); the watcher is the only driver. - Success write-back omitted CompiledFrameworkVersion → HasUsableBuild false forever → every fv-gated waiter times out. Now stamped on fresh compile. - TryCreateReleaseNode was fire-and-forget yet its path was stamped into LatestReleasePath immediately → phantom-path NotFound. Now emits the path only after the create lands. - SEPARATE root: storage query discarded its fuzzy score → free-text top-N rode readdir order (CI-only SearchQueryTests flake). Now ranked before the Take(limit) clip. 5/5 full Monolith-suite iterations green @2 cores; Orleans 122/122; Query 342/342. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR targets a set of CI flakes and occasional runtime wedges in the graph/node-type compilation pipeline by enforcing a single compile driver (status control plane → watcher-driven compile), ensuring terminal compile writes are complete, and making query results deterministic under free-text search.
Changes:
- Added an integration test that ratchets the “single compile driver + complete terminal write” invariants for fresh NodeTypes, including concurrent requester consistency.
- Updated
GetCompilationPathRequesthandling to dispatch compiles via the status control plane, wait for settling, and ensureCompiledFrameworkVersionis stamped on fresh-success write-back. - Stabilized in-memory free-text query results by ranking matches by relevance before applying the limit clip; and changed release-node creation to be observed/bounded (but see review comment on AccessContext).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/MeshWeaver.Hosting.Monolith.Test/CompileSingleDriverConsistencyTest.cs | New integration test covering fresh compile terminal-state completeness and concurrent request single-flight behavior. |
| src/MeshWeaver.Hosting/Persistence/Query/StorageAdapterMeshQueryProvider.cs | Adds relevance sorting for free-text search to eliminate limit-window nondeterminism. |
| src/MeshWeaver.Graph/MeshDataSource.cs | Changes release creation helper to an observed/bounded IObservable<string?> surface rather than fire-and-forget. |
| src/MeshWeaver.Graph/Configuration/NodeTypeContractHandler.cs | Enforces watcher-driven single-flight compilation and stamps framework version on fresh compile success write-back. |
| src/MeshWeaver.Graph/Configuration/NodeTypeCompileActivityHandler.cs | Ensures parent terminal writes occur only after release-create observation completes (bounded), avoiding phantom release paths. |
| src/MeshWeaver.Graph/Configuration/NodeTypeCompilationHelpers.cs | Mirrors bounded/observed release-create behavior inside the watcher compile pipeline. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return Observable.Using( | ||
| () => !string.IsNullOrEmpty(requestedBy) && accessService is not null | ||
| ? accessService.SwitchAccessContext(new AccessContext | ||
| { | ||
| ObjectId = requestedBy, | ||
| Name = requestedBy | ||
| }) | ||
| : System.Reactive.Disposables.Disposable.Empty, | ||
| _ => meshService.CreateNode(node).Take(1)) |
Test Results (shard 2) 14 files ± 0 14 suites ±0 6m 46s ⏱️ -31s Results for commit 563afa3. ± Comparison against base commit 214ba1b. This pull request removes 164 tests. |
Test Results (shard 1)1 160 tests - 100 1 159 ✅ - 100 3m 57s ⏱️ - 1m 8s Results for commit 563afa3. ± Comparison against base commit 214ba1b. This pull request removes 102 and adds 2 tests. Note that renamed tests count towards both. |
Test Results 53 files ± 0 53 suites ±0 18m 19s ⏱️ - 2m 18s Results for commit 563afa3. ± Comparison against base commit 214ba1b. This pull request removes 266 and adds 2 tests. Note that renamed tests count towards both. |
Root-causes the 2-core CI flake family that's been reddening branch runs (MeshNodeCompilation, OrleansDynamicCompilation, NodeTypeReleaseGate, FrameworkStale, SearchQueryTests). NOT the remembered wall-clock/base-Full model (that mechanism no longer exists — memory corrected); reproduced and pinned the real owner-side races. 5/5 full-suite iterations green @2 cores; Orleans 122/122, Query 342/342, Data 273/273, solution Release -warnaserror clean.
🤖 Generated with Claude Code