Skip to content

Bugfix/legacy facade dual state and v0.3.0 - #175

Merged
wpak-ai merged 2 commits into
cppalliance:mainfrom
jonathanMLDev:bugfix/legacy-facade-dual-state-and-v0.3.0
Jun 23, 2026
Merged

Bugfix/legacy facade dual state and v0.3.0#175
wpak-ai merged 2 commits into
cppalliance:mainfrom
jonathanMLDev:bugfix/legacy-facade-dual-state-and-v0.3.0

Conversation

@jonathanMLDev

@jonathanMLDev jonathanMLDev commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes silent dual-state between legacy module facades and explicit ServerContext setup, and starts the legacy facade deprecation window on v0.3.0.

#Issue 170: Dual-state fix

  • Adds facadeSupersededBy tracking and installExplicitServerContext() so setupCoreServer({ context }) / setupAllianceServer({ context }) on a non-default context invalidates legacy facades.
  • getDefaultServerContext() throws with migration guidance when facades are superseded (no silent divergence between getPineconeClient() and ctx.getClient()).
  • Client migration on the legacy { config } setup path stays in resolveSetupContext().
  • Adds resolveDefaultServerContext() for internal/setup paths so deprecation warnings are not duplicated.

Issue 171: v0.3.0 deprecation publish

  • Pins deprecation window: deprecated 0.3.0, earliest removal 0.5.0 in docs/deprecation-policy.md, docs/MIGRATION.md, and @deprecated JSDoc across all 17 facade symbols.
  • Moves accumulated [Unreleased] CHANGELOG content into ## [0.3.0].
  • Adds opt-in runtime warnings via PINECONE_DEPRECATION_WARNINGS=1 or DEBUG log level (once per symbol).
  • Bumps package.json to 0.3.0.

Test plan

  • setPineconeClient()setupCoreServer(config)getPineconeClient() returns same client as default context
  • setPineconeClient()setupCoreServer({ context: isolatedCtx })getPineconeClient() throws with migration guidance
  • setupAllianceServer({ context: isolatedCtx }) → legacy facade call throws
  • Instance-only: createServer + setupCoreServer({ context }) registers tools on passed context
  • teardownServer() after supersede restores legacy facade path
  • PINECONE_DEPRECATION_WARNINGS=1 warns once per symbol; default env produces no warn
  • npm run ci green
  • npm run release:check green
  • npm run docs:link-check green

Release (post-merge)

After merge to main, create GitHub Release v0.3.0 to trigger npm publish via CI (see docs/RELEASING.md).

Related

Summary by CodeRabbit

  • Documentation

    • Clarified deprecation timeline for legacy module-level facades: deprecated in 0.3.0, with removal no earlier than 0.5.0.
    • Updated migration guide with deprecation details.
  • Bug Fixes

    • Legacy module-level facades now emit deprecation warnings (opt-in via PINECONE_DEPRECATION_WARNINGS environment variable or debug logging).
    • Using legacy facades with an explicit ServerContext now throws an error with migration guidance instead of silently diverging.

zho and others added 2 commits June 23, 2026 03:26
…etup context

Add facadeSupersededBy tracking and installExplicitServerContext so mixing
legacy facades with setupCoreServer({ context }) throws instead of silent
dual-state. Keep client migration in resolveSetupContext.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ings

Update deprecation policy and MIGRATION anchors, bump to 0.3.0, move CHANGELOG
Unreleased content, and add PINECONE_DEPRECATION_WARNINGS-gated warn helper.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jonathanMLDev jonathanMLDev self-assigned this Jun 22, 2026
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@jonathanMLDev, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 34 minutes and 8 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f461b74f-4910-40b7-a1b6-f5f40789fe44

📥 Commits

Reviewing files that changed from the base of the PR and between 38b9f84 and 535960e.

📒 Files selected for processing (17)
  • CHANGELOG.md
  • README.md
  • docs/MIGRATION.md
  • docs/deprecation-policy.md
  • examples/alliance/library-embedding-demo.ts
  • package.json
  • src/alliance/setup.ts
  • src/core/server/client-context.ts
  • src/core/server/config-context.ts
  • src/core/server/legacy-facade-warn.test.ts
  • src/core/server/legacy-facade-warn.ts
  • src/core/server/namespaces-cache.ts
  • src/core/server/server-context.legacy-facade.test.ts
  • src/core/server/server-context.ts
  • src/core/server/suggestion-flow.ts
  • src/core/server/url-registry.ts
  • src/core/setup.ts
📝 Walkthrough

Walkthrough

The PR implements the 0.3.0 release, introducing a resolveDefaultServerContext resolver that throws when an explicit ServerContext has been installed via the new installExplicitServerContext helper, and a warnLegacyFacade utility that emits a once-per-symbol opt-in deprecation warning. All legacy module facade functions are wired through both. Docs and version are updated to 0.3.0/0.5.0 timelines.

Changes

Legacy Facade Supersession and 0.3.0 Release

