Skip to content

docs(deployment): name the /meta/diagnostics query refusals and the canonical stats key - #27959

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/issue-27632-diagnostics-query-refusals
Oct 30, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/issue-27632-diagnostics-query-refusals

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

domain:devx#2 · os-justin · session_01QSeKYmTYfaPbLQD4BJfomW

Refs #27632 (the #27620 half: the three value refusals and the canonical stats key; the #27913 parameter-name refusal stays on the card until #27913 lands)

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:validating-metadata.mdx 的 GET /api/v1/meta/diagnostics 参数表补上三种 400 拒收(未知 type、severity、package),并说明 stats 按规范类型名作键。
  • 为什么改:fix(rest): GET /meta/diagnostics refuses an unknown type, severity or package, and keys an alias by its canonical type (#27514) #27620 之后该路由已拒收这三类错误值,文档没写,读文档的 AI 和 CI 作者仍以为拼错会得到空的「全部通过」。
  • 风险与回滚:仅文档,一个文件、一节;回滚即 revert 本 PR,不影响任何发布包。
  • 先看:content/docs/deployment/validating-metadata.mdx 的 diagnostics 一节(参数表与其后两段)。
  • 两分钟验证:git diff origin/main -- content/docs/deployment/validating-metadata.mdx,预期只见该节的表格加一列、两段新文字。
  • 需要你做的:无,席位落地。

What changes

The GET /api/v1/meta/diagnostics section of content/docs/deployment/validating-metadata.mdx now states what the route does since #27620, each sentence written from the code on origin/main (ed0e71db94):

  • The query table gains a column naming each parameter's 400 INVALID_REQUEST refusal:
    • severity: any value other than error / warning (packages/rest/src/meta-collection-routes.ts, the severity check).
    • type: a misspelling of a declared type, whose message names the accepted spellings (canonicalizeMetaRequestType in packages/metadata-protocol/src/protocol.ts), or a name that is neither a declared type nor in the deployment's live type set (refuseUnknownMetaListType in packages/rest/src/meta-item-read-gate.ts). A live type outside the static contract still answers 200.
    • package: a package that is not installed and that no swept item is bound to (packages/metadata-protocol/src/protocol-meta-diagnostics.ts). An installed package with no items answers zero counts. all sweeps every package (metaItemPackageBinding).
  • An empty value keeps the default. Every refusal uses the nested { error: { code, message } } envelope, and a repeated parameter answers VALIDATION_ERROR in the same envelope (refuseRepeatedQueryParams).
  • stats and each entry's type use the canonical type name, so type=views answers under stats.view, the same as type=view (canonicalMetaUrlType in the sweep).
  • The CI-gate sentence now says that a misspelled type or package answers the 400 rather than an empty sweep.

Left out: the refusal of an unknown query parameter NAME (#27633 / PR #27913). That PR was still open on origin/main ed0e71db94 when this branch was cut. Card comment 6514340216 carries the text to add once it lands.

Tests

Docs only, so there is no test to run. The route's own pins in packages/rest/src/rest-meta-diagnostics-unknown-params.test.ts (unchanged) back each documented clause: the three refusals, the near-miss message naming 'view', the repeated-parameter VALIDATION_ERROR, the canonical stats.view for type=views, and the preservation cases (empty severity, package=all, an installed package with no items, items bound to an uninstalled package, a live type outside the static contract).

Acceptance notes

  • No finding filed.

Verification

Measured at head 26a0c3bd1b (objectstack-ai/objectstack).

Derived gate families: 43 derived, 43 run, all exit 0
  • Derivation: node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack, exit 0, 43 commands, change set of 1 path (+15 / -7).
  • Each command's exit code was written to disk before any pipe. On the first pass, four gates refused with exit 3, PREREQUISITE NOT MET (unbuilt @objectstack/formula, @objectstack/lint and client dist): check:doc-formula-expressions, check:doc-security-posture, check:skill-examples and check:docs-transcript-drift. After turbo run build of those closures under the verify lock (VERDICT command-exit 0, 38/38 tasks), all four re-ran with exit 0.
  • check:doc-authoring: exit 0 ("70 published skill files clean", "19837 customer-facing string(s) ... clean").
  • check:nul-bytes: exit 0.
  • Reconciliation: dispatch-gates.mjs --repo objectstack-ai/objectstack --ran (each line recorded with its exit code) answered "43 derived famil(ies) accounted for — 43 run, 0 NOT-MEASURED (a DERIVED zero — all 43 recorded an exit code and none of them is 3)".
Not measured locally
  • NOT MEASURED: CI's Build Docs and Plan Test Core shards jobs, and the type-check lanes. The derivation names no local invocation for them, so they are left to CI.

Generated by Claude Code

…anonical stats key

Claude-Session: https://claude.ai/code/session_01QSeKYmTYfaPbLQD4BJfomW
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Oct 30, 2026
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation labels Oct 30, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:devx#2 · os-justin · session_01QSeKYmTYfaPbLQD4BJfomW

席位核对 — ACCEPT · domain:devx#2 · head 26a0c3bd1b · 2026-10-30T05:25Z

维护者速读

  • 改了什么:content/docs/deployment/validating-metadata.mdx 里 /meta/diagnostics 的查询参数表,新增一列「什么情况会被 400 拒收」:severity 传了非法值、type 拼错或不存在、package 未安装也没有条目。另外补了两句:拒收用嵌套信封返回,重复传参返回 VALIDATION_ERROR;stats 一律用规范类型名作键。
  • 为什么改:fix(rest): GET /meta/diagnostics refuses an unknown type, severity or package, and keys an alias by its canonical type (#27514) #27620 上线这些拒收后,文档没写。写脚本的人会把拼错类型得到的 400,误读成接口异常;或者以为拼错只会扫出空结果。
  • 风险与回滚:只改一页文档(+15/−7),不动代码。回滚 = 还原本 PR。
  • 先看:参数表新增的那一列,以及表下面两段新句子。
  • 两分钟验证:对一个运行中的服务端请求 GET /api/v1/meta/diagnostics?type=viewes,应收到 400 INVALID_REQUEST,报错消息会列出可用的拼写。
  • 需要你做的:无。席位落地。

席位意见:合入。每一句都照 route 代码写的,并且纠正了卡片上的两处简化:type 有两条拒收路径;package 只有「既没安装、也没有条目绑定」时才拒收。#27913 那条「未知参数名」拒收还没上 main,所以本 PR 改为 Refs,卡片留着承接那一句。

Shape: draft → main, Refs #27632. The seat changed it from Fixes in this act, because the card keeps the #27913 item. 1 file, +15/−7. Labels documentation, size/s, skip-changeset. Non-governed; the seat lands it. Report 6515458646, claim 6515191967.

Sentences checked against the code (content/docs is a prose face, checked here at ACCEPT):

  • severity: any value other than error or warning is refused. An empty value keeps error.
  • type: a near-miss of a declared type is refused by canonicalizeMetaRequestType, with the accepted spellings named. A name that is neither declared nor live is refused by refuseUnknownMetaListType after the sweep. A live type outside the static contract still answers 200, and the table's wording ("neither a declared type nor a type this deployment carries") matches that.
  • package: refused only when the package is not installed and no swept item is bound to it, in protocol-meta-diagnostics.ts. all or an empty value sweeps every package.
  • Envelope: every classified 400 leaves through isDiagnosticsRefusal as nested { error: { code, message } }. A repeated parameter answers VALIDATION_ERROR in the same shape.
  • stats and entries[].type: both are keyed by canonicalMetaUrlType, pinned in rest-meta-diagnostics-unknown-params.test.ts.

Gates: on head 26a0c3bd1b, 49 check-runs: 30 success, 19 skipped, 0 failure; mergeable_state: clean. check-expected-skips --pr 27959: OK, all 19 skips are in main's roster (exit 0). check-governed-merges --pr 27959: NOT governed, 22 changed lines. Dev's union: 43 derived, 43 run, all exit 0.

Out of scope: none. #27913's parameter-name refusal stays on #27632 (comment 6514340216 carries the text).

Landing: non-governed, 22 changed lines. In this act the seat readies the PR and arms auto-merge. On merge, the seat verifies the merged diff and releases #27632 as a partial landing. The card goes to pm:blocked with Blocked-by: PR #27913 for the remaining sentence.


Generated by Claude Code

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/s skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant