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:

Validation Run:

Findings:

  1. entire trail is hidden from top-level help
    It may work directly but discoverability is intentionally/accidentally disabled.
  2. trail create mutates git before auth/API succeeds
    If the user is not logged in or the API rejects the request, the repo may already be changed.
  3. trail create / trail update silently accept extra positional args
  4. trail create --status is not locally validated
  5. Trail lookup only searches the first 200 trails
  6. trail update --body "" cannot clear a body
  7. Finding filters are weakly validated
  8. 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

Additional Fixes:

Further Recommendations:

  1. Make data-fetching behaviors explicit:
    • Avoid surprises in user command expectations and streamline command handling.
    • Introduce explicit subcommands for clarity.
  2. Remove/disable --phase mutation unless the API supports it.
  3. Investigate persistent body behavior in the API interactions.