Skip to content

fix(rest): resolve the ENVIRONMENT's analytics service for dataset queries#1707

Merged
os-zhuang merged 1 commit into
mainfrom
fix/analytics-per-env-resolution
Jun 11, 2026
Merged

fix(rest): resolve the ENVIRONMENT's analytics service for dataset queries#1707
os-zhuang merged 1 commit into
mainfrom
fix/analytics-per-env-resolution

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Layer 3 of the staging dashboard chain (after #1701 typed fallback + #1703 AST aggregate): the dataset-query route used the host provider, which ignores environmentId — tenant queries aggregated over the HOST kernel's (empty) engine: Total Spend: 0 and empty groups on a populated table, COUNT(*) FROM sys_user = 0 while logged in.

  • Extracts resolveProtocol's env resolution (hostname → X-Environment-Id → single-project default) into a shared resolveRequestEnvironmentId so per-env service resolutions can never disagree.
  • The analytics route now resolves the env kernel's own 'analytics' service first (bridges bound to the env engine), host provider as fallback only.

Companion cloud change adds 'analytics' to objectos defaultRequires so env kernels actually install the service. rest: 100 tests green.

🤖 Generated with Claude Code

…eries

The /analytics/dataset/query route resolved its service through the host
provider, which ignores environmentId and returns the HOST kernel's
analytics — whose strategy bridges are bound to the host data engine. A
tenant's dataset query therefore aggregated over the host's (empty) tables:
totals of 0 and empty groups on populated objects, while CRUD (per-env
protocol resolution) saw the real data.

- Extract resolveProtocol's env resolution (hostname → X-Environment-Id →
  single-project default) into resolveRequestEnvironmentId, shared so
  per-environment service resolutions can never disagree about a request's
  kernel.
- The analytics route now resolves the env kernel's own 'analytics' service
  first (its bridges bind the env engine) and only falls back to the host
  provider.

rest: 100 tests green.

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

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 11, 2026 3:38am

Request Review

@os-zhuang os-zhuang merged commit d72104e into main Jun 11, 2026
1 of 2 checks passed
@os-zhuang os-zhuang deleted the fix/analytics-per-env-resolution branch June 11, 2026 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant