Owns the adversarial analysis lifecycle.
Subscribes to save/change/close events. Analysis runs on demand (the
adversarial-analyze command) and, when the skepticism dial is :on_save
or :paranoid, on save. Each analysis runs the model off-process and
publishes findings through Minga.Extension.Diagnostics.
Only the latest admitted analysis for a path can publish. Its reply consumes that request's ref, so late or duplicate replies are ignored. A user edit, explicit clear, or buffer close discards both the pending request and any published findings.
The model, dispatch, and editor effects are injectable so the lifecycle can run without an editor process or network call.
Summary
Functions
Analyzes path now. Returns :off when the dial is off, else :ok.
Returns a specification to start this module under a supervisor.
Clears this extension's findings and invalidates pending analysis for path.
Cycles the session skepticism dial and returns the new value.
Types
@type skepticism() :: :off | :manual | :on_save | :paranoid
Functions
@spec analyze(GenServer.server(), String.t(), String.t() | nil) :: :ok | :off
Analyzes path now. Returns :off when the dial is off, else :ok.
Pass content to analyze in-memory buffer text (including unsaved edits);
when nil, the file on disk is read instead.
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec clear(GenServer.server(), String.t()) :: :ok
Clears this extension's findings and invalidates pending analysis for path.
@spec cycle_skepticism(GenServer.server()) :: skepticism()
Cycles the session skepticism dial and returns the new value.
@spec start_link(keyword()) :: GenServer.on_start()