Skip to content

feat: add trail review CLI#1266

Open
dipree wants to merge 9 commits into
mainfrom
feat/trail-review-cli
Open

feat: add trail review CLI#1266
dipree wants to merge 9 commits into
mainfrom
feat/trail-review-cli

Conversation

@dipree
Copy link
Copy Markdown
Contributor

@dipree dipree commented May 26, 2026

https://entire.io/gh/entireio/cli/trails/425

Summary

  • Add entire trail finding for agent-native findings: dashboard, list/detail, create, status updates, patch apply, and SSE watch.
  • Default finding commands to the current branch's trail; explicit selectors are only overrides (425, trl_abc123, or feat/my-branch).
  • Reuse existing entire trail list --status any for discovery; this PR improves that output with NUM and TITLE columns.
  • Add trail-scoped finding creation via POST /api/v1/trails/{trail_id}/reviews/comments so agents do not need a review id.
  • Add manual golden-path e2e example: e2e/examples/trail-finding-golden-path.sh.

Golden path

entire trail list --status any
entire trail finding
entire trail finding list
entire trail finding add \
  --title "Missing expiry skew handling" \
  --body "Token refresh should allow clock skew before treating the session as expired." \
  --severity high \
  --confidence 0.94 \
  --file src/auth/session.ts \
  --line 88 \
  --client-id "agent-run-123:finding-7"
entire trail finding show <finding-id>
entire trail finding resolve <finding-id> -m "fixed in <sha>"
entire trail finding watch

Making a code suggestion

Attach a unified diff when creating the finding:

git diff > suggestion.diff
entire trail finding add \
  --title "Handle missing token" \
  --body "This path should return a typed auth error." \
  --severity medium \
  --file src/auth/session.ts \
  --line 88 \
  --patch-file suggestion.diff \
  --client-id "agent-run-123:finding-8"

--patch-file - reads the diff from stdin. --patch is also available for inline diffs. Users can later run:

entire trail finding apply <finding-id> --check
entire trail finding apply <finding-id> --resolve

Output examples

entire trail list --status any

  Recent trails · 2

  Open · 1

  NUM  BRANCH                  TITLE                   AUTHOR  UPDATED
  421  fix/auth-refresh        Fix token refresh       dipree  2d ago

  In review · 1

  NUM  BRANCH                  TITLE                   AUTHOR  UPDATED
  425  feat/trail-review-cli   Add trail review CLI    dipree  3m ago

entire trail finding

Trail #425  Add trail review CLI
Status: in_review   Branch: feat/trail-review-cli   Base: main
ID: trl_123

Open findings: 3  high 1  medium 1  low 1
Resolved: 2        Dismissed: 1     Stale: 0

High
  H src/auth/session.ts:88   cmt_high_123   Missing expiry skew handling

Actions:
  entire trail finding show <finding-id>
  entire trail finding add -m "finding body" --file path --line 42
  entire trail finding apply <finding-id> --resolve
  entire trail finding resolve <finding-id> -m "fixed in <sha>"
  entire trail finding dismiss <finding-id> -m "not applicable"
  entire trail finding watch

No current-branch trail fallback

No trail found for the current branch; showing trails in this repo.

  Recent trails · 2

  Open · 1

  NUM  BRANCH                  TITLE                   AUTHOR  UPDATED
  421  fix/auth-refresh        Fix token refresh       dipree  2d ago

  In review · 1

  NUM  BRANCH                  TITLE                   AUTHOR  UPDATED
  425  feat/trail-review-cli   Add trail review CLI    dipree  3m ago

entire trail finding list

ID            SEV     STATUS  LOCATION                 TITLE
cmt_high_123  high    open    src/auth/session.ts:88   Missing expiry skew handling
cmt_med_456   medium  open    src/api/client.ts:141    Retry loop can spin forever

entire trail finding add

Created finding cmt_high_123 on trail #425 (Add trail review CLI)
Status:   open
Severity: high
Location: src/auth/session.ts:88
Title:    Missing expiry skew handling

entire trail finding show <finding-id>

Finding:  cmt_high_123
Status:   open
Severity: high
Confidence: 0.94
Location: src/auth/session.ts:88
Title:    Missing expiry skew handling

Token refresh should allow clock skew before treating the session as expired.

entire trail finding apply <finding-id>

Applied 1 suggested change(s).

With --check:

1 suggested change(s) apply cleanly.

With --resolve:

Applied 1 suggested change(s).
Updated finding cmt_high_123: open → resolved

Status commands

$ entire trail finding resolve <finding-id> -m "fixed in abc123"
Updated finding cmt_high_123: open → resolved

$ entire trail finding dismiss <finding-id> -m "not applicable"
Updated finding cmt_low_789: open → dismissed

$ entire trail finding reopen <finding-id> -m "rechecking"
Updated finding cmt_low_789: dismissed → open

entire trail finding watch

Watching trail #425 (gh/entireio/cli, id trl_123) — Ctrl+C to stop
● connected to trail trl_123 after event 17
[12:34:56] session started by agent:reviewer (code version cv_123)
[12:35:04] finding created by agent:reviewer on src/auth/session.ts (high) — cmt_high_123
[12:35:10] session ended by agent:reviewer (done)

API shape added for finding creation

POST /api/v1/trails/{trail_id}/reviews/comments
{
  "client_id": "agent-run-123:finding-7",
  "title": "Missing expiry skew handling",
  "body": "Token refresh should allow clock skew before treating the session as expired.",
  "severity": "high",
  "confidence": 0.94,
  "location": {
    "granularity": "line",
    "file_path": "src/auth/session.ts",
    "start_line": 88
  },
  "suggested_changes": [
    {
      "change_type": "unified_diff",
      "patch": "diff --git a/src/auth/session.ts b/src/auth/session.ts\n..."
    }
  ]
}

Tests

  • env -u PI_CODING_AGENT mise exec -- go test ./cmd/entire/cli ./cmd/entire/cli/api
  • env -u PI_CODING_AGENT mise exec -- go test ./...
  • mise exec -- golangci-lint run
  • git diff --check

Manual e2e example was added but not run automatically because it hits real services.

Copilot AI review requested due to automatic review settings May 26, 2026 11:11
@dipree dipree requested a review from a team as a code owner May 26, 2026 11:11
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit a68b07b. Configure here.

Comment thread cmd/entire/cli/trail_review_cmd.go
Comment thread cmd/entire/cli/trail_review_cmd.go Outdated
Entire-Checkpoint: 012879bddbd5
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Comment thread cmd/entire/cli/trail_review_cmd.go
Comment thread cmd/entire/cli/trail_review_cmd.go
Comment thread cmd/entire/cli/trail_review_cmd.go
dipree and others added 6 commits May 26, 2026 21:44
Entire-Checkpoint: 58d44d708365
Entire-Checkpoint: 1d403658033b
# Conflicts:
#	cmd/entire/cli/checkpoint/committed_reader_resolve.go
#	cmd/entire/cli/strategy/manual_commit.go
- Remove duplicate optionalStringValue helper; use stringPtrValue
- Inline pointless runTrailWatchWithOptions wrapper into runTrailWatch
- Add t.Parallel() to pure-function trail finding tests
- Guard .git path check with EqualFold for case-insensitive filesystems
- Document why the apply tests use bare git init over testutil.InitRepo

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 138a8d212cff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants