Skip to content

feat(core): a path-table directory name is one level, like ls - #1251

Merged
thekevinscott merged 8 commits into
mainfrom
claude/1223-dir-one-level
Oct 5, 2026
Merged

thekevinscott merged 8 commits into
mainfrom
claude/1223-dir-one-level

Conversation

@thekevinbot

@thekevinbot thekevinbot commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #1223

A path-table directory name means one level, like ls docs. './', './docs' and './docs/' list the files directly inside that directory; * matches one level and ** any depth, so the recursive spellings are './**' and './docs/**'. The same rule applies to absolute, ../ and ~/ path-tables and to the --on-file form. The files-table and hookless-[[table]] hints now point at FROM './**'.

Spec rows and where each is pinned:

You write dirsql scans path_table.rs unit test CLI e2e
'./' files directly inside the root a_bare_dot_slash_lists_the_index_root_one_level_deep a_bare_dot_slash_lists_the_working_directory_one_level_deep
'./docs', './docs/' files directly inside docs/ a_relative_directory_lists_one_level, ..._with_a_trailing_slash_... a_directory_path_lists_one_level
'./*' same as './' an_explicit_star_is_the_same_as_the_bare_dot_slash same name
'./**' every file, recursively a_double_star_scans_every_depth same name
'./docs/**/*.md' markdown at any depth under docs/ a_relative_recursive_glob_is_used_as_written a_recursive_glob_under_a_directory_is_used_as_written
'./notes/today.md' that one file a_relative_single_file_roots_at_its_parent --

Absolute, ../, ~/, filesystem root, and Windows drive forms each have a one-level unit test. --on-file: path_table_parser.rs::a_parsed_directory_path_table_lists_one_level. Watch mode: path-tables have no watcher and re-scan per statement, so the two-levels-down case is pinned as a live re-scan test (path_table_globs.rs::a_file_created_two_levels_down_does_not_join_a_one_level_table); handle_upsert in lib.rs is the declared-table watcher path and is part 2's surface.

Red commit 526e138 went red in CI on Unit tests for the asserted reason (left: "**/*", right: "*") plus the hint assertions.

Every test, doc, README passage, default_config.toml comment, and binding test that wrote FROM './' meaning recursive now writes './**'. Headline one-liners over flat fixtures were left alone. docs/reference/path-tables.md "Writing the path" is rewritten; the "Hidden files" section is untouched (#1249). Nothing under changelog.d/ or migrations.d/ was edited; new fragments only.

Rebase onto main (after #1236, #1239, #1248, #1250)

path_table.rs now roots the walk at the literal prefix (#1236), so a ./docs table is root=/index/docs, glob=*, path_prefix=docs rather than the pre-rebase glob=docs/*. The one-level rule lands in split_target as DIRECTORY_GLOB = "*" in place of RECURSIVE_GLOB = "**/*"; the prefix walk and the parallel walk are untouched. Main's an_explicit_star_is_left_non_recursive is subsumed by an_explicit_star_is_the_same_as_the_bare_dot_slash and dropped. In docs/reference/path-tables.md main's glob-rule sentence in "Skip rules" is kept with its example spelled './**'.

Post-rebase hand-check, cargo build -p dirsql --features cli --release, run from a fixture of a.txt, d1/b.txt, d1/c.txt, d1/d2/e.txt, d1/d2/f.txt:

Query count(*)
'./' 1
'./d1' 2
'./**' 5
'./*' 1
'./d1/*.txt' 2
SELECT path FROM './d1/**' 4 rows, d1/b.txt .. d1/d2/f.txt (index-root-relative)

Hand-check

cargo build --release --features cli, then the binary against a fixture of root.md, folder/a.md, folder/sub/b.md, sibling/c.md, notes/today.md:

Query Rows
'./' 1: root.md
'./folder' 1: folder/a.md
'./folder/' 1: folder/a.md
'./*' 1: root.md
'./**' 5: all files
'./folder/**/*.md' 2: folder/a.md, folder/sub/b.md
'./notes/today.md' 1: notes/today.md
'/abs/folder' 1: .../folder/a.md
'/abs/folder/**' 2
--on-file over './folder' / './folder/**' 1 / 2 titles
SELECT 1 FROM files no such table: files; did you mean FROM './**'?

Changelog / Migrations

  • packages/rust/changelog.d/2026-10-03-path-table-directory-one-level.md
  • packages/python/changelog.d/2026-10-03-path-table-directory-one-level.md
  • packages/ts/changelog.d/2026-10-03-path-table-directory-one-level.md
  • packages/rust/migrations.d/2026-10-03-path-table-directory-one-level.md
  • packages/python/migrations.d/2026-10-03-path-table-directory-one-level.md
  • packages/ts/migrations.d/2026-10-03-path-table-directory-one-level.md

PARITY.md

Row added: "Path-table directory name is one level; ** descends (#1223)" -- Y/Y/Y. No drift: the rule lives in the shared core and both bindings pin it (path_table_test.py::it_lists_one_level_for_a_directory_name, path-table.test.ts "lists one level for a directory name").

E2E Verification

  • Ran e2e suites locally for every affected SDK
  • Python SDK e2e: pass (41 passed, 1 xfailed)
  • TypeScript SDK e2e: pass (18 passed)
  • Rust core e2e (if applicable): pass (cargo test --workspace --features cli, 63 test binaries, 0 failed)
  • packages/python/e2e-attestations/claude-1223-dir-one-level.json receipt written (just e2e-attest-python)
  • packages/ts/e2e-attestations/claude-1223-dir-one-level.json receipt written (just e2e-attest-ts)
  • Command(s) run (post-rebase, in order): cargo test --workspace --features cli, cargo build -p dirsql --features cli --release, uv run maturin develop --release (packages/python), pnpm build (packages/ts), just e2e-attest-python, just e2e-attest-ts, just preflight
  • Result summary: all green locally; just preflight reported 0 failing pair(s), 3 skipped

@thekevinbot
thekevinbot force-pushed the claude/1223-dir-one-level branch from 6c11b71 to 58da7e3 Compare October 5, 2026 00:28
@thekevinscott
thekevinscott merged commit cd65f69 into main Oct 5, 2026
84 checks passed
@thekevinscott
thekevinscott deleted the claude/1223-dir-one-level branch October 5, 2026 00:35
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