Repository navigation
refactor(test): split the AI-menu pin so the portal suite stops referencing MeshWeaver.AI - #2340
Conversation
…encing the module Memex.Portal.Shared.Test was the last unparked test project holding a compile-time ProjectReference to src/MeshWeaver.AI — the exact edge #2276 exists to remove. It was there for one file: AiMenuNewThreadTest asserted BOTH the portal's compiled imperative entry AND MeshWeaver.AI's seeded UiContribution nodes in the same test methods. Split along the seam that already existed in the data: the portal's "New thread" entry is Order 0 and every AI seed is Order > 0. Disjoint Order ranges mean the aggregator (which dedupes on (Order, Label, Area) via ImmutableSortedSet) can never collide entries drawn from the two lists, so asserting each half separately proves the same whole contract with neither side referencing the other's assembly. - Memex.Portal.Shared.Test keeps the portal's half: the single compiled entry, its Order 0, the language-neutral glyph, the absent Href, and the /User/{me}/Chat destination. - MeshWeaver.AI.Test gains AiMenuContributionsTest for the seeds' half: Order > 0, the AI context, Href + LabelKey present, and unique keys. Coverage goes UP, not down — the six methods become eight, because the two cross-boundary assertions each split into a per-side one. Drops with the coupling: - the ProjectReference from Memex.Portal.Shared.Test.csproj, - the InternalsVisibleTo("Memex.Portal.Shared.Test") grant on MeshWeaver.AI, which existed solely so that suite could read the internal Seeds list. Verified: both projects build -c Release -warnaserror with 0 Warning(s)/0 Error(s), and both halves run green (3 + 5 tests). No What's New entry: test-only refactor, no user-visible effect. Refs #2276 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Refactors AI menu pinning tests to remove Memex.Portal.Shared.Test’s compile-time ProjectReference to src/MeshWeaver.AI, by splitting assertions between portal-side (compiled “New thread” sentinel) and AI-side (seeded UiContribution navigation entries).
Changes:
- Added
MeshWeaver.AI.Test.AiMenuContributionsTestto pin the seeded navigation contributions (Order > 0, Href/LabelKey present, uniqueness). - Removed
MeshWeaver.AIproject reference fromMemex.Portal.Shared.Testand narrowedAiMenuNewThreadTestto portal-only invariants. - Dropped
InternalsVisibleTo("Memex.Portal.Shared.Test")fromMeshWeaver.AI.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/MeshWeaver.AI.Test/AiMenuContributionsTest.cs | New AI-side test suite asserting the seeded AI menu navigation contributions. |
| test/Memex.Portal.Shared.Test/Memex.Portal.Shared.Test.csproj | Removes the test project’s compile-time dependency on MeshWeaver.AI. |
| test/Memex.Portal.Shared.Test/AiMenuNewThreadTest.cs | Updates portal-side tests to assert only the compiled “New thread” sentinel contract. |
| src/MeshWeaver.AI/InternalsVisibleTo.cs | Removes portal test friend access to MeshWeaver.AI internals. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Test Results (shard 3) 9 files ± 0 9 suites ±0 5m 43s ⏱️ -18s Results for commit ed88b95. ± Comparison against base commit e5ce962. This pull request removes 581 and adds 614 tests. Note that renamed tests count towards both.This pull request removes 2 skipped tests and adds 1 skipped test. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
Test Results (shard 2)3 435 tests - 1 3 435 ✅ - 1 9m 31s ⏱️ ±0s Results for commit ed88b95. ± Comparison against base commit e5ce962. This pull request removes 2 and adds 1 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
Test Results (shard 4)2 172 tests - 30 1 873 ✅ - 31 12m 32s ⏱️ -17s Results for commit ed88b95. ± Comparison against base commit e5ce962. This pull request removes 614 and adds 584 tests. Note that renamed tests count towards both.This pull request removes 1 skipped test and adds 2 skipped tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
Test Results 55 files ±0 55 suites ±0 57m 25s ⏱️ +17s Results for commit ed88b95. ± Comparison against base commit e5ce962. This pull request removes 2 and adds 4 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
Re-running on a current base — the red is not reachable from this diff
Can this diff reach it?The PR touches four files: the AI-menu test in Nothing here is on the path of an Orleans hub-disposal test. Why merge main rather than just assert thatThe branch was 21 commits behind, and among what it lacked is #2335 — "Close the #2013 blocking-bridge residue that recurred today". A test named So: merged — so the merge has not silently reverted anyone's work. 🚨 To be explicit about what this is not: I am not re-running to see whether it passes this time. The base changed, and it changed in a way that plausibly bears on the failing test. If it reds again on the new base, that is a different and much more interesting signal, and I will treat it as one. |
Closes the last unparked test project holding a compile-time
ProjectReferencetosrc/MeshWeaver.AI— the exact edge #2276 exists to remove.Why it was there
Memex.Portal.Shared.Testreferenced the module for one file.AiMenuNewThreadTestasserted both halves of the AI (✨) menu in the same test methods:MemexConfiguration.AiMenuItems— the "New thread" click-action sentinel), andMeshWeaver.AI's seededUiContributionnodes (Threads / Models / Tiers / Providers / Agents / Skills).Three of its six methods spanned the boundary, which is what forced the reference — and an
InternalsVisibleTo("Memex.Portal.Shared.Test")grant on the module so the suite could read the internalSeedslist.The seam already existed in the data
The portal's imperative entry is Order 0; every AI seed is Order > 0. The menu aggregator dedupes on
(Order, Label, Area)viaImmutableSortedSet, so entries drawn from disjoint Order ranges can never collide. That makes the split lossless: each side asserts its own half plus its half of the ordering invariant, and the whole contract still follows — with neither test referencing the other's assembly.Memex.Portal.Shared.TestHref(it stays imperative); the/User/{me}/ChatdestinationMeshWeaver.AI.Test(newAiMenuContributionsTest)AIcontext;Href+LabelKeypresent; unique keysCoverage goes up, not down — six methods become eight, because each cross-boundary assertion splits into a per-side one.
Also dropped, with the coupling
ProjectReferenceinMemex.Portal.Shared.Test.csprojInternalsVisibleTo("Memex.Portal.Shared.Test")onMeshWeaver.AI— it existed solely for this suiteVerification
dotnet build -c Release -p:CIRun=true -warnaserroron both projects:0 Warning(s),0 Error(s)No What's New entry — test-only refactor, no user-visible effect.
Refs #2276
🤖 Generated with Claude Code