Skip to content

feat(console): action dialogs draw declared notices; the invite dialogs warn when this server delivers no mail - #39248

Draft
objectstack-fleet[bot] wants to merge 6 commits into
mainfrom
claude/project-thread-lk8ab5
Draft

objectstack-fleet[bot] wants to merge 6 commits into
mainfrom
claude/project-thread-lk8ab5

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread

repo:objectstack@os-bill · os-bill · session_01Utp6Cb9JFbMTwmocV9qxio

Fixes #39045

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

维护者速读

  • 用户能看到什么变化:服务器没配邮件时,「邀请用户」和「重新发送邀请」对话框在提交前就显示一条警告:不会发出邮件,谁还能接受邀请,其余人需由平台管理员建号。配了邮件就不显示。
  • 为什么做:落实裁决 A(评论 7359751238)的消费端:动作声明的 notices 由控制台在确认框和参数框里画出来,邀请动作采用它,并同步更新 emailDelivery 的功能登记。
  • 出错会怎样:提示只是展示,不拦任何操作;条件算不出来时不画(fail-closed)并在浏览器控制台报一次;可直接撤回本次改动。
  • 要你做什么:无。

What changes

Ruling A on #39045 (comment 7359751238) gave actions a general dialog notice key, ActionSchema.notices, which landed spec-side in #39201. This PR is the consumer half: the console draws the key, the invite actions adopt it, and the emailDelivery registry entry books the reads (ruling term 6).

The console draws notices (ui/packages/**):

  • ActionRunner (core) hands an action's notices, in declared order and named, to the dialog the action opens before it runs, beside the record the dispatch runs against (the row for a row dispatch, else the page record). A param-less action with confirmText gets them in the confirm handler's options (notices). An action with params gets them in the param-collection handler's new 6th argument, and then never in the confirm too. The runner judges no condition.
  • ActionDialogNoticeList (app-shell, new views/ActionDialogNotices.tsx) draws each notice between the dialog's title and its description, in both ActionConfirmDialog and ActionParamDialog. severity picks the tone and icon from the notification surfaces' one severity table (notificationSeverityStyle, now exported from @object-ui/components); info when omitted.
  • Conditions: no declared visible draws the notice, a boolean is its own verdict, anything else is evaluated by evalRowPredicate against the dispatch's record plus the host predicate scope (features, the signed-in user). Fail-closed and loud: a condition that cannot be evaluated draws nothing and warns once, naming the notice and the action (approved by the seat on the claim).
  • Localisation is bundle-first at objects.<object>._actions.<action>.notices.<notice>.title|body (useObjectLabel().actionNoticeText), then the authored text. The confirm path resolves it in useActionTextLocalizer (localizeActionNotices); the console's two param-collection handlers (useConsoleActionRuntime, RecordDetailView) share localizeDialogNotices, so they cannot drift.
  • The four action renderers (action-button, action-icon, action-group, action-menu) forward the key; @object-ui/types ActionSchema carries it; the forward-order pins list it.

Invite User and Resend Invitation warn first (packages/platform-objects):

  • MAIL_NOT_DELIVERED_NOTICES (beside the invite outcome messages) declares mail_not_delivered, severity: 'warning', visible: has(features.emailDelivery) && features.emailDelivery != true. The has() conjunct keeps it off a host that has not received the flag, rather than leaning on fail-closed for the common case.
  • Adopted by the four invite_user actions (sys_user, sys_member, sys_invitation, sys_organization) and sys_invitation.resend_invitation. The invitation is still created, and the post-submit toast still reports the link_only outcome.
  • Translated in all ten shipped locales (generated bundles regenerated; source-hash entries clear).

The feature registry books notice reads (packages/spec/src/kernel/public-auth-features.ts):

  • PublicAuthFeatureEntry gains optional noticePaths (<object>.actions.<action>.notices.<name>). A notice gates nothing, so it is booked apart from gatedInputs; emailDelivery stays an exempt, opt-in, login-surface flag, with its exempt reason rewritten to say it now also draws the invite notices (display only).
  • feature-gate-guard.test.ts checks both directions: every booked path is a declared notice whose condition reads the flag, and every features.* read in any notice condition is booked; a walker floor keeps both loops non-vacuous.

Liveness and docs: the notices row in packages/spec/liveness/action.json (and its children) moves from planned to live, with the console read points as evidence; gen:liveness-counts regenerated. content/docs/protocol/objectui/actions.mdx: only its notices section (Planned callout removed, the both-dialogs and fail-closed rules, the platform adoption).

Changeset: patch for @objectstack/spec, @objectstack/platform-objects and six @object-ui/* packages. Clause-②: yes (widening): new exported names and members, none removed (PublicAuthFeatureEntry.noticePaths; notificationSeverityStyle from @object-ui/components; ActionNoticeDef, ActionDialogNotice, ActionDialogNotices and the param handler's notices argument in @object-ui/core; localizeActionNotices in @object-ui/react; useObjectLabel().actionNoticeText; notices on @object-ui/types ActionSchema). No metadata author can write anything new, so Metadata-protocol: none and patch.

Tests

  • ui/packages/core/src/actions/__tests__/ActionRunner.dialogNotices-39045.test.ts (6): confirm options shape and order, row record over page record, no record, no-notices control, param action gets them in argument 6 and not the confirm, param control.
  • ui/packages/app-shell/src/views/ActionDialogNotices.notices-39045.test.tsx: drawn while mail is off; not while on; not while the flag is absent (has()); boolean and absent conditions; the record read; fail-closed warning naming notice and action; declared order; bundle-first localisation and inline locale maps; both dialogs render the notice above the description, with controls.
  • packages/platform-objects/src/feature-gate-guard.test.ts: the new two-way noticePaths describe. packages/spec/src/kernel/public-auth-features.test.ts: noticePaths grammar.
  • Pin updates: useObjectLabel member count 33 → 34; renderer forward-order pins.

Acceptance notes

  • Features refresh after mail is configured (follow-up for the seat to file). AppContent reads features once per mount (getAuthConfig effect). An admin who configures mail and returns to the invite dialog in the same session still sees the notice until a reload. The notice errs toward the old state for one session; no wrong action follows because it gates nothing.
  • The gate run used base 724b3695; main was merged afterwards (no overlapping files) and the generated-artefact gates re-ran on the merged tree.

Verification

  • Derived gate families for this file surface (scripts/pm/dispatch-gates.mjs), 122 commands, base 724b3695: 118 passed first time. List: /mnt/project-files/card-39045/gates-ran-015998c0.txt (card-thread file).
    • pnpm --dir ui exec vitest run scripts/ was OOM-killed in this container at the default worker count; re-run with --maxWorkers=2: 172 files, 5159 tests passed.
    • check:skill-examples refused (exit 3, client-react unbuilt); after building it: 344 prose examples type-check.
    • check:dual-build-cjs-loads refused (exit 3, unbuilt packages outside this diff) and check-plugin-teardown-shape --self-test refused (exit 3, fixture commit unreachable from a shallow clone). Nothing was measured by either; CI answers both.
  • After merging main (5a0bb8dd, no file overlap): check:liveness, check:generated and check-i18n-bundles re-ran green.
  • Targeted: UI suites 242 files / 2812 tests; platform-objects 132 files / 2352 tests; spec registry tests; typechecks of core, types, i18n, react, components, app-shell; check:action-forward-parity, check:handler-key-reads, eslint.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Utp6Cb9JFbMTwmocV9qxio

@github-actions github-actions Bot added size/xl 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 Dec 3, 2026
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/platform-objects, @objectstack/spec, touching 8 documentable anchor(s). ⚠️ 2 changed file(s) yielded no anchor (packages/spec/liveness/action.json, packages/spec/liveness/state-counts/action.md), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

21 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 1fe9c6287f2f058c7d1f1972cdfa4ebcd58803b6.

⛔ 11 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 2 changed file(s) yielded no anchor (packages/spec/liveness/action.json, packages/spec/liveness/state-counts/action.md) — pages documenting those are invisible to this run
  • 1 anchor(s) matched too much of the corpus to be a work list: sys_user (symbol, 60 pages)
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 71 of 256 client-bound route-ledger rows — the other 185 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 185: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 60 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 125 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 — 183 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 1fe9c6287f2f058c7d1f1972cdfa4ebcd58803b6 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from e520f7af8b811e7dbc8d832a13cf25d066e2d11a — the merge of head 015998c057c6ea5fa29afaed961f52c419a44150 into base 1fe9c6287f2f058c7d1f1972cdfa4ebcd58803b6, 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 e520f7af8b811e7dbc8d832a13cf25d066e2d11a && git checkout e520f7af8b811e7dbc8d832a13cf25d066e2d11a
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 1fe9c6287f2f058c7d1f1972cdfa4ebcd58803b6 015998c057c6ea5fa29afaed961f52c419a44150 && git checkout -B drift-repro 1fe9c6287f2f058c7d1f1972cdfa4ebcd58803b6 && git merge --no-ff 015998c057c6ea5fa29afaed961f52c419a44150

node scripts/docs-audit/affected-docs.mjs --json 1fe9c6287f2f058c7d1f1972cdfa4ebcd58803b6

⚠️ 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 1fe9c6287f2f058c7d1f1972cdfa4ebcd58803b6 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

… pin the mail notice's condition

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

This branch has not been deployed

No deployments
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/xl 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.

Invite user: the dialog does not warn that mail is not configured; the invite is created and only then reported as undeliverable

2 participants