Layer / File(s) Summary
Legacy-facade deprecation warning utility
src/core/server/legacy-facade-warn.ts, src/core/server/legacy-facade-warn.test.ts
warnLegacyFacade(symbol) emits at most one console.error per symbol, gated by PINECONE_DEPRECATION_WARNINGS=1 or DEBUG log level, with a test-only latch-reset helper and Vitest coverage for all three warning modes.
ServerContext supersession guard and resolvers
src/core/server/server-context.ts
Adds facadeSupersededBy module state, LEGACY_FACADE_SUPERSEDED_MESSAGE, refactors getDefaultServerContext to warn+delegate, adds resolveDefaultServerContext that throws when superseded, adds installExplicitServerContext to set/clear the flag, and clears it on teardown/disposal/createServer.
Setup entrypoints wired to new resolvers
src/core/setup.ts, src/alliance/setup.ts
setupCoreServer calls installExplicitServerContext when an explicit context is provided and uses resolveDefaultServerContext for config/fallback paths; setupAllianceServer switches to resolveDefaultServerContext.
All legacy facade modules wired to warn and resolve
src/core/server/client-context.ts, src/core/server/config-context.ts, src/core/server/namespaces-cache.ts, src/core/server/suggestion-flow.ts, src/core/server/url-registry.ts
Each legacy facade function now calls warnLegacyFacade and delegates via resolveDefaultServerContext() instead of getDefaultServerContext(), with JSDoc updated to the 0.3.0/0.5.0 deprecation timeline.
Integration tests for facade supersession
src/core/server/server-context.legacy-facade.test.ts
New Vitest suite covers all supersession scenarios: legacy-then-config, legacy-then-explicit-context throws, setupAllianceServer explicit context, instance-only createServer, createIsolatedContext, and teardown-restore.
0.3.0 release docs and version bump
package.json, CHANGELOG.md, docs/MIGRATION.md, docs/deprecation-policy.md, README.md, examples/alliance/library-embedding-demo.ts
Bumps version to 0.3.0; updates changelog with the 0.3.0 release heading, concrete deprecation window, and Fixed entry; updates migration and deprecation-policy docs to 0.3.0/0.5.0 version targets; refreshes all anchor links to #030-legacy-module-facade-deprecations.

Sequence Diagram(s)

sequenceDiagram
  participant Consumer
  participant setupCoreServer
  participant installExplicitServerContext
  participant resolveDefaultServerContext
  participant LegacyFacade as getPineconeClient

  rect rgba(173, 216, 230, 0.5)
    note over Consumer,LegacyFacade: Legacy-then-explicit-context path (new fail-fast behavior)
    Consumer->>LegacyFacade: setPineconeClient(client)
    LegacyFacade->>resolveDefaultServerContext: resolveDefaultServerContext()
    resolveDefaultServerContext-->>LegacyFacade: default ctx (ok, facadeSupersededBy=null)
    Consumer->>setupCoreServer: setupCoreServer({ context: isolatedCtx })
    setupCoreServer->>installExplicitServerContext: installExplicitServerContext(isolatedCtx)
    installExplicitServerContext->>installExplicitServerContext: set facadeSupersededBy = isolatedCtx
    Consumer->>LegacyFacade: getPineconeClient()
    LegacyFacade->>resolveDefaultServerContext: resolveDefaultServerContext()
    resolveDefaultServerContext-->>LegacyFacade: throws LEGACY_FACADE_SUPERSEDED_MESSAGE
    LegacyFacade-->>Consumer: Error (migration guidance)
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • wpak-ai
  • leostar0412

Poem

🐇 Hop, hop — no more ghost states at play,
The old facade path is walled off today.
One symbol, one warn, then silence the latch,
Explicit context wins — no dual-state mismatch!
From 0.2 to 0.3 the bunny does leap,
With removal at 0.5… that's a promise to keep. 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Bugfix/legacy facade dual state and v0.3.0' clearly summarizes the main changes: addressing dual-state issues between legacy facades and explicit context setup while formalizing the 0.3.0 deprecation window.
Linked Issues check ✅ Passed The PR fully addresses both linked issues #170 and #171: it implements facade supersession tracking to prevent dual-state divergence, pins concrete deprecation versions (0.3.0 deprecation, 0.5.0 removal), adds optional runtime warnings, updates all documentation, and bumps the package version.
Out of Scope Changes check ✅ Passed All code changes are directly related to addressing the linked issues: legacy facade refactoring, deprecation timeline formalization, documentation updates, and version bumping are all within the stated objectives of fixing #170 and #171.
Docstring Coverage ✅ Passed Docstring coverage is 89.66% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 9 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@38b9f84). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/core/server/namespaces-cache.ts 0.00% 4 Missing ⚠️
src/core/server/client-context.ts 66.66% 2 Missing ⚠️
src/core/server/config-context.ts 50.00% 2 Missing ⚠️
src/core/setup.ts 66.66% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #175   +/-   ##
=======================================
  Coverage        ?   87.77%           
=======================================
  Files           ?       41           
  Lines           ?     1710           
  Branches        ?      552           
=======================================
  Hits            ?     1501           
  Misses          ?      209           
  Partials        ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jonathanMLDev

Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@jonathanMLDev

Copy link
Copy Markdown
Collaborator Author

@coderabbitai, full review again. Don't skip

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

@jonathanMLDev Sure! Triggering a full review of PR #175 now — nothing will be skipped.

✅ Action performed

Full review finished.

@leostar0412
leostar0412 requested a review from wpak-ai June 23, 2026 20:04
@wpak-ai
wpak-ai merged commit 7b8df0d into cppalliance:main Jun 23, 2026
12 checks passed
@jonathanMLDev
jonathanMLDev deleted the bugfix/legacy-facade-dual-state-and-v0.3.0 branch July 15, 2026 07: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

3 participants