Skip to content

index_notes: dot-files (e.g. .draft.md, .trash.md) are indexed despite BRAIN_INDEX_HIDDEN default #25

Closed

Description

@Kaap10

Steps to reproduce

  1. Create a markdown folder with a hidden file (e.g. .secret.md or notes/.draft.md).
  2. Run iter_notes(vault_dir) with BRAIN_INDEX_HIDDEN unset (default behavior):
    from sqlite_graph_memory.index_notes import iter_notes
    iter_notes(vault_dir)

What happened

iter_notes() returns the dot-file:

['.secret.md']

In src/sqlite_graph_memory/index_notes.py:88:

if not include_hidden and any(part.startswith('.') for part in rel.parts[:-1]):
    continue

rel.parts[:-1] inspects parent directories, but excludes rel.parts[-1] (the filename itself). Consequently, dot-files are included in the index.

What you expected instead

Per the docstring ("Skips dot-directories and Syncthing conflict copies. Set BRAIN_INDEX_HIDDEN=1 to index hidden folders too"), hidden dot-files should be excluded when BRAIN_INDEX_HIDDEN is not set.

Environment

OS: Windows 11 / Linux / macOS
Runtime: Python 3.12.7
This repo at: 9308a91 (v0.3.0)

Anything you already tried

Changing rel.parts[:-1] to rel.parts:

if not include_hidden and any(part.startswith('.') for part in rel.parts):
    continue

Before you submit

  • I searched the open and closed issues and this is not a duplicate.
  • There are no secrets, credentials, personal data or third-party names in what I pasted.
  • I would like to fix this myself.

Activity

  1. tonydzi commented on Oct 12, 2026

    @tonydzi
    Owner

    Hi, Mycroft here, Anton's synthetic AI co-founder. I read this before the human did, which is the one race I always win.

    Logged your issue ("index_notes: dot-files (e.g. .draft.md, .trash.md) are indexed despite BRAIN_INDEX_HIDDEN ") after 3 h of silence, which is on us. A human from the lab reads it within 48 hours, as CONTRIBUTING.md promises; if that clock runs out, ping the thread, it is not rude.

    — TonyDzi · we run a multi-agent lab in public and ship its parts daily; the rest is at github.com/tonydzi.

  2. tonydzi commented on Oct 13, 2026

    @tonydzi
    Owner

    @Kaap10 reproduced: with .secret.md and ok.md in a folder, iter_notes() returns both. index_notes.py:88 checks rel.parts[:-1] only, so the filename is never tested. Fix is one slice, but the test should cover both a hidden file and a file inside a hidden directory, and BRAIN_INDEX_HIDDEN=1 must still include them. Labelled accepted; claim it with a comment if you want it.

  3. added
    acceptedWe want this and it is free to take - comment 'claiming this'
    good first issueaccepted + small and self-contained - start here
    help wantedWe want it but havent scoped it - comment and we shape it with you
    on Oct 13, 2026
  4. added 2 commits that reference this issue on Oct 20, 2026
    f43b175
    0670d99
  5. added a commit that references this issue on Oct 28, 2026
    659fa6e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedWe want this and it is free to take - comment 'claiming this'bugSomething isn't workinggood first issueaccepted + small and self-contained - start herehelp wantedWe want it but havent scoped it - comment and we shape it with you

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions