refactor: extract shared vdir constants and diagnostics helpers#61
Merged
jamestexas merged 1 commit intomainfrom Feb 27, 2026
Merged
refactor: extract shared vdir constants and diagnostics helpers#61jamestexas merged 1 commit intomainfrom
jamestexas merged 1 commit intomainfrom
Conversation
Move duplicated parseDiagPath/isDiagPath from FUSE and NFS backends into internal/graph/vdirpath.go alongside the existing callers/callees helpers. Add named constants for all virtual directory/file names (_schema.json, _diagnostics, context, PROMPT.txt, callers, callees, last-write-status, ast-errors, lint) and use them across both backends. Net reduction of 20 lines; eliminates ~30 lines of duplicated parsing logic and replaces 40+ scattered string literals with shared constants.
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
IsDiagPath()andParseDiagPath()intointernal/graph/vdirpath.goalongside existing callers/callees helpersisDiagPath()andparseDiagPath()from bothinternal/fs/root.goandinternal/nfsmount/graphfs.goDetails
vdirpath.goalready shared callers/callees parsing between backends. This extends it with:IsDiagPath(path)/ParseDiagPath(path)— reuses the existingparseVDirPath()generic implementationSchemaDotJSON,DiagnosticsDir,ContextFile,PromptFile,CallersDir,CalleesDir,DiagLastWrite,DiagASTErrors,DiagLintFUSE's
isDiagPath()retains itsWritable &&guard by wrapping the shared helper.Not touched (intentionally):
diagContent()stays per-backend (different backing stores),.query/stays FUSE-only, leyline pre-materializes into SQLite so has no path parsing.Net: 3 files changed, 83 insertions, 103 deletions (-20 lines).
Test plan
task fmt && task vet && task lint— cleantask test— all passing, zero failures