Repository navigation
Commit 0d9d982
docs(skills): the api and i18n skills teach
Fixes #34552
Clause-②: no
Metadata-protocol: none
## 维护者速读
- **改了什么**:API 技能加 5 行、i18n 技能加 3 行,讲发布后运行检查(`probes`)里每条问题的
`userMessage`:这是写给发布者本人看的话,界面显示它,不显示写给 AI 的英文
`message`;没有这句话时,界面显示自己的通用提示。i18n
技能说明这句话的语言按发布请求来定(请求语言,否则工作区默认语言,否则英文)。另加一条评测用例。
- **为什么改**:技能不讲这个字段,AI 写界面时还会把英文原始报错直接给用户看。
- **风险与回滚**:只改两份技能文字和一条评测用例,不改代码,不改契约。回滚就是 revert 本 PR。
- **先看**:① `skills/objectstack-api/SKILL.md` 新增的 5 行,其中「absent, show
your own generic sentence」与上一句保存检查的「absent, render `message`」方向相反,这是
spec 的原意;② `skills/objectstack-i18n/SKILL.md` 改动的 3 行;③
`skills/objectstack-api/evals/endpoints-auth-routes.json` 的用例 8。
- **两分钟验证**:运行 `node scripts/check-skills-token-ratchet.mjs`,预期通过,其中 api
技能读数 5316 / 6314,i18n 技能读数 6282 / 6333。
- **需要你做的**:一个动作:批准这份技能文字(`skills/**` 是受管面,Tier H)。
> **Review round (supersedes the readings below where they differ).**
Contract review 7003090626 on 8f62dd8 was FAIL. Head 705655b
merges origin/main 2e9e1ac. M1: in `skills/objectstack-i18n/SKILL.md`
the two added bullets are gone; the "Server-Composed User Text" sentence
now lists "a 422 or `probes` issue" (one line changed). The file is 6332
/ 6333 tokens on the merged tree, and no ceiling is touched. S1: eval
case 8 names `Accept-Language` for this door, not `?locale`. The api
skill gains a sixth line: "This door reads the request's locale from
`Accept-Language` alone." N1 ("may answer `probes`") and N4 (the prompt
line) taken. api SKILL.md 5333 / 6314 tokens. Gates: 48 derived, 48 exit
0; ratchet and skill-links exit 0; overlap clean against main
f6902e9.
## What changes
- **`skills/objectstack-api/SKILL.md`**, section "Error Envelopes & the
Code Ledger", the `userMessage` paragraph: five new lines. They name the
report a batch publish answers (`probes`, `BuildProbeReportSchema`) and
its finding element (`RuntimeBuildIssueSchema`), say that `message` /
`fix` are English for the agent that built the app and `userMessage` is
the sentence for the person who published, and give the client rule:
show a person `userMessage`, never `message`; when it is absent, show
your own generic sentence. The paragraph's opening sentence already says
"render it as received and keep no per-code translation table", so that
rule is not repeated.
- **`skills/objectstack-i18n/SKILL.md`**, section "Server-Composed User
Text (`userMessage`)": the opening sentence lists the probe finding
beside the error envelope, the advisory and the 422 issue (one line
more), and the "Platform-composed" bullet gains two lines: the finding's
sentence is on the same locale ladder, the request being the publish
request, and `message` / `fix` stay English.
- **`skills/objectstack-api/evals/endpoints-auth-routes.json`**: case 8.
An admin page prints `probes.issues[].message` and the team asks for a
translation table per `code`. The answer must use `userMessage`; it must
not build a table keyed by a code, and must not fall back to
`issue.message`.
- **`.changeset/34552-skills-build-issue-user-message.md`**:
`@objectstack/skills` patch, with both declaration lines.
The wording is taken from the `RuntimeBuildIssueSchema` docblock
(`packages/spec/src/api/protocol.zod.ts`) and the ADR-0038 amendment
"two readers, two channels", as PR 34513 merged them. The skills point
at the schema and the ADR for everything else (how a sentence names an
artifact, the code list).
The api skill adds sentences instead of extending the existing
`RuntimeAuthoringIssueSchema` sentence, because the two fallbacks differ
in the spec: an authoring finding with no `userMessage` renders
`message`; a build finding with none shows the client's own generic
sentence. The i18n skill extends its existing sentence, as the dispatch
order asked.
### Line and token readings
Base `fff0ad0c18`, head `8f62dd835c`. Lines are `wc -l`; tokens are
`check-skills-token-ratchet`'s own count.
| file | lines before | lines after | net | tokens before | tokens after
| ceiling |
|:--|--:|--:|--:|--:|--:|--:|
| `skills/objectstack-api/SKILL.md` | 432 | 437 | +5 | 5206 | 5316 |
6314 |
| `skills/objectstack-i18n/SKILL.md` | 533 | 536 | +3 | 6219 | 6282 |
6333 |
| all 12 `SKILL.md` files | 4728 | 4736 | +8 | 61564 | 61737 | n/a |
| `skills/objectstack-api/evals/endpoints-auth-routes.json` (eval
fixture, measured, not ratcheted) | 75 | 85 | +10 | 1613 | 1980 | none |
The dispatch budget is at most +6 net lines in each SKILL.md. No ceiling
row is touched and nothing is re-wrapped: every existing line is
byte-identical except the two lines of the i18n sentence that takes the
new list item.
## Tests
No code changes, so there is no unit test and no ablation. The eval case
was run with the repository's runner, each case with the bundle
installed and without it, three repeats:
`pnpm --filter @objectstack/scenarios skill-evals --skills
objectstack-api --repeats 3 --concurrency 4` at head `8f62dd835c`, 48 of
48 turns ran.
| case | with-skill | no-skill | no-skill misses |
|:--|--:|--:|:--|
| `objectstack-api/endpoints-auth-routes#8` (new) | 3/3 | 0/3 | lacks
`userMessage`, carries `widget_query_failed:` (a table keyed by code) in
all three |
## Acceptance notes
- In the same round, four older cases of this file scored 0/3 with the
skill installed: case 3 (missed `x-objectstack-signature`), case 4
(missed `LoginRequestSchema`, `AuthProvider`), case 5 (missed
`sys_recycle_bin`, carried `'search'`), case 6 (missed `sourceField`,
`targetField`). This PR does not touch those cases or the text they
grade. Noted here, not filed: one round of three repeats on one model is
a reading, not a reproduction.
- `check:skill-eval-tokens` scans only the `objectui` bundle today, so
no gate checks that a `must_contain` token of an `objectstack-api` case
is taught. Checked by hand for case 8: its one required token,
`userMessage`, is in the api skill, and none of its three forbidden
strings is in its own `expected_output`.
- Overlap: `node scripts/pm/overlap-check.mjs` at head `8f62dd835c`
answers `VERDICT clean exit 0`. One open PR (33849) shares both SKILL.md
files and merges cleanly with this branch.
- `test:repo` is left to CI (`Test Core`). The diff touches no package
source.
## Verification
<details><summary>Local gates at head 8f62dd8</summary>
- `node scripts/pm/dispatch-gates.mjs --commands` derives 48 commands
for this diff. All 48 were run with the exit code captured before any
pipe; all 48 exit 0.
- `node scripts/pm/dispatch-gates.mjs --ran`: `48 derived famil(ies)
accounted for — 48 run, 0 NOT-MEASURED (a DERIVED zero — all 48 recorded
an exit code and none of them is 3)`.
- Five of the 48 read built output and first answered exit 3
(PREREQUISITE NOT MET) on the fresh worktree:
`check:doc-formula-expressions`, `check:dts-closure`,
`check:dual-build-cjs-loads`, `check:lean-entry-closure`,
`check:sourcemap-no-sources-content`. After a workspace build under the
verify lock (`turbo run build`, 119/119 tasks, `VERDICT command-exit 0`)
each was re-run and exits 0. The recorded code for those five is the
second run's.
- `node scripts/check-skills-token-ratchet.mjs`: exit 0, `58 authored
bundle file(s) within their ceilings`.
- Outside the derived list, run because the diff edits a `SKILL.md`:
`pnpm --filter @objectstack/spec run check:skill-refs` exit 0 (`9
generated files in sync`), `check:skill-examples` exit 0 (`347 prose
examples type-check`). `check:skill-docs` is in the derived list: exit 0
(`Skill docs in sync`).
- `pnpm check:nul-bytes` exit 0, and the control-character scan over the
four changed files finds 0 lines.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_012MmDsS4GoHCgYwA2uv3n3C)_
<!-- signed: repo:objectstack#4 · os-lizheng ·
session_012MmDsS4GoHCgYwA2uv3n3C -->
---------
Co-authored-by: Claude <noreply@anthropic.com>RuntimeBuildIssue.userMessage (#34970)1 parent f727061 commit 0d9d982
4 files changed
Lines changed: 27 additions & 1 deletion
File tree
- .changeset
- skills
- objectstack-api
- evals
- objectstack-i18n
| 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 | |
|---|---|---|---|
| |||
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
355 | 361 | | |
356 | 362 | | |
357 | 363 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
73 | 83 | | |
74 | 84 | | |
75 | 85 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
394 | 394 | | |
395 | 395 | | |
396 | 396 | | |
397 | | - | |
| 397 | + | |
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
| |||
0 commit comments