From cd1381592891156922e0058b47d244d639ce8ad4 Mon Sep 17 00:00:00 2001 From: jerryfane Date: Fri, 13 Nov 2026 13:40:08 +0100 Subject: [PATCH] feat!: drop wake panel, verdicts stub and dead leftovers (gitmoot/gitmoot#2593) Part A of gitmoot/gitmoot#2593 (dashboard dead views, keep Galaxy). Removed from the DataSource contract and UI: - Wake ledger: GET /api/wakes, /api/wakes/summary, /api/wakes/receipts, WakeDataSource and its types, the Overview "Wake obligations" panel and the "wake obligations" Today tile. gitmoot never implemented it; the panel always said "requires a newer gitmoot build". /api/stale-notifications covers the need. - GET /api/run/{id}/verdicts, DataSource.BinaryVerdicts and the BinaryVerdict(s) types (SkillOpt, gone since #1752; the UI never called it). - Attention.SynthItems / Attention.Candidates and their types and UI sections (always empty since #1752). - The groom_proposal Needs-you rank and "groom proposals" text. - The Tasks "Implementing" column and the planned/implementing ranks. - The Runs column's static orchestrate/goal/implement Kind facet. - The Charts "codex & kimi ... claude only" footnote; the runtime colour map gains omp (codex/claude/kimi stay for historical jobs). Unknown /api/ paths now answer 404 instead of the 200 SPA shell, so removed endpoints fail loudly. fakefeed drops the wake, verdict, synth and candidate fixtures and the groom/memory/pipeline/orchestration sample text. BREAKING CHANGE: DataSource no longer has BinaryVerdicts; Attention no longer has SynthItems/Candidates; WakeDataSource and the wake/verdict types are gone. --- api.go | 213 ++-------------------------------- api_test.go | 273 ++------------------------------------------ datasource.go | 149 ++---------------------- fakefeed.go | 228 ++++++------------------------------ server.go | 17 ++- server_test.go | 29 +++++ web/dist/index.html | 193 ++++++------------------------- 7 files changed, 133 insertions(+), 969 deletions(-) diff --git a/api.go b/api.go index 9e23bf6..c84334b 100644 --- a/api.go +++ b/api.go @@ -17,15 +17,6 @@ import ( const ( workflowMaxRuns = 50 workflowMaxNotes = 200 - wakeDefaultLimit = 100 - wakeMaxLimit = 500 - wakeErrorScanLimit = 256 - wakeErrorTimeout = "TIMEOUT" - wakeErrorRateLimited = "RATE LIMITED" - wakeErrorAuth = "AUTH" - wakeErrorNotFound = "NOT FOUND" - wakeErrorTransport = "TRANSPORT" - wakeErrorDelivery = "DELIVERY ERROR" changePollInterval = time.Second changeHeartbeatInterval = 15 * time.Second changeClientCap = 32 @@ -254,81 +245,6 @@ func workflowLimit(raw string, cap int) int { return n } -func wakeLimit(raw string) int { - n, err := strconv.Atoi(raw) - if err != nil || n <= 0 { - return wakeDefaultLimit - } - if n > wakeMaxLimit { - return wakeMaxLimit - } - return n -} - -func validWakeState(state string) bool { - switch state { - case "pending", "attempted", "delivered", "stalled", "failed", "delivery_unknown": - return true - default: - return false - } -} - -var wakeOutstandingStates = [...]string{ - "pending", - "attempted", - "stalled", - "delivery_unknown", - "failed", -} - -func wakeStateOutstanding(state string) bool { - for _, outstanding := range wakeOutstandingStates { - if state == outstanding { - return true - } - } - return false -} - -// wakeErrorClass reduces untrusted transport text to a fixed public enum. -// Bound before case folding so classification work cannot scale with an -// arbitrarily large error string supplied by a data source. -func wakeErrorClass(value string) string { - if len(value) > wakeErrorScanLimit { - value = value[:wakeErrorScanLimit] - } - value = strings.ToLower(value) - switch { - case value == "": - return "" - case strings.Contains(value, "timeout"), strings.Contains(value, "deadline"), strings.Contains(value, "timed out"): - return wakeErrorTimeout - case strings.Contains(value, "429"), strings.Contains(value, "rate limit"), strings.Contains(value, "throttl"): - return wakeErrorRateLimited - case strings.Contains(value, "auth"), strings.Contains(value, "unauthor"), strings.Contains(value, "forbidden"), strings.Contains(value, "permission"), strings.Contains(value, "token"), strings.Contains(value, "credential"): - return wakeErrorAuth - case strings.Contains(value, "not found"), strings.Contains(value, "unknown role"), strings.Contains(value, "no such"): - return wakeErrorNotFound - case strings.Contains(value, "connect"), strings.Contains(value, "network"), strings.Contains(value, "dial"), strings.Contains(value, "reset"), strings.Contains(value, "broken pipe"), strings.Contains(value, "eof"), strings.Contains(value, "transport"), strings.Contains(value, "socket"): - return wakeErrorTransport - default: - return wakeErrorDelivery - } -} - -func publicWakeRows(rows []WakeRow, outstandingOnly bool) []WakeRow { - public := make([]WakeRow, 0, len(rows)) - for _, row := range rows { - if outstandingOnly && !wakeStateOutstanding(row.State) { - continue - } - row.LastError = wakeErrorClass(row.LastError) - public = append(public, row) - } - return public -} - func splitWorkflowLabel(label string) (string, string) { namespace, campaign, ok := strings.Cut(label, "/") if !ok { @@ -358,27 +274,21 @@ func overviewNeedRank(kind string) int { return 1 case "blocked_job": return 2 - case "groom_proposal": - return 3 default: - return 4 + return 3 } } func taskStateRank(state string) int { switch state { - case "planned": - return 0 - case "implementing": - return 1 case "pr_open": - return 2 + return 0 case "blocked": - return 3 + return 1 case "merged": - return 4 + return 2 default: - return 5 + return 3 } } @@ -451,89 +361,6 @@ func (s *server) handleOverview(w http.ResponseWriter, r *http.Request) { writeJSON(w, http.StatusOK, o) } -// handleWakeSummary serves the wake-outbox rollup used by the Overview badge. -func (s *server) handleWakeSummary(w http.ResponseWriter, r *http.Request) { - ds, ok := s.ds.(WakeDataSource) - if !ok { - http.Error(w, "wake ledger unsupported by data source", http.StatusNotFound) - return - } - summary, err := ds.WakeSummary(r.Context()) - if err != nil { - http.Error(w, err.Error(), statusForError(err)) - return - } - candidates := summary.Rows - if candidates == nil { - for _, state := range wakeOutstandingStates { - rows, rowsErr := ds.Wakes(r.Context(), WakeQuery{State: state, Limit: wakeMaxLimit}) - if rowsErr != nil { - http.Error(w, rowsErr.Error(), statusForError(rowsErr)) - return - } - candidates = append(candidates, rows.Rows...) - } - } - summary.Rows = publicWakeRows(candidates, true) - summary.Outstanding = len(summary.Rows) - writeJSON(w, http.StatusOK, summary) -} - -// handleWakes serves metadata-only wake obligations. The data source controls -// filtering; the handler validates the public query and normalizes nil rows. -func (s *server) handleWakes(w http.ResponseWriter, r *http.Request) { - ds, ok := s.ds.(WakeDataSource) - if !ok { - http.Error(w, "wake ledger unsupported by data source", http.StatusNotFound) - return - } - state := r.URL.Query().Get("state") - if state != "" && !validWakeState(state) { - http.Error(w, "invalid wake state", http.StatusBadRequest) - return - } - rows, err := ds.Wakes(r.Context(), WakeQuery{ - State: state, - Role: r.URL.Query().Get("role"), - Limit: wakeLimit(r.URL.Query().Get("limit")), - }) - if err != nil { - http.Error(w, err.Error(), statusForError(err)) - return - } - rows.Rows = publicWakeRows(rows.Rows, false) - writeJSON(w, http.StatusOK, rows) -} - -// handleWakeReceipts serves delivered wake metadata filtered by role and time. -func (s *server) handleWakeReceipts(w http.ResponseWriter, r *http.Request) { - ds, ok := s.ds.(WakeDataSource) - if !ok { - http.Error(w, "wake ledger unsupported by data source", http.StatusNotFound) - return - } - since := r.URL.Query().Get("since") - if since != "" { - if _, err := time.Parse(time.RFC3339, since); err != nil { - http.Error(w, "invalid wake receipt since", http.StatusBadRequest) - return - } - } - rows, err := ds.WakeReceipts(r.Context(), WakeReceiptQuery{ - Role: r.URL.Query().Get("role"), - Since: since, - Limit: wakeLimit(r.URL.Query().Get("limit")), - }) - if err != nil { - http.Error(w, err.Error(), statusForError(err)) - return - } - if rows.Rows == nil { - rows.Rows = []WakeReceipt{} - } - writeJSON(w, http.StatusOK, rows) -} - // handleTasks serves GET /api/tasks. Ordering is normalized for byte-stable // polling: lifecycle columns first, then most-recently-updated within a column. func (s *server) handleTasks(w http.ResponseWriter, r *http.Request) { @@ -877,8 +704,8 @@ func (s *server) handleLearningSkills(w http.ResponseWriter, r *http.Request) { } // handleAttention serves GET /api/attention -> Attention, the "Needs a human" -// view (gitmoot #528). Mirrors handleRuns; every list is coerced non-nil so the -// client always sees JSON arrays. +// view (gitmoot #528). Mirrors handleRuns; Gates is coerced non-nil so the +// client always sees a JSON array. func (s *server) handleAttention(w http.ResponseWriter, r *http.Request) { att, err := s.ds.Attention(r.Context()) if err != nil { @@ -888,12 +715,6 @@ func (s *server) handleAttention(w http.ResponseWriter, r *http.Request) { if att.Gates == nil { att.Gates = []AttentionGate{} } - if att.SynthItems == nil { - att.SynthItems = []AttentionSynthItem{} - } - if att.Candidates == nil { - att.Candidates = []AttentionCandidate{} - } writeJSON(w, http.StatusOK, att) } @@ -917,26 +738,6 @@ func (s *server) handleJobChecks(w http.ResponseWriter, r *http.Request) { writeJSON(w, http.StatusOK, checks) } -// handleBinaryVerdicts serves GET /api/run/{id}/verdicts -> BinaryVerdicts, the -// per-run SkillOpt binary-check breakdown (gitmoot #714). An unknown run is not -// a 404 — it returns zero counts with an empty Verdicts list (coerced non-nil). -func (s *server) handleBinaryVerdicts(w http.ResponseWriter, r *http.Request) { - id := r.PathValue("id") - if id == "" { - http.Error(w, "missing run id", http.StatusBadRequest) - return - } - v, err := s.ds.BinaryVerdicts(r.Context(), id) - if err != nil { - http.Error(w, err.Error(), statusForError(err)) - return - } - if v.Verdicts == nil { - v.Verdicts = []BinaryVerdict{} - } - writeJSON(w, http.StatusOK, v) -} - // handleState serves GET /api/state?run= -> State. An empty run resolves to // the active/most-recent run. func (s *server) handleState(w http.ResponseWriter, r *http.Request) { diff --git a/api_test.go b/api_test.go index 088ad96..14ec5d2 100644 --- a/api_test.go +++ b/api_test.go @@ -18,22 +18,6 @@ import ( type noWorkflowDataSource struct{ DataSource } type noChangeCursorDataSource struct{ DataSource } type noOrgDataSource struct{ DataSource } -type noWakeDataSource struct{ DataSource } - -type sparseWakeDataSource struct{ DataSource } - -func (d sparseWakeDataSource) WakeSummary(context.Context) (WakeSummary, error) { - return WakeSummary{}, nil -} - -func (d sparseWakeDataSource) Wakes(context.Context, WakeQuery) (WakeRows, error) { - return WakeRows{}, nil -} - -func (d sparseWakeDataSource) WakeReceipts(context.Context, WakeReceiptQuery) (WakeReceipts, error) { - return WakeReceipts{}, nil -} - type sparseOrgDataSource struct{ DataSource } func (d sparseOrgDataSource) Org(context.Context) (OrgView, error) { @@ -402,189 +386,6 @@ func TestFakeOverviewContractOrderingAndDeterminism(t *testing.T) { } } -func TestHandleWakeLedgerUnsupportedDataSource(t *testing.T) { - ds := noWakeDataSource{DataSource: NewFakeDataSource()} - srv := httptest.NewServer(Serve(ds)) - defer srv.Close() - - for _, path := range []string{"/api/wakes/summary", "/api/wakes", "/api/wakes/receipts"} { - resp, err := http.Get(srv.URL + path) - if err != nil { - t.Fatalf("GET %s: %v", path, err) - } - body, _ := io.ReadAll(resp.Body) - resp.Body.Close() - if resp.StatusCode != http.StatusNotFound || !strings.Contains(string(body), "wake ledger unsupported") { - t.Fatalf("GET %s status=%d body=%q, want clear 404", path, resp.StatusCode, body) - } - } -} - -func TestHandleWakeLedgerNormalizesNilRows(t *testing.T) { - srv := httptest.NewServer(Serve(sparseWakeDataSource{DataSource: NewFakeDataSource()})) - defer srv.Close() - - for _, path := range []string{"/api/wakes/summary", "/api/wakes", "/api/wakes/receipts"} { - raw := getRaw(t, srv.URL+path) - if !bytes.Contains(raw, []byte(`"rows": []`)) { - t.Fatalf("GET %s did not normalize rows: %s", path, raw) - } - } -} - -func TestFakeWakeSummaryOutstandingRowsCannotDrift(t *testing.T) { - srv := httptest.NewServer(Serve(NewFakeDataSource())) - defer srv.Close() - - var summary WakeSummary - if err := json.Unmarshal(getRaw(t, srv.URL+"/api/wakes/summary"), &summary); err != nil { - t.Fatalf("decode wake summary: %v", err) - } - if summary.Rows == nil { - t.Fatal("wake summary rows are nil") - } - if summary.Outstanding != 6 { - t.Fatalf("outstanding=%d, want 6 including failed wake", summary.Outstanding) - } - if got := len(summary.Rows); got != summary.Outstanding { - t.Fatalf("outstanding badge=%d but ledger rows=%d", summary.Outstanding, got) - } - seen := make(map[string]bool) - for _, row := range summary.Rows { - if !wakeStateOutstanding(row.State) { - t.Fatalf("terminal state %q appeared in outstanding rows: %+v", row.State, summary.Rows) - } - seen[row.State] = true - } - for _, required := range []string{"pending", "attempted", "stalled", "delivery_unknown", "failed"} { - if !seen[required] { - t.Fatalf("outstanding rows omitted required state %q: %+v", required, summary.Rows) - } - } -} - -func TestWakeErrorClass(t *testing.T) { - tests := []struct { - name string - value string - want string - }{ - {name: "empty", value: "", want: ""}, - {name: "timeout", value: "delivery deadline exceeded", want: wakeErrorTimeout}, - {name: "rate limited", value: "remote returned HTTP 429", want: wakeErrorRateLimited}, - {name: "auth before transport", value: "unauthorized transport connection", want: wakeErrorAuth}, - {name: "not found", value: "unknown role g9", want: wakeErrorNotFound}, - {name: "transport", value: "connection reset by peer", want: wakeErrorTransport}, - {name: "generic", value: "payload included here", want: wakeErrorDelivery}, - { - name: "bounded scan", - value: strings.Repeat("x", wakeErrorScanLimit) + " timeout", - want: wakeErrorDelivery, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := wakeErrorClass(tt.value); got != tt.want { - t.Fatalf("wakeErrorClass(%q) = %q, want %q", tt.value, got, tt.want) - } - }) - } -} - -func TestFakeWakeLedgerContractFiltersAndDeterminism(t *testing.T) { - srv := httptest.NewServer(Serve(NewFakeDataSource())) - defer srv.Close() - - summaryRaw := getRaw(t, srv.URL+"/api/wakes/summary") - if again := getRaw(t, srv.URL+"/api/wakes/summary"); !bytes.Equal(summaryRaw, again) { - t.Fatalf("wake summary changed across identical reads\nfirst=%s\nsecond=%s", summaryRaw, again) - } - var summary WakeSummary - if err := json.Unmarshal(summaryRaw, &summary); err != nil { - t.Fatalf("decode wake summary: %v", err) - } - if summary.Outstanding != 6 || summary.Pending != 2 || summary.AgedAttempted != 1 || summary.DeliveryUnknown != 1 || summary.Stalled != 1 || summary.OldestAgeSeconds != 3100 { - t.Fatalf("wake summary = %+v", summary) - } - if summary.Rows == nil || len(summary.Rows) != summary.Outstanding { - t.Fatalf("wake summary rows=%+v outstanding=%d", summary.Rows, summary.Outstanding) - } - for _, field := range []string{"\"outstanding\"", "\"pending\"", "\"aged_attempted\"", "\"delivery_unknown\"", "\"stalled\"", "\"oldest_age_seconds\"", "\"rows\""} { - if !bytes.Contains(summaryRaw, []byte(field)) { - t.Fatalf("wake summary missing %s: %s", field, summaryRaw) - } - } - for _, secret := range []string{"rotate the private signing key", "unredacted customer fixture"} { - if bytes.Contains(summaryRaw, []byte(secret)) { - t.Fatalf("wake summary leaked raw delivery error %q: %s", secret, summaryRaw) - } - } - - wakesRaw := getRaw(t, srv.URL+"/api/wakes?limit=100") - if again := getRaw(t, srv.URL+"/api/wakes?limit=100"); !bytes.Equal(wakesRaw, again) { - t.Fatalf("wake rows changed across identical reads\nfirst=%s\nsecond=%s", wakesRaw, again) - } - var wakes WakeRows - if err := json.Unmarshal(wakesRaw, &wakes); err != nil { - t.Fatalf("decode wakes: %v", err) - } - if wakes.Rows == nil || len(wakes.Rows) != 6 { - t.Fatalf("wake rows = %+v, want six non-nil rows", wakes.Rows) - } - validStates := map[string]bool{"pending": true, "attempted": true, "delivered": true, "stalled": true, "failed": true, "delivery_unknown": true} - for i, row := range wakes.Rows { - if row.ID == "" || row.TargetRole == "" || row.SourceKind == "" || row.SourceID == "" || !validStates[row.State] || row.CreatedAt == "" { - t.Fatalf("incomplete wake row[%d] = %+v", i, row) - } - } - if !bytes.Contains(wakesRaw, []byte(`"attempted_at": null`)) { - t.Fatalf("pending wake must carry attempted_at:null: %s", wakesRaw) - } - for _, secret := range []string{"rotate the private signing key", "unredacted customer fixture"} { - if bytes.Contains(wakesRaw, []byte(secret)) { - t.Fatalf("wake API leaked raw delivery error %q: %s", secret, wakesRaw) - } - } - errorClasses := map[string]string{ - "wake-unknown-001": wakeErrorTransport, - "wake-stalled-001": wakeErrorTimeout, - "wake-attempted-001": wakeErrorTransport, - "wake-failed-001": wakeErrorAuth, - } - for _, row := range wakes.Rows { - if want, ok := errorClasses[row.ID]; ok && row.LastError != want { - t.Fatalf("wake %s last_error=%q, want public class %q", row.ID, row.LastError, want) - } - } - - var filtered WakeRows - if err := json.Unmarshal(getRaw(t, srv.URL+"/api/wakes?state=pending&role=g2&limit=1"), &filtered); err != nil { - t.Fatalf("decode filtered wakes: %v", err) - } - if len(filtered.Rows) != 1 || filtered.Rows[0].State != "pending" || filtered.Rows[0].TargetRole != "g2" { - t.Fatalf("filtered wakes = %+v", filtered.Rows) - } - - var receipts WakeReceipts - if err := json.Unmarshal(getRaw(t, srv.URL+"/api/wakes/receipts?role=lead&since=2026-07-28T22:00:00Z&limit=10"), &receipts); err != nil { - t.Fatalf("decode receipts: %v", err) - } - if receipts.Rows == nil || len(receipts.Rows) != 1 || receipts.Rows[0].TargetRole != "lead" || receipts.Rows[0].State != "delivered" { - t.Fatalf("filtered receipts = %+v", receipts.Rows) - } - - for _, path := range []string{"/api/wakes?state=unknown", "/api/wakes/receipts?since=not-a-time"} { - resp, err := http.Get(srv.URL + path) - if err != nil { - t.Fatalf("GET invalid query %s: %v", path, err) - } - resp.Body.Close() - if resp.StatusCode != http.StatusBadRequest { - t.Fatalf("GET %s status=%d, want 400", path, resp.StatusCode) - } - } -} - func TestFakeTasksContractOrderingAndDeterminism(t *testing.T) { srv := httptest.NewServer(Serve(NewFakeDataSource())) defer srv.Close() @@ -598,10 +399,10 @@ func TestFakeTasksContractOrderingAndDeterminism(t *testing.T) { if err := json.Unmarshal(raw1, &tasks); err != nil { t.Fatalf("decode tasks: %v", err) } - if len(tasks) != 53 { - t.Fatalf("tasks = %d, want 53", len(tasks)) + if len(tasks) != 19 { + t.Fatalf("tasks = %d, want 19", len(tasks)) } - wantCounts := map[string]int{"planned": 23, "implementing": 11, "pr_open": 10, "blocked": 5, "merged": 4} + wantCounts := map[string]int{"pr_open": 10, "blocked": 5, "merged": 4} gotCounts := map[string]int{} lastRank := -1 lastUpdated := int64(0) @@ -1521,14 +1322,14 @@ func TestHandleAttention(t *testing.T) { if err := json.Unmarshal(getRaw(t, srv.URL+"/api/attention"), &att); err != nil { t.Fatalf("decode: %v", err) } - if att.Gates == nil || att.SynthItems == nil || att.Candidates == nil { - t.Fatalf("attention lists must be non-nil: %+v", att) + if att.Gates == nil { + t.Fatalf("attention gates must be non-nil: %+v", att) } - if len(att.Gates) == 0 || len(att.SynthItems) == 0 || len(att.Candidates) == 0 { - t.Fatalf("fake attention should have items in every bucket: %+v", att) + if len(att.Gates) == 0 { + t.Fatalf("fake attention should have gates: %+v", att) } - if want := len(att.Gates) + len(att.SynthItems) + len(att.Candidates); att.Total != want { - t.Fatalf("Total = %d, want %d", att.Total, want) + if att.Total != len(att.Gates) { + t.Fatalf("Total = %d, want %d", att.Total, len(att.Gates)) } for _, g := range att.Gates { if g.JobID == "" || g.Need == "" { @@ -1592,62 +1393,6 @@ func TestHandleJobChecksUnknownJobNotFound(t *testing.T) { } } -func TestHandleBinaryVerdicts(t *testing.T) { - srv := httptest.NewServer(Serve(NewFakeDataSource())) - defer srv.Close() - - var v BinaryVerdicts - if err := json.Unmarshal(getRaw(t, srv.URL+"/api/run/"+fakeVerdictRun+"/verdicts"), &v); err != nil { - t.Fatalf("decode: %v", err) - } - if v.RunID != fakeVerdictRun { - t.Fatalf("RunID = %q, want %q", v.RunID, fakeVerdictRun) - } - if len(v.Verdicts) == 0 { - t.Fatalf("expected verdicts for %q", fakeVerdictRun) - } - if v.Passed+v.Failed != len(v.Verdicts) { - t.Fatalf("passed(%d)+failed(%d) != len(%d)", v.Passed, v.Failed, len(v.Verdicts)) - } - pass, fail := 0, 0 - for _, q := range v.Verdicts { - if q.Pass != (q.Verdict == "yes") { - t.Fatalf("Pass/Verdict mismatch: %+v", q) - } - if q.Pass { - pass++ - } else { - fail++ - } - } - if pass != v.Passed || fail != v.Failed { - t.Fatalf("counts mismatch: got passed=%d failed=%d, recomputed passed=%d failed=%d", v.Passed, v.Failed, pass, fail) - } - // Ordering must be (dimension, questionId) ascending. - for i := 1; i < len(v.Verdicts); i++ { - prev, cur := v.Verdicts[i-1], v.Verdicts[i] - if prev.Dimension > cur.Dimension || (prev.Dimension == cur.Dimension && prev.QuestionID > cur.QuestionID) { - t.Fatalf("verdicts not ordered by (dimension, questionId) at %d: %+v then %+v", i, prev, cur) - } - } -} - -func TestHandleBinaryVerdictsUnknownRun(t *testing.T) { - srv := httptest.NewServer(Serve(NewFakeDataSource())) - defer srv.Close() - - var v BinaryVerdicts - if err := json.Unmarshal(getRaw(t, srv.URL+"/api/run/nope/verdicts"), &v); err != nil { - t.Fatalf("decode: %v", err) - } - if v.Verdicts == nil { - t.Fatalf("Verdicts must be non-nil") - } - if len(v.Verdicts) != 0 || v.Passed != 0 || v.Failed != 0 { - t.Fatalf("unknown run should be empty: %+v", v) - } -} - // getRaw fetches url and returns the 200 response body, failing the test on any // error or non-200 status. func getRaw(t *testing.T, url string) []byte { diff --git a/datasource.go b/datasource.go index 2258295..3de0815 100644 --- a/datasource.go +++ b/datasource.go @@ -368,7 +368,7 @@ type WorkflowDataSource interface { // Link is either a dashboard path or an external URL. Stalled workflow cards // additionally carry the read-only coordinator handoff fields. type OverviewNeedsYou struct { - Kind string `json:"kind"` // pr_awaiting_merge | blocked_job | groom_proposal | stalled_workflow + Kind string `json:"kind"` // pr_awaiting_merge | blocked_job | unlabeled_jobs | stalled_workflow Repo string `json:"repo,omitempty"` Ref string `json:"ref,omitempty"` Title string `json:"title"` @@ -441,77 +441,6 @@ type OverviewDataSource interface { Overview(ctx context.Context) (Overview, error) } -// WakeSummary is the operator-facing rollup served by GET /api/wakes/summary. -type WakeSummary struct { - Outstanding int `json:"outstanding"` - Pending int `json:"pending"` - AgedAttempted int `json:"aged_attempted"` - DeliveryUnknown int `json:"delivery_unknown"` - Stalled int `json:"stalled"` - OldestAgeSeconds int `json:"oldest_age_seconds"` - // Rows is the candidate wake set. The public handler applies the canonical - // outstanding-state classifier and derives Outstanding from the result. - Rows []WakeRow `json:"rows"` -} - -// WakeRow is one metadata-only wake obligation. Data sources may populate -// LastError with untrusted transport text; handleWakes replaces it with a fixed -// error class before serialization on the public API. -type WakeRow struct { - ID string `json:"id"` - TargetRole string `json:"target_role"` - SourceKind string `json:"source_kind"` - SourceID string `json:"source_id"` - State string `json:"state"` // pending | attempted | delivered | stalled | failed | delivery_unknown - AttemptCount int `json:"attempt_count"` - LastError string `json:"last_error"` - AgeSeconds int `json:"age_seconds"` - CreatedAt string `json:"created_at"` // RFC3339 - AttemptedAt *string `json:"attempted_at"` // RFC3339 or null -} - -// WakeRows is the non-null list envelope served by GET /api/wakes. -type WakeRows struct { - Rows []WakeRow `json:"rows"` -} - -// WakeReceipt is one metadata-only delivered wake record. -type WakeReceipt struct { - ID string `json:"id"` - TargetRole string `json:"target_role"` - SourceKind string `json:"source_kind"` - State string `json:"state"` // delivered - AttemptCount int `json:"attempt_count"` - DeliveredAt string `json:"delivered_at"` // RFC3339 -} - -// WakeReceipts is the non-null list envelope served by GET /api/wakes/receipts. -type WakeReceipts struct { - Rows []WakeReceipt `json:"rows"` -} - -// WakeQuery is the validated GET /api/wakes query. -type WakeQuery struct { - State string - Role string - Limit int -} - -// WakeReceiptQuery is the validated GET /api/wakes/receipts query. -type WakeReceiptQuery struct { - Role string - Since string - Limit int -} - -// WakeDataSource is the optional read-only wake-ledger extension. Keeping it -// separate preserves the core DataSource contract for older bridges. -type WakeDataSource interface { - WakeSummary(ctx context.Context) (WakeSummary, error) - Wakes(ctx context.Context, query WakeQuery) (WakeRows, error) - WakeReceipts(ctx context.Context, query WakeReceiptQuery) (WakeReceipts, error) -} - // TaskSummary is one read-only lifecycle card on GET /api/tasks. UpdatedAt is // epoch milliseconds; AgeS is the server-computed display age. Merged entries // are limited to the most recent seven days by the data source. @@ -519,7 +448,7 @@ type TaskSummary struct { ID string `json:"id"` Title string `json:"title"` Repo string `json:"repo"` - State string `json:"state"` // planned | implementing | pr_open | blocked | merged + State string `json:"state"` // pr_open | blocked | merged Agent string `json:"agent,omitempty"` PRNumber int `json:"pr_number,omitempty"` CI string `json:"ci,omitempty"` // green | red | pending | "" @@ -897,7 +826,7 @@ type Skills struct { PendingTotal int `json:"pendingTotal"` } -// Attention + binary checks — surfacing evaluator output and human gates where a +// Attention + result checks — surfacing evaluator output and human gates where a // human (or the planned Slack/media bridge, gitmoot #519) manages work // (gitmoot #528). @@ -921,28 +850,6 @@ type JobChecks struct { Failed []ResultCheck `json:"failed"` // failed checks, insertion order; never nil } -// BinaryVerdict is one per-question verdict from a SkillOpt binary evaluation -// (gitmoot #714 skillopt_binary_verdicts): a yes/no answer to a decomposed -// question with the evaluator's explanation. Pass mirrors Verdict == "yes". -type BinaryVerdict struct { - QuestionID string `json:"questionId"` - Dimension string `json:"dimension,omitempty"` - Verdict string `json:"verdict"` // yes | no - Pass bool `json:"pass"` - Explanation string `json:"explanation,omitempty"` - Weight float64 `json:"weight,omitempty"` -} - -// BinaryVerdicts is the per-run binary-check breakdown (gitmoot #714): the -// verdicts ordered by (dimension, questionId) plus pass/fail headline counts. -// An unknown run yields zero counts and an empty (never nil) list. -type BinaryVerdicts struct { - RunID string `json:"runId"` - Passed int `json:"passed"` - Failed int `json:"failed"` - Verdicts []BinaryVerdict `json:"verdicts"` // ordered (dimension, questionId); never nil -} - // AttentionGate is a blocked job waiting on a human-satisfiable gate (gitmoot // #693 job_gates): one open (unsatisfied) need on a job. type AttentionGate struct { @@ -956,42 +863,14 @@ type AttentionGate struct { CreatedAt int64 `json:"createdAt,omitempty"` // epoch ms } -// AttentionSynthItem is a synthesized SkillOpt review item awaiting the human -// approval gate (gitmoot skillopt_synth_items, status pending_human_approval). -type AttentionSynthItem struct { - ID string `json:"id"` - TemplateID string `json:"templateId,omitempty"` - Repo string `json:"repo,omitempty"` - Question string `json:"question,omitempty"` - Gap float64 `json:"gap,omitempty"` - WeakAgent string `json:"weakAgent,omitempty"` - StrongAgent string `json:"strongAgent,omitempty"` - JudgeAgent string `json:"judgeAgent,omitempty"` - CreatedAt int64 `json:"createdAt,omitempty"` // epoch ms -} - -// AttentionCandidate is an agent-template candidate version awaiting human -// promotion (a template version in the "pending" state). Score passes through -// the review's stored form (a decimal, or empty when unscored). -type AttentionCandidate struct { - TemplateID string `json:"templateId"` - Name string `json:"name,omitempty"` - VersionID string `json:"versionId"` - Number int `json:"number"` - Score string `json:"score,omitempty"` - CreatedAt int64 `json:"createdAt,omitempty"` // epoch ms -} - -// Attention is the "Needs a human" view (gitmoot #528): the three kinds of item -// that require an explicit human decision — blocked job gates, pending synth -// approvals and template candidates awaiting promotion — plus a headline total. -// Every list is non-nil and deterministically ordered (the UI polls with a -// signature-skip). +// Attention is the "Needs a human" view (gitmoot #528): blocked job gates that +// require an explicit human decision, plus a headline total. Gates is non-nil and +// deterministically ordered (the UI polls with a signature-skip). type Attention struct { - Gates []AttentionGate `json:"gates"` // open job gates, oldest-first - SynthItems []AttentionSynthItem `json:"synthItems"` // pending synth approvals, newest-first - Candidates []AttentionCandidate `json:"candidates"` // versions awaiting promotion, (templateId, number) - Total int `json:"total"` // gates + synthItems + candidates + Gates []AttentionGate `json:"gates"` // open job gates, oldest-first + // Total is the headline count: the gates plus any other waiting items the + // data source counts (gitmoot adds stale notifications). + Total int `json:"total"` } // ChangeCursorDataSource is the optional liveness extension behind @@ -1046,16 +925,12 @@ type DataSource interface { // gitmoot retired and could only ever answer empty. Skills(ctx context.Context) (Skills, error) // Attention returns the "Needs a human" view (gitmoot #528): blocked job - // gates, pending synth approvals and template candidates awaiting promotion. - // Ordering must be deterministic (the UI polls with a signature-skip). + // gates and the headline waiting total. Ordering must be deterministic (the + // UI polls with a signature-skip). Attention(ctx context.Context) (Attention, error) // JobChecks returns the job-detail failed-check section for one job (gitmoot // #711): the deterministic result checks its result failed plus the home-wide // policy mode. An unknown job yields an empty Failed with the resolved Mode. JobChecks(ctx context.Context, jobID string) (JobChecks, error) - // BinaryVerdicts returns the per-run SkillOpt binary-check breakdown (gitmoot - // #714) for a skillopt eval run id: verdicts ordered by (dimension, - // questionId) plus pass/fail counts. An unknown run yields zero counts. - BinaryVerdicts(ctx context.Context, runID string) (BinaryVerdicts, error) Subscribe(ctx context.Context, runID string) (<-chan State, func(), error) // for SSE } diff --git a/fakefeed.go b/fakefeed.go index 1c2b877..10675c0 100644 --- a/fakefeed.go +++ b/fakefeed.go @@ -465,11 +465,11 @@ func compactWorkflowNode(n Node) WorkflowNode { func fakeWorkflowNotes(anchor int64) []WorkflowNoteView { notes := []WorkflowNoteView{ - {ID: 109, Author: "claude-coordinator", Body: "Designs agree across all three researchers — dispatching wave-impl to implement the split threshold and LLM-guided lossless merge. Holding review until the validation pass returns.", Repo: "jerryfane/gitmoot", CreatedAt: anchor - int64(2*time.Minute/time.Millisecond)}, + {ID: 109, Author: "claude-coordinator", Body: "Designs agree across all three researchers — dispatching wave-impl to implement the exact-head review guard. Holding review until the validation pass returns.", Repo: "jerryfane/gitmoot", CreatedAt: anchor - int64(2*time.Minute/time.Millisecond)}, {ID: 108, Author: "panel-synth", Body: "render literally & safely", Repo: "jerryfane/gitmoot", CreatedAt: anchor - int64(10*time.Minute/time.Millisecond)}, - {ID: 107, Author: "claude-coordinator", Body: "Panel fired (3 models): core decision = split threshold at 0.62 cosine plus an LLM-guided lossless merge; write caps set to 16KiB / 64KiB.", Repo: "jerryfane/gitmoot", CreatedAt: anchor - int64(20*time.Minute/time.Millisecond)}, - {ID: 106, Author: "research-kimi", Body: "Kimi review favors the lossless merge guard and a separate validation child before synthesis.", Repo: "jerryfane/gitmoot", CreatedAt: anchor - int64(27*time.Minute/time.Millisecond)}, - {ID: 105, Author: "research-sol", Body: "The baseline confirms over-merge around high-density topic boundaries; cosine-only tuning is insufficient.", Repo: "jerryfane/gitmoot", CreatedAt: anchor - int64(40*time.Minute/time.Millisecond)}, + {ID: 107, Author: "claude-coordinator", Body: "Panel fired (3 models): core decision = keep the merge gate closed until a review exists at the exact head; evidence caps set to 16KiB / 64KiB.", Repo: "jerryfane/gitmoot", CreatedAt: anchor - int64(20*time.Minute/time.Millisecond)}, + {ID: 106, Author: "research-kimi", Body: "Kimi review favors the exact-head guard and a separate validation child before synthesis.", Repo: "jerryfane/gitmoot", CreatedAt: anchor - int64(27*time.Minute/time.Millisecond)}, + {ID: 105, Author: "research-sol", Body: "The baseline confirms stale-head approvals slip through after force-pushes; branch-name matching is insufficient.", Repo: "jerryfane/gitmoot", CreatedAt: anchor - int64(40*time.Minute/time.Millisecond)}, {ID: 104, Author: "claude-coordinator", Body: "Baseline audit complete. Launching independent design research with Claude, Codex, and Kimi.", Repo: "jerryfane/gitmoot", CreatedAt: anchor - int64(55*time.Minute/time.Millisecond)}, {ID: 103, Author: "project-lead", Body: "Workflow opened from issue #78 with the dashboard half isolated from server lifecycle derivation.", Repo: "jerryfane/gitmoot-dashboard", CreatedAt: anchor - int64(75*time.Minute/time.Millisecond)}, {ID: 102, Author: "project-lead", Body: "Coordinator pane reserved and journal handoff verified.", Repo: "jerryfane/gitmoot-dashboard", CreatedAt: anchor - int64(100*time.Minute/time.Millisecond)}, @@ -501,14 +501,14 @@ func fakeWorkflowNode(id, parentID, title, agent, runtime string, state NodeStat func fakeWorkflowRuns(anchor int64) []WorkflowRun { minute := int64(time.Minute / time.Millisecond) - currentRoot := fakeWorkflowNode("wf-current-root", "", "Groom split heuristics — validation pass", "claude-coordinator", "claude", "running", anchor-8*minute, 0) - currentImpl := fakeWorkflowNode("wf-current-impl", currentRoot.ID, "implement: merge guard", "wave-impl", "codex", "running", anchor-6*minute, 0) + currentRoot := fakeWorkflowNode("wf-current-root", "", "Merge gate exact-head guard — validation pass", "claude-coordinator", "claude", "running", anchor-8*minute, 0) + currentImpl := fakeWorkflowNode("wf-current-impl", currentRoot.ID, "implement: exact-head guard", "wave-impl", "codex", "running", anchor-6*minute, 0) currentReview := fakeWorkflowNode("wf-current-review", currentRoot.ID, "review: validation results", "researcher", "claude", "queued", 0, 0) - failedRoot := fakeWorkflowNode("wf-failed-root", "", "Independent design research — split heuristics", "research-fable", "claude", "failed", anchor-18*minute, anchor-18*minute+15_000) - failedChild := fakeWorkflowNode("wf-failed-child", failedRoot.ID, "ask: evaluate split threshold", "research-fable", "claude", "failed", anchor-18*minute, anchor-18*minute+15_000) - solRoot := fakeWorkflowNode("wf-sol-root", "", "Independent design research — split heuristics", "research-sol", "codex", "succeeded", anchor-38*minute, anchor-33*minute) - solChild := fakeWorkflowNode("wf-sol-child", solRoot.ID, "review: compare merge strategies", "research-sol", "codex", "succeeded", anchor-37*minute, anchor-33*minute) - baseRoot := fakeWorkflowNode("wf-base-root", "", "Baseline: current groomer over-merge audit", "researcher", "kimi", "succeeded", anchor-70*minute, anchor-64*minute) + failedRoot := fakeWorkflowNode("wf-failed-root", "", "Independent design research — exact-head guard", "research-fable", "claude", "failed", anchor-18*minute, anchor-18*minute+15_000) + failedChild := fakeWorkflowNode("wf-failed-child", failedRoot.ID, "ask: evaluate stale-head approvals", "research-fable", "claude", "failed", anchor-18*minute, anchor-18*minute+15_000) + solRoot := fakeWorkflowNode("wf-sol-root", "", "Independent design research — exact-head guard", "research-sol", "codex", "succeeded", anchor-38*minute, anchor-33*minute) + solChild := fakeWorkflowNode("wf-sol-child", solRoot.ID, "review: compare guard strategies", "research-sol", "codex", "succeeded", anchor-37*minute, anchor-33*minute) + baseRoot := fakeWorkflowNode("wf-base-root", "", "Baseline: stale-head approval audit", "researcher", "kimi", "succeeded", anchor-70*minute, anchor-64*minute) runs := []WorkflowRun{ { RunID: fakeRunID, Title: currentRoot.Title, Agent: currentRoot.Agent, Runtime: currentRoot.Runtime, @@ -613,10 +613,10 @@ func fakeWorkflowIndex(anchor int64) []WorkflowIndexEntry { return []WorkflowIndexEntry{ {Label: fakeStalledWorkflow, Summary: "Hardening scheduled arXiv retries after repeated rate-limit failures.", Coordinator: WorkflowCoordinator{Author: "claude-coordinator", Pane: "fable", SessionID: "a3f19c"}, State: "stalled", StalledForS: 40 * 60, Counts: WorkflowCounts{Jobs: 4, Succeeded: 2, Failed: 2, Notes: 5}, TokensIn: 64_000, TokensOut: 16_000, FirstAt: anchor - 3*hour, LastAt: anchor - 40*minute, LastNote: "Panel synthesized temp JSON + env var; no resume note since.", Repos: []string{"jerryfane/arxiv-post-agent"}}, primary, - {Label: "sol/smart-groomer", Summary: "Improving memory grooming with safer split and merge heuristics.", Coordinator: WorkflowCoordinator{Author: "claude-coordinator", Pane: "sol", SessionID: "c40d8a"}, State: "active", Counts: WorkflowCounts{Jobs: 11, Running: 2, Succeeded: 9, Notes: 12}, TokensIn: 680_000, TokensOut: 210_000, FirstAt: anchor - 2*hour, LastAt: anchor - 4*minute, LastNote: "Validation workers are still moving.", Repos: []string{"jerryfane/gitmoot"}}, + {Label: "sol/review-sweep", Summary: "Sweeping open PRs for reviews that predate their current head.", Coordinator: WorkflowCoordinator{Author: "claude-coordinator", Pane: "sol", SessionID: "c40d8a"}, State: "active", Counts: WorkflowCounts{Jobs: 11, Running: 2, Succeeded: 9, Notes: 12}, TokensIn: 680_000, TokensOut: 210_000, FirstAt: anchor - 2*hour, LastAt: anchor - 4*minute, LastNote: "Validation workers are still moving.", Repos: []string{"jerryfane/gitmoot"}}, {Label: "officeqa-point-formula", Coordinator: WorkflowCoordinator{Author: "claude-coordinator", Pane: "kimi", SessionID: "d7c410"}, State: "settled", Counts: WorkflowCounts{Jobs: 16, Succeeded: 12, Failed: 3, Blocked: 1, Notes: 9}, TokensIn: 2_100_000, TokensOut: 800_000, FirstAt: anchor - day, LastAt: anchor - 8*hour, LastNote: "Closing note published.", Repos: []string{"jerryfane/officeqa"}}, {Label: "sol/token-accounting", Coordinator: WorkflowCoordinator{Author: "claude-coordinator", Pane: "sol", SessionID: "1f9b22"}, State: "settled", Counts: WorkflowCounts{Jobs: 9, Succeeded: 7, Failed: 1, Blocked: 1, Notes: 6}, TokensIn: 470_000, TokensOut: 170_000, FirstAt: anchor - 9*hour, LastAt: anchor - 6*hour, LastNote: "Token totals reconciled.", Repos: []string{"jerryfane/gitmoot"}}, - {Label: "ops/groom-propose", Coordinator: WorkflowCoordinator{Author: "claude-coordinator", Pane: "ops", SessionID: "0f621a"}, State: "settled", Counts: WorkflowCounts{Jobs: 5, Succeeded: 5}, TokensIn: 18_000, TokensOut: 4_000, FirstAt: anchor - 5*hour, LastAt: anchor - 4*hour, Repos: []string{"jerryfane/gitmoot"}}, + {Label: "ops/design-notes", Coordinator: WorkflowCoordinator{Author: "claude-coordinator", Pane: "ops", SessionID: "0f621a"}, State: "settled", Counts: WorkflowCounts{Jobs: 5, Succeeded: 5}, TokensIn: 18_000, TokensOut: 4_000, FirstAt: anchor - 5*hour, LastAt: anchor - 4*hour, Repos: []string{"jerryfane/gitmoot"}}, {Label: "adhoc/researcher", Coordinator: WorkflowCoordinator{Author: "claude-coordinator", Pane: "adhoc", SessionID: "8aa912"}, State: "settled", Counts: WorkflowCounts{Jobs: 26, Succeeded: 22, Failed: 4}, TokensIn: 3_600_000, TokensOut: 1_300_000, FirstAt: anchor - 3*day, LastAt: anchor - day, Repos: []string{"jerryfane/gitmoot", "jerryfane/sophon"}}, } } @@ -667,15 +667,14 @@ func (f *FakeDataSource) Overview(ctx context.Context) (Overview, error) { NeedsYou: []OverviewNeedsYou{ {Kind: "pr_awaiting_merge", Repo: "jerryfane/vetrina", Ref: "#77", Title: "Charlotte selfimprove pass 3 — layout tokens", AgeS: 11 * 3600, CI: "pending", Link: "https://github.com/jerryfane/vetrina/pull/77"}, {Kind: "stalled_workflow", Repo: "jerryfane/arxiv-post-agent", Ref: "40m", Title: "1 run failed · coordinator silent", AgeS: 40 * 60, Link: "/workflows/fable%2Farxiv-retry-hardening", Label: fakeStalledWorkflow, Pane: "fable", SessionID: "a3f19c", LastNote: "synthesized temp JSON + env var; 16KiB caps"}, - {Kind: "pr_awaiting_merge", Repo: "jerryfane/gitmoot", Ref: "#892", Title: "Add memory-groom split heuristics to nightly propose pass", AgeS: 2 * 3600, CI: "green", Link: "https://github.com/jerryfane/gitmoot/pull/892"}, + {Kind: "pr_awaiting_merge", Repo: "jerryfane/gitmoot", Ref: "#892", Title: "Require an exact-head review before the merge gate opens", AgeS: 2 * 3600, CI: "green", Link: "https://github.com/jerryfane/gitmoot/pull/892"}, {Kind: "blocked_job", Repo: "jerryfane/gitmoot", Ref: "planner", Title: "Job blocked · needs writable /root/.gitmoot", AgeS: 5 * 86400, Link: "/attention"}, - {Kind: "groom_proposal", Repo: "gitmoot · joltra", Ref: "12 facts", Title: "3 memory-groom proposals await review", AgeS: 4 * 3600, Link: "/attention"}, - {Kind: "pr_awaiting_merge", Repo: "jerryfane/arxiv-post-agent", Ref: "#418", Title: "Fix arxiv summary pipeline retry backoff on 429", AgeS: 6 * 3600, CI: "red", Link: "https://github.com/jerryfane/arxiv-post-agent/pull/418"}, + {Kind: "pr_awaiting_merge", Repo: "jerryfane/arxiv-post-agent", Ref: "#418", Title: "Fix arxiv summary retry backoff on 429", AgeS: 6 * 3600, CI: "red", Link: "https://github.com/jerryfane/arxiv-post-agent/pull/418"}, }, Activity: OverviewActivity{ Workflows: []OverviewWorkflowActivity{ {Label: "sol/dashboard-redesign", Running: 2, Agents: []string{"sol-impl-a", "ui-designer-researcher"}, StartedAgoS: 4 * 60}, - {Label: "fable/smart-groomer", Running: 3, Agents: []string{"researcher", "research-sol", "wave-impl"}, StartedAgoS: 25 * 60}, + {Label: "fable/review-sweep", Running: 3, Agents: []string{"researcher", "research-sol", "wave-impl"}, StartedAgoS: 25 * 60}, }, UnattendedNote: "ops/… + adhoc/… · 4 more jobs running", Queued: 8, @@ -684,7 +683,7 @@ func (f *FakeDataSource) Overview(ctx context.Context) (Overview, error) { Completed: 142, Failed: 14, Cancelled: 6, TokensIn: 38_100_000, TokensOut: 9_100_000, PerHour: [24]int{8, 7, 5, 5, 4, 4, 3, 5, 10, 18, 30, 42, 51, 56, 49, 44, 38, 45, 52, 43, 36, 25, 19, 17}, Notable: []OverviewNotable{ - {Agent: "researcher", Title: "Design review for gitmoot #863 — end-to-end pipeline run", Outcome: "succeeded", ElapsedS: 516, AgeS: 12 * 60}, + {Agent: "researcher", Title: "Design review for gitmoot #863 — merge gate evidence", Outcome: "succeeded", ElapsedS: 516, AgeS: 12 * 60}, {Agent: "research-fable", Title: "Independent design research for gitmoot #864: workflow", Outcome: "failed", ElapsedS: 15, AgeS: 34 * 60}, {Agent: "wave-impl", Title: "FEATURE: gitmoot server half of dashboard #75", Outcome: "succeeded", ElapsedS: 608, AgeS: 3600}, {Agent: "btc-coordinator", Title: "Price model backtest sweep r8", Outcome: "succeeded", ElapsedS: 276, AgeS: 5400}, @@ -701,125 +700,19 @@ func (f *FakeDataSource) Overview(ctx context.Context) (Overview, error) { }, nil } -func fakeWakeRows() []WakeRow { - attemptedA := "2026-07-28T22:47:00Z" - attemptedB := "2026-07-28T22:51:00Z" - attemptedC := "2026-07-28T23:03:00Z" - return []WakeRow{ - { - ID: "wake-unknown-001", TargetRole: "lead", SourceKind: "escalation", SourceID: "esc-g4-owner-17", - State: "delivery_unknown", AttemptCount: 3, AgeSeconds: 3100, - LastError: `connection reset while sending payload "owner decision: rotate the private signing key"`, - CreatedAt: "2026-07-28T22:39:00Z", - AttemptedAt: &attemptedA, - }, - { - ID: "wake-stalled-001", TargetRole: "g4", SourceKind: "delegation", SourceID: "job-contract-review", - State: "stalled", AttemptCount: 4, AgeSeconds: 2700, - LastError: `delivery deadline exceeded: message "use the unredacted customer fixture"`, - CreatedAt: "2026-07-28T22:45:00Z", - AttemptedAt: &attemptedB, - }, - { - ID: "wake-attempted-001", TargetRole: "vetrina", SourceKind: "recycle", SourceID: "recycle-vetrina-09", - State: "attempted", AttemptCount: 2, AgeSeconds: 1900, - LastError: "dial unix /run/tmux/default: connect: connection refused", - CreatedAt: "2026-07-28T22:58:00Z", - AttemptedAt: &attemptedC, - }, - { - ID: "wake-pending-001", TargetRole: "joltra", SourceKind: "delegation", SourceID: "job-video-export", - State: "pending", AttemptCount: 0, AgeSeconds: 420, CreatedAt: "2026-07-28T23:21:00Z", - }, - { - ID: "wake-pending-002", TargetRole: "g2", SourceKind: "awaited_fact", SourceID: "fact-release-1230", - State: "pending", AttemptCount: 0, AgeSeconds: 180, CreatedAt: "2026-07-28T23:25:00Z", - }, - { - ID: "wake-failed-001", TargetRole: "herdres", SourceKind: "escalation", SourceID: "esc-delivery-audit", - State: "failed", AttemptCount: 2, AgeSeconds: 800, - LastError: "authentication required for delivery transport", - CreatedAt: "2026-07-28T23:14:00Z", - AttemptedAt: &attemptedC, - }, - } -} - -func fakeWakeReceipts() []WakeReceipt { - return []WakeReceipt{ - {ID: "wake-delivered-003", TargetRole: "g3", SourceKind: "delegation", State: "delivered", AttemptCount: 1, DeliveredAt: "2026-07-28T23:24:00Z"}, - {ID: "wake-delivered-002", TargetRole: "lead", SourceKind: "escalation", State: "delivered", AttemptCount: 2, DeliveredAt: "2026-07-28T22:55:00Z"}, - {ID: "wake-delivered-001", TargetRole: "joltra", SourceKind: "recycle", State: "delivered", AttemptCount: 1, DeliveredAt: "2026-07-28T20:15:00Z"}, - } -} - -// WakeSummary implements the deterministic wake-outbox rollup. -func (f *FakeDataSource) WakeSummary(ctx context.Context) (WakeSummary, error) { - return WakeSummary{ - Outstanding: 5, Pending: 2, AgedAttempted: 1, - DeliveryUnknown: 1, Stalled: 1, OldestAgeSeconds: 3100, - Rows: fakeWakeRows(), - }, nil -} - -// Wakes implements the metadata-only wake obligation listing. -func (f *FakeDataSource) Wakes(ctx context.Context, query WakeQuery) (WakeRows, error) { - rows := fakeWakeRows() - out := make([]WakeRow, 0, len(rows)) - for _, row := range rows { - if query.State != "" && row.State != query.State { - continue - } - if query.Role != "" && row.TargetRole != query.Role { - continue - } - out = append(out, row) - if query.Limit > 0 && len(out) >= query.Limit { - break - } - } - return WakeRows{Rows: out}, nil -} - -// WakeReceipts implements delivered wake history with role/time filtering. -func (f *FakeDataSource) WakeReceipts(ctx context.Context, query WakeReceiptQuery) (WakeReceipts, error) { - var since time.Time - if query.Since != "" { - since, _ = time.Parse(time.RFC3339, query.Since) - } - rows := fakeWakeReceipts() - out := make([]WakeReceipt, 0, len(rows)) - for _, row := range rows { - if query.Role != "" && row.TargetRole != query.Role { - continue - } - if !since.IsZero() { - deliveredAt, err := time.Parse(time.RFC3339, row.DeliveredAt) - if err != nil || deliveredAt.Before(since) { - continue - } - } - out = append(out, row) - if query.Limit > 0 && len(out) >= query.Limit { - break - } - } - return WakeReceipts{Rows: out}, nil -} - func fakeTaskTitles() []string { return []string{ - "Add memory-groom split heuristics to nightly propose pass", - "Fix arxiv summary pipeline retry backoff on 429 responses", - "Implement the ENGINE half of gitmoot #779 orchestration loop", + "Require an exact-head review before the merge gate opens", + "Fix arxiv summary retry backoff on 429 responses", + "Record weekly design notes from merged review findings", "Baseline repo reconciliation for GitHub fleet sync", "Messaging, approvals and agent delivery for waybread", "Charlotte selfimprove pass 3 — vetrina layout tokens", "Wire gitmoot activepieces support end to end", - "Refactor orchestrator core.mjs runner into staged pipeline", + "Wake the requesting seat when a review verdict lands", "Design review for dashboard #78 information architecture", "Backtest sweep r8 for the bitcoin price model", - "Cluster store migration to internal memory index", + "Org chart role scopes for the review fleet", "Health page locks-aging amber thresholds", } } @@ -835,7 +728,7 @@ func fakeTaskAgent(i int) string { } // Tasks implements the optional task-board contract with the mockup's target -// volumes: 23 planned, 11 implementing, 10 PR-open, 5 blocked, and 4 merged. +// volumes: 10 PR-open, 5 blocked, and 4 merged. func (f *FakeDataSource) Tasks(ctx context.Context) ([]TaskSummary, error) { f.mu.Lock() anchor := f.st.Nodes[0].StartedAt @@ -844,8 +737,8 @@ func (f *FakeDataSource) Tasks(ctx context.Context) ([]TaskSummary, error) { counts := []struct { state string count int - }{{"planned", 23}, {"implementing", 11}, {"pr_open", 10}, {"blocked", 5}, {"merged", 4}} - tasks := make([]TaskSummary, 0, 53) + }{{"pr_open", 10}, {"blocked", 5}, {"merged", 4}} + tasks := make([]TaskSummary, 0, 19) serial := 0 for _, group := range counts { for i := 0; i < group.count; i++ { @@ -865,8 +758,6 @@ func (f *FakeDataSource) Tasks(ctx context.Context) ([]TaskSummary, error) { Agent: fakeTaskAgent(serial - 1), UpdatedAt: anchor - age*1000, AgeS: age, } switch group.state { - case "planned": - task.Agent = "" case "pr_open": task.PRNumber = 620 + i*7 ci := []string{"green", "green", "red", "pending"} @@ -1597,7 +1488,7 @@ func fakeHistory() []fakeJobRecord { minsAgo int tin, tout int }{ - {"job-live-1", "orchestrate: nightly maintenance", "project-lead", "codex", fakeRepo, "running", 6, 4200, 1800}, + {"job-live-1", "review: nightly maintenance PR", "project-lead", "codex", fakeRepo, "running", 6, 4200, 1800}, {"job-live-2", "implement: export to CSV", "implementer", "codex", fakeRepo, "running", 3, 3100, 900}, {"job-live-3", "implement: bulk delete", "implementer", "codex", "jerryfane/noted", "queued", 22, 0, 0}, {"job-live-4", "review: auth refactor", "reviewer-kimi", "kimi", "acme/api", "blocked", 47, 800, 120}, @@ -2049,10 +1940,6 @@ func (f *FakeDataSource) Skills(ctx context.Context) (Skills, error) { return fakeSkills(), nil } -// fakeVerdictRun is the SkillOpt eval run id the fake binary-verdicts fixture is -// keyed on (matches the pending candidate skill-reviewer-v3's evaluation). -const fakeVerdictRun = "eval-reviewer-0007" - // fakeJobChecks builds the fixed job-detail failed-check fixture (gitmoot #711), // keyed by job id. job-5 (the integrate/review/open-PR job) failed two // deterministic result checks under a block policy; every other job passed @@ -2084,49 +1971,9 @@ func (f *FakeDataSource) JobChecks(ctx context.Context, jobID string) (JobChecks return JobChecks{JobID: jobID, Mode: "warn", Failed: []ResultCheck{}}, nil } -// fakeBinaryVerdicts builds the fixed per-run binary-check breakdown (gitmoot -// #714): five decomposed questions across two dimensions, three passing and two -// failing, ordered by (dimension, questionId) — the same order the live store -// reads. Passed/Failed are derived from Verdict == "yes". -func fakeBinaryVerdicts() BinaryVerdicts { - verdicts := []BinaryVerdict{ - {QuestionID: "q-cites-sources", Dimension: "correctness", Verdict: "yes", - Explanation: "Every claim in the review cites a file:line.", Weight: 1}, - {QuestionID: "q-no-false-pass", Dimension: "correctness", Verdict: "no", - Explanation: "Approved a change whose test is skipped, so the pass is unearned.", Weight: 2}, - {QuestionID: "q-actionable", Dimension: "usefulness", Verdict: "yes", - Explanation: "Findings name a concrete fix & location.", Weight: 1}, - {QuestionID: "q-no-nits-as-blockers", Dimension: "usefulness", Verdict: "yes", - Explanation: "Nits are labelled, not raised as blockers.", Weight: 1}, - {QuestionID: "q-scoped", Dimension: "usefulness", Verdict: "no", - Explanation: "Two findings are outside the diff & should have been dropped.", Weight: 1}, - } - out := BinaryVerdicts{RunID: fakeVerdictRun, Verdicts: verdicts} - for i := range verdicts { - out.Verdicts[i].Pass = verdicts[i].Verdict == "yes" - if out.Verdicts[i].Pass { - out.Passed++ - } else { - out.Failed++ - } - } - return out -} - -// BinaryVerdicts implements DataSource. It returns the fixed fakeBinaryVerdicts -// fixture for fakeVerdictRun; any other run id yields zero counts and an empty -// (never nil) list. Output is deterministic and byte-stable. -func (f *FakeDataSource) BinaryVerdicts(ctx context.Context, runID string) (BinaryVerdicts, error) { - if runID == fakeVerdictRun { - return fakeBinaryVerdicts(), nil - } - return BinaryVerdicts{RunID: runID, Verdicts: []BinaryVerdict{}}, nil -} - -// fakeAttention builds the fixed "Needs a human" fixture (gitmoot #528): two -// blocked job gates, two pending synth approvals and one candidate awaiting -// promotion. Every timestamp is anchored on fakeChartsNow (never time.Now()) so -// the section is byte-stable across polls. +// fakeAttention builds the fixed "Needs a human" fixture (gitmoot #528): three +// blocked job gates. Every timestamp is anchored on fakeChartsNow (never +// time.Now()) so the section is byte-stable across polls. func fakeAttention() Attention { const h = time.Hour at := func(x time.Duration) int64 { return fakeChartsNow.Add(-x).UnixMilli() } @@ -2138,23 +1985,12 @@ func fakeAttention() Attention { Agent: "claude-a", Repo: "jerryfane/noted", State: "blocked", CreatedAt: at(90 * time.Minute)}, // Long suggested-action regression fixture (issue #88): the chip must // ellipsize instead of squeezing the title into a per-character wrap. - {JobID: "job-long-action-7", Need: "Commit the intact working-tree changes with: git add internal/memory/cluster.go internal/memory/cluster_test.go internal/db/store.go internal/db/memory_cluster_store.go && git commit -m 'feat(memory): cluster hierarchy' then re-run the gate", - Title: "Implement the ENGINE half of the memory cluster hierarchy with bounded fan-out and recursive depth", + {JobID: "job-long-action-7", Need: "Commit the intact working-tree changes with: git add internal/cli/merge_gate.go internal/cli/merge_gate_test.go internal/db/store.go internal/db/review_head_store.go && git commit -m 'feat(merge): exact-head review guard' then re-run the gate", + Title: "Implement the exact-head review guard for the merge gate with bounded evidence and recursive head lookup", Agent: "wave-impl", Repo: "jerryfane/gitmoot", State: "blocked", CreatedAt: at(6 * 24 * h)}, }, - SynthItems: []AttentionSynthItem{ - {ID: "synth-reviewer-0031", TemplateID: "tmpl-reviewer", Repo: "jerryfane/gitmoot", - Question: "Should a review flag an unearned pass when the asserting test is skipped?", - Gap: 0.29, WeakAgent: "reviewer@v2", StrongAgent: "reviewer@v3", JudgeAgent: "cross-family-judge", CreatedAt: at(4 * h)}, - {ID: "synth-reviewer-0030", TemplateID: "tmpl-reviewer", Repo: "jerryfane/gitmoot", - Question: "Does the review keep findings scoped to the diff under test?", - Gap: 0.18, WeakAgent: "reviewer@v2", StrongAgent: "reviewer@v3", JudgeAgent: "cross-family-judge", CreatedAt: at(5 * h)}, - }, - Candidates: []AttentionCandidate{ - {TemplateID: "tmpl-reviewer", Name: "reviewer", VersionID: "skill-reviewer-v3", Number: 3, Score: "0.81", CreatedAt: at(6 * h)}, - }, } - att.Total = len(att.Gates) + len(att.SynthItems) + len(att.Candidates) + att.Total = len(att.Gates) return att } diff --git a/server.go b/server.go index 51b0a08..0482fcd 100644 --- a/server.go +++ b/server.go @@ -12,9 +12,8 @@ import ( // static UI (with SPA fallback to index.html) plus the JSON API (handleRuns/ // handleJobs/handleAgents/handleAgent/handleCharts/handleHealth/ // handleLearningSkills/handleOverview/handleTasks/ -// handleWakeSummary/handleWakes/handleWakeReceipts/ // handleOrg/handleOrgRole/handleWorkflows/handleWorkflow/ -// handleAttention/handleJobChecks/handleBinaryVerdicts/ +// handleAttention/handleJobChecks/ // handleState/handleJob/handleGraph/handleChangeEvents in api.go) and the // run-state SSE stream (handleEvents in sse.go). func Serve(ds DataSource) http.Handler { @@ -30,9 +29,6 @@ func Serve(ds DataSource) http.Handler { mux.HandleFunc("GET /api/config", s.handleConfig) mux.HandleFunc("GET /api/learning/skills", s.handleLearningSkills) mux.HandleFunc("GET /api/overview", s.handleOverview) - mux.HandleFunc("GET /api/wakes/summary", s.handleWakeSummary) - mux.HandleFunc("GET /api/wakes/receipts", s.handleWakeReceipts) - mux.HandleFunc("GET /api/wakes", s.handleWakes) mux.HandleFunc("GET /api/tasks", s.handleTasks) mux.HandleFunc("GET /api/org", s.handleOrg) mux.HandleFunc("GET /api/org/role/{name}", s.handleOrgRole) @@ -40,7 +36,6 @@ func Serve(ds DataSource) http.Handler { mux.HandleFunc("GET /api/workflow/{label}", s.handleWorkflow) mux.HandleFunc("GET /api/attention", s.handleAttention) mux.HandleFunc("GET /api/job/{id}/checks", s.handleJobChecks) - mux.HandleFunc("GET /api/run/{id}/verdicts", s.handleBinaryVerdicts) mux.HandleFunc("GET /api/state", s.handleState) mux.HandleFunc("GET /api/job/{id}", s.handleJob) mux.HandleFunc("GET /api/graph", s.handleGraph) @@ -71,15 +66,15 @@ func newServer(ds DataSource) *server { // The JSON API handlers (handleRuns/handleJobs/handleAgents/handleAgent/ // handleCharts/handleHealth/handleLearningSkills/ // handleOverview/handleTasks/ -// handleWakeSummary/handleWakes/handleWakeReceipts/ // handleOrg/handleOrgRole/handleWorkflows/handleWorkflow/ -// handleAttention/handleJobChecks/handleBinaryVerdicts/ +// handleAttention/handleJobChecks/ // handleState/handleJob/handleGraph/handleChangeEvents) live in api.go and the // run-state SSE handler (handleEvents) lives in sse.go. // staticHandler serves the embedded web/dist assets. Requests that do not map // to an existing file fall back to index.html so the client-side router can -// take over. +// take over — except under /api/, where an unknown or removed endpoint must +// answer 404 rather than a 200 HTML shell a client would try to parse as JSON. func (s *server) staticHandler() http.Handler { dist := webDistFS() fileServer := http.FileServer(http.FS(dist)) @@ -96,6 +91,10 @@ func (s *server) staticHandler() http.Handler { if upath == "" { upath = "index.html" } + if upath == "api" || strings.HasPrefix(upath, "api/") { + http.NotFound(w, r) + return + } if f, err := dist.Open(upath); err == nil { f.Close() fileServer.ServeHTTP(w, r) diff --git a/server_test.go b/server_test.go index ca7bc71..051c415 100644 --- a/server_test.go +++ b/server_test.go @@ -47,6 +47,35 @@ func TestServeSPAFallback(t *testing.T) { } } +// TestRemovedAPIRoutesNotFound pins that endpoints removed from the contract +// (the wake ledger and the SkillOpt verdicts stub, gitmoot/gitmoot#2593) and +// any other unknown /api/ path answer 404 instead of the 200 SPA shell. +func TestRemovedAPIRoutesNotFound(t *testing.T) { + srv := httptest.NewServer(Serve(NewFakeDataSource())) + defer srv.Close() + + for _, path := range []string{ + "/api/wakes", + "/api/wakes/summary", + "/api/wakes/receipts", + "/api/run/eval-reviewer-0007/verdicts", + "/api/no-such-endpoint", + "/api", + } { + resp, err := http.Get(srv.URL + path) + if err != nil { + t.Fatalf("GET %s: %v", path, err) + } + resp.Body.Close() + if resp.StatusCode != http.StatusNotFound { + t.Fatalf("GET %s status = %d, want 404", path, resp.StatusCode) + } + if ct := resp.Header.Get("Content-Type"); strings.HasPrefix(ct, "text/html") { + t.Fatalf("GET %s served the HTML shell (Content-Type %q)", path, ct) + } + } +} + // TestStateRouteRegistered asserts the /api/state route is wired into the mux // and served by the JSON handler (not the static SPA fallback, which would // return an HTML index). diff --git a/web/dist/index.html b/web/dist/index.html index 84d681b..e997d27 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -134,7 +134,7 @@
SYSTEM
-
+
Needs a human @@ -513,7 +513,7 @@ vw: 900, vh: 560, showPrompt: true, showOutput: false, view: 'overview', // bare / is operator overview; graph survives only at /?run= // Runs column - runsOpen: true, runsQuery: '', facets: { status: [], kind: [], agent: [], repo: [] }, + runsOpen: true, runsQuery: '', facets: { status: [], agent: [], repo: [] }, openFacet: null, oneShotsExpanded: false, oneShotLimit: 6, selectedRunId: null, hoverRun: null, listLoading: true, listError: false, // Persistent top bar: daemon liveness for the "daemon · up … · ● LIVE" chip. @@ -543,11 +543,10 @@ MIN = 60000; HR = 3600000; DAY = 86400000; // relTime() units facetDefs = { status: ['running','succeeded','failed','blocked','cancelled'], - kind: ['orchestrate','goal','implement','ask','review'], agent: ['codex','claude','kimi'], repo: ['acme/webapp','quant/pricing','ops/waybread','data/warehouse'] }; - facetLabels = { status:'Status', kind:'Kind', agent:'Agent', repo:'Repo' }; + facetLabels = { status:'Status', agent:'Agent', repo:'Repo' }; kindColors = { orchestrate:'#9ece6a', goal:'#bb9af7', implement:'#7aa2f7', ask:'#7dcfff', review:'#e0af68' }; relTime(ago) { @@ -1115,8 +1114,8 @@ this.stopConfigPoll(); if (this._configRoot) this._configRoot.style.display = 'none'; } - // Attention overlay ("Needs a human": blocked gates, pending synth approvals, - // candidates awaiting promotion). Same body-appended overlay pattern. + // Attention overlay ("Needs a human": blocked job gates). Same body-appended + // overlay pattern. if (v === 'attention') { const root = this.ensureAttentionDom(); root.style.display = 'block'; @@ -1161,114 +1160,45 @@ "#overview-root .ov-grid{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(340px,.9fr);gap:16px;margin-top:16px}.ov-stack{display:grid;align-content:start;gap:16px}", "#overview-root .ov-activity-row{display:grid;grid-template-columns:10px minmax(0,1fr) auto 52px;gap:10px;align-items:center;min-height:51px;border-bottom:1px solid rgba(160,168,220,.07);font:10px 'JetBrains Mono'}.ov-activity-row:last-of-type{border-bottom:0}.ov-label{color:#eef0ff;font:600 11.5px 'JetBrains Mono'}.ov-label .ns{color:#777eac;font-weight:500}.ov-agents{margin-top:4px;color:#555c83;font-size:9px}.ov-running{padding:2px 7px;border:1px solid rgba(158,206,106,.25);border-radius:5px;color:#9ece6a;background:rgba(158,206,106,.08)}.ov-age{text-align:right;color:#9ece6a}.ov-unattended{padding-top:10px;color:#4f567f;font:9.5px 'JetBrains Mono'}.ov-empty{padding:14px 0;color:#596087;font:10.5px 'JetBrains Mono'}.ov-muted-dot{width:7px;height:7px;border-radius:50%;background:#5a6088}", "#overview-root .ov-notable-row{display:grid;grid-template-columns:22px 120px minmax(0,1fr) 62px 42px;gap:8px;align-items:center;min-height:36px;border-bottom:1px solid rgba(160,168,220,.055);font:9.5px 'JetBrains Mono'}.ov-notable-row:last-child{border-bottom:0}.ov-outcome{width:20px;height:20px;display:grid;place-items:center;border:1px solid rgba(160,168,220,.18);border-radius:5px}.ov-outcome.succeeded{color:#9ece6a;border-color:rgba(158,206,106,.25)}.ov-outcome.failed{color:#f7768e;border-color:rgba(247,118,142,.25)}.ov-outcome.cancelled{color:#697099}.ov-agent{color:#cabff2;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ov-job-title{color:#c7c9e5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ov-num{text-align:right;color:#697099}", - "#overview-root .ov-today-tiles{display:grid;grid-template-columns:repeat(4,1fr);gap:9px;margin:6px 0 12px}.ov-tile{padding:10px;border:1px solid rgba(160,168,220,.12);border-radius:7px;background:#0f1120}.ov-tile b{display:block;font:600 18px 'JetBrains Mono';color:#9ece6a}.ov-tile.fail b{color:#f7768e}.ov-tile.cancel b{color:#8b90b8}.ov-tile.wake b{color:#5a6088}.ov-tile.wake.problem{border-color:rgba(224,175,104,.35);background:rgba(224,175,104,.065)}.ov-tile.wake.problem b{color:#e0af68}.ov-tile.wake.aging{border-color:rgba(247,118,142,.52);background:rgba(247,118,142,.09)}.ov-tile.wake.aging b{color:#f7768e}.ov-tile span{display:block;margin-top:4px;color:#555c83;font:8px 'JetBrains Mono';letter-spacing:.1em;text-transform:uppercase}.ov-bars{height:66px;display:flex;align-items:flex-end;gap:3px;border-bottom:1px solid rgba(160,168,220,.07)}.ov-bar{flex:1;min-width:2px;background:#7da357;border-radius:2px 2px 0 0}.ov-bar-axis{display:flex;justify-content:space-between;margin-top:5px;color:#41486d;font:8px 'JetBrains Mono'}.ov-token{margin-top:12px;color:#7c83aa;font:9.5px 'JetBrains Mono'}.ov-token b{color:#cabff2;font-size:13px}", - "#overview-root .ov-wake-shell{margin-top:16px;padding:13px 14px 14px}.ov-wake-shell.problem{border-color:rgba(224,175,104,.3)}.ov-wake-shell.aging{border-color:rgba(247,118,142,.44);background:rgba(247,118,142,.025)}.ov-wake-dot{width:8px;height:8px;border-radius:50%;background:#5a6088}.ov-wake-shell.problem .ov-wake-dot{background:#e0af68}.ov-wake-shell.aging .ov-wake-dot{background:#f7768e}.ov-wake-rollup{margin-left:auto;display:flex;align-items:center;gap:6px;color:#62698f;font:9px 'JetBrains Mono';letter-spacing:0;text-transform:none}.ov-wake-chip{padding:2px 7px;border:1px solid rgba(160,168,220,.14);border-radius:5px;background:#0f1120}.ov-wake-chip.bad{color:#f7768e;border-color:rgba(247,118,142,.28);background:rgba(247,118,142,.07)}.ov-wake-grid{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(330px,.8fr);gap:14px;margin-top:8px}.ov-wake-pane{min-width:0;border:1px solid rgba(160,168,220,.1);border-radius:8px;background:#0c0e1a;overflow:hidden}.ov-wake-pane-head{min-height:36px;display:flex;align-items:center;gap:8px;padding:7px 10px;border-bottom:1px solid rgba(160,168,220,.08);color:#8b90b8;font:600 9px 'JetBrains Mono';letter-spacing:.1em;text-transform:uppercase}.ov-wake-pane-head .muted{color:#4f567f;font-weight:400;letter-spacing:0;text-transform:none}.ov-wake-controls{margin-left:auto;display:flex;gap:6px}.ov-wake-controls select{height:26px;max-width:128px;padding:0 24px 0 8px;border:1px solid rgba(160,168,220,.14);border-radius:6px;background:#0f1120;color:#a8aecf;font:9px 'JetBrains Mono'}.ov-wake-list{max-height:286px;overflow:auto}.ov-wake-row{display:grid;grid-template-columns:92px minmax(130px,1fr) 116px 58px 88px 48px;gap:8px;align-items:center;min-height:47px;padding:7px 10px;border-bottom:1px solid rgba(160,168,220,.06);font:9.5px 'JetBrains Mono'}.ov-wake-row:last-child{border-bottom:0}.ov-wake-row.urgent{background:rgba(247,118,142,.055);box-shadow:inset 3px 0 #f7768e}.ov-wake-role{color:#eef0ff;font-weight:600;overflow:hidden;text-overflow:ellipsis}.ov-wake-source{min-width:0;color:#8b90b8}.ov-wake-source b{display:block;color:#c7c9e5;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ov-wake-source span{display:block;margin-top:3px;color:#555c83;font-size:8.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ov-wake-state{display:inline-flex;width:max-content;max-width:100%;padding:3px 6px;border:1px solid rgba(160,168,220,.16);border-radius:5px;color:#8b90b8;background:rgba(160,168,220,.05);overflow:hidden;text-overflow:ellipsis}.ov-wake-state.delivery_unknown,.ov-wake-state.stalled{color:#f7768e;border-color:rgba(247,118,142,.32);background:rgba(247,118,142,.1)}.ov-wake-state.pending,.ov-wake-state.attempted{color:#e0af68;border-color:rgba(224,175,104,.28);background:rgba(224,175,104,.07)}.ov-wake-state.failed{color:#ff9e64;border-color:rgba(255,158,100,.28)}.ov-wake-attempt,.ov-wake-age{text-align:right;color:#697099}.ov-wake-error{color:#e0af68;font-size:8.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ov-receipt-row{display:grid;grid-template-columns:86px minmax(92px,1fr) 48px 74px;gap:8px;align-items:center;min-height:43px;padding:7px 10px;border-bottom:1px solid rgba(160,168,220,.06);font:9.5px 'JetBrains Mono'}.ov-receipt-row:last-child{border-bottom:0}.ov-receipt-kind{min-width:0;color:#c7c9e5}.ov-receipt-kind span{display:block;margin-top:3px;color:#555c83;font-size:8.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ov-receipt-ok{color:#9ece6a;text-align:right}.ov-wake-empty{padding:18px 10px;color:#596087;font:10px 'JetBrains Mono'}.ov-wake-note{padding:8px 10px;border-top:1px solid rgba(160,168,220,.06);color:#4f567f;font:8.5px 'JetBrains Mono';line-height:1.45}", - "#overview-root .ov-wake-cols{display:grid;grid-template-columns:92px minmax(130px,1fr) 116px 58px 88px 48px;gap:8px;padding:6px 10px;border-bottom:1px solid rgba(160,168,220,.06);color:#444b70;font:8px 'JetBrains Mono';letter-spacing:.08em;text-transform:uppercase}.ov-wake-cols span:nth-last-child(-n+3){text-align:right}", + "#overview-root .ov-today-tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin:6px 0 12px}.ov-tile{padding:10px;border:1px solid rgba(160,168,220,.12);border-radius:7px;background:#0f1120}.ov-tile b{display:block;font:600 18px 'JetBrains Mono';color:#9ece6a}.ov-tile.fail b{color:#f7768e}.ov-tile.cancel b{color:#8b90b8}.ov-tile span{display:block;margin-top:4px;color:#555c83;font:8px 'JetBrains Mono';letter-spacing:.1em;text-transform:uppercase}.ov-bars{height:66px;display:flex;align-items:flex-end;gap:3px;border-bottom:1px solid rgba(160,168,220,.07)}.ov-bar{flex:1;min-width:2px;background:#7da357;border-radius:2px 2px 0 0}.ov-bar-axis{display:flex;justify-content:space-between;margin-top:5px;color:#41486d;font:8px 'JetBrains Mono'}.ov-token{margin-top:12px;color:#7c83aa;font:9.5px 'JetBrains Mono'}.ov-token b{color:#cabff2;font-size:13px}", "#overview-root .ov-fleet{grid-column:1/-1}.ov-fleet-list{display:flex;gap:9px;overflow-x:auto}.ov-fleet-item{display:flex;align-items:center;gap:7px;min-width:210px;padding:9px 11px;border:1px solid rgba(160,168,220,.12);border-radius:7px;background:#0f1120;font:9.5px 'JetBrains Mono'}.ov-fleet-item b{color:#eef0ff}.ov-runtime{padding:2px 6px;border:1px solid rgba(160,168,220,.16);border-radius:4px}.ov-runtime.claude{color:#cabff2;background:rgba(187,154,247,.1)}.ov-runtime.codex{color:#8fd3ff;background:rgba(110,198,255,.1)}.ov-runtime.kimi{color:#e8c58a;background:rgba(224,175,104,.1)}.ov-fleet-jobs{margin-left:auto;color:#596087}", "#overview-root .ov-shimmer{height:140px;border-radius:9px;background:#0d0f1c;position:relative;overflow:hidden}.ov-shimmer:after{content:'';position:absolute;inset:0;transform:translateX(-100%);background:linear-gradient(90deg,transparent,rgba(187,154,247,.08),transparent);animation:ovsh 1.35s infinite}@keyframes ovsh{to{transform:translateX(100%)}}.ov-loading{display:grid;grid-template-columns:1.45fr .9fr;gap:16px}.ov-loading .wide{grid-column:1/-1}", - "@media(max-width:768px){#overview-root{left:0!important;top:54px!important;bottom:calc(60px + env(safe-area-inset-bottom))!important}.ov-scroll{padding:14px 15px 24px!important}.ov-needs-list{display:grid!important;overflow:visible!important}.ov-need{width:auto!important;min-width:0!important;min-height:122px!important}.ov-grid{display:block!important;margin-top:13px!important}.ov-stack{display:block!important}.ov-panel{margin-bottom:13px}.ov-notable.empty-mobile,.ov-fleet.empty-mobile{display:none}.ov-activity-row{grid-template-columns:9px minmax(0,1fr) auto 38px!important}.ov-notable-row{grid-template-columns:22px 92px minmax(0,1fr) 38px!important}.ov-notable-row .elapsed{display:none}.ov-today-tiles{grid-template-columns:repeat(2,1fr)!important}.ov-wake-shell{padding:11px!important}.ov-wake-shell .ov-head{height:auto!important;min-height:28px;flex-wrap:wrap}.ov-wake-rollup{width:100%;margin-left:15px!important;overflow-x:auto;padding-bottom:3px}.ov-wake-grid{grid-template-columns:1fr!important}.ov-wake-list{max-height:none!important}.ov-wake-cols{display:none!important}.ov-wake-row{grid-template-columns:76px minmax(100px,1fr) 104px!important;gap:7px!important;min-height:64px!important}.ov-wake-row .ov-wake-attempt,.ov-wake-row .ov-wake-error,.ov-wake-row .ov-wake-age{grid-row:2}.ov-wake-row .ov-wake-attempt{text-align:left}.ov-wake-row .ov-wake-error{grid-column:2}.ov-wake-row .ov-wake-age{grid-column:3}.ov-receipt-row{grid-template-columns:72px minmax(90px,1fr) 42px 62px!important}.ov-wake-pane-head .muted{display:none}.ov-wake-controls{width:100%;margin-left:0!important}.ov-wake-controls select{flex:1;max-width:none!important}.ov-loading{display:grid!important;grid-template-columns:1fr!important}.ov-loading .wide{grid-column:auto}.ov-fresh{display:block!important;text-align:center;color:#4f567f;font:9.5px 'JetBrains Mono';padding:12px 0 6px}}" + "@media(max-width:768px){#overview-root{left:0!important;top:54px!important;bottom:calc(60px + env(safe-area-inset-bottom))!important}.ov-scroll{padding:14px 15px 24px!important}.ov-needs-list{display:grid!important;overflow:visible!important}.ov-need{width:auto!important;min-width:0!important;min-height:122px!important}.ov-grid{display:block!important;margin-top:13px!important}.ov-stack{display:block!important}.ov-panel{margin-bottom:13px}.ov-notable.empty-mobile,.ov-fleet.empty-mobile{display:none}.ov-activity-row{grid-template-columns:9px minmax(0,1fr) auto 38px!important}.ov-notable-row{grid-template-columns:22px 92px minmax(0,1fr) 38px!important}.ov-notable-row .elapsed{display:none}.ov-today-tiles{grid-template-columns:repeat(3,1fr)!important}.ov-loading{display:grid!important;grid-template-columns:1fr!important}.ov-loading .wide{grid-column:auto}.ov-fresh{display:block!important;text-align:center;color:#4f567f;font:9.5px 'JetBrains Mono';padding:12px 0 6px}}" ].join('\n'); document.head.appendChild(st); const root=document.createElement('div'); root.id='overview-root'; root.style.cssText='position:fixed;left:216px;top:54px;right:0;bottom:0;z-index:42;display:none;flex-direction:column'; root.innerHTML='
'; root.addEventListener('click',e=>{const link=e.target.closest&&e.target.closest('[data-ov-link]');if(!link)return;const href=link.getAttribute('href')||'';if(href.indexOf('/workflows/')===0){e.preventDefault();let label=href.slice(11);try{label=decodeURIComponent(label);}catch(x){}this.showWorkflow(label);}else if(href==='/workflows'){e.preventDefault();this.showWorkflows();}else if(href==='/attention'){e.preventDefault();this.showAttention();}else if(href==='/agents'){e.preventDefault();this.showAgents();}}); - this._wakeReceiptRole=this._wakeReceiptRole||'';this._wakeReceiptRange=this._wakeReceiptRange||'24h';this._wakeRoles=this._wakeRoles||[]; - root.addEventListener('change',e=>{if(e.target.id==='ov-wake-role'){this._wakeReceiptRole=e.target.value||'';this.fetchOverview(false);}else if(e.target.id==='ov-wake-range'){this._wakeReceiptRange=e.target.value||'24h';this.fetchOverview(false);}}); document.body.appendChild(root);this._dockOverlay(root);this._overviewRoot=root;return root; } _ovEsc(v){return this._galaxyEsc(v==null?'':String(v));} _ovDur(s){s=Math.max(0,Number(s||0));if(s<60)return Math.round(s)+'s';if(s<3600)return Math.round(s/60)+'m';if(s<86400)return Math.round(s/3600)+'h';return Math.round(s/86400)+'d';} _ovNum(n){n=Number(n||0);if(n>=1000000)return(n/1000000).toFixed(n>=10000000?0:1).replace(/\.0$/,'')+'M';if(n>=1000)return(n/1000).toFixed(n>=100000?0:1).replace(/\.0$/,'')+'K';return String(n);} _ovRuntime(rt){rt=String(rt||'').toLowerCase();return rt==='claude'||rt==='codex'||rt==='kimi'?rt:'shell';} - _wakeSince(range){ - const hours={ '1h':1,'6h':6,'24h':24,'7d':168 }[range||'24h']; - return hours?new Date(Date.now()-hours*3600000).toISOString():''; - } - _wakeErrorClass(value){ - const s=String(value||'').slice(0,256).toLowerCase(); - if(!s)return''; - if(/timeout|deadline|timed out/.test(s))return'TIMEOUT'; - if(/429|rate limit|throttl/.test(s))return'RATE LIMITED'; - if(/auth|unauthor|forbidden|permission|token|credential/.test(s))return'AUTH'; - if(/not found|unknown role|no such/.test(s))return'NOT FOUND'; - if(/connect|network|dial|reset|broken pipe|eof|transport|socket/.test(s))return'TRANSPORT'; - return'DELIVERY ERROR'; - } - _wakeStateRank(state){return({delivery_unknown:0,stalled:1,pending:2,attempted:3,failed:4,delivered:5})[state]??6;} - _wakeAbs(value){ - const d=new Date(value||'');if(!Number.isFinite(d.getTime()))return'-'; - return d.toLocaleString([],{month:'short',day:'numeric',hour:'2-digit',minute:'2-digit',timeZone:'UTC'})+' UTC'; - } - _wakeRead(url){ - return fetch(url,{cache:'no-store'}).then(async r=>({status:r.status,text:await r.text()})).catch(err=>({status:0,text:'',error:err})); - } fetchOverview(isPoll){ const token=(this._overviewFetchToken||0)+1;this._overviewFetchToken=token; - const receiptParams=new URLSearchParams({limit:'100'}),role=this._wakeReceiptRole||'',since=this._wakeSince(this._wakeReceiptRange||'24h'); - if(role)receiptParams.set('role',role);if(since)receiptParams.set('since',since); - Promise.all([ - this._wakeRead('/api/overview'), - this._wakeRead('/api/wakes/summary'), - this._wakeRead('/api/wakes/receipts?'+receiptParams.toString()) - ]).then(parts=>{ + fetch('/api/overview',{cache:'no-store'}).then(async r=>({status:r.status,text:await r.text()})).then(overview=>{ if(token!==this._overviewFetchToken||this.state.view!=='overview')return; - const overview=parts[0],wakeParts=parts.slice(1); if(overview.status===404){this._overviewData=null;this.renderOverview(null,'unsupported');return;} if(overview.status<200||overview.status>=300)throw new Error(overview.text||('HTTP '+overview.status)); - const sig=[overview.text,role,this._wakeReceiptRange||'24h',...wakeParts.map(p=>p.status+':'+p.text)].join('\\n'); - if(isPoll&&this._overviewSig===sig)return; - this._overviewSig=sig;this._overviewData=JSON.parse(overview.text); - if(wakeParts.some(p=>p.status===404)){ - this._wakeLedgerData={status:'unsupported',summary:{},rows:[],receipts:[]}; - }else if(wakeParts.every(p=>p.status>=200&&p.status<300)){ - try{ - const summary=JSON.parse(wakeParts[0].text)||{},receiptBody=JSON.parse(wakeParts[1].text)||{}; - const rows=Array.isArray(summary.rows)?summary.rows:[],receipts=Array.isArray(receiptBody.rows)?receiptBody.rows:[]; - this._wakeLedgerData={status:'ready',hasSnapshot:true,summary:summary,rows:rows,receipts:receipts}; - this._wakeRoles=[...new Set([...(this._wakeRoles||[]),...rows.map(r=>r.target_role),...receipts.map(r=>r.target_role)].filter(Boolean))].sort(); - }catch(e){ - this._wakeLedgerData=Object.assign({},this._wakeLedgerData||{hasSnapshot:false,summary:{},rows:[],receipts:[]},{status:'error'}); - } - }else{ - this._wakeLedgerData=Object.assign({},this._wakeLedgerData||{hasSnapshot:false,summary:{},rows:[],receipts:[]},{status:'error'}); - } + if(isPoll&&this._overviewSig===overview.text)return; + this._overviewSig=overview.text;this._overviewData=JSON.parse(overview.text); this.renderOverview(this._overviewData,'ready'); }).catch(err=>{if(token===this._overviewFetchToken&&!isPoll)this.renderOverview(null,'error');}); } - _wakeLedgerHTML(){ - const esc=this._ovEsc.bind(this),ledger=this._wakeLedgerData||{status:'loading',summary:{},rows:[],receipts:[]},summary=ledger.summary||{}; - const n=v=>Math.max(0,Number(v||0)),outstanding=n(summary.outstanding),pending=n(summary.pending),aged=n(summary.aged_attempted),unknown=n(summary.delivery_unknown),stalled=n(summary.stalled),oldest=n(summary.oldest_age_seconds); - const problem=outstanding>0||unknown>0||stalled>0,aging=outstanding>0&&aged>0,statusClass=aging?' aging':problem?' problem':''; - if(ledger.status==='unsupported')return '
Wake obligations
Wake ledger requires a newer gitmoot build.
'; - if(ledger.status==='loading')return '
Wake obligations
Loading wake obligations and receipts...
'; - if(ledger.status==='error'&&!ledger.hasSnapshot)return '
Wake obligations
Wake obligations are temporarily unavailable. No clear state is being inferred.
'; - const rows=(Array.isArray(ledger.rows)?ledger.rows:[]).slice().sort((a,b)=>this._wakeStateRank(a.state)-this._wakeStateRank(b.state)||n(b.age_seconds)-n(a.age_seconds)); - const wakeRows=rows.length?rows.map(r=>{ - const state=String(r.state||'pending'),urgent=state==='delivery_unknown'||state==='stalled',errorClass=this._wakeErrorClass(r.last_error); - return '
'+esc(r.target_role||'-')+''+esc(r.source_kind||'-')+''+esc(r.source_id||r.id||'-')+''+esc(state.replace(/_/g,' '))+''+n(r.attempt_count)+''+esc(errorClass||'-')+''+esc(this._ovDur(r.age_seconds))+'
'; - }).join(''):'
No outstanding wake obligations.
'; - const roles=(this._wakeRoles||[]).slice().sort(),role=this._wakeReceiptRole||'',range=this._wakeReceiptRange||'24h'; - const roleOptions=''+roles.map(v=>'').join(''); - const rangeOptions=[['1h','last hour'],['6h','last 6h'],['24h','last 24h'],['7d','last 7d'],['all','all receipts']].map(v=>'').join(''); - const receipts=Array.isArray(ledger.receipts)?ledger.receipts:[]; - const receiptRows=receipts.length?receipts.map(r=>'
'+esc(r.target_role||'-')+''+esc(r.source_kind||'-')+''+esc(r.id||'-')+''+n(r.attempt_count)+''+esc(this._wakeAbs(r.delivered_at))+'
').join(''):'
No matching delivery receipts.
'; - const stale=ledger.status==='error'?'refresh unavailable':''; - return '
Wake obligations '+outstanding+'
'+stale+'pending '+pending+'aged attempted '+aged+'delivery unknown '+unknown+'stalled '+stalled+'oldest '+esc(oldest?this._ovDur(oldest):'-')+'
Outstanding ledger urgent states first
rolesourcestateattemptserror classage
'+wakeRows+'
Metadata only. Delivery error text is classified; raw error strings are never displayed.
Receipts who was told, when, and whether it arrived
'+receiptRows+'
'; - } renderOverview(data,status){ if(!this._overviewRoot)return;const box=this._overviewRoot.querySelector('#ov-content'); if(status==='unsupported'){box.innerHTML='
Overview requires a newer gitmoot build. Jobs, Workflows, and the run graph remain available.
';return;} if(!data){box.innerHTML=status==='error'?'
Overview is temporarily unavailable.
':'
';return;} - const esc=this._ovEsc.bind(this),needs=Array.isArray(data.needs_you)?data.needs_you:[],act=data.activity||{},workflows=Array.isArray(act.workflows)?act.workflows:[],today=data.today||{},notable=Array.isArray(today.notable)?today.notable:[],fleet=Array.isArray(data.fleet)?data.fleet:[],wake=this._wakeLedgerData||{status:'loading',summary:{}},wakeSummary=wake.summary||{},wakeOutstanding=Math.max(0,Number(wakeSummary.outstanding||0)),wakeAging=wakeOutstanding>0&&Number(wakeSummary.aged_attempted||0)>0,wakeProblem=wakeOutstanding>0||Number(wakeSummary.delivery_unknown||0)>0||Number(wakeSummary.stalled||0)>0; - const needHTML=needs.length?'
Needs you '+needs.length+'stalled workflows · PRs to merge · blocked jobs · groom proposals
'+needs.map(n=>{const stalled=n.kind==='stalled_workflow',badge=stalled?'STALLED':n.kind==='pr_awaiting_merge'?'PR '+(n.ref||''):n.kind==='blocked_job'?'BLOCKED '+(n.ref||''):'GROOM '+(n.ref||''),ci=n.ci?'CI '+(n.ci==='green'?'✓':n.ci==='red'?'✗':'…')+'':'';return '
'+esc(badge)+''+esc(this._ovDur(n.age_s))+'
'+(stalled?'
'+this._wfLabelHTML(n.label||'')+'
':'')+'
'+esc(n.title||'Needs attention')+'
'+(stalled?'pane '+esc(n.pane||'-')+' · sess '+esc(n.session_id||'-')+(n.last_note?'
last note · '+esc(n.last_note):''):esc(n.repo||''))+ci+'
';}).join('')+'
':'
✓Nothing needs you0 PRs · 0 blocked · 0 proposals · 0 stalled workflows
'; + const esc=this._ovEsc.bind(this),needs=Array.isArray(data.needs_you)?data.needs_you:[],act=data.activity||{},workflows=Array.isArray(act.workflows)?act.workflows:[],today=data.today||{},notable=Array.isArray(today.notable)?today.notable:[],fleet=Array.isArray(data.fleet)?data.fleet:[]; + const needHTML=needs.length?'
Needs you '+needs.length+'stalled workflows · PRs to merge · blocked jobs · unlabeled jobs
'+needs.map(n=>{const stalled=n.kind==='stalled_workflow',badge=stalled?'STALLED':n.kind==='pr_awaiting_merge'?'PR '+(n.ref||''):n.kind==='blocked_job'?'BLOCKED '+(n.ref||''):n.kind==='unlabeled_jobs'?'UNLABELED':String(n.kind||'needs you').replace(/_/g,' ').toUpperCase(),ci=n.ci?'CI '+(n.ci==='green'?'✓':n.ci==='red'?'✗':'…')+'':'';return '
'+esc(badge)+''+esc(this._ovDur(n.age_s))+'
'+(stalled?'
'+this._wfLabelHTML(n.label||'')+'
':'')+'
'+esc(n.title||'Needs attention')+'
'+(stalled?'pane '+esc(n.pane||'-')+' · sess '+esc(n.session_id||'-')+(n.last_note?'
last note · '+esc(n.last_note):''):esc(n.repo||''))+ci+'
';}).join('')+'
':'
✓Nothing needs you0 PRs · 0 blocked · 0 stalled workflows
'; const activity='
Live fleet activity by workflow'+Number(act.queued||0)+' queued · Workflows ↗
'+(workflows.length?workflows.map(w=>{const p=this._wfSplitLabel(w.label||'');return '
'+(p.namespace?''+esc(p.namespace)+'/':'')+esc(p.campaign)+'
'+esc((w.agents||[]).join(', '))+'
▶ '+Number(w.running||0)+' running'+esc(this._ovDur(w.started_ago_s))+'
';}).join('')+(act.unattended_note?'
unattended · '+esc(act.unattended_note)+'
':''):'
Fleet idle · no jobs yet · '+Number(act.queued||0)+' queued
')+'
'; const notableHTML='
Notable completions last 5 finished
'+(notable.length?notable.map(n=>'
'+(n.outcome==='succeeded'?'✓':n.outcome==='failed'?'✗':'⊘')+''+esc(n.agent||'agent')+''+esc(n.title||'job')+''+esc(n.elapsed_s?this._ovDur(n.elapsed_s):'-')+''+esc(this._ovDur(n.age_s))+'
').join(''):'
No jobs have finished in the last 24h.
')+'
'; const hours=Array.isArray(today.per_hour)?today.per_hour:[],max=Math.max(1,...hours.map(Number)),bars=hours.some(Number)?'
'+hours.map(v=>'').join('')+'
24h agojobs / hournow
':''; - const wakeTileValue=wake.status==='ready'||(wake.status==='error'&&wake.hasSnapshot)?this._ovNum(wakeOutstanding):'-',wakeTileTitle=wakeOutstanding?' title="oldest '+esc(this._ovDur(wakeSummary.oldest_age_seconds))+'"':''; - const todayHTML='
Today rolling 24h
'+this._ovNum(today.completed)+'completed
'+this._ovNum(today.failed)+'failed
'+this._ovNum(today.cancelled)+'cancelled
'+wakeTileValue+'wake obligations
'+bars+'
'+this._ovNum(Number(today.tokens_in||0)+Number(today.tokens_out||0))+' tokens · '+this._ovNum(today.tokens_in)+' in · '+this._ovNum(today.tokens_out)+' out
'; + const todayHTML='
Today rolling 24h
'+this._ovNum(today.completed)+'completed
'+this._ovNum(today.failed)+'failed
'+this._ovNum(today.cancelled)+'cancelled
'+bars+'
'+this._ovNum(Number(today.tokens_in||0)+Number(today.tokens_out||0))+' tokens · '+this._ovNum(today.tokens_in)+' in · '+this._ovNum(today.tokens_out)+' out
'; const fleetHTML='
Fleet at a glance Agents ↗
'+(fleet.length?'
'+fleet.map(a=>'
'+esc(a.agent)+''+esc(a.runtime||'shell')+''+Number(a.jobs_today||0)+' today
').join('')+'
':'
No agents registered yet.
')+'
'; - const fresh=!needs.length&&!workflows.length&&!Number(today.completed||0)&&!Number(today.failed||0)&&!wakeProblem&&!fleet.length; - box.innerHTML=needHTML+this._wakeLedgerHTML()+'
'+activity+notableHTML+'
'+todayHTML+'
'+fleetHTML+'
'+(fresh?'':''); + const fresh=!needs.length&&!workflows.length&&!Number(today.completed||0)&&!Number(today.failed||0)&&!fleet.length; + box.innerHTML=needHTML+'
'+activity+notableHTML+'
'+todayHTML+'
'+fleetHTML+'
'+(fresh?'':''); } // ============================================================ @@ -1282,12 +1212,12 @@ if(this._tasksRoot)return this._tasksRoot;const st=document.createElement('style');st.textContent=[ "#tasks-root{font-family:Inter,system-ui,sans-serif;color:#c7c9e5;background:#080a14;overflow:hidden}#tasks-root *{box-sizing:border-box}#tasks-root button,#tasks-root input,#tasks-root select{font:inherit}", "#tasks-root .tk-head{height:72px;flex:none;display:flex;align-items:center;gap:14px;padding:0 26px;border-bottom:1px solid rgba(160,168,220,.09)}.tk-title{font:700 23px 'Space Grotesk';color:#eef0ff}.tk-title i{font-style:normal;color:#bb9af7}.tk-summary{color:#596087;font:10.5px 'JetBrains Mono'}.tk-filters{margin-left:auto;display:flex;gap:8px}.tk-search{width:220px;padding:8px 10px;border:1px solid rgba(160,168,220,.14);border-radius:8px;background:#0f1120;color:#c7c9e5;font:10.5px 'JetBrains Mono';outline:0}.tk-select{padding:0 26px 0 10px;border:1px solid rgba(160,168,220,.14);border-radius:8px;background:#0f1120;color:#a8aecf;font:10px 'JetBrains Mono'}.tk-tabs{display:none}", - "#tasks-root .tk-board-wrap{flex:1;min-height:0;overflow-x:auto;overflow-y:hidden;padding:14px 26px 22px}.tk-board{height:100%;min-width:1040px;display:grid;grid-template-columns:repeat(3,minmax(210px,1fr)) 176px;gap:12px}.tk-col{min-width:0;display:flex;flex-direction:column;min-height:0}.tk-col-head{height:30px;display:flex;align-items:center;gap:8px;flex:none;color:#8b90b8;font:600 10px 'JetBrains Mono';letter-spacing:.08em;text-transform:uppercase}.tk-col-dot{width:7px;height:7px;border-radius:50%;background:#7d83ac}.tk-col.implementing .tk-col-dot{background:#9ece6a;box-shadow:0 0 8px rgba(158,206,106,.6)}.tk-col.pr_open .tk-col-dot{background:#6ec6ff}.tk-col.blocked .tk-col-dot{background:#f7768e}.tk-col.merged .tk-col-dot{background:#5a6088}.tk-col-count{margin-left:auto;padding:2px 7px;border-radius:9px;background:rgba(160,168,220,.1);color:#a8aecf;font-size:9px;letter-spacing:0}.tk-col-body{flex:1;min-height:0;overflow-y:auto;padding-right:3px;display:flex;flex-direction:column;gap:8px}.tk-empty{padding:24px 4px;text-align:center;color:#4f567f;font:9.5px 'JetBrains Mono'}.tk-card{flex:none;padding:10px 11px;border:1px solid rgba(160,168,220,.13);border-radius:8px;background:#0f1120;cursor:pointer;transition:background .15s,border-color .15s}.tk-card:hover{background:#12152a}.tk-card.selected{border-color:rgba(187,154,247,.55);box-shadow:inset 0 0 0 1px rgba(187,154,247,.12)}.tk-card-title{color:#eef0ff;font-size:11.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tk-card-meta{display:flex;align-items:center;gap:7px;margin-top:8px;min-width:0}.tk-chip{max-width:120px;padding:2px 7px;border:1px solid rgba(160,168,220,.14);border-radius:4px;color:#8b90b8;background:rgba(160,168,220,.05);font:9px 'JetBrains Mono';white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tk-agent.claude{color:#cabff2;background:rgba(187,154,247,.1)}.tk-agent.codex{color:#8fd3ff;background:rgba(110,198,255,.1)}.tk-agent.kimi{color:#e8c58a;background:rgba(224,175,104,.1)}.tk-age{margin-left:auto;color:#50577d;font:9px 'JetBrains Mono'}.tk-state{display:flex;align-items:center;gap:7px;margin-top:8px;color:#68709c;font:9px 'JetBrains Mono'}.tk-state-dot{width:6px;height:6px;border-radius:50%;background:#697099}.tk-state-dot.running{background:#9ece6a;box-shadow:0 0 7px rgba(158,206,106,.6);animation:dotpulse 1.8s infinite}.tk-state-dot.green{background:#9ece6a}.tk-state-dot.red{background:#f7768e}.tk-state-dot.pending{background:#e0af68}.tk-blocked-reason{margin-top:8px;padding:5px 6px;border-radius:5px;background:rgba(247,118,142,.07);color:#f7768e;font:8.5px 'JetBrains Mono';white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tk-col.merged .tk-card{padding:8px}.tk-col.merged .tk-card-title{white-space:normal;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;font-size:10.5px}.tk-col.merged .tk-chip{display:none}", + "#tasks-root .tk-board-wrap{flex:1;min-height:0;overflow-x:auto;overflow-y:hidden;padding:14px 26px 22px}.tk-board{height:100%;min-width:800px;display:grid;grid-template-columns:repeat(2,minmax(210px,1fr)) 176px;gap:12px}.tk-col{min-width:0;display:flex;flex-direction:column;min-height:0}.tk-col-head{height:30px;display:flex;align-items:center;gap:8px;flex:none;color:#8b90b8;font:600 10px 'JetBrains Mono';letter-spacing:.08em;text-transform:uppercase}.tk-col-dot{width:7px;height:7px;border-radius:50%;background:#7d83ac}.tk-col.pr_open .tk-col-dot{background:#6ec6ff}.tk-col.blocked .tk-col-dot{background:#f7768e}.tk-col.merged .tk-col-dot{background:#5a6088}.tk-col-count{margin-left:auto;padding:2px 7px;border-radius:9px;background:rgba(160,168,220,.1);color:#a8aecf;font-size:9px;letter-spacing:0}.tk-col-body{flex:1;min-height:0;overflow-y:auto;padding-right:3px;display:flex;flex-direction:column;gap:8px}.tk-empty{padding:24px 4px;text-align:center;color:#4f567f;font:9.5px 'JetBrains Mono'}.tk-card{flex:none;padding:10px 11px;border:1px solid rgba(160,168,220,.13);border-radius:8px;background:#0f1120;cursor:pointer;transition:background .15s,border-color .15s}.tk-card:hover{background:#12152a}.tk-card.selected{border-color:rgba(187,154,247,.55);box-shadow:inset 0 0 0 1px rgba(187,154,247,.12)}.tk-card-title{color:#eef0ff;font-size:11.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tk-card-meta{display:flex;align-items:center;gap:7px;margin-top:8px;min-width:0}.tk-chip{max-width:120px;padding:2px 7px;border:1px solid rgba(160,168,220,.14);border-radius:4px;color:#8b90b8;background:rgba(160,168,220,.05);font:9px 'JetBrains Mono';white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tk-agent.claude{color:#cabff2;background:rgba(187,154,247,.1)}.tk-agent.codex{color:#8fd3ff;background:rgba(110,198,255,.1)}.tk-agent.kimi{color:#e8c58a;background:rgba(224,175,104,.1)}.tk-age{margin-left:auto;color:#50577d;font:9px 'JetBrains Mono'}.tk-state{display:flex;align-items:center;gap:7px;margin-top:8px;color:#68709c;font:9px 'JetBrains Mono'}.tk-state-dot{width:6px;height:6px;border-radius:50%;background:#697099}.tk-state-dot.green{background:#9ece6a}.tk-state-dot.red{background:#f7768e}.tk-state-dot.pending{background:#e0af68}.tk-blocked-reason{margin-top:8px;padding:5px 6px;border-radius:5px;background:rgba(247,118,142,.07);color:#f7768e;font:8.5px 'JetBrains Mono';white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tk-col.merged .tk-card{padding:8px}.tk-col.merged .tk-card-title{white-space:normal;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;font-size:10.5px}.tk-col.merged .tk-chip{display:none}", "#tasks-root .tk-hint{position:absolute;left:50%;bottom:14px;transform:translateX(-50%);padding:6px 10px;border:1px solid rgba(160,168,220,.12);border-radius:14px;background:#0d0f1c;color:#596087;font:9px 'JetBrains Mono';pointer-events:none}.tk-detail{position:absolute;right:0;top:0;bottom:0;width:410px;z-index:5;display:flex;flex-direction:column;background:#0a0b16;border-left:1px solid rgba(160,168,220,.15);box-shadow:-24px 0 48px rgba(0,0,0,.46);animation:panelin .22s ease}.tk-detail-head{padding:17px 18px 14px;border-bottom:1px solid rgba(160,168,220,.09)}.tk-detail-top{display:flex;align-items:center;gap:8px}.tk-state-badge{padding:3px 7px;border:1px solid rgba(160,168,220,.18);border-radius:5px;color:#8b90b8;font:9px 'JetBrains Mono'}.tk-state-badge.blocked{color:#f7768e;border-color:rgba(247,118,142,.3);background:rgba(247,118,142,.08)}.tk-close{margin-left:auto;width:26px;height:26px;border:1px solid rgba(160,168,220,.14);border-radius:7px;background:#0f1120;color:#8b90b8;cursor:pointer}.tk-detail-title{margin-top:13px;color:#eef0ff;font-size:15px;font-weight:600;line-height:1.4}.tk-detail-meta{display:flex;gap:8px;align-items:center;margin-top:9px;color:#596087;font:9.5px 'JetBrains Mono'}.tk-detail-body{flex:1;min-height:0;overflow-y:auto;padding:16px 18px 84px}.tk-section{margin:0 0 10px;color:#5a6088;font:600 9px 'JetBrains Mono';letter-spacing:.12em;text-transform:uppercase}.tk-life{padding:2px 0 16px}.tk-life-row{display:grid;grid-template-columns:22px minmax(0,1fr) auto;gap:9px;align-items:center;min-height:42px;position:relative;color:#697099;font:10.5px 'JetBrains Mono'}.tk-life-row:not(:last-child):before{content:'';position:absolute;left:10px;top:27px;bottom:-15px;width:1px;background:rgba(160,168,220,.14)}.tk-life-mark{width:20px;height:20px;display:grid;place-items:center;border:1px solid rgba(160,168,220,.18);border-radius:50%;background:#0d0f1c}.tk-life-row.done{color:#a8aecf}.tk-life-row.done .tk-life-mark{color:#9ece6a;border-color:rgba(158,206,106,.3);background:rgba(158,206,106,.08)}.tk-life-row.current{color:#cabff2}.tk-life-row.blocked{color:#f7768e}.tk-life-row.blocked .tk-life-mark{border-color:rgba(247,118,142,.35);background:rgba(247,118,142,.09)}.tk-life-note{color:#f7768e;font-size:8.5px}.tk-state-box{margin:4px 0 18px;padding:12px;border:1px solid rgba(160,168,220,.13);border-radius:8px;background:#0f1120;color:#a8aecf;font:10px/1.55 'JetBrains Mono'}.tk-state-box.blocked{border-color:rgba(247,118,142,.3);background:rgba(247,118,142,.05);color:#f7768e}.tk-state-box a{display:block;margin-top:9px;color:#f7768e;text-decoration:none}.tk-job{display:grid;grid-template-columns:8px 66px minmax(0,1fr) auto;gap:8px;align-items:center;min-height:31px;border-bottom:1px solid rgba(160,168,220,.06);color:#697099;font:9px 'JetBrains Mono'}.tk-job .action{padding:2px 5px;border:1px solid rgba(110,198,255,.18);border-radius:4px;color:#6ec6ff}.tk-detail-actions{position:absolute;left:0;right:0;bottom:0;display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:12px 18px 15px;border-top:1px solid rgba(160,168,220,.09);background:#0a0b16}.tk-action{display:flex;justify-content:center;padding:9px;border:1px solid rgba(160,168,220,.14);border-radius:7px;background:#0f1120;color:#c7c9e5;text-decoration:none;font:9.5px 'JetBrains Mono'}.tk-shimmer{height:100%;border-radius:8px;background:#0d0f1c;position:relative;overflow:hidden}.tk-shimmer:after{content:'';position:absolute;inset:0;transform:translateX(-100%);background:linear-gradient(90deg,transparent,rgba(187,154,247,.08),transparent);animation:tksh 1.35s infinite}@keyframes tksh{to{transform:translateX(100%)}}", "@media(max-width:768px){#tasks-root{left:0!important;top:54px!important;bottom:calc(60px + env(safe-area-inset-bottom))!important}.tk-head{height:auto!important;display:block!important;padding:13px 15px 10px!important}.tk-head>div:first-child{display:flex;align-items:baseline;justify-content:space-between;gap:10px}.tk-title{font-size:20px!important}.tk-summary{float:none!important;margin-top:0!important;white-space:nowrap}.tk-filters{margin-top:10px!important;display:grid!important;grid-template-columns:minmax(0,1fr) 70px 80px!important}.tk-search{width:auto!important;min-width:0}.tk-tabs{display:flex!important;gap:7px;padding:0 15px 10px;overflow-x:auto;flex:none}.tk-tab{flex:none;padding:6px 9px;border:1px solid rgba(160,168,220,.14);border-radius:14px;background:#0f1120;color:#8b90b8;font:9px 'JetBrains Mono';white-space:nowrap}.tk-tab.active{color:#cabff2;border-color:rgba(187,154,247,.35);background:rgba(187,154,247,.1)}.tk-board-wrap{padding:0 15px 18px!important;overflow:hidden!important}.tk-board{min-width:0!important;display:block!important}.tk-col{display:none!important;height:100%}.tk-col.mobile-active{display:flex!important}.tk-col-head{display:none}.tk-card{padding:12px!important}.tk-card-title{font-size:12px!important}.tk-col.merged .tk-chip{display:inline-block}.tk-hint{display:none}.tk-detail{position:fixed!important;inset:54px 0 calc(60px + env(safe-area-inset-bottom)) 0!important;width:auto!important;border-left:0!important;z-index:80!important}.tk-detail-actions{grid-template-columns:1fr!important}.tk-detail-body{padding-bottom:120px!important}}" ].join('\n');document.head.appendChild(st); const root=document.createElement('div');root.id='tasks-root';root.style.cssText='position:fixed;left:216px;top:54px;right:0;bottom:0;z-index:42;display:none;flex-direction:column';root.innerHTML='
Tasks.
'; - document.body.appendChild(root);this._dockOverlay(root);this._tasksFilters={query:'',repo:'all',agent:'all'};this._tasksTab=this._tasksTab||'implementing'; + document.body.appendChild(root);this._dockOverlay(root);this._tasksFilters={query:'',repo:'all',agent:'all'};this._tasksTab=this._tasksTab||'pr_open'; root.querySelector('#tk-search').addEventListener('input',e=>{this._tasksFilters.query=e.target.value||'';this.renderTasks(this._tasksData||[]);});root.querySelector('#tk-repo').addEventListener('change',e=>{this._tasksFilters.repo=e.target.value||'all';this.renderTasks(this._tasksData||[]);});root.querySelector('#tk-agent').addEventListener('change',e=>{this._tasksFilters.agent=e.target.value||'all';this.renderTasks(this._tasksData||[]);}); root.addEventListener('click',e=>{const tab=e.target.closest&&e.target.closest('[data-tk-tab]');if(tab){this._tasksTab=tab.getAttribute('data-tk-tab');this.renderTasks(this._tasksData||[]);return;}const card=e.target.closest&&e.target.closest('[data-task-id]');if(card){this._tasksSelected=card.getAttribute('data-task-id');this.renderTasks(this._tasksData||[]);return;}if(e.target.closest&&e.target.closest('[data-tk-close]')){this._tasksSelected='';this.renderTasks(this._tasksData||[]);return;}if(e.target.id==='tk-board'){this._tasksSelected='';this.renderTasks(this._tasksData||[]);}}); this._tasksKeydown=e=>{if(e.key==='Escape'&&this.state.view==='tasks'&&this._tasksSelected){this._tasksSelected='';this.renderTasks(this._tasksData||[]);}};document.addEventListener('keydown',this._tasksKeydown);this._tasksRoot=root;return root; @@ -1297,17 +1227,17 @@ } _tkRuntime(agent){const known=this._tasksRuntimeByAgent&&this._tasksRuntimeByAgent[agent];if(known)return this._ovRuntime(known);const s=String(agent||'').toLowerCase();if(s.indexOf('kimi')>=0)return'kimi';if(s.indexOf('research')>=0||s.indexOf('lead')>=0)return'claude';return'codex';} _tkRepo(repo){const s=String(repo||''),at=s.lastIndexOf('/');return at>=0?s.slice(at+1):s;} - _tkCard(task){const esc=this._ovEsc.bind(this),state=task.state||'',rt=this._tkRuntime(task.agent),age=this._ovDur(task.age_s),ci=task.ci||'',status=state==='implementing'?'
agent working
':state==='pr_open'?'
#'+Number(task.pr_number||0)+' · CI '+(ci==='green'?'✓':ci==='red'?'✗':'…')+'
':state==='merged'?'
merged'+(task.pr_number?' · #'+Number(task.pr_number):'')+'
':'';return '
'+esc(task.title)+'
'+esc(this._tkRepo(task.repo))+''+(task.agent?''+esc(task.agent)+'':'')+''+esc(age)+'
'+status+(state==='blocked'?'
'+esc(task.blocked_reason||'blocked')+'
':'')+'
';} - _tkDetail(task){if(!task)return'';const esc=this._ovEsc.bind(this),state=task.state||'',rt=this._tkRuntime(task.agent),steps=['implementing','pr_open','merged'],current=state==='blocked'?0:Math.max(0,steps.indexOf(state)),life=steps.map((s,i)=>{const done=i'+(done?'✓':blocked?'⚑':cur?'●':'○')+''+esc(s==='pr_open'?'PR open':s.charAt(0).toUpperCase()+s.slice(1))+''+(blocked?'blocked here':done?'done':'')+'
';}).join(''); - let stateBox='';if(state==='blocked')stateBox='
! BLOCKED
'+esc(task.blocked_reason||'Needs operator input')+'Resolve in Needs a human →
';else if(state==='pr_open'){const href='https://github.com/'+String(task.repo||'').replace(/^\/+|\/+$/g,'')+'/pull/'+Number(task.pr_number||0);stateBox='
PR #'+Number(task.pr_number||0)+' · CI '+esc(task.ci||'pending')+'
Open on GitHub ↗
';}else if(state==='implementing')stateBox='
agent is implementing
';else if(state==='merged')stateBox='
Merged'+(task.pr_number?' via PR #'+Number(task.pr_number):'')+' · '+esc(this._ovDur(task.age_s))+' ago
';else stateBox='
Queued for implementation.
'; + _tkCard(task){const esc=this._ovEsc.bind(this),state=task.state||'',rt=this._tkRuntime(task.agent),age=this._ovDur(task.age_s),ci=task.ci||'',status=state==='pr_open'?'
#'+Number(task.pr_number||0)+' · CI '+(ci==='green'?'✓':ci==='red'?'✗':'…')+'
':state==='merged'?'
merged'+(task.pr_number?' · #'+Number(task.pr_number):'')+'
':'';return '
'+esc(task.title)+'
'+esc(this._tkRepo(task.repo))+''+(task.agent?''+esc(task.agent)+'':'')+''+esc(age)+'
'+status+(state==='blocked'?'
'+esc(task.blocked_reason||'blocked')+'
':'')+'
';} + _tkDetail(task){if(!task)return'';const esc=this._ovEsc.bind(this),state=task.state||'',rt=this._tkRuntime(task.agent),steps=['pr_open','merged'],current=state==='blocked'?0:Math.max(0,steps.indexOf(state)),life=steps.map((s,i)=>{const done=i'+(done?'✓':blocked?'⚑':cur?'●':'○')+''+esc(s==='pr_open'?'PR open':s.charAt(0).toUpperCase()+s.slice(1))+''+(blocked?'blocked here':done?'done':'')+'
';}).join(''); + let stateBox='';if(state==='blocked')stateBox='
! BLOCKED
'+esc(task.blocked_reason||'Needs operator input')+'Resolve in Needs a human →
';else if(state==='pr_open'){const href='https://github.com/'+String(task.repo||'').replace(/^\/+|\/+$/g,'')+'/pull/'+Number(task.pr_number||0);stateBox='
PR #'+Number(task.pr_number||0)+' · CI '+esc(task.ci||'pending')+'
Open on GitHub ↗
';}else if(state==='merged')stateBox='
Merged'+(task.pr_number?' via PR #'+Number(task.pr_number):'')+' · '+esc(this._ovDur(task.age_s))+' ago
'; const jobs=(this._tasksJobs||[]).filter(j=>(j.repo&&j.repo===task.repo)||(task.agent&&j.agent===task.agent)).slice(0,3),jobHTML=jobs.length?jobs.map(j=>'
'+esc(j.kind||'job')+''+esc(j.agent||'agent')+''+esc(j.started?this._fmtDur(j.duration):'-')+'
').join(''):'
No linked jobs reported.
'; return ''; } renderTasks(data,status){ if(!this._tasksRoot)return;const board=this._tasksRoot.querySelector('#tk-board'),summary=this._tasksRoot.querySelector('#tk-summary'),tabs=this._tasksRoot.querySelector('#tk-tabs'),slot=this._tasksRoot.querySelector('#tk-detail-slot');if(status==='unsupported'){summary.textContent='';tabs.innerHTML='';board.innerHTML='
Tasks requires a newer gitmoot build.
';slot.innerHTML='';return;}if(!data){summary.textContent='';tabs.innerHTML='';board.innerHTML=status==='error'?'
Tasks are temporarily unavailable.
':'
';slot.innerHTML='';return;} const all=Array.isArray(data)?data:[],repos=[...new Set(all.map(t=>t.repo).filter(Boolean))].sort(),agents=[...new Set(all.map(t=>t.agent).filter(Boolean))].sort(),repoSel=this._tasksRoot.querySelector('#tk-repo'),agentSel=this._tasksRoot.querySelector('#tk-agent'),fill=(el,vals,label,current)=>{el.innerHTML=''+vals.map(v=>'').join('');};fill(repoSel,repos,'Repo',this._tasksFilters.repo);fill(agentSel,agents,'Agent',this._tasksFilters.agent); - const q=String(this._tasksFilters.query||'').toLowerCase(),filtered=all.filter(t=>(this._tasksFilters.repo==='all'||t.repo===this._tasksFilters.repo)&&(this._tasksFilters.agent==='all'||t.agent===this._tasksFilters.agent)&&(!q||[t.title,t.repo,t.agent,t.blocked_reason,String(t.pr_number||'')].join(' ').toLowerCase().indexOf(q)>=0));const states=[['implementing','Implementing'],['pr_open','PR open'],['blocked','Blocked'],['merged','Merged · 7d']],counts={};states.forEach(s=>counts[s[0]]=filtered.filter(t=>t.state===s[0]).length);const tracked=['implementing','pr_open','blocked'].reduce((n,s)=>n+counts[s],0);summary.textContent=tracked+' tracked · '+counts.blocked+' blocked';tabs.innerHTML=states.map(s=>'').join(''); - board.innerHTML=states.map(s=>{const items=filtered.filter(t=>t.state===s[0]);const empty={implementing:'- none in flight -',pr_open:'- no open PRs -',blocked:'- nothing blocked -',merged:'- none -'}[s[0]];return '
'+s[1]+''+items.length+'
'+(items.length?items.map(t=>this._tkCard(t)).join(''):'
'+empty+'
')+'
';}).join('');const selected=all.find(t=>t.id===this._tasksSelected);if(this._tasksSelected&&!selected)this._tasksSelected='';slot.innerHTML=this._tkDetail(selected);const hint=this._tasksRoot.querySelector('.tk-hint');if(hint)hint.remove();if(all.length&&!selected){const h=document.createElement('div');h.className='tk-hint';h.textContent='Click any card to open its detail panel';this._tasksRoot.appendChild(h);} + const q=String(this._tasksFilters.query||'').toLowerCase(),filtered=all.filter(t=>(this._tasksFilters.repo==='all'||t.repo===this._tasksFilters.repo)&&(this._tasksFilters.agent==='all'||t.agent===this._tasksFilters.agent)&&(!q||[t.title,t.repo,t.agent,t.blocked_reason,String(t.pr_number||'')].join(' ').toLowerCase().indexOf(q)>=0));const states=[['pr_open','PR open'],['blocked','Blocked'],['merged','Merged · 7d']],counts={};states.forEach(s=>counts[s[0]]=filtered.filter(t=>t.state===s[0]).length);const tracked=['pr_open','blocked'].reduce((n,s)=>n+counts[s],0);summary.textContent=tracked+' tracked · '+counts.blocked+' blocked';tabs.innerHTML=states.map(s=>'').join(''); + board.innerHTML=states.map(s=>{const items=filtered.filter(t=>t.state===s[0]);const empty={pr_open:'- no open PRs -',blocked:'- nothing blocked -',merged:'- none -'}[s[0]];return '
'+s[1]+''+items.length+'
'+(items.length?items.map(t=>this._tkCard(t)).join(''):'
'+empty+'
')+'
';}).join('');const selected=all.find(t=>t.id===this._tasksSelected);if(this._tasksSelected&&!selected)this._tasksSelected='';slot.innerHTML=this._tkDetail(selected);const hint=this._tasksRoot.querySelector('.tk-hint');if(hint)hint.remove();if(all.length&&!selected){const h=document.createElement('div');h.className='tk-hint';h.textContent='Click any card to open its detail panel';this._tasksRoot.appendChild(h);} } // ============================================================ @@ -2700,9 +2630,10 @@ // active. Escaping + state colors reuse _galaxyEsc / // _galaxyStateColor; job detail reuses the galaxy detail layout. // ============================================================ - // Design palette: codex cyan / claude purple / kimi orange / shell grey — cyan for - // codex avoids colliding with the succeeded-green state color in the same charts. - runtimeColors = { codex: '#7dcfff', claude: '#bb9af7', kimi: '#e0af68', shell: '#5a6088' }; + // Design palette: omp teal / shell grey (the live runtimes), plus codex cyan / + // claude purple / kimi orange so historical jobs on retired runtimes keep their + // color. None is green, which would collide with the succeeded state color. + runtimeColors = { omp: '#73daca', codex: '#7dcfff', claude: '#bb9af7', kimi: '#e0af68', shell: '#5a6088' }; _runtimeColor(rt) { return this.runtimeColors[rt] || '#5a6088'; } _fmtDur(ms) { if (!ms || ms <= 0) return '-'; @@ -4539,9 +4470,6 @@ "#charts-root .ch-sbtn{border:1px solid rgba(160,168,220,.14);border-radius:14px;background:#0f1120;padding:4px 11px;cursor:pointer;font-family:'JetBrains Mono',monospace;font-size:11px;color:#8b90b8}", "#charts-root .ch-sbtn:hover{color:#c8cce6;border-color:rgba(160,168,220,.24)}", "#charts-root .ch-sbtn.on{color:#cabff2;border-color:rgba(187,154,247,.35);background:rgba(187,154,247,.1)}", - "#charts-root .ch-foot{display:flex;align-items:center;gap:8px;margin-top:12px;padding-top:11px;border-top:1px solid rgba(160,168,220,0.07)}", - "#charts-root .ch-foot .ico{font-size:13px;color:#5a6088;flex:none}", - "#charts-root .ch-foot .txt{font-size:11.5px;color:#5a6088;font-style:italic}", // Top agents / repos: clickable rows (name + track/bar + count). "#charts-root .ch-rows{display:flex;flex-direction:column;gap:11px}", "#charts-root .ch-row{display:flex;align-items:center;gap:12px;cursor:pointer;border-radius:6px;padding:3px 5px;margin:-3px -5px}", @@ -4581,7 +4509,7 @@ // Derived from _jobSegs() so legend swatches can never diverge from the bars // (review catch: queued/cancelled greys rendered with no legend entry). const jobsLegend = '
' + this._jobSegs().map(g => legItem(g[0], g[1])).join('') + '
'; - const rtLegend = '
' + ['codex', 'claude', 'kimi'].map(rt => legItem(rt, this._runtimeColor(rt))).join('') + '
'; + const rtLegend = '
' + ['omp', 'shell', 'codex', 'claude', 'kimi'].map(rt => legItem(rt, this._runtimeColor(rt))).join('') + '
'; const scaleToggle = '
'; root.innerHTML = [ '
', @@ -4602,7 +4530,6 @@ '
', '
Tokens / day' + scaleToggle + '
', '
', - '
ⓘcodex & kimi token usage not yet captured - claude only
', '
', '
', '
Top agents' + rtLegend + '
', @@ -4924,8 +4851,7 @@ // ============================================================ // Attention view ("Needs a human", gitmoot #528): the fleet-wide // roll-up of everything parked on an explicit human decision — - // blocked job gates (#693), pending synth approvals, and template - // candidates awaiting promotion. Body-appended overlay, same + // blocked job gates (#693). Body-appended overlay, same // pattern as Health; polled with a signature-skip so a byte-stable // /api/attention response never re-renders. A gate row expands to // lazily fetch that job's failed result checks (/api/job//checks). @@ -4966,8 +4892,6 @@ "#attention-root .at-chip{display:inline-flex;align-items:center;padding:3px 9px;border-radius:7px;font-family:'JetBrains Mono',monospace;font-size:10.5px;font-weight:600;white-space:nowrap;flex:none}", "#attention-root .at-chip.gate{display:inline-block;max-width:44%;overflow:hidden;text-overflow:ellipsis;line-height:1.7}", "#attention-root .at-chip.gate{color:#e0af68;background:rgba(224,175,104,0.12);border:1px solid rgba(224,175,104,0.3)}", - "#attention-root .at-chip.gap{color:#7dcfff;background:rgba(125,207,255,0.1);border:1px solid rgba(125,207,255,0.28)}", - "#attention-root .at-chip.score{color:#9ece6a;background:rgba(158,206,106,0.1);border:1px solid rgba(158,206,106,0.28)}", "#attention-root .at-checks{margin-top:10px;padding-left:20px;display:none;flex-direction:column;gap:8px}", "#attention-root .at-checks.open{display:flex}", "#attention-root .at-check{padding:9px 11px;background-color:#0a0b16;border:1px solid rgba(247,118,142,0.22);border-radius:9px}", @@ -4988,9 +4912,7 @@ '
Needs a human.
', '
Everything parked on an explicit human decision - retry, approve, reject, continue or escalate.
', '
', - '
Blocked job gates
', - '
Pending synth approvals
', - '
Candidates awaiting promotion
', + '
Blocked job gates
', '
' ].join('\n'); document.body.appendChild(root); @@ -5036,9 +4958,7 @@ const esc = (s) => this._galaxyEsc(s); const root = this._attentionRoot; const gates = Array.isArray(data.gates) ? data.gates : []; - const synth = Array.isArray(data.synthItems) ? data.synthItems : []; - const cand = Array.isArray(data.candidates) ? data.candidates : []; - const total = (typeof data.total === 'number') ? data.total : (gates.length + synth.length + cand.length); + const total = (typeof data.total === 'number') ? data.total : gates.length; const upd = root.querySelector('#at-updated'); if (upd) upd.textContent = 'updated ' + new Date().toLocaleTimeString(); @@ -5046,13 +4966,11 @@ const hero = root.querySelector('#at-hero'); if (hero) { const stat = (n, k, hot) => '
' + n + '
' + k + '
'; - hero.innerHTML = stat(total, 'total waiting', true) + stat(gates.length, 'blocked gates', false) + stat(synth.length, 'synth approvals', false) + stat(cand.length, 'candidates', false); + hero.innerHTML = stat(total, 'total waiting', true) + stat(gates.length, 'blocked gates', false); } const setCount = (id, n) => { const el = root.querySelector(id); if (el) el.textContent = n ? ('· ' + n) : ''; }; setCount('#at-gates-c', gates.length); - setCount('#at-synth-c', synth.length); - setCount('#at-cand-c', cand.length); const col = (s) => this._galaxyStateColor(s || 'blocked'); const gatesEl = root.querySelector('#at-gates'); @@ -5077,45 +4995,6 @@ } } - const synthEl = root.querySelector('#at-synth'); - if (synthEl) { - if (!synth.length) { - synthEl.innerHTML = '
No synth review items are awaiting approval.
'; - } else { - synthEl.innerHTML = synth.map(s => { - const meta = []; - meta.push('' + esc(s.id) + ''); - if (s.templateId) meta.push('' + esc(s.templateId) + ''); - if (s.repo) meta.push('' + esc(s.repo) + ''); - if (s.weakAgent || s.strongAgent) meta.push('' + esc(s.weakAgent || '?') + ' → ' + esc(s.strongAgent || '?') + ''); - if (s.judgeAgent) meta.push('judge ' + esc(s.judgeAgent) + ''); - if (s.createdAt) meta.push('' + esc(this._relFromMs(s.createdAt)) + ''); - const gap = (typeof s.gap === 'number' && s.gap > 0) ? 'gap ' + esc(s.gap.toFixed(2)) + '' : ''; - return '
' + - '
' + esc(s.question || s.id) + '
' + - '
' + meta.join('') + '
' + gap + '
'; - }).join(''); - } - } - - const candEl = root.querySelector('#at-cand'); - if (candEl) { - if (!cand.length) { - candEl.innerHTML = '
No template candidates are awaiting promotion.
'; - } else { - candEl.innerHTML = cand.map(c => { - const meta = []; - meta.push('' + esc(c.versionId) + ''); - if (c.templateId) meta.push('' + esc(c.templateId) + ''); - if (c.createdAt) meta.push('' + esc(this._relFromMs(c.createdAt)) + ''); - const score = c.score ? 'score ' + esc(c.score) + '' : ''; - const label = (c.name ? esc(c.name) : esc(c.templateId || c.versionId)) + ' · v' + esc(c.number); - return '
' + - '
' + label + '
' + - '
' + meta.join('') + '
' + score + '
'; - }).join(''); - } - } } // fetchAttentionJobChecks lazily loads one gate job's failed result checks @@ -6353,7 +6232,7 @@ const cur = s.facets[cat]; const has = cur.includes(val); return { facets: { ...s.facets, [cat]: has ? cur.filter(x => x !== val) : [...cur, val] } }; }); - clearFacets = () => this.setState({ facets: { status: [], kind: [], agent: [], repo: [] }, runsQuery: '', openFacet: null }); + clearFacets = () => this.setState({ facets: { status: [], agent: [], repo: [] }, runsQuery: '', openFacet: null }); selectRun = (id) => { if (!id || id === this.state.selectedRunId) return; this.currentRunId = id; @@ -6453,7 +6332,7 @@ _navApplyAttention(data) { data = data || {}; const total = (typeof data.total === 'number') ? data.total - : ((Array.isArray(data.gates) ? data.gates.length : 0) + (Array.isArray(data.synthItems) ? data.synthItems.length : 0) + (Array.isArray(data.candidates) ? data.candidates.length : 0)); + : (Array.isArray(data.gates) ? data.gates.length : 0); const on = total > 0; if (on !== this.state.attnAttn) this.setState({ attnAttn: on }); } @@ -6688,7 +6567,7 @@ const facetActive = Object.values(S.facets).some(a => a.length); const filtered = runs.filter(r => { if (q && !(r.title.toLowerCase().includes(q) || r.snippet.toLowerCase().includes(q))) return false; - for (const cat of ['status', 'kind', 'agent', 'repo']) { + for (const cat of ['status', 'agent', 'repo']) { const sel = S.facets[cat]; if (!sel.length) continue; const val = cat === 'status' ? r.state : r[cat]; if (!sel.includes(val)) return false; @@ -6742,7 +6621,7 @@ const cat = S.openFacet; const vals = this.facetDefs[cat].map(v => { const on = S.facets[cat].includes(v); - const col = cat === 'status' ? (CO[v] || CO.queued).c : cat === 'kind' ? this.kindColors[v] : '#7aa2f7'; + const col = cat === 'status' ? (CO[v] || CO.queued).c : '#7aa2f7'; return R('button', { key: v, onClick: () => this.toggleFacet(cat, v), style: { display: 'flex', alignItems: 'center', gap: '7px', padding: '5px 9px', borderRadius: '7px', cursor: 'pointer', fontSize: '11.5px', fontFamily: cat === 'repo' ? mono : 'Inter', background: on ? 'rgba(158,206,106,0.14)' : 'rgba(160,168,220,0.05)', @@ -6762,7 +6641,7 @@ ]); } const facetBar = R('div', { key: 'fc', style: { padding: '0 14px 12px', flex: 'none', position: 'relative', display: 'flex', flexWrap: 'wrap', gap: '6px', alignItems: 'center' } }, [ - catChip('status'), catChip('kind'), catChip('agent'), catChip('repo'), + catChip('status'), catChip('agent'), catChip('repo'), (facetActive || q) ? R('button', { key: 'clr', onClick: this.clearFacets, style: { marginLeft: 'auto', background: 'none', border: 'none', color: '#7aa2f7', fontSize: '11px', cursor: 'pointer', padding: '4px 2px', fontFamily: 'Inter' } }, 'Clear') : null, popover ]);