Repository navigation
fix(mcp): validate_expression gives the runtime publish gate's verdict at a flow condition and judges the field being authored - #33168
Conversation
…t at a flow condition and judges a named field At site flow_condition the tool now runs the gate's own passes through judgeAuthoredSiteExpression, over a one-flow probe judged as the runtime publish gate judges a flow write: the null guard on a record-triggered flow's record./previous. reads, and the unprovisioned-anchor warning. Two optional inputs: startCondition (the start guard downstream conditions are presumed under) and field (the formula-site field the expression is authored on, so a stored field gets the stored-expression warnings and a formula the cycle verdict). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibxiHaRMZVvPqb3cEac
📓 Docs Drift CheckThis PR changes 2 package(s): 13 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 4 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 15 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 96a9957ae940f1e635f159074fb0574e94a55bb1 && git checkout 96a9957ae940f1e635f159074fb0574e94a55bb1
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 3e19223bf561694fdbb575dd2490847038916132 5eea9771e798ea2b4519a8781cc60df60103af10 && git checkout -B drift-repro 3e19223bf561694fdbb575dd2490847038916132 && git merge --no-ff 5eea9771e798ea2b4519a8781cc60df60103af10
node scripts/docs-audit/affected-docs.mjs --json 3e19223bf561694fdbb575dd2490847038916132
|
|
domain:server#7 · os-tesla · session_01L9qibzuZJBQY4wUQFJbkfx Contract reviewServed-tier: Face: narrowing (the paths decide no face; the Inputs: card #33147 body and its 3 comments (triage 6863163129, claim 6864566168, dev report 6867633023; no ruling and no earlier review record is on the thread), PR #33168 body, file list (8 files) and net diff against Check-runs on the head: 66 concluded, 56 success, 10 skipped, 0 failed, 0 pending (read 2026-11-14T00:02Z). Success includes Build Core, Type Check (workspace, source gates, consumer gates, debt ledger), every Lint family, Test Core 8/8, Test UI 16/16, Type Check UI, Lint UI, Build and E2E UI, Live E2E UI, Dogfood Regression Gate, Check Changeset, PR-body guards and Governed Surface Queue Guard. The 10 skipped are opt-in or queue-only jobs (Queue verdict, Borrowed queue verdict, Build Docs, packed-tarball smoke, 18.x upgrade harness, Temporal Conformance, UI Published Artifacts, Dogfood Verify CLI, the sharded dogfood matrix, the schedule gate). ① Derived judgmentsAccept-set and public-surface changes the diff implies, each judged:
② Semver level
③ Boundary flagsPR author login:
④ Design judgment
Observation, outside this diff: the validator half of the tool has never been handed a flow's variables ( Findings: F1 should-fix, F2 should-fix, ③ flag 2 should-fix (process), two nits. No must-fix. Implemented-by: VERDICT: PASS |
…see, and read fields as record.FIELD at every site The lint entry header, the site-map jsdoc and the changeset said the runtime flow publish door never gives the shadowed-field-read warning. It does; the tool just is never handed the flow's variables. The site input and the tool description still said flow conditions bind fields bare, against the record.FIELD advice. No answer changes. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibxiHaRMZVvPqb3cEac
|
domain:server#7 · os-tesla · session_01L9qibzuZJBQY4wUQFJbkfx Contract reviewServed-tier: Delta round on record 6868101966 (head Check-runs on the head: 66 concluded, 56 success, 10 skipped, 0 failed, 0 pending (read 2026-11-14T01:07Z). The same 10 opt-in or queue-only jobs are skipped as on the previous head. ① Derived judgmentsThe delta moves no accept set. Its hunks are:
So the commit is prose only: comments, two description strings and the changeset. The two strings are served bytes (an agent reads them in ② Semver levelUnchanged and still right: ③ Boundary flagsPR author login:
④ Design judgmentF1, closed. Each of the three places now says what the tree does:
F2, closed. The tool description's parenthesis now reads "read fields as
One nit, new: "Every site reads fields as The two nits of the first record ( Findings on this head: no must-fix, no should-fix, three nits. Implemented-by: VERDICT: PASS |
|
domain:server#7 · os-tesla · session_01L9qibzuZJBQY4wUQFJbkfx 维护者速读 · PR #33168 @
|
… validation rule an object extension adds by the object's own rule pass (objectstack-ai#33205) <!-- claude-projects-attribution: {"github_login":"os-tesla"} --> _Requested by **Tesla** · [project thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6Jao9hFPRZ1WJgvAp5Am1CGguA)_ Fixes objectstack-ai#33154 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 an extension whose validation rule carries a `condition` or `when` that the same rule declared on the object is refused for. No exported type or signature changes. Measured first-party exposure: 0 extension entries carry a validation rule (`examples/app-showcase` and `packages/plugins/plugin-auth` extensions add fields only; HotCRM `origin/main` 92519d8 has no `objectExtensions` in code), so nothing first-party is newly refused. Two repository test fixtures carried the refused shape and are repaired here (see Acceptance notes). Metadata-protocol: narrowed Skills-docs: none owed — this PR edits `content/docs/deployment/validating-metadata.mdx` (the object extension door paragraph names the rule pass); `skills/objectstack-data` teaches validation rules and `defineObjectExtension({ extend, fields })` without saying an extension's rules are exempt, so the build and the door now give the verdict the object's own rules already get. Precedent followed: objectstack-ai#33072 (PR objectstack-ai#33119), which declared the same `no (narrowing)` / `narrowed` pair for the computed fields an extension adds. ## 维护者速读 - 改了什么:对象扩展(`objectExtensions` / Studio 发布的 `object_extension`)里的 `validations` 校验规则,现在在 `os build` 和运行时发布口都按对象自身校验规则的同一套检查判定(同一个函数 `judgeValidationRule`、同一条规则 id `expression-invalid`),位置为 `object '对象' · objectExtensions[0] · validation '规则'`。 - 为什么改:注册表会把扩展的校验规则按名字合并到目标对象上,每次保存记录都会执行,但此前两道门都不判定;字段拼错、函数不存在、可空字段没加空值守卫,都要等到最终用户保存记录时才失败(空值情况下会拒绝每次保存)。 - 风险与回滚:收窄;第一方实测 0 处扩展校验规则受影响。仓库测试里有 2 个 fixture 正好是被拒的形状(一个裸字段 `region__c`,一个未加空值守卫的 `record.qx_credit > 5000000`),已在本 PR 修正。草稿保存不受影响,已存的行再次发布时才判。回滚即 revert。 - 先看:`packages/lint/src/validate-expressions.ts`(`judgeValidationRule`、扩展遍历里新增的循环、扩展写入时去掉注入系统列的一行)、`packages/lint/src/runtime-gate.object-formula-writes.test.ts`(objectstack-ai#33154 一节)、`packages/runtime/src/domains/meta-object-extension-item.test.ts`(真实发布口 4 条)。 - 两分钟验证:`pnpm --filter @objectstack/lint exec vitest run src/runtime-gate.object-formula-writes.test.ts -t 33154`,预期 9 条全过:拼错字段与未知函数被拒、build 与发布口结论逐条相同(含平台注入的系统列 `created_at`:两边都接受)、合法规则与读同一扩展新增字段的规则通过。 - 需要你做的:无,席位落地。 - 席位意见:落地。契约复审 PASS(评论 6878859677,Head-sha `9d07ffa0`),无 must-fix / should-fix,4 个 nit 记为接受的偏差;上一轮 FAIL(6870963898)的 F1、F2、N2、N3 已在树上核实解决。后续卡 objectstack-ai#33216、objectstack-ai#33217、objectstack-ai#33246。复审由实现本 PR 的同一会话采纳隔离子代理的结论,依据维护者 2026-11-14 14:17Z「你现在可以自己契约复审了」。非受管面,579 行。 ## What changes **Lint: one rule pass, two walks.** - **`packages/lint/src/validate-expressions.ts`.** - The per-rule body of the object walk is hoisted into one closure, `judgeValidationRule(rule, { objectName, locus, rulePath })`. It covers the `condition` and `when` (with the one-hop checks the rule validator serves), every nested `then` / `otherwise` predicate, the `parent` root verdict and the null-guard gate. The object walk's loop now calls it, and its findings, order and key paths are byte for byte what they were. - objectstack-ai#32875's extension walk calls the same closure for each `validations[]` rule of each entry that `objectExtensionsByTarget` keeps (the fold already carried them). A `record.FIELD` read resolves against the target's fields as served (`fieldIndex`, over `objectsAsServed`), so a field this extension or a sibling package's extension adds resolves, and a field nothing serves is unknown. An undeclared target is judged on what does not depend on its fields, as its formulas are. The hop checks (`refuseUndeclaredHopField`, `storedMetadataBodyReferencesFor`) read the declared objects, so the leaf of a one-hop read through a reference an extension adds is not judged (see Acceptance notes). - The locator is `object 'TARGET' · objectExtensions[i] · validation 'RULE'`, and the key path is `ENTRY.validations[k].SLOT`. The door's 422 carries that path as is (`objectExtensions[0].validations[0].condition`); only a draft read's `_diagnostics` re-spell it item-relative (`validations.0.condition`). - On an `object_extension` write the door's live objects are read through `stripInjectedSystemColumns` (`@objectstack/metadata-core`), as `authored-site-expression.ts` reads served objects. The registry serves an object with the system columns it injects (`created_at`, `owner_id`, …) declared, `required: false` and no default, so the null-guard gate judged `record.created_at > …` as an unguarded nullable operand and refused at the door what `os build` accepts. Stripped, the indexes re-derive those columns as the build does: known fields, never judged nullable. - On an `object_extension` write the door still runs ONE pass, the extension walk, and returns after it (objectstack-ai#33072's `extensionWrite`). The rules join that one pass. - **`packages/lint/src/authoring-rules.ts`.** Comment only (surface amendment 6868654518), on the expression rule's `runtimeTypes`. **Docs, migration and changeset.** - **`content/docs/deployment/validating-metadata.mdx`.** One sentence in the object extension door paragraph. The CEL row's columns do not change: the `ᵒˣ` mark landed with objectstack-ai#33072. - **`packages/spec/src/migrations/entries/semantic/18.object-extension-validation-rule-expression-judged.ts`.** The ADR-0087 D3 entry. Its printed guidance carries no tracker id. There is no D2 conversion, because how a refused rule is repaired is a fact only the author holds. - **`.changeset/33154-object-extension-validation-rules-judged.md`.** `@objectstack/lint` minor and `@objectstack/spec` minor, with both declaration lines, a BREAKING banner (Before / Now / Unchanged / Fix) that names the null-guard refusal and its fix, and the ADR-0087 disposition marker. ## Tests 1. **`packages/lint/src/runtime-gate.object-formula-writes.test.ts`**, a new top-level describe `objectstack-ai#33154` with 9 cases, at the real gate (`runRuntimeAuthoringRules`) and the build (`runAuthoringRules('build', …)`): - LIT: a misspelt field is refused at the entry, with its key path. - LIT: an unregistered function in a nested `then` branch is refused at the branch. - PARITY: on one shared input set (a typo, `sqrt`, a bare reference), the door's findings deep-equal the build's. - PARITY: with the objects as the registry serves them (`applyInjectedSystemColumns`), an unguarded ordering over `record.created_at` is accepted at the door as at the build, and one over a declared nullable field (`record.amount > 0`) is refused at both, the findings deep-equal. - CONTROL: a valid rule, a rule reading a field the same extension adds, and a gated one-hop read are clean at both doors. - SIBLING: a rule reading a field a sibling package's extension adds resolves at the build, and a misspelling of it is refused at `packages[2].manifest.objectExtensions[0]`. - An undeclared target is judged on what does not depend on its fields. - One pass: the extension write does not judge the target's own broken rule. - CONTROL: the object save door still judges the object's own rule at its own location. 2. **`packages/runtime/src/domains/meta-object-extension-item.test.ts`**, a new describe `[objectstack-ai#33154]` with 4 cases, through the real `saveMetaItem` + `publishMetaItem`: - LIT: a rule reading `record.nmae` gets 422 `INVALID_METADATA` with issue `expression-invalid` at the build's location and path. The rule is not served, and the row stays a draft. - CONTROL: a valid rule publishes and is served on the account. - PARITY: `record.created_at > timestamp(…)` with no guard publishes and is served (the account as served declares `created_at`), and `os build` (`runAuthoringRules('build', …)` on the account as authored and the same entry) reports nothing; an unguarded `record.bonus__c > 100` on a field the same entry adds is refused at both, with the same rule, location and path. - LIT (republish, objectstack-ai#33072's S1 shape): dropping a field that the extension's own rule still reads is refused, because the stored self lends it nothing. 3. **Repaired by this change** (stale fixtures, each the refused shape): - `meta-object-extension-item.test.ts`: a bare `region__c == null` becomes `record.region__c == null`. - `packages-disable-module-extension-fields.test.ts` (surface amendment 6869487624): an unguarded `record.qx_credit > 5000000` gains `record.qx_credit != null &&`. - `authored-site-expression.test.ts`: the `validate_expression` enumeration's source regions now read the hoisted rule pass. `indexOf` and `isArray` moved out of the region with the object loop's own index, so they leave the member-call table. **Ablation** (one-shot; nothing permanent): `node scripts/ablation-replace.mjs` replaced the extension walk's `for (const rule of rules) {` with an empty loop (anchor x1 → x0, blob a3c3164 → 1bba8602). Then `pnpm --filter @objectstack/lint build` ran, and `ablation-dist-preflight` found the marker in 4 built files. - Lint pins: 5 of 8 red. The 3 controls stayed green. - Runtime pins, read through `dist/`: 2 of 3 red. The control stayed green. - Restore: the blob equals HEAD and `git diff HEAD` is empty. Lint was rebuilt, and `ablation-dist-preflight --absent` passes on all 20 built files with a clean tree. - The mutate leg's tree reading first exited 3, because the source spells the marker `[] as typeof rules`. The dist reading passed on that run, and the restore leg passed `--source-marker`. **Ablation of the strip** (r1, one-shot): `ablation-replace.mjs` replaced `if (extensionWrite) stack = {` with `if (extensionWrite && String('ablated-strip') === 'off') stack = {` (anchor x1 → x0, blob 7295169 → e6b23d5a). Lint was rebuilt, and `ablation-dist-preflight` found the marker in 4 built files. - Lint pins: 1 of 9 red, the injected-column PARITY case (the door reported the null-guard finding on `record.created_at`, the build none). - Runtime door pins: 1 of 4 red, the PARITY case (`422` on `record.created_at`). - Restore: blob equals HEAD and `git diff HEAD` is empty. Lint was rebuilt, and `ablation-dist-preflight --absent` passes on all 20 built files with a clean tree. ## Acceptance notes - **Out of scope, as the seat ruled (filed as objectstack-ai#33217):** two rules still judge an object's own rules only. - `validate-rule-compilability` checks a `format` rule's regex. - `validate-rule-schema-formats` checks a `json_schema` rule's formats. - Both read `obj.validations`, so a regex or schema format in an extension's rule is judged at neither door. Neither is an expression pass. The changeset's Unchanged line says so. - **Not judged, at either door:** the leaf of a one-hop read through a reference an extension ADDS. `refuseUndeclaredHopField` and `storedMetadataBodyReferencesFor` read the declared objects, so with `manager__c` (a lookup to staff) added by the extension, `record.manager__c.daly_hours > 12` passes the build and the door alike (measured), while the same misspelling through a reference the target declares is refused. The changeset's Unchanged line says so. Filed as objectstack-ai#33216. - **Filed from the contract review (record 6878859677, ③):** the flow and hook publish doors read the same unstripped nullable index, so an unguarded ordering over `record.created_at` in a record-triggered flow or a hook condition is refused at the door while `os build` accepts it. It is out of this card's scope: those walks are not in this diff. Filed as objectstack-ai#33246. - A rule an extension adds under the same name as one of the target's own rules replaces it in the registry (merged by name). Both are judged, each where it is authored. - Module packages registered at boot (`defineStack({ objectExtensions })` through `registerApp`) are not gated, as an object's own rules are not. `packages-disable-module-extension-fields.test.ts` still registers unguarded module rules that way, untouched. ## Verification Head `9d07ffa06` (rework r1 on `15d074782`: the strip, its pins, and the prose fixes). `origin/main` was merged twice before r1 (1169d64 before opening, then after objectstack-ai#33168 landed on `authored-site-expression.test.ts`); r1 merges nothing, and `git merge-tree` against `origin/main` at push time is clean. Everything below ran at `9d07ffa06` unless it names another head. <details><summary>Package tests</summary> - `@objectstack/lint` at `9d07ffa06`: 208/208 files, 8879/8879 tests. Typecheck exit 0. - Runtime door files at `9d07ffa06` (`meta-object-extension-item.test.ts` + `packages-disable-module-extension-fields.test.ts`): 74/74. - Every other test file that publishes an `object_extension`, at `9d07ffa06`: metadata-protocol `protocol-extension-redeclared-owner-field`, `protocol-stored-item-conversion.notice-name`, `protocol-authoring-gate.extension-write-fold`, `protocol.packaged-base-refusal`, `protocol.unknown-picklist-binding-refusal` (129/129); runtime `meta-picklist-binding-door`, `packages-export-base-showcase-boot.integration`, `meta-object-extension-item-door-fit` (22/22). - At `e4ee8af8e` (before r1; r1 changes only the extension door's object read and prose): `@objectstack/metadata-protocol` 22810 tests passed, `@objectstack/objectql` 12874, `@objectstack/platform-objects` 1955, `@objectstack/mcp` 1145, `@objectstack/cloud-connection` 1206, `@objectstack/plugin-approvals` 1632, `@objectstack/service-mailbox` 152, `@objectstack/rest` 8346 (332 skipped), `@objectstack/cli` unit 5934 and integration `test/migrate-meta-engine-guidance.test.ts` 3/3, `@objectstack/runtime` 597 files after the fixture repair. </details> <details><summary>Gates (dispatch-gates --commands, 109 lines)</summary> The derivation at `9d07ffa06` is the same 109 lines as before r1. Every line ran with stdin closed and its exit code captured before any pipe. 103 exited 0 on the first pass; six `@objectstack/spec` lines (`check:api-surface`, `check:browser-reachable-entries`, `check:dual-source-exports`, `check:entry-nameability`, `check:exported-any`, `check:skill-examples`) exited 3 (refused, nothing measured) because the spec build predated the edited semantic entry. After `pnpm --filter @objectstack/spec build` all six exited 0. `dispatch-gates --ran`: `109 derived, 109 run, 0 NOT-MEASURED`. </details> Dogfood (the title carries `!`), full battery, the CI command, no shard, on head `9d07ffa06`. The closure was built first. Result: `VERDICT command-exit 0`, Test Files 463 passed and 3 skipped (466), Tests 3918 passed and 42 skipped (3960), no failures. --- _Generated by [Claude Code](https://claude.ai/code/session_01L9qibyToDkPxCjvNiWsv6e)_ <!-- signed: domain:spec#2 · os-tesla · session_01L9qibyToDkPxCjvNiWsv6e --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Tesla · project thread
Fixes #33147
Clause-②: yes (narrowing) — the MCP
validate_expressiontool now answersok: false(or a warning) at aflow_condition, and for a named stored or formula field at aformulasite, where the publish gate already refuses (or warns). It also accepts two new optional inputs,startConditionandfield, which is the widening arm. The gate's acceptance set does not change.Metadata-protocol: none
Skills-docs: none — the published skills say only that the tool runs the build's validator, which stays true; what it judges at each site is taught by the served
SKILL.mdline this diff updates (and its Console mirror, byte for byte).维护者速读
validate_expression在flow_condition位点按运行时发布门禁对流程写入的判法,跑门禁自己的检查(记录触发流程上record./previous.未判空的可空字段报错,外部对象未落存储的系统列告警);新增两个可选入参:startCondition(下游条件继承起始条件已证的非空)和field(公式位点按该字段本身判:存储字段给存储表达式告警,公式字段给循环判定)。ok: true,代理到保存流程时才第一次被拒;存储字段的告警和公式循环它也答不出。packages/lint/src/authored-site-expression.ts(流程探针与field就地替换)、packages/mcp/src/mcp-http-tools.ts的validate_expression入参与gatePassFindings。pnpm --filter @objectstack/lint exec vitest run src/authored-site-expression.test.ts,预期 50 个测试全过。What changes
PR #33134 closed the gap at the
validationandformulasites. This PR closes the three gaps it left.1.
flow_condition: the gate's own passes. Measured at the #33134 head (fbdba070) before this change, on a record-triggered flow ontaskwithdaysnullable. Each condition was placed on the start node, adecisionbranch and an edge, and all three slots answered alike:os validate(build door)record.days > 3previous.days > 3record.owner_id == 'u1'on an external objectdays > 3(bare)user.id == 'u1',foo.bar == 1record.title == 'x'(CONTROL)The two doors disagree because the runtime publish gate's per-write snapshot shows no entrance, so its root scope is never provable (
perWriteSnapshotEntrance). That turns off the bare-name null guard and the unbound-root refusal there. The existing pin invalidate-expressions.flow-null-guards.test.tsalready records this disagreement.The seat chose the runtime flow publish door, the one a flow saved through MCP or Studio meets. The tool must never refuse what that door accepts. So
okat aflow_conditionis that door's verdict, notos validate's. The tool description, the servedSKILL.mdline and the changeset each say this in one sentence and tell an agent to writerecord.FIELD.@objectstack/lintjudgeAuthoredSiteExpressiontakessite: 'flow_condition'. ⛔ It still re-implements no pass. It builds a one-flow probe (authoredFlowProbe): a start node bound toobjectNamewith the trigger the caller names, its start condition when one is given, and one edge to an end node carrying the condition. It then runs the gate's own walk withruntimeWriteType: 'flow'and keeps the findings on that edge's key path (flows[0].edges[0].condition). Each trigger kind is spelled the wayresolveFlowTriggerKindreads it, and a pin reads every kind back.runStackExpressionPassescall. Only the stack, the write type and the slot filter differ by site.sharedValidatorRunByCallerstill has one passer, and the source pin from fix(mcp): validate_expression gives the publish gate's verdict at validation and formula sites #33134 still holds that.@objectstack/mcp:VALIDATE_SITE_MAP.flow_conditiongainsgatePasses: 'flow_condition'. At a flow condition the tool reads the subject's served definition and nothing else, because nothing hydrates a relationship hop there.2. New optional input
startCondition(siteflow_conditiononly). The gate presumes what a flow's start condition proves at every condition downstream. Without that presumption, the tool would refuserecord.days > 3on an edge after a start conditionrecord.days != null, which the gate accepts. GivenstartCondition, the probe carries it on the start node, and the gate's own presumption applies. That includes the door split for a bare start guard:days != nullproves nothing at the runtime door, so the edge is still refused there and here. Omitted, the condition is judged as the start condition itself. A pin shows that a start probe and an edge probe answer alike when no start condition is given, so no slot input is needed.3. New optional input
field(siteformulaonly, a snake_case field name): the field the expression is authored on. It resolves only through the caller's served definition (servedObjectDefinitionOf).formula) then gets the gate'sstoredExpressionInputIssueswarnings (card item 2), and a formula field is judged on the object's formula graph under its own name, soformulaCycleIssuesrefuses the cycle it would close (card item 3).Other surfaces:
SKILL.mdline, with its Console mirror byte for byte, name what is judged at aflow_condition, the two inputs, and the limits.startConditionon another site andfieldon another site are refused, like the existing site-scoped inputs..changeset/33147-validate-expression-flow-condition-parity.md: patch for@objectstack/mcp,@objectstack/lintand@object-ui/console, with the BREAKING verdict-narrowing banner and the ADR-0087not-required (no-migration-prescription)disposition, naming both inputs.Tests
packages/lint/src/authored-site-expression.test.ts(26 → 50 tests)decisionbranch block, the edge block, and thecheck/checkDeclaredPredicatehelpers they hand the source to. Bare calls and member calls are both covered. The classification:checkFlowNullGuardsandwarnUnprovisionedAnchorsarepass. Each is pinned at all three slots: the entry's findings equal the runtime gate's on a hand-written flow (start,decision, two ends, three edges).refuseUnboundRootsandwarnShadowedFieldReadsarepass-silent-here, with the reason: os validate's whole-flow judgments over variables, node ids and entrances. Each pin is non-vacuous:os validatespeaks on the same condition, given the bindings it reads.refuseStoredMetadataBodyHopandrefuseUndeclaredHopFieldarepass-silent-here: they run only where a hop is hydrated.os validaterefuses it, and the runtime gate and the entry do not.validateExpression,checkStructuralConditionandpredicateSlotRefusalare the validator and envelope checks the tool runs itself. The rest is plumbing.decisionpasses. A bare start guard still refuses, as at the runtime door. The start condition's own findings are not reported.resolveFlowTriggerKind, and each answers as the gate does. The null guard fires on a record-triggered flow only.[].field. A declared stored field gets the gate's stored-expression warnings, and the unnamed probe gets none. A declared formula gets the cycle refusal under its own name. Array-form fields read the same. An undeclared name answers like no name.formulaCycleIssuesandstoredExpressionInputIssuesclassifications keeppass-silent-herefor the unnamed probe, and their reasons now point at thefieldblock.packages/mcp/src/mcp-validate-expression.test.ts(60 → 72 tests)flow_condition: therecord.null guard, theprevious.null guard, and the anchor warning. Each is the gate's verdict and sentence, and the definition-less bridge answered ok before.days > 3answers exactly as before. A start guard is honoured. A schedule flow gets no null guard. CONTROL equals the definition-less bridge.flow_conditionreads nothing now coverstemplatealone.fieldblock with a masking bridge. A stored field's warnings, the cycle refusal, and a field masked from the caller answers exactly as a field the object does not declare (and as no field at all). A bad field name is refused.Acceptance notes
okat aflow_conditionis the runtime publish gate's verdict, notos validate's.os validatealso refuses a bare name's unguarded null read, a root the run does not bind, and warns on a read a flow variable shadows. It judges those over the whole flow's variables, node ids and entrances, which the tool is not handed. The runtime door gives none of them, and the tool follows it so that it never refuses a condition that door accepts.flow 'this flow' · edge 'this condition' (start→end) condition, because the tool is handed the condition and not the flow it will sit in.fieldis judged as a new formula field, and there is nofieldTypeinput (seat ruling). Once the field is declared, or served in a draft, it is judged as stored.fieldresolves only throughservedObjectDefinitionOf, and the runtime bridge serves that throughreadObjectForCaller, which masks a field the caller cannot read.mcp-object-schema-mask.test.ts's case table already pins that mask from fix(mcp): validate_expression gives the publish gate's verdict at validation and formula sites #33134. This PR adds the tool-level pin that a masked name and an absent name answer alike.decisionbranch and an edge are the same slot to the gate, apart from the start-condition presumption, so there is no slot input. A non-start node'sconfig.conditionis inert and the gate does not judge it.ruling|Ruling-ref|maintainer|⛔) before editing, on the surface:authored-site-expression.ts1 (its own ⛔ no re-implementation),validate-expressions.ts28,lint/src/index.ts7,mcp-http-tools.ts39,skill-md.ts1. The ones that bear on this change are the root-scope stand-down at the runtime gate (rulings5791822697item 3 and6104584601, cited inflow-cel-root-scope.ts). This PR follows them: the tool judges no root where that door judges none.os-dev-reportcomment.Verification
Head:
c21d260c, which is529ccc6d(the change) withorigin/mainmerged once before opening, cleanly. The merge brought #33117, which also editsmcp-http-tools.tsin another tool, plus two metadata-protocol changes. Every suite and gate below that namesc21d260cwas re-run after that merge.Ablations (each through scripts/ablation-replace.mjs, each restored with git diff HEAD empty)
Suites at head
Derived gates (dispatch-gates --commands, reconciled with --ran)
Dogfood battery (owed by the narrowing arm)
🤖 Generated with Claude Code
https://claude.ai/code/session_01L9qibxiHaRMZVvPqb3cEac