| 1 | package taskcontract |
| 2 | |
| 3 | import ( |
| 4 | "reasonix/internal/evidence" |
| 5 | "testing" |
| 6 | ) |
| 7 | |
| 8 | func TestRetiredPolicyDoesNotRewriteHistoricalReceipt(t *testing.T) { |
| 9 | for _, stamp := range []string{"", "standard", "delivery"} { |
| 10 | receipt := evidence.Receipt{PolicyFloor: stamp, ToolName: "bash", Command: "go test ./...", Success: false} |
| 11 | if ReceiptPolicyFloor(receipt) != PolicyFloorNone { |
| 12 | t.Fatalf("stamp %q revived policy", stamp) |
| 13 | } |
| 14 | if receipt.PolicyFloor != stamp || receipt.Success { |
| 15 | t.Fatal("compatibility read rewrote history") |
| 16 | } |
| 17 | } |
| 18 | } |
| 19 |