Repository navigation
Commit 0b6b934
committed
fix(core): derive the delete purge keep-set from the surviving provider's ownership
What:
- Both delete branches now pass an ownership-derived keep-set to
purgeDeletedProfileSecrets, via a new getSurvivingProviderSecretKeys helper
that resolves the surviving profile's provider from the manager and keeps the
deleted profile's keys that provider owns.
- Exports providerOwnsSecretKey from ContextProxy.
- Replaces the active branch's blob-derived keep-set with the same helper, and
retitles the round-5 same-provider spec to assert the corrected semantics.
- Adds three inactive-branch specs: same-provider preservation, cross-provider
purge, and the unreadable-survivor purge fallback.
Why:
The inactive branch called purgeDeletedProfileSecrets with no keep-set, so
deleting a profile whose blob declared a key the surviving active profile also
uses deleted the live credential. The e2e profile test's finally deletes
subtask-child-profile and subtask-parent-profile while default is active; all
three are OpenRouter, so they share the single openRouterApiKey SecretStorage
slot. The purge deleted default's credential and every rehydrated task hung
until its 30 s timeout, which is the deterministic 9/3 mocked-e2e failure.
A blob-derived keep-set cannot fix this: the api.getConfiguration() round-trip
rewrites a profile without its secret fields while keeping apiProvider, so the
surviving profile's blob is secret-less exactly when the live credential needs
protecting. Provider ownership comes from the schema, which no round-trip can
strip. The active branch had the same hazard and is aligned.
Impact:
Fixes the deterministic e2e-mock failure: the local mocked subtasks suite is
12/12. Preserves the S-3 security closure, because a cross-provider delete keeps
nothing (the survivor owns none of the deleted keys) and an unreadable survivor
falls back to purging every key the deleted profile declared.1 parent 99a95bc commit 0b6b934
3 files changed
Lines changed: 158 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| |||
2261 | 2261 | | |
2262 | 2262 | | |
2263 | 2263 | | |
2264 | | - | |
| 2264 | + | |
| 2265 | + | |
| 2266 | + | |
| 2267 | + | |
| 2268 | + | |
| 2269 | + | |
| 2270 | + | |
| 2271 | + | |
| 2272 | + | |
| 2273 | + | |
| 2274 | + | |
| 2275 | + | |
2265 | 2276 | | |
2266 | 2277 | | |
2267 | 2278 | | |
| |||
2323 | 2334 | | |
2324 | 2335 | | |
2325 | 2336 | | |
2326 | | - | |
2327 | | - | |
2328 | | - | |
| 2337 | + | |
| 2338 | + | |
| 2339 | + | |
| 2340 | + | |
2329 | 2341 | | |
2330 | 2342 | | |
2331 | | - | |
| 2343 | + | |
2332 | 2344 | | |
2333 | 2345 | | |
2334 | 2346 | | |
| |||
2364 | 2376 | | |
2365 | 2377 | | |
2366 | 2378 | | |
2367 | | - | |
| 2379 | + | |
| 2380 | + | |
| 2381 | + | |
| 2382 | + | |
| 2383 | + | |
| 2384 | + | |
| 2385 | + | |
| 2386 | + | |
| 2387 | + | |
| 2388 | + | |
| 2389 | + | |
| 2390 | + | |
| 2391 | + | |
| 2392 | + | |
2368 | 2393 | | |
2369 | | - | |
2370 | | - | |
2371 | | - | |
2372 | | - | |
| 2394 | + | |
| 2395 | + | |
2373 | 2396 | | |
2374 | | - | |
| 2397 | + | |
| 2398 | + | |
| 2399 | + | |
| 2400 | + | |
| 2401 | + | |
| 2402 | + | |
| 2403 | + | |
| 2404 | + | |
| 2405 | + | |
| 2406 | + | |
2375 | 2407 | | |
2376 | | - | |
2377 | | - | |
| 2408 | + | |
| 2409 | + | |
2378 | 2410 | | |
2379 | 2411 | | |
2380 | 2412 | | |
| 2413 | + | |
| 2414 | + | |
| 2415 | + | |
| 2416 | + | |
2381 | 2417 | | |
2382 | 2418 | | |
2383 | 2419 | | |
| |||
2388 | 2424 | | |
2389 | 2425 | | |
2390 | 2426 | | |
2391 | | - | |
2392 | | - | |
| 2427 | + | |
| 2428 | + | |
| 2429 | + | |
2393 | 2430 | | |
2394 | 2431 | | |
2395 | 2432 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3813 | 3813 | | |
3814 | 3814 | | |
3815 | 3815 | | |
3816 | | - | |
3817 | | - | |
3818 | | - | |
3819 | | - | |
3820 | | - | |
| 3816 | + | |
| 3817 | + | |
| 3818 | + | |
| 3819 | + | |
| 3820 | + | |
| 3821 | + | |
| 3822 | + | |
| 3823 | + | |
| 3824 | + | |
| 3825 | + | |
| 3826 | + | |
| 3827 | + | |
| 3828 | + | |
| 3829 | + | |
| 3830 | + | |
| 3831 | + | |
| 3832 | + | |
| 3833 | + | |
| 3834 | + | |
| 3835 | + | |
| 3836 | + | |
| 3837 | + | |
| 3838 | + | |
| 3839 | + | |
| 3840 | + | |
| 3841 | + | |
| 3842 | + | |
| 3843 | + | |
| 3844 | + | |
| 3845 | + | |
| 3846 | + | |
| 3847 | + | |
| 3848 | + | |
| 3849 | + | |
| 3850 | + | |
| 3851 | + | |
| 3852 | + | |
| 3853 | + | |
| 3854 | + | |
| 3855 | + | |
| 3856 | + | |
| 3857 | + | |
| 3858 | + | |
| 3859 | + | |
| 3860 | + | |
| 3861 | + | |
| 3862 | + | |
| 3863 | + | |
| 3864 | + | |
| 3865 | + | |
| 3866 | + | |
| 3867 | + | |
| 3868 | + | |
| 3869 | + | |
| 3870 | + | |
| 3871 | + | |
| 3872 | + | |
| 3873 | + | |
| 3874 | + | |
| 3875 | + | |
| 3876 | + | |
| 3877 | + | |
| 3878 | + | |
| 3879 | + | |
| 3880 | + | |
| 3881 | + | |
| 3882 | + | |
| 3883 | + | |
| 3884 | + | |
| 3885 | + | |
| 3886 | + | |
| 3887 | + | |
| 3888 | + | |
| 3889 | + | |
| 3890 | + | |
| 3891 | + | |
| 3892 | + | |
| 3893 | + | |
| 3894 | + | |
| 3895 | + | |
| 3896 | + | |
| 3897 | + | |
| 3898 | + | |
| 3899 | + | |
| 3900 | + | |
| 3901 | + | |
| 3902 | + | |
| 3903 | + | |
| 3904 | + | |
| 3905 | + | |
| 3906 | + | |
| 3907 | + | |
| 3908 | + | |
| 3909 | + | |
| 3910 | + | |
| 3911 | + | |
| 3912 | + | |
| 3913 | + | |
| 3914 | + | |
| 3915 | + | |
3821 | 3916 | | |
3822 | 3917 | | |
3823 | | - | |
3824 | | - | |
3825 | | - | |
3826 | | - | |
3827 | 3918 | | |
3828 | 3919 | | |
3829 | 3920 | | |
| |||
3845 | 3936 | | |
3846 | 3937 | | |
3847 | 3938 | | |
3848 | | - | |
3849 | | - | |
3850 | | - | |
3851 | | - | |
| 3939 | + | |
| 3940 | + | |
| 3941 | + | |
| 3942 | + | |
3852 | 3943 | | |
3853 | 3944 | | |
3854 | 3945 | | |
| |||
0 commit comments