Repository navigation
Commit 796e9d4
fix(lint): connector, permission-set and form-view advisories carry a user sentence in every platform locale (#33145)
<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoWK5rFW1SUGSkDw9iatZE4f)_
Fixes #32842
Clause-②: no
Metadata-protocol: none
## 维护者速读
- **改了什么**:保存连接器、权限集和表单视图时返回的 3 类提示,现在都带一句面向用户的话,覆盖平台全部 11 种语言;规则 id、英文
message 和 hint 一字未改。卡片列出的另外 7 类提示保存时根本不会返回,本 PR 不为它们写文案,只在下方写明原因。
- **为什么改**:此前这些提示只有给开发者看的英文,非英文界面的管理员保存连接器或权限集时看不懂;这是 #32655
已落地做法在连接器、权限和表单领域的延续。连接器那句只说凭据写在哪个请求头或变量里,绝不包含凭据本身。
- **风险与回滚**:只新增文案和 `userTextParams` 字段,不改变哪些写入被拒、哪些通过;回滚即撤销本 PR。`os
validate --json` / `os build --json` 的 warnings 里这三类提示会多出
`userTextParams` 键。
- **先看**:`lint-connector-credential-literals.user-text.ts`(4
种情形,最贴近用户),再看 `validate-predicate-path-refs.user-text.ts`(两种理解都给出写法),最后看
`authoring-rules.ts` 里两行转发。
- **两分钟验证**:`pnpm --filter @objectstack/lint exec vitest run
src/finding-user-text.connector-permission-form.test.ts`,21
个用例全绿,每条都从真实元数据经运行时保存门取出并逐语言渲染。
- **需要你做的**:无,席位落地。
## What changes
Three advisory rule ids that the save door returns now carry
`userTextParams` and a user sentence in all eleven
`PLATFORM_LOCALE_TAGS`. Each rule file gets a `*.user-text.ts` catalog
beside it, and the three catalogs merge into `FINDING_USER_TEXT_CATALOG`
through `mergeUserTextCatalogs`, the way #32655 landed
`validate-security-posture.user-text.ts`.
| Rule file | Catalog | Id | Write |
|---|---|---|---|
| `lint-connector-credential-literals.ts` |
`CONNECTOR_CREDENTIAL_LITERALS_USER_TEXT` |
`connector-credential-literal` | connector |
| `validate-retired-permission-residue.ts` |
`RETIRED_PERMISSION_RESIDUE_USER_TEXT` |
`permission-retired-lifecycle-residue` | permission |
| `validate-predicate-path-refs.ts` | `PREDICATE_PATH_REFS_USER_TEXT` |
`predicate-rhs-path-shaped` (bare-word `warning` arm only) | view |
- `connector-credential-literal` has three push sites and four arms,
chosen by `position`: `header` and `env` (a literal in one of the four
maps; params `connector`, `name`), `credential-env` (a credential typed
into `transport.credentialEnv`) and `stdio-auth` (a stdio MCP server
whose `auth` reaches nothing); both carry only `connector`. ⛔ No param
and no sentence carries the credential value, following the
`lint-flow-credential-literals` precedent. The sentences name the
console's own page, Connector credentials
(`connectorCredentials.title`).
- `permission-retired-lifecycle-residue`: params `permissionSet`,
`object`, `key`. The sentence says the line grants nothing, to delete
it, and that restore and purge are granted through the recycle bin
(`recycleBin.title`).
- `predicate-rhs-path-shaped`: params `view`, `word`, `op`, set on the
bare-word arm only; the dotted arm refuses the write and carries none.
The view name is threaded through `checkPredicate` / `walkFields` (same
file). Per the rule's own note (`validate-predicate-path-refs.ts`, §One
position, one prescription: which reading the author meant is not
decided), the sentence names both readings and the supported spelling of
each (`== 'active'`, or the field on the left: `data.active == 'yes'`)
and never prescribes the root in place (`== data.active` is the refused
arm).
- `authoring-rules.ts`: the `lintConnectorCredentialLiterals` and
`validateRetiredPermissionResidue` adapters rebuilt findings field by
field and dropped `userTextParams`; each gets the one-line conditional
spread (#33120, #33140 precedent). `validatePredicatePathRefs` passes
findings through unchanged.
- Changeset `32842-advisory-user-text.md`, `@objectstack/lint` patch.
## Tests
New `finding-user-text.connector-permission-form.test.ts`, 21 tests, in
the shape of `finding-user-text.data-model.test.ts`:
- exact coverage of each catalog (ids × 11 locales) and its identity in
`FINDING_USER_TEXT_CATALOG`; the seven never-at-door ids have no entry;
- every push site rendered from its real finding in every locale
(connector header, env, credentialEnv and stdio-auth; permission
`allowRestore` and `allowPurge`; the bare-word predicate), with no
`undefined`, no unfilled `${`, every shown name present, and no locale
falling back to the English sentence; the four connector arms render
apart in every locale;
- no credential sentinel in any param or any locale's sentence;
- both predicate readings in every locale, for `==` and `!=`, and never
the root in place; the dotted arm carries no params;
- one runtime-gate case per write type (connector, permission, view)
through `runRuntimeAuthoringRules`, with the advisory's params checked
and `userMessage` parsed under `RuntimeAuthoringIssueSchema` (de-DE,
ja-JP, fr-FR).
## Acceptance notes
**Re-measure.** The card's table lists 10 ids in 8 files; the static
scan matches (each id produces exactly one `warning` whole-stack).
Through the save door (`runRuntimeAuthoringRules` on each id's own write
type with an objects context, main `a83c3667`), 3 reach a user. This PR
writes catalogs and pins for those 3 only. Under #32835's Done-when
alternative, the 7 that never reach the door:
- **(a) reference-integrity suite members on its frozen `flow`
default.** An agent, app, skill or mapping write dispatches none of
them, and a flow write's snapshot carries no agents, apps, skills or
mappings. Measured: 0 at the door for each.
- `agent-authoring-withdrawn`, `default-agent-outside-roster`,
`default-agent-legacy-alias` (`validate-ai-agent-authoring.ts`)
- `mapping-connector-source-unknown`
(`validate-mapping-connector-source.ts`)
- `ai-skill-tool-unresolved` (`validate-ai-tool-references.ts`): kept
off the door on purpose by ruling 5791822697 (ADR-0109 Decision §3),
since a per-write snapshot cannot resolve a skill's tools truthfully.
- **(b) CLI-only registry entries.**
- `security-external-owner-unmapped` (`validateExternalOwnerSharing`,
`RUNTIME_OBJECT_ADVISORY_VOLUME`)
- `sharing-rule-object-not-shareable`
(`validateSharingRuleEnforceability`, pending a `sharing_rule` door that
carries `sharingRules`)
**Agent-written sentences for the native-review round.** Every
non-English sentence in this PR is agent-written: 3 ids (6 sentences
counting the connector's four arms) × 10 locales (zh-Hans, zh-Hant, es,
ar, fr, pt-BR, ru, de, ja, ko), in the three `*.user-text.ts` files
above. Terms follow `ui/packages/i18n`: Connector credentials 连接器凭据 /
聯結器憑據 / Credenciales de conectores / بيانات اعتماد الموصلات /
Identifiants des connecteurs / Credenciais de conectores / Учётные
данные коннекторов / Connector-Zugangsdaten / コネクタ認証情報 / 커넥터 자격 증명;
recycle bin 回收站 / 回收站 / papelera / سلة المحذوفات / corbeille / lixeira /
корзина / Papierkorb / ごみ箱 / 휴지통; permission set as in
`validate-security-posture.user-text.ts`. zh-Hant uses the console's 聯結器
and 回收站, which differ from the flow catalog's 連接器; the native round may
want to settle one spelling. The connector `stdio-auth` and the
predicate sentences carry the most technical wording and are the best
first read.
**Metadata-protocol.** `none`. The #32655 precedent (#32790) declared
`added` / `Clause-②: yes` because it added a spec field (`userMessage`,
the `api` authorable shard); this PR adds no spec field and moves no
shard, so it follows #32835's reading for its lint-only sub-cards
(#32836, #32837, #32838 all `none`).
**Ruling grep** (`ruling|Ruling-ref|maintainer|⛔` across the surface,
read before editing): connector credential literals 2 (never the value;
stdio needs `credentialEnv`), retired permission residue 3 (director
ruling D, not re-adjudicable; table not derived live), predicate path
refs 2 (the consumer's ruling on the right side; which reading the
author meant is undecided), `finding-user-text.ts` 2, the four
never-at-door files 0–2 each (untouched). The sentences keep every one
of them; none is reversed.
**Serial.** #32838 (PR #33140) landed on `finding-user-text.ts` and
`authoring-rules.ts` while this was in flight; main was merged once and
every catalog line and adapter spread from both is kept. #33072's
`validate-expressions.ts` and expression entry are untouched.
**Ablations** (source, committed first, `scripts/ablation-replace.mjs`,
anchor 1 → 0 on disk, each restored to the HEAD blob `9968f378` and
verified by hash):
- deleting the `lintConnectorCredentialLiterals` adapter spread: 1
failed / 20 passed, exactly the connector-write gate case;
- deleting the `validateRetiredPermissionResidue` adapter spread: 1
failed / 20 passed, exactly the permission-write gate case.
## Verification
Head `ad51300d`, `c371f044` merged with `origin/main` at `6482c083`
(once, after #33140 landed on `finding-user-text.ts`; conflict on the
catalog list resolved by keeping both sides; `authoring-rules.ts`
auto-merged with all four adapter spreads present). After the merge:
`pnpm install --frozen-lockfile`, full `pnpm turbo run build
--concurrency=2` (lock VERDICT exit 0), `packages/runtime/.objectstack`
cleared.
- `pnpm --filter @objectstack/lint test`: 206 files, 8762 tests passed
(VERDICT exit 0). Before the merge, at `c371f044`: 204 files, 8732
passed, 5 skipped.
- `pnpm --filter @objectstack/lint typecheck`: exit 0 (includes
`check:test-typecheck`, debt held). `node
scripts/check-cli-command-ids.mjs`: exit 0. `check:nul-bytes`: exit 0.
- Consumers of the widened finding shape, each its real reading at the
merged head:
- `@objectstack/metadata-protocol` (the save door;
`protocol.runtime-authoring-gate.test.ts` names these ids): 337 files
passed, 7 skipped; 22799 tests passed, 36 skipped.
- `@objectstack/cli`
`test/connector-credential-literal-doors.e2e.test.ts` (nightly tier,
integration project, spawns the CLI): 2 tests passed.
- Derived gates: `dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` at `ad51300d` derives 62 families (identical
list to `c371f044`); every line run with stdin closed, exit captured
before any pipe, all 62 exit 0. `--ran` reconciliation: 62 derived, 62
run, 0 NOT-MEASURED (a derived zero). Record:
`spec-seat-2/r2026-11-13/out/32842-gates-ran-ad51300d.list`.
<details><summary>Gate readings that were not exit 0 on the first sweep
(c371f04)</summary>
- `check-plugin-teardown-shape --self-test` exit 3: the shallow clone
could not reach the pinned fixture commit `621a4876`; after fetching it,
exit 0 (and exit 0 in the post-merge sweep).
</details>
- No dogfood battery: the title has no `!` and `Clause-②:` carries no
`(narrowing)` arm.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01L9qibwqZc5F1URP3eghRix)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent 128b657 commit 796e9d4
10 files changed
Lines changed: 842 additions & 4 deletions
File tree
- .changeset
- packages/lint/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2078 | 2078 | | |
2079 | 2079 | | |
2080 | 2080 | | |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
2081 | 2084 | | |
2082 | 2085 | | |
2083 | 2086 | | |
| |||
2199 | 2202 | | |
2200 | 2203 | | |
2201 | 2204 | | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
2202 | 2208 | | |
2203 | 2209 | | |
2204 | 2210 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
72 | 75 | | |
73 | 76 | | |
74 | 77 | | |
| |||
187 | 190 | | |
188 | 191 | | |
189 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
190 | 198 | | |
191 | 199 | | |
192 | 200 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
91 | 100 | | |
92 | 101 | | |
93 | 102 | | |
| |||
194 | 203 | | |
195 | 204 | | |
196 | 205 | | |
| 206 | + | |
197 | 207 | | |
198 | 208 | | |
199 | 209 | | |
| |||
213 | 223 | | |
214 | 224 | | |
215 | 225 | | |
| 226 | + | |
216 | 227 | | |
217 | 228 | | |
218 | 229 | | |
| |||
234 | 245 | | |
235 | 246 | | |
236 | 247 | | |
| 248 | + | |
237 | 249 | | |
238 | 250 | | |
239 | 251 | | |
| |||
0 commit comments