Skip to content

Polecat IDocumentSession scope priming (GH-3001, Polecat slice)#3004

Merged
jeremydmiller merged 1 commit into
feat-3001-marten-scope-primingfrom
feat-3001-polecat-scope-priming
Jun 1, 2026
Merged

Polecat IDocumentSession scope priming (GH-3001, Polecat slice)#3004
jeremydmiller merged 1 commit into
feat-3001-marten-scope-primingfrom
feat-3001-polecat-scope-priming

Conversation

@jeremydmiller
Copy link
Copy Markdown
Member

The Polecat slice of #3001, mirroring the Marten slice (#3003). When a handler falls back to service location, a service-located Polecat IDocumentSession / IQuerySession now resolves to the same outbox-enrolled session the handler is using — not a separate, un-enrolled one.

How it works (mirror of #3003)

  • ScopedDocumentSessionHolder + PrimeScopedDocumentSessionFrame for Polecat's IDocumentSession, registered via the WolverineOptions.ScopingFrameSources seam (from Marten IDocumentSession scope priming (GH-3001, Marten slice) #3003) in PolecatIntegration.
  • IntegrateWithWolverine decorates Polecat's own IDocumentSession / IQuerySession scoped registrations to prefer the primed session, delegating to Polecat's original factory for non-handler scopes.

No core changes — this slice purely reuses the registry introduced in #3003.

Verification

  • New PolecatTests.service_location_document_session proves one IDocumentSession flows through a service-located object graph (ReferenceEquals, SQL Server).
  • 70 Polecat aggregate/outbox/read-aggregate/service-location tests pass; dotnet build wolverine.slnx -c Release clean.

⚠️ Stacked on #3003

Based on feat-3001-marten-scope-priming (#3003) because it depends on the ScopingFrameSources registry that lives there. Merge #3002#3003 → this, in order, to avoid the registry being absent. Once #3003 merges to main, this PR retargets to main.

Remaining follow-ups

HTTP + gRPC chains; the ancillary-store matrix.

🤖 Generated with Claude Code

Mirrors the Marten slice for Polecat: when a handler falls back to service location,
a service-located Polecat IDocumentSession / IQuerySession now resolves to the SAME
outbox-enrolled session the handler is using, not a separate un-enrolled one.

- ScopedDocumentSessionHolder + PrimeScopedDocumentSessionFrame (Polecat.IDocumentSession),
  registered via the WolverineOptions.ScopingFrameSources seam in PolecatIntegration.
- IntegrateWithWolverine decorates Polecat's IDocumentSession / IQuerySession scoped
  registrations to prefer the primed session, delegating to Polecat's original factory
  for non-handler scopes.

No core changes — purely reuses the ScopingFrameSources registry. New
PolecatTests.service_location_document_session proves one IDocumentSession through a
service-located graph (ReferenceEquals, SQL Server). 70 Polecat aggregate/outbox tests
and wolverine.slnx pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jeremydmiller jeremydmiller merged commit 38c044f into feat-3001-marten-scope-priming Jun 1, 2026
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