Repository navigation
fix(lint)!: os build and the object_extension publish door judge the one-hop leaf through an extension-added lookup, and the regex and JSON-schema checks of an extension's validation rules - #33398
Conversation
…n adds The expression rule's hop checks (refuseUndeclaredHopField and the stored-metadata-body hop refusal) looked the reference up on the declared objects, so a misspelt leaf behind a lookup an objectExtensions entry adds passed os build and the object_extension publish door. They now read the object as served (typedObjects: extension fields folded in, a field two packages tie on left out), at both doors. The object walk's own field-reference verdict stays on the declared body. Adds the ADR-0087 semantic entry object-extension-added-lookup-hop-leaf-judged. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5ny58hH1bcw97uPpgu
…JSON-schema checks validateRuleCompilability and validateRuleSchemaFormats share one rule walk, which read objects[].validations only. It now also walks each rule an objectExtensions entry adds, through the shared extension fold, located at the entry (object 'T' · objectExtensions[i] · validation 'N', path objectExtensions[i].validations.N.regex|schema), with the rule ids the object's own rules get. Both rules now run on the object_extension publish door; the gate's differential keeps the target's own stored rules off the extension write. Adds the ADR-0087 semantic entry object-extension-validation-rule-artifacts-judged, the one changeset for both fixes, and the validating-metadata docs row and paragraph this makes stale. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5ny58hH1bcw97uPpgu
📓 Docs Drift CheckThis PR changes 2 package(s): 3 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 2 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 172 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 17df209a0b03adf7d71ad6a35e2e3959e7a55eb8 && git checkout 17df209a0b03adf7d71ad6a35e2e3959e7a55eb8
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin b63c894934b5e427b456b997774f48a220edb7e5 d190a7f0437f6d0d40f1a2357023b12ce5b04993 && git checkout -B drift-repro b63c894934b5e427b456b997774f48a220edb7e5 && git merge --no-ff d190a7f0437f6d0d40f1a2357023b12ce5b04993
node scripts/docs-audit/affected-docs.mjs --json b63c894934b5e427b456b997774f48a220edb7e5
|
|
domain:spec#1 · os-project-manager · session_01FEkQ5mswnWm181XgYcCUag Contract reviewServed-tier: PR #33398, cards #33216 and #33217 (two commits, ① Derived judgments
② Semver levelRight. Clause-②: no (narrowing) — present, identically armed, on the PR body and the changeset; it agrees with the diff (no exported type or signature change, two refusals added). ③ Boundary flags
④ Design judgment
Findings:
No must-fix, no should-fix. Nits alone end the round. Implemented-by: VERDICT: PASS |
|
domain:spec#1 · os-project-manager · session_01FEkQ5mswnWm181XgYcCUag ACCEPT · PR #33398 (#33216, #33217) · head
|
…ormula cycle an object extension adds (objectstack-ai#33442) <!-- claude-projects-attribution: {"github_login":"os-project-manager"} --> _Requested by **Leehom** · [project thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XH2axL4s7aEsVfT4UcgVK1P)_ Fixes objectstack-ai#33153 Clause-②: no (narrowing) — `os build`, `os validate`, `os lint` and the runtime `object_extension` publish door (Studio, `PUT /api/v1/meta/object_extension/TARGET`, the MCP and AI authoring doors) now refuse one shape an object extension could carry before: a `formula` field an extension adds that sits on a cycle of formulas (it reads itself, two added formulas read each other, or the cycle closes through a formula the target declares). No exported type or signature changes. Measured first-party exposure: 0 `objectExtensions` entries add a `formula` field (`examples/app-showcase` one entry, a `select`, a `url` and a `number` field; `packages/plugins/plugin-auth` one, a `secret` field; HotCRM `origin/main` ac4dd3d has no `objectExtensions` in code), so nothing first-party is newly refused. Metadata-protocol: narrowed Skills-docs: none owed — this PR edits `content/docs/deployment/validating-metadata.mdx` (the object extension paragraph names the cycle check); `skills/objectstack-formula` and `skills/objectstack-data` teach formula fields and `defineObjectExtension({ extend, fields })` without saying an extension is exempt from the cycle check, so the build and the door now give the verdict the object's own formulas already get. Precedent followed: objectstack-ai#33216/objectstack-ai#33217 (PR objectstack-ai#33398), which widened the same extension walk and declared the same `no (narrowing)` / `narrowed` pair. ## 维护者速读 - **改了什么**:对象扩展(`objectExtensions` / Studio 发布的 `object_extension`)新增的公式字段,如果引用自己,或两个互相引用,或经由对象自身声明的公式绕回来,现在在 `os build` 和运行时发布口都会被拒(规则 id `expression-invalid`,和对象自身公式循环同一句提示),位置为 `object '对象' · objectExtensions[0] · field '字段' expression`。 - **为什么改**:引擎按依赖顺序计算公式,循环里的公式永远不会被计算、每行都读到空值。此前循环检查只看对象自身声明的公式,扩展加的循环在两个入口都放行,要到读记录时才暴露。 - **风险与回滚**:收窄;第一方实测 0 处扩展新增公式字段,无既有元数据被新拒。对象自身公式循环的结论与位置不变;对象声明的公式与扩展公式构成的循环,声明那一侧仍报在对象上、只报一次;发布口不会把目标对象自身已有的循环算到扩展这次写入上。草稿保存不受影响。回滚即 revert。 - **先看**:`packages/lint/src/validate-expressions.ts`(扩展遍历末尾新增的一次 `formulaCycleIssues` 调用)、`packages/lint/src/formula-cycle-issues.ts`(`extensionFormulaLoci` 与 map 形式的 `report`)、`packages/lint/src/runtime-gate.object-formula-cycle.test.ts`。 - **两分钟验证**:`pnpm --filter @objectstack/lint exec vitest run src/runtime-gate.object-formula-cycle.test.ts`,预期 16 条全过:扩展自引用、互相引用、经声明公式绕回的循环在 build 与发布口都被拒且位置一致,链式公式和读对象公式的扩展公式通过;发布口按写入条目自身的定义判定同名字段(含与其他包同优先级或被更高优先级覆盖的情形,build 此时放行,后续卡 objectstack-ai#33494)。 - **需要你做的**:无,席位落地。 ## What changes **`packages/lint/src/validate-expressions.ts` (the extension walk only; the gate-setup region objectstack-ai#33246 edits is untouched).** After each target's entries are judged, the walk runs the formula-cycle pass (objectstack-ai#33100's `formulaCycleIssues`) over the `fieldDefs` it already builds for that target: the target as served (its declared fields with every kept entry's fields folded in through `objectsAsServed`, a tie between two packages left out), its declared fields and injected columns behind it; for a target the stack does not declare, the entries' own fields. No second fold. Each cycle member an entry adds gets a finding located at that entry, and in the build a member the authored target declares is left to the object walk, so a cycle closing through a declared formula keeps that member's location at the object and names it once. On the door's one pass the object walk does not run and the written entry is folded over the target as served before the write, so every name the entry adds is served from the entry's own record and none is left out, a name the target already serves included (review round 1). **`packages/lint/src/formula-cycle-issues.ts`.** `formulaCycleIssues`' `report` also takes a map from field name to location. The new `extensionFormulaLoci(target, entries, left)` builds it: each name an entry adds, located `object 'T' · objectExtensions[i] · field 'F' expression` (the location the field-formula pass gives the same field), a name two entries add located at the later entry in fold order (the definition the registry serves), the caller's `left` names left out (the authored target's declared names in the build, none at the door). Kept in this module so the walk gains no new receiver for the objectstack-ai#5017 key scan. **Door.** `validateStackExpressions` is already on the `object_extension` door (objectstack-ai#33072), so the roster and its pins do not move. The door's one pass reads only the written entry, and only names the entry adds are reported members there, so a cycle the target or a sibling package already carries, and a formula that only reads a cycle, are not charged to the extension write. **`packages/spec/src/migrations/entries/semantic/18.object-extension-formula-cycle-refused.ts`**: the ADR-0087 D3 entry, its one exception stated (in `os build` on a declared target, a field two packages add at the priority that decides it is not judged; the door judges the written entry's own definition, see objectstack-ai#33494). No D2 conversion: which read breaks the cycle is a fact only the author holds. **`content/docs/deployment/validating-metadata.mdx`**: the object extension paragraph names the cycle check, its location in the build, and the door's reading of a name the target already serves. **`.changeset/33153-extension-formula-cycle.md`**: `@objectstack/lint` minor and `@objectstack/spec` minor, both declaration lines, a BREAKING banner (Before / Now / Unchanged / Fix) and `adr-0087: registered object-extension-formula-cycle-refused`. ## Why The engine computes an object's formulas, an extension's included, in dependency order; a formula on a cycle has no order, is never evaluated and reads null on every row. The cycle check named the object's declared formulas only, so the card's probe (an extension adding `a__c = record.a__c`, or `a__c` and `b__c` reading each other) got 0 findings at both the build and the door. ## Tests 1. **`packages/lint/src/runtime-gate.object-formula-cycle.test.ts`**, new top-level describe `objectstack-ai#33153` (11 cases) in the objectstack-ai#33100 harness file, at the real gate (`runRuntimeAuthoringRules` with `type: 'object_extension'`) and the build (`runAuthoringRules('build', …)`): - LIT: an extension formula reading itself is refused at the door at the entry, in the engine's sentence (`formulaCycleMessage`); the build's finding equals the door's (where and message). - LIT: two extension formulas reading each other are refused on each, door and build equal. - LIT: a cycle closing through a declared formula: the door refuses the added member at the entry; the build names the declared member at the object (its objectstack-ai#33100 location) and the added member at the entry, once each. - A cycle across two packages' extensions is named at each entry (`packages[j].manifest.objectExtensions[0]`). - LIT (review round 1, shape a): an extension re-declaring a field the target declares as a formula reading itself is refused at the door at the entry; the build names it once, at the object. - LIT (review round 1, shape b): an entry adding, as a self-reading formula, a name a sibling package's published extension already serves is refused at the door at the entry; the build over both packages (sibling priority 100, written entry 300) refuses it at the later entry. - Review round 2: the door judges the written entry's own definition whatever a sibling package's priority. A tie (both 200) and an outranked entry (sibling 300, written 200) are each refused at the door at the entry, while the build lets both through (it drops the tied name on a declared target and serves the outranking sibling's definition). The pin names follow-up objectstack-ai#33494, which makes the door read the build's winner. - A sibling package's stored cycle, and an extension formula that only reads it, are not charged to the extension write. - An extension of an object the door does not carry is judged on its own fields. - The target's own stored cycle is not the extension write's to answer for (the differential). - CONTROL: an extension formula over a declared formula, and a chain inside the extension, are clean at both. 2. **`packages/runtime/src/domains/meta-object-extension-item.test.ts`**, new describe `[objectstack-ai#33153]` (3 cases) through the real `saveMetaItem` + `publishMetaItem`: a self-reading formula and a two-formula cycle each get 422 `INVALID_METADATA` with the build's rule id, `where` and `path` on each member, the field is not served and the row stays a draft; a chain publishes and is served. **Red at base:** the round-0 head tests over the base sources (`git restore --source=fc283d6d` of the two lint files): 5 of 12 red (the file then held 12 cases), every LIT plus the sibling and undeclared-target cases; controls and the differential green. Restored with `git checkout HEAD --`, `git status --porcelain` empty. **Ablations** (one-shot, through `node scripts/ablation-replace.mjs` on the committed head; the tool's restore verdict each time: blob equals HEAD, `git diff HEAD` empty): - A1, the report scoping in `formulaCycleIssues` (`!report.has(field)` dropped, so every served member is reported): 5 of 12 red (round 0), including the differential case (the target's own cycle charged to the extension write) and the declared-member case (named twice). Lint tests read `src/`. - A3 (review round 1), the door guard (`base && !extensionWrite` back to `base`, the round-0 reading): 2 of 15 red, exactly shapes a and b; and the build-side exclusion (`ownNames` emptied in the build too, behind an opaque `globalThis` marker): 1 red, shape a's build assertion (the member named twice). Both restored by the tool's verdict. - A4 (review round 2), the same door-guard mutation at `bfa139ba`: 3 of 16 red, shapes a and b and the tie/outranked pin; restored by the tool's verdict. - A2, the extension loci (entries read as none, behind an opaque `globalThis` marker), for the runtime pins that read lint through `dist/`: `pnpm --filter @objectstack/lint build`, `ablation-dist-preflight` found the marker in 4 built files, runtime `-t 33153`: 2 red (both LITs), the control green. Restore leg: lint rebuilt, `--absent` found the marker in 0 of 20 built files, tree clean, 3/3 green. ## Acceptance notes - **Exposure measured:** `git grep` of `objectExtensions` / `defineObjectExtension` over `examples/`, `packages/` (non-test) and HotCRM `origin/main`: two entries, neither adds a `formula` field. - **A field an extension redeclares under a name the target already serves** is served as the written definition. In the build the object walk judges a re-declared declared field under its name, at the object, so the extension walk leaves the authored target's declared names out rather than naming one twice. At the door, whose one pass skips the object walk and whose target is served before the write (other packages' published extension fields included), no name is left out, so both a package re-declaring a field of an object it owns and an entry re-adding a name a sibling package's extension serves are refused at the entry (review round 1, finding 1; `protocol-extension-redeclared-owner-field.ts` does not judge an extension of an object its own package owns, so nothing else refused that shape). - **A field two packages add at the same priority**, in `os build` on a declared target, is left out of the served body (`objectsWithoutTiedFields`) and so out of the cycle pass, as objectstack-ai#33398 leaves its hops unjudged: which definition is served is registration order. On an undeclared target the build takes the later entry's definition of a shared name and judges it. - **The door's reading of a shared name** (review round 2): the door snapshot carries a sibling package's published extension field as a plain field with no priority, and folds the written entry over it, so the door judges the written entry's own definition of every name it adds. On a tie, or where a sibling outranks the written entry, the door can refuse a cycle the build lets through. Ruled text plus a pin, no code change here; follow-up objectstack-ai#33494 makes the door read the build's winner. The semantic entry, the changeset's Unchanged list, the call-site comment and the docs sentence state both readings. - **Not changed, by the order's fence:** the gate-setup region of `validate-expressions.ts` (objectstack-ai#33246's), `authoring-rules.ts` and the door roster pins (the rule already runs on the door). ## Verification Head `bfa139ba` (base `fc283d6d`; review round 1 adds `88b22a14` and `7c2eeb88` over `67ff848e`, round 2 adds `bfa139ba`). `origin/main` has moved to `811b976a`; `git diff --stat fc283d6 811b976` over every file this PR touches is empty, so no merge was needed. objectstack-ai#33246 (PR objectstack-ai#33434) had not merged. <details><summary>Package tests</summary> - `@objectstack/lint`: 210/210 files, 8982/8982 tests; `pnpm --filter @objectstack/lint typecheck` (tsc + test typecheck) exit 0. - `@objectstack/runtime` `src/domains/meta-object-extension-item.test.ts`: 46/46; `pnpm --filter @objectstack/runtime typecheck` exit 0. - `@objectstack/spec` `src/migrations`: 5 files, 198/198. </details> <details><summary>Gates (dispatch-gates --commands, 109 lines)</summary> The derivation at `bfa139ba` is 109 lines, the same list as at `67ff848e` and `7c2eeb88`. Every line ran after a whole-repo `pnpm build` of `bfa139ba`, its exit code captured before any pipe, and all 109 exited 0. `dispatch-gates --ran`: `109 derived, 109 run, 0 NOT-MEASURED`. The record is `pm-orders/spec/33153-gates-ran-r2.txt` in the project share (earlier rounds: `33153-gates-ran.txt`, `33153-gates-ran-r1.txt`). </details> Dogfood (`Clause-②:` carries the `(narrowing)` arm and the title `!`): full battery, the CI command (`pnpm --filter @objectstack/dogfood test` under the verify lock), no shard, on head `bfa139ba` after a whole-repo build. Result: `VERDICT command-exit 0`, Test Files 465 passed and 3 skipped (468), Tests 3932 passed and 42 skipped (3974), no failures (the same counts as on `67ff848e` and `7c2eeb88`). ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. - [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. - [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 by [Claude Code](https://claude.ai/code/session_01FEkQ5mAXtyZgMs9QwfQzXE)_ <!-- signed: domain:spec#1 · os-project-manager · session_01FEkQ5mswnWm181XgYcCUag --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Leehom · project thread
Fixes #33216
Fixes #33217
Clause-②: no (narrowing) —
os build,os validate,os lintand the runtimeobject_extensionpublish door (Studio,PUT /api/v1/meta/object_extension/TARGET, the MCP and AI authoring doors) now refuse two shapes an object extension could carry before: a validation rule or formula readingrecord.REF.LEAFthrough a lookup an extension adds where the lookup's target serves noLEAF, and aformat/json_schemavalidation rule an extension adds whose regex or schema does not compile or names an unregistered format. No exported type or signature changes. Measured first-party exposure: 0objectExtensionsentries add a lookup or a validation rule (examples/app-showcaseone entry, three plain fields;packages/plugins/plugin-authone, asecretfield; HotCRMorigin/mainac4dd3d has noobjectExtensionsin code), so nothing first-party is newly refused.Metadata-protocol: narrowed
Skills-docs: none owed — this PR edits
content/docs/deployment/validating-metadata.mdx(the rule-table row marks the extension door, and the object extension paragraph names both checks);skills/objectstack-datateaches one-hop reads,format/json_schemarules anddefineObjectExtension({ extend, fields })without saying an extension is exempt from either check, so the build and the door now give the verdict the object's own declarations already get.Precedent followed: #33154 (PR #33205), which built the extension walk these two cards extend and declared the same
no (narrowing)/narrowedpair.维护者速读
objectExtensions/ Studio 发布的object_extension)补上两项对象自身早已有的检查。① 通过“扩展新增的查找字段”做一跳读取(record.manager__c.字段)时,目标字段名现在按“对象实际提供的结构”判定,拼错即拒,和通过对象自身声明的查找字段一样(同一规则 idexpression-invalid、同一句提示)。② 扩展里format规则的正则、json_schema规则的 schema 及其 format 名,现在和对象自身规则一样检查(同三个规则 id),位置为object '对象' · objectExtensions[0] · validation '规则'。两项在os build与运行时发布口结论一致。packages/lint/src/validate-expressions.ts(refuseUndeclaredHopField与storedMetadataBodyReferencesFor改读typedObjects)、packages/lint/src/validate-rule-compilability.ts(walkObjectValidationRules新增的扩展循环)、packages/lint/src/authoring-rules.ts(两条规则的runtimeTypes加object_extension)。pnpm --filter @objectstack/lint exec vitest run src/runtime-gate.object-formula-writes.test.ts src/validate-rule-compilability.test.ts -t "33216|33217",预期 16 条全过:扩展查找字段后拼错的叶子字段、扩展的坏正则/坏 schema/拼错的 format 名在 build 与发布口都被拒且结论逐条相同,正确写法通过,对象自身的用例不变。What changes
Two commits, one per card.
#33216 —
packages/lint/src/validate-expressions.ts(hop-index region only).refuseUndeclaredHopFieldlooked the hopping reference up on the declaredobjects, so a lookup anobjectExtensionsentry adds was never found and its leaf never judged. It now readstypedObjects, the served fold lint: the field-name indexes outside indexObjectGraph (validate-expressions, indexObjectFields readers, hook-body-writes, sortable-fields, translation-references) still read declared objects only, refusing extension-added fields #30471 already builds (every extension field folded in, a field two packages tie on left out), the same foldfieldIndexreads for the leaf. A hop through a declared lookup reads the same definition as before, so the object's own verdicts and locations do not move.storedMetadataBodyReferencesFortakes aservedflag. The hop refusal (refuseStoredMetadataBodyHop) asks for the served reading, so a hop through an added lookup into a stored-metadata-body table is refused as through a declared one. The object walk's lint: a lookup or master_detail field whose reference is a stored-metadata-body table saves, builds and validates, but the engine never hydrates it — refuse it at authoring time #24677 field-reference verdict keeps the declared reading, so a field an extension adds is never charged to the object's own location. One map holds both readings (a served reading is keyedserved:NAME), so the validate-expressions / validate-security-posture 也有同形的 spec 不声明键的??别名读法(#5009 建议 3 的核对结果) #5017 receiver scan sees no new receiver.object_extensiondoor the written entry is folded into the door's live objects by the same fold, so the verdict is the build's.packages/spec/src/migrations/entries/semantic/18.object-extension-added-lookup-hop-leaf-judged.ts: the ADR-0087 D3 entry. No D2 conversion: which field the author meant is a fact only the author holds.#33217 —
packages/lint/src/validate-rule-compilability.ts,validate-rule-schema-formats.ts,authoring-rules.ts.walkObjectValidationRules(the one walk both rules share, so they cannot disagree about which rules exist) also walks each rule an extension adds, throughobjectExtensionsByTarget(the fold fix(lint)!: os build and the object_extension publish door judge each validation rule an object extension adds by the object's own rule pass #33205's extension walk reads: one entry per package per target, as the registry keeps them),conditionalbranches flattened in. Located at the entry:whereobject 'T' · objectExtensions[i] · validation 'N'(the locus fix(lint)!: os build and the object_extension publish door judge each validation rule an object extension adds by the object's own rule pass #33205 uses),pathobjectExtensions[i].validations.N.regex/.schema(the entry's path in place of the object'sobjects.T),packages[j].manifest.prefixed in a built artifact. The rule ids are unchanged. An undeclared target is judged all the same: a regex or schema needs no field of the target.validateRuleCompilabilityandvalidateRuleSchemaFormatscross onto theobject_extensiondoor (runtimeTypes: ['object', 'object_extension']), together, as their [finding] The fourviews[]visibility-predicate rules are CLI-only — a Studio/REST/MCPviewwrite bypasses all of them; if they move to runtime-publish, they must move together #7220 family discipline requires. On that write the snapshot carries the written entry as its sole extension; the target's own rules the door's live objects carry are judged in the gate's baseline as well, so the differential charges the write with its entry's findings only.packages/spec/src/migrations/entries/semantic/18.object-extension-validation-rule-artifacts-judged.ts: the ADR-0087 D3 entry.content/docs/deployment/validating-metadata.mdx: the "Declared enforcement that cannot run, declared on the object being written" row's runtime column now reads✓ᵒᵒˣ, and the object extension paragraph names both checks. Both statements were made false by this change (os-dev rule 4)..changeset/33216-extension-lookup-hop-and-rule-artifacts.md:@objectstack/lintminor and@objectstack/specminor, both declaration lines, a BREAKING banner (Before / Now / Unchanged / Fix) andadr-0087: registerednaming both entries.Tests
packages/lint/src/runtime-gate.object-formula-writes.test.ts, new describe#33216(7 cases), at the real gate (runRuntimeAuthoringRules) and the build (runAuthoringRules('build', …)):record.manager__c.daly_hoursthrough the added lookup is refused at the door atobjectExtensions[0].validations[0].then.condition, the build's findings deep-equal the door's, and the message equals the declared-lookup case's with the reference name taken out.sys_metadatais refused as a stored-metadata-body hop.packages/lint/src/validate-rule-compilability.test.ts, new describe#33217(9 cases): both rules on both doors; an invalid regex, an uncompilable schema and a misspelt format name an extension adds each refused at the build with rule id,whereandpath; each refused at the door with the build's finding byte for byte; aconditionalbranch located at the branch; the same rule ids as the object's own (whose locations are pinned unchanged); valid rules clean at both; a sibling package's entry located at its body and an undeclared target judged; the target's own broken rule not charged to the extension write; the object save door unchanged.packages/runtime/src/domains/meta-object-extension-item.test.ts, through the realsaveMetaItem+publishMetaItem:[#33216]4 cases (rule and formula: a misspelt leaf through the added lookup gets 422INVALID_METADATAwith the build's rule id, location and path, the field is not served and the row stays a draft; the correct leaf publishes and is served);[#33217]3 cases (an invalid regex and an uncompilable schema each get 422 with the build's rule id and locator, the rule is not served; valid ones publish and are served).object_extensiondoor's rules exactly): two inruntime-gate.object-formula-writes.test.ts(lint: the object_extension publish door runs no field-formula judgment, so a computed field os build refuses still publishes through PUT /meta/object_extension #33072), two invalidate-security-posture.runtime-surface.test.ts(security-role-word lint skips fields declared through objectExtensions, so a field named role passes validate, build and verify #31998; surface amendment 6881180427).Ablations (one-shot, nothing permanent; each through
node scripts/ablation-replace.mjson the committed head, thenpnpm --filter @objectstack/lint build, thenablation-dist-preflightfound the marker in 4 built files; runtime pins read lint throughdist/):for (const obj of typedObjects)→ declaredobjects): lint 3 of 94 red, runtime 2 of 40 red, exactly the five A one-hop read through a lookup an object extension adds is accepted with a misspelt target field, then refuses every save #33216 LIT cases (rule and formula at both doors, the object's own formula); every control green.storedMetadataBodyReferencesFor(objectName, true)→ declared): lint 1 red, the stored-metadata-body LIT; runtime 40/40.obj.validations ?? obj.validationRules别名读法(#5017 全包 grep 的第八处,第三个文件) #5096 receiver meta-test, which reds on the marker's ownentries.filterspelling, not on behaviour), runtime 2 red (the regex and schema door LITs); the controls, the differential case and the object door green.validateRuleCompilability'sruntimeTypesback to['object']): lint 7 red (the door LITs, the roster pins, therulesRuncontrols), runtime 2 red (the door LITs).git diff HEADis empty (the tool's verdict). Lint was rebuilt after the last leg; no marker remains inpackages/lint/dist(grep0 files for each of the four) andgit status --porcelainis empty.Acceptance notes
git grepofobjectExtensions/defineObjectExtensionoverexamples/,packages/(non-test) and HotCRMorigin/main: two entries, neither adds a lookup or a validation rule. Every test file inpackages/metadata-protocol(7 files, 251 tests) andpackages/runtime(7 files, 136 tests) that publishes or reads anobject_extensionpasses at the head.buildNullableFieldIndex) and theextensionWritestrip, which are A flow or hook condition ordering record.created_at with no guard is refused at the publish door while os build accepts it #33246's; A formula field an object extension adds that reads itself, or two that read each other, is refused at neither the publish door nor os build #33153 (a formula cycle an extension adds) and Publish accepts an activityMilestones[].field or displayNameField that names no field; both are served and do nothing #33101 are not folded.reference) is now read as served at a hop site, which is what the engine plans. The object walk's own field-reference verdict still reads the declared field, so such a field is not charged to the object's location.defineStack({ objectExtensions })throughregisterApp) are not gated, as an object's own rules are not.Verification
Head
d190a7f0(base87330e89);git diff --stat 87330e89 origin/mainover every touched file is empty at hand-over time, so no merge was needed.Package tests
@objectstack/lint: 208/208 files, 8902/8902 tests; typecheck exit 0.meta-object-extension-item.test.ts+packages-disable-module-extension-fields.test.ts): 81/81.object_extension:@objectstack/metadata-protocol7 files 251/251;@objectstack/runtime7 files 136/136.Gates (dispatch-gates --commands, 109 lines)
The derivation at
d190a7f0is 109 lines. Every line ran with stdin closed and its exit code captured before any pipe. 107 exited 0 on the first pass. Two exited 3 (refused, nothing measured) on a missing build:pnpm --filter @objectstack/spec run check:skill-examples(no@objectstack/client-reactdist) andpnpm check:dual-build-cjs-loads(needs every package's dist). After a whole-repopnpm buildboth exited 0.dispatch-gates --ran:109 derived, 109 run, 0 NOT-MEASURED, 0 UNRUN. The record ispm-orders/spec/33216-gates-ran.txtin the project share.Dogfood (the title carries
!andClause-②:the(narrowing)arm): full battery, the CI command (pnpm --filter @objectstack/dogfood testunder the verify lock), no shard, on headd190a7f0after a whole-repo build. Result:VERDICT command-exit 0, Test Files 464 passed and 3 skipped (467), Tests 3927 passed and 42 skipped (3969), no failures.Generated by Claude Code