Unify labels, byte units, snapshot numbers and spelling
This commit is contained in:
@@ -121,7 +121,7 @@ func (m *Manager) beginReviews(ctx context.Context, ref store.SnapshotRef) error
|
||||
}
|
||||
changes, err := git.Compare(ctx, project.RepoPath, project.DefaultBranch, snap.CommitSha, snap.TreeSha, "")
|
||||
if err != nil {
|
||||
return finished(api.ReviewStateFailed, project.ReviewWorkflow, fmt.Sprintf("byre couldn't compare snapshot %d with %s: %v", snap.N, project.DefaultBranch, err))
|
||||
return finished(api.ReviewStateFailed, project.ReviewWorkflow, fmt.Sprintf("byre couldn't compare snapshot #%d with %s: %v", snap.N, project.DefaultBranch, err))
|
||||
}
|
||||
if len(changes.Files) == 0 {
|
||||
slog.Info("review skipped, snapshot has no diff", "task", task.Id, "snapshot", snap.N)
|
||||
@@ -243,7 +243,7 @@ func (m *Manager) reviewPrompt(ctx context.Context, task api.Task, project api.P
|
||||
|
||||
b := &strings.Builder{}
|
||||
fmt.Fprintf(b, "Review the work of the agent on the byre task %q, as reviewer %q of the project's review workflow %q.\n\n%s\n\n", task.Title, stage, project.ReviewWorkflow, strings.TrimSpace(workflow.Get(def, stage).Prompt))
|
||||
fmt.Fprintf(b, "It is snapshot %d of the task, commit %s, checked out in your working directory. The change is all of the task's work, `git diff %s %s` (from the merge-base with %s); %d files changed:\n",
|
||||
fmt.Fprintf(b, "It is snapshot #%d of the task, commit %s, checked out in your working directory. The change is all of the task's work, `git diff %s %s` (from the merge-base with %s); %d files changed:\n",
|
||||
snap.N, snap.CommitSha, changes.Base, snap.CommitSha, project.DefaultBranch, len(changes.Files))
|
||||
for i, f := range changes.Files {
|
||||
if i == maxReviewFiles {
|
||||
@@ -425,7 +425,7 @@ func findingsMessage(n int, reviews []api.Review) string {
|
||||
return ""
|
||||
}
|
||||
return fmt.Sprintf(findingsPreamble+"%d of your work has finished, and its reviewers raised the findings below. Reviewers can be wrong or miss context: check each one against the code and your brief. "+
|
||||
"Before you change anything, answer each finding with respond_to_finding (snapshot %d, the reviewer's name and the finding's number): fixing if it holds up and you'll act on it, ignoring with your reason if you're leaving it. "+
|
||||
"Before you change anything, answer each finding with respond_to_finding (snapshot #%d, the reviewer's name and the finding's number): fixing if it holds up and you'll act on it, ignoring with your reason if you're leaving it. "+
|
||||
"The human sees your answers on the findings and can overrule an ignore.", n, n) + b.String()
|
||||
}
|
||||
|
||||
@@ -480,16 +480,16 @@ func (m *Manager) respondToFindingTool(l *live) mcp.Tool {
|
||||
}
|
||||
}
|
||||
if reviewID == "" {
|
||||
return "", fmt.Errorf("%w: snapshot %d has no finished review by reviewer %q", ErrInvalid, args.Snapshot, args.Reviewer)
|
||||
return "", fmt.Errorf("%w: snapshot #%d has no finished review by reviewer %q", ErrInvalid, args.Snapshot, args.Reviewer)
|
||||
}
|
||||
err = m.store.SetFindingResponse(ctx, reviewID, args.Finding-1, api.FindingResponse{Response: args.Response, Reason: reason}, agentActor)
|
||||
if errors.Is(err, store.ErrNotFound) {
|
||||
return "", fmt.Errorf("%w: reviewer %q's review of snapshot %d has no finding %d", ErrInvalid, args.Reviewer, args.Snapshot, args.Finding)
|
||||
return "", fmt.Errorf("%w: reviewer %q's review of snapshot #%d has no finding %d", ErrInvalid, args.Reviewer, args.Snapshot, args.Finding)
|
||||
}
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return fmt.Sprintf("Recorded: %s finding %d of reviewer %q's review of snapshot %d.", args.Response, args.Finding, args.Reviewer, args.Snapshot), nil
|
||||
return fmt.Sprintf("Recorded: %s finding %d of reviewer %q's review of snapshot #%d.", args.Response, args.Finding, args.Reviewer, args.Snapshot), nil
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -671,9 +671,9 @@ func (m *Manager) stopStuckReviewers(ctx context.Context, h Health) {
|
||||
|
||||
func reviewName(r api.Review) string {
|
||||
if r.Stage == "" {
|
||||
return fmt.Sprintf("review of snapshot %d", r.SnapshotN)
|
||||
return fmt.Sprintf("review of snapshot #%d", r.SnapshotN)
|
||||
}
|
||||
return fmt.Sprintf("%q review of snapshot %d", r.Stage, r.SnapshotN)
|
||||
return fmt.Sprintf("%q review of snapshot #%d", r.Stage, r.SnapshotN)
|
||||
}
|
||||
|
||||
func reviewLine(r api.Review) string {
|
||||
|
||||
Reference in New Issue
Block a user