Repository navigation
Commit 3bd4421
fix(bundler): let 'catalog remove' delete a project source overriding a built-in
`remove_source` refused any built-in id before looking at what the project
config actually held:
if target in _BUILTIN_IDS:
raise BundlerError(
f"'{target}' is a built-in default source and cannot be deleted "
"(add a same-id source to override it instead)."
)
That message documents the override workflow -- and the same guard then made
the override permanent. Reproduced on main:
add_source -> OK (documented override). stored: ['community']
remove_source-> REFUSED: 'community' is a built-in default source and
cannot be deleted (add a same-id source to override it
instead).
STILL STORED : ['community']
The user could not undo their own project-scoped entry through the CLI at all;
the only way back was hand-editing the config the command exists to manage.
Now the built-in id is refused only when there is no project-scoped entry to
remove. Deleting the user's own entry simply restores the built-in default.
The existing CLI guard (tests/contract/test_bundle_cli.py
test_catalog_remove_builtin_is_refused) runs against a project with no such
entry and still passes unchanged.
Rebased onto current main (files moved in the workflow/bundler restructure).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>1 parent 5364d7c commit 3bd4421
2 files changed
Lines changed: 44 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
229 | 236 | | |
230 | 237 | | |
231 | 238 | | |
232 | 239 | | |
233 | 240 | | |
234 | | - | |
235 | 241 | | |
236 | 242 | | |
237 | 243 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
210 | 246 | | |
211 | 247 | | |
212 | 248 | | |
| |||
0 commit comments