Skip to content

Commit 3684d18

Browse files
feat(spec): ActionSchema.preflight, a declared same-origin read shown in the param dialog before submit (#31859)
<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbFVf7GDTdiXTXLqC5MVJbvu)_ Fixes #31840 Clause-②: yes (widening) Metadata-protocol: added Skills-docs: follow-up #31860 ## 维护者速读 - 改了什么:动作(action)新增可选键 `preflight`:参数对话框提交前先发一个同源 GET,把答复显示在参数上方,并可把答复里的值填进指定参数(只读、照原样提交)。同源规则从页面元素的接口读取里搬到一个共享模块,两边共用一套。 - 为什么改:云端安装/升级要在确认前先给用户看「这次会改什么」,并把确认令牌带进提交;现在动作没有任何声明方式。本 PR 只做 spec 一半,控制台在 #31808 里读它。 - 风险与回滚:纯新增,旧元数据解析结果不变;页面元素读取的接受集、提示文字与 JSON Schema 逐字节不变(差分 2208 个输入 0 差异)。回滚即 revert 本 PR。新键在活性账本里是 planned,控制台未读之前作者写了也看不到效果。 - 先看:`packages/spec/src/ui/action.zod.ts`(`preflight` 键与 `refusePreflightContradictions` 七类拒收)、`packages/spec/src/ui/same-origin-api-read.ts`(共享规则)、`packages/spec/src/ui/page.zod.ts`(只改为引用共享模块)。 - 两分钟验证:`pnpm --filter @objectstack/spec exec vitest run src/ui/action-preflight.test.ts src/ui/page-element-api-data-source.test.ts`,预期全绿。 - 需要你做的:无,席位落地。 ## What changes - **`ActionSchema.preflight`** (`packages/spec/src/ui/action.zod.ts`): `{ read: { url, method? }, path?, fields?, seed? }`, the shape the card body declares. `fields` is built from the same row as `resultDialog.fields` (`actionAnswerFieldRow` plus one shared format set `ACTION_ANSWER_FIELD_FORMATS`), so the two cannot drift; `resultDialog`'s JSON Schema and parse are unchanged (measured below). - **Refused at parse, each at its own issue path:** 1. `read.url` not a same-origin API path (scheme, `//`, backslash, space or control, relative), the class named; projects as `pattern`. A URL opening with a hole gets its own sentence. 2. `read.method` other than `GET`. 3. A credential key (`headers`, `auth`, `authorization`, `token`, `credentials`, `apiKey`), `body`, `params`, `title` or any unknown key, with guidance. 4. A hole outside `${param.NAME}` / `${ctx.recordId}` / `${ctx.record.FIELD}` (`${result.*}` named), an unterminated hole, or a `${param.NAME}` naming no declared param. 5. `preflight` on an action with no non-empty `params`. 6. A `seed.param` naming no declared param, a param seeded twice, a seeded param that declares `defaultValue` / `defaultFromRow` / `carryOver`, a seeded param a hole reads. 7. `preflight` beside `execution: 'aggregate'` (the seat's ruling in the Claim). - **One shared same-origin module** (`packages/spec/src/ui/same-origin-api-read.ts`, import-free, package-internal): the URL regex, the class-naming refusal (subject passed in), the response-path regex and the no-credentials text. `page.zod.ts` imports it; the page element's accept set, messages and published `pattern` are byte-identical. - **Liveness:** `preflight` is `planned` in `packages/spec/liveness/action.json`, consumer #31808, with its children drilled (`check:liveness` requires it). - **Form:** an `omit` row in `metadata-form-zod-reconciliation.test.ts` on the `pressed` planned precedent; `action.form.ts` unchanged. - **Docs:** a `preflight` section in `content/docs/protocol/objectui/actions.mdx`, marked planned. - **Regenerated:** `content/docs/references/**` (3), `authorable-surface/ui.json`, `liveness/state-counts/action.md`, `docs/audits/2026-07-unknown-key-strictness-ledger.counts/ui.md`. - **Changesets:** `minor` on `@objectstack/spec`; `patch` on `@object-ui/core` for the one inventory line. - **ui inventory:** `'preflight'` in `SPEC_ACTION_KEYS` (`ui/packages/core/src/actions/actionKeys.ts`); `ActionDef`, the runner and the console are untouched. ## Tests Head `5e02b708c` (branch merged with `origin/main` `31ae944b4`; no `packages/spec` change came in, so the spec build and readings below stand). - `packages/spec/src/ui/action-preflight.test.ts` (new, 57 cases): the cloud-shaped example parses and is kept as written; the closed hole set and a `field`-named param are admitted; refusals 1 to 7, each asserted on code + issue path and on the slot or class the message names; the published `pattern`; an inline action does not pick the key. - `packages/spec/src/ui/page-element-api-data-source.test.ts` (one new top-level `describe`): the page element's five class messages, the `path` and `method` refusals and the credential guidance, whole, as they read before the move, and the published `pattern` source. - `packages/spec/src/system/metadata-form-zod-reconciliation.test.ts`: the `omit` row for `action.preflight`. - `ui/packages/core/src/actions/actionKeys.ts`: `'preflight'` in `SPEC_ACTION_KEYS` (Claim amend 2), so the inventory pin stays green. <details><summary>Readings</summary> - `pnpm --filter @objectstack/spec exec vitest run --project local --maxWorkers=2` (under the verify lock): Test Files 828 passed (828), Tests 26192 passed, 1 todo. VERDICT command-exit 0. - `pnpm --filter @objectstack/spec exec vitest run src/ui/action-preflight.test.ts src/ui/page-element-api-data-source.test.ts`: 2 files, 123 tests passed. - spec `repo` project, the 13 files naming liveness, action, page or form: 13 passed, 308 tests. - Consumer `@objectstack/lint`: `vitest run`, Test Files 197 passed, Tests 8365 passed. - Consumer `@object-ui/core`: `vitest run packages/core/src/actions/` from `ui/`, Test Files 55 passed, Tests 755 passed. Before the inventory line: `actionKeys.pin.test.ts` failed with `missing: ['preflight']` (1 failed / 18 passed). - **Page element byte-identity, differential** (scratch, not committed): `page.zod.ts` at `cc16008a` copied beside the new one, `ElementApiDataSourceSchema.safeParse` compared on 2208 inputs (23 URLs including non-strings, 8 read shapes, 4 paths, 3 top-level extras): **0 differences**; `z.toJSONSchema` equal. - **`resultDialog` unchanged, differential**: `ActionSchema` at `cc16008a` vs now, input JSON Schema: `resultDialog` equal, the only added property is `preflight`, no other property changed; a `resultDialog` fixture with an alias and a bad format parses to the same result. - **Ablation** (`node scripts/ablation-replace.mjs`, the anchor `.superRefine(refusePreflightContradictions)` 1 to 0): `action-preflight.test.ts` 18 failed / 39 passed; restored to the HEAD blob `c028a358ec5a`. </details> ## Acceptance notes - **PM premise measured, partly disproven:** the runner's hole parser (`substituteScopeTokens`, `ui/packages/core/src/actions/ActionRunner.ts`) is module-private in `@object-ui/core`, and `@objectstack/spec` has no workspace dependencies, so the spec cannot import it. The spec declares the closed set itself, spelled to the runner's `${SCOPE.PATH}` token (`PATH` `[\w.]+`), in `preflightHoleParam`. No second spec-side parser existed before (searched `packages/spec/src` for a hole regex: none). - **New exports: none.** The shared module is not re-exported from the `ui` barrel and the preflight schema is inline in `ActionSchema`, so `check:api-surface` does not move. The console half re-judges stored metadata with `ActionSchema`, not with the regex. - `fields[].path` keeps `resultDialog.fields`' unconstrained `path` string (the row is reused as is); `preflight.path` and `seed[].path` use the dotted response-path regex. ## Verification <details><summary>Derived gates (dispatch-gates --commands, 112 families)</summary> - 111 run, exit 0. `check:dual-build-cjs-loads` exit 3 (PREREQUISITE NOT MET), left to CI (`dispatch-gates --ran`: 112 derived, 111 run, 1 NOT-MEASURED, 0 UNRUN). - `check:doc-formula-expressions`, `check:doc-security-posture` and `check:skill-examples` first answered exit 3 (unbuilt `@objectstack/formula` / `lint` / `client-react`); after `turbo run build --filter=@objectstack/lint --filter=@objectstack/client-react` (43 tasks) all three exit 0. - `pnpm --filter @objectstack/spec check:generated`: all 14 generated artefacts up to date, after `gen:docs`, `gen:strictness-ledger` and `gen:liveness-counts`; `check:api-surface` green with no regeneration (no new export). - `check:liveness` required drilling `preflight`'s children (all `planned`) rather than a baseline row. </details> Deviations from the Claim's first surface, both ruled by the seat: `docs/audits/2026-07-unknown-key-strictness-ledger.counts/ui.md` (pure `gen:strictness-ledger` regeneration, amend 1) and `ui/packages/core/src/actions/actionKeys.ts` with its `patch` changeset `.changeset/31840-action-keys-preflight.md` on the precedent of the `pressed` spec PR (amend 2). --- _Generated by [Claude Code](https://claude.ai/code/session_01QsR2jRzeonr7DwHQMQLRRu)_ <!-- signed: domain:spec#2 · zhuangjianguo · session_01QsR2jUe9c6YdtNkrzUnMUd --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent ef4af73 commit 3684d18

