Skip to content

feat: consolidate local privacy and admin updates - #2455

Open
twoimo wants to merge 1 commit into
mainfrom
gjc/consolidate-local-changes-20260731
Open

feat: consolidate local privacy and admin updates#2455
twoimo wants to merge 1 commit into
mainfrom
gjc/consolidate-local-changes-20260731

Conversation

@twoimo

@twoimo twoimo commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • consolidates the verified local privacy, account-deletion, admin, URL, and pipeline changes
  • adds paired frontend and backend regression coverage
  • excludes local session exports, connection probes, scratch files, and production backup data

Verification

  • bun run test:unit: 1218 passed
  • python3 -m unittest backend.utils.tests.test_run_daily_regression backend.pipeline.test_data_contracts_unittest backend.pipeline.test_validators_unittest: 85 passed

Backup

Production backup remains encrypted outside the repository; no credentials or data are included in this PR.

@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
tzudong Ignored Ignored Preview Jul 31, 2026 6:56pm

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ba70793a16

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +190 to +193
const isPrivacyProfileComplete = data !== null && isPrivacyProfileStatusAllowed(data.status);

if (error || !isPrivacyProfileComplete) {
clearSupabaseAuthCookies(request, supabaseResponse);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Provision privacy profiles before enforcing eligibility

For any new user—or any existing user without an eligible/guardian_verified row—this condition clears the authentication cookies and redirects or returns 403. A repository-wide search finds no migration defining privacy_age_profiles and no flow that creates or updates these rows; the OAuth callback also requires the row immediately after exchanging the login code. Consequently, users cannot establish the profile needed to pass this check and authenticated routes become inaccessible. Add the schema/enrollment flow before making this a mandatory session gate.

Useful? React with 👍 / 👎.

Comment on lines +135 to +140
const supabaseAdmin = createSupabaseServiceRoleClient();
const { data, error } = await supabaseAdmin.rpc('preview_account_deletion', {
p_actor_user_id: targetUserId,
p_target_user_id: targetUserId,
p_reauthenticated_at: verifiedUser.last_sign_in_at,
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add the required account-deletion RPCs

On a database provisioned from this repository's migrations, every deletion attempt stops at this mandatory preview because preview_account_deletion is not defined anywhere in the tree. The new G028 migration similarly calls an absent begin_account_deletion_apply function (its test even states that G014 must already exist), while this commit removes the prior direct deletion implementation. Include the prerequisite migration/worker RPCs so fresh and test deployments do not return account_deletion_preview_not_available for every user.

Useful? React with 👍 / 👎.

# [PERF] 안전 타임아웃: 최대 90분 (월 3000분 한도 보호)
timeout-minutes: 90
if: ${{ github.event_name != 'workflow_dispatch' || github.ref_name == github.event.repository.default_branch }}
if: ${{ (github.event_name != 'workflow_dispatch' || github.ref_name == github.event.repository.default_branch) && vars.G037_WRITE_FREEZE != 'active' }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Apply the write freeze to every scheduled writer

When G037_WRITE_FREEZE is set to active, this guard stops only the daily crawler and the GDrive backfill. I also checked .github/workflows/restaurant-refresh-cron.yml, whose scheduled non-dry-run path passes --allow-db-write with the Supabase service-role key, and .github/workflows/youtube-kpi-snapshot.yml, whose scheduled capture writes snapshots with the same key; neither job checks the freeze variable. Those production writes therefore continue during a declared repository-wide freeze, so add the admission guard to the remaining scheduled writer jobs as well.

Useful? React with 👍 / 👎.

Comment on lines +124 to +130
const privacyHashKey = process.env.PRIVACY_AUDIT_HASH_KEY?.trim();
if (
process.env.VERCEL !== '1'
|| !privacyHashKey
|| Buffer.byteLength(privacyHashKey, 'utf8') < 32
) {
return 'unknown';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Configure the hash key before enforcing the client quota

In a Vercel deployment without the newly referenced PRIVACY_AUDIT_HASH_KEY, every request is assigned to the same unknown bucket. The new database policy limits that bucket to 20 requests per minute, so the 21st shortening request across the entire deployment rate-limits every client even though the intended global ceiling is 200. A repository-wide search finds this variable only here and in a source test—not in .env.example or deployment configuration—so provision and document the key, or avoid applying the per-client ceiling to the shared fallback bucket.

Useful? React with 👍 / 👎.

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.

1 participant