I am looking for discussion in the literature that properly *formalizes* the heuristic idea that a BV-BRST complex is a model for the "derived critical locus of a function on an $\infty$-Lie algebroid".

The kind of statement that I am after would be in the following style:

Pass to the ambient $\infty$-topos of $\infty$-sheaves on the $\infty$-site of formal duals to commutative cochain dg-algebras in non-positive degree over a field of characteristic 0 (for some topology, which I think won't matter much for the following question): the context of dg-geometry. There is then a derived functor $dgAlg^{op} \to Sh_\infty(dgAlg_-^{op})$ that interprets unbounded dg-algebras as objects in this $\infty$-topos, and this I shall make use of in the following.

In there we should have a canonical morphism

$$ \theta : \mathbb{A}^1 \to \mathbb{L}\Omega^1_K(-) $$

from the line to the $\infty$-sheaf of cotangent complexes, that sends over $A \in dgAlg_-$ an element $a \in Q A \simeq \mathbb{A}^1(A)$ to $d a$, for $Q A$ a cofibrant replacement.

Now consider an $\infty$-Lie algebroid, for instance as a simple standard example the homotopy quotient of a Lie algebra action on an ordinary affine, for which sugestive notation would be $X//\mathfrak{g}$. The dg-algebra corresponding to this dually is the corresponding Chevalley-Eilenberg algebra / BRST complex (in *non-negative* degree). Then a morphism

$$ S : X//\mathfrak{g} \to \mathbb{A}^1 $$

is a $\mathfrak{g}$-invariant "action functional". The composite

$$ d S : X//\mathfrak{g} \stackrel{S}{\to} \mathbb{A}^1 \stackrel{\theta}{\to} \mathbb{L} \Omega^1_K(-) $$

would be its differential. The *derived critical locus* of $S$ ought to be the homotopy fiber $hofib (d S)$ (over the global point given by the 0-forms).

Is the BV-BRST complex in $dgAlg$ of the data $(X, \mathfrak{g}, S)$ a model for $hofib (d S)$ ?

Or do you know writeups of details about statements of a similar flavor?