ResourceFromFiberAnalyzerModule

PackageAxial.Guardrails
The `ResourceFromFiber` analyzer: flags a forked flow whose value is a scoped resource it acquired itself. A forked fiber owns the scoped resources it acquires and releases them when it settles, so `Flow.scopeResource r |> Flow.fork` followed by `Fiber.join` hands back a resource that has already been released. The code compiles and reads like ZIO, where a forked fiber shares its parent's `Scope`, so the mistake is easy to make and only shows up as use-after-dispose at runtime. `Flow.forkResource` is the form that keeps the resource. The check is syntactic and narrow: it reports the flow passed to a `fork` variant when that flow is a direct `scopeResource`/`scopeAcquireRelease` call, or a `flow { }` whose final `return`/`return!` hands back such an acquisition. A flow built elsewhere and passed by name is not followed, which only costs a missed finding.

Summary

NameSignatureSynopsis
Operations
headIdentheadIdent exprThe identifier an application chain ultimately applies: fork in Flow.forkNamed "x" body is forkNamed.
pipepipe exprx |> f parses as App(App(op_PipeRight, x), f).
childExprschildExprs exprNo description available.
allExprsInModuleallExprsInModule declsNo description available.
rawRangesrawRanges ctxNo description available.
analyzeanalyze ctxRuns the check without applying guardrail configuration, for tests.
resourceFromFiberAnalyzerresourceFromFiberAnalyzer ctxNo description available.

Operations

kind:member

headIdent

headIdent expr
Member
The identifier an application chain ultimately applies: `fork` in `Flow.forkNamed "x" body` is `forkNamed`.

Parameters

NameTypeDescription
exprSynExpr

Returns

string option
kind:member

pipe

pipe expr
Member
`x |> f` parses as `App(App(op_PipeRight, x), f)`. Returns the piped value and the function it is piped into.

Parameters

NameTypeDescription
exprSynExpr

Returns

(SynExpr * SynExpr) option
kind:member

childExprs

childExprs expr
Member

Parameters

NameTypeDescription
exprSynExpr

Returns

SynExpr list
kind:member

allExprsInModule

allExprsInModule decls
Member

Parameters

NameTypeDescription
declsSynModuleDecl list

Returns

SynExpr list
kind:member

rawRanges

rawRanges ctx
Member

Parameters

NameTypeDescription
ctxCliContext

Returns

range list
kind:member

analyze

analyze ctx
Member
Runs the check without applying guardrail configuration, for tests.

Parameters

NameTypeDescription
ctxCliContext

Returns

Message list
kind:member

resourceFromFiberAnalyzer

resourceFromFiberAnalyzer ctx
Member

Parameters

NameTypeDescription
ctxCliContext

Returns

Async<Message list>