Skip to content

fix(share-links): the share page names the object by its label and leaves off hidden fields - #36460

Merged
objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/issue-33552-share-link-label-hidden
Nov 22, 2026
Merged

objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/issue-33552-share-link-label-hidden

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

Fixes #33552

Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 打开分享链接的访客,页头现在显示对象的显示名(按访客语言),不再显示内部名;对象标记为隐藏的字段也不再列出。
  • 属于分享链接落地页体验修整,替每个收到分享链接的人解决「看到内部名、看到隐藏列」的问题。
  • 出错时访客看到的是对象内部名或原始显示名,或多出一行隐藏字段;都不影响数据,可直接撤回本改动。
  • 无

What changes

  • @objectstack/types buildShareLinkResolveAnswer (the one builder both mounts of GET /api/v1/share-links/{token}/resolve serve) now answers:
    • link.object_label: the shared object's label in the request's locale. The locale is the Accept-Language top tag, else the i18n service's default locale, as the meta door reads it.
      • The label is translated by translateObject over the served label, with the inputs the meta door hands it for an object: the resolve options metaTranslateOptions builds (locale, declared fallback, and sourceLocale before defaultLocale as the authored language), and packagedBase, the object's packaged declaration, read through the request's metadata protocol (getPackagedObjectBase, the accessor the meta door's packagedObjectBaseOf reads for an object).
      • A renamed object therefore keeps its rename, rather than getting the bundle's translation of its old label (ADR-0029 D9.2a).
      • No pairBundle is passed. An object is extend-only (ADR-0146 D10; servedOverrideBaseOf answers none for it), so the meta door hands the object translator no pair catalog either, and a .custom pair's translation of the label reaches both through the deployment bundle.
      • With no service, no entry for the locale, or a throwing service, the served label is served. A protocol that cannot answer is read as no baseline known. An object with no label carries no key.
    • fields[NAME].hidden: true for a field the object declares hidden, including the injected organization_id / owning_business_unit_id / queue columns, which are hidden at their source. No other field carries the key.
  • Both producers pass the request's Accept-Language, the i18n service and the metadata protocol:
    • plugin-sharing: registerShareLinkRoutes gains optional i18n and protocol resolvers, which SharingServicePlugin wires to the kernel's i18n and protocol services, resolved per request.
    • The runtime dispatcher twin, packages/runtime/src/domains/share-links.ts: deps.resolveService(context, 'i18n') and deps.resolveService(context, 'protocol').
  • L2 S1 (done): both public routes (/resolve and /messages) on both mounts answer Vary: X-Share-Password, X-Share-Password-Encoding, Accept-Language, from the new SHARE_LINK_PUBLIC_VARY constant (@objectstack/types). Before, they sent only the two password headers. The two routes' docblocks name the third header.
  • Console share page (ui/apps/console):
    • The header reads Shared LABEL, falling back to object_name.
    • SharedRecordFields leaves off a field the projection marks hidden. That is the record panel's rule (RecordDetailPanel filters schemaFields[name].hidden).
    • shareRequestHeaders states the html element's lang attribute as Accept-Language, the same source createAuthenticatedFetch uses, so the label matches the page's UI language.
  • The runtime dispatcher twin is in scope by seat ruling, because this route has two producers. packages/runtime/src/domains/share-links.ts (cloud's designed primary surface) and its both-mounts harness packages/runtime/src/domains/share-links-field-projection.test.ts are part of this change. Both mounts build the answer through the one builder.
  • The key name is settled by seat ruling as link.object_label, beside link.object_name.
  • No packages/spec/src/** edit: the HTTP answer shape is declared in @objectstack/types only. ResolveShareLinkResult in spec contracts is the service result, and this PR does not change it.

Tests

  • packages/types/src/share-link-resolve-answer.test.ts adds a top-level describe with five cases:
    • a hidden field reports hidden: true and a shown one carries no key;
    • a zh-CN request gets the translated label;
    • the declared label stands with no service, with an uncovered locale, and with a throwing service;
    • the i18n default locale is used when no header is sent;
    • an unlabelled object carries no object_label.
  • packages/runtime/src/domains/share-links-field-projection.test.ts runs on both mounts over real ObjectQL, SQLite and ShareLinkService:
    • zh-CN gives the translated label; en-US and no header give the declared label;
    • an authored hidden field and the injected queue column report hidden;
    • both mounts serve equal data under a zh-CN request;
    • a code extension's rename of a packaged object keeps the rename under zh-CN, though the bundle translates the packaged label, with a control showing the unrenamed object is translated.
  • packages/types/src/share-link-resolve-answer.test.ts also pins the rename against packagedBase, the translated unrenamed label, and a throwing protocol read as no baseline.
  • The Vary pins per mount now read the three headers: the dispatcher twin in share-links-public-cache-headers.test.ts and share-links-password-encoding.test.ts, the plugin route in share-link-password.test.ts. The two runtime harnesses import @objectstack/metadata at module top, as check:test-source-alias prescribes.
  • Console:
    • SharedRecordPage.systemFields-33346.test.tsx: a hidden non-system field is not listed; the header shows the label; an absent label falls back to the name.
    • shared-record-shape.test.ts: the Accept-Language header follows the html element's lang attribute.

Acceptance notes

  • Field labels in the projection stay the authored ones, as before. This card asked only for the object label in the request locale. The object label takes the same inputs as GET /meta/object/NAME: the packaged base, read through the protocol's getPackagedObjectBase, so a rename stands. No pair bundle is passed, because an object is extend-only and takes no declared override (ADR-0146 D10).
  • Known, follow-up material (not a defect, per L2 7080458415): the packaged-base reader in @objectstack/types restates the object row of rest's packagedObjectBaseOf. That reader is not exported, and plugin-sharing does not depend on rest. The docblock names the reader it follows.
  • The resolve route reads the locale from Accept-Language only. It does not add a ?locale= read, so the route's query surface is unchanged.
  • The answer now depends on Accept-Language, and Vary says so (L2 S1, above). Cache-Control: no-store is unchanged.

Verification

Read first:

  1. packages/types/src/share-link-resolve-answer.ts, sharedObjectLabel: the locale and resolve-option rule.
  2. packages/runtime/src/domains/share-links.ts, the resolve arm: the twin's i18n resolution.
  3. ui/apps/console/src/pages/SharedRecordFields.tsx, the key filter.

Two-minute check: pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/domains/share-links-field-projection.test.ts. Expect every test to pass, including the [#33552] describes on both mounts (the rename case among them).

Readings, rework round 1, at head 2745365
  • Closure rebuilt under the lock, VERDICT command-exit 0, all green under set -e:
    • types share-link-resolve-answer.test.ts and share-password-header.test.ts: 50/50;
    • runtime share-links-field-projection, share-links-public-cache-headers and share-links-password-encoding: 51/51;
    • plugin-sharing share-link-password and share-link-redact-fields: 55/55;
    • typecheck passed on types, plugin-sharing and runtime.
  • Final-head reruns, in one lock hold after both ablations restored: runtime three files 51/51, plugin share-link-password.test.ts 44/44.
  • Ablation A deleted the packagedBase option line in sharedObjectLabel. The types test read the source directly: 1 failed (the rename pin), 16 passed. Restored to the HEAD blob f28a2bdd1f37; git diff HEAD empty.
  • Ablation B dropped Accept-Language from SHARE_LINK_PUBLIC_VARY. Types was rebuilt and ablation-dist-preflight --absent confirmed the marker gone from dist.
    • The runtime share-links-public-cache-headers pins went red: 3 failed, 2 passed.
    • The plugin never cached pins went red: 2 failed.
    • Restored to the HEAD blob; the rebuild put the marker back in dist (preflight exit 0); git diff HEAD was 0 lines.
  • Gates, each exit 0: check:test-source-alias (fixes the CI red at ec70ad9), check:nul-bytes, check:cross-package-test-inputs, check-changeset-no-major, check-empty-changeset, check-adr-0087-registration, check:route-envelope, check:undeclared-dep-imports, check:doc-authoring, check:issue-citations.
  • overlap-check --branch=HEAD: clean.
Readings at head 75f97ca (round 0; local subset; CI runs the full farm)
  • pnpm --filter @objectstack/types test: Test Files 39 passed (39), Tests 921 passed (921). Typecheck passed on @objectstack/types, @objectstack/plugin-sharing and @objectstack/runtime; the test-typecheck ledgers held. These ran at head 9a0a2b2, and only a test-file import and the changeset have changed since.
  • At 75f97ca, under the lock (VERDICT command-exit 0): share-links-field-projection.test.ts 19/19, share-link-resolve-answer.test.ts 14/14.
  • Console, from ui/, under the lock (VERDICT command-exit 0): six share-page files, Test Files 6 passed (6), Tests 51 passed (51).
  • Ablations: each mutation was made with scripts/ablation-replace.mjs, which confirmed the anchor went from 1 to 0, and was restored to the HEAD blob a2ae3fcb6b25.
    • Returning the declared label instead of the translated one: 2 failed, 12 passed. The two failures are the zh-CN case and the default-locale case.
    • Deleting the hidden projection line: 1 failed, 13 passed.
    • The console filter was not ablated.
  • Derived gates (dispatch-gates --ran): 78 derived, 74 run, 4 not measured.
    • The 4 not measured exited 3 (prerequisite not met): the plugin-teardown-shape self-test (shallow clone), check:dual-build-cjs-loads and check:i18n (workspace not fully built), and check:type-check-debt (closure build got no turn on the lock).
    • pnpm --dir ui exec vitest run scripts/ exited 1. Six tests timed out at 15 s with the box at load average 15, and the registry census could not import packages that were not built yet. The call-site-keys gate those timed-out tests drive was run directly (node ui/scripts/check-i18n-call-site-keys.mjs, exit 0).
    • check:test-source-alias first flagged the edited harness; it was fixed with a module-top @objectstack/metadata import and is now exit 0.
  • overlap-check --branch=HEAD: merges cleanly, exit 0.

Generated by Claude Code

…est locale and each field's hidden flag

Claude-Session: https://claude.ai/code/session_01QsR2jTyyBmoPBsURQjeJGq
Co-authored-by: Claude <noreply@anthropic.com>
… on both mounts and the share page

Claude-Session: https://claude.ai/code/session_01QsR2jTyyBmoPBsURQjeJGq
Co-authored-by: Claude <noreply@anthropic.com>
…and hidden flags

Claude-Session: https://claude.ai/code/session_01QsR2jTyyBmoPBsURQjeJGq
Co-authored-by: Claude <noreply@anthropic.com>
…projection harness

Claude-Session: https://claude.ai/code/session_01QsR2jTyyBmoPBsURQjeJGq
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 22, 2026
@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/plugin-sharing, @objectstack/runtime, @objectstack/types, touching 29 documentable anchor(s).

8 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/api/client-sdk.mdx (via getTranslations (sdk, the bare tail of client method i18n.getTranslations, bound to GET /api/v1/i18n/translations/:locale; the bare tail of client method i18n.getTranslations, bound to GET /i18n/translations/:locale), i18n.getTranslations (sdk, the route ledger binds it to GET /api/v1/i18n/translations/:locale, selected by route anchor /translations/:locale; the route ledger binds it to GET /i18n/translations/:locale, selected by route anchor /translations/:locale))
  • content/docs/api/plugin-endpoints.mdx (via /translations/:locale (route, bridged from symbol getTranslations — its route source's handler names it))
  • content/docs/kernel/runtime-services/push-service.mdx (via /devices/:deviceId (route, bridged from symbol getLocales — its route source's handler names it; bridged from symbol getTranslations — its route source's handler names it))
  • content/docs/kernel/services-checklist.mdx (via getDefaultLocale (symbol, a field of interface ShareLinkLabelI18n), getLocales (symbol, a field of interface ShareLinkLabelI18n), getSourceLocale (symbol, a field of interface ShareLinkLabelI18n), getTranslations (symbol, a field of interface ShareLinkLabelI18n), getTranslations (sdk, the bare tail of client method i18n.getTranslations, bound to GET /api/v1/i18n/translations/:locale; the bare tail of client method i18n.getTranslations, bound to GET /i18n/translations/:locale), unregisterDevice (sdk, the bare tail of client method notifications.unregisterDevice, bound to DELETE /notifications/devices/:deviceId), /api/v1/i18n/locales (route, the route ledger binds it to client method i18n.getLocales), /translations/:locale (route, bridged from symbol getTranslations — its route source's handler names it))
  • content/docs/permissions/authentication.mdx (via acceptLanguage (symbol, a field of interface ShareLinkAnswerLocale))
  • content/docs/protocol/kernel/http-protocol.mdx (via getDefaultLocale (symbol, a field of interface ShareLinkLabelI18n), getLocales (symbol, a field of interface ShareLinkLabelI18n))
  • content/docs/protocol/kernel/i18n-standard.mdx (via getTranslations (symbol, a field of interface ShareLinkLabelI18n), getTranslations (sdk, the bare tail of client method i18n.getTranslations, bound to GET /api/v1/i18n/translations/:locale; the bare tail of client method i18n.getTranslations, bound to GET /i18n/translations/:locale), /translations/:locale (route, bridged from symbol getTranslations — its route source's handler names it))
  • content/docs/ui/translations.mdx (via /translations/:locale (route, bridged from symbol getTranslations — its route source's handler names it))

⛔ 4 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v17/17-0.mdx (via unregisterDevice (sdk, the bare tail of client method notifications.unregisterDevice, bound to DELETE /notifications/devices/:deviceId))
  • content/docs/releases/v18/18-0.mdx (via /api/v1/i18n/locales (route, the route ledger binds it to client method i18n.getLocales))
  • content/docs/releases/v18/18-2.mdx (via /translations/:locale (route, bridged from symbol getTranslations — its route source's handler names it))
  • content/docs/releases/v18/18-3.mdx (via unregisterDevice (sdk, the bare tail of client method notifications.unregisterDevice, bound to DELETE /notifications/devices/:deviceId), /devices/:deviceId (route, bridged from symbol getLocales — its route source's handler names it; bridged from symbol getTranslations — its route source's handler names it))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 5 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 68 of 250 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 45 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 39e9a820fc57b5febd990a184194503b5687ad99 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 85317fe739013ac70771688d0abafebf6e9cb6e1 — the merge of head 27453659084258c8465f91f74b05b30022f471f4 into base 39e9a820fc57b5febd990a184194503b5687ad99, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 85317fe739013ac70771688d0abafebf6e9cb6e1 && git checkout 85317fe739013ac70771688d0abafebf6e9cb6e1
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 39e9a820fc57b5febd990a184194503b5687ad99 27453659084258c8465f91f74b05b30022f471f4 && git checkout -B drift-repro 39e9a820fc57b5febd990a184194503b5687ad99 && git merge --no-ff 27453659084258c8465f91f74b05b30022f471f4

node scripts/docs-audit/affected-docs.mjs --json 39e9a820fc57b5febd990a184194503b5687ad99

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 39e9a820fc57b5febd990a184194503b5687ad99 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTyyBmoPBsURQjeJGq

Final green head · 2026-11-22T13:11Z
Head-sha: 75f97ca6645c67d7aff5dd4b2da6774a0ca0d837
CI on this head: 62 success, 14 skipped, 0 failing or pending; mergeable clean. The dev's local NOT MEASURED families (dual-build, check:i18n, type-check-debt, teardown self-test, ui vitest run scripts/) are covered by CI on this head.
Declarations: Clause-②: yes (widening) · Metadata-protocol: none · packages/spec/src/** untouched ⇒ L2 at TIER_DEFAULT, owed by the seat.
Seat rulings in the body: the runtime dispatcher twin is in scope (two producers of one door), and the key is link.object_label.
Review: L1 requested from the L1 thread via the seat, and L2 from the seat. Dev report: #33552 comment 7079233796.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jSpi3g1dQNTvN6zEuH

席位核对

L1 (L1-e) on head 75f97ca664, card #33552: REWORK. One item is owed, in the declared change (the object label). The hidden-field half and the console half read correct.

Owed: link.object_label is not "the object's label as GET /meta/object/NAME serves it" for a customized object.

  • The meta door translates with more than metaTranslateOptions. meta-item-read-gate.ts:3662-3673 passes packagedBase: packagedObjectBaseOf(p, 'object', name) and the customization pair's bundles.
  • sharedObjectLabel calls translateObject({ name, label }, bundle, { locale, fallbackChain, defaultLocale }) with neither of those.
  • In translateObject, scalarOverridesPackagedBase(undefined, 'label', …) judges nothing diverged, so the deployment catalog applies. labelCatalogs with no pairBundle never reads the pair's catalog (ADR-0146 D2).
  • Two concrete cases:
    • A tenant who renamed the object (objectExtensions / a rename folded into getSchema), with a bundle entry for the packaged label: the meta door serves the rename, and the share page serves the bundle's translation of the old label.
    • A label translated only in the <base>.custom pair's catalog: the record page shows it, and the share page does not.
  • The sentences that claim parity:
    • the module header: "is the object's label as GET /meta/object/NAME serves it";
    • the changeset: "translated the way GET /meta/object/NAME translates it".
  • Fix it one of two ways, the dev's choice:
    • (a) Hand sharedObjectLabel the packaged base and the pair bundle on both mounts, so the answer is the meta door's. Pin a renamed object with a bundle entry: the rename stands.
    • (b) Narrow both sentences to what is served (the bundle over the folded declared label, without the packaged-base or pair rules), file a card for the divergence, and name it in the body.

Read and accepted

  • Shape (l1-face.mjs --pr 36460, CLEAN): open, draft, base main, Fixes #33552, Clause-②: yes (widening), which is right (two optional answer keys and an optional fourth argument), Metadata-protocol: none. One changeset covers all four published packages. Gates at this head: 62 success, 14 expected skip, 0 failed.
  • Hidden fields. projectField sets hidden: true only for field.hidden === true. The page drops a field marked hidden on top of the existing system, audit and declared-only rules. That is the record panel's rule. hidden is display only and does not redact (the value still rides record), which matches the card's ask and the record page. Redaction stays redactFields.
  • Both mounts call the one builder with { acceptLanguage, i18n }. The plugin resolves i18n per request, guarded. The runtime twin uses deps.resolveService(context, 'i18n'), guarded, with null mapped to undefined. A throwing service falls back to the declared label, and the resolve never fails on it.
  • Locale. preferredLocaleFromHeader(Accept-Language) comes first, then the service default: the meta door's order. The console sends <html lang> as Accept-Language on resolve and messages, and omits the header when empty.
  • Console. The title reads object_label || object_name, so an older server or an unlabelled object keeps the name.
  • Caching nit, no action. The answer now varies by Accept-Language, but Vary is still SHARE_PASSWORD_VARY. Harmless: both mounts send Cache-Control: no-store, and a label is not a secret.
  • Changeset, checked sentence by sentence. It is true apart from the parity sentence above. That includes "An object that declares no label carries no object_label" (textOf(schema.label)) and the hidden absent-when-false rule.

A delta ACCEPT follows on a head that makes one of (a) or (b) true, with its pin or card.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 75f97ca6645c67d7aff5dd4b2da6774a0ca0d837
Local-runs: none

Read: card #33552 body and its four comments (triage 6886911138, regrade 6984990301, claim 7077759641, dev report 7079233796); PR #36460 body and its two comments; the net diff of 12 files against merge base 4e55e4e; the check-runs on this head. Every check-run on this head is success or skipped. None failed and none is pending.

① Derived judgments

  • link.object_label on the resolve answer. Right. It is optional in the type (ShareLinkResolvedLink gains object_label?: string). It is spread in only when the schema declares a label, so an unlabelled object answers the same nine link keys as before. The types test pins that. A reader that ignores the key is unaffected. The name follows the seat ruling quoted in the PR body.
  • fields[NAME].hidden on the resolve answer. Right. It is optional and typed hidden?: true. projectField sets it only when field.hidden === true, and FieldSchema.hidden is a boolean in spec. A shown field carries no key, so an existing reader sees no change for it.
  • Same shape on both mounts. Right. Both the plugin-sharing route and the runtime dispatcher twin call the one builder, buildShareLinkResolveAnswer, with the same four inputs: the record, the resolution, getSchema(object_name) on the request's ObjectQL, and the request's Accept-Language with the i18n service. The runtime harness runs both mounts over real ObjectQL and SQLite, and asserts equal data under a zh-CN request.
  • Same hidden rule on both mounts. Right. The flag is computed in one place, projectField in @objectstack/types, from the schema each mount passes. Neither mount computes it itself. The harness checks an authored hidden field and the injected queue column on each mount.
  • Locale rule. Right, and it matches the body. The locale is preferredLocaleFromHeader(Accept-Language), else getDefaultLocale(), as the meta door reads it. The resolve options match metaTranslateOptions in @objectstack/rest: the declared fallback as the chain, and sourceLocale before defaultLocale as the authored language. The bundle is built the way translationBundleOf builds it. A missing service, no locale, an empty bundle or a throw returns the declared label. The body says the packaged-base and pair-bundle overlay inputs are not used, and they are not.
  • i18n resolution per mount. Right. The plugin resolves ctx.getService('i18n') per request inside a try. The twin calls deps.resolveService(context, 'i18n') with no environment id, which is how domains/meta.ts resolves it for the meta door.
  • New optional inputs. Right and additive. buildShareLinkResolveAnswer gains an optional fourth argument. ShareLinkRoutesOptions gains an optional i18n resolver. A caller that passes neither gets the declared label and the hidden flags.
  • New exports from @objectstack/types (through its export *): sharedObjectLabel, ShareLinkLabelI18n and ShareLinkAnswerLocale. Additive and right. The changeset does not name them. No existing reader is misled by an unlisted addition, so this is not graded.
  • Console share page. Right. The header prints object_label, else object_name. SharedRecordFields drops a key whose projection says hidden: true, which is the rule RecordDetailPanel uses. With no projection, nothing new is dropped. shareRequestHeaders sends the html element's lang attribute as Accept-Language on the resolve and messages requests, the same source the settings calls read. The header is CORS-safelisted, so no preflight is added. The local ShareLink and SharedFieldDisplay types gain the two optional keys.
  • Body claims against the code. They match. Each change the body names is in the diff, and the diff has no change of contract the body leaves out. packages/spec/src is untouched, as claimed.

② Semver level

  • Changeset .changeset/33552-share-link-label-hidden.md names @objectstack/types, @objectstack/plugin-sharing, @objectstack/runtime and @object-ui/console, each at patch. These are exactly the four packages the diff changes in published source.
  • Clause-②: yes (widening) is right. The answer gains two optional members and the functions gain optional inputs. Nothing is removed, renamed or tightened.
  • Metadata-protocol: none is right. No key, value or type a metadata author can write changes. hidden and label are read, not added.
  • The level follows from the kind. none takes patch under AGENTS.md Post-Task Checklist item 3, and a non-protocol widening ships patch. Both declaration lines are in the PR body and in the changeset body. Check Changeset is green on this head.

③ Boundary flags

  • open_questions, the key name (link.object_label or a top-level objectLabel). Answered: option A, by seat ruling as the PR body records. It is right on the merits. It sits beside object_name, which the page already reads.
  • Deviation, the runtime dispatcher twin was outside the claimed file surface. Answered: in scope by seat ruling. It is right on the merits. The route has two producers, and leaving the twin out would make the two mounts answer different shapes.
  • Deviation, one test run was not under the lock, and the derived gates ran while a source file was mutated. Answered: the check-runs on this head cover them. Every one is green.
  • Deviation, the changeset level was copied from the claim. Answered: patch is right, see ②.
  • out_of_scope_findings[0], the field labels in the projection stay authored. Answered: outside this card's acceptance, which asks for the object label only. A follow-up card is the seat's call.
  • out_of_scope_findings[1], the shared Vary does not list Accept-Language. Escalated as S1 below.
  • Triage stop rule (FLS). The dev reports that owning_business_unit_id and queue carry no requiredPermissions or maskingRule at their source, so the rule did not trigger. Nothing in the diff contradicts that.
  • SQL push-down. No finding. The diff adds no query, no id materialisation and no in-app join. The label is read from the schema and the i18n bundle, and the hidden flag from the schema.

S1 (should-fix) — The resolve answer now varies on Accept-Language, but both mounts still send Vary: SHARE_PASSWORD_VARY, which lists only the two password headers. Both mount docblocks say that Vary exists for a cache that does not honour no-store. Such a cache could now serve one reader's localized label to a reader in another language. The dev noted this and filed nothing. Add Accept-Language to the Vary the two public routes send, or file it as its own card before this one closes.

No must-fix.

Implemented-by: claude/issue-33552-share-link-label-hidden
Reviewed-by: session_01QsR2jTeURPvEm465RcoYEC

VERDICT: PASS

…rves it, and the public answers vary on Accept-Language

Claude-Session: https://claude.ai/code/session_01QsR2jTyyBmoPBsURQjeJGq
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l and removed size/m labels Nov 22, 2026
…ink header harnesses

Claude-Session: https://claude.ai/code/session_01QsR2jTyyBmoPBsURQjeJGq
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTyyBmoPBsURQjeJGq

Final green head (rework 1) · 2026-11-22T14:13Z
Head-sha: 27453659084258c8465f91f74b05b30022f471f4
CI on this head: 60 success, 12 skipped, 0 failing or pending; mergeable clean.
This round answers the L1 REWORK and the L2 should-fix S1.

  • L1 option (a): sharedObjectLabel hands translateObject the packaged base, read through the request's metadata protocol (getPackagedObjectBase, the accessor the meta door reads). It does this on both mounts, so a code extension's rename stands under a translated locale.
  • No pair bundle is passed. An object is extend-only, and the meta door hands the object translator no pair catalog either.
  • Pins: a rename under zh-CN on both mounts, with an unrenamed control.
  • S1: both public routes on both mounts send Vary: X-Share-Password, X-Share-Password-Encoding, Accept-Language, from the new SHARE_LINK_PUBLIC_VARY. The per-mount pins are updated, and dropping Accept-Language turns them red (ablation).
  • The Test-source alias gate red on ec70ad9 is fixed: the two runtime harnesses now import @objectstack/metadata at module top.
  • The changeset stays at patch, and packages/spec/src/** is untouched.
    Dev delta: share-link resolve answer carries no object label and no field hidden flag, so the landing page prints the API name and can list hidden columns #33552 comment 7079994565.
    Noted for the reviewer: the packaged-base reader in @objectstack/types restates the object row of rest's packagedObjectBaseOf, which is not exported (plugin-sharing does not depend on rest). The docblock names the reader it follows.
    Review: L1-e delta and a short L2 delta (seat) requested via the seat on this head.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jSpi3g1dQNTvN6zEuH

席位核对

L1 (L1-e) delta on head 27453659084258c8465f91f74b05b30022f471f4, card #33552: ACCEPT. This supersedes REWORK 7079684282 (head 75f97ca664). The short delta L2 owns the Vary reading (its S1).

The owed item: closed, by option (a).

  • sharedObjectLabel now hands translateObject the object's packaged base.
    • It is read the way the meta door's packagedObjectBaseOf(p, 'object', name) reads it: the protocol's getPackagedObjectBase(name), called synchronously, with undefined on no protocol, no accessor, or a throw.
    • Both mounts resolve the 'protocol' service per request, guarded: the plugin through ctx.getService, the runtime twin through deps.resolveService(context, 'protocol').
    • A served label that diverged from the packaged one (a rename) therefore reads no deployment catalog, which is ADR-0029 D9.2a, as on the meta door.
  • No pair bundle: I checked the reason, and it holds.
  • New pins, on the builder and on both mounts:
    • a renamed object with a bundle entry for its packaged label keeps the rename;
    • control: an object still on its packaged label is translated;
    • a protocol that cannot answer is read as no baseline known.
  • Sentences. The module header and the changeset now spell out the inputs (the served label, metaTranslateOptions, the packaged base, no pairBundle and why). "A renamed object therefore keeps its rename" is true of the code.

Also in the delta (the L2's S1).

  • SHARE_LINK_PUBLIC_VARY = the password pair plus Accept-Language, from one constant in @objectstack/types.
  • It is answered on /resolve and /messages on both mounts, with Cache-Control: no-store unchanged. The header tests follow it.
  • The changeset states the new Vary value and the new optional protocol resolver.

27453659 is test-harness only: the two share-link header harnesses pay the metadata load at collection.

Gates at this head: 60 success, 12 expected skip, 0 failed, mergeable clean. Everything else in 7079684282 stands as read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTeURPvEm465RcoYEC

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 27453659084258c8465f91f74b05b30022f471f4
Local-runs: none

Delta review: 75f97ca6..27453659. Prior record 7079728874 (PASS at 75f97ca6) stands for everything this delta leaves alone.

Read: card #33552 and every comment on it, the dev delta 7079994565 included; PR #36460 body and its comments, with the L1-e REWORK 7079684282 and the final-green note 7080388304; the compare 75f97ca6...27453659; the check-runs on this head. The compare is two commits, ec70ad9c and 27453659, each with one parent on the branch. There is no merge of main in the delta, so every hunk below is the dev's. Ten files change. Every check-run on this head is success or skipped (Test Core 10 of 10 and Test UI 16 of 16 among them). None failed and none is pending. The PR is mergeable clean.

① Derived judgments

  • sharedObjectLabel passes packagedBase. Right, and it matches the meta door. translateMetaDocument and translateMetaList in @objectstack/rest hand the object translator packagedObjectBaseOf(p, 'object', name). That is the protocol's getPackagedObjectBase(name) (the object row of PACKAGED_BASE_ACCESSORS), read synchronously, with undefined for no protocol, no accessor or a throw. The new reader does the same, and sharedObjectLabel already refuses an empty name before it is called. In translateObject the label goes through resolveScalar('label'). When the served label differs from the packaged one and no pair bundle is given, the deployment catalog is not read, so a rename stands. That is the meta door's answer.
  • "Objects are extend-only, so no pair bundle." True. OVERRIDE_TYPE_CLASSIFICATION.object in packages/spec/src/kernel/customization-package.ts is extend_only (ADR-0146 D10). servedOverrideBaseOf in metadata-protocol/src/served-override.ts answers undefined for any type that isOverridableMetadataType refuses. So pairTranslationBundleOf(p, 'object', document) on the meta door is always undefined, and that door hands the object translator no pair catalog either. The second L1 case, a label translated only in a .custom pair's catalog, cannot arise for an object.
  • The meta door's other object inputs do not reach the label. patchBundles (i18n: let a dependent package's fieldPatches label/description be translated from that package's own catalog (split from #33800 half 2) #33952) is read only for field slots (patchCatalogsOf in translateObject). withoutStaleObjectPlural rewrites only pluralLabel. Neither is a gap for link.object_label.
  • Protocol resolution per mount. Right. The runtime twin calls deps.resolveService(context, 'protocol') inside a try, which is how domains/meta.ts resolveProtocol reads it. The plugin route calls ctx.getService('protocol') per request inside a try, the same pattern the i18n resolver already uses. 'protocol' is the name metadata-protocol/src/plugin.ts registers, and its shim carries getPackagedObjectBase.
  • The header and changeset claim of matching GET /meta/object/NAME. Now holds for the label. The module header names the three inputs (the resolve options, packagedBase, no pairBundle) and why each is so. The changeset sentence names the packaged declaration and the rename rule. Both are true of the code above. The L1-e REWORK option (a) is met.
  • Pins. The runtime harness registers projection_lead and a code extension that renames it to Prospect, then runs both mounts over a real ObjectStackProtocolImplementation under zh-CN, with a bundle entry for the packaged label. It asserts Prospect, and the unrenamed control is translated. The pin carries weight by construction: with no packaged base, the bundle entry would answer 投影线索. The types unit pins add the throwing protocol case. The dev reports ablating packagedBase turned the rename pin red.
  • Vary. Right. SHARE_LINK_PUBLIC_VARY is SHARE_PASSWORD_VARY plus , Accept-Language. Both mounts' frozen public header maps now use it, so /resolve and /messages send it on every outcome on both mounts. The three per-mount pins read the three headers. The dev reports ablating the third header turned five pins red.
  • New public surface in @objectstack/types: SHARE_LINK_PUBLIC_VARY (named in the changeset) and the ShareLinkLabelProtocol type (not named). New optional inputs: protocol on ShareLinkAnswerLocale, and a protocol resolver on ShareLinkRoutesOptions. All additive. A caller that passes no protocol gets the earlier answer.
  • Test-only hunks: the two runtime header harnesses gain a module-top import '@objectstack/metadata' for check:test-source-alias. No contract change.
  • The restated packaged-base reader. Not graded; follow-up material. packagedObjectBaseOf in @objectstack/rest is not on that package's export surface, and @objectstack/types depends on @objectstack/spec alone, so it cannot import rest. The restatement is one row and behaves the same as rest's today. A rename of the accessor would turn the runtime rename pin red, because it uses the real protocol. Rest's table docblock says no second resolver should sit beside it, though. The durable fix is to move the object-row reader to a package both can import. A card for that is the seat's call.
  • Body claims against the code. The changeset and the What changes section match the delta. One sentence in Acceptance notes does not, see S2.

② Semver level

  • The changeset still names the same four packages at patch. The delta adds published source only in @objectstack/types, @objectstack/plugin-sharing and @objectstack/runtime, all already listed.
  • Clause-②: yes (widening) is still right. The delta adds an optional input and an exported constant. It also adds a third Vary name, which only narrows what a non-compliant cache may reuse. Nothing is removed or tightened for a caller.
  • Metadata-protocol: none is still right. No authorable key changes.
  • Check Changeset is green on this head.

③ Boundary flags

  • L1-e REWORK 7079684282. Answered by option (a), see ①. The pair-bundle half needs no code, because objects take no declared override.
  • Prior S1, Vary lacked Accept-Language on both public mounts. Fixed and pinned on both mounts, see ①.
  • The dev's note that the types reader restates rest's. Answered in ①: follow-up, not graded.
  • The CI red at ec70ad9c (check:test-source-alias). Answered: fixed by the module-top imports, and the lint gates are green on this head.
  • SQL push-down. No finding. The delta adds no query. getPackagedObjectBase is an in-memory registry read.

S1: closed

S2 (should-fix): The PR body's Acceptance notes still say "The object label is translated without the /meta packaged-base and pair-bundle overlay inputs, as the other non-/meta readers do". Since 27453659 that is false for the packaged base, and it contradicts the What changes section of the same body. Rewrite the sentence to say the packaged base is passed and no pair bundle applies to an object, or delete it, before merge.

No must-fix.

Implemented-by: claude/issue-33552-share-link-label-hidden
Reviewed-by: session_01QsR2jTeURPvEm465RcoYEC

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · zhuangjianguo · session_01QsR2jTyyBmoPBsURQjeJGq

Landing · 2026-11-22T14:25Z · head 27453659084258c8465f91f74b05b30022f471f4 · L1-e delta ACCEPT 7080445196 · L2 delta PASS 7080458415 (TIER_DEFAULT; prior PASS 7079728874)

probe reading
check-governed-merges.mjs --pr 36460 NOT governed · 602 changed lines ≤ 3000
landing-k.mjs --pr 36460 K = 5 < 15
checks on head 60 success, 12 skipped, 0 failing · mergeable clean (body-guard reruns after the body edits: success)
L2 S2 (body) the Acceptance note now says the label takes the meta door's inputs (packaged base, no pair bundle)
follow-up the restated packaged-base reader is named in the body as known

Ready + auto-merge in this stroke; Fixes #33552 closes the card on merge.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 22, 2026 14:25
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit 9abc732 Nov 22, 2026
80 of 81 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-33552-share-link-label-hidden branch November 22, 2026 15:04
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
…and activity-summary labels read as /meta serves them in a declared sourceLocale (objectstack-ai#36464)

<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9Ubb3T2gwH6MWTYde4qF8edEDN)_

Part of objectstack-ai#35384 — this PR moves three of the card's readers onto the
`/meta` resolve path. The approval NOTIFICATION subject param stays
open: it is resolved per recipient at delivery by service-messaging's
general keyed-param path, so it is left for the area to file (see
Acceptance notes).

Clause-②: no
Metadata-protocol: none

## 维护者速读

-
用户能看到什么变化:应用以英文编写、默认面向中文用户时,英文用户在审批收件箱、审批页、活动记录摘要和自定义校验规则的报错里看到英文原文,不再夹杂默认语言的中文;中文用户看到的不变。
- 为什么做:这是多语言标签统一的后续:让这三处和对象元数据接口用同一种方式取标签。
- 出错会怎样:最坏情况是某处标签显示成原文而不是译文,不影响数据和权限,合并后可直接回退。
- 要你做什么:无

## What changes

The objectstack-ai#34030 rule, quoted from the card: "resolve the label through
`translateObject` with the same resolve options `/meta` builds, so `t()`
carries messages only."

- **objectql** (`validation/rule-validator.ts`, `authoredRuleMessage`):
an author-written rule message
(`objects.OBJECT._validations.RULE.message`) now resolves through
`translatedLabels` over `ValidationMessageContext.labelTranslation`.
That is the bundle plus `ResolveOptions` that the same refusal's field,
option and object labels already read (objectstack-ai#34030), so this half adds no
copy of the options. The ADR-0029 D9.2a tenant-rewrite check is
unchanged. `translate` (that is, `t()`) now carries only the built-in
messages.
- **plugin-approvals** (`reader-locale-labels.ts`,
`readerLabelsFor().objectLabel`): the object label resolves through
`translateObject` over every locale the service holds, with the metadata
route's options: the negotiated reader locale, the declared fallback
chain, and `sourceLocale` else `defaultLocale`. This one change covers
the inbox row, the request page, the generic data door's request rows
and the two lifecycle refusals that name an object. Flow, step and
position labels and the catalog sentences stay on `t()`.
- **plugin-audit** (`activity-summary-message.ts`):
`readerSummaryLocale` hands the composer the object definition that
`translateObject` put in the reader's language. The object, field and
select-option labels are read off that definition and no longer come
from `t()` keys. The writer's stored sentence is unchanged, because its
locale already reads only authored labels.
- A service that cannot hand its translations over (no `getLocales()` /
`getTranslations()`) no longer gets these labels translated through
`t()`: the authored text stands. Every service the platform ships
implements both.

## Tests

- objectql `engine-label-source-locale.test.ts`: new top-level describe
for the authored rule message under `sourceLocale: 'en'` /
`defaultLocale: 'zh-CN'`. An `en` write reads the authored sentence.
Controls: a `zh-CN` write reads the zh-CN row, and with no
`sourceLocale` an `en` write walks to the zh-CN row.
- objectql `validation/rule-validator.test.ts` (objectstack-ai#14253 and D9.2a
describes) moved from `translate` doubles to `labelTranslation`. The
first case wires a `t()` decoy beside it, so a regression back to `t()`
turns it red.
- objectql `engine-validation-locale-negotiation.test.ts` and
`engine-validation-tenant-rewrite.test.ts`: the served-adapter doubles
gain `getTranslations` / `getFallbackLocale`, which `FileI18nAdapter`
has. The three `t()`-locale probes in the negotiation suite now trip a
built-in `max_length` message, the sentence the `t()` bridge still
carries.
- plugin-approvals `reader-locale-labels.test.ts` and plugin-audit
`activity-summary-message.test.ts`: a new `[objectstack-ai#35384]` describe in each.
Each covers the real in-memory service and the served-adapter shape, and
asserts that `t()` itself answers the zh-CN row at the same service, so
the defect's precondition is measured and not assumed. Also covered: the
two controls, a `t()`-only service, and a throwing `getTranslations`.
- `/meta`'s half of the same scenario is pinned in
`packages/rest/src/meta-i18n-declared-fallback-chain.test.ts` §6.

## Acceptance notes

- **Not fixed here, left for the area to file:** the approval
notification subject param (`approval-notification-text.ts`
`subjectParams`, `{ key: objects.OBJECT.label, fallback }`). It is
resolved at delivery by
`packages/services/service-messaging/src/notification-text.ts`
(`renderWith`: `lookup(i18n, param.key, locale) ?? param.fallback`,
through `t()`). The producer holds no recipient locale at emit, so it
cannot hand over a resolved label. The only messaging fix would parse
the key shape inside the per-delivery param resolver that every
producer's keyed params share, which goes past the narrow widening the
area allowed. **Routed (seat):** this is the objectstack-ai#35384 remainder, released
back to `pm:queue` on merge as a typed object-label param in
`NotificationTextKeys` that service-messaging resolves through
`translateObject` (`domain:server`), together with `readerLabelsFor`'s
flow, step and position labels.
- **Folded into the same objectstack-ai#35384 remainder (L1 7081082388):** the two
readers this PR moves hand `translateObject` the metadata route's
resolve options but not its packaged base. plugin-approvals
`objectLabel` passes `{ name }` alone, and plugin-audit
`translatedObjectDef` passes no `packagedBase`. So for a renamed object
(a served label that diverged from the packaged one) they read the
translation of the old label, where `/meta` serves the rename. This is
not a regression: `t('objects.<o>.label')` did the same. The fix is the
`getPackagedObjectBase` read objectstack-ai#36460 threads for the share-link label.
Until then, the docblocks' "as `/meta` resolves it" holds for the
resolve options only.
- **Measured: `en-US` under `sourceLocale: 'en'`.** `/meta` hands
`translateObject` the request tag as written. objectql (objectstack-ai#34030) and now
these readers hand it the tag negotiated against the service's locales.
When the service holds an `en` locale (any `en` catalog), an `en-US`
request gets `客户` (the defaultLocale row) from `/meta` and `Account`
from objectql. With no `en` locale held, both give `客户`. Reading taken
with `translateObject` from this branch's `@objectstack/spec` dist at
c0111e2. Raised as a decision; not changed here. **Filed:** objectstack-ai#36466
(`/meta` negotiates the request locale first; no spec change).
- No resolve-options builder is reachable from plugin-approvals or
plugin-audit: rest's `metaTranslateOptions` is not a dependency, and
objectql's `labelTranslationOf` is private. So each plugin carries the
same few lines that plugin-security and objectql inlined in objectstack-ai#34030, with
a docblock naming `metaTranslateOptions`. **Filed:** objectstack-ai#36467 (one
exported spec builder, contract tier).

## Verification

Two-minute check: `pnpm --filter @objectstack/plugin-approvals exec
vitest run --maxWorkers=2 src/reader-locale-labels.test.ts`. Expect
every case to pass, including `[objectstack-ai#35384] … an en reader picks no
defaultLocale row`.

Read first:
1. `packages/plugins/plugin-audit/src/activity-summary-message.ts`, the
`readerSummaryLocale` / `translatedObjectDef` hunk (the reader's
definitions are now the translated ones).
2. `packages/objectql/src/validation/rule-validator.ts`, the
`authoredRuleMessage` hunk.
3. `packages/plugins/plugin-approvals/src/reader-locale-labels.ts`, the
`objectLabel` hunk.

<details><summary>Test readings (b815112 unless stated; fix round at
final head 67d23af first)</summary>

- Fix round at 67d23af (CI Test Core 6/10 red on b815112: 4 cases in
`packages/services/service-automation/src/flow-write-refusal-locale.integration.test.ts`,
whose i18n double held the rule message only as a `t()` key, so the
bundle read now returned the authored English). The double's zh-CN
bundle gains
`objects.crm_deal._validations.amount_not_negative.message`. It is a
fixture change of spelling only: no assertion changed and nothing was
skipped. In that file, Tests 8 passed (8).
`@objectstack/service-automation` 290/290 files, 4222/4222 tests.
`@objectstack/plugin-approvals` 126/126 files, 1853/1853.
`@objectstack/plugin-audit` 109/109 files, 1800/1800. Lock VERDICT
command-exit 0. overlap-check at 67d23af is clean. A sweep of the
other tests that combine validations, an i18n service and a non-en
locale found no further consumer.
- objectql `pnpm --filter @objectstack/objectql test` at 8be4929
(objectql is unchanged after it): Test Files 628 passed (628), Tests
14286 passed (14286); lock VERDICT command-exit 0.
- plugin-audit `pnpm --filter @objectstack/plugin-audit test` at
b61713e: 107/109 files, 1798/1800 tests. Two failures: the new pin's
expected list wording, and the bare-string option case (triaged below).
After the fix, those two files at b815112: Tests 31 passed (31).
- plugin-approvals `pnpm --filter @objectstack/plugin-approvals test` at
b61713e: 125/126 files, 1846/1853 tests. Seven failures, all in
`record-lock-user-facing-message.test.ts`, whose doubles answered labels
through `t()` only. After those doubles gained `getTranslations`, that
file and `reader-locale-labels.test.ts` at b815112: Tests 41 passed
(41).
- typecheck at b815112: objectql exit 0, plugin-audit exit 0,
plugin-approvals exit 0. At b61713e approvals failed with TS2339 on
the label-only doc literal; fixed with an `ObjectLike` annotation.
- Fixture triage: the bare-string option `options: ['p1', 'p2']` is not
a `SelectOptionSchema` (strict object with `label`). `translateObject`,
and so `/meta`, serves it as written. The objectstack-ai#7289 case now pins `p1` as
`/meta` serves it, where it used to pin the `t()` row.

</details>

<details><summary>Reverse verification (each fixed source file put back
to origin/main, its pins run, then restored)</summary>

At b61713e, under one lock call, the scratch script used `git restore
--source=BASE` (tree only), checked the BASE blob hash on disk, then
`git checkout HEAD --` and checked the HEAD blob hash. Pins resolve
`src/` directly, so no dist step is involved.
- `rule-validator.ts` at BASE: `engine-label-source-locale.test.ts` 1
failed / 8 (`an en write reads the authored English sentence`).
- `reader-locale-labels.ts` at BASE: `reader-locale-labels.test.ts` 4
failed / 22 (both `en reader picks no defaultLocale row` cases, the
inbox-row case, and the `t()`-only case).
- `activity-summary-message.ts` at BASE:
`activity-summary-message.test.ts` 4 failed / 18 (both `en reader`
cases, the `t()`-only case, and the throwing-translations case).
- Controls stayed green on every leg. After restore, `git diff HEAD` was
empty.

</details>

<details><summary>Gates</summary>

`node scripts/pm/dispatch-gates.mjs --commands` derived 74 families;
reconciliation with `--ran` reported 74 derived, 74 run.
- 70 exit 0 at b61713e. Re-run at b815112, exit 0:
`check:type-check-debt` (a PREREQUISITE exit 3 on the first pass, while
a sibling build held dist), `check:type-check-coverage`,
`check:cross-package-test-inputs`, `check:test-source-alias`,
`check:undeclared-dep-imports`, `check:nul-bytes`,
`check:engine-double-contract`, `check:doc-authoring`,
`check:issue-citations`.
- NOT MEASURED locally, left to CI: `check:i18n` (needs the built CLI
closure), `check:dual-build-cjs-loads` (needs a full build), and
`check-plugin-teardown-shape --self-test` (needs a commit this shallow
clone does not have).
- `overlap-check --branch=HEAD`: clean against origin/main and objectstack-ai#36399.

</details>

---

_Generated by [Claude
Code](https://claude.ai/code/session_01QsR2jTyyBmoPBsURQjeJGq)_

<!-- signed: repo:objectstack#7 · zhuangjianguo ·
session_01QsR2jTyyBmoPBsURQjeJGq -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
…s label, read as the metadata translators serve them (objectstack-ai#36598)

<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi91tYCagMT6JaQ6YA5YqnWwi)_

Part of objectstack-ai#35384

Clause-②: no
Metadata-protocol: none

## 维护者速读

-
应用以英文编写、默认给用户中文的部署里,英文读者在审批收件箱、审批详情和时间线上看到的流程名与岗位名,从中文改回作者写的英文;被代码扩展改过名的对象,在审批和动态摘要里也显示新名字,与元数据接口一致。
- 属于「标签按读者语言显示」的收尾工作,替英文读者和改过对象名的应用解决「看到默认语言或旧名字」的问题。
- 出错时读者看到的是改动前的标签(中文或旧对象名),不影响数据,可直接撤回本改动。
- 请决定审批步骤名是否另开一张卡:它暂时仍走旧的查词方式,需要规范包新增一个读取函数。

## What changes

This is stage 2 of objectstack-ai#35384: items 2 and 3 of the remainder in release
comment 7082136476. Item 1 (the approval notification subject param in
service-messaging) is not in this PR, and neither is the approval STEP
label (see Acceptance notes). That is why this PR says `Part of`.

- **Item 2: flow and position labels in the approvals door**
(`plugin-approvals/src/reader-locale-labels.ts`).
`readerLabelsFor().flowLabel` and `.positionLabel` no longer go through
`t()`, which falls back to the `defaultLocale` row. Each now uses the
spec translator for its type, over every locale the i18n service holds,
with the resolve options the metadata route builds (the reader's
negotiated locale, the declared fallback chain, and the authored
language: `sourceLocale`, else `defaultLocale`):
- position: `translatePosition`, which `GET /meta/position` serves
through `translateMetadataDocument`;
- flow: `translateFlow`. `/meta` serves a flow document untranslated:
`translateFlow` is deliberately not in the dispatch table, and the flow
runner applies it on the client. So `translateFlow` is the spec's one
reading of `flows.FLOW.label`.
- Callers that pick these up with no change: the inbox, the request
page, the generic data door's request rows
(`reader-locale-labels-middleware.ts`), and timeline position notes.
- **Item 3: a renamed packaged object.** `objectLabel` (approvals) and
`translatedObjectDef` (audit) now give `translateObject` the object's
served definition and its packaged base as `packagedBase`. The base
comes from the engine's registry
(`registry.getPackagedObjectBase(name)`). That is the same body the
metadata protocol's `getPackagedObjectBase` reads (`engine.registry`),
and the protocol accessor is how `/meta` and objectstack-ai#36460's share-link label
get `packagedBase`.
- approvals: `readerLabelsFor` takes an optional third argument,
`ReaderObjectSource` (`getSchema`, `registry`).
`ApprovalService.readerLabels` and the two lock-refusal sentences in
`lifecycle-hooks.ts` pass the engine they already hold.
- audit: `installActivitySummaryLocale` reads the base off the engine it
is installed on, and `readerSummaryLocale` takes an optional
`getPackagedObjectBase`.
- No public surface moves. The changed functions and types are internal
modules, not exported from either package's index.
`ApprovalServiceOptions` and `ApprovalEngine` are unchanged. Nothing
under `packages/spec/src/**` or `packages/services/service-messaging/**`
is edited.

## Tests

- `reader-locale-labels.test.ts` (the shared harness), two new top-level
describes:
- Flow and position labels in a `sourceLocale: 'en'` / `defaultLocale:
'zh-CN'` deployment with an `en` pack. First the precondition: `t()`
gives an `en` reader the zh-CN rows. Then `en` and `en-US` readers pick
nothing, so the authored snapshot stands. A pin measures that `en-US` is
negotiated to `en`. Controls: a zh-CN reader, an `en` pack entry, no
`sourceLocale` declared, a `t()`-only service, and one bundle per read.
- A renamed packaged object over a real `SchemaRegistry` (a packaged
`Opportunity` that an extension renames `Deal`). `en`, `en-US` and
`zh-CN` readers read `Deal`, and so does the oracle
`translateMetadataDocument('object', served, bundle, {...options,
packagedBase})`. Controls: an unrenamed object, a registry that throws,
and a `getSchema` that throws.
- Fixture triage (change of spelling): two older `objectstack-ai#24863` cases that
used a `t()`-only double for `flowLabel` now ask `stepLabel`, the one
label still on `t()`.
- `activity-summary-message.test.ts`: a new top-level describe drives
the installed `sys_activity` middleware over a real `SchemaRegistry`.
`en`, `en-US` and `zh-CN` readers get `Deal`, and the zh-CN field label
still translates. Controls: an unrenamed object, and a registry whose
base read throws.

<details><summary>Readings at head 0e31535</summary>

- `pnpm --filter @objectstack/plugin-approvals test`: Test Files 127
passed (127), Tests 1880 passed (1880).
- `pnpm --filter @objectstack/plugin-audit test`: Test Files 109 passed
(109), Tests 1821 passed (1821).
- `pnpm --filter @objectstack/plugin-approvals --filter
@objectstack/plugin-audit typecheck` (tsc, scripts tsconfig,
`check:test-typecheck`): lock VERDICT command-exit 0.
- Ablation. One lock call, `scripts/ablation-replace.mjs` per leg, plus
a trap restore. The subject resolves from `src/` (relative import), so
there is no dist leg.
- leg 1, approvals `objectLabel` without `packagedBase`: 3 failed / 37
(the `en`, `en-US` and `zh-CN` rename cases).
- leg 2, `flowLabel` back on `t()`: 3 failed / 37 (the `en` and `en-US`
authored cases, and the `t()`-only case).
- leg 3, `positionLabel` back on `t()`: 3 failed / 37 (the same three).
- leg 4, audit `translatedObjectDef` without `packagedBase`: 3 failed /
24 (the `en`, `en-US` and `zh-CN` rename cases).
- Each leg: anchor x1 to x0 on disk, then restored with blob equal to
HEAD. Final hashes match HEAD, and `git diff HEAD` is empty.
- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` @0e315358fa: 72 families. 70 exit 0. 2 NOT
MEASURED (exit 3, PREREQUISITE NOT MET): `check:dual-build-cjs-loads`
(needs a full build) and `check:i18n` (needs the built CLI closure); CI
runs both. `--ran`: 72 derived, 70 run, 2 NOT-MEASURED, 0 UNRUN.
- `node scripts/pm/overlap-check.mjs --branch=HEAD` @0e315358fa: VERDICT
clean exit 0.

</details>

## Acceptance notes

- **The approval step label (`flows.FLOW.approvals.NODE.label`) is still
read through `t()`.** No spec translator reads that key: `translateFlow`
overlays the flow label, the toasts and screen copy only. Reading the
bundle along the locale chain inside plugin-approvals would be a second
resolver beside `localeChain`. A spec export would widen
`@objectstack/spec`, which this slice may not do. So an `en` reader in
such a deployment still sees the zh-CN step label next to the authored
flow label. The fork goes to the seat as an open question in the report.
- PM mechanism assumption, measured: `/meta` does not translate flows.
`GET /meta/flow` serves the authored document, so the flow side uses
`translateFlow` (the same translator, with the same resolve options),
not a `/meta` read.
- The packaged base comes from the engine's registry, not from the
`protocol` service. It is the same body, the engine is already in hand
at every caller, and `ApprovalServiceOptions` stays unchanged.
- File surface: `approval-service.ts` (one argument) and
`lifecycle-hooks.ts` (two arguments) are beyond the claim's listed
files. They are the callers that hand `objectLabel` its engine.

## Verification

Read first, by risk:
1. `packages/plugins/plugin-approvals/src/reader-locale-labels.ts`: the
`readerLabelsFor` body (`translated`, `flowLabel`, `positionLabel`,
`objectLabel`).
2. `packages/plugins/plugin-audit/src/activity-summary-message.ts`:
`translatedObjectDef` and `packagedObjectBaseReader`.
3. `packages/plugins/plugin-approvals/src/lifecycle-hooks.ts`: the two
`readerLabelsFor(service, locale, engine)` calls.

Two-minute check: `pnpm --filter @objectstack/plugin-approvals exec
vitest run src/reader-locale-labels.test.ts` should report 37 passed.
The `[objectstack-ai#35384]` describes cover `en` and `en-US` readers with authored
flow and position labels, and the rename `Deal` in every locale.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01ADHkmPTDM2MxHR8cvoMVUX
<!-- signed: repo:objectstack#2 · os-steve ·
session_01ADHkmPTDM2MxHR8cvoMVUX -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

share-link resolve answer carries no object label and no field hidden flag, so the landing page prints the API name and can list hidden columns

2 participants