Skip to content

fix(client,runtime): reconcile the four dispatcher↔client shape mismatches (#3584) - #3592

Merged
os-zhuang merged 2 commits into
mainfrom
claude/task-evaluation-option-b-3fx0tq
Jul 27, 2026
Merged

fix(client,runtime): reconcile the four dispatcher↔client shape mismatches (#3584)#3592
os-zhuang merged 2 commits into
mainfrom
claude/task-evaluation-option-b-3fx0tq

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Closes #3584. This PR is the decision record the issue's acceptance criteria ask for.

决议:四行不拆成同一个选项

复核修正了审计的一个前提:client 端 analytics 使用的两个形状(GET /analytics/meta/:cubePOST /analytics/explain)没有任何服务端实现——dispatcher 不提供,@objectstack/rest 只挂载 /analytics/dataset/query,service-analytics 不注册任何 HTTP 路由。所以这两个方法在一切部署形态下都 404("REST 才懂"不成立),且在 objectstack/objectui 两仓库中调用点为零。

Analytics ×2 → Option B(client 对齐 dispatcher)

实际上并非破坏性变更:一个必然 404 的方法不可能有正常工作的调用方。

  • analytics.meta(cube?)GET /analytics/meta[?cube=]。cube 参数改为可选;dispatcher 现在把 ?cube= 传入 AnalyticsService.getMeta(cubeName?)(该过滤能力本来就存在,只是没接线)。
  • analytics.explain(payload) → 保留方法名,改调 POST /analytics/sql(dispatcher 的 SQL dry-run 路由,后端为 generateSql)。
  • Ledger 两行 mismatchsdk

Storage ×2 → documented deliberate disposition(不动代码)

presigned/chunked 协议不是 REST 独有:service-storage 在任何 http-server 服务上自主注册它(storage-service-plugin.ts:283)。把 client 改回裸 POST /storage/upload 会回退直传云端、分块/断点续传、上传鉴权(#2755)与下载授权(#2970/ADR-0104)。协议为规范路径;dispatcher 的两条裸路由在 ledger 中改记为 server-only(低层 redirect/stream 兼容面),理由写入行内 note,决议记录于审计文档 §4 Resolution。

变更清单

  • packages/client/src/index.ts — 两个 analytics 方法对齐 dispatcher 形状
  • packages/runtime/src/domains/analytics.ts + http-dispatcher.ts?cube= 过滤接线(约 5 行)
  • packages/runtime/src/route-ledger.ts — 四行重新分类,mismatch 归零
  • docs/audits/2026-07-dispatcher-client-route-coverage.md — §4 增加 Resolution,follow-up [WIP] Fix error in step four of the action run #5 标记完成
  • 测试:client 三条 URL 形状测试(钉住新路由防回漂)、runtime 一条 ?cube= 全链路测试;ledger hygiene guard 机械通过
  • changeset(patch)含 FROM → TO 迁移说明
  • content/docs/api/client-sdk.mdx — 注释修正

验证

  • pnpm turbo test --filter=@objectstack/runtime — 25/25 通过
  • pnpm turbo test --filter=@objectstack/client — 27/27 通过

🤖 Generated with Claude Code

https://claude.ai/code/session_01Uij3WXdY7d4882DxMeaAAJ


Generated by Claude Code

…tches (#3584)

The #3563 audit ledgered four routes as 'mismatch'. Re-verification showed
the two analytics shapes the client spoke (GET /analytics/meta/:cube,
POST /analytics/explain) were served by NOTHING — not the dispatcher, not
@objectstack/rest, not service-analytics — so both methods 404ed against
every deployment and had zero call sites. Split resolution:

- analytics ×2 — client aligns to the dispatcher (not breaking in practice:
  a universally-404ing method has no working callers). analytics.meta(cube?)
  now calls GET /analytics/meta with an optional ?cube= filter, threaded
  through the dispatcher into AnalyticsService.getMeta(cubeName?) which
  always supported it; analytics.explain keeps its name and calls
  POST /analytics/sql. Ledger rows reclassified mismatch → sdk.

- storage ×2 — deliberate disposition, no code moves. The presigned/chunked
  protocol the SDK speaks is registered autonomously by service-storage on
  any http-server (not REST-only as the audit assumed); reshaping the client
  to the bare dispatcher route would regress direct-to-cloud, resumable
  uploads, upload auth (#2755) and download authorization (#2970/ADR-0104).
  Ledger rows reclassified mismatch → server-only with the rationale;
  decision recorded in the audit doc §4 Resolution.

Guards stay green: URL-shape tests pin the reconciled client routes, a
dispatcher test pins the ?cube= threading, and the ledger hygiene tests
(notes on every non-sdk row) pass unchanged.

Closes #3584

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uij3WXdY7d4882DxMeaAAJ
@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectstack Ignored Ignored Jul 27, 2026 8:44am

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests tooling size/m and removed documentation Improvements or additions to documentation tests tooling labels Jul 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/client, @objectstack/runtime.

26 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/ai/skills-reference.mdx (via packages/client)
  • content/docs/api/client-sdk.mdx (via @objectstack/client, packages/runtime)
  • content/docs/api/data-flow.mdx (via @objectstack/client)
  • content/docs/api/environment-routing.mdx (via @objectstack/client)
  • content/docs/api/error-catalog.mdx (via @objectstack/client)
  • content/docs/api/index.mdx (via @objectstack/runtime)
  • content/docs/api/wire-format.mdx (via @objectstack/runtime)
  • content/docs/automation/hook-bodies.mdx (via @objectstack/runtime)
  • content/docs/concepts/north-star.mdx (via packages/runtime)
  • content/docs/data-modeling/drivers.mdx (via @objectstack/runtime)
  • content/docs/deployment/index.mdx (via @objectstack/runtime)
  • content/docs/deployment/production-readiness.mdx (via @objectstack/runtime)
  • content/docs/deployment/single-project-mode.mdx (via @objectstack/runtime)
  • content/docs/deployment/vercel.mdx (via @objectstack/runtime)
  • content/docs/getting-started/your-first-project.mdx (via @objectstack/client, @objectstack/runtime)
  • content/docs/kernel/runtime-services/data-service.mdx (via packages/client)
  • content/docs/kernel/runtime-services/index.mdx (via packages/client)
  • content/docs/permissions/authentication.mdx (via @objectstack/client, @objectstack/runtime)
  • content/docs/permissions/authorization.mdx (via packages/runtime)
  • content/docs/plugins/packages.mdx (via @objectstack/client, @objectstack/runtime)
  • content/docs/protocol/kernel/http-protocol.mdx (via @objectstack/runtime)
  • content/docs/protocol/kernel/index.mdx (via @objectstack/runtime)
  • content/docs/protocol/kernel/lifecycle.mdx (via @objectstack/runtime)
  • content/docs/protocol/kernel/realtime-protocol.mdx (via @objectstack/client)
  • content/docs/releases/implementation-status.mdx (via @objectstack/client, @objectstack/runtime)
  • content/docs/releases/v16.mdx (via @objectstack/client)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests tooling labels Jul 27, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review July 27, 2026 08:55
@os-zhuang
os-zhuang merged commit 0bab8bb into main Jul 27, 2026
16 checks passed
@os-zhuang
os-zhuang deleted the claude/task-evaluation-option-b-3fx0tq branch July 27, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reconcile the four dispatcher↔client shape mismatches (analytics ×2, storage ×2) — #3563 follow-up

2 participants