Skip to content

Sync with upstream (2026-06-05) - #5

Merged
tlvenn merged 69 commits into
mainfrom
sync-upstream-2026-06-05
Jun 5, 2026
Merged

tlvenn merged 69 commits into
mainfrom
sync-upstream-2026-06-05

Conversation

@tlvenn

@tlvenn tlvenn commented Jun 5, 2026

Copy link
Copy Markdown
Owner

Merges 68 upstream commits since the 2026-05-28 sync. Pure merge — no self-host glue changes needed.

Drift check

Surface Change
`apps/{api,alerting,chat-agent}/wrangler.jsonc` unchanged — bindings + crons identical
`apps/api/src/lib/Env.ts` unchanged — same env vars
ClickHouse migrations none added
Drizzle migrations 2 new (`0016_alert_notification_template`, `0017_blue_kid_colt`) — auto-applied by `runtime.ts` on boot
dist-only-subpath packages unchanged — same pre-build set covers it
New apps `apps/local-ui` (SPA only, no worker) — not shipped

Notable upstream features in this sync

Verification

CI on this branch (workflow_dispatch) rebuilds both `maple-workerd` and `maple-web`.

Makisuo and others added 30 commits May 28, 2026 01:50
…chLabs#63)

- Restyle session detail: enriched header (relative time, copyable id),
  AlertStatCard-style stat tiles, differentiated detail-row icons, layout-
  matching skeleton, staggered entrance motion (respects reduced motion).
- Player: scrubber hover time bubble, shared action-marker legend, control
  tooltips.
- Timeline: font-display headers, fixed dead ring-dashed on out-of-range
  trace bars, and trace rows now link to /traces/$traceId (open in new tab,
  with t= to scope the ClickHouse partition scan); expand chevron split from
  the link, seek bar unchanged.
- Extract presentational parts into session-detail-parts.tsx (shared by the
  page and a placeholder-data preview route at /replays/preview).
- Add optional preview-only injection props to the player provider, timeline,
  and events panel (default to the existing atom-fetch path).
- Icons: real Nucleo pixel assets — share-up-right (external link) and
  mobile-toolbar (device); new MobileIcon.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
create_dashboard with template="blank" failed schema validation with
"Expected array, got undefined at [\"tags\"]". The blank template omits
tags/description, so built.tags was undefined and passed straight into
PortableDashboardDocument, whose optionalKey fields reject present-with-undefined.
Conditionally spread both fields so they're only set when defined.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…apleTechLabs#65)

* feat(ingest): local Maple binary — OTLP ingest + embedded chDB

Adds `maple start`, a standalone single-binary local mode: OTLP/HTTP
ingest into an embedded in-process ClickHouse (chDB), reusing the
production OTLP→NDJSON encoders and the generated ClickHouse schema so
local rows are shaped identically to cloud. Single-tenant (OrgId="local").

- chdb module: one dedicated writer thread owns the chDB session; all
  bootstrap/insert/query is funneled through it (chDB is single-owner).
- new `maple` bin gated behind the `local` cargo feature so the
  production maple-ingest build never links libchdb; clap CLI, Axum
  routes, rust-embed SPA fallback.
- telemetry::encode_local_{traces,logs,metrics} wrap the private encoders
  for zero row-mapping divergence with the Tinybird path.
- schema codegen: emit local-schema.sql + local-inserts.json from the
  Tinybird manifest, wired into the clickhouse:schema task.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(web): pass children into AutocompleteValuesProvider props

Pre-existing regression on `main` (introduced by ac723de "feat: fix some
react stuff", which rewrote this provider to use createElement). main's CI is
red on the same error; this branch inherits it via rebase onto main.

AutocompleteValuesProvider's `children` prop is required, so React 19's
createElement overload requires it in the props object — passing it as the
variadic 3rd arg leaves the required prop unsatisfied (TS2769). Move children
into the props object. Functionally identical; unblocks @maple/web typecheck.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* move components to ui

* feat(local): lightweight local-ui SPA + build/release pipeline

Adds the frontend and distribution half of `maple start` (the standalone
local Maple binary). The Rust ingest binary + embedded chDB (earlier on this
branch) now has a UI to drive it and a reproducible way to ship it.

apps/local-ui — minimal React + Vite SPA (no Clerk/router/Cloudflare):
  - hash-routed trace list / trace detail / logs views
  - data layer hits the binary's POST /local/query, builds ClickHouse SQL
    via @maple/query-engine (CH.compile) pinned to the `local` org
  - reuses @maple/ui components (trace waterfall, severity badges, tables)
  - its dist/ is synced into apps/ingest/ui-dist/ and baked in via rust-embed

packages/ui/src/lib/span-tree.ts — shared buildTraceDetail/buildSpanTree
  (branded TraceId/SpanId) consumed by the local trace-detail view.

scripts/build-local-binary.sh — builds the SPA, syncs ui-dist, compiles
  `maple` with the `local` feature, then bundles libchdb.so beside the binary
  and rewrites the dynamic-load path (install_name_tool @rpath/@loader_path on
  macOS, patchelf $ORIGIN on Linux) so the 2-file bundle is relocatable.

.github/workflows/local-binary-release.yml — builds the bundle on native
  runners per target triple (aarch64/x86_64 darwin + linux; native because
  chdb-rust downloads a host-specific libchdb), ad-hoc codesigns macOS, tars
  maple + libchdb.so with a sha256, and publishes to a GitHub release on v*.

ui-dist is now a build artifact: only .gitkeep is tracked (rust-embed needs
the folder to exist); the generated SPA output is gitignored.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* f

* fix

* l

* fix

* l

* fix(local-ui): remove unused useDebouncedSearch hook (Knip)

Orphan scaffolding never imported anywhere; ToolbarSearch already has its
own inline debounce (with external-sync for "Clear all", which this hook
lacks). Knip's files rule is error-severity, so the unused file failed CI.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(ingest): update ingest_bench for datasources: DatasourceNames refactor

TinybirdConfig consolidated the flat datasource_traces/logs/metrics_* fields
into a single `datasources: DatasourceNames`, but benches/ingest_bench.rs still
constructed the old shape — breaking `cargo bench --bench ingest_bench` (E0560)
and failing the Cargo test CI job. Use DatasourceNames::defaults(), matching the
telemetry tests and main.rs construction.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(local): curl|sh installer for the local Maple binary

Adds scripts/install.sh: detects OS/arch, downloads the matching bundle from the
latest GitHub release, verifies the sha256, installs the 3-file bundle into
~/.maple/bin (kept co-located for the rpath + maple→maple-cli forwarding),
clears the macOS quarantine, and symlinks `maple` onto PATH. Documents the
one-liner in docs/local-mode.md and the release notes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* feat(landing): serve install script at maple.dev/cli/install

apps/landing copies scripts/install.sh → public/cli/install at build/dev time
(single source via the `sync:install` script; the copy is gitignored). Astro's
static build emits it to dist/cli/install, so the canonical installer URL is:

  curl -fsSL https://maple.dev/cli/install | sh

Updates the script header, docs/local-mode.md, and release notes to the nice URL.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(release): publish per-platform immediately — no waiting on slow runners

Replace the single aggregated `release` job (which waited for all 4 platforms)
with a per-platform "Publish to release" step at the end of each build job.
Each platform creates/uploads to the release as soon as it finishes. A queued
macos-13 runner can no longer block arm64 mac and Linux bundles from publishing.
`gh release create ... || true` handles the creation race between concurrent jobs.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix(install): suppress curl noise on missing release, cleaner error message

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix(release): avoid heredoc in YAML run block (indentation parse error)

Use printf to write release notes to a file — heredocs inside YAML literal
block scalars break when the terminator/content have less indentation than
the block, causing instant workflow failures on every branch push.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* feat(local): embed maple-cli inside maple — single 2-file distribution

maple-cli (the Bun/TypeScript query CLI) is now baked into the maple binary
at build time via rust-embed (#[folder = "cli-dist/"]), the same pattern
used for the SPA. The build script compiles it before cargo so rust-embed
picks it up. At runtime, the first query subcommand (services, traces, etc.)
extracts the embedded CLI to ~/.maple/maple-cli-<hash> and execs into it;
subsequent invocations skip re-extraction.

Distribution shrinks from 3 files (maple + libchdb.so + maple-cli) to 2
(maple + libchdb.so). The install script, CI, and docs are updated to match.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* feat(local): maple stop command + already-running guard on start

- `maple start` writes ~/.maple/maple.pid and refuses to start a second
  instance with a clear "already running (PID N) — run maple stop" message.
  Stale PID files from crashes are cleaned up automatically.
- `maple stop` sends SIGTERM and waits up to 5 s, printing progress dots,
  then reports "maple stopped." or suggests kill -9.
- Graceful shutdown wires SIGTERM + SIGINT into axum's with_graceful_shutdown
  and removes the PID file on clean exit.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* s

* s

* fix(local-cli): update bin.ts for renamed executor exports

executor.ts was refactored to export makeLocalWarehouseExecutor(baseUrl)
and DEFAULT_LOCAL_URL instead of the resolved LocalWarehouseExecutorLive.
Update bin.ts to match.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix(local-cli): Effect v4 catchAll→catch, WarehouseQueryName cast

- auth.ts: Effect.catchAll removed in Effect v4; replace with Effect.catch
- warehouse.ts: executor.query pipe param is typed as WarehouseQueryName union;
  the passthrough wrapper casts string→WarehouseQueryName

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* fix(knip): add apps/local-cli workspace entry

Knip has no entry for apps/local-cli so it can't trace the import chain
from src/bin.ts and marks auth.ts + warehouse.ts as unused files (error).
Add the workspace with src/bin.ts as the entry point.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* chore: update bun.lock after local-cli package changes

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* l

* l

* Update CLAUDE.md

* n

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
GitHub retired the macos-13 runner image in Dec 2025, so the
x86_64-apple-darwin job sat queued indefinitely on every release
(v0.0.2–v0.0.5), never producing a bundle. Remove the matrix entry so
releases complete cleanly with the 3 buildable targets (arm64 macOS +
x86_64/arm64 Linux). Intel macOS is EOL on GitHub-hosted runners in Fall
2027 anyway; Intel-Mac users build from source.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The alchemy `Vite` helper defaults its static-asset directory to
`dist/client` whenever an `entrypoint` is set (the TanStack-Start
layout `apps/web` uses). local-ui is a plain Vite SPA that builds flat
to `dist/` — the same `dist/` the `maple` binary embeds via rust-embed
(`apps/cli/src/server/ui-assets.ts`), so its `outDir` can't change.

The deploy therefore scanned a non-existent `dist/client` and failed
with `ENOENT: scandir 'apps/local-ui/dist/client'`. Pin `assets` to
`dist` so the Cloudflare worker serves the actual build output.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a /local marketing page for single-binary local mode (maple start + embedded chDB) with eyebrow, product hero, and loopback-flow components. Link it from the nav and footer, and correct the local-mode docs to drop the retired Intel-Mac build target.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Mark Maple Local as shipped and add Browser Session Replay. Reframe the board around momentum: a shipment-progress meter, Now/Next/Later lanes, and a dense newest-first shipped ledger. Retire the 9px text and add reduced-motion-safe reveal/grow animations.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…usly

chDB v26.1.0 defaults async_load_databases=true, so chdb_connect returns
while the persisted tables (~30 MVs feeding MergeTree targets) are still
loading on background loader threads. The #bootstrap DDL we run right after
(CREATE TABLE IF NOT EXISTS ...) then races the concurrent load of the same
table, tripping `recursive_mutex lock failed: Invalid argument` /
ASYNC_LOAD_WAIT_FAILED, so chdb_connect returns NULL. Most visible after a
start -> kill -> restart when load/merge work is still in flight on reopen.

Pass --async_load_databases=0 so connect blocks until loading finishes,
serializing it before bootstrap and removing the race.

Also:
- Surface an actionable "recover with `maple start --reset`" error when
  chdb_connect returns NULL over a populated store (gated on storeHasData),
  instead of the opaque "chdb_connect returned NULL".
- Don't print the spurious "maple stopped" notice when startup fails.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Browser session-replay sessions are ingested but were not metered to
Autumn, unlike logs/traces/metrics (GB) and AI tokens. Add a
`browser_sessions` metered feature and report one unit per session at
session start.

- autumn.config.ts: add `browser_sessions` metered/consumable feature
  (track-only — no Starter/Startup plan item changes). Must be pushed to
  Autumn so /v1/track + aggregateEvents recognize it.
- ingest: make AutumnTracker unit-agnostic (UsageEvent.value_gb -> value;
  the /v1/track body field was already `value`). In
  handle_replay_meta_inner, count NDJSON rows with version==1 (the SDK's
  "active" session-start row) and, after accept_rows succeeds,
  track(org_id, "browser_sessions", n), guarded by the existing
  SENTINEL_ORG_ID check. Documents the at-least-once reload over-count
  caveat.
- web: surface a "Browser Sessions" usage meter in billing settings.
  AggregatedUsage gains browserSessions; add formatCount; generalize
  MeterRow to used/limit/formatValue; request browser_sessions in
  useAggregateEvents (limit Infinity -> "Unlimited", track-only).

Verified: cargo check (ingest), web + api typecheck all pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
When the local maple binary can't be reached, the UI left users staring at
an infinite loading skeleton. Add an App-level connection gate that swaps the
views for a "Can't reach Maple Local" screen (maple start command, expected
endpoint, retry) and auto-recovers once the binary is up.

- Derive connection status from the existing ingest-pulse poll (no extra
  network traffic); key on data presence so connected-but-idle isn't disconnected
- Give the probe an AbortSignal.timeout so a hung chDB query surfaces as an
  error instead of pending forever; data/list queries keep no timeout
- Thread an optional AbortSignal through the shared executeLocalQuery client
- Extract CopyableField for reuse between the Connect popover and the new screen

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Throttled startup check (at most once per 24h, cached in ~/.maple/config.json)
prints a non-blocking "update available" notice to stderr; opt out with
MAPLE_NO_UPDATE_CHECK=1. New `maple update` downloads the latest release
bundle, verifies its SHA-256, and atomically renames `maple` + `libchdb.so`
in place (avoids ETXTBSY overwriting a running binary). Supports `--check`
(report only) and `--version <tag>` (pin or downgrade).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
apps/cli now imports `@maple-dev/effect-sdk/server` (CLI telemetry), which is
published from its tsdown-built `dist/`. That dist is gitignored, and the
release workflow only runs `bun install`, so `bun build --compile` could not
resolve the import and every platform's build failed (v0.0.8). Build the SDK
via its workspace filter before the SPA/compile steps so a fresh checkout / CI
has the dist on disk.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Two bugs made `maple update` unusable:

1. Download hung forever. `Bun.write(dest, response)` never resolves when
   streaming GitHub's redirect-backed release-asset bodies — the `◌ updating…`
   line froze indefinitely. Buffer the body via `arrayBuffer()` first, then
   write the bytes (~2s for the 115 MB macOS bundle).

2. `--version` flag was shadowed. The CLI framework reserves a global
   `--version` (prints the binary version and exits), so `maple update
   --version <tag>` never reached the handler. Renamed the flag to `--tag`.

Verified end-to-end with a compiled binary stamped v0.0.1: `maple update`
downloads, checksum-verifies, and atomically swaps to v0.0.10 in ~5s (inode
changes, confirming the rename-based swap).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Google Rich Results flagged breadcrumb structured data as invalid:
the current-page ListItem (passed without an href) omitted the
required `item` property. Emit `item` for every ListItem, falling
back to the current page's absolute URL when no href is supplied.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add per-signal billing enforcement at the ingest edge. AutumnEntitlements
calls Autumn POST /v1/check (cached via moka) and handle_signal_inner /
handle_cloudflare_logpush_inner return HTTP 402 when an org is over its
hard-capped base plan (starter: 50 GB/signal, no overage) or has no active
subscription.

- Gate on Balance.remaining > 0, not the raw `allowed` flag (Autumn's default
  required_balance:1 flips allowed false at <1 GB left, premature for a GB meter)
- balance:null => block (no sub); unlimited / overage_allowed (startup) => allow
- Fails open on any HTTP/transport/decode error so a billing outage never drops
  customer data
- Inert unless AUTUMN_ENFORCE_LIMITS=true AND AUTUMN_SECRET_KEY set (deploy dark);
  MAPLE_TEST sentinel short-circuits before the check so onboarding is unaffected

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…apleTechLabs#67)

Fixes 11 reported failure modes in the maple-dashboard-widgets MCP surface
where dashboards looked correctly scoped but weren't, the verifier couldn't
check the hardest widgets, and writes crashed on tag-less dashboards.

whereClause (packages/query-engine query-builder):
- Auto-route bare trace keys to attr.<key> instead of silently dropping them,
  so query.context/error.type/db.system filters actually apply.
- Honor negation: !=, !contains, !exists now set `negated` instead of
  collapsing to the positive predicate (SQL layer already supported it).
- add/update/replace widget tools reject the write (nothing saved) when the
  builder reports an unhonored clause, instead of persisting a mis-scoped chart.

inspect_chart_data accuracy:
- Evaluate formulas[] server-side (evaluator lifted to @maple/query-engine and
  re-exported from web) so formula/hit-rate widgets verify end-to-end.
- reduceToValue falls back to the first numeric column like the renderer, so
  stat tiles no longer report a false reducedValue: null.
- New EMPTY_GROUPING flag when a groupBy collapses to a single "all" series.
- New METRIC_NOT_FOUND flag distinguishing a typo'd metric from an empty one.
- SUSPICIOUS_GAP is now informational and no longer downgrades the verdict.
- list_metrics no longer prints category totals next to a zero-match filter.

Write path:
- tags/description optionalKey crash hardened across all DashboardDocument /
  PortableDashboardDocument construction sites (conditional spread).
- get_dashboard always emits a tags array so JSON round-trips through writes.
- New replace_dashboard_widgets tool: atomic, validated whole-list rebuild.

Docs: corrected SKILL.md + maple://instructions (groupBy attr. prefix, the full
operator table incl. negation, legacy metric-fields) and documented the new
behaviors.

Deferred to follow-up PRs: MapleTechLabs#10 numeric-attribute aggregation (hot query path,
needs live e2e), MapleTechLabs#12 query_engine.* metric ingestion (OTLP MeterProvider).

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
…apleTechLabs#67)

