Fix Trail Command Behavior and API Alignment · Entire
Investigate Entire Trail Command
Investigate every "entire trail" command whether it’s functional. Is there anything missing/broken, any bugs?
Commands present:
entire trailentire trail listentire trail createentire trail updateentire trail watchentire trail findingentire trail finding list|add|show|apply|resolve|dismiss|reopen|watch
Validation Run:
go test ./cmd/entire/cli -run 'Trail|trail'✅go test ./cmd/entire/cli/...✅- Help output renders for the command tree ✅
Findings:
entire trailis hidden from top-level help
It may work directly but discoverability is intentionally/accidentally disabled.trail createmutates git before auth/API succeeds
If the user is not logged in or the API rejects the request, the repo may already be changed.trail create/trail updatesilently accept extra positional argstrail create --statusis not locally validated- Trail lookup only searches the first 200 trails
trail update --body ""cannot clear a body- Finding filters are weakly validated
- SSE watch treats clean EOF as
io.ErrUnexpectedEOF
Overall Conclusion:
The command tree is wired and tests pass, but there are real functional/UX bugs around create side effects, lookup pagination, update clearing fields, arg/status validation, and watch EOF handling.
Implementation of Fixes for Items 2-8
trail createnow validates status locally and handles errors appropriately.trail updateandtrail createreject unexpected positional args.- Local validation for finding finding filters is enforced.
- Clean SSE behavior is now handled.
Additional Fixes:
- Title is enforced as required.
- Added API/model support for trail
phaseand surfaced it in CLI outputs.
Further Recommendations:
- Make data-fetching behaviors explicit:
- Avoid surprises in user command expectations and streamline command handling.
- Introduce explicit subcommands for clarity.
- Remove/disable
--phasemutation unless the API supports it. - Investigate persistent body behavior in the API interactions.