Skip to content

Fail config tables and parsed path-tables on a folder that cannot be listed - #1763

Merged
thekevinscott merged 6 commits into
mainfrom
bot/1740-unlistable-folder-fails-1118
Nov 19, 2026
Merged

thekevinscott merged 6 commits into
mainfrom
bot/1740-unlistable-folder-fails-1118

Conversation

@thekevinbot

@thekevinbot thekevinbot commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #1767

Part one of #1740. A folder a glob reaches that exists but cannot be listed (its open fails, or a read fails part-way) now fails:

  • Config tables: the build fails with cannot list folder '<path>': <reason>. This is DirSqlError::Io, carrying the OS error kind.
  • Parsed path-tables (--on-file / path_table_parser): the query fails with the same message.

This covers a literal path inside such a folder, per the ruling. A folder that does not exist, or a path that is a file ("Not a directory"), still holds nothing.

Out of scope, per the maintainer:

docs/reference/glob.md lists the departure from bash as the unlistable divergence. agents/reference/product-principles.md lists it too.

Red

The Rust integration tests job 134959810456 failed on red commit dc02b748. Three tests failed:

  • a_parsed_path_table_over_an_unlistable_folder_fails_naming_it: an unlistable folder must fail the query: [{"k": Text("a")}]
  • a_parsed_literal_path_inside_an_unlistable_folder_fails_naming_it: parser produced no rows for b.ndjson``
  • a_config_table_through_a_link_to_an_unlistable_folder_fails_its_build_naming_it: an unlistable folder must fail the build

Manual exercise

On a tree with data/open/a.ndjson and data/locked (chmod 311):

  • dirsql --on-file cat "SELECT * FROM './data/**/*.ndjson'" exits 1 with cannot list folder '/tmp/hand1740/data/locked': Permission denied (os error 13).
  • The literal path ./data/locked/b.ndjson fails the same way.
  • ./data/{open,missing}/*.ndjson exits 0 and returns [{"k":1}].
  • A config table through a symlink to the locked folder exits 1 with failed to load config: cannot list folder '.../idx/link'.

E2E Verification

  • Python: ran testing-conventions e2e attest 'uv run python -m pytest tests/e2e/on_file_query_test.py tests/e2e/on_file_failure_test.py tests/e2e/query_contract_test.py tests/e2e/glob_speed_recursive_test.py tests/e2e/glob_speed_symlink_test.py tests/e2e/many_dirs_speed_test.py tests/e2e/parent_then_child_test.py -x -q'. Result: 23 passed; receipt committed.
  • TypeScript: ran just e2e-attest-ts. Result: passed; receipt committed.
  • Rust: cargo test -p dirsql --features cli passes, with one exception: tests/non_utf8_names.rs cannot create its fixture on this host's tmpfs (EILSEQ). That fixture failure predates this change.

Changelog / Migrations

  • packages/rust/changelog.d/2026-11-18-unlistable-folder-fails.md
  • packages/rust/migrations.d/2026-11-18-unlistable-folder-fails.md (scan_directory_reporting, scan_glob and scan_glob_checking_root now return Result)

@thekevinbot thekevinbot changed the title Fail the scan when a folder a glob reaches cannot be listed Fail config tables and parsed path-tables on a folder that cannot be listed Nov 18, 2026
@thekevinbot
thekevinbot marked this pull request as ready for review November 18, 2026 17:00
…older-fails-1118

# Conflicts:
#	packages/rust/src/scanner.rs
@thekevinscott
thekevinscott merged commit 582b92b into main Nov 19, 2026
90 checks passed
@thekevinscott
thekevinscott deleted the bot/1740-unlistable-folder-fails-1118 branch November 19, 2026 02:53
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.

A folder that cannot be listed is treated as empty and the query succeeds An unlistable folder fails config tables and parsed path-tables

2 participants