# Live Demo Verification Checklist

Target: your canopy deployment URL (below: `<DEMO_URL>`). Sign in with the deployment's own account (the dev-noauth demo accepts any credentials; pick **Administrator** for write tests). Do not commit real hosts or credentials here.
Backend: the checklist assumes a SkyWalking showcase-shaped BanyanDB behind the console (e.g. reached via `kubectl port-forward svc/demo-banyandb-http 18913:17913`, `BANYANDB_TARGET=http://127.0.0.1:18913`).
Concrete resources used below (all present on such a cluster): `sw_metricsMinute/service_cpm_minute`, `sw_records/alarm_record`, `sw_trace/segment`, `sw_metricsMinute/endpoint_cpm-service` (TopN agg).

Run top to bottom; every box should be checkable without touching the server.

## 0. Smoke

- [ ] Login page renders; sign in as Administrator lands on Home.
- [ ] Sidebar header shows `Connected <banyandb-target>` (BanyanDB reachable).
- [ ] Sidebar counts load: Measures 4 groups, Streams 3, Traces 2, Properties 1, Pipelines TopN count > 0.

## 1. Redirect / navigation flows

### 1.1 Home & sidebar
- [ ] Home quick cards navigate: Measures/Streams/Traces → `/metadata/:type`; Properties → `/properties`; Pipelines → `/pipelines`; Query → `/query`.
- [ ] Sidebar catalog row → type overview; group row → group page; per-group **Index** sub-row → `/metadata/:type/:group/Index` (and it auto-expands when the URL is an Index page).
- [ ] Sidebar property group expand → collection leaf → `/properties/:group/:collection`.
- [ ] Breadcrumbs on every page walk back up one level at a time (resource → group → type).

### 1.2 Metadata browser
- [ ] Type overview: group card → group page. New group (admin) → redirected to the new group's page.
- [ ] Group page: resource row click → resource detail. Keyboard: focus row + Enter → same.
- [ ] Group page: resource row **Query** action → `/query` — builder FROM shows that catalog/group/resource and the "pre-filled from …" banner appears.
- [ ] Resource detail: header **Query** → `/query` seeded the same way (FROM = this resource).
- [ ] Resource detail: per-tag **index rule chip** → `/metadata/:type/:group/Index` with the matching rule row glowing ~2s.
- [ ] Resource delete (admin) → back to group page, resource gone from the table.
- [ ] Index page: binding **subject chip** → that resource's detail page; an orphan subject chip does NOT navigate (danger chip).
- [ ] Index page: "unbound" CTA / "Bind to subject" opens the binding modal (no navigation).

### 1.3 Pipelines / TopN
- [ ] `/pipelines` card → `/pipelines/topn`; "Recent pipelines" row → that aggregation's detail; "View all" → list.
- [ ] TopNList row click → detail; Enter on focused row → same; **Space/Enter on the row's Edit/Delete buttons activates the button and does NOT navigate** (regression: keyboard bubbling fix).
- [ ] TopN create modal (admin) → on success redirects to the new aggregation's detail.
- [ ] TopNDetail: source-measure card → `/metadata/measures/:group/:name` of the source.
- [ ] TopNDetail: **Run Top-N query** → `/query` — FROM shows `TOPN AGG <name> IN <group>`, AGGREGATE BY defaults to MEAN.
- [ ] TopN delete (admin) → back to `/pipelines/topn`, row gone.

### 1.4 Query console seed behavior
- [ ] Seed from GroupPage/ResourceDetail/TopNDetail survives the persisted builder state: the seeded FROM wins over localStorage (`canopy.query.v3`).
- [ ] After a seeded load, picking a different resource via the FROM-row fuzzy search replaces the seed cleanly (banner updates).

## 2. Query features (per catalog)

### 2.1 Measure — `sw_metricsMinute/service_cpm_minute`
- [ ] FROM-row search `service_cpm_minute` → SELECT shows **all fields raw** (value, total — no MEAN auto-seed).
- [ ] ORDER BY dropdown shows only `time` (attr0–5 are noSort inverted rules — hidden) + `— none —`.
- [ ] Run → 11+ series, 100 data points; attr1–attr5 cells are **blank, never `[object Object]`**.
- [ ] `— none —` clears ORDER BY; query still runs.
- [ ] Table ↔ Chart toggle works; sid/version columns toggle works.
- [ ] Load more appends the next 100 rows (offset paging) when present.

