Inner
工 supplies the sound (gōng → shì shows heavy drift, but the pairing was established in Old Chinese).
工 itself pictures a carpenter's square or measuring tool. Combined with
弋 outside: a fixed measuring standard — exactly what a
式 (formula, pattern, ceremony) is. The inner workman's tool sets the pattern, the outer marker fixes the reference.