Repository navigation
fix: resolve prompt paths against the repo root, not the current directory - #30
Merged
Merged
Conversation
sujal-maheshwari2004
force-pushed
the
fix/repo-root-paths
branch
from
November 15, 2026 05:10
ee5d3cf to
9e2c271
Compare
sujal-maheshwari2004
requested review from
guptadevik2003 and
iamDyeus
as code owners
November 15, 2026 05:10
…ctory openRepo found the repo from any subdirectory, but prompt discovery, URIs and file writes were relative to cwd. Run from acme/, publish sent support/agent.prompt as priompt://support/agent (another org), diff reported every prompt as deleted plus new, and commit/promote/log failed. main now chdirs to the worktree root and path arguments are mapped to repo-relative paths (relative, ./-prefixed or absolute). A bare publish from a subdirectory publishes the prompts under that subdirectory. Outside a repo nothing changes. Fixes #17
sujal-maheshwari2004
force-pushed
the
fix/repo-root-paths
branch
from
November 15, 2026 05:13
9e2c271 to
ecd853a
Compare
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.
Fixes #17.
openRepofound the repo from any subdirectory, but prompt discovery, URIs and file writes were relative to the current directory. A prompt's URI comes from its repo path, so running fromacme/publishedsupport/agent.promptaspriompt://support/agent, a different org.diff,commit,promoteandlogbroke the same way.Change
promptctlmoves to the worktree root and records where it was started (cwdInRepo).log,promoteandpublishgo throughrepoPath, so relative,./-prefixed and absolute paths all become repo-relative.publish(no paths) from a subdirectory publishes only the prompts under that subdirectory, instead of the whole repo. Validation beforecommit/pushstays repo-wide.publishstill works on plain files.Tested
TestSubdirectoryPathsResolveAgainstRepoRoot: fromacme/support, three forms of the path (agent.prompt,./agent.prompt, absolute) all map toacme/support/agent.prompt/priompt://acme/support/agent, anddiffreportsno prompt changes vs HEAD.priompt serve, runningpublishfromacme/:main:published priompt://support/agentpublished priompt://acme/support/agentgo vet ./...andgo test ./...pass.Touches the same file as #29 but different functions, so it should merge cleanly in either order.