| 1 | package agent |
| 2 | |
| 3 | import ( |
| 4 | "reasonix/internal/event" |
| 5 | "reasonix/internal/evidence" |
| 6 | "reasonix/internal/tool" |
| 7 | "reflect" |
| 8 | "testing" |
| 9 | ) |
| 10 | |
| 11 | func TestResultProjectionDoesNotRewriteEvidenceOrHistory(t *testing.T) { |
| 12 | a := New(nil, tool.NewRegistry(), NewSession("sys"), Options{}, event.Discard) |
| 13 | a.task.ledger.Record(evidence.Receipt{ToolName: "edit_file", Success: true, Write: true, Paths: []string{"auth.go"}}) |
| 14 | messages := a.Session().Snapshot() |
| 15 | receipts := a.task.ledger.Receipts() |
| 16 | a.emitTurnShadows("complete work") |
| 17 | if !reflect.DeepEqual(messages, a.Session().Snapshot()) || !reflect.DeepEqual(receipts, a.task.ledger.Receipts()) { |
| 18 | t.Fatal("result projection rewrote source records") |
| 19 | } |
| 20 | if a.CompletionReceipt().Verdict != "unknown" { |
| 21 | t.Fatal("host quality verdict created") |
| 22 | } |
| 23 | } |
| 24 |