Fixes 11 reported failure modes in the maple-dashboard-widgets MCP surface
where dashboards looked correctly scoped but weren't, the verifier couldn't
check the hardest widgets, and writes crashed on tag-less dashboards.

whereClause (packages/query-engine query-builder):
- Auto-route bare trace keys to attr.<key> instead of silently dropping them,
  so query.context/error.type/db.system filters actually apply.
- Honor negation: !=, !contains, !exists now set `negated` instead of
  collapsing to the positive predicate (SQL layer already supported it).
- add/update/replace widget tools reject the write (nothing saved) when the
  builder reports an unhonored clause, instead of persisting a mis-scoped chart.

inspect_chart_data accuracy:
- Evaluate formulas[] server-side (evaluator lifted to @maple/query-engine and
  re-exported from web) so formula/hit-rate widgets verify end-to-end.
- reduceToValue falls back to the first numeric column like the renderer, so
  stat tiles no longer report a false reducedValue: null.
- New EMPTY_GROUPING flag when a groupBy collapses to a single "all" series.
- New METRIC_NOT_FOUND flag distinguishing a typo'd metric from an empty one.
- SUSPICIOUS_GAP is now informational and no longer downgrades the verdict.
- list_metrics no longer prints category totals next to a zero-match filter.

Write path:
- tags/description optionalKey crash hardened across all DashboardDocument /
  PortableDashboardDocument construction sites (conditional spread).
