fix(fs): suppress data-first capability dirs on file-first workspaces#51
Merged
Conversation
File-first workspaces present markdown/plaintext files. Exposing .by/, .filter/, .order/, .export/, .columns/, .first/, .last/, .sample/, .indexes/, .modify/, .delete/, .import/ at workspace root or in subdirs leaks the backing table's row/column abstraction (including internal columns like parent_id, filetype, encoding) into a surface that should look like a directory of files. This was an emergent side effect of the data-first pipeline machinery being reused for synth views; no spec or ADR endorses workspace-level data-first access. Suppress at the parser layer. (*Operations).parsePath is the single chokepoint every production entry point (Stat, ReadDir, Read, Write, Readlink, Mkdir, etc.) goes through. After resolveSchema, the new rejectDataFirstCapOnSynthWorkspace helper detects blocked path shapes, confirms via the existing synth-view cache that the target is in fact a synth view (regular data-first tables in the user schema are unaffected), and returns ErrInvalidPath with a hint pointing at .tables/<workspace>/ for callers who need the data-first surface. File-first control surfaces (.info/, .history/, .log/, .savepoint/, .undo/, .format/) remain accessible. .log/ and .savepoint/ redirect the FSContext schema to tigerfs, so the gate (which only fires on the user schema) correctly leaves .log/.by/type/ etc. working. Existing .tables/<workspace>/.by/ etc. access continues to work unchanged: that route uses Schema=tigerfs from parse time, which the gate fast-bypasses. No DB changes, no migration. One helper + one call site + a doc comment on pure ParsePath pointing future contributors at the parser- aware wrapper for policy enforcement.
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.
File-first workspaces present markdown/plaintext files. Exposing .by/, .filter/, .order/, .export/, .columns/, .first/, .last/, .sample/, .indexes/, .modify/, .delete/, .import/ at workspace root or in subdirs leaks the backing table's row/column abstraction (including internal columns like parent_id, filetype, encoding) into a surface that should look like a directory of files. This was an emergent side effect of the data-first pipeline machinery being reused for synth views; no spec or ADR endorses workspace-level data-first access.
Suppress at the parser layer. (*Operations).parsePath is the single chokepoint every production entry point (Stat, ReadDir, Read, Write, Readlink, Mkdir, etc.) goes through. After resolveSchema, the new rejectDataFirstCapOnSynthWorkspace helper detects blocked path shapes, confirms via the existing synth-view cache that the target is in fact a synth view (regular data-first tables in the user schema are unaffected), and returns ErrInvalidPath with a hint pointing at .tables// for callers who need the data-first surface.
File-first control surfaces (.info/, .history/, .log/, .savepoint/, .undo/, .format/) remain accessible. .log/ and .savepoint/ redirect the FSContext schema to tigerfs, so the gate (which only fires on the user schema) correctly leaves .log/.by/type/ etc. working.
Existing .tables//.by/ etc. access continues to work unchanged: that route uses Schema=tigerfs from parse time, which the gate fast-bypasses.
No DB changes, no migration. One helper + one call site + a doc comment on pure ParsePath pointing future contributors at the parser- aware wrapper for policy enforcement.