Skip to content

skills(ui): teach resultDialog (incl. table format) and the aggregate bulk handler's BulkActionResult - #35644

Merged
os-zhuang merged 5 commits into
mainfrom
claude/area-a4A-34648
Nov 19, 2026
Merged

os-zhuang merged 5 commits into
mainfrom
claude/area-a4A-34648

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Elon · project thread
Fixes #34648
Fixes #34268
Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:用 AI 写界面动作的人,现在能让 AI 正确写出「执行后弹出一次性结果框(含表格)」和「批量动作逐行报告成败」两种写法;已有应用无感。
  • 为什么做:这两项能力平台已经上线,但对外发布的界面技能包里没有教,AI 写不出来或写错。
  • 出错会怎样:只是教学文字,写错最多让 AI 给出不准确的建议,撤回本次改动即可恢复。
  • 要你做什么:无。界面动作这份教学文件的长度上限按既有裁决「先削重复,余额按实测提高」随实测上调了 378 个计数单位,请在合并审阅时留意这一行。

What changes

skills/objectstack-ui/rules/actions.md, two bullets in the "Visibility, Disable & Feedback" list, each written from the merged schema and its reader, not from the card text:

  • resultDialog (beside preflight): the dialog replaces the success toast and is refused beside outcomeMessages; its keys; the fields row; the six formats; table with its columns (one row per element of the array at path, one cell per column, required with table, refused beside any other format); the dialog-level default and a cell's format take every format but table. It says a text or code-list cell has no copy control and a secret or qrcode cell keeps its own, which is what ActionAnswerTableColumnSchema.format describes and ActionResultDialog.tsx draws. The card's proposed sentence was checked against packages/spec/src/ui/action.zod.ts and kept where it matched.
  • Aggregate bulk handler: an execution: 'aggregate' handler that wrote some rows and refused others catches per row and resolves { succeeded: string[], failed: [{ id, message }] } (BulkActionResult) as its whole return value; a throw is one outcome for the selection; ids outside _selectedIds are dropped, a duplicate counts once, an id in both lists is failed, a selected id in neither is not confirmed; a value with neither member keeps the whole-selection report and one with either member that does not parse is unreadable. Source: BulkActionResultSchema in packages/spec/src/ui/bulk-action.zod.ts and readAggregateResult in ui/packages/plugin-grid/src/hooks/useBulkExecutor.ts.
  • One restatement cut in the same file: the preflight bullet no longer spells the { path, label?, format? } row that the resultDialog bullet right below it now states (28 bytes).
  • scripts/check-skills-token-ratchet.mjs: the rules/actions.md row only, 3333 to 3711 with its note (see Token budget).
  • .changeset/34648-skills-result-dialog-bulk-result.md: @objectstack/skills patch.

Net added lines for the whole PR, changeset included: 43 (git diff --numstat origin/main...HEAD: 45 added, 2 deleted), under the order's 45.

Evals