- get_dashboard always emits a tags array so JSON round-trips through writes.
- New replace_dashboard_widgets tool: atomic, validated whole-list rebuild.

Docs: corrected SKILL.md + maple://instructions (groupBy attr. prefix, the full
operator table incl. negation, legacy metric-fields) and documented the new
behaviors.

Deferred to follow-up PRs: MapleTechLabs#10 numeric-attribute aggregation (hot query path,
needs live e2e), MapleTechLabs#12 query_engine.* metric ingestion (OTLP MeterProvider).

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Makisuo and others added 28 commits June 2, 2026 18:57
…y pillar, homepage FAQ

Apply Ahrefs AI-search-optimization findings to the marketing site so Maple is
more citable by AI chatbots (ChatGPT, AI Overviews/AI Mode, Perplexity):

- Add "Best open-source observability tools" ranked listicle (ItemList schema),
  driven by a new best-observability-tools data module
- Add "What is observability?" informational pillar page (FAQPage schema)
- Add a homepage FAQ with quotable entity facts (FAQPage schema)
- Welcome AI crawlers (GPTBot, OAI-SearchBot, ClaudeBot, PerplexityBot,
  Google-Extended, etc.) in robots.txt
- Stamp sitemap lastmod for freshness; add footer "Learn" links + cross-links
- Document the strategy and per-insight rationale in docs/geo-ai-search.md

Tool licenses stated accurately — Maple is source-available under FSL-1.1
(converts to Apache 2.0), not OSI open source.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Fuse.js-backed search palette for the Astro docs site, reusing
@maple/ui's CommandDialog. A build-time endpoint indexes each doc's
title/headings/description/body; the client fetches it once and ranks
with Fuse. Opens via ⌘K, /, or a header button; browse mode when empty,
ranked results with a group/SDK badge otherwise, keyboard nav, Esc to
close.

Notes on two base-ui gotchas handled: the popup is gated on `open` so it
unmounts cleanly (otherwise a pointer-blocking backdrop lingers), and
Escape is closed from a capture-phase listener (the forced-open
Autocomplete stops its propagation).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…xtarea

The web and landing apps shipped their own byte-for-byte copies of icons
that already exist in the @maple/ui core design system.

- apps/web: re-export the 34 shared icons from @maple/ui via the existing
  `@/components/icons` barrel and delete the local duplicates. App-specific
  icons stay local. No consumer churn (all import through the barrel).
- apps/landing: delete the local icon barrel + 8 duplicate icons + icon.tsx
  (dead code — zero references; only the *Logo.astro files were used).
- dashboard widget settings: swap the raw description <textarea> (whose
  className just copied core styling) for the core <Textarea>, matching the
  Name <Input> directly above it.

Verified: bun typecheck (all 21 packages), grep guard for stale imports,
and browser checks of web (icons render, 0 console errors) + landing +
the widget settings Textarea.
…s#71)

* fix(ci): bump TanStack Router to zod-v4-compatible versions

The root `overrides: { zod: 4.4.3 }` forces every transitive dep onto zod v4,
but @tanstack/router-generator@1.166.36 (via router-plugin@1.167.x) still uses
the zod v3 `z.function().returns()` API, so loading apps/web/vite.config.ts threw
`z.function(...).returns is not a function` — failing both the Deploy (vite build)
and CI (@maple/web#test) jobs.

Bump @tanstack/router-plugin to ^1.168.14 and @tanstack/react-router to ^1.170.11
(also in packages/effect-router) so router-generator resolves to 1.167.13 (zod v4)
and the stack aligns on router-core@1.171.9.

Also fix the chat-agent Knip errors that were masked by the vite failure:
- delete dead model-gateway.ts (orphaned by the openrouter refactor) and drop its
  sole consumer dep @maple/agent-harness
- wire openrouter.test.ts into CI (add test script + vitest, convert node:test ->
  vitest) so it runs and Knip treats it as a test entry
- repoint stale model-gateway.ts doc references in api evals to openrouter.ts

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(ci): remove global zod override; fix astro + local-ui builds

The `overrides: { zod: 4.4.3 }` added in "fix stuff" force-deduped EVERY
transitive dep onto zod v4 — breaking packages that bundle zod v3 internally.
astro 5.x's config schema uses v3-only APIs (z.ZodIssueCode,
z.custom().superRefine()), so `astro build` (apps/landing and the PR-preview
deploy) crashed with "Cannot read properties of undefined (reading 'length')".

The override wasn't load-bearing: removing it lets bun resolve zod naturally
(app + ai-sdk -> 4.4.3, astro -> 3.25.76) and the full
`turbo typecheck test build` passes 38/38. The TanStack Router bump from the
previous commit stays (a fine upgrade; router-generator 1.167.13 works on the
app's zod 4.4.3).

Also declare `effect` in @maple/local-ui: use-local-session-detail.ts (added in
HEAD) and query.ts import `effect` without declaring it, which a fresh install's
strict rolldown resolution rejected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Swap PulseIcon for the pixel BoltIcon on the scrape-target Test
button to better convey the "run a probe" action.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…mendations

Restyle the Attribute Mappings list to match the Recommendations table
(column headers, full-bleed hover rows, mono keys, hover-revealed
edit/delete, relative "Added" time), and give the Operation column colored
icon badges (Copy -> info/CopyIcon, Move -> warning/ArrowRightFromLineIcon).

The two lists are data-coupled (recommendations reconcile against mappings),
so cross-refresh them via shared singleton atoms: applying a recommendation
now refreshes the mappings list, and creating/editing/deleting a mapping
refreshes the recommendations list.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The Otlp.layerJson-based `server`/`client` presets (`Maple.layer`) batch in
the background and expose no way to force an export, so a browser tab loses the
last few seconds of spans on unload and a short-lived process can exit before
the timer fires.

Add `MapleFlush.make()` to both `/server` and `/client`, returning
`{ layer, flush, dispose }` built on the same buffer-backed tracer/logger the
Cloudflare preset uses. Browser flush uses `fetch(keepalive)` (Maple ingest
auth is header-only, so `sendBeacon` can't carry the key) and flushes on
`pagehide`/`visibilitychange→hidden`; both presets run a 5s auto-flush by
default. Traces + logs only (no metrics).

Refactor: extract the platform-agnostic encode/POST machinery into
`shared/flush-core.ts`, move the buffer modules to `shared/`, and extract the
client `withSessionLink` decorator — the Cloudflare suite runs unmodified as
the behavior-preserving gate. 60 tests, typecheck clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Give the add/edit dialog a header icon, icon'd source-context options
(span/resource), colored operation options (Copy -> info, Move -> warning)
in both the dropdown and the trigger, and a live source -> target preview
with the operation badge — matching the table's badge styling.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ned labels

The database detail panel ("Query Activity" + "Top Query Shapes") was slow and
collapsed every query into one span-name shape (e.g. "execute"):

- Grouping fell through to SpanName whenever db.query.summary/operation/statement
  were absent, and the primary key (db.statement.fingerprint) is set on zero
  Client/Producer app spans (only Maple's own Internal warehouse spans carry it),
  so the key always hashed the raw label — collapse, or per-literal fragmentation.
- Three full raw-`traces` scans per open, with no hourly rollup (every other
  service-map node already reads one).

Fixes:
- New shared, zero-import SQL fragments (@maple/domain/tinybird/db-query-shape-sql)
  derive the shape label by OTEL-attribute precedence (db.query.summary →
  {op} {table} → statement-derived {VERB} {table} → query.context → db.operation*
  → SpanName) and a literal-normalized fingerprint key (strips string/number
  literals + IN-lists) so same-shape queries collapse and distinct ones don't.
- New service_map_db_query_shapes_hourly AggregatingMergeTree rollup + MV (true
  sample-weighted p50/p95 via a t-digest state). MV's DbSystem coalesces
  db.system.name/db.system, fixing a latent gap in service_map_db_edges_hourly_mv.
- serviceDb{Summary,Timeseries,TopQueries}SQL now read the rollup for sealed
  hours UNION raw traces for the in-progress hour (sub-hour timeseries stays raw).
  Read path shares the label/key SQL byte-for-byte with the MV so keys are stable
  across the sealed/live boundary.

NOTE: requires `bun tinybird:deploy` (datasource + MV) before/with this code or
the panel errors on the missing table. MV aggregates going forward only.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…{collection}

Instrumentations that emit a generic db.operation.name (e.g. "execute") plus a
db.collection.name composed to one indistinct label ("execute subscriptions")
for every distinct query against that table — the keys split the shapes into
separate rows but the labels were identical and useless.

Derive the display label in the read path from the rollup's stored SampleStatement
(literals stripped, case preserved) when statement text exists, falling back to the
derived label only for shapes with no statement (Redis ops, connection spans). This
is a read-only change off already-stored columns — the MV/datasource DDL is
unchanged (manifest hash identical), so no Tinybird redeploy is required.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The service map animated every edge in SVG: up to 16 SMIL <animateMotion> plus
3 feGaussianBlur filters per edge (a bloom filter wrapping the moving
particles), all scaling with traffic. At 120 services / 400 edges this produced
~1700 blur filters + ~6700 SMIL animations re-rasterizing every frame on the
main thread — idle rendering ~23fps (p95 frame ~50ms), panning ~17fps (p95
~125ms).

Move all flowing-traffic particles onto a single <canvas> driven by one rAF
loop reading a per-edge geometry registry, with a global particle budget (<=400)
distributed by call rate so cost no longer grows with traffic. Edges become
cheap filter-free gradient strokes. Memoize node positions on a topology key so
15s metric refreshes no longer re-run the hierarchical layout.

After: ~127fps idle (p95 ~8ms), ~72fps pan (p95 ~33ms); 0 blur filters, 0 SMIL.

Adds a Playwright perf gate (apps/web/perf + CI job) over a synthetic, auth-free
/service-map-bench route, plus vitest guards (no filters/SMIL in edges, particle
budget stays capped under heavy traffic, topology-key stability). bun.lock also
carries incidental re-normalization of existing transitive deps from bun install.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The service workload query LEFT JOINed trace-derived workload identity
(service_platforms_hourly) against kubeletstats pod gauges (metrics_gauge)
on clusterName. App spans never carry k8s.cluster.name (the k8sattributes
processor doesn't set it), so the identity side's cluster was always ''
while the pod metrics carry k8s.cluster.name='production' — every join row
evaluated '' = 'production', dropped, and podCount read 0.

- Join on kind/name/namespace only (all reliably present on both sides).
- Source clusterName from the metrics side for display (now shows the real
  cluster instead of empty).
- Count pods via the always-emitted k8s.pod.cpu.usage probe instead of only
  the *_limit_utilization gauges (which require limits set), matching the
  sibling infra.ts facet query so pods without limits aren't undercounted.

Verified against live otel-demo data: podCount 0 -> correct per-service
counts, cluster label populated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…MapleTechLabs#72)

The web `test` script (`vitest run`) had no `include`, so Vitest's default
globs collected `perf/service-map.perf.spec.ts` — a Playwright spec — and
failed CI with "Playwright Test did not expect test() to be called here."
Scope the include to `src/**/*.test.{ts,tsx}` (matching the apps/api config
convention); the perf suite still runs separately via `bun run test:perf`.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@tlvenn
tlvenn merged commit 79f9efe into main Jun 5, 2026
6 of 8 checks passed
@tlvenn
tlvenn deleted the sync-upstream-2026-06-05 branch June 5, 2026 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants