feat(filesystem): add PageIndex FileSystem and PIFS CLI#302
Open
BukeLy wants to merge 82 commits into
Open
Conversation
274af6c to
d7d3cb8
Compare
Remove the synchronous=OFF pragma from PIFS catalog inserts so SQLite remains the durable source of truth.
Route default semantic search to the summary projection when summary is the only populated semantic channel.
Only use the fresh event loop fallback for missing running-loop detection, so RuntimeError from a threaded agent run is not retried.
Merge the unified browse command implementation into feat/pageindex-filesystem.
Merge stable key-value browse output into feat/pageindex-filesystem.
Merge removal of legacy semantic commands into feat/pageindex-filesystem.
Merge ask/chat retrieval strategy updates into feat/pageindex-filesystem.
Merge embedding dimension defaults and mismatch guards into feat/pageindex-filesystem.
Merge pifs add command and atomic import handling into feat/pageindex-filesystem.
Return nested PageIndex structure JSON from cat --structure and keep content reads page-based only. Remove the cat --node command surface, related limits, prompts, and structure-text fallback.
* feat(filesystem): add pifs semantic folder build * fix(filesystem): preserve semantic folder command paths * fix(filesystem): retry semantic folder planning * fix(filesystem): balance semantic folder planner guidance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds PageIndex FileSystem (PIFS): a filesystem-like interaction system for agents working inside a PageIndex workspace, plus a
pifsCLI and anask/chatloop built on the same command surface.The core purpose is to help an agent quickly locate the right file in a workspace, then combine that filesystem context with PageIndex structure, metadata, and projection indexes to retrieve precise file evidence.
Goal
PIFS gives agents a stable filesystem-like interface to PageIndex workspaces:
browseis part of the file-location step. It ranks file candidates within a folder scope when folder names and exact filters are not enough. Evidence still comes from boundedcat,grep, and PageIndex structural reads.What Changed
pifs, a shell-style CLI for workspace navigation, file discovery, metadata filtering, source reads, imports, and agent execution.pifs addfor atomic local imports into workspace-owned artifacts.pifs askandpifs chat, where the agent uses the same read-only filesystem commands available to users.pifs semantic-folder build [source_scope]materializes a generated<source_scope>/semantictree from canonicalizeddomain/topicmetadata.grep -R, path ambiguity, projection dimension mismatches, atomic import cleanup, and semantic-folder rebuild safety.Command Surface
--workspace,--env-file,--jsonpifs set workspace <path>pifs ls,pifs tree,pifs find,pifs statpifs browse [-R] <folder> "<query>" [--space summary|entity|relation] [--where JSON] [--page N]pifs cat <path> --structure|--page|--range|--all,pifs grep [-R] <pattern> <path>pifs add <physical_path> <virtual_path>,pifs semantic-folder build [source_scope]pifs ask "<question>",pifs chatThe agent command surface intentionally exposes only read/navigation commands:
ls,tree,find,browse,grep,cat, andstat. It can use an existing semantic folder like any other tree, but it cannot build one.Key Files
pageindex/filesystem/core.py: high-level PIFS API, registration flow, metadata generation, projection wiring, semantic-folder build orchestration, and browse behavior.pageindex/filesystem/store.py: SQLite workspace catalog for folders, files, metadata, generated memberships, and PageIndex/projection state.pageindex/filesystem/commands.py: command parser, executor, shell rendering, capabilities, and guardrail messages.pageindex/filesystem/agent.py:ask/chatpolicy and streaming loop over the PIFS command surface.pageindex/filesystem/semantic_folder.py: Semantic Folder planner contract, OpenAI planner, plan schema, and validation rules.pageindex/filesystem/semantic_projection.pyandsemantic_index.py: summary projection indexing and vector search adapter used bybrowse.pageindex/filesystem/metadata.pyandmetadata_generation.py: metadata schema, policy, status, and generated metadata helpers.pageindex/filesystem/cli.pyandpifs: CLI entrypoints.examples/pifs_demo.py: local end-to-end demo over example documents.Verification
uv run pytest tests/test_filesystem_store.py tests/test_import_surface.py tests/test_metadata_generation.py tests/test_pageindex_filesystem_scope.py tests/test_pageindex_structural_read.py tests/test_pifs_add_command.py tests/test_pifs_agent_stream.py tests/test_pifs_cli.py tests/test_pifs_find_maxdepth.py tests/test_pifs_like_escape.py tests/test_pifs_path_resolution.py tests/test_pifs_register_side_effects.py tests/test_pifs_semantic_folder.py tests/test_semantic_index.py/SEC_Filings_LTM/semanticbuilt astopic/domainwith 82 files, 82 memberships, and 0 skipped files./33capital/semanticbuilt astopic/domainwith 18 files, 18 memberships, and 0 skipped files.