Skip to content

Add [bundle] include / exclude globs - #83

Merged
kriswill merged 2 commits into
kriswill:mainfrom
jase-perf:feat/bundle-include-exclude
Oct 23, 2026
Merged

kriswill merged 2 commits into
kriswill:mainfrom
jase-perf:feat/bundle-include-exclude

Conversation

@jase-perf

Copy link
Copy Markdown
Contributor

A bundle can now be a subset of its directory. This lets a bundle sit at the root of a workspace that also holds markdown that isn't knowledge (READMEs, project notes, logs, task lists) and limit itself to the parts that are:

[bundle]
dir = "."
include = ["wiki/**", "sources/**"]   # a .md must match one; empty = every .md (today's behavior)
exclude = ["**/*.fulltext.md"]        # applied after include

Today the only way to keep files out is a leading . or _, which means renaming folders other tools depend on.

Behavior

  • Both lists are bundle-relative Bun.Glob patterns. Config validation rejects absolute paths and .., the same rule as the other path fields.
  • validate, viz and migrate walk through the filter, via a new bundleFilter() passed to walkMd(root, filter?).
  • Directories are pruned only when that's certain, so a narrow include never descends into the rest of a large tree. A directory is skipped when it's off every include's literal leading path (wiki/** never enters projects/), or under an X/** exclude. A leading wildcard (**/*.md) or a non-/** exclude never prunes.
  • With both lists empty, nothing changes. The default config gains include: [], exclude: [], and config.test.ts was updated for that.

Testing

  • New tests in test/lib.test.ts cover doc matching, directory pruning, and a walkMd run on a real temp tree, with a spy confirming excluded trees are never entered. viz-app/config.test.ts covers parsing and the rejection of ../ and /-rooted globs.
  • On Linux (oven/bun:1.4.3): 607 pass / 0 fail, tsgo --noEmit clean.
  • I'm using it on a 3,015-file bundle that sits at the root of a notes vault, with include = ["wiki/**", "sources/**"].

It touches walkMd, and so does #82, so whichever merges second will have a one-hunk conflict there. Resolved, it's this branch's version with relUnder(root, abs) in place of abs.slice(root.length + 1); that combination passes 610/610 on Windows.

🤖 Generated with Claude Code

A bundle can now be a subset of its directory: include (a .md must match
one; empty = every .md) and exclude (applied after include), both
bundle-relative globs. This lets a bundle sit at the root of a workspace
that also holds non-concept markdown (READMEs, project notes, logs) and
limit itself to, say, ["wiki/**", "sources/**"].

validate, viz and migrate walk through the filter. Directories are
pruned only when that is certain, so a narrow include never descends
into the rest of a large tree: off every include's literal leading path,
or under an `X/**` exclude.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3ae215c3-bda7-441c-a596-feb06b750413
📥 Commits

Reviewing files that changed from the base of the PR and between 17a6b70 and f46b499.

📒 Files selected for processing: 7
  • lib.ts
  • migrate.ts
  • test/lib.test.ts
  • validate.ts
  • viz-app/config.test.ts
  • viz-app/config.ts
  • viz.ts
+---------------------------------------------------------------------------------+
| CodeRabbi is my uncle. He's a bit more orthodox. Feel lucky you got me instead. |
+---------------------------------------------------------------------------------+
  \
   \     /)/)
        ( '')
        /  |
      o(___)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

# Conflicts:
#	lib.ts
#	test/lib.test.ts
#	validate.ts
#	viz-app/config.test.ts
#	viz-app/config.ts
@kriswill
kriswill merged commit b76e3c8 into kriswill:main Oct 23, 2026
1 of 2 checks 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