Refactor architecture into eight components and consolidate reliability work
Build and publish container images / images (push) Successful in 9m34s
Release container images / release (push) Successful in 36s

Extract Grammaratur, Dregarnuhr, Geduldh, Mestionora, Ordoschnellic, Schutzaria, Kunstzeal and Seheweit behind compatible application contracts.

Include accumulated editor resilience, navigation and theme UX, remote CLI, storage/schema and DR groundwork, tests and design/operations documentation.

Verified: uncached full Go suite; go vet ./...; race tests for all eight components; 11 targeted Chromium tests; Node suites; 19 Python CLI tests; reproducible editor build. No push, release tag or deployment in this checkpoint.
This commit is contained in:
Anya Tokugawa committed 2026-11-01 15:23:31 +09:00
1 parent 9dd425f765
commit d5d21b7841
302 files changed
+20037 -3492

No files matched your search

+7 -38
View File
@@ -4,14 +4,11 @@ import (
"encoding/json"
"errors"
"net/http"
"os"
"path/filepath"
"runtime"
"strconv"
"strings"
"syscall"
"time"
"pageswiki/internal/seheweit"
"pageswiki/internal/store"
)
@@ -250,7 +247,7 @@ func (s *Server) handleQueueAPI(w http.ResponseWriter, r *http.Request) {
writeEventJSON(w, 500, map[string]string{"error": "could not load resource history"})
return
}
writeEventJSON(w, 200, map[string]any{"samples": samples, "hours": hours, "retention_days": 7})
writeEventJSON(w, 200, map[string]any{"samples": samples, "hours": hours, "retention_days": seheweit.RetentionDays})
return
}
}
@@ -258,39 +255,11 @@ func (s *Server) handleQueueAPI(w http.ResponseWriter, r *http.Request) {
writeEventJSON(w, http.StatusMethodNotAllowed, map[string]string{"error": "unsupported queue operation"})
}
func (s *Server) resourceStatus() map[string]any {
var memory runtime.MemStats
runtime.ReadMemStats(&memory)
root := s.store.DocumentRoot
if root == "" {
root = "."
}
root, _ = filepath.Abs(root)
var fs syscall.Statfs_t
_ = syscall.Statfs(root, &fs)
total := fs.Blocks * uint64(fs.Bsize)
available := fs.Bavail * uint64(fs.Bsize)
loadAverage := ""
if data, err := os.ReadFile("/proc/loadavg"); err == nil {
fields := strings.Fields(string(data))
if len(fields) >= 3 {
loadAverage = strings.Join(fields[:3], " ")
}
}
func (s *Server) resourceStatus() seheweit.Snapshot {
stats, _ := s.store.ActiveEventStats()
settings, _ := s.store.GetQueueSettings()
return map[string]any{
"timestamp_ms": time.Now().UnixMilli(),
"io": readProcessIO(),
"cpu": map[string]any{"logical_cpus": runtime.NumCPU(), "load_average": loadAverage},
"memory": map[string]any{
"heap_bytes": memory.HeapAlloc, "go_system_bytes": memory.Sys,
"gc_cycles": memory.NumGC, "goroutines": runtime.NumGoroutine(),
},
"storage": map[string]any{
"path": root, "total_bytes": total, "used_bytes": total - available,
"available_bytes": available,
},
"queue": map[string]any{"stats": map[string]int{"queued": stats.Queued, "running": stats.Running}, "active_workers": s.schedulerRunning.Load(), "paused": settings.Paused},
}
return seheweit.Collect(s.store.DocumentRoot, seheweit.Queue{
Stats: seheweit.QueueStats{Queued: stats.Queued, Running: stats.Running},
ActiveWorkers: s.schedulerRunning.Load(), Paused: settings.Paused,
})
}