Skip to content

F# codegen: JSON HTTP path + causation via JasperFx 2.2.4 (GH-2969)#2978

Merged
jeremydmiller merged 1 commit into
mainfrom
feat-2969-fsharp-phase-c-json
May 29, 2026
Merged

F# codegen: JSON HTTP path + causation via JasperFx 2.2.4 (GH-2969)#2978
jeremydmiller merged 1 commit into
mainfrom
feat-2969-fsharp-phase-c-json

Conversation

@jeremydmiller
Copy link
Copy Markdown
Member

Picks up the F# self-identifier fix (jasperfx#393, shipped in JasperFx 2.2.4) and uses it to unblock the inherited-instance-method frames F# couldn't emit before — completing the Wolverine.Http JSON request/response path (Phase C) and message-causation tracking.

Changes

  • Bump JasperFx 2.2.3 → 2.2.4 (JasperFx, .Events, .Events.SourceGenerator, .SourceGenerator; RuntimeCompiler stays on its 5.x line). 2.2.4 emits member this. for generated F# members, so inherited instance calls resolve.
  • WriteJsonFramedo! this.WriteJsonAsync(httpContext, result)
  • ReadJsonBodylet! (body, jsonContinue) = this.ReadJsonAsync<T>(httpContext) + FSharpEmitHelpers.WriteAbortGuard for the no-early-return stop check (the helper is reachable from Wolverine.Http via the existing [InternalsVisibleTo]).
  • RecordMessageCausationFramethis.RecordCauseAndEffect(context, context.Runtime.Observer)
  • Re-enabled the POST/JSON endpoint in the Http F# driver and turned on EnableMessageCausationTracking in the Core driver, so all three frames are compile-gated.

Generated F# (the JSON POST endpoint)

override this.Handle(httpContext: HttpContext) : Task =
    task {
        let! (command, jsonContinue) = this.ReadJsonAsync<CreateThing>(httpContext)
        if jsonContinue = Wolverine.HandlerContinuation.Stop then
            ()
        else
            let thingCreated_response = thingEndpoints.Create(command)
            do! this.WriteJsonAsync(httpContext, thingCreated_response)
    }

Verification

  • Both F# surface gates compile (Core: GET + validation + cascade + saga chains; Http: GET and POST/JSON).
  • fsharp-coverage: Core 25 / 2 / 17 of 44; with Wolverine.Http loaded 28 / 2 / 51 of 81.
  • dotnet build wolverine_fsharp.slnx -c Release + all 4 gate/coverage tests — green.
  • Full dotnet build wolverine.slnx -c Release regression (whole solution on 2.2.4) — 0 warnings, 0 errors.

Part of #2969.

🤖 Generated with Claude Code

…-2969)

Picks up the F# self-identifier fix (#393, shipped in JasperFx 2.2.4)
and uses it to unblock the inherited-instance-method frames that F# couldn't
emit before — completing the Wolverine.Http JSON request/response path (Phase C)
and message-causation tracking.

- Bump JasperFx / .Events / .Events.SourceGenerator / .SourceGenerator
  2.2.3 -> 2.2.4 (RuntimeCompiler stays on its 5.x line). 2.2.4 emits
  `member this.` for generated F# members, so inherited instance calls resolve.
- WriteJsonFrame: `do! this.WriteJsonAsync(httpContext, result)`.
- ReadJsonBody: `let! (body, jsonContinue) = this.ReadJsonAsync<T>(httpContext)`
  followed by FSharpEmitHelpers.WriteAbortGuard for the no-early-return stop
  check (reachable from Wolverine.Http via the existing InternalsVisibleTo).
- RecordMessageCausationFrame: `this.RecordCauseAndEffect(context, context.Runtime.Observer)`.
- Re-enabled the POST/JSON endpoint in the Http F# driver and turned on
  EnableMessageCausationTracking in the Core driver, so all three frames are
  compile-gated.

fsharp-coverage: Core 25 implemented / 2 skipped / 17 remaining of 44;
with Wolverine.Http loaded 28 / 2 / 51 of 81.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jeremydmiller jeremydmiller merged commit 3ebb8df into main May 29, 2026
24 checks passed
This was referenced 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