Two cases appended to skills/objectstack-ui/evals/views-apps-actions-pages.json:

  • id 22: an api action returning a count and an array of rejected rows. must_contain: resultDialog, format: 'table', columns, rejected, reason. must_not_contain: columns: ['email' (column names in place of column objects) and display: 'table' (a refused alias).
  • id 23: an aggregate script handler whose per-row throw fails the whole run. must_contain: _selectedIds, succeeded, failed, message, catch. must_not_contain: succeeded: ids.length (a count where a list is required).

Neither refusal list holds a bare identifier a correct answer may mention. The cases were not run against a model in this PR.

Token budget

skills/objectstack-ui/rules/actions.md had zero headroom on main: 13330 bytes, 3333 tokens, ceiling 3333. Raise path: the standing maintainer ruling of 2026-10-27, 「A:先削重复,余额按实测提高」, ruling record 6513306068 (letter B).

  • Paid down first: 28 bytes of restatement in the same file, the { path, label?, format? } row on the preflight bullet, which the resultDialog bullet right below it now spells.
  • Arithmetic: the text adds 1541 bytes, the cut removes 28, so the file is 13330 to 14843 bytes.
  • Tokens before 3333, after 3711; ceiling +378, the measured remainder only, pinned at the measurement: ceil(14843 / 4) == 3711.
  • node scripts/check-skills-token-ratchet.mjs at head 060842a: exit 0, "skills/objectstack-ui/rules/actions.md is 3711 tokens (ceiling 3711; headroom 0)".

Verification

Two readings for a skills/** diff:

before after
rules/actions.md 258 lines, 13330 bytes, 3333 tokens 260 lines, 14843 bytes, 3711 tokens
all SKILL.md files summed 4853 lines, 255988 bytes unchanged (no SKILL.md touched)
eval fixture (measured, not ratcheted) 21389 bytes, 5348 tokens 23912 bytes, 5978 tokens

Token convention is the gate's own, ceil(utf8 bytes / 4).

Local gate readings
  • At head 060842a, exit 0: check-skills-token-ratchet ("59 authored bundle file(s) within their ceilings"), its --self-test ("104 cases pass"), check-ratchet-remedy-authority, check-nul-bytes.
  • The lines below were read at a6fd641, before the row moved; that commit touches the ratchet script only.
  • exit 0: check:skill-identifier-liveness, check:skill-links, check:skill-compatibility, check:skill-frame-sync, check:nul-bytes, check:pm-skill-id-lint, check:doc-authoring, check-empty-changeset --base origin/main, check-adr-0087-registration --base origin/main, check-changeset-no-major --base origin/main.
  • node scripts/pm/overlap-check.mjs --branch=claude/area-a4A-34648: "VERDICT clean exit 0".
  • The eval file loads through the runner's own loadSkillEvalCatalog (23 cases in the file), and each new case's expected output passes its own assertions by substring.
  • Every other derived family (self-tests, build-reading gates, check:published-files and the rest) is declared to CI.

Two-minute check: open skills/objectstack-ui/rules/actions.md, read the resultDialog bullet under preflight and the last bullet of the same list, and compare with the .describe strings of ActionAnswerTableColumnSchema and BulkActionResultSchema.

Read first, by risk: (1) the resultDialog bullet's copy-control sentence; (2) the aggregate bullet's counting rules; (3) the two must_not_contain lists.

Acceptance notes

  • Noted, not changed here: the same file's list_toolbar row and its Add to Campaign example read the selection as input.selectedIds, while packages/spec/src/ui/action-params.zod.ts names _selectedIds as the built-in key and calls selectedIds its near-miss spelling. Not reproduced at a public door in this PR.
  • The evals README's one-line summary of this fixture is left as is.

🤖 Generated with Claude Code

…format included

rules/actions.md gains a resultDialog bullet beside preflight, written from
the merged ActionSchema describe and the console's ActionResultDialog: the
dialog keys, the fields row, the six formats, table with its required
columns, and which cells keep a copy control. One eval case asks for a
table of rejected rows.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4d1ZJL93Kin2UHFXbFv
…kActionResult

rules/actions.md gains one bullet written from BulkActionResultSchema and the
grid's readAggregateResult: a handler that wrote some rows and refused others
resolves with both row lists and does not throw, and how the console counts
ids against the dispatched selection. One eval case; the changeset names both
entries.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4d1ZJL93Kin2UHFXbFv
…restated row shape

Both bullets say the same facts in fewer bytes, and the preflight bullet no
longer spells the fields row the resultDialog entry right below it states.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4d1ZJL93Kin2UHFXbFv
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 19, 2026
13330 -> 14843 bytes, 3333 -> 3711 tokens: 1541 bytes of teaching added, 28
bytes of restatement cut first, under the standing ruling of record
6513306068 (delete restatement first, raise by the measured remainder).

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4d1ZJL93Kin2UHFXbFv
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-elon-musk · session_016WV4d1ZJL93Kin2UHFXbFv

Final head for review: 060842a240de85253916837cf247d813f9910406 · CI green (31 success, 18 skipped, 0 failed), mergeable clean · 2026-11-19T21:27Z

Area a4-A asks L1 (thread L1-a) for ACCEPT. skills/** is Tier H: after ACCEPT the seat runs the contract review and lands. Token ratchet row for rules/actions.md moved 3333 → 3711 under standing ruling 6513306068 (restatement cut first); arithmetic in the body's Token budget section.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-elon-musk · session_016WV4d1H9ixhgepGZ7fawhL

L1 verdict (L1-a): ACCEPT at head 060842a240de85253916837cf247d813f9910406 (the head announced in comment 7022699400).

Gates on this head: 49 check-runs, 0 failed, 0 pending. Lint & Repo Gates success, TypeScript Type Check success. Mergeable clean.

Shape: draft, base main, Fixes #34648 / Fixes #34268. Both cards are delivered in full (no half-landing), so Fixes is right for each. No closing keyword sits beside any other open card number. @objectstack/skills patch changeset is present. Clause-②: no and Metadata-protocol: none fit a teaching-only diff. No content/docs/releases/ change. No !, so dogfood_battery does not apply.

Sentences checked against merged source:

  • resultDialog bullet vs packages/spec/src/ui/action.zod.ts (resultDialog, actionAnswerFieldRow, ActionAnswerTableColumnSchema, the outcomeMessages refusal):
    • the keys and the fields row;
    • the six formats;
    • table is a field-only format, with columns required beside it and refused beside anything else;
    • the dialog default is json, a cell's default is text, and neither takes table;
    • outcomeMessages is refused beside the dialog;
    • a cell gets no copy control for text / code-list, while secret / qrcode keep theirs. This matches the column .describe word for word and does not imply per-cell copy (card comment 6941854066 is satisfied).
  • Aggregate bullet vs BulkActionResultSchema (packages/spec/src/ui/bulk-action.zod.ts) and readAggregateResult (ui/packages/plugin-grid/src/hooks/useBulkExecutor.ts):
    • it resolves the result and does not throw;
    • an id outside _selectedIds is dropped;
    • a duplicate counts once;
    • an id in both lists counts as failed;
    • a selected id in neither list is "not confirmed";
    • a value with neither member keeps the whole-selection report, and a value with either member that does not parse is "unreadable". Both members are required, so "one list" is correctly unreadable.
  • Changeset prose: each sentence (dialog keys, row, formats, table + columns, the copy-control rule, resolve-not-throw, id counting, one eval each) matches the diff.
  • Evals 22/23: must_not_contain stays narrow. display: 'table' is a refused alias, columns: ['email' is the string-list error, and succeeded: ids.length is the count error. None of them is a bare identifier that a correct answer would contain.

Token ratchet: rules/actions.md is 14843 bytes and ceil(14843/4) = 3711, which I reproduced locally on the head blob. The row moved 3333 → 3711 after a 28-byte restatement cut, under standing ruling 6513306068. The row is outside the order's file surface, and the seat's contract review owns it (Tier H).

Notes (non-blocking):

  1. Net added lines: 43 (45/2). The order on file says ≤ 40, but the body says "under the order's 45". The overage is the 11-line ratchet note. The area should reconcile that sentence, or confirm its amended budget, before landing.
  2. Owed card, filed separately (noticed, not touched here). The published rules/actions.md teaches input.selectedIds in the list_toolbar row (line 27) and the Add to Campaign example (line 108). ACTION_PARAM_BUILTIN_KEYS makes the built-in _selectedIds. After this PR the file states both spellings.
  3. packages/qa/scenarios skill-evals.test.ts is recorded as NOT MEASURED locally (build prerequisite). CI is green on this head. The new eval cases were not run against a model.

Next: Tier H. Handed to the seat for contract review and landing.


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-elon-musk · session_016WV4cysZsTQwxLv9M2TzHH

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 060842a240de85253916837cf247d813f9910406
Local-runs: none
Scope: skills/objectstack-ui/rules/actions.md, skills/objectstack-ui/evals/views-apps-actions-pages.json + scripts/check-skills-token-ratchet.mjs
Security-touching: yes

Cards #34648 and #34268, one PR. Inputs: both cards with every comment, the PR body and file list, the net diff against main, the check-runs on the head. Code outside the diff was read in the PR tree to judge the two bullets, never reviewed: packages/spec/src/ui/action.zod.ts, packages/spec/src/ui/bulk-action.zod.ts, packages/spec/src/ui/action-params.zod.ts, ui/packages/app-shell/src/views/ActionResultDialog.tsx, ui/packages/plugin-grid/src/hooks/useBulkExecutor.ts, ui/packages/plugin-grid/src/ObjectGrid.tsx, ui/packages/core/src/actions/serverActionHandler.ts. The changeset is the lane seat's ACCEPT at TIER_DEFAULT.

① Derived judgments

  • Accept-set: no change. No schema, validator or runtime file is in the diff; nothing an author writes is newly accepted or refused. Right.
  • Public surface, @objectstack/skills: rules/actions.md gains two bullets and loses 28 bytes of the preflight bullet; the eval fixture gains cases 22 and 23. Additive teaching of capabilities already on main (resultDialog and its table format; BulkActionResultSchema and its grid reader). Right.
  • Gate constant: the rules/actions.md ceiling row moves 3333 to 3711 in scripts/check-skills-token-ratchet.mjs; one row, no logic change. Right (arithmetic under ④).
  • Check-runs on the head: every completed run is success or skipped, none failed. Lint & Repo Gates, Lint · repo & tooling gates, Lint · docs & code guards, Check Changeset, Check PR Size, Governed Surface Queue Guard and both PR-body guards runs are success. Queue verdict is skipped.

② Semver level

'@objectstack/skills': patch matches what the diff publishes: skill prose and eval cases, no code and no accept-set move. Clause-②: no and Metadata-protocol: none stand on both the PR body and the changeset and agree with the diff; Check Changeset is success. The ratchet script is not published. Correct level.

③ Boundary flags

  • Dev flag, input.selectedIds on the list_toolbar row (line 27), in the Add to Campaign example (line 110) and in eval 1's must_contain: answered. Those lines are outside this diff and are not reviewed here. The new bullet's input._selectedIds is the spelling the tree holds (ACTION_PARAM_BUILTIN_KEYS, the showcase predicate-matrix.action.ts body), so the diff is right and the older lines are the ones in doubt; after this PR the file carries both spellings. ESCALATED to the seat as a follow-up card on domain:skills; not a condition of this PR.
  • Dev flag, the evals README one-line summary left as is: accepted; not a hits file and not in the diff.
  • Dev flag, "the cases were not run against a model in this PR": ESCALATED. Card skills: teach the action resultDialog, including the table format and its columns #34648's Done-when reads "the rule teaches it and the eval passes", and the PR closes the card with the second half unmeasured. No check-run on the head runs the eval. The seat decides whether a run is owed before close or the card's clause is waived; this record judges the cases as written (④) and cannot stand in for a run.
  • Budget: the claim on skills: teach the action resultDialog, including the table format and its columns #34648 (7013685431) sets a net-added-line budget of 40 with "stop on breach; explain in the report"; the diff is 45 added, 2 deleted, net 43, and the PR body measures it against "the order's 45". The dispatch order is not an input of this review, so the 45 is unverified here. ESCALATED to the seat to confirm the figure; Check PR Size is success.
  • File surface: the same claim lists rules/actions.md, evals/** and the changeset; scripts/check-skills-token-ratchet.mjs is a fourth file. It is the one ceiling row the text change forces and the PR body names it for the maintainer. Answered: accepted as the gate edit the change requires, under the ruling its note cites (the same ruling and wording the 3180 to 3333 note on main already rests on); the ruling record itself is not among this review's inputs.
  • Card skills: teach the action resultDialog, including the table format and its columns #34648 comment 6941854066 (no per-cell copy for text / code-list, secret / qrcode keep theirs): answered in the bullet's last sentence, see ④.
  • Triage note on skills: teach the action resultDialog, including the table format and its columns #34648 (teach the merged describe, not the draft sentence): answered, see ④.
  • Security-touching: yes is meant, on a narrow basis: the new bullet teaches how a secret value is offered to the reader in a result dialog (the copy control a secret cell keeps), and the rewritten preflight line is the one carrying "no body or credentials" and "UX, not authorization". No permission, sharing or authentication rule is added or changed.
  • SQL push-down: not applicable; no query, id materialisation or join in the diff.
  • open_questions: none on either card or in the PR body beyond the flags above.

④ Design judgment

No must-fix, no should-fix.

skills/objectstack-ui/rules/actions.md, resultDialog bullet, sentence by sentence against action.zod.ts and ActionResultDialog.tsx:

  • "in place of the success toast (so no successMessage; outcomeMessages is refused beside it)": the key's describe says it suppresses successMessage; refuseInertOutcomeMessages refuses outcomeMessages beside it. Holds.
  • Keys title, description, acknowledge, format, fields: the strict object's exact key set. Holds.
  • Field row path, label, format, and the six formats: actionAnswerFieldRow and ACTION_ANSWER_FIELD_FORMATS. Holds.
  • table with columns of path, label, format; one row per element, one cell per column; required with table, refused beside any other format: ActionAnswerTableColumnSchema and refuseTableColumnContradictions (which also refuses an empty list and columns with no format). Holds.
  • Dialog-level format defaults to json, a cell's to text, neither takes table: actionAnswerScalarFormat on both slots; column.format ?? 'text' in the renderer. Holds.
  • Copy sentence: TableCellValue draws text as a bare span and code-list as a bare list, and hands secret and qrcode to the blocks that carry CopyButton. Holds, and it is scoped to a cell, which is what comment 6941854066 asked for; a top-level text field does keep its copy button and the bullet does not say otherwise.
  • The sentence is the merged describe, not the card's draft: it adds the toast and outcomeMessages rules, the key list, the two defaults and the copy rule.

Aggregate bullet against bulk-action.zod.ts, useBulkExecutor.ts and ObjectGrid.tsx:

  • One call, ids in params._selectedIds: runBulkActionAggregate. Holds.
  • Resolves succeeded as a string list and failed as id plus message, as the whole return value: BulkActionResultSchema; readActionPayload(res.data) hands the reader the handler's own value. BulkActionResult is exported from @objectstack/spec/ui. Holds.
  • A throw is one outcome for the selection: the catch arm sets aggregateRejection. Holds.
  • Outside id dropped, duplicate once, both lists counts as failed, neither is not confirmed: readAggregateResult, line for line. Holds.
  • Neither member keeps the whole-selection report; either member that does not parse is unreadable: carriesMember then safeParse. Both lists are required by the schema, so "(counts, one list)" is accurate. Holds.
  • All five points of card skills: teach an aggregate bulk handler to resolve with BulkActionResult (skills/objectstack-ui/rules/actions.md) #34268 are taught.

Tried to break it: a handler returning only failed (unreadable, as taught); an id in both lists (failed, as taught); columns on a field with no format (refused, covered by "refused beside any other format"); table at dialog level (refused, as taught). None breaks the text.

skills/objectstack-ui/evals/views-apps-actions-pages.json:

  • Case 22: the expected output parses under the schema (field-level table, object columns). display: 'table' is a real refused alias and columns: ['email' a real wrong shape; neither is a string a correct answer needs. Holds against card skills: teach the action resultDialog, including the table format and its columns #34648's eval ask.
  • Case 23: the expected output is a legal BulkActionResult; succeeded: ids.length is the count shape the schema refuses. "Not a resultDialog" is consistent with the grid: the per-row report is the bulk dialog's. Holds.

scripts/check-skills-token-ratchet.mjs (implementing file): the cut string is 28 bytes; 13330 + 1541 - 28 = 14843, the size of the file at the head; ceil(14843 / 4) = 3711; ceiling +378, zero headroom, pinned at the measurement. The note agrees with the tree. The cut loses nothing: the row shape now sits one bullet below.

Nits, none affecting correctness or the contract:

  • N1 (nit) — resultDialog bullet: "(omitted: the whole answer as JSON)" follows the gloss of path, though it is fields that may be omitted (path is required). The key list marks fields optional and path not, so the reading is recoverable.
  • N2 (nit) — case 22's expected output puts format: 'text' on imported, a number. valueFitsFormat takes a string for text, so the renderer draws that field as json. The count still shows; dropping the format from the expected output would be exact.
  • N3 (nit) — preflight bullet after the cut reads "fields rows are resultDialog.fields' (omitted: JSON)", a possessive with no noun. The spec's own phrase is "row and format set".
  • N4 (nit) — case 22's must_contain pins format: 'table' with single quotes; a correct answer in double quotes misses. This is the fixture's standing convention (type: 'record', type: 'wizard'), so left as is.

Implemented-by: claude/area-a4A-34648
Reviewed-by: session_016WV4cysZsTQwxLv9M2TzHH

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-elon-musk · session_016WV4cysZsTQwxLv9M2TzHH

席位核对 — ACCEPT · repo:objectstack#4 · head 060842a240de85253916837cf247d813f9910406

  1. 形态:4 文件 +45/-2,一 PR 两卡(同文件合并)。
  2. 前提实测:复审在 origin/main 上逐句核对 spec 与读取方,成立。
  3. 门禁:现 head check-runs 全 success/skipped。
  4. 接受的偏差:净增 43 行 > 认领评论的 40;区在扩面到 ratchet 行时把预算改为 ≤45(订单文件记录),本席认可。scripts/check-skills-token-ratchet.mjs 行 3333→3711 照裁决 6513306068,算术复核无误。
  5. 范围外去向:input.selectedIds 旧写法 → skills(objectstack-ui): actions.md teaches input.selectedIds for list_toolbar bulk actions; the spec names _selectedIds the built-in key #35647;Skills-docs: 本 PR 即技能文本。卡 skills: teach the action resultDialog, including the table format and its columns #34648 Done-when「eval passes」:两条新案例未跑模型,由区在关卡前跑一次并记在卡上,非本 PR 条件。
  6. 落地条款:批准后 pr_ready + 入队;Clause-②: no,@objectstack/skills patch。

@objectstack-fleet objectstack-fleet Bot added pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue security labels Nov 19, 2026
@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 19, 2026 21:39
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit e91d967 Nov 19, 2026
59 of 60 checks passed
@os-zhuang
os-zhuang deleted the claude/area-a4A-34648 branch November 19, 2026 22:12
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 pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue security size/s tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants