Problem
hunk session navigate does not consistently enforce one complete navigation mode across the CLI and daemon API.
Two invalid or ambiguous requests currently pass validation:
-
Directional navigation can be combined with absolute targets, for example:
hunk session navigate <session-id> --next-comment --file src/app.ts --hunk 2
Directional navigation wins and the file/hunk arguments are silently ignored.
-
The daemon accepts absolute hunk or line navigation without filePath. It dispatches the command, but the live terminal cannot resolve an absolute target without a file.
These behaviors predate the comment-ID cleanup in #896, but that work makes the remaining validation gap explicit at the broker boundary.
Expected behavior
Navigation should select one complete mode:
- comment ID:
commentId only;
- direction:
commentDirection only;
- absolute location:
filePath plus either a hunk number or complete side/line coordinates.
For compatibility, a raw API request containing complete line coordinates alongside a hunk number may continue to prefer the exact line, but this precedence should be explicit and tested.
Acceptance criteria
- Reject directional navigation combined with file, hunk, or line targets in both CLI and daemon validation.
- Require
filePath for daemon hunk and line navigation.
- Preserve the documented exact-line precedence for compatible raw API requests.
- Add CLI and broker regression tests for accepted and rejected mode combinations.
- Keep the terminal bridge as a pass-through adapter.
- Add a patch Changeset for the validation fix.
Context
This comment was generated by Pi using GPT-5.6 Sol
Problem
hunk session navigatedoes not consistently enforce one complete navigation mode across the CLI and daemon API.Two invalid or ambiguous requests currently pass validation:
Directional navigation can be combined with absolute targets, for example:
Directional navigation wins and the file/hunk arguments are silently ignored.
The daemon accepts absolute hunk or line navigation without
filePath. It dispatches the command, but the live terminal cannot resolve an absolute target without a file.These behaviors predate the comment-ID cleanup in #896, but that work makes the remaining validation gap explicit at the broker boundary.
Expected behavior
Navigation should select one complete mode:
commentIdonly;commentDirectiononly;filePathplus either a hunk number or completeside/linecoordinates.For compatibility, a raw API request containing complete line coordinates alongside a hunk number may continue to prefer the exact line, but this precedence should be explicit and tested.
Acceptance criteria
filePathfor daemon hunk and line navigation.Context
This comment was generated by Pi using GPT-5.6 Sol