Build the shape-preserving residual path of a transformer block before adding attention and normalization.
Required APIdef transformer_residual(x, update):
return x_plus_updateBehaviorThink through the mechanism first if you want the extra reasoning step. It never blocks the editor.
transformer_residual([1, 2], [3, 4])the residual carries the old signal forward
transformer_residual([5, -1], [0, 0])a zero block update is an identity
2 hidden edge tests run after the visible contract passes.
Run Tests to see the contract verdicts here.