ea6731d62c
The per-cell catch-all DROP was reaching position 5 before our ACCEPT (position 6) because apply_all_cell_rules can re-run after ensure_cell_api_dnat, pushing the DNAT ACCEPT below the DROP. Fix: add the API-sync ACCEPT inside apply_cell_rules itself, tagged with the cell's own tag and inserted LAST (= position 1, above the DROP). Since it's part of the cell's rule block it is always in the right position relative to the catch-all DROP, regardless of call order. Also adds _get_cell_api_ip() helper (docker inspect cell-api) so the destination IP is always current, and two new tests that verify both the rule exists and that the insertion order guarantees it wins over DROP. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>