feat(profile): add safe account removal lifecycle - #253
Conversation
📝 WalkthroughWalkthroughAdds guarded profile removal with durable-reference reassignment, audit recovery, CLI and Console API support, dashboard controls, validation, documentation, and end-to-end tests. ChangesProfile removal lifecycle
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant ConsoleUser
participant ConsoleAssets
participant LocalConsoleServer
participant ConsoleDashboardApplicationService
participant ConsoleApplicationService
participant runProfileRemoval
ConsoleUser->>ConsoleAssets: confirm account removal
ConsoleAssets->>LocalConsoleServer: POST /api/v1/profiles/remove
LocalConsoleServer->>ConsoleDashboardApplicationService: validate and forward request
ConsoleDashboardApplicationService->>ConsoleApplicationService: removeProfile(request)
ConsoleApplicationService->>runProfileRemoval: execute audited removal
runProfileRemoval-->>ConsoleApplicationService: removal report
ConsoleApplicationService-->>ConsoleDashboardApplicationService: normalized report
ConsoleDashboardApplicationService-->>LocalConsoleServer: JSON result
LocalConsoleServer-->>ConsoleAssets: removal response
ConsoleAssets->>LocalConsoleServer: refresh dashboard
Possibly related PRs
Poem
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/profile-removal-onboarding.test.ts`:
- Around line 164-213: Add a direct happy-path test for runProfileRemoval with a
resolving audit.record, asserting the returned report has changed: true, write:
true, the requested profile, and a defined backupPath; verify audit intent and
successful record calls, and confirm the rewritten configuration removes the
profile. Clean up the temporary directory in a finally block.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: e09068ff-3ced-4c9f-b6e8-12e6c9c80f44
📒 Files selected for processing (20)
README.mddocs/cli.mddocs/console-api.mdsrc/cli/exit-codes.tssrc/cli/main.tssrc/cli/parse.tssrc/console/console-application-service.tssrc/console/console-assets.tssrc/console/console-dashboard-application-service.tssrc/console/console-server.tssrc/setup/profile-removal-onboarding.tssrc/utils/errors.tstests/cli-exit-codes.test.tstests/cli-parse.test.tstests/console-application-service.test.tstests/console-dashboard-application-service.test.tstests/console-server.test.tstests/package-contract.test.tstests/profile-removal-onboarding.test.tstests/readme-product-contract.test.ts
|
CodeRabbit is rate-limited on current head 435d22a. Its check is passing with Review rate limited, so I used the documented fallback review. Local Claude Fable completed a read-only review of the current pull-request diff with NO BLOCKERS. It independently verified durable-reference coverage, native OAuth refusal, guarded audit rollback, Console CSRF and schema safety, browser path redaction, stale trusted-source fail-closed behavior, and secret/cache boundaries. It noted only a non-blocking pre-existing sibling-pattern gap: no test currently forces external interference during the rollback comparator path. The new direct successful runProfileRemoval audit-path test addresses the actual CodeRabbit request, and the original CodeRabbit thread is no longer unresolved after the update. |
Dismissed because CodeRabbit is rate limited on the current head. Its one actionable test gap was addressed in 435d22a; there are no unresolved review threads, all current-head CI checks are green, and a bounded local Claude Fable read-only review found no blockers.
Part of #204.
Adds one guarded profile-removal lifecycle through the CLI and Console.
Validation:
Local review: manual security review completed. Local Claude CLI review was attempted in plan/read-only mode but did not return within the bounded window and was terminated without any file changes.
Summary by CodeRabbit
New Features
Documentation