Skip to content

analysis: last_seen_at cannot mean what control 4c claimed it meant - #443

Merged
JasonYeYuhe merged 1 commit into
mainfrom
fix-last-seen-at-tautology
Aug 18, 2026
Merged

analysis: last_seen_at cannot mean what control 4c claimed it meant#443
JasonYeYuhe merged 1 commit into
mainfrom
fix-last-seen-at-tautology

Conversation

@JasonYeYuhe

Copy link
Copy Markdown
Collaborator

The defect

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 (install, then first_provider_detected), 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

  • CodeAnonymousInstallTelemetry has no third send path.
  • Production, read-only:
query result
where first_provider_detected_at is null 2
and last_seen_at = first_seen_at 2 ← identical, so the conjunct selects nothing
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, 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 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, with a note: never add a control whose only negative examples are impossible.

Changes

  • trap 4 → FIVE TRAPS. Trap 5 states the freeze, the tautology it implies, and that prune_anonymous_installs()'s 400-day window is therefore "400 days since install" for non-activated rows.
  • 4c — inert conjunct dropped, retitled not activated, explicit caveat column that relaunch behaviour is not observable.
  • 4f — new tautology guard, run 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 if the client ever changes.

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 UNEXPECTED arm is unreachable by construction — a conjunct that filters anything implies a re-sent row, so the first arm always wins:

population verdict reached
today's shape INERT as expected
client re-sends CLIENT NOW RE-SENDS
conjunct filters CLIENT NOW RE-SENDS ← never UNEXPECTED

A 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

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>
Copilot AI lite review requested due to automatic review settings August 18, 2026 03:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@JasonYeYuhe
JasonYeYuhe merged commit 9a7806a into main Aug 18, 2026
21 checks passed
@JasonYeYuhe
JasonYeYuhe deleted the fix-last-seen-at-tautology branch August 18, 2026 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants