Skip to content

Remove SnapshotGate from JasperFx (closes #310)#314

Merged
jeremydmiller merged 1 commit into
mainfrom
claude/hopeful-euler-da825c
May 19, 2026
Merged

Remove SnapshotGate from JasperFx (closes #310)#314
jeremydmiller merged 1 commit into
mainfrom
claude/hopeful-euler-da825c

Conversation

@jeremydmiller
Copy link
Copy Markdown
Member

Summary

  • Deletes SnapshotGate / SnapshotFingerprint / SnapshotVerdict from src/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.
  • Strips the SnapshotGate.ComputeHash / Verify exercise from src/JasperFx.AotSmoke/Program.cs. AotSmoke retains its Event.For<T> and post-rebase CritterStackDefaults / AddJasperFx coverage (the CritterStackDefaults [RequiresUnreferencedCode] blocks IsAotCompatible consumers even when JasperFx.SourceGeneration is wired #312 regression guard added on main while this branch was in flight).
  • Removes the three SnapshotGate references from docs/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 errors
  • dotnet test src/CodegenTests/CodegenTests.csproj — 339/339 passing on net9.0 and net10.0
  • dotnet 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
  • CI green (full build.sh test pipeline)

🤖 Generated with Claude Code

…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>
@jeremydmiller jeremydmiller merged commit 0e84ea8 into main May 19, 2026
1 check 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.

1 participant