fix: the disabled sweep's shape assertion pinned the pre-E3 payload
CI / lint (push) Successful in 3s
CI / extension-version (push) Successful in 3s
Build images / sign-extension (push) Successful in 5s
Build images / build-ml (push) Successful in 9s
Build images / build-agent (push) Successful in 9s
Build images / build-web (push) Successful in 6s
Build images / smoke-web (push) Skipped
Build images / promote (push) Skipped
CI / frontend-build (push) Successful in 20s
CI / backend-lint-and-test (push) Successful in 32s
CI / integration (push) Successful in 2m3s

My own E2 test asserted `sweep`'s disabled return by exact equality, and E3
added `images_joined` to it — a rule 90 miss on a consumer I wrote an hour
earlier. Every E3 test passed; this was the only failure (1 failed, 1202
passed).

Fixed by extending the assertion, NOT by loosening it to a subset check. The
exactness is the point: a disabled sweep reports a complete zeroed shape
rather than a shorter one, so a caller can read any counter unconditionally,
and this assertion is what notices when a new counter skips that path.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LNXXULQDjVZmbuNa2G9mD9
This commit is contained in:
2026-09-10 11:35:53 -04:00
co-authored by Claude Opus 5
parent 1e45e2c56c
commit ba96ecfb2d
+8 -1
View File
@@ -367,7 +367,14 @@ async def test_the_sweep_is_a_no_op_when_the_switch_is_off(db):
await db.commit() await db.commit()
result = await sweep(db) result = await sweep(db)
assert result == {"enabled": False, "sources": 0, "posts_created": 0} # Exact equality on purpose, not a subset check: a disabled sweep reports a
# COMPLETE zeroed shape rather than a shorter one, so a caller can read any
# counter unconditionally. (Today's caller short-circuits on `enabled`, so
# nothing would KeyError — the point is that it does not HAVE to.) E3 adding
# `images_joined` broke this assertion, which is exactly what it is for.
assert result == {
"enabled": False, "sources": 0, "posts_created": 0, "images_joined": 0,
}
@pytest.mark.asyncio @pytest.mark.asyncio