Fix migration hygiene: UTF-8-safe comment strip + rerun-safe index 168
Two pre-existing issues surfaced by Sando's cargo_test gate (audit Run 21/22
artifacts never deployed since prod is at 0.10.6):
- tests/migration_hygiene.rs statements() mixed byte-index iteration with
string slicing (raw[i..i+2]) and pushed bytes as chars, panicking on the
first multibyte char (migration 168 contains '…'). Rewrite with str::find
offsets + push_str so it is UTF-8-safe.
- migration 168 CREATE INDEX lacked IF NOT EXISTS, violating the rerun-safety
convention the hygiene test enforces. Add IF NOT EXISTS. Safe: 168 postdates
0.10.6 and is unapplied on every pipeline tier.
Co-Authored-By
Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Author: Max Johnson <me@maxj.phd> · 2026-07-08 20:01 UTC