mirror of
https://github.com/garrytan/gbrain.git
synced 2026-07-27 22:15:33 +00:00
Takeover of PR #2157, rebased onto current master. - gbrain sources add --include/--exclude (repeatable) persist into sources.config.include_globs / exclude_globs; every subsequent sync of the source honors them. - gbrain sync gains --include (allow-list counterpart to the existing #753/#774 --exclude), merged with the source row's persisted globs. Include/exclude are matched scope-relative in both the incremental and full-sync paths (import.ts gains the include filter); exclusion stays conservative (never deletes previously-imported pages). - gbrain lint gains --include/--exclude and auto-lifts the persisted source globs when the lint target matches a source's local_path. - Migration v125 (renumbered from the PR's v117/v120): a sources.config_fingerprint column caches a SHA-256 of the walk-affecting config fields (strategy + globs) so changing globs on an already-synced source forces a full re-walk instead of "Already up to date" (git HEAD unchanged). NULL = never stamped; first post-upgrade sync stamps quietly. Deviations from #2157 while rebasing: globs are NOT threaded through isSyncable/unsyncableReason in the incremental path — the unsyncable cleanup loop deletes pages for non-metafile classifications, which would violate the documented conservative #1433 posture; instead include mirrors master's existing scope-relative excluded() helper. CLI --exclude/--include now merge (union) with persisted config globs rather than being replaced by them. Fixes #2156 Takeover of #2157 Co-authored-by: brettdavies <brettdavies@users.noreply.github.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>