Repository navigation
fix(lint)!: os build and the object save door refuse a validations[] rule whose predicate reads parent - #25052
objectstack-fleet[bot] wants to merge 3 commits into
Conversation
… error Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D6F9axfoPzR7t8G1J7Ytzz
… predicate that reads parent (422) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D6F9axfoPzR7t8G1J7Ytzz
… minor; the warning entry stops promising 19.0 Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D6F9axfoPzR7t8G1J7Ytzz
📓 Docs Drift Check2 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 4 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 2cfb1131e0aba2be674f4133b649b9565de31854 && git checkout 2cfb1131e0aba2be674f4133b649b9565de31854
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 157ebd008b07d0683ee1762d6c858f4ad766618e 66e0df6213bb42fca8254b8d3d47d766650d39e9 && git checkout -B drift-repro 157ebd008b07d0683ee1762d6c858f4ad766618e && git merge --no-ff 66e0df6213bb42fca8254b8d3d47d766650d39e9
node scripts/docs-audit/affected-docs.mjs --json 157ebd008b07d0683ee1762d6c858f4ad766618e |
Closes #24957
Clause-②: no (narrowing: a
validations[]rule that readsparentis refused atos buildand the object save door; it ships now under the amended 「甲」, #60156303865025)Metadata-protocol: narrowed
What changes
A
validations[]rule's predicates (ascript/cross_fieldrule'scondition, aconditionalrule'swhen, and the same slots on the rules nested in itsthen/otherwise) are evaluated by ObjectQL inruleScope(record, previous), which binds noparent. Such a predicate faults (Unknown variable: parent) on every write it judges and fails closed. The 18.x verdict shipped atwarning(PR #24763,8cfe1f94cb). This PR ships the refusal half, re-timed to 18.x as a BREAKING minor.packages/lint/src/validate-expressions.ts:validationRuleParentIssue's finding is pushed aterrorinstead ofwarning. The message drops "This is a warning today;os buildand the object save door will refuse it from 19.0." The docblock's "Why a warning, and when it becomes a refusal" section becomes "Why an error". The location, rule id, prescription and the field-rule controls are unchanged.runStackExpressionPasses), so the door's verdict moves from advisory to error with no door code change. A publish-mode object save now answers422 INVALID_METADATA..changeset/24957-validation-rule-parent-error.md:@objectstack/lintminor, BREAKING banner,Clause-②: no (narrowing …), ADR-0087 markernot-required (no-migration-prescription)(shape of thebb4f5cc005precedent).The gate on #24684 (withdrawal condition)
#24684 closed
completedthrough PR #24731 (576d0f3733). It landed route B: three lifecycle hooks onshowcase_invoice_line. It made no objectql, lint or spec change. Onorigin/main3b3830ca22,checkPredicate/checkConditionalstill callruleScope(record, previous)(rule-validator.tslines 4511 / 4695), andruleScopeadds noparent. Soparentis still unbound forvalidations[], and the withdrawal condition does not hold.Tests
packages/lint/src/validate-expressions.validation-rule-parent.test.ts: every severity assertion now readserror.os validate/os buildcarry the finding as their only error. The door finding is inerrors, notadvisories, and the door/build parity is unchanged. New: the message promises no later release, and anactive: falserule or an update-only rule is refused too (the rule is judged as written). Controls unchanged:parenton a field's ownreadonlyWhen/requiredWhen,record/previousreads,record.parent_code.packages/metadata-protocol/src/protocol.runtime-authoring-gate.test.ts, new block(#24957)through the realsaveMetaItem: (a) an active save is refused422 INVALID_METADATAwith the build's located finding, and nothing lands; (b) a draft save still succeeds, and its promotion and a package draft publish are refused; (c) control:parentonreadonlyWhen, and arecordrule, save and land.dist/:scripts/ablation-replace.mjsput the severity back towarningwith a marker, then rebuilt lint.ablation-dist-preflightfound the marker in 4 built files. The door block went red, 3 failed (a, b, b-package) and 1 passed (c control). After the restore (blob equal to HEAD,git diff HEADempty), lint was rebuilt, preflight--absentpassed, and the block was green, 4 of 4.pnpm --filter @objectstack/lint test: 153 files, 7045 tests passed.pnpm --filter @objectstack/lint typecheck: exit 0.pnpm --filter @objectstack/metadata-protocol typecheck: exit 0.protocol.runtime-authoring-gate.test.tsin full: 179 passed (before the package-publish leg was added; the-t 24957run after it passed 4 of 4).66e0df6213: 66 derived, 63 run, 3 NOT MEASURED (check:dual-build-cjs-loads,check:lean-entry-closure,check:type-check-debt; each exited 3, prerequisite not met: a full-workspace build). Those are declared to CI.Producers measured
3b3830ca22: 0validations[]predicates readparentacrossexamples/,packages/create-objectstack,skills/and package objects. The 10 files underexamples/packages/create-objectstack/skillsthat authorvalidations:were grepped forparent. Control leg: the same grep finds the field-rule reads (examples/app-showcase/src/data/objects/invoice.object.ts, 3readonlyWhenhits), so it does reach the corpus. Nothing to fix.Acceptance notes
check:empty-changesetis red on purpose. This PR also edits the pending.changeset/24720-validation-rule-parent.md. That note said "Nothing new is refused in 18.x … The refusal … is planned for 19.0", which this PR makes false before it ships. The edit replaces that sentence with "Nothing new is refused by this change … follows in its own breaking entry (lint 18.x:validationRuleParentIssuemoves fromwarningtoerror, so avalidations[]rule that readsparentis refused atos buildand the object save door (the refusal half of #24720) #24957)". This is the gate's DELIBERATE CORRECTION class: it stays red until a person confirms the correction. The alternative is to revert the edit and let the new entry stand alone. It is self-contained, but then the release would ship both sentences. The open Version Packages PR chore: version packages #24876 currently consumes that changeset.validate-expressions.ts, in different hunks (imports,StackExpressionOptionsdocs, the bulkconfirmTextpass). There is no textual overlap with the verdict lines..changeset/24720-*.mdor the metadata-protocol door block. Both are declared here.current_user/input/os/triggerin avalidations[]condition (the family the card notes for triage).Generated by Claude Code