third version

This commit is contained in:
2026-06-08 07:05:01 +00:00
parent 282c841e11
commit 52a935b8b4
20 changed files with 1371 additions and 151 deletions
+15
View File
@@ -62,6 +62,21 @@ func TestUnhaltPreservesMode(t *testing.T) {
}
}
func TestCalendarRecoveryAllowsRestartInsideExitWindow(t *testing.T) {
ctx := context.Background()
repo := testutil.NewMemoryRepository()
system := New(repo, domain.ModePaper)
if err := system.Transition(ctx, domain.StateInit, domain.StatePlaceExitOrders); err != nil {
t.Fatalf("INIT -> PLACE_EXIT_ORDERS should be legal on restart: %v", err)
}
if err := repo.SaveSystemState(ctx, domain.StateHoldOvernight, domain.ModePaper, false, "", "{}"); err != nil {
t.Fatal(err)
}
if err := system.Transition(ctx, domain.StateHoldOvernight, domain.StatePlaceExitOrders); err != nil {
t.Fatalf("HOLD_OVERNIGHT -> PLACE_EXIT_ORDERS should be legal on restart: %v", err)
}
}
func TestRecoverFromMonitorEntryHaltsOnCriticalReconciliationDiff(t *testing.T) {
ctx := context.Background()
repo := testutil.NewMemoryRepository()