How to lock vertex to axis during bone rotation? I am very new to bones, and something I haven't been able to figure out is how to constraint vertices to certain axis.

Consider the following:


This is a simple model with some bones I added. Now, See what happens when I rotate the two middle bones:



I have circled where there is an undesirable deformation. What I would like to happen (but for these two bones only) is for the vertices to be constrained along Y. Basically, I want the vertices to slide along the edge, not rotate around the pivot. Everything else about this is fine to me; I just need the vertices along the edge that are connected to these bones to never move inward (or outward for that matter).

What are some ways to accomplish this?
Consider setting the deforming bone option Relation Parent [Inherit Rotation] False as depicted below.  The bone will still be moved by parent movement.



Here a parent bone is rotated.  Parent bone set to [deform] False.  This is an attempt to emulate your images in the question.



Below a bone constraint.



You can restrict bone axis movement.  In general restrict bones rather than vertices.

The default armature automatic weights were accepted.  Weight paint mode below.



The vertex density supports the curved images.