Improve portable launch, forge persistence, and operator auth UX.

Persist build extra_files for Build Manager history, print dashboard login on every start, add libp2p for Mesh P2P forge, defer WebSocket until login, and split devrun.bat from LAUNCH.bat with USB deck auto-detection.
This commit is contained in:
AetherForge
2026-05-31 18:56:43 -07:00
parent 2f528229f2
commit feba06e008
80 changed files with 2897 additions and 675 deletions

View File

@@ -0,0 +1,35 @@
//go:build windows
package stats
import "testing"
func TestFiletimeToUint64(t *testing.T) {
ft := filetime{LowDateTime: 0xDEADBEEF, HighDateTime: 0x00001234}
want := (uint64(0x1234) << 32) | 0xDEADBEEF
if got := filetimeToUint64(ft); got != want {
t.Fatalf("got %x want %x", got, want)
}
if filetimeToUint64(filetime{}) != 0 {
t.Fatal("zero filetime should be 0")
}
}
func TestCPUBusyPercentFromDeltas(t *testing.T) {
tests := []struct {
idle, total float64
want float64
}{
{idle: 25, total: 100, want: 75},
{idle: 0, total: 100, want: 100},
{idle: 100, total: 100, want: 0},
{idle: 0, total: 0, want: 0},
{idle: -10, total: 50, want: 100}, // over 100% busy clamped
{idle: 200, total: 100, want: 0}, // negative busy clamped to 0
}
for _, tc := range tests {
if got := cpuBusyPercentFromDeltas(tc.idle, tc.total); got != tc.want {
t.Fatalf("idle=%v total=%v: got %v want %v", tc.idle, tc.total, got, tc.want)
}
}
}