Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

bug(obsidian): project-scoped export rewrites shared topic hubs from the scoped project's refs only

Open Beginner friendly
#2,003 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@dnlrsls is already working on this.

Since Oct 22, 2026.

  • #2039 by @dnlrsls — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
73/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go
Domain
backend

Research direction

Start in internal/obsidian/exporter.go and trace how addHubRef builds topicObsRefs during a project-scoped export. Read internal/obsidian/hub.go for ShouldCreateTopicHub and inspect the hub generation and write path. Reproduce with observations from two projects sharing a topic prefix; done means exporting one project preserves the other project's links in the shared hub.

Written by the indexing model from the issue text.

Description

status:needs-review type:bug
Existing Issue Search
  • I searched existing issues and will add evidence to a canonical tracker when applicable.
📝 Observed Consequence

A project-scoped Obsidian export rewrites shared topic hub notes so they lose the links to other projects' observations until the next full export.

🔄 Steps to Reproduce
  1. Store observations in two projects (alpha, beta) sharing a topic prefix (e.g. topic/arch), at least two per project.
  2. Run a full export (no project filter): the shared _topics/topic--arch.md hub links notes from both projects.
  3. Run a project-scoped export for alpha only.
  4. Open _topics/topic--arch.md: it now lists only alpha notes; beta links are gone.
  5. Run a full export again: the hub recovers beta links.
✅ Expected Behavior

A project-scoped export must not narrow a shared topic hub. It should leave the existing hub untouched (same guard spirit as the scoped-retirement fix in #1151) or reconcile it without dropping foreign-project references.

❌ Actual Behavior

The scoped run regenerates the hub from the scoped project's references alone and overwrites the file, so other projects' links silently disappear until the next full export. No error is reported.

Operating System

Linux (Ubuntu/Debian)

Release Version (Report Context)

3.5.1

Agent / Client

Other

📋 Relevant Logs

No response

💡 Additional Context

Verified pre-existing on main while reviewing #1151 (2026-10-21): that PR fixed the retirement side (never prune shared hubs on a scoped export) but regeneration still narrows.

Mechanism on main:

  • internal/obsidian/exporter.go: addHubRef populates topicObsRefs only from observations that pass the project filter, so a scoped run builds the prefix map from one project's refs.
  • Topic hub generation then calls TopicHubMarkdown(prefix, refs) and os.WriteFile on the shared path whenever the scoped count alone satisfies ShouldCreateTopicHub (internal/obsidian/hub.go:19, count >= 2), unconditionally replacing the shared content.
Dominant language
Go
Stars
7.1k
Forks
729
Avg merge
8h 48m
Merged PRs (30d)
340

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Gentleman-Programming/engram

All issues in Gentleman-Programming/engram

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.