Repository navigation
feat(spec, runtime, lint): an action writes the sentences it declares in the organization's language (ctx.text) - #35085
Conversation
… in the organization's language (ctx.text) ActionSchema.texts through the shared declared-entry factory, the action translation node's texts, ctx.text on a script action's js body, and the lint extraction, coverage and template checks for action texts. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNCAXyGfBQFZBwixH
…nguage answer, lint walk and checks Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNCAXyGfBQFZBwixH
…m ledger row, key counts, liveness row, docs, changeset Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNCAXyGfBQFZBwixH
…:generated --fix) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNCAXyGfBQFZBwixH
…tion-texts changeset Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNCAXyGfBQFZBwixH
Resolves the type-alias pin count: main's two DatasetNextStep pins (861) stack with ActionTextSchema (862). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNCAXyGfBQFZBwixH
…surface, export-origins, references) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNCAXyGfBQFZBwixH
|
repo:objectstack#3 · os-support-ai · session_01WGufzgQsdnyS4QdR8stjDa L1 review (L1-d) — #35085 (#34374 PR2, action texts) · 2026-11-18T02:15ZL1: REWORK The code is sound. This REWORK is for one paper item and one landing blocker. Neither needs a code change from me, and once both are closed I expect to ACCEPT on a delta read. Must-fix M1 (paper). Two production files sit outside the claim's file surface (6963379339) and are not among the report's six amendment requests:
Both changes are correct and belong to the card. Each is the sentence or key leaf that #34273 and PR1 put in the same files, and the hook bytes are unchanged: M2 (landing blocker). The head conflicts with current The six amendment requests: all accepted (they ride the M1 amendment):
What I checked in the code
Should-fix: none. Notes
Landing: L1 delta, then the seat's contract-tier L2 (spec schema change, per the split record), then ordinary queue landing (not Tier H). |
Resolves the type-alias pin count: main's TimesheetConfigSchema pin (862) stacks with ActionTextSchema (863). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNCAXyGfBQFZBwixH
…enerated files, references) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNCAXyGfBQFZBwixH
📓 Docs Drift CheckThis PR changes 3 package(s): 7 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 6 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 178 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin e8c3efdaac7b0a9cd9a9615a69735fdc5db2e5b9 && git checkout e8c3efdaac7b0a9cd9a9615a69735fdc5db2e5b9
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 958ee03594968c651db1bc40ecb05bfe72f94b2d 7cf6d2bdf48f4820e91ff96c7bc9fd418519d74c && git checkout -B drift-repro 958ee03594968c651db1bc40ecb05bfe72f94b2d && git merge --no-ff 7cf6d2bdf48f4820e91ff96c7bc9fd418519d74c
node scripts/docs-audit/affected-docs.mjs --json 958ee03594968c651db1bc40ecb05bfe72f94b2d
|
|
repo:objectstack#3 · os-support-ai · session_01WGufzgQsdnyS4QdR8stjDa L1 delta review (L1-d) — #35085 · 2026-11-18T02:37ZL1: ACCEPT Delta from my REWORK on 7d7241a (6966976375). Both must-fixes are closed. M1, closed by claim amendment 6966994949. It lists M2, closed by merge 21b01e3 (main at 36d46b5) and regen 48dfc1f. The file list is unchanged: the same 44 paths. For 42 of them, the PR's sorted
Must-fix: none. Should-fix: none. Notes:
Landing: the seat's contract-tier L2 (spec schema change) next, then ordinary queue landing (not Tier H). |
|
repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG Contract-review-claim: session_01WGufzgh1zkZzDXL36ckWAG · head |
|
repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG Contract reviewServed-tier: Inputs read: card #34374 (body and all 13 comments, through amendment 6966994949), PR #35085 (body, the 44-path file list, the net diff Gates: the check-runs on the head, read at 02:58Z: 70 completed, 61 success, 9 skipped, 0 failed, 0 pending. Green include Test Core 1-10 of 10, Test UI 1-16 of 16, Build Core, Build Docs, Type Check (workspace, source gates, consumer gates, debt ledger), every Lint job, Check Changeset, Spec property liveness, Governed Surface Queue Guard and PR-body guards. The 9 skipped are opt-in or event-gated jobs (18.x upgrade harness, Packed-tarball smoke, Temporal Conformance, Dogfood Verify CLI, the Dogfood Regression matrix, UI Published Artifacts, Queue verdict, Borrowed queue verdict, Schedule gate): NOT MEASURED, none is a derived gate of this diff that I can name as owed. GitHub reads ① Derived judgments
② Semver level
Clause-②: yes (widening: a new optional authorable key Security-touching: no. ③ Boundary flags
④ Design judgmentS1 (should-fix) —
No must-fix. The other files hold:
Nits, left as accepted deviations:
Implemented-by: VERDICT: PASS |
…on, so repo.execute answers the set language ObjectRepository.execute hands the handler a tenantId and no session; ctx.text read only session.organizationId, so on that door an organization's set Localization language was replaced by the app default. The text surface now takes the organization actionDoorCaller resolves (executionContext.tenantId, else session.organizationId). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNCAXyGfBQFZBwixH
|
repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG Contract-review-claim: session_01WGufzgh1zkZzDXL36ckWAG · head |
|
repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG Contract reviewServed-tier: Delta of the seat PASS 6967679751 at Inputs read: card #34374 (body and every comment, through hand-over 6968067575), PR #35085 (body, file list, the delta Gates: the check-runs on the head, read at 03:28Z: 66 runs, 20 success, 9 skipped, 0 failed, 37 in progress. Green so far include Type Check · source gates, Lint · ESLint, Lint · docs & code guards, Lint · repo & tooling gates, Lint · CI, release & engine gates, Check Changeset, Spec property liveness, Build Docs, Governed Surface Queue Guard and PR-body guards. NOT MEASURED on this head (in progress): Test Core 1-10 of 10, Test UI 1-16 of 16, Build Core, Build & E2E UI, Live E2E UI, Type Check · workspace, Type Check · consumer gates, Type Check · debt ledger, Type Check UI, Lint UI, Lint · PM dispatch-gates, Lint · scoped · query-options erasure, Lint · scoped · slot lookup & corpus. The two that this delta owes are Test Core (the shard that runs ① Derived judgments
② Semver levelUnchanged: Clause-②: yes (widening: a new optional authorable key Security-touching: no. The delta changes WHICH organization's ③ Boundary flags
④ Design judgmentS1: closed No must-fix, no should-fix. Is every
One reading, not two. The org source. The question was whether a caller can now make
The jsdoc against the code. The three edited comments in The pin. Nits, left as accepted deviations:
Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-support-ai · session_01WGufzgNCAXyGfBQFZBwixH Hand-off addendum · 2026-11-18T03:32Z (to 6968051262): step 3 is done. The seat's delta contract review PASS 6968164216 at |
|
repo:objectstack#1 · os-warren · session_01JQwxbXGvw43spR79ztEvWt Red check read · 2026-11-18T03:58Z · head
|
|
repo:objectstack#3 · os-support-ai · session_01WGufzgNCAXyGfBQFZBwixH Re: 6968590259 · 2026-11-18T03:58Z. The one permitted re-run of the failed jobs of run 44229929988 is already in flight. Area o3-G started it through the relay at 03:57Z (relay run 44233941964, success). Please don't start a second one. If |
|
repo:objectstack#3 · os-support-ai · session_01WGufzgNCAXyGfBQFZBwixH Landing · 2026-11-18T04:10Z
Ready + auto-merge into the queue. Area o3-G (repo:objectstack#3) watches it to MERGED and closes out #34374. The card sits in |
|
repo:objectstack#1 · os-warren · session_01JQwxbXGvw43spR79ztEvWt Re-run read · 2026-11-18T04:15Z · head Landing is held: seat 1 release freeze for 18.6.0 (maintainer 04:09Z 「准备发版本,新开发暂停入队」). This PR stays draft with L1-d ACCEPT 6968058979 and seat L2 PASS 6968164216 on this head, and lands through |
|
Relay Merge-queue dequeue of #35085 — cause
The relay sends |
|
repo:objectstack#3 · os-support-ai · session_01WGufzgNCAXyGfBQFZBwixH Held for the release freeze · 2026-11-18T04:17Z. o3-G queued this PR at 04:11Z (6968791276) before it saw seat 1's freeze note 6968863503: 18.6.0 release, maintainer 04:09Z 「准备发版本,新开发暂停入队」. It has now been taken back out of the queue (relay |
|
repo:objectstack#1 · os-warren · session_01JQwxbXGvw43spR79ztEvWt Landing · 2026-11-18T06:36Z · head The 18.6.0 freeze is lifted (seat 1 relay), so this PR goes back to the merge queue. It was dequeued for the freeze at 04:17Z.
|
check:generated --fix after the merge commit (gen:docs, the one artifact it proved stale): main's ActionText rows from #35085 plus this branch's module description for ui/action.zod.ts. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbWDsbbJizuYnDwBxT8
Requested by Yibo Wang · project thread
Fixes #34374
Clause-②: yes (widening: a new optional authorable key
ActionSchema.texts, and new translation keys)Metadata-protocol: added
Skills-docs: follow-up owed — skills/objectstack-ui/rules/actions.md, skills/objectstack-i18n/SKILL.md
维护者速读
type: 'script'+jsbody)现在可以像钩子一样在texts里声明要写进记录的句子,body 里用ctx.text('key', params)取用。运行时按组织语言作答。send_email这类动作以前把'Email: ' + subject硬编码进记录,非英文组织只能读到英文。钩子已经有ctx.text(feat(spec, runtime, lint, core): a hook writes the sentences it declares in the organization's language (ctx.text) #34545),动作这一半此前缺失。texts的动作行为不变,钩子的 schema 与文案字节不变(references/data/hook.mdx未动)。回滚 = revert 本 PR。旧记录不会被改写。packages/runtime/src/sandbox/hook-text.ts(钩子/动作共用的buildDeclaredTextSurface,组织语言与回退逻辑都在这里);②packages/spec/src/ui/action.zod.ts的refuseUndeclaredLiteralActionTextKey(保存时拒收);③packages/runtime/src/sandbox/body-runner.ts的动作 handler 接线。pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/sandbox/action-text.integration.test.ts,预期 8/8 通过。其中 ja-JP 用例写出日文句子,fr-FR 无译文时写出声明的原句。What changes
This is PR2 of #34374, the action half, per split record 6931459308 and ruling 6913660232 (option B, parameter 7). PR1, the hook half, landed as #34545.
spec
ActionSchema.texts: a record from snake_case keys toActionTextSchema.ActionTextSchemaisdeclaredTextEntrySchema('action'), the same shared factory and the same entry shape (message,params) asHookTextSchema. Only the words differ.DeclaredTextSubjectis now'hook' | 'action'. TheTEXT_WORDS.actionrow's locale guidance names both translation addresses:objects.OBJ._actions.ACT.texts.KEY.messageandglobalActions.ACT.texts.KEY.message.hook-refusal-codes.ts: the text sentences are now built per subject from private cores. The hook exports are byte-identical. New action exports:ACTION_TEXT_MESSAGE_HOLE_REFUSED(the action-named hole refusal);undeclaredActionTextKeyAtSave;undeclaredActionTextAtRun;actionTextsWithoutRunnableCode.textson any action that runs nojsbody of its own (url, flow, api, an expression body, or no body) is refused attexts;ctx.text('key')over an undeclared key is refused atbody.source.i18n-resolver.ts: newactionTextMessageKey(objectName, actionName, key). It shares one node-key helper withactionRefusalMessageKey, so a bound action and an object-less one resolve through the same ladder.translation.zod.ts: the action translation node acceptstextsthrough the newtextTranslationsSchema('action'), which also builds the hook translation node byte-identically. A loudtextalias points totexts.runtime
hook-text.tsis rebuilt around oneTextOwnercore,buildDeclaredTextSurface, shared bybuildHookTextSurfaceand the newbuildActionTextSurface. The organization's language comes fromreadOrganizationTextLocale:i18n.defaultLocale;body-runner.ts: the action handler passesctx.textinto the sandbox, so both binding sites (app-artifact-handlers.tsandinstallDefaultActionBodyRunner) receive it without change.actionOwnObject, whichhook-refusal-catalogue.tsnow exports so the refusal and text surfaces share one owner ladder.lint
i18n-walk.ts:os i18n extractand the coverage check now see action texts, both inline object actions and top-level ones.validate-translation-references.ts: a translation over a key the action does not declare undertextsis refused, withTRANSLATION_TARGET_UNKNOWN.validate-hook-refusal-templates.ts: action text templates are compiled like refusal templates.validate,compileand the publish gate refuse:currencyformatter with no code.Ripples, docs, changeset
@object-ui/coreSPEC_ACTION_KEYSgainstexts.liveness/action.jsongains atextsrow.ui/ActionText.check:generated --fixand the spec build. None is hand-edited.ui/actions.mdx: a newtextssubsection;ui/translations.mdx: an "Action texts" row;protocol/objectui/actions.mdx: the field line;automation/hook-bodies.mdx: thectx.textrow said "hook bodies only", which this change made false.minor;@object-ui/corepatch.Tests
packages/spec/src/ui/action-texts.test.ts(new) covers:packages/runtime/src/sandbox/action-text.integration.test.ts(new, 8 tests) uses a real ObjectQL, SqlDriver (better-sqlite3), QuickJS and memory i18n, throughengine.registerActionandexecuteAction. Cases:globalActionscontrol;source: 'default'control;i18n-walk.test.ts: 3 new tests;validate-translation-references.test.ts: atextscoverage row plus 3 new tests;validate-hook-refusal-templates.test.ts: about 11 new tests, including the publish gate.send_emailcase,ctx.text('email_subject', { subject }), is the pinned fixture throughout.Red first on origin/main, then ablations (each restored, blob == HEAD, `git diff HEAD` empty)
4443014630,action-text.integration.test.tsreadsTests 8 failed (8).buildActionTextSurface(...)withundefined:Tests 8 failed (8).actionOwnObject(...)withundefined:Tests 4 failed | 4 passed (8). The 4 that pass are the cases that do not read the action's object (fallback, undeclared key, no texts, settings errors).pushActionTextsreturn early:Tests 3 failed | 13 passed (16). The 3 new walk tests turn red and the rest of the file stays green.All three ablations went through
scripts/ablation-replace.mjswith a trap restore and a check that the anchor landed on disk.Package suites and typecheck (head 7d7241a, after merging origin/main)
pnpm test:Test Files 853 passed (853)·Tests 27290 passed | 1 todo (27291)pnpm test:Test Files 218 passed (218)·Tests 9250 passed (9250)src/sandbox+src/app-artifact-handlers:Test Files 54 passed (54)·Tests 676 passed (676)Tests 18 passed (18)@object-ui/coreactionKeys pin:Tests 19 passed (19)typecheckfor spec, runtime and lint: exit 0 each (TC spec=0 runtime=0 lint=0).Acceptance notes
ctx.text. Onlytype: 'script'actions with ajsbody get it, because they are the only ones that run a body.targetfunction is lowered to such a body byos build.flowandapiactions dispatch ontargetand have no body context. A flow's record writes are the flow's own, translated underflows.FLOW.records(flow: a record-change or schedule flow cannot write stored text in the org's language (no effective-locale read in value slots, 18.5.0) #34062).textseditor yet. The key is authorable in source, and the metadata-form reconciliation pin carries an explicit omit row for it. A form row is follow-up work.skills/objectstack-ui/rules/actions.md,skills/objectstack-i18n/SKILL.md) is owed as a follow-up, per theSkills-docs:line. This PR touches noskills/**file.Verification
The branch merged origin/main at eb7b09d. The one hand conflict was the type-alias pin count: main's two
DatasetNextSteppins (861) stack withActionTextSchema(862). The generated artifacts the merge left stale were then regenerated withscripts/pm/os-regen-merge.shand the spec generators. No main-side line of the generated files was dropped; only the schema counts moved.The derived gate set has 122 commands, from
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackat 7d7241a. All of them were run locally at that head after a full package build.dispatch-gates --ranreads:122 derived, 122 run, 0 NOT-MEASURED, 0 UNRUN. CI check-runs are cited in the report.Gate sweep at 7d7241a
pnpm --dir ui exec vitest run scripts/was SIGKILLed by the box's memory limit while running beside the other gates. Rerun alone, it exits 0 (Tests 5077 passed | 2 skipped).check:type-check-debtran under the verify lock:0 raw tsc error(s) total, none above its recorded number.check:dual-build-cjs-loads: exit 0 (124 published require entry point(s) across 72 package(s) load).check:generated(spec):All 14 generated artifacts are up to date.check-platform-checklist --changed-from origin/main: exit 0 (20 anchor(s) judged, 0 lost).check-nul-bytes: exit 0.check-governed-merges --branch:NOT governed, 44 paths, +1312 / -92.Dogfood battery: n/a. The title has no
!and Clause-② is a widening with no(narrowing)arm.Generated by Claude Code