Skip to content

refactor: trim internal-only exports from the public barrels (#203) - #206

Merged
wpak-ai merged 1 commit into
cppalliance:mainfrom
timon0305:feat/trim-export-surface-203
Jul 10, 2026
Merged

refactor: trim internal-only exports from the public barrels (#203)#206
wpak-ai merged 1 commit into
cppalliance:mainfrom
timon0305:feat/trim-export-surface-203

Conversation

@timon0305

@timon0305 timon0305 commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Shrinks the public export surface (issue #203) to reduce blast radius.

An audit of both barrels (. and ./alliance) classified every export. Most are legitimately public or deprecated-in-window legacy facades that the deprecation policy says can't be removed yet, so this is a conservative trim of the genuinely internal leaks plus a guard so the surface can't grow silently.

  • Removed four internal-only re-exports (the symbols stay in their modules; only the barrel re-export is dropped): trimOptional, createUnconfiguredAllianceContext (core), and the concrete URL generators generatorMailing, generatorSlackCpplang (alliance). None are documented or consumer-facing, and no in-repo importer used them via the barrel (they all import from the direct module path).
  • Kept every deprecated-in-window facade (setPineconeClient, getDefaultServerContext, the registerUrlGenerator family) and all response schemas.
  • Added a snapshot guard test that pins the runtime value-export allow-list for both barrels, so a future internal symbol leaking into a barrel fails CI.
  • Documented the removal in the CHANGELOG (Breaking, library, matching the earlier buildQueryExperimental trim) and MIGRATION.

Verified locally: typecheck and eslint src/ clean, full suite green (342 tests), build passes.

Closes #203.

Summary by CodeRabbit

  • Bug Fixes

    • Tightened the public API so only supported features are exposed, reducing accidental use of internal helpers.
    • Added checks to prevent hidden symbols from reappearing in package exports.
  • Documentation

    • Updated the migration guide with guidance for users affected by the removed exports.
  • Chores

    • Streamlined setup and manual workflow notes to be shorter and easier to follow.

…ance#203)

Remove four internal-only re-exports from the package root and /alliance entry
to shrink the public surface and blast radius: trimOptional,
createUnconfiguredAllianceContext (core), and the concrete URL generators
generatorMailing, generatorSlackCpplang (alliance). The symbols stay in their
modules; only the barrel re-exports are dropped, and no in-repo importer used
them via the barrel. Deprecated-in-window legacy facades are kept.

Add a snapshot guard test that pins the runtime value-export allow-list for both
barrels, so a future internal symbol leaking into a barrel fails CI.

Document the removal in CHANGELOG (Breaking, library) and MIGRATION.
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8c87df13-9b5c-4dd4-b1ca-2e82a3811c1a

📥 Commits

Reviewing files that changed from the base of the PR and between d087a5e and 5c24af1.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • docs/MIGRATION.md
  • src/alliance/index.ts
  • src/core/__tests__/public-exports.test.ts
  • src/core/index.ts

📝 Walkthrough

Walkthrough

This PR trims the public export surface by removing internal-only re-exports (trimOptional, createUnconfiguredAllianceContext, generatorMailing, generatorSlackCpplang) from the core and alliance package barrels, adds a snapshot test to guard runtime exports, and updates CHANGELOG.md and docs/MIGRATION.md accordingly.

Changes

Trim internal-only public export surface

Layer / File(s) Summary
Remove internal exports from barrels
src/core/index.ts, src/alliance/index.ts
Drops createUnconfiguredAllianceContext and trimOptional from core's re-exports; drops generatorMailing and generatorSlackCpplang from alliance's re-exports.
Export-surface snapshot test
src/core/__tests__/public-exports.test.ts
Adds allow-lists for core/alliance public exports, asserts internal symbols are excluded, and checks runtime export keys match the allow-lists exactly.
Changelog and migration docs
CHANGELOG.md, docs/MIGRATION.md
Documents trimmed instructions text and removed re-exports in the changelog, and adds a migration section listing removed symbols with replacement guidance.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: leostar0412, wpak-ai, AuraMindNest

🚥 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 clearly summarizes the main change: trimming internal-only exports from the public barrels.
Linked Issues check ✅ Passed The PR removes internal-only re-exports, adds export-surface tests, and updates docs, matching issue #203's acceptance criteria.
Out of Scope Changes check ✅ Passed The changelog and migration guide updates support the export-surface change and do not appear unrelated to the issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@d087a5e). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #206   +/-   ##
=======================================
  Coverage        ?   83.86%           
=======================================
  Files           ?       45           
  Lines           ?     2306           
  Branches        ?      768           
=======================================
  Hits            ?     1934           
  Misses          ?      372           
  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.

@wpak-ai
wpak-ai merged commit 42fad89 into cppalliance:main Jul 10, 2026
12 checks passed
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.

Trim the public export surface to reduce blast radius

3 participants