Skip to content

Commit 51ac499

Browse files
authored
feat(dashboard): make /bay canonical and clarify handoff telemetry (#1112)
* feat(dashboard): make /bay canonical * test(dashboard): synchronize tide proof with visible wash * docs(dashboard): refresh stable Bay proof artifacts * fix(dashboard): mark legacy handoff telemetry unavailable
1 parent 24a140e commit 51ac499

14 files changed

Lines changed: 239 additions & 419 deletions

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ proof, supplied-but-not-sufficient proof, mock-only proof, and proof label
329329
mismatches. See
330330
[`docs/pr-proof-triage-dashboard.md`](docs/pr-proof-triage-dashboard.md).
331331

332-
OpenClaw Bay at `/bay-demo` is a public, indexable ClawSweeper dashboard
332+
OpenClaw Bay at `/bay` is a public, indexable ClawSweeper dashboard
333333
destination that renders the same read-only operational status as an animated
334334
shoreline. It is linked from the Overview, issue-triage, and PR-proof headers,
335335
and adds no browser-to-GitHub requests or new GitHub query path. See

‎dashboard/bay-page.ts‎

Lines changed: 10 additions & 17 deletions
Large diffs are not rendered by default.

‎dashboard/operational-health.ts‎

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ export type ExactReviewHistorySample = {
5353
collection_ok: boolean;
5454
review?: ExactReviewLaneHistorySample;
5555
publication?: ExactReviewLaneHistorySample;
56+
handoff?: ExactReviewHandoffHistorySample;
57+
};
58+
59+
export type ExactReviewHandoffHistorySample = {
60+
status: "idle" | "healthy" | "degraded" | "stalled";
61+
pending: number;
62+
dispatching: number;
63+
leased: number;
5664
};
5765

5866
export type ExactReviewLaneHistorySample = {
@@ -234,14 +242,17 @@ export function stateWriterHistorySample(value: unknown): StateWriterHistorySamp
234242
}
235243

236244
export function exactReviewHistorySample(value: unknown): ExactReviewHistorySample {
237-
const lanes = objectValue(objectValue(value).lanes);
245+
const queue = objectValue(value);
246+
const lanes = objectValue(queue.lanes);
238247
const review = queueLaneHistorySample(lanes.review, true);
239248
const publication = queueLaneHistorySample(lanes.publication, false);
240249
if (!review || !publication) return { collection_ok: false };
250+
const handoff = queueHandoffHistorySample(queue.handoff_health);
241251
return {
242252
collection_ok: true,
243253
review,
244254
publication,
255+
...(handoff ? { handoff } : {}),
245256
};
246257
}
247258

@@ -254,10 +265,46 @@ function normalizeExactReviewHistorySample(value: unknown): ExactReviewHistorySa
254265
const review = storedLaneHistorySample(sample.review, true);
255266
const publication = storedLaneHistorySample(sample.publication, false);
256267
if (!review || !publication) return null;
268+
const handoff = storedHandoffHistorySample(sample.handoff);
269+
if (sample.handoff !== undefined && !handoff) return null;
257270
return {
258271
collection_ok: true,
259272
review,
260273
publication,
274+
...(handoff ? { handoff } : {}),
275+
};
276+
}
277+
278+
function queueHandoffHistorySample(value: unknown): ExactReviewHandoffHistorySample | null {
279+
const handoff = objectValue(value);
280+
const phases = objectValue(handoff.phases);
281+
return handoffHistorySample({
282+
status: handoff.status,
283+
pending: objectValue(phases.pending).count,
284+
dispatching: objectValue(phases.dispatching).count,
285+
leased: objectValue(phases.leased).count,
286+
});
287+
}
288+
289+
function storedHandoffHistorySample(value: unknown): ExactReviewHandoffHistorySample | null {
290+
if (value === undefined) return null;
291+
return handoffHistorySample(objectValue(value));
292+
}
293+
294+
function handoffHistorySample(
295+
value: Record<string, unknown>,
296+
): ExactReviewHandoffHistorySample | null {
297+
const status = String(value.status || "");
298+
const pending = nonNegativeInteger(value.pending);
299+
const dispatching = nonNegativeInteger(value.dispatching);
300+
const leased = nonNegativeInteger(value.leased);
301+
if (!["idle", "healthy", "degraded", "stalled"].includes(status)) return null;
302+
if (pending === null || dispatching === null || leased === null) return null;
303+
return {
304+
status: status as ExactReviewHandoffHistorySample["status"],
305+
pending,
306+
dispatching,
307+
leased,
261308
};
262309
}
263310

