The documentation states that \shapemode should reset to 0 at the end
of a paragraph if it is positive, but the following shows otherwise
\catcode`\{=1\catcode`\}=2
\directlua{tex.enableprimitives('',tex.extraprimitives ())}
\shapemode=1
\showthe\shapemode
\quitvmode\par
\showthe\shapemode
\end
I think the fix is a one liner. I attached a patch.