yeah that seems correct – inputA and inputB must be separate txs, or you entail a hash cycle.
interestingly, for this case, you can do both sides with (a variant of txhash), by doing a constraint check that they both have the same txid and the correct vout…
e.g.
input 0: GETTXIDOFINPUT(0) == GETTXIDOFINPUT(1) && GETCURRENTINDEX == 0 input 1: GETTXIDOFINPUT(0) == GETTXIDOFINPUT(1) && GETCURRENTINDEX == 1
where txid is known to have two outputs (or else do some other checks).
I’m not sure this is relevant, or even interesting, since there’s marginal difference between two inputs that must be spent together from the same tx, and one input that contains the value for both(, or can be split in two after some delay, optionally).