Repository navigation
Commit 146115a
test(spec): pin SEARCH_AUTO_EXCLUDED_TYPES to every credential type in MASKED_ON_READ_FIELD_TYPES (#28123)
<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoD992ixKFWg6AWFdAVqMbwG)_
Fixes #27822
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:在 `search-fields.test.ts` 加一条断言:`MASKED_ON_READ_FIELD_TYPES`
里的每个凭据类型(今天是 `secret`、`password`)都必须在 `SEARCH_AUTO_EXCLUDED_TYPES`
里。只改测试,不改任何发布代码。
- 为什么改:引擎、lint 判凭据类型读的是掩码表,而 REST 入口的 `$searchFields`
默认集读的是手写的排除集。以后有人往掩码表加新凭据类型却忘了排除集,REST 会放行引擎会扣下的字段;这条断言让那次修改当场变红。
- 风险与回滚:零运行时风险,发布值不变;回滚即 revert 本 PR。
- 先看:`packages/spec/src/data/search-fields.test.ts` 新增的
`SEARCH_AUTO_EXCLUDED_TYPES covers every credential type` 块。
- 两分钟验证:`pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2
src/data/search-fields.test.ts`,预期 33/33 通过。
- 需要你做的:无,席位落地。
## What changes
- One new `describe` in `packages/spec/src/data/search-fields.test.ts`:
for every own key of `MASKED_ON_READ_FIELD_TYPES`, assert
`SEARCH_AUTO_EXCLUDED_TYPES.has(key)` (one `it.each` row per credential
type, with a message naming the type), plus a CONTROL that the table is
non-empty so the pin cannot pass vacuously.
- Route: the pin, not the derivation. Deriving the set's credential
members from the table would edit shipped source (`search-fields.ts`)
and need a patch changeset; the triage record asks for a single
assertion, and the pin closes the drift at the same edit.
## Tests
- Red first: injected a scratch key `textarea` into a local copy of
`MASKED_ON_READ_FIELD_TYPES` (not committed; restored with `git checkout
HEAD --`, hash matched the HEAD blob). `search-fields.test.ts` → `×
credential type textarea is auto-excluded`, `Tests 1 failed | 32 passed
(33)`, exit 1.
- Green at `799bb76f`: `search-fields.test.ts` +
`masked-field-types.test.ts` → `Test Files 2 passed`, `Tests 43 passed`.
- `pnpm --filter @objectstack/spec test && pnpm --filter
@objectstack/spec typecheck` under the verify lock → `VERDICT
command-exit 0`; `Test Files 755 passed | 1 skipped (756)`, `Tests 22511
passed | 1 skipped | 1 todo`.
## Acceptance notes
- `skip-changeset`: the diff is a test file only. `@objectstack/spec`'s
`files[]` ships `dist` and `src/**/*.zod.ts`; after a build the new
test's describe string has 0 hits in `dist/`, while the positive control
`SEARCH_AUTO_EXCLUDED_TYPES` hits `dist/browser/data/index.js`.
- The REST ingress itself (`assertSearchFieldsAreSearchable`) is
unchanged; it still reads `SEARCH_AUTO_EXCLUDED_TYPES`, which this pin
now holds to the credential vocabulary.
## Verification
<details><summary>Derived gates at 799bb76 (73 families)</summary>
- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` → 73 commands; every line run with stdin
from /dev/null, exit codes recorded before any pipe.
- 72 exit 0. Three first answered exit 3 (PREREQUISITE NOT MET) and were
re-run after their prerequisite: `check-plugin-teardown-shape
--self-test` (after `git fetch --unshallow`), `@objectstack/lint
check:doc-formula-expressions` and `check:lean-entry-closure` (after
building the lint and objectql closures) → exit 0.
- NOT MEASURED: `pnpm check:dual-build-cjs-loads`, reason: needs every
workspace package built (89+ missing `dist/`); CI's `Lint & Repo Gates`
runs it.
- `dispatch-gates.mjs --repo objectstack-ai/objectstack --ran` → `73
derived famil(ies) accounted for — 72 run, 1 NOT-MEASURED`.
</details>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01L9qibzWK3xztCU4oKFvCGo
---
_Generated by [Claude
Code](https://claude.ai/code/session_01L9qibzWK3xztCU4oKFvCGo)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent 9324232 commit 146115a
1 file changed
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
239 | 240 | | |
240 | 241 | | |
241 | 242 | | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
242 | 271 | | |
243 | 272 | | |
244 | 273 | | |
| |||
0 commit comments