Skip to content

Release: actors, crypto/RNG/SSL helpers, command dispatcher, file watcher#11

Merged
tgiachi merged 24 commits into
mainfrom
develop
Jun 28, 2026
Merged

Release: actors, crypto/RNG/SSL helpers, command dispatcher, file watcher#11
tgiachi merged 24 commits into
mainfrom
develop

Conversation

@tgiachi

@tgiachi tgiachi commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Release scope (develop → main)

New modules & features

  • SquidStd.Actors — actor/mailbox primitive over TPL Dataflow: FIFO single-consumer processing, TellAsync / typed AskAsync, configurable overflow (Wait/DropNewest/Unbounded) and error (Isolate/StopOnError) policies, drain-on-dispose with pending-request faulting, EventBus→mailbox adapter.
  • Command dispatcherICommandDispatcher<TContext> with fan-out, fault isolation, dispatch result, DI-native handler auto-subscription, and seeded dispatch (ISeededCommandDispatcher<TContext,TSeed>); parameterless context factory dropped in favor of explicit/seeded.
  • Core helpersCryptoUtils (AES-GCM) + EncryptString/Base64 extensions, SslUtils (PEM/PFX), BuiltInRng/RandomUtils/RandomExtensions, FileWatcherService, ObjectPool<T>.

Maintenance

  • Converted remaining extensions to C# 14 extension members.
  • Configured ReSharper member layout (Dispose last) and applied jb cleanup across the solution.
  • Bumped YamlDotNet to 18.1.0.

No breaking changes. Full suite green (801 tests). Merge (not squash) to trigger semantic-release + NuGet publish.

tgiachi added 24 commits June 26, 2026 20:06
- feat(core): add FileWatcherService/IFileWatcherService — recursive, debounced, multi-directory watcher with per-directory glob filter that publishes FileChangedEvent on the event bus
- feat(core): add FileChangedEvent (IEvent) under Data.Files and FileChangeKind enum under Types.Files
- feat(core): add ObjectPool<T> — thread-safe non-blocking factory-based pool with bounded retention, optional reset, and IDisposable cleanup
- test(core): cover object pool reuse/reset/overflow/dispose and file watcher create, glob filter, multi-directory, nested subdirectory, debounce, and post-dispose behavior
- docs(core): document FileWatcherService and ObjectPool in the Core README (features, usage, key types)
- feat(services-core): register IFileWatcherService as an event-bus-backed singleton with optional debounce; opt-in, not part of RegisterCoreServices
- test(services-core): cover singleton resolution and that core services do not register the watcher by default
- docs(core): note the DI registration helper in the Core README
- refactor: migrate all classic `this`-parameter extension methods to `extension(...)` member blocks for consistency with the new convention
- refactor(abstractions): convert container/service/event-listener registration extensions
- refactor(core): convert string, env, directories, and log-level extensions
- refactor(services-core): convert log rolling-interval extension
- refactor(caching/messaging/mail/storage/search/database/telemetry/templating/persistence/workers/network/scripting): convert DI registration and helper extensions, keeping non-extension static helpers (ParseOptions, CreateClient, Provider<T>) outside the blocks
- refactor: use generic-receiver `extension<T>(...)` form for IQueryable and IReadOnlyList extensions
- feat(core): add ICommandContextFactory<TContext,TSeed> and ISeededCommandDispatcher<TContext,TSeed> contracts
- feat(services-core): add SeededCommandDispatcher building the context from a seed (e.g. the originating connection) over the existing dispatcher
- feat(services-core): add RegisterSeededCommandDispatcher DI extension
- test(services-core): cover seed-built context dispatch and DI resolution
- docs: document network-driven seeded dispatch in the Services.Core README
…plicit and seeded dispatch

Remove the redundant ICommandContextFactory<TContext> (arity-1) and the
context-less DispatchAsync<TCommand>(command) overload. In multi-session
servers a parameterless Create() cannot know which session a command belongs
to, making it a footgun. Callers now pass the context explicitly via
DispatchAsync(command, context) or build it from a seed through
ISeededCommandDispatcher<TContext, TSeed>.

- Delete ICommandContextFactory.cs (arity-1) and its RegisterCommandContextFactory extension
- Simplify CommandDispatcher to a single ctor and register it directly as a singleton
- Drop the context-less interface overload and implementation
- Update samples, tests, and Core/Services.Core READMEs accordingly
Port the recurring foundation helpers from the server projects into SquidStd.Core
as generic, domain-free primitives.

- CryptoUtils: AES-GCM authenticated encrypt/decrypt with key generation
- Base64Extensions: string/byte base64 helpers and validation
- EncryptString/DecryptString string convenience extensions over CryptoUtils
- SslUtils: load X.509 certificates from PEM or PFX for TLS endpoints
- BuiltInRng: seedable ambient RNG for reproducible sequences
- RandomUtils: dice and coin-flip mechanics
- RandomExtensions: Shuffle/RandomElement/RandomSample over arrays and lists
- Cover all helpers with tests; RNG tests serialized via a shared collection

Uses authenticated AES-GCM instead of the legacy AES-CBC, and excludes
domain-specific helpers (e.g. UO hue tables) from the standard library.
Add SquidStd.Actors: actor/mailbox primitive over TPL Dataflow ActionBlock
with FIFO single-consumer processing, TellAsync/AskAsync, configurable
overflow and error policies, drain-on-dispose, and an EventBus adapter.
…cleanup

Add SquidStd.slnx.DotSettings with a custom C# file layout that enforces the
project conventions: private readonly fields, then properties, then the
constructor, then methods, with Dispose/DisposeAsync always placed last, and
nested types at the bottom. Also define a 'SquidStd' cleanup profile limited to
reformatting and member reordering (no body-style rewrites).

Apply the profile across the solution: members are reordered to the convention
(notably moving Dispose to the end where it was declared earlier) and whitespace
is normalized. No behavior change; full suite stays green (801 tests).
@github-advanced-security

Copy link
Copy Markdown
Contributor

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@github-advanced-security github-advanced-security AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@tgiachi
tgiachi merged commit c76af71 into main Jun 28, 2026
3 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.

2 participants