Skip to content

feat: add --include-hidden flag for obsidian backend#4

Merged
skridlevsky merged 1 commit into
skridlevsky:mainfrom
unbound-force:feature/include-hidden
Mar 10, 2026
Merged

feat: add --include-hidden flag for obsidian backend#4
skridlevsky merged 1 commit into
skridlevsky:mainfrom
unbound-force:feature/include-hidden

Conversation

@jflowers
Copy link
Copy Markdown
Contributor

@jflowers jflowers commented Mar 8, 2026

Summary

Add an --include-hidden CLI flag and WithIncludeHidden vault option that allows indexing directories starting with . when using the obsidian backend. The .git directory is always skipped regardless of the flag setting to prevent indexing git internals.

Motivation

Some projects store documentation and configuration in hidden directories (e.g., .specify/, .opencode/). Currently, the obsidian backend skips all directories starting with ., which means this content is not indexed or searchable. This flag enables those projects to include that content in the knowledge graph.

Our use case is the Unbound Force project, which stores its org constitution in .specify/memory/constitution.md and agent definitions in .opencode/agents/. Without this flag, these critical files are invisible to the knowledge graph.

Changes

  • Add includeHidden bool field to vault.Client struct
  • Add WithIncludeHidden(bool) Option constructor following the existing WithDailyFolder pattern
  • Guard hidden directory skips in Load(), addWatcherDirs(), and handleEvent() with !c.includeHidden check
  • Always skip .git directory regardless of flag (hardcoded exclusion)
  • Add --include-hidden CLI flag in runServe() function
  • Update usage text to document the new flag

Tests

Four new tests added to vault/vault_test.go:

  1. TestIncludeHidden_DefaultSkipsHiddenDirs - Verifies default behavior is unchanged (hidden dirs skipped)
  2. TestIncludeHidden_WithFlagIndexesHiddenDirs - Verifies hidden dirs are indexed with flag
  3. TestIncludeHidden_AlwaysSkipsGitDir - Verifies .git is always skipped even with flag
  4. TestIncludeHidden_WatcherIndexesHiddenFiles - Verifies file watcher picks up changes in hidden dirs with flag

All existing tests pass. go test ./... -race and go vet ./... pass cleanly.

Usage

graphthulhu serve --backend obsidian --vault . --include-hidden --read-only

Backward Compatibility

Default behavior is unchanged. Hidden directories are skipped unless --include-hidden is explicitly set. No existing configuration or behavior is affected.

Add an --include-hidden CLI flag and WithIncludeHidden vault option
that allows indexing directories starting with '.' (e.g., .specify/,
.opencode/). The .git directory is always skipped regardless of the
flag setting to prevent indexing git internals.

This enables projects that store documentation or configuration in
hidden directories to include that content in the knowledge graph.

Changes:
- Add includeHidden field to vault.Client struct
- Add WithIncludeHidden(bool) Option constructor
- Guard hidden directory skips in Load(), addWatcherDirs(), and
  handleEvent() with includeHidden check
- Add --include-hidden CLI flag in runServe()
- Add tests: default skip, include with flag, always skip .git,
  watcher integration with hidden directories
jflowers added a commit to unbound-force/unbound-force that referenced this pull request Mar 8, 2026
Install graphthulhu with --include-hidden support (upstream PR
submitted to skridlevsky/graphthulhu#4), create OpenCode MCP
configuration, verify all 5 user stories, and enrich all 9
spec files with YAML frontmatter.

Deliverables:
- opencode.json: MCP server config for graphthulhu
- verification-log.md: all verification results across 8 phases
- tasks.md: all 49 tasks marked complete
- YAML frontmatter added to all 9 spec files (001-009)
- AGENTS.md and README.md updated with 010 references
- Upstream PR: github.com/skridlevsky/graphthulhu/pull/4

Verified: search, graph analysis, live sync, link traversal,
property queries, read-only enforcement, file non-modification.
50 pages indexed across all directories including .specify/
and .opencode/.
jflowers added a commit to unbound-force/unbound-force that referenced this pull request Mar 8, 2026
Install graphthulhu with --include-hidden support (upstream PR
submitted to skridlevsky/graphthulhu#4), create OpenCode MCP
configuration, verify all 5 user stories, and enrich all 9
spec files with YAML frontmatter.

Deliverables:
- opencode.json: MCP server config for graphthulhu
- verification-log.md: all verification results across 8 phases
- tasks.md: all 49 tasks marked complete
- YAML frontmatter added to all 9 spec files (001-009)
- AGENTS.md and README.md updated with 010 references
- Upstream PR: github.com/skridlevsky/graphthulhu/pull/4

Verified: search, graph analysis, live sync, link traversal,
property queries, read-only enforcement, file non-modification.
50 pages indexed across all directories including .specify/
and .opencode/.
@skridlevsky
Copy link
Copy Markdown
Owner

Great work. Merged.

@skridlevsky skridlevsky merged commit 510b658 into skridlevsky:main Mar 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants