Repository navigation
feat(hub)!: insights reads stock observability; delete the insights mount and package (CL-8160) - #778
Merged
Merged
Conversation
…ts mount and package (CL-8160)
The hub mounts nothing Workbench-specific: packages/insights (its usage,
latency, tools, activity, run-trace, and cross-workbench-scope routes and
Postgres writers) is deleted, along with its ${TENANT_PREFIX}/insights
mount in apps/hub. The stock observability routes it could have read
instead (vendor/intx/hub-api's four GET routes) are unimplemented 501
stubs, so usage/cost, activity, tool-call, latency, run-trace, and scope
switching have no data source left and are dropped rather than faked.
Insights now reads only the native tenant-scoped GET /workflows/runs
listing (already used since CL-8087) for its KPI row, "running now"
strip, recent runs, and run history grouped by definition. Run detail
drops its trace waterfall (steps/completed/failed/duration) since it was
derived from spans this build no longer has. Mission Control drops its
"Runs today" / "Spend today" KPI tiles and "This week" panel; the
sidebar's "Insights" row now gates on having any top-level runs instead
of usage turns, and its "Weekly usage" account-menu line is gone.
packages/insights' turn-text-snapshot reader (chat message-edit replay)
has no dependency on the deleted usage/latency tables, so it moves to
apps/hub/src/turn-text-snapshot.ts instead of disappearing with the rest
of the package.
scripts/db-setup.ts forward-drops the insights schema for existing
databases per docs/package-migrations.md's convention, alongside the
run_key_history/preferences precedent.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Owner ruling: the hub mounts nothing Workbench-specific.
packages/insights(usage, activity, tool-call, turn-latency, run-trace, and cross-workbench-scope routes plus their Postgres writers) is deleted along with its${TENANT_PREFIX}/insightsmount inapps/hub/src/index.ts. The stock observability routes it could have read instead (vendor/intx/hub-api/src/routes/observability.ts's four GET routes: agent logs, agent metrics, list traces, get trace) are unimplemented — each returns{ error: "not_implemented" }, 501. With no data source left, usage/cost, activity, tool-call, latency, run-trace, and cross-workbench scope switching are dropped rather than faked.Insights now reads only the native tenant-scoped
GET /workflows/runslisting (already used since CL-8087) for its KPI row, "running now" strip, recent runs, and run history grouped by definition.packages/insights's turn-text-snapshot reader (chat message-edit replay) has no dependency on the deleted usage/latency tables — it reads only nativeinference_turn/turn_partrows — so it moves toapps/hub/src/turn-text-snapshot.tsinstead of disappearing with the rest of the package.scripts/db-setup.tsforward-drops theinsightsPostgres schema for existing databases, perdocs/package-migrations.md's convention (same pattern as the existingrun_key_history/preferencesdrops).UI dropped (no stock source)
packages/insights' usage store; no replacement writer exists.turn_latencytable; the vendored event collector never persisted the raw events another reader could recompute from./scopeand/workbenches, rolled up from the deleted usage store./runs/:runId/trace, which read the deletedtrace-reader.ts./usageroute; the sidebar's Insights-nav-row gating now checks for any top-level run instead of usage turns.What's kept: the Insights landing's Runs/Errored/Deployed/Running-now KPIs, the "running now" strip, recent runs, and runs history grouped by definition — all backed by the native
GET /workflows/runsfeed already used since CL-8087. The per-workbench Insights route (/insights/workbench/:workbenchId) is untouched — it rendersWorkbenchTimelineRoute, a chat/run timeline with no dependency onpackages/insights.Deleted tests
Per the hard-cutover ruling, tests encoding the deleted behavior were deleted rather than adapted:
apps/web/test/insights-page.test.tsx— the full usage/activity/scope-switcher/trace-timeline/workbench-activity/latency-tile render suite (878 lines), superseded by the trimmed suites inapps/web/src/pages/insights-page.test.tsandinsights-page-render.test.tsxfor the surviving run-list behavior.packages/insights/**tests (all of them, with the package).insights-stats.test.ts'scomputeTraceStatsandfilterRunsByCreatedAtdescribe blocks (both functions deleted — no trace/range data left to test).mission-control-page.test.tsx's three "Runs today"/"Spend today"/"This week" tests.sidebar.test.tsx's "Weekly usage" zero-spend test.Test plan
bun run typecheckbun run lintbun run check:structuralbun --cwd apps/web test(814 pass)