Skip to content

Consolidate obfuscation, NewtonsoftJson, and All meta-package into ktsu.Essentials#1

Merged
matt-edmondson merged 18 commits into
mainfrom
consolidate-into-essentials
Jul 1, 2026
Merged

Consolidate obfuscation, NewtonsoftJson, and All meta-package into ktsu.Essentials#1
matt-edmondson merged 18 commits into
mainfrom
consolidate-into-essentials

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Makes ktsu.Essentials a faithful superset of ktsu.Abstractions + ktsu.Common (Phase 1 of the consolidation). Also incorporates the repo-wide SDK-naming rename.

What's included

Obfuscation (new capability)

  • IObfuscationProvider interface in the core — reversible obfuscation, explicitly not encryption.
  • 7 implementations: Xor, Caesar, Reverse, BitRotate (byte transforms), Base64, Hex (compose the existing encoders), and Composite (pipelines a chain, deobfuscating in reverse order).
  • Encoder-wrapping obfuscators keep both a parameterless and an encoder-accepting constructor public and register via a DI factory lambda to avoid greedy-constructor selection injecting the wrong encoder.

Serialization

  • Ported the NewtonsoftJson serializer from Common (ktsu.Essentials.SerializationProviders.NewtonsoftJson); pinned Newtonsoft.Json 13.0.4; DiTests updated to expect 4 serialization providers.

Packaging

  • New ktsu.Essentials.All meta-package referencing all 42 provider projects for a one-install experience (IncludeBuildOutput=false; ZLib conditionally excluded from netstandard2.1 since it targets net6.0+). Restores cleanly.

Docs

  • README/CLAUDE/DESCRIPTION/TAGS updated for obfuscation, NewtonsoftJson, the meta-package, and the composition model (configuration = persistence + serialization; obfuscation composes encoding).

Design docs under docs/superpowers/ (spec + implementation plan).

Taxonomy decision

Higher-level concerns compose primitives rather than duplicating them:

  • Configuration is not a separate provider family — it's IPersistenceProvider<TKey> over a serializer (persistence already composes serialization). Common's ConfigurationProviders were intentionally not ported.
  • Obfuscation is kept as a distinct intent but implemented by composing IEncodingProvider / simple reversible byte ops.

Verification

  • Full test suite: 288/288 passing.
  • Meta-package restores cleanly.

Known issue (pre-existing, not introduced here)

dotnet pack currently fails repo-wide with NU1510 ("System.Text.Json will not be pruned" promoted to error by ktsu.Sdk 2.x) — confirmed by packing the Json provider alone. This is part of the ongoing SDK 2.x migration and should be resolved before publishing.

Follow-up (separate PR)

Phase 2 — retiring ktsu.Abstractions + ktsu.Common (obsolete interface shims, NuGet deprecations, repo archival, Sync-bot removal) — is deferred until ktsu.Essentials is published, since the shims inherit from the published Essentials types.

🤖 Generated with Claude Code

Rename SerializationProviders/{Json,Toml,Yaml} to flat dotted-name root
folders matching the Semantics convention, drop the AssemblyName/RootNamespace
overrides, and let ktsu.Sdk derive identity from the folder path. Fixes the
PackageId that was frozen to ktsu.SerializationProviders.Json (missing the
Essentials prefix) before the csproj override could apply. Classes renamed to
<Provider>SerializationProvider to avoid namespace/type collisions.
Apply the same fix piloted on the serialization providers to all 38 remaining
provider projects across the 11 other categories. Each provider:
  - moves to a flat dotted-name root folder (Essentials.<Category>.<Provider>),
    matching the Semantics.* convention
  - drops the AssemblyName/RootNamespace overrides so ktsu.Sdk derives identity
    from the folder path (fixes PackageId, which was frozen to the prefix-less
    ktsu.<Category>.<Provider> before the override could apply)
  - gets its own namespace ktsu.Essentials.<Category>.<Provider> and a
    collision-free class name <Provider><Category-singular> (e.g. Gzip ->
    GzipCompressionProvider, SHA256 -> SHA256HashProvider)

The Xor provider's namespace keeps a targeted, namespace-scoped CA1716
suppression (Xor is a reserved keyword) in GlobalSuppressions.cs. Test project,
DI registrations, and type-name assertions updated accordingly.

Build: 0 warnings across all TFMs. Tests: 286/286 passing.
Adds Essentials.SerializationProviders.NewtonsoftJson (ktsu.Sdk naming convention), registers it in test DI, pins Newtonsoft.Json 13.0.4, and updates DiTests to expect 4 serialization providers. Full suite: 288/288 passing.
References all 42 provider implementation projects as package dependencies (IncludeBuildOutput=false, no lib). ZLib is conditionally excluded from netstandard2.1 (it targets net6.0+ only). Restores cleanly. Note: full dotnet pack is currently blocked repo-wide by a pre-existing NU1510 (System.Text.Json pruning warning-as-error), unrelated to this meta-package.
Reconcile the SDK-naming rename (this branch) with main's package-id/ApiCompat
work. Resolution: rename wins (Essentials.<Category>.<Impl> layout and
ktsu.Essentials.* package ids retained); fold in main's fix by adding
<EnablePackageValidation>false</EnablePackageValidation> to every provider
project and the core, and dropping the stale CompatibilitySuppressions.xml
baselines. Full test suite: 288/288 passing.
@sonarqubecloud

sonarqubecloud Bot commented Jul 1, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
55.6% Coverage on New Code (required ≥ 80%)
C Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@matt-edmondson matt-edmondson merged commit 5dfdfda into main Jul 1, 2026
4 of 5 checks passed
@matt-edmondson matt-edmondson deleted the consolidate-into-essentials branch July 1, 2026 03:47
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.

1 participant