analysis: last_seen_at cannot mean what control 4c claimed it meant - #443
Merged
Conversation
Control 4c selected on `last_seen_at = first_seen_at AND
first_provider_detected_at IS NULL` and labelled the result
"single-launch, not activated" — i.e. installs that never came back.
That conjunct is TAUTOLOGICAL and the label is a claim this table cannot
support. `last_seen_at` advances only on an upsert; an upsert happens only on a
send; and the client sends exactly twice ever, both latched in UserDefaults
(trap 3). So a non-activated install sends ONCE and its `last_seen_at` is
frozen at install time forever. An install that relaunched a hundred times and
never found a CLI is byte-identical to one deleted within the hour.
Verified both ways before changing anything:
* code — `AnonymousInstallTelemetry` has no third send path
* production, read-only — `where first_provider_detected_at is null` = 2,
same predicate AND `last_seen_at = first_seen_at` = 2 (identical, so the
conjunct selects nothing), and `where last_seen_at <> first_seen_at` = 0
across the entire table
The verdict 4c reached (AMBIGUOUS) was right. Its stated reason was not, which
is the worse failure: a reader would have acted on "never relaunched".
WHY THE FILE'S OWN LIVENESS CHECK MISSED IT
Section 4e feeds synthetic rows through the same predicates and asserts each
control matches >= 1. It passed. Two of its four synthetic rows carry
`last_seen_at = now()` with a NULL `first_provider_detected_at` — a shape
production CANNOT emit. The control "discriminated" only against rows reality
does not produce. Those rows are kept (4a and 4b need them) but are now
labelled as deliberately illegal shapes.
Changes:
* trap 4 -> FIVE TRAPS; trap 5 states the freeze, the tautology it implies,
and that `prune_anonymous_installs()`' 400-day window is therefore "400
days since install" for non-activated rows.
* 4c: inert conjunct dropped, retitled "not activated", caveat column added.
* 4f: NEW tautology guard that runs against the LIVE table rather than
synthetic rows — does adding the conjunct change what is selected? It also
flips to a loud warning the moment any row re-sends, so trap 5 cannot go
stale silently.
4f's own negative control (synthetic populations, read-only) found a flaw in
4f: a three-armed verdict whose `UNEXPECTED` arm is UNREACHABLE BY
CONSTRUCTION, since a conjunct that filters anything implies a re-sent row and
the first arm always wins. A branch that can never fire is the mirror of the
tautology being fixed, so it is gone. Guard now has two arms and both were
observed firing on synthetic input.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The defect
Control 4c selected on
last_seen_at = first_seen_at AND first_provider_detected_at IS NULLand labelled the result "single-launch, not activated" — i.e. installs that never came back.That conjunct is tautological, and the label is a claim this table cannot support.
last_seen_atadvances only on an upsert; an upsert happens only on a send; and the client sends exactly twice ever (install, thenfirst_provider_detected), both latched in UserDefaults (trap 3). So a non-activated install sends once and itslast_seen_atis frozen at install time forever.Verified both ways before changing anything
AnonymousInstallTelemetryhas no third send path.where first_provider_detected_at is nulland last_seen_at = first_seen_atwhere last_seen_at <> first_seen_atThe verdict 4c reached (AMBIGUOUS) was right. Its stated reason was not — which is the worse failure, because a reader would have acted on "never relaunched".
Why the file's own liveness check missed it
Section 4e feeds synthetic rows through the same predicates and asserts each control matches ≥ 1. It passed. Two of its four synthetic rows carry
last_seen_at = now()with a NULLfirst_provider_detected_at— a shape production cannot emit. The control "discriminated" only against rows reality does not produce.Those rows are kept (4a and 4b need them) but are now labelled as deliberately illegal shapes, with a note: never add a control whose only negative examples are impossible.
Changes
prune_anonymous_installs()'s 400-day window is therefore "400 days since install" for non-activated rows.not activated, explicit caveat column that relaunch behaviour is not observable.The guard's own negative control found a flaw in the guard
Fed synthetic populations, 4f's first draft had a three-armed verdict whose
UNEXPECTEDarm is unreachable by construction — a conjunct that filters anything implies a re-sent row, so the first arm always wins:INERT as expected✓CLIENT NOW RE-SENDS✓CLIENT NOW RE-SENDS← neverUNEXPECTEDA branch that can never fire is the mirror image of the tautology being fixed, so it's gone. The guard now has two arms and both were observed firing.
Read-only throughout: no migration, no schema change, no writes.
🤖 Generated with Claude Code