Repository navigation
Description
Summary
Multi-phase initiative to enforce a clean PUBLIC / INTERNAL boundary across Typhon.Engine, Typhon.Protocol, and Typhon.Schema.Definition. Every top-level type gets classified as either:
-
PUBLIC — needed by a consumer that embeds Typhon as a database (exceptions, configuration types,
DatabaseEngine/Transaction/UnitOfWork/TyphonRuntimeparameters, system author base classes, schema attributes). -
INTERNAL — implementation detail (primitives, allocators, WAL records, B+Tree nodes, profiler codecs, etc.). Lives in
Typhon.Engine.Internalsnamespace atinternalaccessibility, enforced by theTYPHON008Roslyn analyzer.
Result: each engine subsystem folder splits into public/ and internals/ subdirectories, with one consumer-facing namespace per assembly and one internal-implementation namespace.
📄 Design doc: PublicVsInternalApiClassification.md — 2026-04-13 original, refreshed 2026-05-09/10. Methodology, classification rules, per-subsystem tables, open-question resolutions, phase-by-phase audit.
Why
-
Discoverability. Consumers shouldn't have to grep 600 types to find the ~180 they're allowed to use.
-
Refactor safety. Internal types can be reshaped without breaking downstream codebases.
-
Compile-time enforcement.
TYPHON008blocks new public types from leaking internal types in their surface — no more drift. -
Namespace clarity. Two namespaces per assembly (
Typhon.Engine/Typhon.Engine.Internals) replace the previous freeform nesting.
What landed (2026-05-10)
-
Phase 2a — Namespace migration. 17 features moved to feature-tree layout under
src/Typhon.Engine/. ~241 file renames (history preserved viagit mv), ~424 internal-namespace type moves, ~181 public-namespace type moves. Types stay at original accessibility during this phase. -
Phase 2b — Accessibility flips. Solution-wide sweep: every type in
*/internals/*.csflipped frompublic→internal. 488 cascade errors resolved iteratively (either flip the leaking member or promote the leaked type back to public when too entangled). -
InternalApiLeakAnalyzer(TYPHON008) live. Dual condition (internal namespace + internal accessibility) — seesrc/Typhon.Analyzers/README.md. -
12 friend assemblies wired via
GlobalUsings.cs(tests, AntHill, Workbench, Shell, etc.). -
Source generators updated —
SourceLocationGenerator+TraceEventGeneratoremit the right namespace + accessibility. -
§10.3 D — durability exception folder split. 5 separate files under
Errors/public/. -
Engine csproj stale
<Compile Update>cleanup. -
5 promotions codified as PUBLIC where doc was wrong (
ClusterSpatialAabb,SystemAccessDescriptor,ProfilerSessionMetadata,TraceRecordBatch,ExporterQueue).
Verification at landing: solution clean, 0 errors, 3833 engine tests pass + 33 skipped. 241 renames detected via git diff -M.
What remains
-
Leak-tightening pass — Foundation/Memory + Foundation/Concurrency cluster. ✅ Done 2026-05-11. Flipped to internal:
IMemoryAllocator,MemoryAllocator,MemoryBlockArray,MemoryBlockBase,PinnedMemoryBlock,DeadlineWatchdog,HighResolutionSharedTimerService,ITimerRegistration.DatabaseEnginector flipped to internal (friends construct viaInternalsVisibleTo, public DI extensions still work). Held PUBLIC:EpochManager(entangled viaIPageStore.EpochManageraccessed by 30+ generic-constrained hot-path callers — flippingIPageStorecascades through all storage/indexing generics),HighResolutionTimerServiceBase(DagSchedulerinheritance),MemoryAllocatorOptions+IMemoryResource(config bag + base list). Storage cluster +ClientConnectionnot in this scope. Engine 3550/3550 + Workbench 266/266 green.Remaining promotions (Storage cluster, deferred per Public/Internal API classification & namespace split #329 scope):
-
DatabaseEnginector — Foundation/Memory (IMemoryAllocator,MemoryAllocator, etc.), Foundation/Concurrency (EpochManager,DeadlineWatchdog, timer services), Storage (PagedMMF,ManagedPagedMMF,ChangeSet,PersistentStore, segments/accessors),Durability (✅ done 2026-05-11 —IWalFileIO)IWalFileIOflipped to internal; engine constructsWalFileIOitself whenDatabaseEngineOptions.Walis set; ctor parameter dropped; AntHill DI registration removed. Engine 3550/3550 green. -
Subscription admin API —✅ done 2026-05-11 —ClientConnectionSetSubscriptions(ClientConnection, …)→SetSubscriptions(ClientContext, …); runtime looks up the connection internally byConnectionId;ClientConnectionflipped to internal. Tests updated. Engine 3550/3550 green. -
Tightening these requires builder/factory façades that hide the internal types from the ctor signatures. Real refactor work, not a one-line flip.
-
-
§10.3 E —
InternalsVisibleTofriend-list audit. ✅ Done 2026-05-11. Mechanical audit dropped the list from 13 to 8: removedTyphon.Shell(redundant — AssemblyName istsh),Typhon.Shell.Extensibility,Typhon.Workbench.Fixtures,Typhon.ARPG.Shell,Typhon.Workbench.Tests(all build clean against the public surface). Engine 3550/3550 + Workbench 266/266 green. -
§3.2 per-feature subfolder split— Won't do (2026-05-11). The flatpublic/+internals/layout is good enough; the proposed subfolder split would be churn without changing the surface. §3.2 is now historical. -
Carveout in
Querying/public/ViewBase.cs. ✅ Done 2026-05-11. PromotedIViewto PUBLIC (the trioViewId/FieldDependencies/IsDisposedis consumer-facing). Reworked the internal delta-buffer contract:ViewRegistry.RegisterView(IView, ViewDeltaRingBuffer, …)now takes the buffer as an explicit parameter instead of exposing it via an interface, so the public surface never referencesViewDeltaRingBuffer. Suppression removed; TYPHON008 analyzer is fully active without carveouts. -
Extend doc coverage to out-of-scope assemblies —
Typhon.Analyzers,Typhon.Client,Typhon.Generators,Typhon.Profiler,Typhon.Shell,Typhon.Shell.Extensibility. Currently the doc only covers Engine + Protocol + Schema.Definition.
Final counts (post-Phase 2b)
| Project | Total | PUBLIC | INTERNAL | %PUBLIC |
|---|---:|---:|---:|---:|
| Typhon.Schema.Definition | ~35 | ~35 | 0 | 100% |
| Typhon.Protocol | 8 | 8 | 0 | 100% |
| Typhon.Engine | ~605 | ~181 | ~424 | 30% |
| Total | ~648 | ~224 | ~424 | 35% |
Out of scope
-
Renaming or re-shaping the public API itself — this initiative classifies and gates, it doesn't redesign.
-
Cross-assembly type moves between
Typhon.Engineand the satellite assemblies — separate cleanup.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
Public/Internal API classification & namespace split (closes Log2n-io…
#1538 SWG economy, and what it found: an ArchetypeAccessor owns no pa…