‎dashboard/worker.ts‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,11 @@ export default {
758758
if (url.pathname === "/api/triage") return triageJson(request, env, ctx);
759759
if (url.pathname === "/api/pr-proof-triage") return prProofTriageJson(request, env, ctx);
760760
if (url.pathname === "/" || url.pathname === "/index.html") return html(dashboardHtml(env));
761-
if (url.pathname === "/bay-demo") return demoHtml(bayHtml());
761+
if (url.pathname === "/bay") return demoHtml(bayHtml());
762+
if (url.pathname === "/bay-demo") {
763+
url.pathname = "/bay";
764+
return Response.redirect(url.toString(), 308);
765+
}
762766
if (url.pathname === "/triage" || url.pathname === "/triage.html")
763767
return html(triageHtml(issueTriagePageConfig()));
764768
if (url.pathname === "/pr-proof-triage" || url.pathname === "/pr-proof-triage.html")
@@ -7330,7 +7334,7 @@ function issueTriagePageConfig() {
73307334
highlightLabelPrefixes: ["clawsweeper:"],
73317335
links: [
73327336
{ href: "/", label: "Live pipeline" },
7333-
{ href: "/bay-demo", label: "OpenClaw Bay" },
7337+
{ href: "/bay", label: "OpenClaw Bay" },
73347338
{ href: "/pr-proof-triage", label: "PR proof triage" },
73357339
],
73367340
columns: [
@@ -7379,7 +7383,7 @@ function prProofTriagePageConfig() {
73797383
highlightLabelPrefixes: ["triage:", "proof:", "mantis:"],
73807384
links: [
73817385
{ href: "/", label: "Live pipeline" },
7382-
{ href: "/bay-demo", label: "OpenClaw Bay" },
7386+
{ href: "/bay", label: "OpenClaw Bay" },
73837387
{ href: "/triage", label: "Issue triage" },
73847388
],
73857389
columns: [
@@ -9514,7 +9518,7 @@ a.pill:hover { color: var(--claw); text-decoration: none; }
95149518
<header>
95159519
<h1>ClawSweeper <span class="live-tag">Live</span></h1>
95169520
<div class="top-links">
9517-
<a class="top-link" href="/bay-demo">OpenClaw Bay</a>
9521+
<a class="top-link" href="/bay">OpenClaw Bay</a>
95189522
<a class="top-link" href="/triage">Issue triage</a>
95199523
<a class="top-link" href="/pr-proof-triage">PR proof triage</a>
95209524
<a class="top-link" href="${escapeHtml(crabfleetUrl)}">Live terminals</a>

‎docs/openclaw-bay-demo.md‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
- Status: active public observer guide
44
- Owner: ClawSweeper maintainers
55
- Source of truth: `dashboard/bay-page.ts`, Worker queue projections, Bay tests,
6-
and the read-only `/bay-demo` route
7-
- Last verified: `openclaw/clawsweeper@9c32c14c65b0551b43a10c2086c0031338ae41e7`
6+
and the read-only `/bay` route
7+
- Last verified: `openclaw/clawsweeper@71b16d208511700bb241ea06276c94f71c977d89`
88
- Update when: lane names, stage mapping, projection bounds, control cards,
99
routes, or navigation changes
1010

1111
OpenClaw Bay is a public, indexable, read-only visualisation of the live
12-
ClawSweeper pipeline. It lives at `/bay-demo` on the existing dashboard Worker
12+
ClawSweeper pipeline. It lives at `/bay` on the existing dashboard Worker
1313
and turns active work into animated crustaceans moving across a shoreline. It
1414
is linked from the Overview, issue-triage, and PR-proof headers as a normal
1515
ClawSweeper web-page destination.
@@ -21,14 +21,12 @@ live populated shoreline, master-sweeper movement between lanes, terminal
2121
pools, and the contextual crustacean chat behavior. The recording is a
2222
1280×720 H.264 review artifact with audio and capture metadata removed.
2323

24-
For independently inspectable interaction proof, see the
25-
[labelled Playwright storyboard](proof/openclaw-bay/playwright-proof-storyboard.jpg),
26-
[compact trace](proof/openclaw-bay/trace.zip), and
27-
[machine-readable assertion summary](proof/openclaw-bay/proof-summary.json).
28-
That deterministic run uses the real page and artwork with a fully synthetic,
29-
redacted status sequence; it covers the forward sweep, retrigger tunnel,
30-
search, repository filter, safe drawer links, local-only tide, and visible
31-
network diagnostics without reading live dashboard data.
24+
The checked-in `docs/proof/openclaw-bay` package is historical evidence captured
25+
from behavior source `71b16d208511700bb241ea06276c94f71c977d89`; it is not
26+
presented as proof of later documentation-only or rebase commits. Current pull
27+
requests must publish their exact-head proof package and provenance in the PR
28+
body. The historical run used the real page and artwork with a fully synthetic,
29+
redacted status sequence and made no live dashboard reads.
3230

3331
Bay is an observer-only surface: it displays bounded public status but never
3432
triggers or offers queue, workflow, GitHub, DLQ, recovery, deploy, or rollback
@@ -107,15 +105,17 @@ times are not shown because the current data cannot support them accurately.
107105
The page, status API, and image assets all belong to `openclaw/clawsweeper`:
108106

109107
- `dashboard/bay-page.ts` renders the page.
110-
- `dashboard/worker.ts` serves `/bay-demo` and derives the bounded Bay state.
108+
- `dashboard/worker.ts` serves `/bay`, permanently redirects legacy `/bay-demo`
109+
bookmarks, and derives the bounded Bay state.
111110
- `dashboard/public/bay-assets/` contains the three WebP assets.
112111
- `dashboard/wrangler.toml` binds that public asset directory.
113112
- `.github/workflows/dashboard.yml` deploys the existing
114113
`clawsweeper-status` Worker to `clawsweeper.openclaw.ai`.
115114

116115
The Bay HTML is `no-store`, frame-blocked, and protected by a content security
117-
policy. `/bay` remains unpublished so `/bay-demo` remains the one documented
118-
public route rather than gaining an undocumented alias.
116+
policy. `/bay` is the single canonical public route; `/bay-demo` is retained
117+
only as a query-preserving permanent redirect for compatibility with existing
118+
links.
119119

120120
## Local Proof
121121

@@ -125,15 +125,15 @@ Start the Worker:
125125
pnpm run dashboard:dev
126126
```
127127

128-
Then open <http://127.0.0.1:8787/bay-demo>. When local GitHub telemetry is
128+
Then open <http://127.0.0.1:8787/bay>. When local GitHub telemetry is
129129
unavailable, the localhost page may read the existing public, cache-backed
130130
production status snapshot for visual proof. The hosted page remains
131131
same-origin in its request behavior; the CSP allows only self and OpenClaw
132132
HTTPS subdomains so Wrangler's localhost preview can reach that production
133133
snapshot.
134134

135135
The deployment smoke test also checks the Bay route, security headers,
136-
unpublished `/bay` route, and all three WebP assets:
136+
legacy `/bay-demo` redirect, other unpublished route variants, and all three WebP assets:
137137

138138
```bash
139139
pnpm run dashboard:smoke -- http://127.0.0.1:8787

‎docs/proof/openclaw-bay/README.md‎

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
# OpenClaw Bay deterministic browser proof
1+
# Historical OpenClaw Bay deterministic browser proof
22

3-
This proof package exercises the real `/bay-demo` page and its checked-in
3+
Status: historical evidence for behavior source
4+
`0cf6b147fe86f56e4ec8c77352e3d31433e3a1d2`. This package is retained for
5+
auditability and is not the active exact-head proof for later commits.
6+
7+
This proof package exercises the real `/bay` page and its checked-in
48
artwork in Chromium. Playwright replaces the dashboard's status, history, and
59
triage reads with fully synthetic, redacted fixtures so stage changes,
610
telemetry controls, and navigation can be reproduced without live dashboard
@@ -28,7 +32,8 @@ The sequence proves:
2832
- the short static reduced-motion tide cue preserving the same preview state;
2933
- completed and failed/cancelled outcomes grouped into their respective terminal pools;
3034
- twenty completed outcomes fitting individually in the expanded terminal pool without a hidden overflow at the standard desktop width, plus a constrained-width layout that keeps twelve labels readable and makes the remaining eight explicit; and
31-
- a generated real tide visibly washing terminal crustaceans before clearing the shared buffer; and
35+
- a generated real tide atomically proving all twenty terminal crustaceans and
36+
the final completion time are visible before clearing the shared buffer; and
3237
- zero browser-to-GitHub API requests, mutation requests, unexpected console
3338
errors, or uncaught page errors. The deliberate synthetic health-history
3439
outage records one expected 503 console error while the resilience state is
@@ -78,27 +83,32 @@ crabbox run \
7883

7984
## Provenance and privacy
8085

81-
- implementation source: `6eebfcf6ddc5d44fca5fd71381df4432879c1046`
82-
- provider: Crabbox `local-container`
83-
- lease: `cbx_f9f19afcd67b` (`coral-prawn`)
86+
- captured behavior source: `0cf6b147fe86f56e4ec8c77352e3d31433e3a1d2`
87+
- provider: direct local Docker under the user-authorized CSW-124 fallback;
88+
this is not a successful Crabbox lease receipt
8489
- image: `mcr.microsoft.com/playwright:v1.60.0-noble`
8590
- fixture SHA-256:
8691
`B0180F79C465964AD39E6E45F730211294742E1206EA4CE1A4C39DEB61AFCB71`
8792
- exact response SHA-256 values:
8893
- `01-initial.json`:
8994
`9D6CA7EDD926508DBB3DB7ED3B8328405F8404E16AEE303AE9057CA6B3BA0397`
9095
- `02-forward.json`:
91-
`A94441D54E4CBBAE21C788C65FF60B0DCDA166459CBDA77C0A70F827076E9126`
96+
`C38AEE2C3E4C8AB1F99FEB354F6B00886A00F8C21CA3575B229E97B9D5DAC8BD`
9297
- `03-retrigger.json`:
9398
`9BAF0B764E413369EC8D9554D731A4E6B008B2DCB266B5D2837E94E820CEEBFE`
9499
- derived real-tide response:
95-
`18FAF63BD6529D1F4EB03BF880343E20244413F82FE62029F055AABC13F44DA9`
100+
`078023220BCDBF72E4CF212011760751EB63A841CF98070A77E4777A5BD4386E`
101+
102+
These hashes are for the canonical LF bytes materialized from the exact Git
103+
tree inside the Linux proof container. A Windows checkout may display a
104+
different working-tree hash when Git applies CRLF conversion.
96105

97106
The browser allowed only `bay-proof.test:8787`, mapped to the local Wrangler
98107
Worker. The trace contains no cookies or authorization headers. A binary text
99108
scan also found no GitHub tokens, local Windows user paths, usernames, or live
100109
private payloads.
101110

102111
This is deterministic interaction proof, not a claim that synthetic state is
103-
live operational evidence. The separate deployment smoke covers the public
104-
route, response headers, unpublished `/bay`, shared schema, and static assets.
112+
live operational evidence. The separate deployment smoke covers the canonical
113+
`/bay` route, the query-preserving legacy redirect, response headers, shared
114+
schema, and static assets.
45.8 KB
Loading

0 commit comments

Comments
 (0)