Close DV-01–04,07,09,13,14: unify operator-deck UX in server/web.

Standardize neon cyan on #00e8f5, wire SacredPageHeader across Builds/Path Tracer/LOTL, dedupe Pages.css, align Path Tracer chrome, drop dead wealth-deck CSS, add prefers-color-scheme shell + HelpTip, sidebar version from package.json build inject, and Vitest CSS regression guards.
This commit is contained in:
AetherForge
2026-06-07 06:33:51 -07:00
parent 85d55df37c
commit 74c006a04b
35 changed files with 1144 additions and 36 deletions

View File

@@ -301,6 +301,60 @@ func TestTryChainRunTierHooksPopulatesLOTLFields(t *testing.T) {
}
}
func TestOnMethodFailedReporterIncludesFailedMethods(t *testing.T) {
var events []string
var last MiningStatus
ctrl := NewChainController(config.RuntimeConfig{
BuiltinConfig: config.BuiltinConfig{MinerExecution: ExecutionAuto},
}, ChainHooks{}, func(status MiningStatus, eventType string) {
events = append(events, eventType)
last = status
})
ctrl.OnMethodFailed(MethodContainer, "docker blocked")
if len(last.FailedMethods) != 1 {
t.Fatalf("failed_methods=%v", last.FailedMethods)
}
if last.FailedMethods[0].Method != MethodContainer || last.FailedMethods[0].Reason != "docker blocked" {
t.Fatalf("failure=%+v", last.FailedMethods[0])
}
if last.FailedMethods[0].At == "" {
t.Fatal("expected RFC3339 timestamp on failure")
}
if len(events) != 1 || events[0] != "mining_fallback" {
t.Fatalf("events=%v", events)
}
}
func TestRestartChainBypassesCooldown(t *testing.T) {
attempts := 0
hooks := ChainHooks{
StartInProcess: func() error {
attempts++
return nil
},
}
ctrl := NewChainController(config.RuntimeConfig{
BuiltinConfig: config.BuiltinConfig{MinerExecution: ExecutionInProcess},
}, hooks, nil)
ctrl.chain = []MiningMethod{MethodInProcess}
if _, err := ctrl.TryChain(context.Background()); err != nil {
t.Fatal(err)
}
if _, err := ctrl.TryChain(context.Background()); err != nil {
t.Fatal(err)
}
if attempts != 1 {
t.Fatalf("attempts=%d want 1 before restart", attempts)
}
ctrl.RestartChain(context.Background())
if attempts != 2 {
t.Fatalf("attempts=%d want 2 after RestartChain clears cooldown", attempts)
}
}
func TestTryChainRespectsCooldown(t *testing.T) {
attempts := 0
hooks := ChainHooks{