What is the upper shriek in Grothendieck duality in the non-proper case?  I'm trying to learn a little about Grothendieck duality. One version of the theorem states that if $f: X \to Y$ is a proper morphism of schemes, then the induced functor on derived categories $f_*: D^+(\mathrm{QCoh}(X)) \to D^+(\mathrm{QCoh}(Y))$ has a right adjoint $f^!$ (and under nice hypotheses, these will preserve the subcategories with coherent cohomology). The existence of an adjoint can be proved via adjoint functor arguments, even without assuming $f$ proper; this was done, e.g., by Neeman. (The point is that a triangulated  functor between nice triangulated categories (or,  stable $\infty$-categories) which preserves coproducts is a left adjoint.) 
However, in trying to identify $f^{!}$, we might want to be able to localize on $X$ and $Y$, and thus deal with the non-proper case. My understanding is that the upper-shriek functor $f^{!}$ there is not supposed to be the right adjoint to $f_{\ast}$: for example, for an open immersion it should be the upper-star $f^*$. 
In the topological version, one can define a $f_{!}$ functor for sheaves (push-forward with compact support) and $f^!$ is the right adjoint to $f_{!}$. Is there any "functorial" way to interpret $f^{!}$ when $f$ is not proper? 
 A: I don't have an answer, but maybe these notes by Lipman help.
From what I understand the upper pling functor $f^!$ is a sort of Frankenstein, definitely for etale maps it's given by ordinary pullback.
More generally for smooth maps you have to tensor with the relative canonical bundle.
The only description I know of is via dualising complexes, but that's perhaps not categorical enough for what you want.
A: Classically, the functor $f^!$ is indeed not a right adjoint in general. Clausen and I have recently found a way to make it a right adjoint in general, by enlarging the category of modules to that of solid modules, and constructing a general $f_!$ functor on solid modules directly. Solid modules are a version of "completed topological modules", but with excellent categorical properties. As an example, for $f: \mathbb A^1 =\mathrm{Spec} \mathbb Z[T]\to \mathrm{Spec}\mathbb Z$, one has
$$
f_! \mathcal O_{\mathbb A^1} = \left[\mathbb Z[T]\to \mathbb Z((T^{-1}))\right],
$$
the idea being that one wants to look at those functions $f\in \mathbb Z[T]$ that vanish to all orders at $\infty$, i.e. lie in the kernel of $\mathbb Z[T]\to \mathbb Z((T^{-1}))$. This kernel is of course trivial, but there's an interesting cokernel, so it gives an interesting functor on the derived level. And it's really necessary to consider $\mathbb Z((T^{-1}))$ not as an abstract $\mathbb Z$-module, but with its topological (or rather condensed) structure. See here for an account of this approach to coherent duality.
(I should say that a version of this is due to Deligne in the appendix to Hartshorne "Residues and Duality", working with pro-coherent sheaves.)
