Repository navigation
Commit d11756a
docs(skills): teach the record write's text envelope and its organization-language key (#34499)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9QtbmWARfNoXczSYr8gtC8v)_
Fixes #34434
Clause-②: no
Metadata-protocol: none
## 维护者速读
- **改了什么**:两份对外技能补上已落地的行为(#34438):`objectstack-automation` 教流程
`create_record` / `update_record` 的字段值可以写成文本信封 `{ dialect: 'template',
source }`,按组织语言写入;`objectstack-i18n` 写出它的译文键
`flows.FLOW.records.NODE_ID.fields.FIELD`。
- **为什么改**:AI 作者只读 `skills/**`。不教的话,中文组织的应用(hotcrm
的工单升级)会继续写英文裸字符串,平台原样存进记录,没人告诉作者有标记文本的写法。
- **风险与回滚**:只改技能文本,不改运行时。automation 文件的 token 天花板按实测从 6861 抬到
6903(+42),先删了三处别处已有的重复句来付账。回滚 = revert 本 PR。
-
**先看**:`skills/objectstack-automation/SKILL.md`(Valid-but-silently-wrong
第 1 条新增的六行,以及被删的三处);`scripts/check-skills-token-ratchet.mjs`(automation
行的抬升与算式);`skills/objectstack-i18n/SKILL.md`(flows 深层键那一段)。
- **两分钟验证**:`node scripts/check-skills-token-ratchet.mjs`,预期 automation
显示 `6903 / 6903`、i18n 显示 `6219 / 6333`,整体通过。
- **需要你做的**:受治理面(`skills/**`),等你批准后由席位落地。
## What changes
- **`skills/objectstack-automation/SKILL.md`**, Valid-but-silently-wrong
item 1: after the text-slot paragraph, a `create_record` /
`update_record` `fields` value takes a third form, the text envelope `{
dialect: 'template', source }`, for a sentence people read. Its `source`
is a text slot (the paragraph above it: `{{ }}` holes, a single-brace
token refused). It is written in the organization's language (the
Localization setting if set, else the app's `i18n.defaultLocale`; the
key lives in objectstack-i18n), never the run starter's; untranslated,
the authored text is written; an unreadable setting fails the node. A
bare string stays a literal and is never translated. Each clause was
read against what #34438 landed: `FlowRecordFieldValueSchema`
(`packages/spec/src/automation/builtin-node-config.zod.ts`),
`resolveFieldValues`
(`packages/services/service-automation/src/builtin/crud-nodes.ts`),
`resolveOrganizationLocale` (`packages/core/src/organization-locale.ts`)
and `content/docs/automation/flows.mdx` § "Text a record keeps".
- **`skills/objectstack-i18n/SKILL.md`**, the paragraph naming the keys
that sit deeper than their group's `label`: it now names three, adding
`flows.{flow}.records.{node_id}.fields.{field}` for a field marked with
the text envelope, picked in the organization's language, never the run
starter's; `os i18n extract --no-objects-only` scaffolds all three (the
walker branch in `packages/lint/src/i18n-walk.ts`, pinned by
`packages/cli/test/i18n-flow-record-text-coverage.test.ts`). The
coverage check reads the same walker, so no new wording was needed for
it.
- **Paid down first** in `objectstack-automation/SKILL.md` (restatements
with another home):
1. The CEL callout's "Contract, stdlib, legacy → CEL table:
**objectstack-formula**." Survives in the same file's frontmatter
description: "CEL expressions in flow conditions / edge guards: load
objectstack-formula alongside."
2. The Trigger Configuration lead-in "A flow around it also owns
`label`, `type`, `nodes` and the `edges` `FlowSchema` requires:".
Survives in `references/examples-flows.md`, whose flows show every
top-level key.
3. Item 3's `'helpdesk.aiTriageStub': … // pure — the default` row of
the `functions` example. Survives in the same item: "A flow `function`
is a PURE compute step"; the `billing.sync` row that declares `effect:
'writes'` stays.
- **`scripts/check-skills-token-ratchet.mjs`**: the
`objectstack-automation/SKILL.md` row moves 6861 → 6903, the measured
remainder after the cuts, pinned at the measurement, with the byte
arithmetic in the row comment. Raise path: the standing maintainer
ruling 「A:先削重复,余额按实测提高」 (2026-10-27, ruling record 6513306068, letter
B). The `objectstack-i18n` row is unchanged (headroom 187 → 114). The
state-introspection route after the State Machines pointer was cut at
first and is restored:
`packages/rest/src/meta-state-route-doc-spelling.test.ts` (`test:repo`)
pins this file as one of the route's teaching sites, and Test Core shard
2/8 went red on it at 7101d3c.
- **`.changeset/34434-skills-flow-record-text.md`**:
`'@objectstack/skills': patch`.
Not in scope: hooks and actions (#34374). No eval case was added (the
claim allows at most one per skill; none was needed to carry the
teaching, and each would cost tokens in a priced file).
## Line and token readings (`skills/**`)
| File | Lines before → after | Tokens before → after (ceiling) |
|:--|:--|:--|
| `skills/objectstack-automation/SKILL.md` | 460 → 462 (+2) | 6858 →
6903 (6861 → 6903) |
| `skills/objectstack-i18n/SKILL.md` | 530 → 533 (+3) | 6146 → 6219
(6333) |
| All `skills/*/SKILL.md` | 4599 → 4604 (+5) | 59380 → 59498 (+118) |
Line budget from the claim: net +3 lines on each of the two files; both
are within it. Tokens are the ratchet's `ceil(priced bytes / 4)`, read
from `node scripts/check-skills-token-ratchet.mjs` before (origin/main
24b6ae5) and after.
## Tests
None changed or added: the diff is skill text, a ratchet row and a
changeset. `pnpm --filter @objectstack/rest exec vitest run --project
repo` at 0085ff5: 5 files, 300 passed, 23 skipped (it reads this
skill).
## Verification
Gate results at the final head are in the os-dev report on #34434 and in
this PR's check runs.
<!-- signed: repo:objectstack#2 · os-steve ·
session_01ADHkmSXPDB46NVRepWVrL3 -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 52ec26f commit d11756a
4 files changed
Lines changed: 50 additions & 9 deletions
File tree
- .changeset
- scripts
- skills
- objectstack-automation
- objectstack-i18n
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
612 | 612 | | |
613 | 613 | | |
614 | 614 | | |
615 | | - | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
616 | 638 | | |
617 | 639 | | |
618 | 640 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
254 | 260 | | |
255 | 261 | | |
256 | 262 | | |
| |||
294 | 300 | | |
295 | 301 | | |
296 | 302 | | |
297 | | - | |
298 | 303 | | |
299 | 304 | | |
300 | 305 | | |
| |||
406 | 411 | | |
407 | 412 | | |
408 | 413 | | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | 414 | | |
413 | 415 | | |
414 | 416 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
187 | 187 | | |
188 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
189 | 192 | | |
190 | | - | |
| 193 | + | |
191 | 194 | | |
192 | 195 | | |
193 | 196 | | |
| |||
0 commit comments