Skip to content

Autocomplete.Test drops MeshWeaver.AI — keeping the import that only looks like one - #2410

Merged
rbuergi merged 2 commits into
mainfrom
refactor/autocomplete-drops-ai
Aug 26, 2026
Merged

rbuergi merged 2 commits into
mainfrom
refactor/autocomplete-drops-ai

Conversation

@rbuergi

@rbuergi rbuergi commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Eighth suite cleared for #2276.

Two imports named MeshWeaver.AI, one dependency

file import verdict
UnifiedReferenceAutocompleteProviderTest AI.MarkdownReferenceExtractor real AI type — its one [Theory] moves to AI.Test's existing MarkdownReferenceExtractorTest
AutocompleteMultiSourceTest MeshOperations stays — ships in MeshWeaver.Mesh.Operations while declaring namespace MeshWeaver.AI, a frozen binary contract (#2370)

🚨 The second case is the one that broke main

In #2349 I deleted exactly this kind of import from MeshApiEndpoints.cs as a "phantom". My sweep asked "can this project reach the MeshWeaver.AI assembly?" — it cannot — when the right question is "does any referenced assembly contribute a type to this namespace?". It does, and main stopped compiling. #2408 restores it.

Same shape as FuzzyScorer, opposite intent:

This PR applies the distinction in both directions on the same file set, which is the first time I have got both halves right in one pass.

Dependency

Requires #2408. Without the MeshOperations restoration, Memex.Portal.Shared does not compile and neither project here builds.

Verification

  • both projects -c Release -p:CIRun=true -warnaserror → 0 Error(s)
  • AI.Test MarkdownReferenceExtractorTest: 41/41
  • Autocomplete.Test: 146/146

Refs #2276, #2370

🤖 Generated with Claude Code

rbuergi and others added 2 commits August 26, 2026 19:21
…oes not compile

MAIN IS BROKEN and this is my regression. 48b3e31 (#2349) removed
`using MeshWeaver.AI;` from memex/Memex.Portal.Shared/Api/MeshApiEndpoints.cs as the
"fourth phantom" of a repo-wide sweep. It was not a phantom: line 335 takes a
`Func<MeshOperations, IObservable<string>>`, and MeshOperations is in namespace
MeshWeaver.AI.

Control, on pristine main c753ad2 with no edits:

  error CS0246: The type or namespace name 'MeshOperations' could not be found
  Memex.Portal.Shared → Build FAILED, 1 Error(s)

With the using restored: 0 Error(s).

WHY THE SWEEP WAS WRONG. It classified an import by asking whether the project can reach
the MeshWeaver.AI ASSEMBLY through ProjectReference. Memex.Portal.Shared cannot — and the
import was still load-bearing, because MeshOperations SHIPS in MeshWeaver.Mesh.Operations
while DECLARING namespace MeshWeaver.AI. That namespace is a frozen binary contract
(#2370): a plugin compiled against it would break if it moved, which is exactly why
ec56366 kept it. So the right question is "does any referenced assembly contribute a type
to this namespace", not "can we reach the assembly of the same name".

This is the FuzzyScorer pattern with the opposite intent. FuzzyScorer declaring
MeshWeaver.AI.Completion from MeshWeaver.Data was an accident that manufactured phantom
imports, and #2349 fixed it. MeshOperations declaring MeshWeaver.AI from
MeshWeaver.Mesh.Operations is deliberate and load-bearing. Same shape, and I had documented
the first while failing to recognise the second.

The using is restored WITH the reason it exists, so the next sweep does not delete it again.

🚨 It also merged green, which is its own finding: the required check passed while
Memex.Portal.Shared did not compile. My last verification was a solution build on the
pre-merge branch; nothing rebuilt that project against the merged tree.

Verified: pristine main FAILS, this commit builds Memex.Portal.Shared -c Release
-warnaserror at 0 Error(s).

Refs #2344, #2370

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…reference

Two imports named MeshWeaver.AI, and only ONE was a dependency on the engine.

  UnifiedReferenceAutocompleteProviderTest  AI.MarkdownReferenceExtractor — a real AI type.
                                            Its one Theory moves to AI.Test's existing
                                            MarkdownReferenceExtractorTest.
  AutocompleteMultiSourceTest               MeshOperations — STAYS. The type ships in
                                            MeshWeaver.Mesh.Operations while DECLARING
                                            namespace MeshWeaver.AI, a frozen binary
                                            contract (#2370). The import is load-bearing and
                                            is not an AI-assembly dependency.

🚨 That second case is the one I got wrong in #2349 and broke main with: the sweep asked
"can this project reach the MeshWeaver.AI ASSEMBLY" when the question is "does any
referenced assembly contribute a type to this NAMESPACE". Same shape as FuzzyScorer with the
opposite intent — FuzzyScorer's split was an accident worth fixing, MeshOperations' is
deliberate and must be preserved. Applied correctly here in both directions.

Depends on the MeshOperations restoration (#2408): without it Memex.Portal.Shared does not
compile and neither project builds.

Verified: both projects build -c Release -warnaserror at 0 Error(s); AI.Test
MarkdownReferenceExtractorTest 41/41, Autocomplete.Test 146/146.

No What's New entry: test-only refactor.

Refs #2276, #2370

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 26, 2026 17:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR continues the #2276 extraction work by removing the last real MeshWeaver.AI engine dependency from MeshWeaver.Autocomplete.Test, while preserving the intentionally “AI-looking” MeshWeaver.AI namespace import that actually binds to MeshWeaver.Mesh.Operations (MeshOperations) as a frozen binary contract.

Changes:

  • Removed the MarkdownReferenceExtractor test from MeshWeaver.Autocomplete.Test and moved it into the existing MeshWeaver.AI.Test coverage.
  • Dropped the direct ProjectReference to src/MeshWeaver.AI/MeshWeaver.AI.csproj from MeshWeaver.Autocomplete.Test.
  • Restored/annotated using MeshWeaver.AI; in Memex.Portal.Shared/Api/MeshApiEndpoints.cs to make the MeshOperations dependency explicit and non-“phantom”.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
test/MeshWeaver.Autocomplete.Test/UnifiedReferenceAutocompleteProviderTest.cs Removes the MarkdownReferenceExtractor theory that was the suite’s last true AI-engine dependency.
test/MeshWeaver.Autocomplete.Test/MeshWeaver.Autocomplete.Test.csproj Removes the direct project reference to MeshWeaver.AI, ensuring the test project no longer pulls the AI engine.
test/MeshWeaver.AI.Test/MarkdownReferenceExtractorTest.cs Adds the moved theory to the AI test suite so coverage stays with the shipped AI type.
memex/Memex.Portal.Shared/Api/MeshApiEndpoints.cs Keeps the load-bearing MeshWeaver.AI namespace import for MeshOperations (type provided by MeshWeaver.Mesh.Operations).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@rbuergi
rbuergi enabled auto-merge August 26, 2026 17:47
@github-actions

Copy link
Copy Markdown
Contributor

Test Results (shard 3)

    9 files      9 suites   4m 18s ⏱️
1 952 tests 1 950 ✅ 2 💤 0 ❌
2 522 runs  2 520 ✅ 2 💤 0 ❌

Results for commit 84dc192.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results (shard 5)

    9 files      9 suites   6m 55s ⏱️
1 609 tests 1 608 ✅ 1 💤 0 ❌
1 610 runs  1 609 ✅ 1 💤 0 ❌

Results for commit 84dc192.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results (shard 0)

616 tests   612 ✅  17m 47s ⏱️
  7 suites    4 💤
  7 files      0 ❌

Results for commit 84dc192.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results (shard 2)

2 878 tests   2 775 ✅  8m 1s ⏱️
    9 suites    103 💤
    9 files        0 ❌

Results for commit 84dc192.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results (shard 1)

2 036 tests   1 843 ✅  9m 39s ⏱️
    9 suites    193 💤
    9 files        0 ❌

Results for commit 84dc192.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results (shard 4)

2 195 tests   2 193 ✅  14m 38s ⏱️
   10 suites      2 💤
   10 files        0 ❌

Results for commit 84dc192.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results

    53 files  +    53      53 suites  +53   1h 1m 21s ⏱️ + 1h 1m 21s
11 284 tests +11 284  10 979 ✅ +10 979  305 💤 +305  0 ❌ ±0 
11 857 runs  +11 857  11 552 ✅ +11 552  305 💤 +305  0 ❌ ±0 

Results for commit 84dc192. ± Comparison against base commit c753ad2.

@rbuergi
rbuergi merged commit cd8d42d into main Aug 26, 2026
28 checks passed
@rbuergi
rbuergi deleted the refactor/autocomplete-drops-ai branch August 28, 2026 08:56
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.

2 participants