Skip to content

put_page write-through mirrors unrouted pages into an arbitrary federated source's repo #2018

@WilliamCourterWelch

Description

@WilliamCourterWelch

Version: gbrain 0.40.6.0 (engine: postgres/Supabase, MCP stdio via gbrain serve)

Summary: When put_page (called over MCP) creates a page that has no project/source context, its markdown write-through mirror is written into the on-disk local_path of an unrelated federated source, rather than the source the page is actually assigned to.

Observed behavior:

  • gbrain serve runs with cwd = $HOME (no .gbrain-source pin there).
  • Creating cross-cutting pages (tagged internal, no project) via put_page returns write_through: { written: true, path: "/Users/me/Projects/housefax/<slug>.md" }.
  • housefax is an unrelated registered federated source. Its page_count stays at 4 (the new pages are not assigned to it) — yet ~20 unrelated pages' .md mirrors accumulated in its repo dir, including auto-created subfolders (office-hours/, internal/pitfalls/).
  • The pages themselves correctly live in the default source (local_path: null).

Expected behavior: write-through should either (a) mirror to the assigned source's local_path, or (b) skip the on-disk mirror entirely when the assigned source has local_path: null (as default does). It should not fall back to writing into some other federated source's working tree — that silently pollutes an unrelated git repo.

Impact: unrelated project repos accumulate stray untracked markdown files from every cross-cutting page write. Confusing, and easy to accidentally commit another topic's notes into the wrong repo.

Workaround: periodically sweep untracked .md files out of the affected source dir. There is no config knob (gbrain config, put, export, sources) to control the write-through target.

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