Draft
Harden PathLab reset flow to prevent unintended destructive enrollment wipes#2
Conversation
Agent-Logs-Url: https://github.com/passionseed/ps_app/sessions/104143f6-7789-49d2-b705-4bd90f7a9a66 Co-authored-by: xb1g <70068561+xb1g@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Investigate potential database deletion in recent commit
Harden PathLab reset flow to prevent unintended destructive enrollment wipes
Mar 31, 2026
Collaborator
|
So the reset is not in the code, but from the dev fault |
xb1g
force-pushed
the
copilot/check-database-deletion-intent
branch
from
May 11, 2026 17:57
2631fb8 to
6aaa815
Compare
xb1g
force-pushed
the
copilot/check-database-deletion-intent
branch
from
May 11, 2026 18:07
6aaa815 to
33d47cd
Compare
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.
A recent change introduced a test-only reset path that performs destructive deletes (
path_activity_progress,path_assessment_submissions,path_reflections). This PR tightens that flow so reset cannot run broadly in production-like environments and cannot target another user’s enrollment.Reset safety gate (runtime-config)
isEnrollmentResetEnabled()inlib/runtime-config.ts.__DEV__ === true, orEXPO_PUBLIC_ENABLE_ENROLLMENT_RESET=true.Ownership + auth enforcement before destructive operations
resetEnrollment()inlib/pathlab.tsto fail fast unless:path_enrollments.user_id === auth.user.id).UI guard for test-only action
app/seed/[id].tsxto disable “Restart (for test only)” when reset is not enabled by runtime policy.Focused config coverage
tests/runtime-config.test.tswith cases validating reset gate defaults and explicit enablement.Provided screenshot artifact (suitable to attach in PR context):
https://github.com/user-attachments/assets/a1a855f0-b652-4679-aa77-bd070c57617b
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
cdp.expo.dev/home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/ps_app/ps_app/node_modules/.bin/expo start --web(dns block)/home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/ps_app/ps_app/node_modules/.bin/expo start --web conf�� get 72a419d5 de/node/bin/bash credential.usernbash(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt