Skip to content

v0.32: gbrain sync --source-id <name> writes to 'default' source instead of the named one #891

@topcoder1

Description

@topcoder1

Bug

gbrain sync --source-id <named-source> --full enumerates files from the source's local_path correctly but writes the resulting pages to the default source instead of the named one. The named source remains at 0 pages after sync.

Repro

gbrain sources add gstack-code-foo --path ~/dev/foo --name "foo"
gbrain sources federate gstack-code-foo
gbrain config set sync.repo_path ~/dev/foo
gbrain sync --source-id gstack-code-foo --full
gbrain sources list
# Expected: gstack-code-foo shows N pages
# Actual:   default jumps by N pages, gstack-code-foo stays at 0

Verified empirically: synced 12 different repos with named source IDs, all 12 named sources still show 0 pages while default accumulated 1,777 pages total.

Why this matters

Per-source filtering on gbrain query --source <name> becomes impossible — everything lives in default. Use cases like "search only my code, not my notes" or "exclude this client's repo from cross-search" can't be expressed.

It also defeats the per-repo cleanup story: gbrain sources remove gstack-code-foo --yes cascade-deletes 0 rows since nothing ever went there, while the actual data sits orphaned in default.

Workaround

Set global sync.repo_path per-repo before each sync (which is what I did to get the indexing done), and accept that everything lives in default. Loses per-source filtering but at least the data is searchable.

Environment

gbrain 0.32.0, PGLite engine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions