inspect: clearer end-of-run trail confirmation (posted+link / nothing to report) · Entire

inspect: clearer end-of-run trail confirmation (posted+link / nothing to report)

b8fa10c→main·

dipree·1mo ago·2 files·+112 added/-2 removed

When a trail-output run finishes, it now confirms one of:

Local-mode and cancelled runs stay silent about the trail. Adds TestMaybePostReviewToTrail covering all branches (local silent, posted via hook, nothing-to-report skip+confirm, error surfaced, cancelled silent).

Sessions

30b78df00de8View transcript

?\ Checkout the hand off doc that I just added.Pi·Opus 4.8·2 steps

Changes

2

1315 unmodified lines

1316
1317
1318
1319
1319
1320
1321
1322
1323
1323
1324
1325
1326
1327
1328
1329

1315 unmodified lines

verdict = combinedReviewNarratives(summary)
}
if verdict == "" {
    fmt.Fprintln(out, "Nothing to post to the trail (no review output produced).")
    fmt.Fprintln(out, "Nothing to report, so nothing was posted to the trail.")
    return
}
if deps.PostReviewToTrail == nil {
    fmt.Fprintln(out, "Trail output is not available here; keeping the review local.")
    fmt.Fprintln(out, "Trail output is not available here; the review was kept local.")
    return
}
// On success the hook prints its own confirmation and trail link.
if err := deps.PostReviewToTrail(ctx, out, profileName, verdict); err != nil {
    fmt.Fprintf(out, "Could not post the review to the trail: %v\n", err)
}

Mcmd/entire/cli/review/cmd.go+3/-2

package review

import (
    "bytes"
    "context"
    "errors"
    "fmt"
    "io"
    "strings"
    "testing"

reviewtypes "github.com/entireio/cli/cmd/entire/cli/review/types"
)

func postTrailSummary(narrative string) reviewtypes.RunSummary {
    var buf []reviewtypes.Event
    if narrative != "" {
        buf = []reviewtypes.Event{reviewtypes.AssistantText{Text: narrative}}
    }
    return reviewtypes.RunSummary{
        AgentRuns: []reviewtypes.AgentRun{{
            Name:   "claude-code",
            Status: reviewtypes.AgentStatusSucceeded,
            Buffer: buf,
        }},
    }
}

func TestMaybePostReviewToTrail(t *testing.T) {
    t.Parallel()

t.Run("local mode never posts and stays silent about the trail", func(t *testing.T) {
        t.Parallel()
        var out bytes.Buffer
        called := false
        deps := Deps{PostReviewToTrail: func(context.Context, io.Writer, string, string) error {
            called = true
            return nil
        }}
        maybePostReviewToTrail(context.Background(), &out, deps, ReviewOutputLocal, "general", postTrailSummary("a finding"), "")
        if called {
                
t.Error("local mode must not post to the trail")
        }
        if out.Len() != 0 {
            t.Errorf("local mode should print nothing about the trail, got %q", out.String())
        }
    })

t.Run("trail mode with output posts the verdict via the hook", func(t *testing.T) {
        ...
    })

// Additional test cases...
}

Acmd/entire/cli/review/posttrail_test.go+109