Why this is an issue and not a PR checklist
These checks can only run against a deployed environment, so they outlive the PR
that introduces them. Close this once they've actually been run against prod.
Context: feat/llm-usage-metering (stacked on privacy) authenticates the OpenAI
proxy, meters every model request into llm_usage, and routes both deletion paths
through one eraseLoggedData().
1. Schema + the auth.db -> app.db rename
The shared DB was renamed (db.ts renames a pre-existing auth.db, -wal/-shm
included, on first open). On the prod volume, after rollout:
2. Metering attributes spend to the right key
3. deletePosthogPerson actually works (carried over from #503)
This is the one promise in the privacy policy currently backed by a code comment
saying "verify the endpoint shape against your PostHog version before relying on it".
Both deletion paths now depend on it, and the tests mock it, so nothing verifies it.
4. Deletion semantics end to end
Why this is an issue and not a PR checklist
These checks can only run against a deployed environment, so they outlive the PR
that introduces them. Close this once they've actually been run against prod.
Context:
feat/llm-usage-metering(stacked onprivacy) authenticates the OpenAIproxy, meters every model request into
llm_usage, and routes both deletion pathsthrough one
eraseLoggedData().1. Schema + the auth.db -> app.db rename
The shared DB was renamed (
db.tsrenames a pre-existingauth.db,-wal/-shmincluded, on first open). On the prod volume, after rollout:
app.dbexists inDATA_DIR,auth.dbis gone.start a fresh DB).
PRAGMA user_version;is >= 1 andllm_usageexists:sqlite3 $DATA_DIR/app.db 'pragma user_version; .tables'2. Metering attributes spend to the right key
key.
metered to the
demobucket — i.e.OPENAI_DEMO_API_KEYis really reaching thecontainer. If this 401s, demo mode is broken in prod.
GET /api/usage_summary?secret=$LOG_SECRETreturns per-userrows with non-null
costUsd, andunpricedModelsis empty (if it isn't, theserved model is missing from
backend/src/pricing.ts).main project vs the Thoughtful-demo project. This is the whole point of the
table; if it doesn't reconcile, something is being missed.
3. deletePosthogPerson actually works (carried over from #503)
This is the one promise in the privacy policy currently backed by a code comment
saying "verify the endpoint shape against your PostHog version before relying on it".
Both deletion paths now depend on it, and the tests mock it, so nothing verifies it.
POSTHOG_PERSONAL_API_KEYandPOSTHOG_PROJECT_IDare set in prod (withoutthem it logs a warning and no-ops — deletion silently doesn't happen).
DELETE /api/me/activity, and confirm the person and their events are gonefrom the PostHog project.
backend/src/posthog.tsmatchesour PostHog version (a 4xx is reported to captureException, not thrown — so a
wrong URL fails quietly).
4. Deletion semantics end to end
DELETE /api/me/activity(withdrawal): study logs + PostHog person gone, theaccount still works, and new usage rows keep accruing for it.
user's
llm_usagerows move to thedeletedbucket with their token countsintact — the spend total for the window must not drop.