feat(sources): removing a source deletes its files and index entries behind a confirmation modal
Build and Push Containers / build-and-push-app (push) Successful in 1m29s
Build and Push Containers / build-and-push-db (push) Successful in 11s

This commit is contained in:
2026-09-02 15:55:33 -04:00
parent 265e736b3d
commit 137d5fa1a5
24 changed files with 3489 additions and 118 deletions
+16 -7
View File
@@ -137,10 +137,16 @@ uv run uvicorn app.main:app --reload
missing/relative path is rejected, naming the path; so are duplicates)
— since phase 49 this is an API-only operation (`POST /api/git-sources`
with `kind=local`; the page's form was replaced by the upload form). List
rows carry a **Git** or **Local** badge. Adding/removing does not clone
or prune on its own: the Sync button performs that (git + local together,
one run, prune over the union), and a removed source's documents leave
the index on the next sync.
rows carry a **Git** or **Local** badge. Adding does not clone: the
Sync button performs that (git + local together, one run, prune over
the union) and still prunes **upstream file churn** — a file deleted
in a repo or dropped from a local directory leaves the index on that
run. **Removing a source is a total removal, done immediately** — a
confirmation modal states it first, then the source's entry, all of
its indexed documents, and — for git clones and uploaded archives —
its files on disk (the checkout under `BOR_SOURCES_DIR` or the
unpacked folder under `BOR_UPLOAD_DIR`) are gone in one action; files
in the owner's own local directories are never touched.
## Thinking
@@ -406,9 +412,12 @@ table** (the `git_sources` registry with a `kind` discriminator: `git` |
as a failing git clone).
- **Pruning is over the union** — git checkouts and local directories are
imported together with `prune=True`, so a file removed from a local
directory, a repo, or a removed source leaves the index on that run.
Removing the row on the page stops the directory being a source; its
documents leave the index on the next sync (exactly like git sources).
directory or a repo leaves the index on that run (upstream file
churn). Removing the source on the page is a **total removal, done
immediately** (a confirmation modal states it first): its entry and
its indexed documents leave at once — but the directory itself is the
owner's own and is **never touched on disk** (only git checkouts and
uploaded archives get their files deleted).
- **`import_docs`** (no `--source`) resolves the stored git **and** local
rows — git cloned/pulled as above, local walked directly — in one run;
`--source` still wins over everything; while the table is empty,