Skip to content

Public/Internal API classification & namespace split (closes #329) - #331

Merged
nockawa merged 5 commits into
mainfrom
feature/public-internal-api-split
May 11, 2026
Merged

nockawa merged 5 commits into
mainfrom
feature/public-internal-api-split

Conversation

@nockawa

@nockawa nockawa commented May 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Implements the multi-phase initiative tracked in #329: enforce a clean PUBLIC / INTERNAL boundary across Typhon.Engine, Typhon.Protocol, and Typhon.Schema.Definition.

Final shape of the engine surface:

  • Two namespaces per assembly: Typhon.Engine (consumer-facing) and Typhon.Engine.Internals (implementation).
  • Each subsystem folder split into public/ and internals/ subdirectories.
  • TYPHON008 Roslyn analyzer enforces the boundary at compile time (dual condition: internal namespace + internal accessibility).

What's in this PR

Phase 2a/2b (earlier commits)

  • 17 features migrated to feature-tree layout under src/Typhon.Engine/.
  • Solution-wide accessibility flip — every type in */internals/*.cs flipped from public -> internal, with cascade fixes resolved either by demoting leaking members or codifying the type as PUBLIC where the doc was wrong.
  • 5 doc-corrected promotions: ClusterSpatialAabb, SystemAccessDescriptor, ProfilerSessionMetadata, TraceRecordBatch, ExporterQueue.

Leak-tightening pass (this branch's main work)

  • §10.3 E - InternalsVisibleTo audit: dropped friend-list from 13 to 8 (removed Typhon.Shell redundant entry, plus Typhon.Shell.Extensibility, Typhon.Workbench.Fixtures, Typhon.ARPG.Shell, Typhon.Workbench.Tests — all build clean against the public surface).
  • IView carveout resolved: promoted IView to PUBLIC, reworked the internal delta-buffer contract so ViewRegistry.RegisterView(IView, ViewDeltaRingBuffer, …) takes the buffer as an explicit parameter. Removed the #pragma warning disable TYPHON008.
  • IWalFileIO hidden: flipped to internal; engine constructs WalFileIO itself when DatabaseEngineOptions.Wal is set; ctor parameter dropped; AntHill DI registration removed. Side fix: collapsed the two-key WAL gate to one (walOptions != null), eliminating a latent benchmark bug.
  • ClientConnection hidden: changed TyphonRuntime.SetSubscriptions signature to take ClientContext instead of ClientConnection; runtime resolves the connection internally by ConnectionId.
  • Foundation/Memory + Concurrency cluster (Activate deadline propagation — replace WaitContext.Null across all call sites #38): flipped 8 types to internal (IMemoryAllocator, MemoryAllocator, MemoryBlockArray, MemoryBlockBase, PinnedMemoryBlock, DeadlineWatchdog, HighResolutionSharedTimerService, ITimerRegistration). DatabaseEngine ctor flipped to internal — friends construct via InternalsVisibleTo, public DI extensions still work.

Held PUBLIC (documented carveouts)

  • EpochManager — exposed via IPageStore.EpochManager accessed by 30+ generic-constrained hot-path callers.
  • HighResolutionTimerServiceBase — DagScheduler inherits it.
  • MemoryAllocatorOptions, IMemoryResource, IPageStore, plus the Storage cluster (PagedMMF, ManagedPagedMMF, ChangeSet, PersistentStore, segments/accessors) — Storage tightening explicitly out of scope per Public/Internal API classification & namespace split #329.

Final counts

Project Total PUBLIC INTERNAL %PUBLIC
Typhon.Engine ~605 ~173 (was ~181) ~432 (was ~424) 29%
Typhon.Schema.Definition ~35 ~35 0 100%
Typhon.Protocol 8 8 0 100%

Verification

  • Solution build clean (0 errors).
  • Engine tests: 3550/3550 pass.
  • Workbench tests: 266/266 pass.
  • TYPHON008 analyzer is fully active with zero suppressions in source.

Design doc

claude/research/PublicVsInternalApiClassification.md — methodology, classification rules, per-subsystem tables, and per-resolution audit notes inlined throughout the doc.

Closes #329.

@nockawa
nockawa merged commit 0f0bcf7 into main May 11, 2026
5 checks passed
@nockawa
nockawa deleted the feature/public-internal-api-split branch May 11, 2026 00:27
@nockawa nockawa self-assigned this May 11, 2026
@nockawa nockawa added refactoring Code refactoring, no behavior change technical-debt Technical debt, cleanup labels May 11, 2026
@nockawa nockawa moved this to Done in Typhon dev May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Code refactoring, no behavior change technical-debt Technical debt, cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Public/Internal API classification & namespace split

1 participant