Repository navigation
Commit eb7b09d
docs(skills): objectstack-data teaches translating fieldPatches text in the patching package's own translations (#35039)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBLW6dHPW6sSheA32XPKZzPV)_
Fixes #34785
Clause-②: no
Metadata-protocol: none
Served-tier: CONTRACT_REVIEW_TIER
## 维护者速读
- 改了什么:`objectstack-data` 技能的 `fieldPatches`
段落加了一句,说明补丁改写的标签、帮助文字、选项名由发补丁的包在自己的 `translations` 里翻译;另加一条评测用例。
- 为什么改:这个行为已随 PR #34784 上线,文档页也已写明,但对外发布的技能还没教,写元数据的 agent 不知道译文该放哪。
- 风险与回滚:纯文字,无代码、无 schema 变化;为付字数删了同文件三处重复表述。回滚即 revert 本 PR。
- 先看:`skills/objectstack-data/SKILL.md`(新增的那句,以及「multiple: true
lookup」提示块被删的后半段,风险最高)、`skills/objectstack-data/evals/objects-fields-relationships.json`(用例
21)。
- 两分钟验证:`node scripts/check-skills-token-ratchet.mjs`,预期
`skills/objectstack-data/SKILL.md is 6665 tokens (ceiling 6665; headroom
0)`,整体退出 0。
- 需要你做的:无。`check-governed-merges` 判为 Tier H(`skills/**`),按低风险 skills
通道(2026-11-14 #33501 裁决)由席位落地:前提是本 head 有席位达档合同审记录,且写明
`Security-touching: no`。
## What changes
`skills/objectstack-data/SKILL.md`, the `fieldPatches` paragraph, gains
one sentence after the example:
> Translate patched text in the patching package's `translations`, under
the owner's keys (`objects.crm_account.fields.industry.label`, `.help`,
`.options.VALUE`): the owner's translation of the replaced text never
applies, a pair `.custom` translation comes first on `/meta`, and an
untranslated locale serves the patch text.
(In the file the last key is spelled with the option value in angle
brackets; it is written `VALUE` here so the body survives the
sanitizer.)
Each clause was checked against the merged code of PR #34784 (commit
`071323e1e7`), not only the docs page:
| Clause | Where the code says so |
| --- | --- |
| the patching package's own translations | `patchTranslationBundlesOf`
in `packages/rest/src/meta-item-read-gate.ts` reads
`getPackageTranslationBundle(packageId)` per patching package |
| the owner's keys | `translateObject` in
`packages/spec/src/system/i18n-resolver.ts` looks the slot up with
`lookupObjectFieldAttr` (`label`, `help`) and `lookupObjectFieldOption`
(`options`) in the catalog `partCatalog` picks |
| the owner's translation never applies | `partCatalog` returns the
patch catalog or the pair's for a changed slot, never the deployment
catalog |
| the pair comes first on `/meta` | `patchCatalogsOf` lays the pair
bundle over the package's; `form-routes.ts` passes no `pairBundle`, so
the public form has no pair rank, which is why the sentence says `/meta`
|
| an untranslated locale serves the patch text | no catalog hit leaves
the served value as is |
`skills/objectstack-data/evals/objects-fields-relationships.json` gains
case 21: a dependent package that already patches `crm_account` asks
where its zh-CN strings go.
A root changeset, `@objectstack/skills` patch.
### How the new text is paid for
The file was at 6657 of 6665 tokens. The sentence adds 327 priced bytes;
three cuts in the same file delete 295, and the row does not move.
`scripts/check-skills-token-ratchet.mjs` is untouched.
| Cut | Text that still carries it |
| --- | --- |
| The lead-in line "Detailed rules, with incorrect/correct examples:"
under the Quick Reference heading | The heading itself ("Quick Reference
— Detailed Rules"); "incorrect/correct examples" stays in Naming Rules
Summary |
| The multi-value-lookup note: the inline `{ type: 'lookup', reference:
'x', multiple: true }` spelling, and "It is NOT a junction table. Reach
for a junction object (two lookups) only when the relationship itself
carries attributes (role, added_at, …)." | The note's own title
("`multiple: true` lookup ≠ junction object") and the two Relationship
Patterns rows above it: "Many-to-Many (simple): multi-value `lookup`
(`multiple: true`), an array column of ids" and "Many-to-Many (with
attributes): Junction object with two `lookup` fields". The
positional-read sentence is kept |
| "`'organization'` / `'global'` —" in the pointer under the index
example | The example block right above it: `unique: 'organization'`
(unique per organization) and `unique: 'global'` (unique platform-wide)
|
| Reading | Before | After |
| --- | --- | --- |
| `skills/objectstack-data/SKILL.md`, lines | 473 | 472 |
| `skills/objectstack-data/SKILL.md`, tokens (ceiling 6665) | 6657 |
6665 |
| All 12 `skills/*/SKILL.md`, lines | 4730 | 4729 |
| All 12 `skills/*/SKILL.md`, tokens | 61622 | 61630 |
| The eval file (unpriced), lines | 367 | 386 |
## Tests
Text only; no package test applies and nothing was ablated.
<details><summary>Eval assertions, checked by script on
ba3ed91</summary>
For both JSON files under `skills/objectstack-data/evals/`: every
`must_contain` token is a substring of its case's `expected_output`, no
`must_not_contain` token is, and the ids are distinct. Result: 24 cases
and 21 cases, 0 violations.
Case 21's tokens carry no whitespace or quoting (`translations`,
`acme_billing`, `zh-CN`, `objects`, `crm_account`, `industry`,
`customer`; forbidden: the key spelling `overrides:`, as cases 5 and 7
spell it, so a correct answer that says a pair translation overrides the
package's still passes), because
`packages/qa/scenarios/src/skill-evals/grade.ts` matches literal
case-sensitive substrings with no normalisation. No token depends on
whitespace, quoting or line breaks.
Left out on purpose: the placement itself (that the strings sit in
`acme_billing`'s own bundle and not in HotCRM's files, and that the
entry is nested under `objects.crm_account.fields`) cannot be told from
a wrong placement by a layout-free token, so no assertion checks it. It
is stated in `expected_output` only.
</details>
## Acceptance notes
- The claim's file surface names "the `fieldPatches` paragraph only" in
`SKILL.md`. The three cuts are outside that paragraph; the dispatch
order asks for the payment to come from restatement in the same file,
and each cut is listed above.
- Not taught, to keep to one sentence: the same rule also covers
`inlineTitle` and `relatedListTitle`, and with two patching packages the
slot reads the package whose text it serves. The docs page carries the
longer form.
- Noted, not changed: the sentence "Not the same key as object-level
`ownership` …" in the paragraph above reads as if its subject was
removed earlier. Not measured (shallow checkout), not touched.
- `skills/objectstack-data/evals/README.md` lists what each fixture
covers and is not on the file surface, so it does not mention the new
case.
- Open PRs #35022 and #33849 touch the same two files; `overlap-check`
merges both cleanly. #35022 adds no case 21, and #33849 changes only the
unpriced version stamp line.
## Verification
Head `ba3ed91491`, base `origin/main` 4443014. Round 2 (contract
review 6964628467, S1 and N1) changes only case 21's assertion tokens.
On `ba3ed91491`: the eval script check above, `node
scripts/check-skills-token-ratchet.mjs` exit 0 with
`skills/objectstack-data/SKILL.md is 6665 tokens (ceiling 6665; headroom
0)`, `node scripts/check-nul-bytes.mjs` exit 0 and `node
scripts/pm/overlap-check.mjs` `VERDICT clean exit 0`. The other derived
families were not re-run on this head (NOT MEASURED on `ba3ed91491`,
reason: a two-line change to an unpriced eval fixture; CI runs them);
the readings below are from `0b60aa4ce7`.
<details><summary>Derived gates: 48 derived, 46 exit 0, 2 NOT
MEASURED</summary>
`node scripts/pm/dispatch-gates.mjs --commands` derives 48 commands for
the three paths. All 48 were run on `0b60aa4ce7`, exit code captured
before any pipe:
- 46 exit 0, among them `node scripts/check-skills-token-ratchet.mjs`
(and its `--self-test`), `pnpm --filter @objectstack/spec run
check:skill-docs`, `pnpm --filter @objectstack/lint run
check:doc-formula-expressions`, `pnpm check:skill-links`, `pnpm
check:skill-identifier-liveness`, `pnpm check:skill-compatibility`,
`pnpm check:skill-frame-sync`, `pnpm check:doc-authoring`, `pnpm
check:nul-bytes`, `pnpm check:published-files`, `pnpm
check:dts-closure`, `pnpm check:sourcemap-no-sources-content`.
- NOT MEASURED: `pnpm check:dual-build-cjs-loads` and `pnpm
check:lean-entry-closure`, both exit 3 ("Run `pnpm build` first"),
reason: they need a full-repo build, and only the `@objectstack/lint`
dependency closure was built here. CI runs them.
`node scripts/pm/dispatch-gates.mjs --ran`: `48 derived famil(ies)
accounted for — 46 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit
3)`.
Build: `pnpm --workspace-concurrency=2 --filter '@objectstack/lint...'
build` under the verify lock, `VERDICT command-exit 0`.
`node scripts/pm/overlap-check.mjs`: `VERDICT clean exit 0` against
`origin/main` and PR heads #35022 and #33849.
Not run locally, declared to CI: `test:repo`, the repo-wide lint, the
full dogfood battery (no `!` in the title, no narrowing arm).
</details>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01WGufziunkXbDT7wUWqfmWz
<!-- signed: repo:objectstack#3 · os-support-ai ·
session_01WGufziunkXbDT7wUWqfmWz -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 0ad4f48 commit eb7b09d
3 files changed
Lines changed: 39 additions & 10 deletions
File tree
- .changeset
- skills/objectstack-data
- evals
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | 38 | | |
41 | 39 | | |
42 | 40 | | |
| |||
312 | 310 | | |
313 | 311 | | |
314 | 312 | | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
321 | 316 | | |
322 | 317 | | |
323 | 318 | | |
| |||
354 | 349 | | |
355 | 350 | | |
356 | 351 | | |
357 | | - | |
358 | | - | |
| 352 | + | |
359 | 353 | | |
360 | 354 | | |
361 | 355 | | |
| |||
380 | 374 | | |
381 | 375 | | |
382 | 376 | | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
383 | 382 | | |
384 | 383 | | |
385 | 384 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
365 | 385 | | |
366 | 386 | | |
367 | 387 | | |
0 commit comments