返回 DeepSeek-Reasonix
completion_shadow.go
根目录 / internal / agent / completion_shadow.go
1 package agent
2
3 import (
4 "reasonix/internal/completion"
5 "reasonix/internal/event"
6 )
7
8 // completionReceipt projects the report onto the delivery shape. Runs with
9 // nothing to judge return nil rather than an empty card: a receipt that says
10 // nothing is noise, and noise is what makes people stop reading receipts.
11 func completionReceipt(rep completion.Report) *event.CompletionReceipt {
12 if rep.Verdict == completion.VerdictUnknown && rep.Mutations == 0 && len(rep.Verifications) == 0 && len(rep.Gaps) == 0 && len(rep.Risks) == 0 {
13 return nil
14 }
15 out := &event.CompletionReceipt{AssessmentKind: rep.AssessmentKind, Verdict: rep.Verdict.String(), Risks: rep.Risks}
16 for _, change := range rep.Changes {
17 out.Changes = append(out.Changes, event.ReceiptChange{Path: change.Path, Reviewed: change.Reviewed})
18 }
19 for _, v := range rep.Verifications {
20 out.Verifications = append(out.Verifications, event.ReceiptVerification{Command: v.Command, Passed: v.Passed, Stale: v.Stale, ToolCallID: v.ToolCallID, ExitCode: v.ExitCode, Interrupted: v.Interrupted})
21 }
22 for _, gap := range rep.Gaps {
23 out.Gaps = append(out.Gaps, event.ReceiptGap{Kind: gap.Kind.String(), Detail: gap.Detail})
24 }
25 return out
26 }
27
27 lines GO