19 files changed

Lines changed: 1015 additions & 117 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@object-ui/core': patch
3+
---
4+
5+
`SPEC_ACTION_KEYS` lists `preflight`, the param dialog's preflight read `@objectstack/spec` added to `ActionSchema`. An action that carries it is no longer counted as having an unknown key, and the inventory pin stays green. No surface reads the key yet.
6+
7+
Clause-②: no
8+
Metadata-protocol: none
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@objectstack/spec': minor
3+
---
4+
5+
feat(spec): an action declares `preflight`, one same-origin `GET` its param dialog shows before submit, with answer-to-param seeding
6+
7+
Clause-②: yes (widening)
8+
Metadata-protocol: added
9+
Skills-docs: follow-up owed — skills/objectstack-ui/rules/actions.md (documents the action keys; no `preflight` line yet)
10+
11+
- **`ActionSchema.preflight`** — `{ read: { url, method? }, path?, fields?, seed? }`. The param dialog sends one `GET` to `read.url`, shows the answer (or the sub-tree `path` selects, through `fields` in `resultDialog.fields`' own row and format set) above the params, and writes each `seed` entry's value into the named param, which the user does not type. The key is `planned` in the liveness ledger: it parses and is judged at parse today, and no param dialog reads it until the console half lands.
12+
- **One same-origin rule.** `read.url` is held to the rule a page element's `api` data source reads under: it opens with a single `/`, and a scheme, `//host`, a backslash read as a slash, a space or control character, and a relative path are refused at parse with the class named. The rule moved into one module both schemas import; the page element's accept set, its messages and its published `pattern` are unchanged.
13+
- **Refused at parse, each at its own path:** a `method` other than `GET`; a credential key (`headers`, `auth`, `authorization`, `token`, `credentials`, `apiKey`), `body`, `params` or any unknown key; a hole outside `${param.NAME}`, `${ctx.recordId}` and `${ctx.record.FIELD}` (`${result.*}` included), an unterminated `${`, or a `${param.NAME}` naming no declared param; `preflight` on an action with no non-empty `params`, or beside `execution: 'aggregate'`; a `seed.param` naming no declared param, a param seeded twice, a seeded param that also declares `defaultValue`, `defaultFromRow` or `carryOver`, and a seeded param a hole reads.
14+
15+
Nothing an author wrote before changes meaning: the key is new, and every value that parsed before parses to the same thing.

‎content/docs/protocol/objectui/actions.mdx‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ interface Action {
232232
params?: ActionParam[]; // Inputs collected before execution
233233
submitText?: I18nLabel; // The param dialog's submit button verb (default "Confirm")
234234
cancelText?: I18nLabel; // The confirm or param dialog's dismiss button label (default "Cancel")
235+
preflight?: Preflight; // A same-origin GET the param dialog shows before submit (planned: not drawn yet)
235236
method?: 'POST' | 'PATCH' | 'PUT' | 'DELETE'; // for type: 'api'
236237
237238
// UX
@@ -562,6 +563,39 @@ cancelText: Keep invitation
562563
- `cancelLabel` (the button's spelling on the console's `form` and `alert-dialog` renderers) is refused with a rename to `cancelText`.
563564
- The console draws it on the dismiss button of both dialogs, from the translation bundle first and then the authored text. Without it, the button says **Cancel**. `sys_invitation`'s **Cancel Invitation** action declares **Keep invitation**.
564565

566+
### Showing a server read before submit: `preflight`
567+
568+
> **Planned.** The key parses and is judged at parse today, but the console's param dialog does not send the read, draw the panel or fill a param yet. Declaring it now changes nothing an author sees until that reader lands.
569+
570+
Some actions need the user to see what the server says before they confirm: an upgrade that lists the schema changes it will make, and that wants a confirmation token from the same answer submitted with the action. `preflight` declares that read. The param dialog sends one `GET`, shows the answer above the params, and can fill params from it.
571+
572+
```yaml
573+
name: install_package
574+
label: Install Package
575+
type: api
576+
target: /api/v1/cloud/packages/${ctx.recordId}/install
577+
params:
578+
- { name: environment_id, type: lookup, reference: sys_environment, required: true }
579+
- { name: version, type: text, required: true }
580+
- { name: confirm_schema_upgrade, label: Schema change confirmation, type: text, required: true }
581+
preflight:
582+
read:
583+
url: /api/v1/cloud/packages/${ctx.recordId}/upgrade-plan?environment_id=${param.environment_id}&version=${param.version}
584+
path: data
585+
fields:
586+
- { path: findings, label: Schema findings, format: json }
587+
seed:
588+
- { param: confirm_schema_upgrade, path: verdict.findingSet }
589+
```
590+
591+
- **`read.url` is a same-origin API path**, under the rule a page element's `api` data source follows: it opens with a single `/`. An absolute URL of any scheme, `//host`, a backslash read as a slash, a space or control character, and a relative path are refused at parse, and the message names which. `method` is `GET` or omitted.
592+
- **No credential is written.** The console reads the endpoint with its own signed-in fetch, so `headers`, `auth`, `authorization`, `token`, `credentials` and `apiKey` are refused, and so are `body` and `params` (write query parameters into the path).
593+
- **Holes are closed** to `${param.NAME}` (a param this action declares), `${ctx.recordId}` and `${ctx.record.FIELD}`, each value percent-encoded. `${result.*}` is refused because there is no answer before the read, and so is every other hole.
594+
- **`path`** selects the part of the answer to use (`data` in a `{ success, data }` envelope). **`fields`** picks what the panel shows, with the same row and formats as `resultDialog.fields`. Without `fields`, the selected answer is shown as JSON. There is no `title`: the panel has a generic heading.
595+
- **`seed`** writes the value at each `path` into the named param, which the dialog draws read-only and submits as shown. A seeded param is declared in `params`, is seeded once, declares no `defaultValue`, `defaultFromRow` or `carryOver`, and is read by no hole of the URL. Mark it `required` so Confirm waits for the answer.
596+
- **Only where a param dialog opens.** An action with no `params` (or an empty list) is refused, as `submitText` is. So is an action with `execution: 'aggregate'`, because the grid's bulk dialog has no single record to read.
597+
- A preflight is UX, not authorization. The action's endpoint must still check what a seeded param carries.
598+
565599
## AI Tool Exposure (ADR-0011)
566600

567601
An action can be exposed as an AI-callable tool. Exposure is **opt-in and default off** — set `ai.exposed: true`, which then **requires** `ai.description` (≥ 40 chars, the LLM-facing contract).

‎content/docs/references/data/object.mdx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,7 @@ const result = ApiMethod.parse(data);
504504
| **refreshAfter** | `boolean` | optional (default: `false`) | Refresh view after execution |
505505
| **undoable** | `boolean` | optional | Offer an Undo affordance after this single-record update action succeeds. `operation: 'update'` is the one declared operation and the declared form of that action: what the undo captures is the prior value of EVERY field the action writes — the merged write bag, `patch` UNDER the collected `params`, not `patch` alone. An action with no `operation` declares no write set here, but `type: 'api'` is fulfilled by the console, which builds the undo envelope from `undoable` alone. Those two shapes — `operation: 'update'` and `type: 'api'` — are the whole fulfillable set; on a registered action `undoable` beside any other shape is refused, because nothing would anchor the capture. |
506506
| **resultDialog** | `{ title?: string \| Record<string, string>; description?: string \| Record<string, string>; acknowledge?: string \| Record<string, string>; format?: Enum<'qrcode' \| 'code-list' \| 'secret' \| 'text' \| 'json'>; … }` | optional | Render API response in a one-shot reveal dialog (suppresses successMessage when set). |
507+
| **preflight** | `{ read: object; path?: string; fields?: object[]; seed?: object[] }` | optional | Preflight read for the action's param dialog: `{ read: { url }, path?, fields?, seed? }` sends one same-origin `GET` (holes `${param.NAME}`, `${ctx.recordId}`, `${ctx.record.FIELD}`) before submit, shows the selected answer above the params and fills the `seed` params from it. Only on an action with a non-empty `params`, and not beside `execution: 'aggregate'`. UX, not authorization: the action's endpoint still judges what it receives. |
507508
| **visible** | `boolean \| string \| { dialect: Enum<'cel' \| 'cron' \| 'template'>; source: string; ast?: any; meta?: object }` | optional | Visibility predicate — `true`/`false` literal, CEL string, or `{dialect, source}` envelope. The action is offered when it evaluates TRUE. Omit = always visible. |
508509
| **requiresFeature** | `Enum<'twoFactor' \| 'organization' \| 'multiOrgEnabled' \| 'degradedTenancy' \| …>` | optional | Public auth feature flag gating this action; lowered into `visible` at parse time. |
509510
| **requiresMembershipReach** | `Enum<'invite_member' \| 'cancel_invitation' \| 'update_member_role' \| …>` | optional | Organization endpoint (a MEMBERSHIP_REACH row) whose membership-grade gate this action follows; lowered into `visible` over current_user.positions at parse time. |

‎content/docs/references/kernel/metadata-plugin.mdx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ const result = MetadataBulkResultSchema.parse(data);
346346
| **refreshAfter** | `boolean` | optional (default: `false`) | Refresh view after execution |
347347
| **undoable** | `boolean` | optional | Offer an Undo affordance after this single-record update action succeeds. `operation: 'update'` is the one declared operation and the declared form of that action: what the undo captures is the prior value of EVERY field the action writes — the merged write bag, `patch` UNDER the collected `params`, not `patch` alone. An action with no `operation` declares no write set here, but `type: 'api'` is fulfilled by the console, which builds the undo envelope from `undoable` alone. Those two shapes — `operation: 'update'` and `type: 'api'` — are the whole fulfillable set; on a registered action `undoable` beside any other shape is refused, because nothing would anchor the capture. |
348348
| **resultDialog** | `{ title?: string \| Record<string, string>; description?: string \| Record<string, string>; acknowledge?: string \| Record<string, string>; format?: Enum<'qrcode' \| 'code-list' \| 'secret' \| 'text' \| 'json'>; … }` | optional | Render API response in a one-shot reveal dialog (suppresses successMessage when set). |
349+
| **preflight** | `{ read: object; path?: string; fields?: object[]; seed?: object[] }` | optional | Preflight read for the action's param dialog: `{ read: { url }, path?, fields?, seed? }` sends one same-origin `GET` (holes `${param.NAME}`, `${ctx.recordId}`, `${ctx.record.FIELD}`) before submit, shows the selected answer above the params and fills the `seed` params from it. Only on an action with a non-empty `params`, and not beside `execution: 'aggregate'`. UX, not authorization: the action's endpoint still judges what it receives. |
349350
| **visible** | `boolean \| string \| { dialect: Enum<'cel' \| 'cron' \| 'template'>; source: string; ast?: any; meta?: object }` | optional | Visibility predicate — `true`/`false` literal, CEL string, or `{dialect, source}` envelope. The action is offered when it evaluates TRUE. Omit = always visible. |
350351
| **requiresFeature** | `Enum<'twoFactor' \| 'organization' \| 'multiOrgEnabled' \| 'degradedTenancy' \| …>` | optional | Public auth feature flag gating this action; lowered into `visible` at parse time. |
351352
| **requiresMembershipReach** | `Enum<'invite_member' \| 'cancel_invitation' \| 'update_member_role' \| …>` | optional | Organization endpoint (a MEMBERSHIP_REACH row) whose membership-grade gate this action follows; lowered into `visible` over current_user.positions at parse time. |

‎content/docs/references/ui/action.mdx‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ const result = ActionSchema.parse(data);
5454
| **refreshAfter** | `boolean` | optional (default: `false`) | Refresh view after execution |
5555
| **undoable** | `boolean` | optional | Offer an Undo affordance after this single-record update action succeeds. `operation: 'update'` is the one declared operation and the declared form of that action: what the undo captures is the prior value of EVERY field the action writes — the merged write bag, `patch` UNDER the collected `params`, not `patch` alone. An action with no `operation` declares no write set here, but `type: 'api'` is fulfilled by the console, which builds the undo envelope from `undoable` alone. Those two shapes — `operation: 'update'` and `type: 'api'` — are the whole fulfillable set; on a registered action `undoable` beside any other shape is refused, because nothing would anchor the capture. |
5656
| **resultDialog** | `{ title?: string \| Record<string, string>; description?: string \| Record<string, string>; acknowledge?: string \| Record<string, string>; format?: Enum<'qrcode' \| 'code-list' \| 'secret' \| 'text' \| 'json'>; … }` | optional | Render API response in a one-shot reveal dialog (suppresses successMessage when set). |
57+
| **preflight** | `{ read: object; path?: string; fields?: object[]; seed?: object[] }` | optional | Preflight read for the action's param dialog: `{ read: { url }, path?, fields?, seed? }` sends one same-origin `GET` (holes `${param.NAME}`, `${ctx.recordId}`, `${ctx.record.FIELD}`) before submit, shows the selected answer above the params and fills the `seed` params from it. Only on an action with a non-empty `params`, and not beside `execution: 'aggregate'`. UX, not authorization: the action's endpoint still judges what it receives. |
5758
| **visible** | `boolean \| string \| { dialect: Enum<'cel' \| 'cron' \| 'template'>; source: string; ast?: any; meta?: object }` | optional | Visibility predicate — `true`/`false` literal, CEL string, or `{dialect, source}` envelope. The action is offered when it evaluates TRUE. Omit = always visible. |
5859
| **requiresFeature** | `Enum<'twoFactor' \| 'organization' \| 'multiOrgEnabled' \| 'degradedTenancy' \| 'oidcProvider' \| 'sso' \| 'ssoEnforced' \| 'deviceAuthorization' \| 'admin' \| 'phoneNumber' \| … +3 more>` | optional | Public auth feature flag gating this action; lowered into `visible` at parse time. |
5960
| **requiresMembershipReach** | `Enum<'invite_member' \| 'cancel_invitation' \| 'update_member_role' \| 'transfer_ownership' \| 'remove_member' \| 'create_team' \| 'update_team' \| 'remove_team' \| … +4 more>` | optional | Organization endpoint (a MEMBERSHIP_REACH row) whose membership-grade gate this action follows; lowered into `visible` over current_user.positions at parse time. |
@@ -167,6 +168,15 @@ L2 sandboxed JS body — runs inside an isolated VM with declared capabilities
167168
| **format** | `Enum<'qrcode' \| 'code-list' \| 'secret' \| 'text' \| 'json'>` | optional | Default format for fields without their own format. Defaults to json when omitted. |
168169
| **fields** | `{ path: string; label?: string \| Record<string, string>; format?: Enum<'qrcode' \| 'code-list' \| 'secret' \| 'text' \| 'json'> }[]` | optional | Which fields from result.data to render. Omit to dump full JSON. |
169170

171+
### Nested Shape: `Action.preflight`
172+
173+
| Property | Type | Required | Description |
174+
| :--- | :--- | :--- | :--- |
175+
| **read** | `{ url: string; method?: 'GET' }` | ✅ | The read request — the same-origin endpoint the preflight reads |
176+
| **path** | `string` | optional | Dotted path selecting the sub-tree of the answer the preflight shows and seeds from, e.g. `data` in a `{ success, data }` envelope; omitted, the whole answer |
177+
| **fields** | `{ path: string; label?: string \| Record<string, string>; format?: Enum<'qrcode' \| 'code-list' \| 'secret' \| 'text' \| 'json'> }[]` | optional | Which values of the selected answer the panel shows, in `resultDialog.fields`' row and format set. Omit to show the selected answer as JSON. |
178+
| **seed** | `{ param: string; path: string }[]` | optional | Answer-to-param seeding: each entry writes the value at `path` in the selected answer into the named param, which the dialog draws read-only and submits as shown. Each param is seeded once. |
179+
170180
### Nested Shape: `Action.ai`
171181

172182
| Property | Type | Required | Description |

‎docs/audits/2026-07-unknown-key-strictness-ledger.counts/ui.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The `strict` column is the one the campaign schedules against; it counts both th
2121

2222
| Dir | Sites | strict | passthrough | catchall | strip |
2323
|---|---|---|---|---|---|
24-
| `ui/` | 218 | 209 | 4 | 0 | 5 |
24+
| `ui/` | 221 | 212 | 4 | 0 | 5 |
2525

2626
## `ui/` — sites
2727

@@ -32,7 +32,7 @@ classify and is not listed (it becomes reportable the day it grows its first sit
3232
| File | Sites |
3333
|---|---|
3434
| `action-params.zod.ts` | 1 |
35-
| `action.zod.ts` | 9 |
35+
| `action.zod.ts` | 12 |
3636
| `app.zod.ts` | 20 |
3737
| `bulk-action.zod.ts` | 4 |
3838
| `chart.zod.ts` | 8 |
@@ -46,23 +46,23 @@ classify and is not listed (it becomes reportable the day it grows its first sit
4646
| `sharing.zod.ts` | 1 |
4747
| `view.zod.ts` | 59 |
4848
| `widget.zod.ts` | 1 |
49-
| **total** | **218** |
49+
| **total** | **221** |
5050

5151
## `ui/` — open
5252

5353
Per file, how many of its sites still silently discard unknown keys. The `Class`
5454
column that decides the bucket split is hand-written in the ledger; the arithmetic
5555
over it is here.
5656

57-
**5 strip of 218**, in 4 file(s).
57+
**5 strip of 221**, in 4 file(s).
5858

5959
| File | Strip | Sites |
6060
|---|---|---|
6161
| `action-params.zod.ts` | 1 | 1 |
6262
| `app.zod.ts` | 1 | 20 |
6363
| `view.zod.ts` | 2 | 59 |
6464
| `widget.zod.ts` | 1 | 1 |
65-
| **total** | **5** | **218** |
65+
| **total** | **5** | **221** |
6666

6767
| Bucket | Sites |
6868
|---|---|

‎packages/metadata-protocol/src/protocol.meta-types-degenerate-derivation.test.ts‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@
9191
* a derivation chosen for convenience would not cover the served path at all —
9292
* that is precisely the gap #17500's `io: 'input'` pin deliberately left open.
9393
*/
94+
// `@objectstack/lint` is reached through the save door's author-time gate, a
95+
// dynamic `import()` (`metadata-diagnostics.ts`). Paid here, at collection, so no
96+
// case's `testTimeout` window pays that first load
97+
// (`scripts/check-test-source-alias.mjs`, "The source reach").
98+
import '@objectstack/lint';
9499
import { describe, expect, it } from 'vitest';
95100
import { z } from 'zod';
96101
// [#5619] The producer's OWN write-verb dispatch decisions, so the fake engine
@@ -265,10 +270,12 @@ describe('#17501 — /meta/types serves a real schema for `action`, and moves no
265270
// [#28519] 51 → 52: `cancelText` (the dismiss button label of the
266271
// action's confirm or param dialog) joined the accepted set, and the
267272
// sample names it.
268-
expect(Object.keys(properties).length + retiredTopLevelCount('action')).toBe(52);
273+
// [#31840] 52 → 53: `preflight` (the same-origin read the param dialog
274+
// shows before submit) joined the accepted set, and the sample names it.
275+
expect(Object.keys(properties).length + retiredTopLevelCount('action')).toBe(53);
269276
// A sample an author would actually address, and the one #17500's
270277
// repeater titles need a node to sit on.
271-
for (const key of ['name', 'label', 'objectName', 'type', 'params', 'locations', 'outcomeMessages', 'requiresMembershipReach', 'disabledReason', 'pressed', 'submitText', 'cancelText', 'overrides']) {
278+
for (const key of ['name', 'label', 'objectName', 'type', 'params', 'locations', 'outcomeMessages', 'requiresMembershipReach', 'disabledReason', 'pressed', 'submitText', 'cancelText', 'overrides', 'preflight']) {
272279
expect(Object.keys(properties)).toContain(key);
273280
}
274281
});

‎packages/spec/authorable-surface/ui.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"ui/Action:overrides",
4040
"ui/Action:params",
4141
"ui/Action:patch",
42+
"ui/Action:preflight",
4243
"ui/Action:pressed",
4344
"ui/Action:recordIdField",
4445
"ui/Action:recordIdParam",

0 commit comments

Comments
 (0)