Remove SnapshotGate from JasperFx (closes #310)#314
Merged
Conversation
…f ever needed (closes #310) Phase 1 of #243 shipped SnapshotGate + SnapshotFingerprint + SnapshotVerdict in src/JasperFx/CodeGeneration/Snapshots/ to give Marten and Wolverine a shared invalidation contract for codegen artifacts. The shared-mechanism premise no longer holds: - Marten exited runtime codegen entirely (marten#4461) and deliberately deleted its Phase 2 MartenSnapshot consumer (marten#4498). Marten's actual cold-start wins came from in-process caching (marten#4307 / #4309 / #4371) plus the source-generator migration, not from snapshot persistence. - Wolverine has not adopted SnapshotGate; runtime codegen there is now opt-in via WolverineFx.RuntimeCompilation. If Wolverine eventually wants a fingerprint mechanism (wolverine#2728), it will live in Wolverine.RuntimeCompilation, not in core JasperFx — the consumer is itself an opt-in dev-time package, so the right home is alongside it. - Phase 3 of #243 (extract ISnapshotArtifact + shared applicator source-generator) is unreachable: the precondition was two converging consumers, and only one remains. Carrying ~177 LoC of dead-from-JasperFx's-POV surface plus an STJ-without- generation-context AOT footnote is not worth the public-stability promise of a log signature that nobody emits. If wolverine#2728 needs an equivalent, reimplement from scratch — it's <200 LoC of pure functions. Changes: - Deleted src/JasperFx/CodeGeneration/Snapshots/ (3 files: SnapshotGate, SnapshotFingerprint, SnapshotVerdict). - Deleted src/CodegenTests/Snapshots/SnapshotGateTests.cs (the entire test directory). - Stripped the SnapshotGate.ComputeHash / Verify section from src/JasperFx.AotSmoke/Program.cs and removed its "intentionally not exercised: SnapshotGate.Read / Write" footnote. AotSmoke now exercises Event.For<T> only — still meaningful as the IsAotCompatible regression guard since the warnings-as-errors promotion catches any new annotation regressions on what remains of the surface. - Removed three references to SnapshotGate from docs/codegen/aot.md (AOT-clean section bullet, annotated section bullet, STJ example). Verification: - src/JasperFx/JasperFx.csproj builds 0 errors (warnings unchanged from pre-removal). - src/CodegenTests passes 339/339 (net9.0 + net10.0). - src/JasperFx.AotSmoke runs clean ("JasperFx AOT smoke OK."). - No remaining grep hits for SnapshotGate / SnapshotFingerprint / SnapshotVerdict / CodeGeneration.Snapshots anywhere outside obj/bin output and unrelated SnapshotLifecycle (projection-lifecycle enum, a different concept). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SnapshotGate/SnapshotFingerprint/SnapshotVerdictfromsrc/JasperFx/CodeGeneration/Snapshots/plus the matching test suite. The shared-mechanism premise of #243 no longer holds: Marten exited runtime codegen entirely (marten#4461 / marten#4498), and Wolverine has not adopted the contract. Decision recorded at #310.SnapshotGate.ComputeHash/Verifyexercise fromsrc/JasperFx.AotSmoke/Program.cs. AotSmoke retains itsEvent.For<T>and post-rebaseCritterStackDefaults/AddJasperFxcoverage (the CritterStackDefaults [RequiresUnreferencedCode] blocks IsAotCompatible consumers even when JasperFx.SourceGeneration is wired #312 regression guard added onmainwhile this branch was in flight).SnapshotGatereferences fromdocs/codegen/aot.md(AOT-clean bullet, annotated bullet, and the STJ-example footnote in "Known limitations").If wolverine#2728 eventually wants a fingerprint mechanism, it reimplements in
Wolverine.RuntimeCompilation— <200 LoC of pure functions, not worth carrying in core JasperFx for one prospective opt-in dev-time consumer.Test plan
dotnet build src/JasperFx/JasperFx.csproj— 0 errorsdotnet test src/CodegenTests/CodegenTests.csproj— 339/339 passing on net9.0 and net10.0dotnet run --project src/JasperFx.AotSmoke --framework net10.0— prints "JasperFx AOT smoke OK."grep -rn "SnapshotGate\|SnapshotFingerprint\|SnapshotVerdict\|CodeGeneration\.Snapshots" src/ docs/— no remaining hits outside obj/bin🤖 Generated with Claude Code