Skip to content

Report-only walkers and the read path still read a folder they could not list as "no files" (follow-up to #1546) #1652

Open

Description

@markramm

Follow-up to #1546 (draft PR #1647), from the groom of 2026-11-16, section 3, "Reports with the same blind spot" and "Neither", re-checked on dev f95e9b3.

What #1647 does. The index walk (KBRepository._folders, behind walk_files/list_files and _named) can now record each folder it could not list (unreadable= list), and the one reconcile keeps the rows under it and names it (unreadable_folders). None of the places below asks for that list, so each still reads "could not list" as "no files" or "absent". None of them calls remove_entry; no index row is lost through them. They are reports, counts, writers that skip a folder, and the read path.

The places (function names; line numbers drift):

Reports and counts:

  • pyrite/storage/index.py unmodellable_files (health and qa validate)
  • pyrite/storage/index.py the staleness check (check_staleness, the search path)
  • pyrite/storage/index.py files_the_index_may_miss
  • QAService._check_non_string_titles and _check_file_values
  • services/id_pin_service.py (pyrite ids missing, pyrite ids pin): list_files and _named("__collection.yaml")
  • services/file_search.py (pyrite search --files)
  • software-kb adr_listing (the next ADR number comes from the files)
  • the counts in cli/kb_commands.py (~388), KBRegistryService._health_kb's file_count (kb_path.rglob("*.md"), ~682) and cli/schema_commands.py (~403)
  • config.auto_discover_kbs

Writers that skip the folder silently:

  • SchemaService.migrate_entries (writes files)
  • KBService.reconcile_templated_subdirectories (moves files)

Surfaces that reconcile (rows kept by #1647) but do not yet name what they could not reach:

The read path:

  • with a folder at mode 000, pyrite get <id> -k <kb> answers NOT_FOUND for an entry under it ("could not tell" read as "absent").

Acceptance. With a KB folder at mode 000 (root readable), each place above either names the folder it could not list (local CLI: the KB-relative path and Pyrite's fixed KB_UNREADABLE text; REST/MCP: a count, through services/index_health.network_shape), or is shown by a test to be safe by reading; a command that did only part of its job exits per exit_unless_whole; pyrite get of an id under the folder answers KB_UNREADABLE, not NOT_FOUND. A test parametrised over the list fails when a new caller of the walk is added without being classified. A folder under a hidden or _templates part is never reported.

🤖 Filed from the work on #1546 (Claude Code)

Activity

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions