feat(brain-sync): opt-in removal publishing with a bulk-removal valve

gstack-brain-sync never published a removal: a deleted synced file, or the
old directory after a project slug migration, stayed on the remote forever
and gbrain indexed both copies.

New setting artifacts_sync_removals (off by default). When on, each drain
commits and pushes, receipted like every push, the removal of tracked files
that are gone from disk and match the sync allowlist. Transcript pages are
never removed here, and a decision log goes only together with its active
snapshot. One valve: a drain that would remove more than 20 files at once
publishes none and says so. `gstack-brain-sync --publish-removals` lists the
pending removals and `--publish-removals --yes` publishes them on demand,
whatever the setting.

Co-authored-by: Jey2311 <5177215+Jey2311@users.noreply.github.com>
This commit is contained in:
garrytanandJey2311 committed 2026-10-08 15:51:39 +00:00
1 parent 33ceff32bb
commit 671fb0577e
4 files changed
+305 -3

No files matched your search

+22
View File
@@ -114,6 +114,28 @@ gstack-config set artifacts_sync_mode full
gstack-config set artifacts_sync_mode off
```
## Removed and moved files
By default the sync never publishes a removal: delete a synced design doc,
or move a project directory (a project slug migration does), and the old
path stays on the remote, where the brain keeps indexing it next to the new
copy. To publish removals too:
```bash
gstack-config set artifacts_sync_removals on
```
Each sync then commits the removal of synced files that are gone from disk.
Transcript pages are left alone, and a decision log and its active snapshot
go only together. A sync that would remove more than 20 files at once
publishes none of them: that looks like a loss, not a cleanup. Review and
publish those yourself, whatever the setting:
```bash
gstack-brain-sync --publish-removals # list them
gstack-brain-sync --publish-removals --yes # commit and push their removal
```
## Secret protection
Every commit is scanned for credential-shaped content before it leaves