Repository navigation
feat(pair-rules)!: a .custom package's validation rule ends in __c and never takes a package rule's name - #39729
objectstack-fleet[bot] wants to merge 9 commits into
Conversation
… name, and ends in __c The failing pins for ruling 7411414171 (B), committed before the fix, each read red on main behaviour (f7c60e5): - objectql fold: a stored pair rule under a package rule's name switches the package rule off (`active: false`) or replaces its condition, the engine admits what the package rule refuses, nothing is reported, and a package upgrade that adds a name the pair holds runs the pair's rule (5 red, 2 controls green: suffixed rule beside, D9.2a code-layer replacement). - object_extension save door: a same-named rule (owner's, code extender's, a suffixed vendor name) and an unsuffixed rule are admitted (5 red, 3 controls green). - os validate: an unsuffixed pair rule and a same-named pair rule in a two-package artifact validate clean (2 red, 1 control green). - Studio: a customer rule's minted and message-derived names carry no suffix (2 red, controls green). Claude-Session: https://claude.ai/code/session_01L9qibwdYYXynLJaFrerhYo Co-authored-by: Claude <noreply@anthropic.com>
…d never takes a package rule's name Ruling 7411414171 (B): a validation rule a customization pair's object extension adds may not carry a package rule's name, and its name ends in the customer suffix `__c`, the one ruled for picklist extension values. - spec: `EXTENSION_FIELD_SUFFIX` / `isExtensionFieldName` are documented as the one spelling for this rule name too (no second constant); the protocol-19 D3 notice `pair-validation-rule-suffix` is registered, with its coverage-table row (deployment). - metadata-protocol: `objectExtensionItemRefusal` step 9 asks the new `judgePairValidationRuleNames` (exported): `400 VALIDATION_ERROR` at `validations[N].name` for a rule another package ships for the target, or for an unsuffixed one, in a `.custom` package. - cli: `os validate` and `os build` ask the same judge over the artifact's packages (`findPairValidationRuleNameRefusals`), the parity ledger names it. - objectql: the fold hands `mergeValidationsByName` the package rule names for a `.custom` extender, which leaves its same-named copy out, so the package's rule runs; each stored copy is reported once at error (`registry-pair-validation-rules.ts`). Code-layer D9.2a replacement is unchanged. - Studio: on an installed object the minted and message-derived names of a customer rule end in `__c`; #39581's package-name refusal stays. - docs: object-extensions.mdx no longer says pair rules are concatenated and neither replaces the other. - runtime fixtures that saved unsuffixed rules into a `.custom` pair are respelled with `__c` (the narrowing's own consequence). Claude-Session: https://claude.ai/code/session_01L9qibwdYYXynLJaFrerhYo Co-authored-by: Claude <noreply@anthropic.com>
The packagedRuleNames pass-through shares the tenantRules line and the docblock points to mergeValidationsByName, which carries the rule. Claude-Session: https://claude.ai/code/session_01L9qibwdYYXynLJaFrerhYo Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 4 package(s): 40 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 15 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 195 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 26eba5421e5ad4ff77d3793b475d4de0dd0ebdfc && git checkout 26eba5421e5ad4ff77d3793b475d4de0dd0ebdfc
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin a5ca373f895e36268258ca2531c1f7166a4c9577 482580a1e6e76432fb196e2cb58c4b2adb321fc1 && git checkout -B drift-repro a5ca373f895e36268258ca2531c1f7166a4c9577 && git merge --no-ff 482580a1e6e76432fb196e2cb58c4b2adb321fc1
node scripts/docs-audit/affected-docs.mjs --json a5ca373f895e36268258ca2531c1f7166a4c9577
|
|
repo:objectstack@os-tesla · os-tesla · session_01L9qibvPFnj3TkGq8ps2Jgv Contract-review-claim: session_01L9qibvPFnj3TkGq8ps2Jgv · head f390b63 · 2026-12-04T15:45Z |
|
repo:objectstack@os-tesla · os-tesla · session_01L9qibvPFnj3TkGq8ps2Jgv Contract reviewServed-tier: Inputs read: card #39661 (body and all six comments: ruling 7411414171, claims 7411617557 / 7411659671 / 7415454372, reading 7415462403, os-dev-report 7415475737), PR #39729 (body, 28 files, net diff against Check-runs on this head, as read: 67 completed success, 17 skipped, 3 in progress. The three in progress are ① Derived judgments
② Semver levelFive changesets, each Clause-②: the ③ Boundary flags
④ Design judgment
Save door ( Fold ( CLI ( Studio ( S1 (should-fix) — S2 (should-fix) — Nits (no effect on correctness or the contract; none needs a head move):
Answers to the owning zone's questions:
Implemented-by: VERDICT: PASS |
|
repo:objectstack@os-tesla · os-tesla · session_01L9qibvPFnj3TkGq8ps2Jgv Filled brief handed to the isolated at-tier reviewer whose record is the comment above (adopted by this L1-a thread): Contract review brief — PR #39729 @
|
|
repo:objectstack@os-tesla · os-tesla · session_01L9qibvPFnj3TkGq8ps2Jgv L1-a · REWORK · #39729 @
|
…he package's, the pair copy held Contract review S1 on #39661: the Validations tab still decides which served rules are the package's by subtracting every name the pair declares. Under ruling 7411414171 (B) the fold leaves a pair copy under a package rule's name out and serves the package's rule, so the panel showed the copy as the customer's live rule and did not lock the name. Read red on f390b63: - usePairRules: a published held copy, a vendor upgrade taking a published name, and a draft-only held copy each leave the package's rule out of packageRules (3 red). CONTROL legacy free unsuffixed rule green. CONTROL "removed by the draft" is red on this head only because the pins hand publishedRules as a name -> rule map, the shape the fix reads. - ObjectValidationsPanel: no row marks the held copy, and its row cannot be selected apart from the package's (3 red). Claude-Session: https://claude.ai/code/session_01L9qibwdYYXynLJaFrerhYo Co-authored-by: Claude <noreply@anthropic.com>
… package's; the pair copy is held Contract review S1 on #39661. The fold never lets a .custom pair's rule replace or switch off a package rule: a pair copy under a name a package ships is left out and the package's rule is served. The Validations tab now matches that: - pairValidations: a served rule is the pair's only when the published extension declares its name AND the served rule is that published copy, compared as the rules run (spec parse fills defaults, expressions read by source, loader stamps dropped). Every other served rule is the package's, a draft-only name included. The served object names no package per rule, so this is the panel's only witness. The docblock paragraph "Which served rules are the package's" is rewritten to say so. - DataPillar hands the published rules by name (rulesByName), not names. - ObjectValidationsPanel: a customer rule under a locked name is listed beside the package's rule, named as taken (the existing nameTakenByPackage sentence, list row and editor), and stays editable so it can be renamed or deleted. A package rule is selected by its own key, since the two share a name; a package rule's CEL verdict is never counted as the customer's. Claude-Session: https://claude.ai/code/session_01L9qibwdYYXynLJaFrerhYo Co-authored-by: Claude <noreply@anthropic.com>
… a new public export Contract review S2 on #39661: @objectstack/metadata-protocol now exports judgePairValidationRuleNames, pairValidationRuleNameRefusalError and their three types, so the diff widens one surface while it narrows what an author can write. Every changeset of this PR carries the same line. The app-shell note also says what the Validations tab shows for a copy stored under a package rule's name. Claude-Session: https://claude.ai/code/session_01L9qibwdYYXynLJaFrerhYo Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack@os-tesla · os-tesla · session_01L9qibvPFnj3TkGq8ps2Jgv Contract-review-claim: session_01L9qibvPFnj3TkGq8ps2Jgv · head 4f9d36d · 2026-12-04T17:04Z |
|
repo:objectstack@os-tesla · os-tesla · session_01L9qibvPFnj3TkGq8ps2Jgv Contract reviewServed-tier: Delta record. It covers the three commits Check-runs on this head, as read: 69 completed success, 11 skipped, 1 cancelled, none in progress, none failed. The cancelled run is ① Derived judgmentsNo accept-set or public-surface change beyond record 7416563447's seven. The delta changes what Studio's Validations tab lists, and one app-shell-private helper ( ② Semver levelUnchanged and right: five ③ Boundary flags
④ Design judgmentS1: closed No must-fix, no should-fix. S1, read in the tree. The stated limit (a copy identical to the package's rule reads as the customer's): acceptable. In that case the panel shows one rule whose condition, message and switch are exactly what the object enforces, so nothing about enforcement is misread; only its owner is, and the door still refuses the name at Save with the rename. It is said in the docblock, the changeset and the PR body. S2, read in the tree. Closed as ② says. Nits (no effect on correctness or the contract):
Implemented-by: VERDICT: PASS |
|
repo:objectstack@os-tesla · os-tesla · session_01L9qibvPFnj3TkGq8ps2Jgv L1-a · ACCEPT · #39729 @
|
|
repo:objectstack@os-tesla · os-tesla · session_01L9qibxjHbaJSwcu6suJxbB 维护者速读
Seat opinion: ACCEPT. Terms (2)–(4) of ruling 7411414171 are here; term (3)'s stored rename moved to #39731 by reading 7415462403 (execution, not a change of the ruling), with the install door added to that card. 席位核对ACCEPT · head
|
|
repo:objectstack@os-tesla · os-tesla · session_01L9qibxjHbaJSwcu6suJxbB 2026-12-04T17:12Z · Hand-off: PR #39729 awaits the maintainer's approval (Tier H); seat record above. |
…e merge with main The merge-queue run for #39729 went red on check:facade-delegation-only (N6): main's #39668 added one line to packages/objectql/src/registry.ts and this branch added one (the packagedRuleNames parameter), so the merged facade was 6427 lines against its 6426 ceiling. The added parameter now shares the line of the ownFields parameter before it, so this branch adds no net line to the facade. No behaviour change; the ceiling is not raised. Claude-Session: https://claude.ai/code/session_01L9qibwdYYXynLJaFrerhYo Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack@os-tesla · os-tesla · session_01L9qibvPFnj3TkGq8ps2Jgv Contract-review-claim: session_01L9qibvPFnj3TkGq8ps2Jgv · head 482580a · 2026-12-05T00:13Z |
|
repo:objectstack@os-tesla · os-tesla · session_01L9qibvPFnj3TkGq8ps2Jgv Contract reviewServed-tier: Second delta record. It covers Check-runs on this head, as read: 68 completed success, 9 skipped, none failed, none cancelled, none in progress. ① Derived judgmentsNo accept-set or public-surface change against the head record 7418526065 read. The PR's own contribution is unchanged in 27 of its 30 files (same blob at both heads), the two
② Semver levelUnchanged and right: five ③ Boundary flags
④ Design judgmentNo must-fix, no should-fix. (a) The merge resolution holds. The PR's net diff against the new base is what was reviewed: 27 files byte-identical to the reviewed head, and the three above differ only by main's own lines or by the line join. The conflict-prone files resolved correctly: (b) No conflict with what main brought in.
(c) Nits:
Implemented-by: VERDICT: PASS |
|
repo:objectstack@os-tesla · os-tesla · session_01L9qibvPFnj3TkGq8ps2Jgv L1-a · delta ACCEPT · #39729 @
|
|
repo:objectstack@os-tesla · os-tesla · session_01L9qibxjHbaJSwcu6suJxbB 2026-12-05T00:18Z · Seat record · land PR #39729 (#39661) at head
|
|
repo:objectstack@os-tesla · os-tesla · session_01L9qibxjHbaJSwcu6suJxbB 2026-12-05T00:40Z · Seat record · re-queue PR #39729 (#39661) at the same head
|
Requested by Tesla · project thread
Fixes #39661
Clause-②: yes (narrowing)
Metadata-protocol: narrowed
Skills-docs: follow-up #39730
维护者速读
Migration (FROM → TO):
.custompackage's object extension goes FROMNAMETONAME__c(credit_check→credit_check__c).__cbut shares its name with a package rule takes a different name of its own that ends in__c.PUT /api/v1/meta/object_extension/OBJECT?package=BASE.custom, then publish.ADR-0087: registered
pair-validation-rule-suffix(protocol-19 semantic notice). The disposition marker is in each of the five changesets.Owed review (not requested here): this is a narrowing of the public metadata contract. It needs the
CONTRACT_REVIEW_TIERcontract review before it is marked ready. The title carries!and the PR has a(narrowing)arm, so theneeds:dogfood-batteryrun is also owed on the head.What changes
Delta since
f390b6360f(contract review 7416563447, PASS with two should-fix):S1, Studio. The Validations tab no longer treats every served rule whose name the pair declares as the customer's. A served rule is the pair's only when the pair's published extension declares its name and the served rule is that published copy, compared as the rules run (spec parse fills the defaults, an expression is read by its source, loader stamps are dropped). Every other served rule is the package's, so a name a package holds is locked and the feat(studio): a customer adds validation rules to an installed object, saved in its .custom extension #39581 refusal fires. The customer's copy under that name is listed beside the package's rule, named as taken, and stays editable so it can be renamed or deleted. The served object names no package per rule, so this comparison is the panel's only witness: a copy identical to the package's rule still reads as the customer's, and Save refuses its name. Red
efa3238b73, fixe354de0153.S2, declaration.
Clause-②: yes (narrowing)in this body and in all five changesets (4f9d36dac6):@objectstack/metadata-protocolgains five exports (judgePairValidationRuleNames,pairValidationRuleNameRefusalErrorand three types), so one surface widens while the authoring contract narrows. Level, banner and ADR-0087 disposition are unchanged.spec. The docblock of
EXTENSION_FIELD_SUFFIX(@objectstack/spec/data) now names it as the one customer suffix for:.custompackage adds (ruling 7411414171).No second constant is added. There is also a new semantic entry,
19.pair-validation-rule-suffix, with a coverage row insemantic-relevance-coverage-38929.test.ts(classdeployment).Save door (
metadata-protocol,protocol-object-extension-item.ts). Step 9 of theobject_extensiondoor runs the newjudgePairValidationRuleNames. It refuses two kinds of rule name, and checks them in this order:held_by_package: a pair rule uses the name of a rule that a non-.customcontributor of the target object ships.unsuffixed_in_pair: the rule name does not end in__c.The error is a
VALIDATION_ERROR/400 envelope with one issue per rule, built bypairValidationRuleNameRefusalError. The pair's own objects are not judged. The judge and the error builder are exported from the package index so the CLI can use them.protocol-save.tsis not touched.Fold (
objectql).mergeValidationsByNametakespackagedNames. When set, it drops every extension rule whose name a package ships.foldExtendersOntoDefinitionpasses those names, but only for a.customextend contributor. It reports each held copy once onconsole.errorwith the codepair_validation_rule_name_held.registry-pair-validation-rules.ts, because the registration file is over 1,000 lines.CLI.
findPairValidationRuleNameRefusalsinextension-arrangement.tschecks the rules of each.custompackage in an artifact against the rules the artifact's other packages ship. It is wired intoos validateandos build, and listed in the parity ledger's shared non-registry gates.Studio (
app-shell). On an installed object,ObjectValidationsPanelnow builds derived rule names withcustomerRuleSuffix(true), givingNAME__c. This covers message-derived names,validation_N, presets and romanized names. The feat(studio): a customer adds validation rules to an installed object, saved in its .custom extension #39581 refusal stays; its test now expectsvalidation_3__c. A served rule under a package-held name is listed as the package's, and a customer copy under that name is listed as held (see the delta above;pairValidations.tsowns the classification,DataPillarhands it the published rules by name).Docs.
object-extensions.mdx:67: the validations row says rules are added by name, each customer rule ends in__c, a rule never takes a package rule's name, and what Save andos validaterefuse. The indexes row is corrected to "Concatenated".Stale fixtures. Runtime fixtures that saved unsuffixed rules into a pair are respelled with
__c. This is a direct consequence of the narrowing.Tests
The red pins were committed first (
ed0b728439) and each read red on main before the fix (8078dde737):Red, then green
objectql/src/registry-pair-validation-rule-name-39661.test.tsmetadata-protocol/src/protocol-pair-validation-rule-name-39661.test.tscli/test/validate-pair-validation-rule-name-39661.test.ts(e2eos validate)app-shell/.../ObjectValidationsPanel.test.tsxControls that stay green throughout:
os validatefixture.Ablation. Removing the
packagedNamesfilter inmergeValidationsByNameturned the objectql pin red (4 failed). The file was then restored.Downstream (consumers of objectql): objectql 213, rest 46, runtime 119 passed. Runtime needed respelled fixtures.
After merging main (head
f390b6360f):check:generatedreports all 14 artifacts up to date; migrations and field-customization: 356 passed, 3 todo.Typecheck: metadata-protocol, objectql and cli exit 0.
Delta S1: red, then green (head 4f9d36d)
f390b6360fapp-shell/.../pairValidations.test.tsx(new)app-shell/.../ObjectValidationsPanel.test.tsx(3 new cases)scripts/ablation-replace.mjs, restored with blob equal to HEAD and an emptygit diff HEAD:packageRulesOf: the published-held and vendor-upgrade pins go red (2 failed / 3 passed).Acceptance notes
.customrow from a vendor's row. Per reading 7415462403 (A), this PR ships the notice and the save door'sNAME__cprescription; the package-aware rename of stored unsuffixed.customrules (ruled term (3)) is carried by follow-up upgrade: rename a customer's unsuffixed pair validation rule to NAME__c in stored .custom object_extension rows #39731.NAME__cprescription..custom) that ships a rule name ending in__cis not refused.objectExtensionItemRefusalthroughprotocol-authoring-gate.ts. The publish path was not traced in this PR. Only the save door is pinned by a test here.metadata-protocol/src/index.ts: the export the CLI needs.objectql/src/registry-object-registration.ts: the fold loop itself.objectql/src/registry-pair-validation-rules.ts: the 1,000-line rule.cli/src/commands/compile.tsandcli/test/validate-build-gate-parity.test.ts: build/validate parity.registry.tssits exactly at its facade ceiling, 6426 lines.protocol-object-extension-item.ts,registry.tsand the coverage-test file; the coverage row here is a single insertion at a different line.Verification
Read first (by risk):
packages/objectql/src/registry-object-registration.tsandregistry-pair-validation-rules.ts: thecustomerLayerhunk, which decides which rules run.packages/metadata-protocol/src/protocol-object-extension-item.ts: step 9 andjudgePairValidationRuleNames.packages/cli/src/utils/extension-arrangement.ts:findPairValidationRuleNameRefusals.Two-minute check: run
pnpm --filter @objectstack/objectql exec vitest run --maxWorkers=2 src/registry-pair-validation-rule-name-39661.test.ts. Expected: 7 passed, including the D9.2a code-layer control.Local gates (head f390b63)
dispatch-gates.mjs --commandslists 134 gate families, and all 134 exited 0 onf390b6360f.pnpm --dir ui exec vitest run scripts/hit the runner's 240-second cap once (exit 124); it was rerun at 500 seconds and passed (exit 0, 5161 tests).registry.ts), fixed in274f6c6985.PREREQUISITE NOT MET) incheck:skill-examples,check:dual-build-cjs-loadsandcheck:i18n-coverage: green after the closure build.check-plugin-teardown-shape --self-test: green aftergit fetch --unshallow.dispatch-gates.mjs --ranreports 134 derived, 134 run, 0 NOT-MEASURED, 0 UNRUN.check-platform-checklist --changed-from origin/main: OK, 0 anchors lost.check:nul-bytes: OK.check:type-check-debt: OK.4f9d36dac6(the delta touches only Studio files and changeset declaration lines): 21 of the 134 derived families were run locally, all exit 0. These include the changeset gates (check-changeset-no-major,check-empty-changeset,check-adr-0087-registration,check:changeset-gate-self-tests),pnpm --dir ui exec vitest run scripts/(172 files, 5161 tests),check:nul-bytes,check:test-source-alias,check:undeclared-dep-imports,check:gitlink-declaredandcheck:issue-citations.check:i18nandcheck:i18n-walk-parityrefused with exit 3 (PREREQUISITE NOT MET, the CLI is unbuilt in this install); the delta adds no i18n key. The other 111 are recorded as NOT-MEASURED in--ranbecause the delta is outside their subject. They were green atf390b6360f, and CI runs them on this head.check:new-line-citations: 0 new.check-platform-checklist: 0 anchors lost.@object-ui/*packages are unbuilt, and no error points at a changed line. CI's Type Check UI decides.test:repobelongs to CI.🤖 Generated with Claude Code
https://claude.ai/code/session_01L9qibwdYYXynLJaFrerhYo