Audit a Sim dynamic selector across its declaration, browser-safe manifest, server attachment, provider primitive, and selectors.execute security boundary. Use
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-validate-selector-eae307edc7d7 ,按照其中的说明把「validate-selector」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Validate the complete path, not only the provider adapter.
Read:
apps/sim/lib/selectors/manifest.ts and types.ts.apps/sim/lib/selectors/context.ts.apps/sim/lib/selectors/server/registry.ts.Search literal API paths as well as TypeScript imports before deciding whether an old provider route or contract is unused.
local keys use the local registry).dependsOn names the required source fields; canonical pairs contribute only their active member.{{KEY}} references remain unresolved in the browser; runtime references are omitted,
while embedded interpolation is forwarded unresolved and rejected by the server executor.For provider and internal selectors, confirm the shared executor owns this order:
The attachment must not duplicate these shared checks. It must not accept a browser-provided module, provider, service, operation kind, origin, or scope list.
Review its destination classification:
fixed origins are code-defined.credential-bound origins are derived from or checked against the authorized credential.user-controlled destinations have an explicit policy for hidden use-only authentication and
network safety.Missing and inaccessible references, and missing, unauthorized, or provider-mismatched credentials,
must not become existence oracles. Hidden/server-only resolved plaintext, credentials, authentication
material, and raw upstream errors must not enter responses, query/cache/rate keys, selector result
caches, logs, audit metadata, redirects, or error messages. Browser-known literals and viewable
personal/shared values are not automatically protected plaintext, but the executor must still never
deliberately or wholesale echo selector context. Only intentionally projected, normalized
{ id, label, meta? } options and bounded cursors may cross the boundary.
Selector code must not introduce a context, token, or result cache. The sole existing cache exception is authorized client-credential resolution after authorization and provider binding, which may reuse the credential service's TTL-governed, lazily pruned process-local token cache. The cache is not hard-bounded, the exception requires explicit security-owner acceptance, and selector work must not expand it.
Use existing Vitest/route/React Query patterns. Preserve valuable provider tests, but do not demand a per-selector authorization matrix. Shared executor tests should cover ordering, references, credential binding, sanitization, and safe errors; adapter tests should cover only special provider behavior.
Report critical, warning, and suggestion findings. Treat browser secret resolution, missing scope or credential authorization, unsafe destination binding, provider payload passthrough, and plaintext egress as critical.
Run the smallest relevant focused suites plus:
bun run --cwd apps/sim type-check
bun run check:api-validation:strict
bun run check:fork-dependent-coverage
bun run check:client-boundary
git diff --check
State which live-provider checks remain pending when disposable credentials are unavailable.