Repository navigation
fix(rest): GET /meta/diagnostics refuses an unknown query parameter name instead of answering the full sweep - #27913
Conversation
…ame instead of answering the full sweep The diagnostics route now declares its closed query-parameter set (type, severity, package) through the shared closed-set decision, and refuses any other name with 400 INVALID_REQUEST in the route's nested envelope. Before, `?typ=view` was ignored and answered 200 with every type swept. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cxscKusnsCNkzSsjxM
📓 Docs Drift CheckThis PR changes 1 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 19 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 75677847d69df8a378b48871d8854f0db5ecf08a && git checkout 75677847d69df8a378b48871d8854f0db5ecf08a
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 2a3dec2d498ea8467460f07dd3fb0e46ddc3cf8d 2e2306d961bb53b442887ab410252f8ccf204661 && git checkout -B drift-repro 2a3dec2d498ea8467460f07dd3fb0e46ddc3cf8d && git merge --no-ff 2e2306d961bb53b442887ab410252f8ccf204661
node scripts/docs-audit/affected-docs.mjs --json 2a3dec2d498ea8467460f07dd3fb0e46ddc3cf8d
|
|
domain:server#3 · os-elon-musk · session_016WV4czuTWNgKR22fKv7jia Contract-review-claim: The lane seat runs the |
|
domain:server#3 · os-elon-musk · session_016WV4czuTWNgKR22fKv7jia Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
Implemented-by: VERDICT: PASS |
|
domain:server#3 · os-elon-musk · session_016WV4czuTWNgKR22fKv7jia Seat ACCEPT · PR #27913 · head
|
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 41001938717 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
domain:server#3 · os-elon-musk · session_016WV4czuTWNgKR22fKv7jia Dequeued 2026-10-30T05:09Z with |
Requested by Elon · project thread
Fixes #27633
Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: follow-up #27632 (the same
/meta/diagnosticsquery table; the unknown-name refusal is added to that card in a comment)维护者速读
GET /meta/diagnostics现在只认type、severity、package三个查询参数,拼错或多传一个参数名(如?typ=view)会回 400 并列出支持的参数,而不是悄悄忽略、回全量扫描。view,其实是全部类型,同样是假的「全部正常」。client.meta.getDiagnostics与 Console 的metadata-client)只发这三个参数,不受影响。回滚即还原本 PR。packages/rest/src/meta-collection-routes.ts里诊断路由开头新增的两行,以及文件顶部的META_DIAGNOSTICS_PARAMS。pnpm --filter @objectstack/rest exec vitest run src/rest-meta-diagnostics-unknown-params.test.ts,16 条全绿(其中 rest:GET /meta/diagnosticsdeclares no closed query-parameter set, so a misspelled parameter name (?typ=view) answers a 200 full sweep #27633 的 5 条)。What changes
GET {metaPath}/diagnosticsdeclares its closed query-parameter set,META_DIAGNOSTICS_PARAMS = ['type', 'severity', 'package'], measured from the handler's read points and matching what both SDKs send.unknownQueryParamRefusalMessagefromquery-allowlist.ts(the onerefuseUnknownQueryParamswrites; no second helper), and throws the route's owndiagnosticsRefusal. So the refusal is400 INVALID_REQUESTin the nested{ error: { code, message } }envelope, the code every other thrown refusal of this route answers since meta diagnostics: an unknown type, severity or package answers a silent 200 all-clear (scannedTypes 1, zero issues) instead of a refusal; aliases key stats non-canonically #27514. The message names the unknown parameter and lists the supported set.Why
#27514 / #27620 closed the false all-clear for unknown VALUES. An unknown NAME was still dropped:
?typ=viewanswered200with every type swept, and a caller who believed the answer was narrowed could not tell.Verification
mainfirst (b13a1ed): of 5 new cases, the 4 refusal pins were red (?typ=view,?packageId=, an unknown name beside known ones with an empty value, an unknown name with a repeated known one) and the preservation pin (all three known names together answer 200) was green.pnpm --filter @objectstack/rest exec vitest run: 352 files passed, 7025 tests passed, 350 skipped.tsc --noEmitonpackages/rest: exit 0.dispatch-gates --ran: 60 derived, 58 run (exit 0), 2 NOT-MEASURED (exit 3, prerequisite in a fresh container:check-plugin-teardown-shape --self-testneeds an unshallow clone,check:dual-build-cjs-loadsneeds every package's dist), 0 UNRUN.pnpm lint: exit 0.Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses.main, one pull request.packages/spectouched: n/a.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_016WV4cxscKusnsCNkzSsjxM