Skip to content

core: decide whether a dot-prefixed .md is vault material — the walk's note route still indexes it #136

Description

@samkeen

Follow-up from CodeRabbit's review of #135 (thread). The refactor preserved this behavior byte-for-byte, so the decision was deliberately kept out of that PR.

Current behavior

collect_vault_files (crates/b2-core/src/ingest.rs) applies the hidden-name rule unevenly, and documents the unevenness as deliberate:

  • dot-prefixed directories are skipped everywhere (.b2/, .git/, .obsidian/) — both the ingest walk and the folder walk;
  • dot-prefixed resources are skipped from the inventory (.DS_Store, .gitignore are not vault material);
  • a dot-prefixed .md file (.scratch.md, .templates.md) still routes to notes — "the note route keeps its historical behavior" — so it gets a b2id stamped, chunks, embeddings, and graph presence.

pathspec::is_hidden (one predicate since #135, doc sharpened in abcc394) defines what hidden means; each walk chooses where to apply it. The asymmetry is visible but has never been ruled on.

The decision

Is a dot-prefixed .md vault material? This is a data-model question (data-model.md §1's definition of a note), not a code question. Two coherent answers:

  1. No — hidden means hidden. Apply is_hidden before the note/resource dispatch. Consistent with the resource route, the folder walk, and normalize_rel_dir refusing dot-segments in user input.
  2. Yes — keep the historical behavior and document it in data-model.md rather than only in a walk comment. An editor that writes .name.md drafts would keep them searchable.

If the answer is (1), the migration cost is real

Existing vaults with indexed dot-.md notes would, on the next reindex, have those rows ghost-pruned (#31) and every inbound link at them re-dangled (G5 surfaces them, but the churn is user-visible). The stamped b2id: lines stay in the files — B2 doesn't unwrite them (W4) — so flipping back re-adopts the same identities. Worth a line in the release notes if shipped.

Implementation then is the review's suggestion: hoist the is_hidden check above the match in collect_vault_files, plus a regression test that a dot-prefixed Markdown file is absent from the collected note paths (and one that plan_reindex agrees, since it shares the walk).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions