2.8 KiB
2.8 KiB
M-SERVICE-01..05 — Owning ServiceHandles, Immutable Snapshots, DAG Lifecycle & ServicePlugin Split
- Wave: Wave 8 (
feat/roadmap-p2-wave8, branched frommainatd83d0f4) - Roadmap reference:
docs/roadmap/modules/Service.md,docs/roadmap/DEPENDENCIES.md(Rule #3,G-HOST)
Scope & Ownership
src/Service/module.cmake:INTERNAL_DEPS Core Functional Time Async LogState,EXCLUDE_HEADERS Void/Service/PluginService.hpp(zero external deps, zeroPlugindependency).src/ServicePlugin/module.cmake:INTERNAL_DEPS Service Plugin LogState,EXTRA_HEADERS Void/Service/PluginService.hpp.include/Void/Service/Types.hpp:kServiceErrorDomain = 22,ServiceErrorCode,make_service_error,ServiceLimits(256 providers, 16 parent levels, 1,024 edges, 64 staged changes, 128 lifecycle requests, 4 retained generations),PublicationEpoch,ExpectedEpoch,ServicePin,ServiceHealth,ServiceObservation,ShutdownReport,IManagedService,ServiceHandle<I>.include/Void/Service/Registry.hpp+src/Service/Registry.cpp:- Preserve 100% of existing
ServiceRegistryAPI (provide<I>,remove<I>,get<I>,require<I>,has<I>,start_all,stop_all,size). - Immutable
SnapshotDataswapped atomically under a short guard; old snapshots, destructors, and observers released/invoked outside locks. start_all()/stop_all()copy retained lifecycle list under short lock and invoke callbacks outside locks.ServiceSnapshotretainingparent_snapshotshared_ptrso child snapshots outlive parent registries;snapshot(),from_parent_snapshot(),refresh_parent().acquire<I>() -> Result<ServiceHandle<I>>returningservice_stoppingwhen closed ormissing_servicewhen absent, pinning generation lifetime until handle drop.ProviderSet(add,add_aliassharing one lifecycle node per object pointer),PreparedPublication,prepare_batch(topological sort + cycle/duplicate/missing-dep/limit validation),start_staged(topological start +abort_start()+ reverse rollback preserving active snapshot),publish(epoch check + retention cap + atomic swap),start,close_and_join(dependent-first stop +incomplete_ownersreporting without freeing live providers),retained_generation_count().
- Preserve 100% of existing
include/Void/Service/PluginService.hpp: preservedPluginServiceBinding<I>+acquire_plugin_service<I>pinning exactPluginHandleviaServicePin.- Tests & consumers:
tests/standalone/Service/ServiceHardening.cpp,tests/package/ServiceOnly/*,tests/package/ServicePluginOnly/*, updatedtests/package/InstalledComponents.cmake.
Verification Criteria
- Standalone
Service;ServicePlugin;TestingRelWithDebInfo-Werror:Service*tests +ctest2/2 (ServiceOnly,ServicePluginOnly). - Full Wave 8 RelWithDebInfo
-Werror, ASan+UBSan-Werror, and Wave 8 TSan.