Skip to content

feat: absorb 6 kernel-surface files from Modules/Core - #8

Open
smuchow1962 wants to merge 1 commit into
mainfrom
feat/absorb-core-kernel-surface
Open

feat: absorb 6 kernel-surface files from Modules/Core#8
smuchow1962 wants to merge 1 commit into
mainfrom
feat/absorb-core-kernel-surface

Conversation

@smuchow1962

Copy link
Copy Markdown
Contributor

Summary

Modules/Core's test project cannot compile because 11 files exist only in
Core, not in Herald.OSS, and the test project references Herald.OSS (not
Core's own assembly) to avoid a version collision. This PR moves the 6 of
those 11 files that carry no licensing gate and no naming collision into
Herald.OSS, so Core's test project can pick them up through the reference it
already has.

  • Adds FlightRecorderCommunityShape, PipelineCapabilityMatrix,
    PipelineEditionValidator, PipelineManifestReader (Configuration), and
    IStructuredOnlySink, MaterializingKernelSink (Pipeline/Kernel).
  • Adds the 5 corresponding test files, trimmed and fixed to run standalone
    in an OSS-only test process (no Pro/Enterprise plugin loaded).
  • Adds a new MaterializingKernelSinkTests.cs written against OSS's own
    SpyLogger test double, instead of importing Core's 636-line
    KernelPipelineTests.cs wholesale — that file mixes general kernel
    coverage OSS already tests under its own file layout with the 2
    MaterializingKernelSink tests this PR actually needs.
  • Adds the 11 .mmpform dashboard config-form manifests these types read
    at runtime for OSS's own Community-tier pipeline steps.

Real defects surfaced / Follow-ups

  • FlightRecorderCommunityShapeTests expected InvalidOperationException;
    OSS's HeraldEditionGate throws the more specific
    HeraldEditionRequirementException
    (not a subclass — direct
    Exception). Fixed the test to expect the type OSS actually throws.
  • Manifest container headers used Core's internal/technical step names
    ("Post-Filtering (NLog PostFilteringWrapper equivalent)") while OSS's own
    PipelineStep definitions carry plain-language DisplayNames ("Filter on
    Message Text"). Prefixed each of the 10 Community-tier manifest headers
    with OSS's own display name so the dashboard label check passes and the
    copy matches what OSS actually calls the step.
  • One assertion in Catalog_includes_every_matrix_entry was
    order-dependent.
    PipelineCapabilityMatrix.All caches a
    FrozenDictionary at first touch, while PipelineStep.AllNames (and so
    PipelineCatalog.Build()) stays live. Other test classes in this
    assembly (PipelineStepCapabilityTests, DetourCSurfaceFillInTests)
    already call PipelineStep.Register(...), and depending on run order
    those registrations can land after the matrix cache warms up. The
    assertion checked that the catalog and matrix counts matched; loosened it
    to the subset check the test actually needs (every matrix entry has a
    catalog entry) — that invariant holds regardless of ordering. This is a
    pre-existing characteristic of
    PipelineCapabilityMatrix's caching design, not something this PR
    changes; flagging for whoever owns that type next.
  • Not moved: QuickLogBuilder.With.cs, SinkRegistry.cs, SinkInfo.cs,
    SinkNameValidator.cs, NetworkSinkNameAssigner.cs — the remaining 5 of
    the 11 Core-only files. Together they implement a "named sink" feature.
    Core's WithConsoleSink/WithFileSink/WithHttpJsonSink add a 3rd
    name parameter that OSS's existing Sinks.cs/NetworkSinks.cs
    overloads don't have — moving them as-is produces ambiguous-overload
    errors against OSS's 2-param overloads once a caller omits the optional
    tail. The feature also touches already-diverged shared files
    (QuickLogResult.cs: 856 diff lines against Core's copy,
    QuickLogBuilder.cs: 186, PipelineBuildResult.cs: 13,
    SinkRuntimeOverrideSet.cs: 170), and something in Core's own reference
    graph — not its plain OSS source tree — already supplies these members to
    Core's test project. That needs investigating before a real port; it
    isn't a mechanical file move. Filing as a follow-up rather than guessing.

Test plan

  • dotnet build tests/Herald.OSS.Tests.csproj -c Release -f net8.0/net9.0/net10.0 — all three green, 0 errors, same 3 pre-existing warnings on each TFM as before this PR.
  • dotnet test tests/Herald.OSS.Tests.csproj -c Release -f net10.0 — 1606 passed, 1 skipped, 0 failed (baseline: 1541 passed, 1 skipped).
  • dotnet test tests/Herald.OSS.Tests.csproj -c Release -f net9.0 — 1606 passed, 1 skipped, 0 failed (baseline: 1541 passed, 1 skipped).
  • dotnet test tests/Herald.OSS.Tests.csproj -c Release -f net8.0 — 1601 passed, 1 skipped, 0 failed (baseline: 1536 passed, 1 skipped — net8 omits 5 tests present on net9/net10, consistent with the baseline gap).
  • Reran net10.0 and net9.0 three additional times each to rule out flakiness on the newly-added/edited tests specifically — all clean. One transient failure was observed once each on net8.0 and net9.0 during this work, in tests unrelated to this PR's changes; it did not reproduce on rerun and is consistent with this repo's already-tracked test-isolation-flakes note.
  • Not covered: the 5 not-moved files above have no test coverage change here — they stay wherever Core's follow-up lands them.

Verified per TFM

Run net8.0 net9.0 net10.0
Full suite, this PR ✅ 1601 passed, 0 failed ✅ 1606 passed, 0 failed ✅ 1606 passed, 0 failed
Baseline before this PR 1536 passed, 0 failed 1541 passed, 0 failed 1541 passed, 0 failed
Full test-suite results — net10.0
Passed!  - Failed:     0, Passed:  1606, Skipped:     1, Total:  1607, Duration: 18-33 s - Herald.OSS.Tests.dll (net10.0)
Full test-suite results — net9.0
Passed!  - Failed:     0, Passed:  1606, Skipped:     1, Total:  1607, Duration: 18-25 s - Herald.OSS.Tests.dll (net9.0)
Full test-suite results — net8.0
Passed!  - Failed:     0, Passed:  1601, Skipped:     1, Total:  1602, Duration: 17-18 s - Herald.OSS.Tests.dll (net8.0)

Addendum: blast radius

  • Touches PipelineCatalog.cs (one comment edit only — no behavior
    change): the doc comment said OSS "intentionally omits" the matrix shape;
    it no longer does, so the comment now says the matrix lives here but
    PipelineCatalog still deliberately keeps its own hand-maintained cost
    numbers instead of consuming it.
  • New embedded resources (manifests/pipeline/*.mmpform, 11 files):
    OSS's own Herald.OSS.csproj already had a conditional
    EmbeddedResource Include="manifests\pipeline\*.mmpform" wired in,
    unused until this PR populates the directory — this was an anticipated
    seam, not new plumbing.
  • No existing public type's signature changes. Every added type is new;
    nothing already shipped in Herald.OSS moves or changes shape.
  • Merge order: this PR merges before
    mmpworks/Herald.Core#refactor/drop-absorbed-kernel-surface (companion
    PR). Core's test project references Herald.OSS by sibling ProjectReference
    when present, falling back to the published Herald.OSS NuGet package
    (currently pinned at 0.12.11 in the umbrella's Directory.Packages.props)
    otherwise. Until this PR merges and a new Herald.OSS version ships, the
    Core PR's test-file removal has nothing to fall back on for a
    from-scratch clone that restores the package instead of building the
    sibling project. No HeraldCoreVersion or Directory.Packages.props
    pin needs to move for the PAIR to be internally consistent (both repos
    build via the sibling ProjectReference today, in this same umbrella
    checkout) — but the next Herald.OSS NuGet release should include this
    change before anyone rebuilds Modules/Core from a package-only
    restore.

AI-assisted: written with Claude (Max, build/licensing steward persona) via Claude Code, directed and reviewed by Steve.

Core owns 6 non-licensing files Herald.OSS lacked: the Community-tier
FlightRecorder edition gate, the pipeline capability matrix, the
edition validator, the manifest reader for dashboard config forms, and
two kernel-adapter types (IStructuredOnlySink, MaterializingKernelSink).
Core's test project cannot compile without PipelineCapabilityMatrix
because it references Herald.OSS, not its own assembly, to avoid a
CS0012 collision with the Pro/Enterprise package pin.

Brings the 5 corresponding test files, the 21 .mmpform dashboard-form
manifests PipelineManifestReader reads (11 apply to OSS's own
Community-tier steps; 5 paid-tier manifests are left out since no OSS
capability ever registers under those names), and a new
MaterializingKernelSinkTests.cs written against OSS's own SpyLogger
instead of importing Core's KernelPipelineTests.cs wholesale (that
636-line file mixes general kernel coverage OSS already tests under
its own file layout with the 2 MaterializingKernelSink tests actually
needed here).

Test fixes required to port cleanly:
- Trimmed 5 paid-tier step names (audit, circuitBreaker, durableBuffer,
  fallback, retry) from PipelineCatalogTests' InlineData: those steps
  register from Herald.Enterprise/Compliance at plugin load time and
  never exist in an OSS-only assembly.
- FlightRecorderCommunityShapeTests expected InvalidOperationException;
  OSS's HeraldEditionGate throws the more specific
  HeraldEditionRequirementException (not a subclass).
- Manifest container headers used Core's internal/technical step names;
  swapped in OSS's own plain-language DisplayName so the dashboard
  label check passes and the copy matches OSS's own naming.
- Loosened one exact-count assertion in Catalog_includes_every_matrix_entry
  to a subset check: PipelineCapabilityMatrix caches a FrozenDictionary
  at first touch while PipelineStep.AllNames stays live, so other test
  classes' PipelineStep.Register(...) calls can land after the cache
  warms, depending on run order. The invariant the test owns (every
  matrix entry has a catalog entry) holds either way.

Verified: net8.0/net9.0/net10.0 all build clean and the full suite
passes (1606/1601 non-skipped depending on TFM, baseline was
1541/1536, 65 net-new).

Not moved (needs Richard's sign-off before touching): QuickLogBuilder.With.cs,
SinkRegistry.cs, SinkInfo.cs, SinkNameValidator.cs, NetworkSinkNameAssigner.cs.
Together these implement a named-sink feature whose QuickLogBuilder
methods overlap Sinks.cs/NetworkSinks.cs by name but not by signature
(Core's copies add a 3rd name parameter) - moving them as-is creates
ambiguous-overload errors against OSS's existing 2-param overloads. The
feature also touches already-diverged shared files (QuickLogResult.cs,
QuickLogBuilder.cs, PipelineBuildResult.cs, SinkRuntimeOverrideSet.cs)
and something in Core's own build graph (not its plain OSS source tree)
already supplies these members for Core's test project, which needs
investigating before a real port - not a mechanical file move.
@smuchow1962

Copy link
Copy Markdown
Contributor Author

Companion PR (merges after this one): https://github.com/mmpworks/Herald.Core/pull/3

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