Repository navigation
feat(studio): a customer adds validation rules to an installed object, saved in its .custom extension - #39581
Conversation
…tom extension The Validations tab of an installed object lists the package's rules read-only and edits the customer's rules in the object's extension in the paired .custom package, saved and published by the extension's Save. A new or renamed customer rule never takes a package rule's name. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvqcHrQpENbRP7eLfU
… at record save Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvqcHrQpENbRP7eLfU
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibvqcHrQpENbRP7eLfU
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
|
repo:objectstack@os-tesla · os-tesla · session_01L9qibvPFnj3TkGq8ps2Jgv L1-a · ACCEPT · #39581 @
For the seat (out of scope, no change here): the body measured that at the HTTP door a pair extension rule bearing a package rule's name replaces it, and Not Tier H. Landing order: #39548 lands first, then this PR merges main (both touch |
…stom-picklist-validation # Conflicts: # ui/packages/app-shell/src/views/studio-design/DataPillar.baseObjectExtension-28575.test.tsx
|
repo:objectstack@os-tesla · os-tesla · session_01L9qibxjHbaJSwcu6suJxbB 2026-12-04T11:27Z · Seat record · land PR #39581 (#39471) at head
|
Fixes #39471
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
Studio → an installed object → Validations now offers New validation rule. Before, the tab showed the package's rules read-only and offered nothing.
object_extensionin the App's paired.custompackage. The top bar's Save writes it through the ensure door and publishes it, which is the same path that already carries__cfields, field patches and the field layout. No server change.active: falsewould turn it off. The claim rules out override and disable.studio-design/pairValidations.ts, splits the served rules into the package's and the pair's and routes edits into the buffer.ObjectValidationsPanel.tsxgets one prop (packageRules).DataPillar.tsxadds call sites only: the published rule names on the buffer, one hook call, and the panel mount. The served-verdict context is not handed down in pair mode, because its paths index the served rules, not the extension's. Copy is in thestudionamespace,enandzh.Scope: item 2 of the card only. Item 1 (adding a picklist value) is split out to its own card for a maintainer route decision, because no door stores a
picklistExtensionsentry in a pair today.Read first (by risk):
ui/packages/app-shell/src/views/studio-design/pairValidations.ts:packageRulesOfdecides which served rules are the package's (by the names the buffer and the published extension declare).ui/packages/app-shell/src/views/studio-design/DataPillar.tsx: the Validations mount, which switchesdraft/onPatch/disabledand drops the verdict context whenpairRulesis set.ui/packages/app-shell/src/views/studio-design/ObjectValidationsPanel.tsx:editorDisabledand the name-input refusal.Tests
DataPillar.baseObjectExtension-28575.test.tsxgets a new top-level describe (the shared base-object harness). The package rule is read-only. The "not negative" preset over the customer'sunits__csaves{ extend, fields, validations }into the pair, sends noobjectsave and publishesobject_extensionat the pair; the body parses againstObjectExtensionSchema. A published customer rule shows once, and its edit replaces it in the extension. CONTROL: walled, nothing is offered or written.ObjectValidationsPanel.test.tsxgets a new top-level describe. Package rules are listed first and read-only. A new rule is named past a package rule's name. Typing a package rule's name is refused and nothing is written. CONTROL: with no package rules the panel is unchanged.packages/runtime/src/domains/meta-object-extension-item.test.tsgets a new top-level describe over the real SQL store and protocol. A rule in the pair's extension refuses a matching insert (VALIDATION_FAILED) and lets another through. It keeps refusing after the base registers again (a reinstall) and after a restart reads the stored row back. This pins behaviour the platform already had; no runtime source changed.Readings (head cfb48d3 unless marked)
pnpm --dir ui exec vitest runon the two studio-design files:Test Files 2 passed (2) · Tests 35 passed (35).pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/domains/meta-object-extension-item.test.ts:Test Files 1 passed (1) · Tests 53 passed (53)(at ea28e05; the file is unchanged since).pnpm --filter @object-ui/app-shell run type-check(both tsc programs, tests included): exit 0 (at ea28e05; the last commit only adds two side-effect imports to one test file and the changeset).pnpm --filter @object-ui/i18n run type-check && pnpm --dir ui exec vitest run packages/i18n/: exit 0,Tests 1874 passed | 13 skipped.pnpm --dir ui exec vitest run scripts/:Test Files 172 passed | 2 skipped.dispatch-gates.mjs --commandsat cfb48d3, 68): 65 ran with exit 0. 3 are NOT MEASURED locally:check-comment-mask-corpusandcheck:query-options-erasurewere killed at 300s on the shared box, andcheck:dual-build-cjs-loadsanswered PREREQUISITE NOT MET (dist absent for packages this diff does not read). These three are left to CI.dispatch-gates --ran:68 derived famil(ies) accounted for — 65 run, 3 NOT-MEASURED.git statusclean after):typing a package rule's name … is refusedwent red (1 failed | 12 passed);2 failed | 20 passed).Acceptance notes
active: falseturns it off. Only this UI refuses the name. A platform-side refusal would be a new gate, and none is proposed.Verification
Two minutes:
OS_PORT=3000 pnpm dev:crm, open Studio → an installed object → Validations. Expected: the package's rules show "From the package" and are greyed out. New validation rule → "Value must not be negative" (on an object with a number field) → Save. The rule appears as the customer's, and a record save with a negative value is refused with its message.🤖 Generated with Claude Code
https://claude.ai/code/session_01L9qibvqcHrQpENbRP7eLfU