Add Python semantic-language search CLI#5
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2b8288a904
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| normalized = path.removeprefix("./") | ||
| if normalized in owner_paths: |
There was a problem hiding this comment.
Relativize absolute ingest paths before owner matching
When stdin contains absolute paths (for example rg -n pattern /repo/src or editor/vimgrep output with full filenames), this normalization only strips ./, while owner_paths are project-relative display paths. Those records therefore miss the parser-visible owner, so the ingest packet omits the |owner section and emits unusable follow-up targets like /repo/src/foo.py instead of src/foo.py, despite the ingest view promising owner grouping.
Useful? React with 👍 / 👎.
| """Run the CLI using process environment arguments.""" | ||
|
|
||
| return run_cli(sys.argv[1:]) | ||
| stdin = "" if sys.stdin.isatty() else sys.stdin.read() |
There was a problem hiding this comment.
Avoid draining stdin for non-ingest commands
The console entrypoint now reads all non-tty stdin before it even parses the command, but only search ingest needs stdin. In a pipeline or wrapper where stdin is a pipe/FIFO/large stream, commands such as py-harness --help, py-harness check, or py-harness search workspace can block until EOF or consume unbounded input that they ignore; the read should be gated on the parsed ingest command instead.
Useful? React with 👍 / 👎.
Align Python compact semantic-search output with canonical project path values by rendering location metadata as path, line, and column fields. Tighten the package-local packet schema path fields to reject rank-prefixed and path:line locator strings.
Permit "." as the canonical project-root path while keeping rank prefixes, absolute paths, parent traversal, and path:line locators invalid.
Summary
Validation