Skip to content

feat(spec)!: action locations say what an action acts on - #37929

Merged
os-zhuang merged 10 commits into
mainfrom
claude/project-thread-rswxk0
Nov 28, 2026
Merged

os-zhuang merged 10 commits into
mainfrom
claude/project-thread-rswxk0

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Tesla · project thread

Part of #36495

What changes

An action's locations now say what the action acts on, not the part of the page it sits in. ACTION_LOCATIONS is list, record, record_page, record_row, record_related, record_section. The page-part words list_toolbar, list_item, record_header and record_more are retired.

  • record is new: the action acts on one record, so it is drawn on the record page's header and in each list row's menu.
  • The record header's ⋯ fold, which record_more used to say, is the action's component: 'action:menu'.
  • Which actions are buttons and in what order stays the object's actionLayout.

Clause-②: yes (narrowing)
Metadata-protocol: narrowed
Skills-docs: follow-up #37895

A replacement with a registered conversion, so yes (narrowing) as on main's precedents (.changeset/pre/37086-define-metadata-form-rename.md, .changeset/pre/37304-knowledge-source-governed-type.md). Narrowed: the four retired words are refused wherever a location is read. Widened in the same change:

  • the four newly accepted values list, record, record_page and record_row, at the same positions;
  • the new @object-ui/types export actionFoldedIntoMenu;
  • eight new @object-ui/i18n Studio keys for the location labels (en, zh), replacing the eight keys of the retired words.

ADR-0087 conversion action-locations-acted-on (lossless)

FROM → TO. Each action is drawn in exactly the places it was drawn before:

  • list_toolbar → list
  • list_item → record_row
  • record_header / record_more → record_page
  • record_header or record_more beside list_item → record
  • record_more without record_header → record_page + component: 'action:menu'
  • A component's single location (record:quick_actions, action:group, action:bar) is mapped the same way.

The conversion is retired from the load path from day one, as every protocol-19 entry is. An old word is refused at authoring, and the refusal names the word to write instead. Stored items, built artifacts and os migrate meta --from 18 replay the conversion. It leaves a TODO and changes nothing in four cases that have no lossless rewrite:

  • a record_more-only action that is also on list_toolbar, without component: 'action:menu' already (with it, the rewrite is lossless); there are 0 in this repo
  • an action at record_header with an authored component: 'action:menu': the header folded it into its ⋯ while a record:quick_actions bar at record_header drew it as a button, and record_page has one state for both; 0 in objectstack and HotCRM. Pinned in packages/spec/src/conversions/action-locations-acted-on.test.ts; removing the TODO turns 3 of its cases red
  • a component whose location is record_more
  • an action:group at record_header with a record_more-only member

A site left as stored keeps its old word, which a protocol-19 runtime matches to no surface: that action or block is drawn nowhere until it is rewritten by hand.

The semantic entry action-locations-page-parts-retired carries the step into the protocol-19 upgrade guide.