### 2.2 Stream — `sw_records/alarm_record`
- [ ] Run → console view renders severity pills (WARNING), badges are truncated with ellipsis, never overflowing their card.
- [ ] Expand a row: long values (`tags_raw_data`, `id0`, `snapshot`, `uuid`) show the **hover popover with full value + Copy**; click copies to clipboard (✓ Copied flash).
- [ ] `id`-named tags (`id0`, `id1`) render as id-role copyable cells by default.
- [ ] Table view renders the same values; Tags popover lists inferred roles (TYPE/AUTO/CONV/SET) and a role override sticks.
- [ ] Load more appends rows.

### 2.3 Trace — `sw_trace/segment`
- [ ] Picking `segment` seeds a `trace_id` condition and **ORDER BY shows `— none —`**; generated BydbQL has no ORDER BY.
- [ ] Delete the trace_id condition → ORDER BY becomes `start_time` (schema timestampTagName), query runs, spans render (no "index rule timestamp not found").
- [ ] Result: span list with trace_id/span_id columns, grouped spans render (not "No spans" when data exists).
- [ ] Expand a span: `service_id`, `service_instance_id`, `endpoint_id`, `segment_id` are id-role copyable cells; `start_time` (TIMESTAMP badge) is fully visible (wraps, not truncated); badges stay inside cards.
- [ ] ORDER BY dropdown shows only `— none —`, `start_time`, `latency`; no `optional`-less row (chip present).
- [ ] Decode bytes: bind a `.proto` → DECODED panel renders; `raw bytes` toggle is single-line and flips both ways.

### 2.4 Top-N — `sw_metricsMinute/endpoint_cpm-service`
- [ ] AGGREGATE BY defaults to MEAN on page load; run → leaderboard "Top 10 of endpoint_cpm-service by value" with rank bars and decoded entity names.
- [ ] Switching AGGREGATE BY to `none — pre-aggregated value` sticks (no snap-back) — the run then fails loudly with "unspecified requested aggregation function" (expected on distributed).
- [ ] SUM/MAX/MIN/COUNT selections each run successfully.
- [ ] Time-bucket picker appears only if multiple lists come back (single snapshot on this cluster is correct).

### 2.5 Property query console — `/properties/:group/:collection`
- [ ] Embedded console (NOT `/query`): builder filter chips → matching docs; code mode round-trips.
- [ ] Doc cards: JSON values pretty/raw toggle + copy; long text wraps; pager shows when > 10 docs (client-side, 10/page).
- [ ] Create/Edit document (admin): new tag keys auto-declare on the schema ("tags count mismatch" must NOT appear); delete removes the card; the list re-runs the last query after each mutation.

## 3. Fetch / CRUD features

- [ ] Groups: create (admin) → appears in sidebar + type overview; edit interval; delete → redirect to type overview.
- [ ] Resources: create stream/measure/trace schema via Group page (admin) → redirected to its detail; edit tags; delete.
- [ ] Index rules: create/update/delete (admin); rule row shows bound subjects; binding create/edit/delete; status chips (active/expired/orphan/pending) render correctly.
- [ ] TopN aggregations: create with same-group source (mismatched source group is **blocked with a clear error**, not a server failure); edit; delete — list/detail refresh without reload (query-cache invalidation).
- [ ] Properties: create collection; delete collection → group page.
- [ ] Read-only role: sign out → sign in as Read-only → every write button (New/Edit/Delete/Apply) is hidden or disabled; queries still run.
- [ ] Sign out → session cleared, back to login.

## 4. Regression spot-checks (this round of fixes)

- [ ] No `[object Object]` anywhere: measure attr1–5, stream null tags, trace null tags, TopN entity tooltips.
- [ ] Failed re-run shows only the error card (previous result panel disappears; Retry restores).
- [ ] ORDER BY dropdowns never offer non-index-ruled tags; stale selections auto-reset.
- [ ] Long text (> 40 chars) is copyable in stream + trace results (Console and Table).
- [ ] TopN query never sends the `{function, field_name}` agg message shape (works on this distributed liaison).
