Skip to content

Commit 0d9d982

Browse files
docs(skills): the api and i18n skills teach RuntimeBuildIssue.userMessage (#34970)
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>
1 parent f727061 commit 0d9d982

4 files changed

Lines changed: 27 additions & 1 deletion

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): the api and i18n skills teach `RuntimeBuildIssue.userMessage`
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
objectstack-api's SKILL.md, in the error-envelope section, names the post-publish probe report a batch publish answers (`probes`, `BuildProbeReportSchema`) and its finding element (`RuntimeBuildIssueSchema`): `message` / `fix` are English for the agent that built the app, the optional `userMessage` is the sentence for the person who published, and a client shows a person `userMessage`, never `message`, with its own generic sentence when the field is absent; the publish door reads the request's locale from `Accept-Language` alone. objectstack-i18n's SKILL.md lists the `probes` issue among the server-composed user text, which its platform locale ladder covers. The api skill points at the schema and ADR-0038 for the rest. One new eval case in the api skill grades a client that renders a build finding to a person.

‎skills/objectstack-api/SKILL.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,12 @@ otherwise as declared, with no `en` floor. The save / publish doors' `advisories
352352
422 `issues[]` share one element, `RuntimeAuthoringIssueSchema` (`api/protocol.zod.ts`): it
353353
carries an optional `userMessage` beside the stable `rule`, while `message` / `hint` stay
354354
developer-facing English; absent, render `message`.
355+
A batch publish (`POST /api/v1/packages/:id/publish-drafts`) may answer `probes`, its runtime
356+
findings (`BuildProbeReportSchema`, same file; ADR-0038). Each `issues[]` element
357+
(`RuntimeBuildIssueSchema`) has two readers: `message` / `fix` are English for the agent that
358+
built the app, the optional `userMessage` is the sentence for the person who published. Show
359+
a person `userMessage`, never `message`; absent, show your own generic sentence. This door
360+
reads the request's locale from `Accept-Language` alone.
355361

356362
A flow door — `POST /api/v1/automation/{name}/trigger`, resume, `/actions`, a
357363
declared `type: 'flow'` endpoint — answers a failed run with `400 FLOW_FAILED`;

‎skills/objectstack-api/evals/endpoints-auth-routes.json‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,16 @@
7070
"must_contain": ["?names=", "/api/v1/meta/object", "VALIDATION_ERROR"],
7171
"must_not_contain": ["object?ids=", "object?filter="]
7272
}
73+
},
74+
{
75+
"id": 8,
76+
"prompt": "Our admin page publishes a package with `POST /api/v1/packages/acme_crm/publish-drafts` and lists what the answer's `probes.issues` report. It prints each issue's `message`, and our Chinese-speaking admins cannot read lines like `widget 'open_tasks' on dashboard 'task_board': dataset query failed`. They want a translation table per `code` (`widget_query_failed`, `seed_not_applied`, ...). None of the project's files are in this directory: write the function that renders one issue for the admin in your answer.",
77+
"expected_output": "Does not build a table of translated sentences keyed by `code`. Renders each `probes.issues[]` element's `userMessage` as received: `RuntimeBuildIssueSchema` (`api/protocol.zod.ts`) gives a finding two readers, and `userMessage` is the sentence for the person who published, composed by the server in the request's locale (this door reads `Accept-Language`; else the workspace default, else `en`), so the page sends the admin's locale in that header and keeps no translations of its own. `message` and `fix` are English for the agent that built the app: at most under a collapsed technical-details section, never the line the admin reads. When a finding has no `userMessage`, shows one generic sentence of the page's own, not `message`. `code` stays the stable id for grouping.",
78+
"files": [],
79+
"assertions": {
80+
"must_contain": ["userMessage"],
81+
"must_not_contain": ["widget_query_failed:", "?? issue.message", "|| issue.message"]
82+
}
7383
}
7484
]
7585
}

‎skills/objectstack-i18n/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ stack config carries `translations` or `i18n` (kernel bootstrap is
394394
## Server-Composed User Text (`userMessage`)
395395

396396
Text the server addresses to the end user — `userMessage` on an error envelope, a save /
397-
publish advisory or a 422 issue — comes back in the REQUEST's locale, composed where it is
397+
publish advisory, a 422 or `probes` issue — comes back in the REQUEST's locale, composed where it is
398398
produced; a client renders it as received.
399399

400400
- **Platform-composed** text follows one ladder over the platform locale table

0 commit comments

Comments
 (0)