Readers

  • @object-ui/types:
    • actionRendersAt reads record as covering record_page and record_row.
    • The new actionFoldedIntoMenu tells whether an action is folded into the ⋯.
    • arrangedHeaderActions pins and unpins through component.
  • page:header sends every folded action to its ⋯. Every other record_page action takes the inline budget.
  • record:quick_actions at record_page leaves folded actions out.
  • The related list reads record as a row action.
  • The record-scoped checks in core and runtime (isRecordScopedAction, requiresRecord) accept record.
  • Studio:
    • The action inspector and the record:quick_actions location dropdown offer record.
    • The action preview draws the fold as "record_page · ⋯".
  • Lint: the record-page header, related-list and action-layout rules read the new words. The related-list hint now groups locations that draw the same thing, which keeps the one-line fix under 200 characters.
  • Declarations under packages/**, examples/** and ui/**, plus content/docs/**, use the new words. The generated references, sdui.manifest.json and the component reference pages are regenerated.

Not moved

Size

421 files, +2478/−1631 (4109 changed lines). This is over 3000, so it is a class (c) landing.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L9qic11optJUat6U8X67jY

Keeps both protocol-19 step sentences in registry.ts.template, moves the
new main declarations and the liveness evidence to the acted-on words,
and regenerates the references.

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

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 10 package(s): @objectstack/cli, @objectstack/lint, @objectstack/metadata-protocol, @objectstack/platform-objects, @objectstack/plugin-approvals, @objectstack/downstream-contract, @objectstack/scenarios, @objectstack/runtime, @objectstack/service-datasource, @objectstack/spec, touching 81 documentable anchor(s). ⚠️ 7 changed file(s) yielded no anchor (packages/lint/src/validate-null-guards.ts, packages/spec/liveness/action.json, packages/spec/liveness/object.json, …), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

39 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 8d34c4404f951410083a6caebd6ad8003ea3423d.

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

What this run could not see
  • 7 changed file(s) yielded no anchor (packages/lint/src/validate-null-guards.ts, packages/spec/liveness/action.json, packages/spec/liveness/object.json, …) — pages documenting those are invisible to this run
  • 13 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 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; 124 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 — 191 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 8d34c4404f951410083a6caebd6ad8003ea3423d → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json 8d34c4404f951410083a6caebd6ad8003ea3423d

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

…n location labels

The action inspector's location options are now Record · page and rows /
Record · page; the action preview draws its ⋯ frame for a folded record
page action, so the ⋯ wording is pinned on a folded fixture.

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1

Contract-review-claim: session_01L9qibwSEecrzDjKjbk24r1 · head 0ada605 · 2026-11-27T20:06Z

L1-a (the seat's L1 thread) runs the isolated CONTRACT_REVIEW_TIER review on this head (narrowing face: the action locations vocabulary in @objectstack/spec goes from page parts to what an action acts on, with the ADR-0087 conversion action-locations-acted-on, its semantic entry, and the readers in @object-ui/types, core, runtime, lint and Studio), and posts its L1 beside it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 0ada605856a2bf5cdfaecd5fd9164c57cb8da4ef
Local-runs: none
Scope: packages/spec/src/conversions/entries/19/action-locations-acted-on.ts, packages/spec/src/conversions/registry.ts, packages/spec/src/data/object-action-layout.ts, packages/spec/src/kernel/public-auth-features.ts, packages/spec/src/migrations/entries/semantic/19.action-locations-page-parts-retired.ts, packages/spec/src/migrations/registry.ts.template, packages/spec/src/stack.zod.ts, packages/spec/src/studio/plugin.zod.ts, packages/spec/src/ui/action-declarative-update.ts, packages/spec/src/ui/action.zod.ts, packages/spec/src/ui/component.zod.ts, packages/spec/src/ui/dashboard.zod.ts, packages/spec/src/ui/page.zod.ts + the other 391 paths of the diff outside content/docs/** and .changeset/** (narrowing floor: packages/**, ui/**, examples/**, scripts/sdui-manifest.record.json, sdui.manifest.json), the readers read in full: ui/packages/types/src/ui-action.ts, ui/packages/core/src/actions/ActionEngine.ts, ui/packages/core/src/actions/serverActionHandler.ts, ui/packages/components/src/renderers/layout/containers.tsx, ui/packages/components/src/renderers/action/action-bar.tsx, ui/packages/plugin-detail/src/renderers/record-quick-actions.tsx, ui/packages/plugin-detail/src/renderers/relatedListActions.ts, ui/packages/plugin-detail/src/DetailView.tsx, ui/packages/layout/src/PageHeader.tsx, ui/packages/app-shell/src/views/RelatedRecordActionsBridge.tsx, ui/packages/app-shell/src/views/DeclaredActionsBar.tsx, ui/packages/app-shell/src/views/objectViewListRenderer.tsx, ui/packages/app-shell/src/layout/designModeHeaderPinsModel.ts, ui/packages/app-shell/src/views/metadata-admin/previews/ActionPreview.tsx, ui/packages/app-shell/src/views/metadata-admin/previews/block-config.ts, packages/runtime/src/action-execution.ts, packages/lint/src/validate-record-page-header.ts, packages/lint/src/validate-action-name-refs.ts, packages/lint/src/validate-object-action-layout.ts. Read outside the diff, not reviewed: packages/spec/src/conversions/apply.ts, packages/spec/src/conversions/stored.ts, packages/metadata-core/src/artifact-forward-conversion.ts, .changeset/config.json, .changeset/pre.json, skills/objectstack-ui/rules/actions.md, docs/qa/**, and every reader above at the merge base cb3f8b95.

① Derived judgments

Inputs: card #36495 with its five comments, PR #37929 body and file list, the net diff cb3f8b95...0ada6058 (420 files, +2322/−1631), and the 70 check-runs on the head (61 success, 9 skipped, 0 failed).

  • The tap. It is on the card as comment 7213827153 (recorded 08:42Z, ruling letter A 「照卡上这套」 at 08:40Z on 2026-11-27), beside 7213534162 (start now, before 19.0.0 GA). It is the seat's record of the maintainer's tap, not a comment in the maintainer's own hand.
  • Enum equals the card's set: right. ACTION_LOCATIONS at the head is exactly list, record, record_page, record_row, record_related, record_section. No extra word, none missing. list_toolbar, list_item, record_header, record_more are gone from the enum and each is refused by the enum's own error map with its replacement (action.zod.ts; pinned in action.test.ts and retired-key-removal-version.pin.test.ts).
  • Conversion table equals the card's: right. rewriteLocations and convertAction implement the five card rows word for word. The component single-location mapping and the three TODO cases are additions the card does not state; they stay inside the ruling.
  • Accept set, narrowed: right. Four values refused on action.locations, on the row locations of action:button, action:icon and group or menu members, and on the location of record:quick_actions and action:group. Metadata-protocol: narrowed is the right kind (narrowed over added).
  • Accept set, widened: declared wrong. Four values are newly accepted at the same positions (list, record, record_page, record_row). See S2.
  • Public surface, @object-ui/types. ACTION_LOCATIONS and ActionLocation change members (breaking); actionFoldedIntoMenu is a new export (widening); arrangedHeaderActions no longer writes locations (behaviour). @object-ui/core re-exports the same constant and type and getActionsForLocation takes the new type. Named in the changeset: right, except the Clause-② line (S2).
  • Published language packs. @object-ui/i18n studio packs (en, zh) drop eight …location.* keys and add eight. Not named in the changeset as a key change (S2).
  • Readers. actionRendersAt answers record_page and record_row for record: right. isRecordScopedAction (core) and requiresRecord (runtime) keep their exact sets, respelled: right; record_related stays outside core's set and record_section outside runtime's, as on main.

② Semver level

  • @objectstack/spec major and @object-ui/types major are right. .changeset/pre.json is in pre mode (tag next), every package is at 19.0.0-next.1, and all published packages sit in one fixed group, so the release stays on the 19 prerelease line.
  • Every publishable package the diff touches is in the changeset (25 names; @objectstack/dogfood and @objectstack/downstream-contract are private). The ADR-0087 marker and the FROM → TO block are present; Check Changeset is green.
  • The per-package levels below major are changelog placement only inside the fixed group. Two are loose (N5).
  • Clause-②: no (narrowing) is not true as written. See S2.

③ Boundary flags

  • open_questions in the os-dev report (7227149591) is empty. Its six deviations are answered: (1) the skills split is carried by skills: teach the new action locations vocabulary (list / record + exception words) after #36495 #37895, see N6; (2) class (c) size is the seat's call and Check PR Size is green; (3) docs/qa is not only prose, see N7; (4) the warming imports in 23 tests and (5) the registry.ts.template merge are fine; (6) majors confirmed in ②.
  • security_findings: none agrees with the diff: no permission or capability gate changes; every gate comment that moved is a respelling.
  • SQL push-down: the diff adds no query, id materialisation or in-app join. No finding.
  • PR author is objectstack-fleet[bot].

④ Design judgment

The narrowing itself holds: it is a respelling with a migration, not a capability taken away. A grep for each retired word over packages/, ui/ and examples/ at the head, outside migrations, conversions and CHANGELOG files, leaves only comments and the two pin tests. No consumer reads a retired word. Source is refused at parse with the replacement; stored rows (applyConversionsToStoredItem) and built artifacts (floor 19.0.0 opens the major step; floor at or below 18.6.0 opens it by retiredAfter) replay the conversion.

Break attempts that held, main readers against head readers:

  • record_header + list_item to record: the header surfaces (page:header on the record page, side preview and phone bar, the design-mode pin rows, MetadataTypeActions) and the row surfaces (grid and list row menus, related-list rows in a parent, the inbox inline decisions) all go through actionRendersAt at the head. Same places.
  • record_related: record does not cover it and need not. A list_item action already drew on related-list rows on main (ROW_LOCATIONS_IN_RECORD), and record_header + record_related becomes record_page + record_related, not record.
  • record_more-only to record_page + component: 'action:menu': main's header folded on isMoreOnly or on the component; the head folds on the component alone. Replacing an authored component is lossless: row menus, related lists, DeclaredActionsBar and record:quick_actions never read an object action's component, and the header reads only action:menu.
  • record_header + record_more to record_page with no component: a button before and after.
  • arrangedHeaderActions: pinned lifts the fold, unpinned sets it; same split as main's location rewrite.
  • The three TODO cases are truly not expressible per item: the list toolbar reads the fold too; no word draws only folded actions; a group member has no component.

S1 (should-fix) — A fourth non-lossless case is converted silently. On main record:quick_actions at record_header (also its default location, and PageHeader's actions prop) drew every action whose locations included record_header, whatever its component (ActionEngine.getActionsForLocation was a plain includes). At the head the bar at record_page leaves out every action with component: 'action:menu' (record-quick-actions.tsx). So an action authored locations: ['record_header'] with component: 'action:menu' was a button in that bar on main and is absent from it at the head; no notice, no TODO. The cause is structural: main had two states (header word plus menu component: in the bar; record_more-only: not in the bar) and the head has one. The mirror case exists for an action:bar at record_page fed business actions: a former record_more-only action now appears in its overflow (no in-repo feeder passes business actions there). Census: zero authored component: 'action:menu' declarations in objectstack and in HotCRM. Fix either way: the conversion reports a TODO for an action that carries record_header and an authored component: 'action:menu', or the changeset and the semantic entry name the exception and the maintainer accepts it, since the card says every action shows exactly where it shows today.

S2 (should-fix) — Clause-②: no (narrowing) under-declares. The diff also widens: four newly accepted enum values, the new @object-ui/types export actionFoldedIntoMenu, and eight new published @object-ui/i18n keys. House precedent on main declares a replacement with a registered conversion as yes (narrowing) (.changeset/pre/37086-define-metadata-form-rename.md, .changeset/pre/37304-knowledge-source-governed-type.md) and keeps no (narrowing) for pure retirements (37712-agent-model-provider-retired.md). The line belongs as Clause-②: yes (narrowing) with the widened members named, in the changeset, the PR body and a corrected claim line. Prose faces only; no code moves, and the tier this review ran at already covers it.

N1 (nit) — At rest, two TODO shapes draw nothing on a 19 runtime until rewritten by hand: an action left as ['list_toolbar', 'record_more'] matches no reader, and a record:quick_actions left at location: 'record_more' finds no action. The read seam reports no TODO; only os migrate meta does. The changeset and the semantic entry say "left as stored" but not that consequence. Say it in the prose.

N2 (nit) — The toolbar TODO also fires when the action already carries component: 'action:menu', where ['list', 'record_page'] with the component is lossless.

N3 (nit) — Studio's record:quick_actions dropdown now offers record. A bar at record reads the exact word: it draws only actions that declare record, not record_page ones, and does not apply the fold filter that record_page applies. Follow-up card.

N4 (nit) — Wording. The enum refusal on a block's location: 'record_more' prescribes record_page, which the conversion itself says is not equivalent. The record_section advice in action.zod.ts and page.zod.ts changed from "adds record_more" (the fold) to "adds record_page" (a header button unless the component is also set). The semantic entry's comment says two sites are left as stored; its text says three.

N5 (nit) — Changeset prose. "The packages listed as patch change comments, test fixtures or authoring copy only" is not true for @objectstack/plugin-approvals and @objectstack/service-datasource (shipped declarations) or @object-ui/layout (a runtime literal). @object-ui/core, @object-ui/components and @object-ui/react carry the breaking type through re-exports and parameters at minor or patch; moot in the fixed group.

N6 (nit) — Out of scope, skills/**: safe for this landing with one condition. After the merge, skills/objectstack-ui/rules/actions.md (the locations table and the actionLayout paragraph), rules/record-page.md:40, skills/objectstack-formula/SKILL.md:139 and two eval files still teach refused words; the eval must_contain at views-apps-actions-pages.json:30 requires record_header. Both skill gates are green on the head, so no checked example or served JSON fence carries one. @objectstack/skills is in the fixed group, so a next cut between this merge and #37895 PR 2 ships skills that teach words the same version refuses; the refusal names the replacement, so an agent recovers in one round. Condition: #37895 PR 2 lands before the next prerelease cut.

N7 (nit) — Out of scope, HotCRM and docs/qa/**. HotCRM is safe: it pins @objectstack/spec 18.6.0, its five record_more declarations are all convertible, and it has no TODO shape. docs/qa is not only prose: both recorded builds (order_to_cash.json as well as travel_expense.json) carry old words and declare engines.protocol: ^19, which the artifact door replays through the major step; but the checklist's scratch bodies sent to the save door (studio-authoring.json:5372, records-forms.json:7273) will now be refused, and the install-local recipe at records-forms.json:77 carries no protocol floor (not verified whether it replays). No follow-up card is named for these; file one.

N8 (nit) — Body staleness. The PR body still says two derived gates are red until #37895 PR 1 lands; PR 1 (#37947) is on main and both gates are green on this head. The size line reads 417 files, +2308/−1624; the head is 420 files, +2322/−1631. The body names only travel_expense.json among the recorded builds.

Implemented-by: claude/project-thread-rswxk0
Reviewed-by: session_01L9qibwSEecrzDjKjbk24r1

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1

The filled brief the record above (7227370865) was rendered from (L1-a, isolated CONTRACT_REVIEW_TIER subagent):

Contract review brief — PR #37929 @ 0ada605856a2bf5cdfaecd5fd9164c57cb8da4ef (card #36495)

You review at CONTRACT_REVIEW_TIER. Render ONE ## Contract review record on this head — its shape is
node scripts/pm/record-recognisers.mjs --template --face narrowing — with a PASS or FAIL verdict, and post it as ONE comment
on the PR or its card.

Inputs — these and nothing else:
· card #36495: its body and EVERY comment (rulings and earlier records included)
· PR #37929: its body, its file list, and the net diff against main at cb3f8b9538d167460d3a67c5201a1e6315e936e2
· the check-runs on 0ada605856a2bf5cdfaecd5fd9164c57cb8da4ef: their conclusions ARE the gate verdicts
⛔ Not the dispatch order, ⛔ not the dispatching seat's own conclusions — this brief is adversarial by design.

Scope — the narrowing is declared of the whole PR, never of a path: the floor is EVERY path of the diff outside the
prose faces (content/docs/**, .changeset/**), plus every file those hunks make a claim about, read in the cited code.
Widen it freely, ⛔ never below that floor; the record's Scope: line lists both. No path is the lane seat's remainder.
④ judges the narrowing itself over that floor: lockfiles, generated output, changesets and prose elsewhere in
the PR are not reviewed; the published spec and the cited code are READ to judge it, never reviewed.

⛔ READ-ONLY. No worktree, no checkout, no build, no test run, no gate re-run, no ablation: the check-runs
on the head already answered every derived gate family, and a local run costs more than it returns.
If ONE probe is unavoidable, the record's Local-runs: line says probe — REASON; otherwise none.
Scratch space is /tmp/claude-0/-home-user/166e2125-4268-552f-a555-2b7c43a99f0f/scratchpad/pr-37929/ alone; nothing there you did not write this round is read.

Judge, in the record's own sections:
① Derived judgments — every accept-set and public-surface change the diff implies, each named right or wrong.
② Semver level — the changeset (or skip-changeset) matches what the diff publishes, and the Clause-②: line.
③ Boundary flags — every dev flag and every open_questions entry answered, or escalated.
On every face, SQL push-down: a new id materialisation or in-app join where SQL could push down is a
finding unless a reason is given (AGENTS.md, Prime Directive 5: SQL first).
④ Design judgment — the narrowing itself, read against the published spec on main: does it take a
declared capability away at the consumer, or make the spec's own refusal real? A capability declared
and not delivered is an implementation gap, implemented or retired, ⛔ never narrowed at the consumer.
Read the spec and the cited code in the live tree, and try to break the design.
Grade each finding must-fix, should-fix or nit — a nit has no effect on correctness or the contract.
A must-fix is a FAIL; a must-fix or should-fix earns a delta review of its fix; nits alone end the round.
Spell a must-fix or should-fix with its id and grade, S1 (should-fix) — …, and a clean round as
No must-fix, no should-fix.: the queue guard reads a graded finding as OPEN on this head and
refuses the record; the delta record names those it closes by id alone, S1: closed.
A nit is fixed only on the prose faces, or left as an accepted deviation or a follow-up card: a fix
anywhere else moves the head, and this record no longer covers it.
⛔ Judge the tree, never the PR body's account of it.
Sign Implemented-by: with the dev's branch and Reviewed-by: with your session id — the value is the FIRST
thing after each colon.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1
2026-11-27T20:19Z

L1 REWORK at 0ada605856a2bf5cdfaecd5fd9164c57cb8da4ef (L1-a for the seat). The isolated CONTRACT_REVIEW_TIER record 7227370865 is a PASS (claim 7227191836; filled brief beside it). It has no must-fix, but it has two should-fix findings, and each owes a delta of its fix before ACCEPT. Everything else holds:

  • the shipped enum is exactly the card's set, per the tap 「照卡上这套」 recorded at 7213827153;
  • the five conversion rows are word for word;
  • no reader in packages/, ui/ or examples/ still reads a retired word;
  • stored rows and built artifacts replay the conversion;
  • all 25 touched publishable packages are in the changeset;
  • CI is 61 success, 9 skipped, 0 failed;
  • the dogfood battery is pinned to 0ada6058 in report 7227149591 (4144 passed, 0 failed).

Owed before ACCEPT.

  • S1 (should-fix): a fourth case that is not lossless is converted silently. On main, record:quick_actions at record_header drew every action whose locations included record_header, whatever its component. At the head, the bar at record_page drops every component: 'action:menu' action. So locations: ['record_header'] with an authored component: 'action:menu' was a button in that bar and now is not, with no TODO. The census is zero in objectstack and HotCRM. Either fix closes it:

    • (a) the conversion reports a TODO for record_header plus an authored component: 'action:menu', with a pin; or
    • (b) the changeset and the semantic entry name the exception, and the seat takes it to the maintainer, because the card promises that every action shows exactly where it shows today.

    (a) moves code and needs a new green head. (b) is prose plus a ruling.

  • S2 (should-fix): the Clause-②: line under-declares. The diff also widens: four newly accepted values (list, record, record_page, record_row), the new @object-ui/types export actionFoldedIntoMenu, and eight new @object-ui/i18n keys. Main's precedent for a replacement with a registered conversion is Clause-②: yes (narrowing) (.changeset/pre/37086-…, .changeset/pre/37304-…), with no (narrowing) reserved for pure retirements. Write it as yes (narrowing) with the widened members named, in the changeset, the PR body and a corrected claim line. This is a prose-only change.

Nits worth taking in the same push (prose faces only, unless you choose otherwise):

  • N1: say that the two left-as-stored TODO shapes draw nothing on a 19 runtime until rewritten.
  • N4: the wording of the record_more block refusal, the record_section advice, and the two-vs-three count in the semantic entry.
  • N5: the changeset's "patch packages change comments only" is untrue for plugin-approvals, service-datasource and @object-ui/layout.
  • N8: the body's stale "two gates red" paragraph, the size line (420 files, +2322/−1631), and naming order_to_cash.json next to travel_expense.json.

Follow-ups for the seat (not this PR).

Each needs a card.

After the fix. If S1 goes by (a), I want a new green head, a same-reviewer delta on it, and the dogfood battery re-pinned to that head. If S1 goes by (b) and S2 is prose only, the head may still move for the changeset. Any new head owes the delta and a re-pinned dogfood reading. Tier H on landing (narrowing, class (c) size).

…thored fold

An action at `record_header` with `component: 'action:menu'` was folded into
the record page header's ⋯ menu and drawn as a button by a
`record:quick_actions` bar at `record_header`. At `record_page` the fold is one
state for the whole page, so the conversion now leaves it as stored with a
TODO, pinned with an ablation. A ⋯-only toolbar action that already carries
`action:menu` is rewritten losslessly instead of reported.

The changeset declares `Clause-②: yes (narrowing)` with the widened members,
and the semantic entry, the location refusal and the `record_section` advice
say what a site left as stored draws and how the fold is kept.

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

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 46090930212 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Test Core (4/10) — 失败步骤: Run this shard's tests

    @objectstack/service-knowledge:test:  FAIL  src/__tests__/knowledge-settings-contribution.test.ts > embedderSettings: false keeps the embedder section off the ai page > the knowledge page, its test bu
      ↳ 失败原因: (这条 FAIL 之后 12 行内没有可识别的原因行 —— 点进 job 看)
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

历史信号:

  • ⚠️ 本 PR 过去 24h 已在队列失败 1 次(不含本次)。 内容未变而反复失败 ⇒ 高度怀疑 flaky 测试或与同组 PR 的语义冲突,重排不解决。
  • 过去 24h 队列共有 32 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

Merged via the queue into main with commit 58b513a Nov 28, 2026
80 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-rswxk0 branch November 28, 2026 01:41
os-tesla pushed a commit that referenced this pull request Nov 28, 2026
Conflicts with #37929 (action locations say what an action acts on)
resolved toward this PR's retirement of `ask_ai`:
- conversions/registry.ts keeps both protocol-19 entries at order 3
  (action-locations-acted-on, then action-type-ask-ai-removed, by id);
- the pin test keeps both JOIN rows, one action.zod import;
- dashboard.zod.ts keeps the `ask_ai` header refusal removed;
- the showcase's AskAboutTaskAction, and the four ask_ai test files #37929
  re-spelled (action-ask-ai, dashboard-header-ask-ai-37142,
  ActionRunner.askAi-37142, RelatedList.toolbarAskAi-37142), stay deleted.

Claude-Session: https://claude.ai/code/session_01L9qibzCKZkVMWDVKhZVdRK
Co-authored-by: Claude <noreply@anthropic.com>
os-tesla pushed a commit that referenced this pull request Nov 28, 2026
… new location words

The merged tree's reference pages, regenerated. The conversion fixture and
the changeset's FROM row spell `locations` in #37929's words
(`record_page`, `record_row`), since the page-part words are refused now.

Claude-Session: https://claude.ai/code/session_01L9qibzCKZkVMWDVKhZVdRK
Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…bjectstack-ai#37947)

repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoEfAeSobHZgSLfHP3844ZfC)_

Part of objectstack-ai#37895

This is PR 1 of 2 on that card. It lands before objectstack-ai#36495 (draft PR
objectstack-ai#37929), so that objectstack-ai#37929's `check:skill-examples` and
`check:skill-served-sections` go green. PR 2, the teaching of the new
words, stays behind objectstack-ai#36495.

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户能看到什么变化:写应用的 AI 助手读到的六个按钮示例,不再写明按钮放在哪里;说明文字和位置对照表一字未动,也没有教任何新词。
- 为什么做:这是「按钮位置改用新词」这项工作的前置一步。旧的位置词即将退役,这六个示例不先让路,那项改动的两道示例检查过不了。
- 出错会怎样:照抄示例的人会得到一个哪里都不显示的按钮,校验时有一条提醒告诉他补上位置;本改动只删了几行,可以直接撤回。
- 要你做什么:在「按钮位置改用新词」那项改动之前合并本改动(技能包属于要你亲手合并的范围)。

## What changes

Six checked examples in the published skills drop their `locations` key.
Eight old words leave compiled text; no word is added. (A seventh,
`ask_about_contract` in `skills/objectstack-ai/SKILL.md`, left with C1s
objectstack-ai#37937, which deleted its whole Ask AI block; see the update below.)

| File | Example | Line on the base | Words dropped |
|:--|:--|:--|:--|
| `skills/objectstack-ui/SKILL.md` | `mark_done`, § Actions, JSON fence
1 | 136 | `record_header` |
| `skills/objectstack-ui/rules/actions.md` | `crm_reassign_lead`
(os:check) | 69 | `record_header`, `list_item` |
| `skills/objectstack-ui/rules/actions.md` | `crm_convert_lead`
(os:check) | 96 | `record_header`, `list_item` |
| `skills/objectstack-ui/rules/actions.md` | `crm_print_a3` (os:check) |
180 | `record_header` |
| `skills/objectstack-ui/rules/actions.md` | `crm_open_invoice_pdf`
(os:check) | 205 | `record_header` |
| `skills/objectstack-ui/rules/actions.md` | `crm_add_invoice_line`
(os:check) | 239 | `record_header` |

Two more files move because the gates measure them as owed:

- `scripts/check-skills-token-ratchet.mjs`: two rows follow their files
down to the measurement (2264 to 2256, 3890 to 3844). The gate refuses a
ceiling above its file's measurement. The `objectstack-ai` row is
`main`'s own (6609) after the merges below.
- `.changeset/37895-skills-action-examples-no-location-key.md`: a
`patch` for `@objectstack/skills`, which ships the catalog.

Not changed: every sentence, the location table (`actions.md` lines 17
to 26), the `actionLayout` paragraph, `actions.md` line 222,
`skills/objectstack-formula/SKILL.md`,
`skills/objectstack-ui/rules/record-page.md` and the eval fixtures. None
of them is compiled, and they are PR 2's.

## Why

On objectstack-ai#37929's branch the action location vocabulary is `list`, `record`,
`record_page`, `record_row`, `record_related`, `record_section`. On main
it is `list_toolbar`, `list_item`, `record_header`, `record_more`,
`record_related`, `record_section`. The only words both accept are
`record_related` and `record_section`, and neither means a record-header
button. So each example drops the key instead of taking a word with a
different meaning.

## Size of the published skills

| Reading | Lines before | Lines after | Tokens before | Tokens after |
|:--|--:|--:|--:|--:|
| `skills/objectstack-ai/SKILL.md` | 487 | 486 | 6799 | 6791 |
| `skills/objectstack-ui/SKILL.md` | 165 | 165 | 2264 | 2256 |
| `skills/objectstack-ui/rules/actions.md` | 266 | 261 | 3890 | 3844 |
| Bundle: all 14 `SKILL.md` files | 4959 | 4958 | 65451 | 65435 |
| Authored files the ratchet prices | n/a | n/a | 199689 | 199627 |

Net change under `skills/`: 1 line added, 7 removed. Tokens are the
ratchet's own count, `ceil(utf8 bytes / 4)` with the release-stamp line
left out.

## Tests

**Update at head `78295ae3`.** Two real merges of `main` (`d7c3960e`,
then `e5898ad9` on `4de4e3e9`) and one changeset commit. Net diff
against `main`: 4 files, +18 / −8, `skills/` net −5. The two
`objectstack-ui` rows measure 2256 and 3844 on the merged tree.
`check:skill-examples` exits 0 with 351 examples (the one that left is
Ask AI). `check:skill-served-sections`, the ratchet and its
`--self-test` exit 0. Merge delta reports are on objectstack-ai#37895; the review
records are on this PR. The size table and readings below are the first
measurement and still count the `objectstack-ai` row.

The readings below are at head `661e8e90`, on base `f926dfab`
(origin/main when the worktree was made).

<details>
<summary>Main-based tree: the two spec gates and the token
ratchet</summary>

- `pnpm --filter @objectstack/spec run check:skill-examples`: exit 0.
`352 prose examples type-check across 3 surface(s)`.
- `pnpm --filter @objectstack/spec run check:skill-served-sections`:
exit 0. `24 served section(s), each heading exactly once in its file (6
json, 2 json+ts, 16 neutral); 10 JSON fence(s) parse and pass their spec
validators.`
- `node scripts/check-skills-token-ratchet.mjs`: exit 0. `61 authored
bundle file(s) within their ceilings`. Before the three rows moved it
was exit 1, `3 of 114 published bundle file(s) failed their check`, each
row above its measurement (by 8, 8 and 46).
- `node scripts/check-skills-token-ratchet.mjs --self-test`: exit 0.
`111 cases pass`.
- `pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2
scripts/platform-catalog.test.ts` (the one test file that names the
ratchet script): `Test Files 1 passed (1)`, `Tests 20 passed (20)`.

</details>

<details>
<summary>objectstack-ai#37929's branch at e3b2ea9: red before these edits, green with
them</summary>

Method: a second worktree, detached at `e3b2ea95`. `@objectstack/spec`,
`@objectstack/client` and `@objectstack/client-react` were built there
(turbo, 47 tasks). The gates ran once on the untouched tree, as the
control. Then this PR's `skills/` diff was applied with `git apply`, and
the gates ran again. The two `objectstack-ui` files were byte-identical
to this PR's head after the apply.

- Control, `check:skill-served-sections`: exit 1.
`skills/objectstack-ui/SKILL.md § Actions: JSON fence 1 is refused as
Action: locations.0`.
- Control, `check:skill-examples`: exit 1. Eight `TS2322` errors, at
`skills/objectstack-ai/SKILL.md:189:15` and
`skills/objectstack-ui/rules/actions.md` 69:15, 69:32, 96:15, 96:32,
180:15, 205:15, 239:15.
- With the edits, `check:skill-served-sections`: exit 0. `10 JSON
fence(s) parse and pass their spec validators.`
- With the edits, `check:skill-examples`: exit 0. `352 prose examples
type-check across 3 surface(s)`.

The token ratchet on that tree stays red on that branch's own three rows
until main, with this PR in it, is merged there. That is not a reading
about this PR.

</details>

<details>
<summary>Derived gate families: 68 derived, 67 run, 1 not
measured</summary>

`node scripts/pm/dispatch-gates.mjs --commands` derived 68 commands for
the 5 changed paths. Each was run with its exit code recorded before any
pipe, and `--ran` answered: `68 derived famil(ies) accounted for — 67
run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)`.

- 67 commands: exit 0.
- NOT MEASURED: `pnpm check:dual-build-cjs-loads`, reason: exit 3,
`PREREQUISITE NOT MET`. It reads the `dist/` of every package and this
tree built only the three packages above. The diff changes no package
source, so this one is CI's.
- `check:skill-examples` is outside the derived list; it was run because
the order names it.

</details>

## Acceptance notes

- **The examples now show an action with no placement.** The text above
them still says that an action with neither `locations` nor a list view
naming it renders nowhere, and the Ask AI paragraph still says to
declare the action in `locations`. An action copied from one of these
seven examples as it stands draws the `action-no-placement` warning at
`os validate` and no button. No sentence was added to say so: the order
set a budget of zero added lines and no new word. PR 2 gives each of the
six examples its placement again, in the new words. Carrier: PR 2 on
this card.
- **The token rows are banked.** The three ceilings are 62 tokens lower
in total. When PR 2 writes `locations` back, those three files grow
again. The ratchet's header gives one path for a row to go up:
restatement cut from the same file first, then the measured remainder,
with the standing ruling quoted in the PR body.
- **The sibling branch landed first.** C1s objectstack-ai#37937 (`4de4e3e9`) deleted
the whole Ask AI block. The merge `e5898ad9` keeps `main`'s
`skills/objectstack-ai/SKILL.md` byte for byte, so this PR no longer
touches that file, and the ratchet row stays `main`'s 6609.
- **Old words that stay.** `git grep` for the four retired words under
`skills/` still finds prose, the location table and eval fixtures. They
are not compiled and they are PR 2's.
- **Main moved after the base.** origin/main went from `f926dfab` to
`a3c229ea` during the run. None of the five files changed there and `git
merge-tree` reports a clean merge. The readings above were not repeated
on the merged tree.

## Verification

Read first, by risk:

1. `skills/objectstack-ui/SKILL.md`, the hunk at line 136. This JSON is
served to clients by the hosted door, and it is the one example in a
section whose headline is that a write button needs a placement.
2. `skills/objectstack-ui/rules/actions.md`, the hunks at lines 69 and
96. Each dropped two words, a header placement and a row placement.
3. `scripts/check-skills-token-ratchet.mjs`, the three rows. Each new
number is the gate's own measurement.

Two-minute check, no build needed: `pnpm --filter @objectstack/spec run
check:skill-served-sections`. Expect the last line to end with `10 JSON
fence(s) parse and pass their spec validators.` and exit 0.

## Human Minimum

- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(No schema changes.)
- [x] 2. Every name I added uses the casing for its kind. (No name
added.)
- [x] 3. No formatter ran. `pnpm lint` is CI's on this PR.
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: not touched.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.

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

https://claude.ai/code/session_01L9qibztwLPZEpzDMBn2GM6

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…entry; it binds to the deployment's store (objectstack-ai#38026)

repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP

Fixes objectstack-ai#37306

Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: follow-up objectstack-ai#37310 — `skills/**` teaches the optional
`adapter` and the item mount after this lands

## 维护者速读

- 用户能看到什么变化:应用作者写知识源时不必再指定存储,也不必在应用里声明需要知识服务;在本机开发(SQLite)、PostgreSQL
和自带存储的部署上,同一个知识源无需修改即可建索引和检索。
- 为什么做:知识库检索专题(按调用者权限过滤的知识检索)中“知识源可移植”的一行,替写知识源的应用作者和 AI
解决“换个数据库就要改知识源”的问题。
- 出错会怎样:最坏是同时注册了两个以上存储、且都不是部署自带的那个时,未写存储的知识源在保存时被明确拒绝并列出可选项;改动可直接撤回。
- 要你做什么:无(“运行中首次保存、部署未装知识服务时怎么办”已拆成单独的待裁决卡)。

## What changes

**Mechanism (the deployment's-store mark).** It is a service option, not
a contract member: `KnowledgeServicePlugin` / `KnowledgeService` take
`deploymentAdapter?: string`, which the runtime sets to the adapter id
of the store it mounted (`resolveCapabilityArgument('knowledge', …)`
answers `{ deploymentAdapter:
resolveKnowledgeStore(input).store.adapterId }`, the same resolution
`resolveCapabilityExtras` mounts from). `IKnowledgeAdapter` and
`registerAdapter` are unchanged, so an adapter that application code
registers is never the deployment's by registering.

1. **`adapter` optional** (`@objectstack/spec`, ADR-0161 K4 / K8 item
11). `KnowledgeSourceSchema.adapter` is `z.string().optional()`.
Omitted, the source is held by the marked store, else the only adapter
registered. Several registered and none the deployment's ⇒ refused at
registration on both doors (`registerSource`, the `knowledge_source`
loader) and at save (`admitAuthoredSource`), `400 VALIDATION_ERROR`,
naming the choices. A source registered first and left unplaceable by
adapters that came later answers the same refusal at index and search,
and `reportUnmountedAdapters` names it once at boot. No adapter at all ⇒
`503 SERVICE_UNAVAILABLE`, naming the marked store.
2. **Placement is resolved where it is used** (`adapterIdFor` /
`adapterFor` / `boundAdapterId`), so a code-door source registered at
init finds a store plugin that registers in `start()`. Every
`getAdapter(source.adapter)` call site (reindex, index state, record
sync, delete, search planning, reap guard, `dropMetadataSource`) now
goes through it. `index_status` reports the adapter a source is placed
on.
3. **An item mounts the service** (K8 item 12).
`PlatformCapabilityProvider` gains optional `mountedBy: { collection }`;
the `knowledge` row of `PLATFORM_CAPABILITY_PROVIDERS` carries `{
collection: 'knowledgeSources' }`. (Review S1, record 7224273377: the
earlier `type` member had no reader and repeated what the spelling map
owns, so it is dropped.) `@objectstack/core` adds
`stackItemCapabilities(stack)` (top level, then each package body), and
`resolveServedCapabilities(…, { itemTokens })` serves them as declared
tokens, reported in a new `byItems` set. `os serve` / `os dev` / `os
start` and verify's `bootStack` read it and pass `database` to the
argument resolver. `os migrate plan` / `apply` compose the same set:
`stackItemCapabilities` is a composition step of both boots in
`boot-preparation-parity.test.ts`. This answers CI's Test Core red at
aba523a and the review's N3.
4. **Item 4 is split to objectstack-ai#37983 (seat ruling).** The first
`knowledge_source` saved at run time on a deployment with no knowledge
service behaves exactly as on main: row 3a's boot line and behaviour are
unchanged. The built item-4 code is kept on
`claude/area-o1C-37306-item4` (fa2b538).
5. **Docs**: `content/docs/ai/knowledge-rag.mdx`,
`content/docs/protocol/knowledge.mdx`; references regenerated
(`gen:docs`).

What a 19.0.0-next.1 stack sees: one that ships a source without
`requires: ['knowledge']` held an inert item with a boot warning. It is
now indexed: the service mounts, the boot pass builds the index, and the
content fields are sent to the configured embedder (ADR-0161 K5:
embedding is egress). The changeset says the same.

Unchanged: a named adapter that is not mounted answers
`SERVICE_UNAVAILABLE` as before (objectstack-ai#37102); a host that mounts
`KnowledgeServicePlugin` itself gets no store and no mark from the
runtime; without a source or the token nothing is mounted. Out of scope
as fenced: `skills/**` (objectstack-ai#37310), the Studio form (objectstack-ai#37309), hosted/EE
mounts, objectstack-ai#37479's unmounted-adapter reporting.

### Deviations (declared)

- **`@objectstack/runtime`, MCP draft door**
(`packages/runtime/src/domains/mcp-authoring.ts`, `itemSaveRefusal`): a
finding from the dev of card objectstack-ai#37983, carried here. The door spelled
every refusal that was not a 403 as `SERVICE_UNAVAILABLE`, so the new
`400 VALIDATION_ERROR` from `admitAuthoredSource` arrived over MCP as
`SERVICE_UNAVAILABLE` with status 400. Now a 403 stays
`PERMISSION_DENIED` and any other verdict keeps its own code, as the
REST door already does. It carries a pin in `mcp-authoring.test.ts` and
a `@objectstack/runtime` patch entry in the changeset. Outside the
claimed file surface.
- **`@objectstack/cli`, the migrate boot**
(`schema-migration-plugins.ts`, `composeServedPlatform`): it reads the
item tokens as `serve` does. The step pin and a behaviour pin cover it:
an item-only stack composes `KnowledgeServicePlugin`, and the control
does not.
- **Two semantic conflicts with main**: main's new readers of the
`adapter` field this change makes optional. Both now read the store a
source is placed on (`boundAdapterId`), each with a pin.
- The boot build pass (main's first-build pass at boot), in 205f667.
- The reconcile's no-`listDocuments` check (main's scheduled reconcile),
in merge 635fb18.
- **Accepted overlaps (seat ruling)**:
- objectstack-ai#37963: one hunk in `knowledge-service.ts`. That PR absorbs the merge
after this lands.
- objectstack-ai#38015: the generated
`content/docs/references/ai/knowledge-source.mdx`. objectstack-ai#38015 has landed.
This head merges main and regenerates the page on the merged tree
(`gen:schema` + `gen:docs`).

File surface beyond the claim, declared:
`packages/runtime/src/domains/mcp-authoring.ts` and its test,
`packages/cli/src/utils/schema-migration-plugins.ts` and its test plus
`boot-preparation-parity.test.ts` (above), the `knowledgeSources`
describe in `packages/spec/src/stack.zod.ts`, `service-knowledge` plugin
options, `knowledge-build-actions.ts`, `knowledge-reap-guard.ts`,
`packages/verify/src/required-providers.ts`,
`packages/core/src/capability-providers.ts` (comments only).

Read first (by risk):
1. `packages/services/service-knowledge/src/knowledge-service.ts`:
`adapterIdFor` and `refuseUnplacedSource`, where the refusal and
placement rules live.
2. `packages/core/src/capability-composition.ts`:
`stackItemCapabilities` and the `knowledge` branch of
`resolveCapabilityArgument`.
3. `packages/spec/src/kernel/platform-capabilities.ts`: the `mountedBy`
row field, the public surface this adds.

Two-minute verification: `pnpm --filter @objectstack/verify exec vitest
run src/harness.required-providers.test.ts -t "an item, no adapter, no
token"` should print one passing case: a stack with a `knowledge_source`
that names no adapter and no `requires: ['knowledge']` boots
`KnowledgeServicePlugin` + `KnowledgeTursoPlugin`, places the source on
`turso` beside an app adapter, and finds the Chinese row for `住宿标准 报销`.

## Tests

Local, under the shared verify lock, at 633041b (the last commit,
af27454, adds only module-top imports to one cli test file; that file
was re-run, see below).

<details><summary>Suites and typecheck</summary>

- `@objectstack/spec` (whole package): 909 files / 28749 passed (+1
todo).
- `@objectstack/core` `capability-composition.test.ts`: 25/25.
- `@objectstack/service-knowledge`: 18 files / 563 tests.
- `@objectstack/verify` `harness.required-providers.test.ts`: 16/16.
- `@objectstack/cli` `boot-preparation-parity.test.ts` +
`schema-migration-plugins.test.ts`: 2 files / 93 tests, at 633041b
and again at af27454 (cli typecheck exit 0 at both).
- `@objectstack/runtime` `mcp-authoring.test.ts`: 73/73, at aba523a;
runtime is unchanged since.
- Typecheck exit 0: spec, core, service-knowledge, verify, cli, runtime.

</details>

<details><summary>Ablations (each restored; blob == HEAD, `git diff
HEAD` empty)</summary>

| Pin | Mutation | Result |
| --- | --- | --- |
| A1 | the deployment's mark in `adapterIdFor` | 2 failed |
| A2 | the registration refusal | 1 failed |
| A3 | the item tokens in `resolveServedCapabilities` | 1 failed |
| A4 | the `knowledge` capability argument | 1 failed |
| A6 | `adapter` optional, redone as `z.string().min(0)` (the first try
was a no-op) | 1 failed |
| A7b | `stackItemCapabilities`, core dist | verify case fails: the
knowledge service is not found |
| A8 | the mark argument, core dist | verify case fails: source refused,
then a TypeError |
| A9 | boot pass reads the named adapter | the boot pin fails |
| A10 | reconcile reads the named adapter | the reconcile pin fails |
| A11 | MCP door respells non-403 as `SERVICE_UNAVAILABLE` | the pin
fails: `SERVICE_UNAVAILABLE` where `VALIDATION_ERROR` was expected |
| A12 | the migrate boot passes no item tokens | the behaviour pin
fails: `KnowledgeServicePlugin` is not composed |

A5 left with item 4.

</details>

## Acceptance notes

- PostgreSQL (pgvector) acceptance is NOT MEASURED end to end, locally
or in CI.
- CI's `capability-mount.live-postgres.test.ts` names `adapter:
'pgvector'` and `requires: ['knowledge']`, so it exercises neither the
omitted adapter nor the item mount (review N2).
  - What pins the card's PostgreSQL line is two unit pins, composed:
- `resolveCapabilityArgument('knowledge', postgres)` answers `{
deploymentAdapter: 'pgvector' }`, the store `resolveCapabilityExtras`
mounts for the same database (core).
- A source with no adapter binds to the marked store
(service-knowledge).
  - Follow-up: objectstack-ai#38040 drops `adapter` and `requires` from the live case.
- Known gap, both boots alike: `os serve --artifact-fallback` (no
config, the stack synthesized from the artifact JSON) reads items from a
config that carries no `knowledgeSources`. The artifact result surfaces
`requires` but no item collection, so an artifact-only stack's sources
do not mount the service there. Follow-up: objectstack-ai#38039; not built here.
- Item 4 and its Acceptance line moved to objectstack-ai#37983 (seat ruling).

## Verification

<details><summary>Container run (os dev, scratch app; at fa2b538,
items 1-3 unchanged since)</summary>

The scratch app held one `knowledge_source`, with no `adapter` and no
`requires`. The embedder was a local bigram fake.

1. `os dev --fresh` booted `KnowledgeServicePlugin` and
`KnowledgeTursoPlugin`.
2. Three Chinese rows were POSTed (201 ×3).
3. `os knowledge rebuild kbx-kbx_policies` ended `done`: 3 rows read, 3
written.
4. `os knowledge status` showed `adapter turso`, `index: current`.
5. MCP `search_knowledge '住宿标准 报销'` ranked `差旅住宿标准` first (score 0.436).

</details>

<details><summary>Gates</summary>

- `dispatch-gates --commands` at 633041b derives 129 families.
- NOT MEASURED locally:
- `check:type-check-debt`: its closure build needs the shared lock (CI
ran `Type Check · debt ledger` green at aba523a).
- `check:skill-examples` and `check:dual-build-cjs-loads`: they exit 3
on prerequisites outside this diff (the client-react, studio and
scenarios dists are not built).
- Exit 0: every other family, the ones that read built output re-run
after the build. That includes `check:generated` ("All 14 generated
artifacts are up to date"), `check:api-surface`, `check:dts-closure`,
`check:i18n*`, `check:docs-transcript-drift` and `check:nul-bytes`.
- `check:test-source-alias` failed once, on the edited cli test file.
The test now pays its dynamic imports at module top, and the gate exits
0.
- overlap-check at af27454 exits 1 against objectstack-ai#37963 only (accepted).
Clean: origin/main, objectstack-ai#38038, objectstack-ai#38037, objectstack-ai#38033, objectstack-ai#38013, objectstack-ai#37982, objectstack-ai#37929.

</details>

---

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

https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…ption badge (objectstack-ai#37986)

<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoAoNwrZVJoUEFfvMURpRPKJ)_
Fixes objectstack-ai#37435
Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户能看到什么变化:搭建者(人或 AI)给下拉选项写了 teal、amber、大写的 Red
这类界面画不出来的颜色时,校验命令和保存时都会收到一条提示,说明这个颜色会显示成灰色、该怎么改;写九个色系名或十六进制色的不受影响。
- 为什么做:上一张卡已经定下"选项颜色只认作者声明、没配就灰",但写错的颜色也会静默变灰,作者不知道自己写错了。
- 出错会怎样:只是提示、从不拒绝保存,误报最多多一条警告;平台和示例里现有的选项颜色没有一条会触发,可直接撤回。
- 要你做的:无。

## What changes

- New advisory rule `field/option-color-renders-neutral`
(`lintOptionColors` in `packages/lint/src/data-model-rules.ts`). It
warns on a select option `color` the option badge does not paint:
anything that is not one of the nine palette families (`gray red orange
yellow green blue indigo purple pink`, lowercase, as `BADGE_COLOR_MAP`
matches them) and not `#` + 3 or 6 hex digits. The warning names the
option; the fix line names the spelling the value already points at
(lowercase family, the hex with its `#`, the hex without alpha digits),
otherwise the families and the hex form. It never maps a colour name to
a family.
- Route (a) as a warning, not (b) a name-to-family map: (b) is
consumer-side tolerance that invents a colour the author did not pick,
close to the value-derived colour ruling A on objectstack-ai#36882 removed (「A
全部去掉,没配就灰」). Not a refusal: `SelectOption.color` stays `z.string()`, and
charts and gantt bars paint a CSS colour name.
- Registered in `AUTHORING_RULES` as `tier: 'advisory'`, on `os
validate` / `os build` / `os lint`, and on the runtime publish gate for
`object` and `object_extension` writes, where findings ride back as 2xx
`advisories` (the save door Studio, REST `/meta` and MCP authors share).
Judges object fields, object-extension fields, picklists and picklist
extensions; picklists are CLI-only because `picklist` is not
runtime-creatable.
- `os explain field/option-color-renders-neutral` entry in
`rule-explanations.ts`, with the measured per-surface reading.
- Root barrel publishes `FIELD_OPTION_COLOR_RENDERS_NEUTRAL`,
`OPTION_COLOR_FAMILIES`, `isBadgePaintableOptionColor`,
`lintOptionColors`, type `OptionColorPicklist`.
- Object and object-extension door roster pins gain the rule (three test
files), and the four docs CLI transcripts print 87 author-time rules
(`check:docs-transcript-drift`).

## Tests

- New pin
`packages/lint/src/data-model-rules.option-color-37435.test.ts`: `teal`
warned (rule, severity, path, where, fix names all nine families) and
`amber`, `Red`, bare hex, alpha hex, `rgb()`, `hsl()`, leading-space hex
all warned; every declared family and `#abc` / `#14b8a6` not warned;
blank colour not judged; extension and picklist paths; all three
commands; at the save door `teal` comes back as an advisory with zero
errors, and `red` / a hex with none.

## Acceptance notes

- Door crossing: this is an advisory-tier rule at the object door. The
five fenced advisory rules (objectstack-ai#4716 adjudication,
`RUNTIME_OBJECT_ADVISORY_VOLUME`) stay fenced and untouched; that fence
prices advisory VOLUME. Measured volume for this rule: 0 firings. Census
of option-level colour literals: objectstack at 6e11ff2 (`*.object.ts`,
picklists, extensions; non-test) is every one a family name or a 6-digit
hex; the only out-of-family names (`teal`, `amber`, 9 sites) are
OBJECT-level `color`, which this rule does not read. hotcrm at 08a7451:
170 colour literals, all 6-digit hex. The one out-of-family option
colour in the tree is a test fixture
(`ui/e2e/list-condition-row-35549.spec.ts:87`, `amber`).
- Single source of the family list: `@objectstack/lint` cannot import
`@object-ui/fields` (lint depends on spec only and runs in the kernel's
save door), and a lint test reading the renderer source would need a
`scripts/cross-package-test-inputs.mjs` + `turbo.json` declaration
outside this claim's file surface. The list is therefore spelled once in
lint (`OPTION_COLOR_FAMILIES`) with a comment naming `BADGE_COLOR_MAP`;
the shared home both sides could read is `@objectstack/spec`, left as an
open question in the report rather than taken here.
- Not judged: a form view's own option list, and an object extension's
`fieldPatches`.
- The runtime advisory has no localized `userMessage` (no
`.user-text.ts` catalog); Studio renders the English `message`.

## Verification

- Two-minute check: `pnpm --filter @objectstack/lint exec vitest run
src/data-model-rules.option-color-37435.test.ts` → 9 passed.
- Read first: `packages/lint/src/data-model-rules.ts`
(`isBadgePaintableOptionColor`, must match the renderer's reading),
`packages/lint/src/authoring-rules.ts` (the `lintOptionColors` entry and
its door comment), `packages/lint/src/rule-explanations.ts` (the
per-surface paragraph).

<details><summary>Local readings (HEAD after the docs commit)</summary>

- `pnpm --filter @objectstack/lint test` → Test Files 244 passed (244),
Tests 9816 passed, 5 skipped; `pnpm --filter @objectstack/lint
typecheck` (tsc + test layer) green.
- Ablation: `isBadgePaintableOptionColor` forced to `true` on disk → 5
of 9 pins red (the out-of-family pin included); restored with `git
checkout HEAD`.
- `node scripts/pm/overlap-check.mjs
--branch=claude/project-thread-ciejge` → `VERDICT clean exit 0`, objectstack-ai#37929
(shares `rule-explanations.ts`) merges cleanly.
- Derived gate families run locally; `check:dual-build-cjs-loads` and
`check-plugin-teardown-shape --self-test` are NOT MEASURED here (no full
build; shallow clone) and are left to CI.

</details>

---

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…hat draws as money (objectstack-ai#38100)

<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoJgGMcVYe3tSvxAWdknWFST)_

Fixes objectstack-ai#37890
repo:objectstack#3 · os-tesla · session_01L9qibvqGhhENZcAuiMxqA7

Clause-②: no
Metadata-protocol: none

## 维护者速读
- 手机上看订单行、报价行这类明细列表时,卡片右下角的金额现在显示这一行的总额,不再错显示单价;电脑上的表格不变。
- 属于手机端列表卡片的体验线,替 HotCRM 等有明细行的应用解决金额读错的问题。
- 只改卡片挑哪一列当金额,数据和接口都不变;若挑错,最多是卡片上金额位置显示另一列,可以直接撤回。
- 无

## What changes
- `ui/packages/plugin-grid/src/ObjectGrid.tsx`,
`buildMobileCardRenderer`: the amount slot now takes the first shown
body column whose value draws as money. That is a `currency` column, or
a `formula` / `summary` column for which
`resolveFormulaValueType(fieldDef, number)` (the exported
`@object-ui/fields` rule the formula cell draws by) answers `currency`:
a formula declaring `returnType: 'currency'`, or a summary declaring its
currency (`currencyConfig`). The slot is still chosen once for the list,
so every card keeps one shape.
- Unchanged: a masked column is not promoted; a view that presents the
field as another type (column `type`) keeps it a plain value; a
number-returning formula is not an amount; view order still picks among
several money columns; desktop table untouched.
- No new export (seat ruling: option A). `patch` changeset for
`@object-ui/plugin-grid`.

## Why
On a phone, an order line (2 × 6,000.00, 10% off) showed its unit price
6,000.00 in the amount slot; the line total 10,800.00 is a formula
returning currency, which the slot never considered. Reordering columns
did not help: the total moved into the subtitle.

## Tests
`ui/packages/plugin-grid/src/__tests__/phoneCardAmount-34615.test.tsx`,
a new top-level `describe` in the existing harness (390 px):
- currency formula shown before the unit price → amount `CN¥10,800.00`,
subtitle `2 · CN¥6,000.00`;
- currency formula as the only money column → amount `CN¥10,800.00`;
- summary declaring its currency → amount `CN¥777.00`;
- unit price shown first stays the amount (view order unchanged);
- CONTROL: number-returning formula → no amount line;
- CONTROL: the currency formula presented as `type: 'text'` → no amount
line.

<details><summary>Readings (head f800825 = b4dd4f2 + merge of
origin/main 815e882..f72f335)</summary>

- New describe at b4dd4f2: `Tests 11 passed (11)` for the harness file.
- Ablation on the committed fix (ObjectGrid.tsx restored from base
815e882, tree only, then restored from HEAD; `drawsAsMoney` count 0 → 2
on disk): `Tests 3 failed | 8 passed (11)`. The three red are exactly
the predicted RED directions; both CONTROLs and all five objectstack-ai#34615 cases
stay green.
- After merging origin/main (which brought objectstack-ai#37929, also in plugin-grid)
and rebuilding the closure (`turbo run build
--filter='@object-ui/plugin-grid^...'`, 57/57): `pnpm --filter
@object-ui/plugin-grid type-check` exit 0; `pnpm --dir ui exec vitest
run packages/plugin-grid/`: `Test Files 319 passed (319)`, `Tests 2805
passed (2805)`.
- eslint on the two changed files: 0 errors (155 warnings, none on the
changed hunk).
- `dispatch-gates --ran` at b4dd4f2: 39 derived, 39 run, all exit 0, 0
NOT MEASURED, 0 unrun.
</details>

## Acceptance notes
- Premise measured on origin/main 815e882 before writing (390 px probe,
readings on the card's pre-claim report): unit price first → slot
`CN¥6,000.00`; total first → slot still `CN¥6,000.00`, total in
subtitle; formula-only or summary-only → no slot, though the cell
already drew currency.
- `objectstack-ai#37929` and `objectstack-ai#37924` also touch `ObjectGrid.tsx`, in hunks far from
this one; whichever lands later merges main.

## Verification
Read first (by risk):
1. `ObjectGrid.tsx`: `drawsAsMoney` and the `amountCol` line under it.
2. The new `describe` in `phoneCardAmount-34615.test.tsx`, especially
the two CONTROL cases.

Two-minute check: `pnpm --dir ui exec vitest run
packages/plugin-grid/src/__tests__/phoneCardAmount-34615.test.tsx` shows
11 passing; replace `drawsAsMoney(c)` with `c.type === 'currency'` and
the same command shows 3 failing.

## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(not touched)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes. (eslint on the two
changed files: 0 errors)
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: n/a.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.

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

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

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…ings its write raised, and the console toast shows them (objectstack-ai#38076)

<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6Jao3VQSGvy9zYGn6FpGEZRCnJ)_

Fixes objectstack-ai#37867
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

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

## 维护者速读
-
用户点「确认订单」这类改状态的按钮时,如果这次写入触发了警告型校验规则,现在会弹出一条警告样式的提示,规则作者写的话就在提示里,撤销按钮照样在;以前只弹成功提示。
- 替用按钮改状态的应用解决:警告规则以前只在编辑表单里生效,最常用的按钮路径静默通过(HotCRM 订单超出框架合同额度就是实例)。
- 写入本身不变,只是应答多带警告、提示换样式;如果有问题,最多是提示样式不对,可以直接撤回。
- 无

## What changes
- `packages/runtime/src/action-execution.ts`:
`executeDeclarativeUpdateAction` copies the `warnings` the data-plane
update answered (`protocol.updateData`, the data door's own
`ValidateDataIssue` elements) onto its result. `DeclarativeUpdateResult`
gains an optional `warnings`, present only when the write raised an
advisory rule hit, so a write that trips nothing answers byte-for-byte
as before. Both action doors (REST `POST /api/v1/actions/...` and MCP
`run_action`) go through this executor. The stale roll-up path
(`ERR_SUMMARY_RECOMPUTE`) composes from the same `written` answer, so it
carries them too.
- `ui/packages/core/src/actions/ActionRunner.ts`: for an `operation:
'update'` action only, the runner reads the answer's `warnings`
(distinct messages, in answer order). When there are any, the success
toast takes the `warning` variant, with the messages as its
`description` and the Undo affordance kept. This is one toast, the way a
record save raises one (`toastRecordSave`). When the author turned the
success toast off (`toast.showOnSuccess: false`, or a result dialog),
the warning is still shown, in the rule's own words, so no new runner
text is needed. `ToastHandler` options gain an optional `description`.
- `ui/packages/app-shell/src/hooks/useConsoleActionRuntime.tsx`,
`ui/packages/app-shell/src/views/RecordDetailView.tsx`: both console
toast handlers used to send every non-error toast to `toast.success`.
They now honour `type: 'warning'` and call `toast.warning(message, {
description, duration, action })` with the same Undo action.
- Changeset: `@objectstack/runtime`, `@object-ui/core`,
`@object-ui/app-shell` patch.

Not changed: `packages/spec` (the action answer has no zod declaration,
it is the runtime's TS interface), locale packs (no new text), HotCRM
(its `confirm_sales_order` and `framework_quota_exceeded` work as
authored).

## Tests
- `packages/runtime/src/action-declarative-update.test.ts`, a new
top-level `describe` in the shared harness. It puts a `protocol` slot in
front of the caller-honouring rig. REST: the 200 answer carries the
write's warnings, element for element, beside the record and the undo
anchor. MCP `run_action`: the same write gives the same warnings.
Control: a write that trips no rule has no `warnings` key. The file
gains a module-top `import '@objectstack/metadata'` so the dispatcher's
lazy load is paid at collection (`check:test-source-alias`).
-
`ui/packages/core/src/actions/__tests__/ActionRunner.updateOperation.test.ts`,
a new `describe` through the real `createServerActionHandler`: one
warning toast with the success message as title and the rule's words as
description; repeated messages said once and distinct ones one per line;
Undo kept on an undoable action; control with no warnings is a plain
success toast with no description; success toast off still warns;
reverse pin: a script action without `operation` never reads a
`warnings` key.
-
`ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.undoLookupId-11122.test.tsx`
and
`ui/packages/app-shell/src/views/RecordDetailView.undoLookupId-11122.test.tsx`,
a new `describe` in each, down to `sonner`. On a grid row and on the
record page, the update's warnings raise `toast.warning` once with the
description and the Undo action, no success toast, and Undo restores the
stored value. Both harnesses' route stubs gained an optional answer
body. These two test files are a surface amendment to the claim,
reported to the seat.

## Acceptance notes
- Premise measured on `origin/main` `815e882b` before any edit. Through
the real `HttpDispatcher.handleActions` →
`executeDeclarativeUpdateAction` → `callData`, the protocol's
`updateData` answered `["object","id","record","warnings"]` and the
action's 200 body carried `warnings` 0 times.
- The same executor also drops the data door's `notice` (a hook's
message for the person) and `droppedFields`. Out of scope here; the seat
files them.
- `ToastHandler` and the action answer each gain one optional member.
Nothing is refused or narrowed.

## Verification
- Two-minute check: `pnpm --dir ui exec vitest run
packages/core/src/actions/__tests__/ActionRunner.updateOperation.test.ts`
shows 19 passed, 6 of them the new block.
- Read first: `executeDeclarativeUpdateAction`'s result block
(`action-execution.ts`), then the success-toast arm of
`handlePostExecution` (`ActionRunner.ts`).

<details><summary>Local readings at 40c5c82</summary>

- New and edited suites: `action-declarative-update.test.ts` 37 passed;
`ActionRunner.updateOperation.test.ts` 19 passed;
`useConsoleActionRuntime.undoLookupId-11122` 6 passed;
`RecordDetailView.undoLookupId-11122` 4 passed.
- Full: `pnpm --filter @objectstack/runtime test` Test Files 655 passed,
Tests 12316 passed, 25 skipped. ui vitest `packages/core/src/actions`:
58 files, 810 passed. app-shell `useConsoleActionRuntime*` +
`RecordDetailView*`: 128 files, 1104 passed.
- Typecheck exit 0: `@objectstack/runtime` (test layer 27 files / 183
errors held in the ledger, unchanged), `@object-ui/core` `type-check`,
`@object-ui/app-shell` `type-check`.
- Ablations through `scripts/ablation-replace.mjs`, each restore blob ==
HEAD: runtime `warnings` spread removed, 2 failed (REST, MCP); the
runner's warnings read emptied, 6 failed (4 core, 2 hosts); each host's
warning arm disabled, 1 failed each.
- `dispatch-gates --ran` with recorded exit codes: 73 derived, 71 exit
0, 2 NOT MEASURED (exit 3: `check-plugin-teardown-shape --self-test`,
fixture commit outside the shallow clone; `check:dual-build-cjs-loads`,
needs a full `pnpm build`), 0 unrun. `check:test-source-alias` exit 0 at
40c5c82.
- `overlap-check.mjs` VERDICT clean exit 0 against main and objectstack-ai#37929,
objectstack-ai#37924, objectstack-ai#37896.
</details>

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

<!-- signed: repo:objectstack#3 · os-tesla ·
session_01L9qiby3dfNfCgpXwPkB2Hf -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
… on (objectstack-ai#38104)

repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6JaoEfAeSobHZgSLfHP3844ZfC)_

Fixes objectstack-ai#37895

This is PR 2 of 2 on that card. PR 1 was objectstack-ai#37947 (merged as `b4921982`);
objectstack-ai#37929 put the new words on `main` as `58b513a6`.

**Ordering: this must land before the next `next` prerelease is cut**
(serial note 7227457027 on the card). `main` has refused the four
retired location words since `58b513a6`, and the published skills still
teach them. A prerelease cut before this lands ships skills that teach
words its own save door refuses.

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户能看到什么变化:写应用的 AI
助手读到的「按钮放在哪里」说明换成了新词,只说按钮作用在列表上还是一条记录上;六个按钮示例重新写明了位置。
- 为什么做:「按钮位置改用新词」这项工作已经合入主线,旧的四个位置词保存时会被拒绝,而技能包还在教旧词。
- 出错会怎样:照技能包写按钮的 AI 助手会写出保存不了、或者哪里都不显示的按钮;本改动只动说明文字和示例,可以直接撤回。
- 要你做什么:在下一个预发布版本切出之前合并本改动(技能包属于要你亲手合并的范围)。

## What changes

The published skills teach the action `locations` vocabulary that
`@objectstack/spec` 19 accepts: `list` (acts on no record) and `record`
(acts on one record: the record page and each list row), with the narrow
words `record_page`, `record_row`, `record_related` and
`record_section`. Vocabulary ruling on objectstack-ai#36495, verbatim: 「照卡上这套」
(7213827153).

| File | Change |
|:--|:--|
| `skills/objectstack-ui/rules/actions.md` | The location table's four
page-part rows become `list`, `record`, `record_page`, `record_row`. One
line under the table names what replaced each old word. The
`actionLayout` paragraph says the `record` arm takes `record` /
`record_page` actions and the `list` arm takes `list` actions, which is
what `validateObjectActionLayout` enforces. The `defaultFromRow`
sentence names `record` / `record_row`. Five checked examples declare
`locations` again. The opening sentence is cut (see the token rows). |
| `skills/objectstack-ui/SKILL.md` | The "Mark as done" JSON in Actions
declares `"locations": ["record"]`. Nothing else changes: against `main`
the file differs by that key alone. |
| `skills/objectstack-ui/rules/record-page.md` | A `record_section`
action that must show on the standard page also lists `record_page`. |
| `skills/objectstack-formula/SKILL.md` | "a list row" in place of the
retired word in the sparse-row paragraph. |
| `skills/objectstack-ui/evals/views-apps-actions-pages.json` | Cases 3,
14, 24 and 26 expect the new words. Case 3's `must_contain` token is
`'record'`. |
| `skills/objectstack-ui/evals/record-page.json` | Case 3:
`placedActions: true` draws the actions placed at `record` or
`record_page`. |
| `scripts/check-skills-token-ratchet.mjs` | Three rows move to their
measurements (below). |
| `.changeset/37895-skills-action-locations-acted-on.md` | `patch` for
`@objectstack/skills`. |

`skills/objectstack-ai` is not touched: no Ask AI example and no
placement is written back there.

### The word each example takes

| Example | Before PR 1 | Now | Drawn |
|:--|:--|:--|:--|
| `crm_reassign_lead` | `record_header`, `list_item` | `record` | as
before |
| `crm_convert_lead` | `record_header`, `list_item` | `record` | as
before |
| `crm_print_a3` | `record_header` | `record_page` | as before |
| `mark_done` (SKILL.md JSON) | `record_header` | `record` | also on
each list row |
| `crm_open_invoice_pdf` | `record_header` | `record` | also on each
list row |
| `crm_add_invoice_line` | `record_header` | `record` | also on each
list row |

The first three are the lossless conversion
(`action-locations-acted-on`). The last three were header-only and now
take `record`. This is a judgement, and the alternative is `record_page`
on those three lines:

- The spec's docblock calls `record` "the word an action that acts on a
record writes by default", and the ruled vocabulary treats the other
four as exception words. Nothing in these three examples, or in eval
case 14's prompt (a "button on `task` records"), limits the action to
the record page.
- An agent copies the placement it sees. With `record_page` on four of
six examples, agent-written apps would use an exception word as the
norm.
- None of the three carries a `visible` or `disabled` predicate, so the
sparse list row adds no risk to them.
- `crm_print_a3` keeps `record_page`: N1 asks for its placement back,
and it gives the file one checked example of a narrow word in the
`record` arm.

Eval cases 24 and 26 use `record_page`: case 24 describes existing
header actions, and case 26's prompt asks for a button "on the record
page".

## Why

objectstack-ai#37929 retired `list_toolbar`, `list_item`, `record_header` and
`record_more` on `main`. The skills are what an agent reads before it
writes an action, so an agent following them wrote a word that validate
and save refuse. PR 1 had also left six examples with no placement at
all, which made the `actionLayout` example beside them an error (N1).

## Acceptance checklist

- [x] Card: `git grep -nE
"record_header|record_more|list_item|list_toolbar" -- skills/` returns
one line, `skills/objectstack-ui/rules/actions.md:28`, the line that
names the conversion.
- [x] Card: eval expected outputs use the new words; the token rows
follow the measurement; the skills checks pass (Tests).
- [x] N1 (7218905729): `crm_convert_lead` and `crm_print_a3` are placed
in the `record` arm's scope again. A probe that runs
`@objectstack/lint`'s two rules over the examples as written reports 2
`object-action-layout-not-placed` on `main` and 0 at this head.
- [x] N2 as corrected in 7221834136: six examples declare a placement
again, and the eval cases that expected the old words moved with them.
Nothing is written back into `skills/objectstack-ai`; its eval case 10
still refuses `locations:`.
- [x] Ordering (7227457027): stated at the top of this body.

## Size of the published skills

| Reading | Lines before | Lines after | Tokens before | Tokens after |
|:--|--:|--:|--:|--:|
| `skills/objectstack-ui/rules/actions.md` | 262 | 268 | 3844 | 3918 |
| `skills/objectstack-ui/SKILL.md` | 165 | 165 | 2256 | 2262 |
| `skills/objectstack-ui/rules/record-page.md` | 64 | 64 | 990 | 990 |
| `skills/objectstack-formula/SKILL.md` | 485 | 485 | 6090 | 6088 |
| `skills/objectstack-ui/evals/views-apps-actions-pages.json` | 275 |
275 | not ratcheted | not ratcheted |
| `skills/objectstack-ui/evals/record-page.json` | 119 | 119 | not
ratcheted | not ratcheted |
| Bundle: all 14 `SKILL.md` files | 4936 | 4936 | 65337 | 65341 |
| Authored files the ratchet prices | n/a | n/a | 199591 | 199669 |
| Eval fixtures (measured, not ratcheted) | n/a | n/a | 88563 | 88550 |

Net change under `skills/`: 26 lines added, 20 removed, **+6** against a
budget of +6. Tokens are the ratchet's own count, `ceil(utf8 bytes / 4)`
with the release-stamp line left out.

### Token rows

- `skills/objectstack-ui/rules/actions.md` **3844 to 3918 (+74)**, by
the standing maintainer ruling of 2026-10-27, verbatim: 「A:先削重复,余额按实测提高」
(ruling record 6513306068, letter B). Restatement cut first, in the same
file: the opening "Actions are user-triggered operations on an object or
a view." (62 bytes; the paragraph under it says how `objectName` binds
an action to an object and how a view names one). The new text adds 359
bytes, of which 130 are the five `locations` lines PR 1 took out as 186.
The file is 15373 to 15670 bytes, and the row is pinned at the
measurement. It is 28 above the 3890 the row held before PR 1.
- `skills/objectstack-ui/SKILL.md` **2256 to 2262 (+6)**, by the same
standing ruling, verbatim: 「A:先削重复,余额按实测提高」 (ruling record 6513306068,
letter B). Nothing is paid down: the file has no restatement to cut, and
the seat ruled at 2026-11-28T02:42Z that the gallery phrase " over an
image, avatar or file field" teaches and stays (ruling on the card). The
+25 bytes are the `"locations": ["record"],` key PR 1 removed as 32
bytes; the file is 9050 to 9075 bytes (9048 priced), and the row ends 2
under the 2264 it held before this card.
- `skills/objectstack-formula/SKILL.md` 6090 to 6088: 7 bytes shorter;
the row follows it down.
- `skills/objectstack-ui/rules/record-page.md`: 990, unchanged (the two
words have the same length).

## Tests

The gates below were re-run at head `a7aee8ef` (the seat's 02:42Z
rework, which restored one phrase in `skills/objectstack-ui/SKILL.md`
and moved its row); the branch's diff against `main` (`f72f3353`) was
empty before the first edit. The placement probe, the `platform-catalog`
test and the eval dry run were read at `27cb6e21`; the rework touches no
example, fixture or script logic.

<details>
<summary>Skills gates: all exit 0</summary>

`@objectstack/spec`, `@objectstack/client` and
`@objectstack/client-react` were built first (turbo, 47 tasks, 0 cached,
`VERDICT command-exit 0`).

- `pnpm --filter @objectstack/spec run check:skill-examples`: exit 0.
`351 prose examples type-check across 3 surface(s)`.
- `pnpm --filter @objectstack/spec run check:skill-served-sections`:
exit 0. `24 served section(s), each heading exactly once in its file (6
json, 2 json+ts, 16 neutral); 10 JSON fence(s) parse and pass their spec
validators.`
- `pnpm --filter @objectstack/spec run check:skill-docs`: exit 0. `Skill
docs in sync`.
- `pnpm --filter @objectstack/spec run check:skill-refs`: exit 0. `10
generated files in sync with packages/spec`.
- `node scripts/check-skills-token-ratchet.mjs`: exit 0. `61 authored
bundle file(s) within their ceilings`. On the first commit, before the
rows moved, it was exit 1, `3 of 114 published bundle file(s) failed
their check`; at this head the three rows sit at their measurement
(3918, 2262, 6088).
- `node scripts/check-skills-token-ratchet.mjs --self-test`: exit 0.
`111 cases pass`.
- `pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2
scripts/platform-catalog.test.ts` (the one test file that names the
ratchet script): `Test Files 1 passed (1)`, `Tests 21 passed (21)`.
- `pnpm --filter @objectstack/scenarios skill-evals --dry-run --skills
objectstack-ui` (the strict reader of the eval fixtures; no model call):
exit 0, `objectstack-ui: 51 case(s)`.
- `pnpm check:nul-bytes`: exit 0.

</details>

<details>
<summary>Derived gate families: 68 derived, 67 run, 1 not
measured</summary>

`node scripts/pm/dispatch-gates.mjs --commands` derived 68 commands for
the 8 changed paths. Each ran with its exit code recorded before any
pipe, and `--ran` answered: `68 derived famil(ies) accounted for — 67
run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)`.

- 67 commands: exit 0.
- NOT MEASURED: `pnpm check:dual-build-cjs-loads`, reason: exit 3,
`PREREQUISITE NOT MET`. It reads the `dist/` of every package, and this
tree built only the three packages above. The diff changes no package
source, so this one is CI's.
- Outside the derived list, run because the order names them:
`check:skill-examples`, `check:skill-refs`, the `platform-catalog` test
and the eval reader's dry run.
- `pnpm --dir ui run check:skill-eval-tokens` exits 0, but it scans the
`skills/objectui` bundle only. It is no reading about the fixtures this
PR edits.
- `pnpm check:dev-prereqs` (local-only family) exits 1: 63 of 110
packages have no `dist/` here, which is the targeted build above and
nothing about this diff.

</details>

<details>
<summary>Does any gate check the examples for a missing or misplaced
placement? No.</summary>

- `check:skill-examples` type-checks the marked TypeScript blocks. An
action with no `locations` compiles.
- `check:skill-served-sections` parses the JSON fences with the spec
schema. `locations` is optional there.
- `action-no-placement` and `object-action-layout-not-placed` are
`@objectstack/lint` rules. They run in `os validate`, `os build` and `os
lint` over a whole stack, and no gate feeds them the skill examples.

One-off probe (not committed): it reads the `defineAction` blocks of
`rules/actions.md`, the Actions JSON fence of `SKILL.md` and the
`actionLayout` example at a git ref, builds a stack from them, and calls
`validateActionLocations` and `validateObjectActionLayout` from the
built `@objectstack/lint`.

| Ref | `action-no-placement` | `object-action-layout-not-placed` |
|:--|:--|:--|
| `origin/main` (`f72f3353`) | 7 | 2 (`record.pinned[0]`,
`record.more[0]`) |
| `27cb6e21` (examples unchanged at `a7aee8ef`) | 1
(`crm_create_campaign`) | 0 |

`crm_create_campaign` has never carried `locations`: a list view's
`bulkActions` places it by name, and the probe's stack has no view.

</details>

## Acceptance notes

- **PR 1's changeset is not edited.** It says an action copied from one
of the six examples needs its `locations` added. This PR's changeset
says that it replaces that note. Both ship in the same release.
- **The branch.** The remote branch was absent when this run started:
`git ls-remote` listed no such head, and `refs/pull/37947/head` still
held `78295ae3`. The work starts from `78295ae3` plus a real merge of
`main` (`b8b31cca`), and the first push created the branch again, with
no force.
- **NOT MEASURED: a skill-evals round** (the with-skill and no-skill
pass rates), reason: it needs a Claude Code login and model calls, and
it is not a merge gate.
- **Case 3's token.** `'record'` is single-quoted, as the file's other
code tokens are. An answer that writes `['record_page', 'record_row']`
is valid metadata and fails the token. The old token, `record_header`,
had the same limit.
- **Not changed, outside this card:** `rules/actions.md` line 3 says
"the six types", and the Action Types table it links to has seven rows.
`content/docs/protocol/objectui/actions.mdx` says the console does not
draw `record_related` yet, while `RelatedRecordActionsBridge.tsx` reads
it; this is a reading of the source and was not exercised.
- **Main moved after the merge.** `origin/main` went from `f72f3353` to
`93fa9118` during the run (two commits: `packages/runtime`, a changeset,
and the lockfile and workspace files). Neither touches a file of this
PR, and the branch was not merged again. At `a7aee8ef`, `origin/main` is
`6e06729a`; `git merge-tree` with it is clean and the PR reads
`mergeable_state: clean`.

## Verification

Read first, by risk:

1. `skills/objectstack-ui/rules/actions.md`: the location table hunk,
and the `locations` line of each of the five examples (the word chosen
for the three header-only ones).
2. `scripts/check-skills-token-ratchet.mjs`: the two raises, the
`rules/actions.md` row (3844 to 3918) and the
`skills/objectstack-ui/SKILL.md` row (2256 to 2262).
3. `skills/objectstack-ui/evals/views-apps-actions-pages.json`: case 3's
`must_contain`.

Two-minute check: run `git grep -nE
"record_header|record_more|list_item|list_toolbar" -- skills/`. Expect
exactly one line, `skills/objectstack-ui/rules/actions.md:28`, which
begins "Until protocol 19:".

## Human Minimum

- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(No schema is touched.)
- [x] 2. Every name I added uses the casing for its kind. (No name is
added.)
- [ ] 3. No formatter ran; `pnpm lint` passes. (No formatter ran. `pnpm
lint` is CI's run and was not run locally.)
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed. (Not touched; `check:skill-docs` and
`check:skill-refs` are in sync.)
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English. (The maintainer's
rulings are quoted in their own words, and the quick-read section is the
house form.)
- [ ] The *Before Submitting* list in CONTRIBUTING.md is done. (All but
`pnpm lint`, as item 3.)

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

https://claude.ai/code/session_01L9qibztwLPZEpzDMBn2GM6

---------

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 pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue protocol:data protocol:ui 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.

3 participants