fix(trail): align update + finding-add with current trails API

main

Commit

dipree3mo ago

Two trail commands had drifted from the live data API (verified against https://entire.io/api/openapi.json and live calls):

  • trail update PATCHed the single-trail endpoint with the trail id, but the API keys that route by number and rejects an id with "Invalid trail number format" (HTTP 400). Send the trail number instead.

  • trail finding add POSTed a single flat comment to /reviews/comments, which no longer exists. Creating a finding now requires starting a review (POST /reviews) and posting a batch (POST /reviews/{id}/comments, body {comments:[...]}, response {results:[...]}). Per item, client_id is required (generated when --client-id is omitted), title was removed, and suggested_changes (array) became suggested_change (singular). The review is started with an empty body so the server resolves the code version — the API rejects a lone head_sha (base_sha and head_sha must be sent together or not at all).

Read/patch/apply/watch paths were unchanged and remain compatible.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com Entire-Checkpoint: b1e9c340736d

Checkpoints

Align Trail Commands with Updated API

Claude CodeOpus 4.8[1m]
View session
Checkpoint 1