Skip to content

fix(lint)!: refuse a validation rule that compares a choice field with an option label - #39688

Merged
os-zhuang merged 7 commits into
mainfrom
claude/project-thread-uj1amn
Dec 4, 2026
Merged

os-zhuang merged 7 commits into
mainfrom
claude/project-thread-uj1amn

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Tesla · project thread

Fixes #39441
Ruling-ref: 7403149741

Clause-②: yes (narrowing)
Metadata-protocol: narrowed
Skills-docs: follow-up #39720

维护者速读

  • 用户能看到什么变化:管理员或替他搭应用的 AI 在对象的校验规则里,把下拉、单选、多选字段的「显示名」当成值写(例如写「Urgent」而记录里存的是「urgent」),以前照常保存、规则永远不触发(取反写法则拦下每一次保存),现在校验、构建和发布时当场报错,并告诉他该写哪个值。
  • 为什么做:属于「把选项显示名当值写」这一类问题的收口,流程条件和共享规则已经这样处理,这次补上对象校验规则(替用接口、手写条件或旧表单写规则的管理员解决)。
  • 出错会怎样:已经存着这类规则的对象,下一次发布会被挡下,哪怕这次改的是别的字段,直到把显示名改成值或把这条规则停用为止;对象照常加载、规则照常执行;草稿照常保存,但草稿的发布预检会指出这条规则;从历史版本恢复与发布一样会被挡;已发布的示例与 HotCRM 里没有这样的规则,客户环境里存着的没有测过;撤回这一个改动即可恢复原样。
  • 要你做什么:确认这是一个破坏性收紧(包括上面这条「已有对象下次发布被挡」),并在合并前给出同意。

What changes

A validation rule whose predicate compares a select / radio / multiselect / checkboxes field with one of its option labels, where the record holds the option's value, is refused as validation-condition-option-label (error), naming the field, the label written and the value to write. Ruling (card #39434, comment 7403149741), applied to validation rules by meta-criterion ①: "option A … scoped to the option-LABEL comparand. The broader 'refuse every literal outside the options' … was offered and not chosen."

  • Measured first with the rule validator (evaluateValidationRules, origin/main a92f1ed9, options Urgent / urgent, Low / low): record.priority == 'Urgent' refused neither row (the rule never fires); record.priority != 'Urgent' and !(record.priority in ['Urgent']) refused both rows (the rule refuses every write); the value spellings refused only the row they name. So the negated comparand is covered, under the same id.
  • New module packages/lint/src/validate-validation-rule-option-labels.ts. No second matcher: the label reading is flow-select-options.ts (indexSelectOptions, optionLabelComparisons, the reading flow-condition-option-label uses), with the roots a validation predicate binds (record.F, previous.F); the rule walk is the compile rule's exported walkObjectValidationRules (object rules, extension rules, conditional branches). Judged slots: condition and when.
  • Not judged: a label that is also some option's value; a literal that is neither (option E, not chosen); a readonly field; a picklist-bound field; a field two object extensions both declare; a label holding a quote or a backslash; a predicate in a dialect other than CEL; the membership spelling 'L' in record.F on a multiselect / checkboxes field (not a comparand form the shared reading knows); a rule with active: false and every branch under it (the evaluator skips it, and it keeps a one-key way out for a stored object). The exemption is keyed on the switched-off rule record and the branches the walk hands right after it, never on the rule's name: another, active rule sharing that name is judged (r2, S1 below).
  • Spellings reached: F == 'L', F != 'L', 'L' == F, 'L' != F, and each member of F in [...], negated or not, with F read as record.F or previous.F.
  • Doors: registered in AUTHORING_RULES as gating on all three CLI commands and on the metadata publish door for object and object_extension writes (saveMetaItem active / publishMetaItem, 422 INVALID_METADATA). No code in metadata-protocol moves.
  • Stored rows (judging mode settled as A by precedent, reading 7413097187 on this card): a stored object or extension carrying the shape still loads and its rule evaluates as before. Its next publish is refused, even when the edit is unrelated, until the value is written or the rule is switched off (active: false) — the door's standing mode, where every finding on the written item is judged on every publish ("re-saving a row is writing it", runtime-gate.ts), the same mode the flow sibling flow-condition-option-label landed with (PR fix(lint)!: os validate refuses an option label in a flow filter, edge condition or decision branch #37491). A draft save is not refused at the save, but its publish verdict, computed on read through the same judge, names the finding. A history restore is an active write and is judged like a publish: a stored history version carrying the shape is refused on restore. A sibling object's stored label rule is never charged to another write. Pinned at the lint gate function and, since this round, through the real saveMetaItem door (below). The order pin "a condition unchanged on an existing row is not judged" (a sharing-rule-door term) is withdrawn by the claim per that reading.
  • ADR-0087: semantic ledger entry validation-condition-option-label-refused (packages/spec/src/migrations/entries/semantic/19.validation-condition-option-label-refused.ts) with its rows in semantic-relevance.test.ts and the validation site of semantic-relevance-coverage-38929.test.ts; required by check:adr-0087-registration for a declared Metadata-protocol: narrowed. Changeset @objectstack/lint and @objectstack/spec minor (a declared kind takes at least minor), with a FROM → TO table. Accepted by claim amendment 7412845318.
  • Rosters: the object / object_extension door roster pins name the new rule; os explain validation-condition-option-label has its entry; the four CLI transcripts under content/docs/ print one more author-time rule (90 → 91, check:docs-transcript-drift).

Metadata-protocol: narrowed is the claim's line, confirmed by the contract review (7414461872): unlike the sharing-rule sibling (a sys_sharing_rule row is data, declared none), an object's validation rules are package metadata an author writes, so the minor changeset and the ADR-0087 entry stay.

r2 (head 2eb5a24): S1 and the review nits

  • S1 closed in code. The active: false exemption was keyed on the rule's config path, which flattenRules builds from name; so validations: [{ name: 'x', active: false, ... }, { name: 'x', condition: "record.priority != 'Urgent'" }] left the second, live rule unjudged though it refuses every write (validations is an array and nothing refuses a repeated name). It now follows the walked records: the switched-off rule, then exactly the branches the walk hands right after it (branchesOf, depth-first, then before otherwise, capped at MAX_RULE_NESTING_DEPTH); the first entry that is not the next expected branch ends the silencing. Pinned for a repeated top-level name, a repeated conditional whose live copy's branch has the switched-off copy's branch path, and a repeated name in one extension entry.
  • Nits on the same face: the finding no longer says no record holds the label (a retired value may still be stored); it reads "the field stores the option's value 'urgent', not its label". The os explain entry, the ledger entry and the changeset now name the spellings reached (adding 'L' != F to the explanation) and the one not read ('L' in F), and the ledger's not-the-shape list names the tied-extension field, the quoted label and the non-CEL dialect the code also skips.

Tests

Step 0, red on origin/main at the real door

packages/metadata-protocol/src/protocol.runtime-authoring-gate.test.ts, the #39441 block, run against @objectstack/lint built from a92f1ed9 (the door reaches lint through dist/):

AssertionError: the save resolved — the door still accepts the label: expected { success: true, …(4) } to be an instance of Error
Tests  1 failed | 1 passed | 270 skipped (272)

And at the lint gate function on a92f1ed9: an object write and an object_extension write carrying record.priority == 'Urgent' && record.name == null answered {"errors":[],"advisories":[]}; runAuthoringRules('build') returned no error.

Green at head 502f60a
  • pnpm --filter @objectstack/metadata-protocol exec vitest run --maxWorkers=2 src/protocol.runtime-authoring-gate.test.ts (lint dist/ built from this branch's lint source): Test Files 1 passed (1), Tests 275 passed (275) — 272 before plus the 3 stored-object pins; VERDICT command-exit 0.
  • pnpm --filter @objectstack/metadata-protocol typecheck (tsc --noEmit, --listFiles includes the test file): VERDICT command-exit 0.
  • Carried from 317fe761 (no source in those packages moved since): pnpm --filter @objectstack/lint test Test Files 263 passed (263), Tests 10410 passed (10410); spec semantic-relevance.test.ts + semantic-relevance-coverage-38929.test.ts 64 passed, 3 todo (pre-existing); lint typecheck exit 0.
Ablation (one, the matcher call)

node scripts/ablation-replace.mjs replaced the optionLabelComparisons(...) loop source with an empty list (anchor 1 → 0, blob 19157df3 → 5ef3ddbe): validate-validation-rule-option-labels.test.ts went 6 failed / 8 passed (the 8 are the not-refused pins); restored, blob equals HEAD, git diff HEAD empty. The r1 commit adds pins only and changes no behaviour, so no new ablation.

Green at head 2eb5a24 (r2)
  • pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2 src/validate-validation-rule-option-labels.test.ts: Test Files 1 passed (1), Tests 15 passed (15); VERDICT command-exit 0.
  • pnpm --filter @objectstack/lint test: Test Files 263 passed (263), Tests 10411 passed (10411); VERDICT command-exit 0.
  • pnpm --filter @objectstack/lint typecheck: VERDICT command-exit 0 (check:test-typecheck: OK).
  • pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/migrations: Test Files 6 passed (6), Tests 255 passed, 3 todo; VERDICT command-exit 0.
  • pnpm --filter @objectstack/spec typecheck (runs gen:migration-registry; no tracked file changed): VERDICT command-exit 0.
  • metadata-protocol door suite not re-run: no metadata-protocol file moved in r2, and the door reaches lint through dist/, whose rule behaviour for the pinned shapes (single-named rules) is unchanged; CI's Test Core runs it on this head.
Ablation (r2, S1)

Committed first, then node scripts/ablation-replace.mjs --hold put the r1 path-keyed loop back in place of the identity-keyed one (marker ABLATION-PATH-KEYED count 1, silenced[0] === rule count 0). The suite imports the module by relative source path (no dist/ in the path). validate-validation-rule-option-labels.test.ts: × ⭐ a live rule sharing a switched-off rule's name is still judged, and so are its branches — AssertionError: expected [] to deeply equal [ Array(1) ], Tests 1 failed / 14 passed, VERDICT command-exit 1. Restored with git checkout HEAD --: git diff HEAD empty, disk blob b56327a2 equals the HEAD blob.

Pins (packages/lint/src/validate-validation-rule-option-labels.test.ts): label refused with the value named, at the object door, the extension door and the build (same finding); the value saves; a non-choice field untouched; != / negated in refused; previous.F, when and a nested branch each at their own slot; label-that-is-a-value and neither-label-nor-value not refused; readonly, picklist and non-CEL not judged; active: false not judged; a live rule sharing a switched-off rule's name judged, with its branches (top level, nested, extension entry); a re-publish of a stored object with the label rule unchanged is judged, and switching the rule off republishes clean; a sibling's stored label rule is not charged.

Real door (packages/metadata-protocol/src/protocol.runtime-authoring-gate.test.ts, the #39441 block): an active save comparing the label is refused 422 INVALID_METADATA naming the value, and nothing lands; the value saves. New this round, a stored object the door already holds with the label rule: an unrelated publish (a relabel) is refused on the unchanged rule and nothing lands; the same publish with active: false on the rule lands active without the value written; a draft save of it is not judged and lands draft.

Acceptance notes

Verification

Read first, by risk:

  1. packages/lint/src/validate-validation-rule-option-labels.ts: the identity-keyed silenced loop and branchesOf (r2), then the reads and the not-judged list.
  2. packages/lint/src/authoring-rules.ts, the new entry after validateRuleSchemaFormats (doors and runtimeTypes).
  3. packages/spec/src/migrations/entries/semantic/19.validation-condition-option-label-refused.ts.

Two-minute check: pnpm --filter @objectstack/lint exec vitest run src/validate-validation-rule-option-labels.test.ts shows 15 passed; the second case names write 'urgent' in place of 'Urgent'.

Gates at head 2eb5a24 (r2, narrowed to the r2 delta)
  • Derived at 2eb5a24a (dispatch-gates --commands, stderr names objectstack-ai/objectstack at 2eb5a24): the same 118 families. Local run narrowed to the families reading the five files r2 touched (lint rule module and test, the os explain entry, the ledger entry, the changeset), each exit captured before any pipe, all exit 0: check-adr-0087-registration.mjs --base origin/main (1 migration entry added) and --self-test, check-changeset-no-major.mjs --base origin/main, check-empty-changeset.mjs --base origin/main, check-closing-keyword-parity.mjs, check-issue-citations.mjs, check:nul-bytes, check:issue-citations, check:corpus-claim-drift, check:docs-transcript-drift (4 transcript values equal the registry), check:cross-package-test-inputs, check:test-source-alias, check:changeset-gate-self-tests, docs-audit/check-affected-docs.mjs, docs-audit/check-drift-comment.mjs, spec check:upgrade-guide, check:spec-changes, check:liveness, check:docs (after gen:schema refreshed the gitignored json-schema/; first run was PREREQUISITE-style exit 1 on a stale tree, 251 generated files in sync after), lint check:doc-formula-expressions.
  • dispatch-gates --ran: ✗ dispatch-gates --ran: 98 of 118 derived famil(ies) UNRUN. Declared narrowing: the 98 derive from the r1 files (docs transcripts, the metadata-protocol test) that r2 did not move and were all run green on 502f60a5 (below); CI runs the full set on 2eb5a24a.
Gates at head 502f60a
  • node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack at 502f60a5: 118 families derived (the same set as at 317fe761; the r1 diff adds one test file in packages/metadata-protocol). All 118 re-run on 502f60a5, each exit code captured before any pipe.
  • dispatch-gates --ran: ✓ dispatch-gates --ran: 118 derived famil(ies) accounted for — 117 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3).
  • NOT MEASURED: node scripts/check-plugin-teardown-shape.mjs --self-test, exit 3 PREREQUISITE NOT MET (shallow clone cannot read its pinned fixture commit); CI runs it.
  • Ratchets green on this head, among them check:query-options-erasure (✓ query-options-erasure ratchet holds: 25 unswept non-test site(s) in 11 file(s), none new; a first run under a 300 s per-command cap was killed at the cap, exit 124, and the uncapped re-run exited 0), check:type-check-debt, check:type-check-coverage, check:cross-package-test-inputs, check:test-source-alias, check:engine-double-contract, check:nul-bytes, check:docs-transcript-drift, check:adr-0087-registration --base origin/main, check:authorable-surface.
  • check:dual-build-cjs-loads and check:lean-entry-closure (exit 3 at 317fe761) exited 0 on this head.
  • test:repo not run locally (CI's Test Core). PR check-runs: CI owns them; not read by this round.

Generated by Claude Code

…h an option label

Claude-Session: https://claude.ai/code/session_01L9qibySjU2ZFX7gNxAE2wX
Co-authored-by: Claude <noreply@anthropic.com>
…ion-label validation condition

Claude-Session: https://claude.ai/code/session_01L9qibySjU2ZFX7gNxAE2wX
Co-authored-by: Claude <noreply@anthropic.com>
…n the ADR-0087 ledger; changeset

Claude-Session: https://claude.ai/code/session_01L9qibySjU2ZFX7gNxAE2wX
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Dec 4, 2026
@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/lint, @objectstack/spec, touching 19 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/lint/src/index.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

13 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/api/error-catalog.mdx (via objectExtensions (literal, a string literal in relevantWhen))
  • content/docs/api/metadata-api.mdx (via objectExtensions (literal, a string literal in relevantWhen), object_extension (literal, a string literal in runtimeTypes))
  • content/docs/automation/hook-bodies.mdx (via objectExtensions (literal, a string literal in relevantWhen))
  • content/docs/data-modeling/object-extensions.mdx (via objectExtensions (literal, a string literal in relevantWhen), object_extension (literal, a string literal in runtimeTypes))
  • content/docs/deployment/cli.mdx (via object_extension (literal, a string literal in runtimeTypes))
  • content/docs/deployment/install-modes.mdx (via objectExtensions (literal, a string literal in relevantWhen))
  • content/docs/deployment/marketplace-handbook.mdx (via objectExtensions (literal, a string literal in relevantWhen))
  • content/docs/deployment/validating-metadata.mdx (via AUTHORING_RULES (symbol, a top-level const object), runtimeTypes (symbol, a field of const object AUTHORING_RULES), objectExtensions (literal, a string literal in relevantWhen), object_extension (literal, a string literal in runtimeTypes))
  • content/docs/getting-started/quick-start.mdx (via objectExtensions (literal, a string literal in relevantWhen))
  • content/docs/kernel/cluster.mdx (via object_extension (literal, a string literal in runtimeTypes))
  • content/docs/protocol/kernel/i18n-standard.mdx (via objectExtensions (literal, a string literal in relevantWhen))
  • content/docs/protocol/objectql/schema.mdx (via objectExtensions (literal, a string literal in relevantWhen))
  • content/docs/ui/actions.mdx (via object_extension (literal, a string literal in runtimeTypes))

⛔ 7 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v17/17-5.mdx (via objectExtensions (literal, a string literal in relevantWhen))
  • content/docs/releases/v18/18-0.mdx (via objectExtensions (literal, a string literal in relevantWhen))
  • content/docs/releases/v18/18-3.mdx (via objectExtensions (literal, a string literal in relevantWhen), object_extension (literal, a string literal in runtimeTypes))
  • content/docs/releases/v18/18-4.mdx (via objectExtensions (literal, a string literal in relevantWhen), object_extension (literal, a string literal in runtimeTypes))
  • content/docs/releases/v18/18-5.mdx (via object_extension (literal, a string literal in runtimeTypes))
  • content/docs/releases/v18/18-6.mdx (via objectExtensions (literal, a string literal in relevantWhen), object_extension (literal, a string literal in runtimeTypes))
  • content/docs/releases/v19/index.mdx (via objectExtensions (literal, a string literal in relevantWhen), object_extension (literal, a string literal in runtimeTypes))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/lint/src/index.ts) — pages documenting those are invisible to this run
  • 12 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 71 of 255 client-bound route-ledger rows — the other 184 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 184: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 60 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 185 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 09a1d7b94d8cd2234098a5eca13e04a48a783b84 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from db3466faf2abeed3d7ed2266b4c12fe28b408b3e — the merge of head 2eb5a24ad2968144a0c2a1dec7328c5a6acd94ca into base 09a1d7b94d8cd2234098a5eca13e04a48a783b84, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin db3466faf2abeed3d7ed2266b4c12fe28b408b3e && git checkout db3466faf2abeed3d7ed2266b4c12fe28b408b3e
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 09a1d7b94d8cd2234098a5eca13e04a48a783b84 2eb5a24ad2968144a0c2a1dec7328c5a6acd94ca && git checkout -B drift-repro 09a1d7b94d8cd2234098a5eca13e04a48a783b84 && git merge --no-ff 2eb5a24ad2968144a0c2a1dec7328c5a6acd94ca

node scripts/docs-audit/affected-docs.mjs --json 09a1d7b94d8cd2234098a5eca13e04a48a783b84

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 09a1d7b94d8cd2234098a5eca13e04a48a783b84 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

…ation rule at the real door

A stored object already carrying a validation rule that compares an option
label: an unrelated publish (a relabel) is refused on the unchanged rule,
the same publish with active:false on the rule lands, and a draft save is
not judged.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibySjU2ZFX7gNxAE2wX
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-tesla · os-tesla · session_01L9qibvPFnj3TkGq8ps2Jgv

Contract-review-claim: session_01L9qibvPFnj3TkGq8ps2Jgv · head 502f60a · 2026-12-04T14:24Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-tesla · os-tesla · session_01L9qibvPFnj3TkGq8ps2Jgv

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 502f60a50a7d91fac7655d4ceedad199f4427fa7
Local-runs: none
Scope: packages/spec/src/migrations/entries/semantic/19.validation-condition-option-label-refused.ts + packages/lint/src/validate-validation-rule-option-labels.ts, packages/lint/src/authoring-rules.ts, packages/lint/src/index.ts, packages/lint/src/rule-explanations.ts, packages/lint/src/rule-explanations/publish-time-inert-refusals.ts

Read for this record: card #39441 body and all 8 comments (claim 7411143900 / 7411270954, reports 7412825775 and 7414205246, amendment 7412845318, reading 7413097187), PR #39688 body and its 18-file diff at the head, ruling 7403149741 (the Ruling-ref), and the check-runs on the head. Cited code read in the head tree, not reviewed: flow-select-options.ts, validate-rule-compilability.ts (walkObjectValidationRules, flattenRules), object-graph.ts, runtime-gate.ts, metadata-protocol/src/runtime-authoring-gate.ts, objectql/src/validation/rule-validator.ts and record-validator.ts, core/src/utils/import-coerce.ts, spec/src/data/validation.zod.ts, AGENTS.md Post-Task step 3. The remainder of the diff (two changed lint roster tests, the new lint test, the metadata-protocol door test, the two spec relevance-test rows, four content/docs transcript counts, the changeset prose) is the lane seat's ACCEPT at TIER_DEFAULT; the tests were read only as evidence for the claims below.

① Derived judgments

  • Accept-set, narrowed — right. An object / object_extension body whose validation rule condition or when compares a select / radio / multiselect / checkboxes field of the rule's own object (read as record.F or previous.F) with one of that field's option labels was accepted by os validate, os build, os lint and the publish door; it is now an error at all four (tier: 'gating', commands: ALL, surfaces: CLI_AND_RUNTIME, runtimeTypes: ['object', 'object_extension']). That is "a value refused" in AGENTS.md's own words, on package metadata an author writes.
  • The premise the refusal rests on holds in the evaluator. rule-validator.ts evaluates the CEL against the merged stored record and the previous binding as written, and record-validator.ts admits only optionValues(def.options) on a non-readonly choice field, so a label is not a value the write door admits. The import path maps a cell that matches a label to the option's value (import-coerce.ts, exact value, then label case-insensitively), so createMissingOptions keeps only cells that match neither; it cannot store a label.
  • Not-judged set — right, and each member agrees with the code it cites. Readonly choice fields (shapeOnly skips option membership in record-validator.ts), picklist-bound fields and fields two extensions tie on (selectOptionsOf / objectsWithoutTiedFields), a label that is also a value (labels excludes it), a literal that is neither (option E, not chosen by ruling 7403149741), a non-CEL dialect, and active: false. The active: false exemption matches the evaluator exactly: the top-level list is filtered on r.active !== false and checkConditional returns null for a branch with active === false, so a switched-off rule and everything under it never evaluates.
  • Public surface, added — right. @objectstack/lint gains the exports validateValidationRuleOptionLabels, VALIDATION_CONDITION_OPTION_LABEL and the type ValidationRuleOptionLabelFinding; os explain validation-condition-option-label gains an entry. Additive, no existing export moves.
  • Ledger, added — right. One ADR-0087 semantic entry under major 19 (@objectstack/spec is 19.0.0-next.4), relevantWhen: stack-declares objects, objectExtensions, no D2 conversion. No conversion is the right call: rewriting the label to the value turns a rule that never fired into one that refuses writes, which is the author's decision.
  • No code in metadata-protocol moves — right. The door filters AUTHORING_RULES by runtimeTypes; the diff there is one test block.

② Semver level

  • Changeset .changeset/39441-validation-condition-option-label.md: @objectstack/lint minor, @objectstack/spec minor. Both packages are moved by the diff (lint source; one spec ledger entry), and AGENTS.md Post-Task step 3 reads "a kind takes at least minor on a package the diff moves". Matches. The body carries the BREAKING banner, a Before / After table, the one-line fix, both declaration lines and exactly one ADR-0087 marker (registered validation-condition-option-label-refused), which names an entry that exists in the diff.
  • Clause-②: yes (narrowing) — matches the diff: a previously accepted body is refused. The PR title carries !, the PR body and the changeset body carry the same two lines.
  • Metadata-protocol: narrowed is right, not none (the first question the zone asked). The rule's own text decides it: "a value refused or a requirement tightened is narrowed", measured on "what a metadata author can write". The sibling precedents that declared none (fix(plugin-sharing)!: a sharing rule on an object without record sharing is refused at save #30953, fix(plugin-sharing): refuse an unresolved user recipient on the sys_sharing_rule /data door #39361, and the sharing-rule PR fix(plugin-sharing)!: refuse a sharing-rule criteria that compares a choice field with an option label #39543) refuse a sys_sharing_rule data row; this refuses an object / object_extension metadata body at build and at publish. The flow sibling for the same mistake already carries a ledger entry (19.publish-refuses-flows-that-save-and-do-not-run, naming flow-condition-option-label), and the nearest validation-rule precedent, 18.validation-type-mismatch-refused, is a lint-only tightening registered the same way. So the minor level and the registered ADR-0087 entry both follow.
  • Check-runs on the head: 65 success, 18 skipped, 0 failed. Among the green ones: Test Core 12/12, Type Check (workspace, source gates, consumer gates, debt ledger), Lint and Repo Gates, Lint PM dispatch-gates, Spec property liveness, v18 to v19 source upgrade, Governed Surface Queue Guard, PR-body guards. Not final when this record was rendered: one Check Changeset run in progress (two earlier runs of it on this head are green, one was cancelled as superseded) and the three opt-in Dogfood battery shard runs in progress. The dogfood battery is owed for the ! title and is not answered by this record.

③ Boundary flags

  • Report 7412825775 open_questions[0] (judging mode at the publish door): A holds in the tree. runtime-gate.ts states the mode ("a finding located on the written item itself is this write's whenever the universe without the item does not hold it, whatever the stored row held. Re-saving a row is writing it"), and the new rule registers under it with no per-rule exception. Pinned at the lint gate function (a re-publish that leaves the label rule unchanged is judged; switching the rule off republishes clean) and at the real saveMetaItem door (relabel publish refused 422 INVALID_METADATA on the unchanged rule and nothing lands; the same publish with active: false lands active). Reading 7413097187 settles the term "judged only when the criteria change" as bound to the sys_sharing_rule save; the ruling's sentence does have that subject, and I read the ruling the same way. What that reading does not replace, and this record does not either: the maintainer's per-PR word on the BREAKING narrowing, covering the stored-object sentence in 维护者速读 line 3. Escalated as still owed, not answered here.
  • Draft save left unjudged: holds. metadata-protocol/src/runtime-authoring-gate.ts returns before any shared rule runs when state !== 'active' (D1), and the real-door pin lands the unchanged label rule as draft. One precision the PR body does not state: "not judged" means not refused at the save. A draft's publish verdict is computed on read through the same judge, so the draft will show the finding as its publish verdict. That is the intended behaviour and not a finding.
  • Other doors that reach the same judge (history restore, judged as an active write; package publish-drafts): they inherit the door's standing mode. The PR body's "next publish" sentence does not name restore; a stored history version carrying the shape will be refused on restore like any gating finding. Standing mode, stated for the maintainer's read, not a finding.
  • Report 7412825775 open_questions[1] (minor instead of the order's patch; the spec ledger entry outside the claimed surface; the roster pins, the door pin and the four transcript counts): accept as listed. Each follows from Metadata-protocol: narrowed, which ② finds right; amendment 7412845318 widened the claim to match.
  • Report 7414205246: open_questions is empty. Its out-of-scope notes (the skills/objectstack-data/rules/validation.md sentence, named in the PR's Skills-docs: line as follow-up owed; the validate-flow-notify-channels.ts docblock sentence; the http-dispatcher.ts ratchet decrease) are outside this diff and are the seat's to carry.
  • Customer-stored metadata is unmeasured. The PR body says so plainly and scopes "0 shipped" to the shipped trees and HotCRM. Nothing in the diff can measure it; the exits (active: false, writing the value, OS_ALLOW_UNLINTED_METADATA_WRITES=1) exist in the tree.
  • SQL push-down: not applicable. The rule is a pure (stack) => findings function over in-memory metadata; no query, no id materialisation, no in-app join.

④ Design judgment

19.validation-condition-option-label-refused.ts (hits), against ruling 7403149741 and its first consumer (os migrate meta, through the relevance question): holds. The ruling chose the label comparand only, with the value named; the entry's surface, replacement and reason describe exactly that and say why no conversion is registered. relevantWhen names the two stack keys the rule reads and is pinned in semantic-relevance.test.ts and the validation site of the coverage test. acceptanceCriteria states the stored-object behaviour the door actually has. Sentence by sentence against validate-validation-rule-option-labels.ts: the field types, the two roots, the three comparand forms, the two slots, the branch flattening and the five listed exclusions all agree with the code.

validate-validation-rule-option-labels.ts: the reading is the shared one (indexSelectOptions, optionLabelComparisons with roots: ['record', 'previous'], bare: false) and the walk is the compile rule's, so there is no second matcher and no second walk, as claimed. Tried to break it: a traversal record.account.priority does not match (the read must follow the root directly and is closed by (?![\w.])); a non-choice field with the same text is untouched; an extension rule is judged against the served target (extension fields folded by objectsAsServed); a sibling's finding is not charged (the gate's differential, pinned); previous.F is judged and holds stored values, so the label reasoning applies to it too.

S1 (should-fix) — the active: false silencing is keyed on the rule's PATH STRING, so it also silences a different, active rule that shares the switched-off rule's name. switchedOff holds basePath values and the loop skips any rule whose basePath equals or is prefixed by one; basePath is objects.OBJECT.validations.NAME built from the rule's name by flattenRules. ObjectSchema.validations is z.array(ValidationRuleSchema); the name is described as unique but I found no refusal of a repeated name in the spec schema or in packages/lint/src at this head, and the evaluator runs every array member. So for validations: [{ name: 'x', active: false, ... }, { name: 'x', condition: "record.priority != 'Urgent'" }] the second rule is live, refuses every write, and is not judged. The same holds for same-named branches under one parent path and for two same-named rules in one extension entry. The module docblock, the ledger entry and the changeset all say the exemption is "a rule switched off, and every branch under it"; an active rule with the same name is neither. Direction is fail-open (nothing is wrongly refused), and it takes a repeated name with the switched-off one first, which is why this is not a must-fix. Fix shape: key the exemption on the walked rule itself (identity or walk position of the switched-off rule and its flattened descendants), with one pin for the repeated-name case. Read from the code, not run.

Nits (no effect on correctness or the contract):

  • The finding message says "so no record holds 'Urgent'". The module's own third not-judged bullet admits stored values outside the options (a retired option rows still hold). A row written when Urgent was itself an option value, on a field whose current options carry Urgent only as a label, does hold it, and that comparison is now refused with no value spelling that reaches those rows. Inherited from the shared reading and from ruling option A's premise ("where the row holds the value"); the flow sibling says the same. Softer wording ("the field stores the value") would be exact.
  • 'L' in record.F, the natural membership spelling on a multiselect / checkboxes field, is not a comparand form the shared reader knows, so it is not judged. The changeset and the ledger list those two field types without saying which spellings are reached; the explanation's second paragraph does list the forms, and omits 'L' != F, which the code judges and the test pins.
  • The ledger entry's "Not the shape" list omits three exclusions the code also makes: a field two extensions tie on, a non-CEL dialect, and a label containing a quote or backslash. Harmless in a TODO entry (it over-describes the shape, never under-describes it).
  • Same trap, other slots, outside this card: a field's requiredWhen / readonlyWhen / option visibleWhen comparing a choice field with a label is not read by this rule. Follow-up material for the seat, not a defect of this diff.

authoring-rules.ts: the entry sits beside validateRuleSchemaFormats with the same input, surfaces and runtimeTypes, which is the walk's other reader; the comment's claim that an extension write is charged with its entry's rules alone is the gate's differential and is pinned (an extension write is not charged with a label the target's own stored rule carries). Agrees.

index.ts, rule-explanations.ts, rule-explanations/publish-time-inert-refusals.ts: exports and the explanation registration agree with the module; the explanation's first and third paragraphs match the code and the evaluator (see the nit on its second paragraph).

Answers to the two questions the owning zone asked:

  1. Metadata-protocol: narrowed is right; none would be wrong here. The minor changeset on both moved packages and the registered ADR-0087 entry follow from it and are both present and consistent.
  2. Q1 as A holds in the tree: a republish of a stored object with the unchanged label rule is judged and refused, active: false on the rule republishes it without the value written, and a draft save is not refused (the draft's publish verdict will name the finding). All three are pinned at the real door at this head.

S1 is open on this head; its fix moves the head and earns a delta review. The maintainer's word on the BREAKING narrowing and the dogfood battery remain owed and are outside what this record grants.

Implemented-by: claude/project-thread-uj1amn
Reviewed-by: session_01L9qibvPFnj3TkGq8ps2Jgv (isolated sub-agent)

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

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 #39688 @ 502f60a50a7d91fac7655d4ceedad199f4427fa7 (card #39441)

You review at CONTRACT_REVIEW_TIER. Render ONE ## Contract review record on this head — its shape is
node scripts/pm/record-recognisers.mjs --template --paths packages/spec/src/migrations/entries/semantic/19.validation-condition-option-label-refused.ts — with a PASS or FAIL verdict, and post it as ONE comment
on the PR or its card.

Inputs — these and nothing else:
· card #39441: its body and EVERY comment (rulings and earlier records included)
· PR #39688: its body, its file list, and the net diff against main at 502f60a50a7d91fac7655d4ceedad199f4427fa7
· the check-runs on 502f60a50a7d91fac7655d4ceedad199f4427fa7: their conclusions ARE the gate verdicts
⛔ Not the dispatch order, ⛔ not the dispatching seat's own conclusions — this brief is adversarial by design.

Scope — the paths reviewFace returns as hits on this PR's file list: packages/spec/src/migrations/entries/semantic/19.validation-condition-option-label-refused.ts;
plus every file IN THIS DIFF that directly implements or enforces them — the gate that enforces a rule, the code
a jsdoc or schema line describes, the validator a skill teaches — reviewed for agreement with the contract.
Widen it freely, ⛔ never below hits; the record's Scope: line names the implementing files apart from hits.
The rest of the diff (tests, unrelated modules, lockfiles, generated output, changesets) is the lane seat's
ACCEPT at TIER_DEFAULT, exactly as a standalone PR of those files.
④ judges the hits files and those implementing files ONLY:
lockfiles, generated output, changesets and prose elsewhere in the PR are not reviewed;
code outside the diff is READ to judge them, never reviewed.

⛔ READ-ONLY. No worktree, no checkout, no build, no test run, no gate re-run, no ablation: the check-runs
on the head already answered every derived gate family, and a local run costs more than it returns.
If ONE probe is unavoidable, the record's Local-runs: line says probe — REASON; otherwise none.
Scratch space is /tmp/claude-0/-home-user/f90b304d-2703-5b33-b155-97489671c85a/scratchpad/pr-39688/ alone; nothing there you did not write this round is read.

Judge, in the record's own sections:
① Derived judgments — every accept-set and public-surface change the diff implies, each named right or wrong.
② Semver level — the changeset (or skip-changeset) matches what the diff publishes, and the Clause-②: line.
③ Boundary flags — every dev flag and every open_questions entry answered, or escalated.
On every face, SQL push-down: a new id materialisation or in-app join where SQL could push down is a
finding unless a reason is given (AGENTS.md, Prime Directive 5: SQL first).
④ Design judgment — for EVERY hits file: does the change hold against the code it cites and the
scenario it is accepted against? A skill file against the card's eval prompt and the spec it teaches
on main; a schema file against the ruling or ADR it implements and its first consumer; an ADR
against its first consumer and its execution plan. For EVERY implementing file in the diff: does the
code agree with the contract, sentence by sentence? Read the cited code in the live tree, and try to
break the design.
Grade each finding must-fix, should-fix or nit — a nit has no effect on correctness or the contract.
A must-fix is a FAIL; a must-fix or should-fix earns a delta review of its fix; nits alone end the round.
Spell a must-fix or should-fix with its id and grade, S1 (should-fix) — …, and a clean round as
No must-fix, no should-fix.: the queue guard reads a graded finding as OPEN on this head and
refuses the record; the delta record names those it closes by id alone, S1: closed.
A nit is fixed only on the prose faces, or left as an accepted deviation or a follow-up card: a fix
anywhere else moves the head, and this record no longer covers it.
⛔ Judge the tree, never the PR body's account of it.
Sign Implemented-by: with the dev's branch and Reviewed-by: with your session id — the value is the FIRST
thing after each colon.

The PR declares Clause-②: yes (narrowing) and Metadata-protocol: narrowed; the narrowing itself is in scope —
packages/lint/src/validate-validation-rule-option-labels.ts and its wiring in authoring-rules.ts / index.ts are
implementing files. Questions the owning zone asked to have judged (answer each, do not assume a verdict):
· Is Metadata-protocol: narrowed right, or none? (with the minor changeset and the ADR-0087 entry it implies)
· Card #39441's Q1 was settled by precedent as A (a republish is judged; active: false is the way out) — does
the tree hold that, and is a draft save left unjudged as the PR claims?

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-tesla · os-tesla · session_01L9qibvPFnj3TkGq8ps2Jgv

L1-a · REWORK · #39688 @ 502f60a50a · Area: ot-build · read 2026-12-04T14:32Z

  • L2: at-tier record 7414461872 (CONTRACT_REVIEW_TIER, PASS with S1 open) and its filled brief 7414475226. A graded should-fix is OPEN on this head, so it owes a fix and a delta review.
    • S1 (should-fix): the active: false exemption in validate-validation-rule-option-labels.ts is keyed on the rule's path string (built from name), not on the rule. Two rules sharing a name, the switched-off one first, leave the live one unjudged, though it refuses every write. ObjectSchema.validations is a plain array and nothing at this head refuses a repeated name. Fix: key the exemption on the walked rule (identity or position) and add one repeated-name pin.
  • Zone's questions (answered in the record): Metadata-protocol: narrowed is right (it refuses an authored object / object_extension body; the none precedents refuse data rows), so the minor changeset and the ADR-0087 entry follow. Q1 as A holds: a republish is judged and refused 422 with nothing landing, active: false lands, and a draft save returns before the rule. Precision for the body: a draft is not refused at save, but its publish verdict on read names the finding; history restore is judged like a publish.
  • L1 items, closed: Skills-docs: follow-up #39720 (was "owed"); needs:dogfood-battery applied — the battery must conclude success on the final head. The metadata-protocol changeset flag is benign (only a test is touched; files[] is dist).
  • Nits (may ride the fix): the finding message "no record holds 'Urgent'" overclaims for a retired value; 'L' in record.F (multiselect membership) is not judged and the changeset/ledger don't name the reached spellings; the ledger's "Not the shape" list omits three exclusions the code makes. Outside this card: requiredWhen / readonlyWhen / option visibleWhen carry the same trap — a card for the seat.
  • For the seat: the ! narrowing's per-PR maintainer word, covering the stored-object sentence in 维护者速读 line 3, is still owed and is not granted by this review.
  • Gates at 502f60a50a (l1-face.mjs --pr 39688): 65 success · 14 expected skip · 0 failed; mergeable clean; dogfood battery was still running at the record.

A validation rule with active: false silenced every rule whose config
path equalled or extended its own, and that path is built from `name`.
So a live rule sharing a switched-off rule's name (validations is an
array; nothing refuses a repeated name) was never judged, though it
refuses every write. The exemption now follows the walked records: the
switched-off rule and exactly the branches the walk hands right after
it. Pinned for a repeated top-level name, a repeated conditional with
the same branch path, and a repeated name in one extension entry.

Review nits on the same face: the finding no longer claims no record
holds the label; the explanation, ledger entry and changeset name the
comparand spellings reached and the ones not read ('L' in F), and the
ledger's not-the-shape list names the tied-extension field, the quoted
label and the non-CEL dialect the code also skips.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibySjU2ZFX7gNxAE2wX
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-tesla · os-tesla · session_01L9qibvPFnj3TkGq8ps2Jgv

Contract-review-claim: session_01L9qibvPFnj3TkGq8ps2Jgv · head 2eb5a24 · 2026-12-04T15:16Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-tesla · os-tesla · session_01L9qibvPFnj3TkGq8ps2Jgv

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 2eb5a24ad2968144a0c2a1dec7328c5a6acd94ca
Local-runs: none
Scope: packages/spec/src/migrations/entries/semantic/19.validation-condition-option-label-refused.ts + packages/lint/src/validate-validation-rule-option-labels.ts, packages/lint/src/rule-explanations/publish-time-inert-refusals.ts

Delta review of record 7414461872 (head 502f60a5). Read for this record: the compare 502f60a5...2eb5a24a (one commit, five files: the rule module, its test, the os explain entry, the ledger entry, the changeset), delta report 7414926686, the PR body at this head, and the check-runs on this head. Cited code read at this head, not reviewed: validate-rule-compilability.ts (flattenRules, MAX_RULE_NESTING_DEPTH), flow-select-options.ts (QUOTED). Everything the first record judged and this commit does not move stands as judged there. The test file and the changeset prose are the lane seat's ACCEPT at TIER_DEFAULT; the new pin was read as evidence only.

① Derived judgments

  • Accept-set: one direction only, and the right one. The commit narrows the active: false exemption to the switched-off rule record and the branches under it. The only bodies whose verdict moves are ones holding a live rule that shares a switched-off rule's name (or branch path): they were wrongly passed at 502f60a5 and are judged now. No body judged at 502f60a5 becomes unjudged, apart from the depth corner named in ④.
  • Finding text changed, id and location unchanged. The message now reads "the field stores the option's value 'V', not its label" in place of "no record holds 'L'"; rule, where, path and hint are as before, so the door pins on path and hint hold (Test Core is green on this head).
  • No public-surface change. The module newly imports MAX_RULE_NESTING_DEPTH, an existing export of validate-rule-compilability.ts; nothing is added to or removed from index.ts.
  • Ledger, os explain and changeset: prose only. They now list the spellings reached and the exclusions the code makes.

② Semver level

  • Unchanged and still right: @objectstack/lint minor, @objectstack/spec minor, BREAKING banner, Before / After table, one ADR-0087 marker naming the entry in the diff.
  • Clause-②: yes (narrowing) — unchanged, matches the diff.
  • Metadata-protocol: narrowed — unchanged, right for the reason the first record gives.
  • Check-runs on 2eb5a24a: every completed run is success or skipped, none failed, none pending. Green among them: Test Core 12/12, Test UI 16/16, the Type Check family, Lint and Repo Gates, Lint PM dispatch-gates, Spec property liveness, v18 to v19 source upgrade, Check Changeset (both runs), Governed Surface Queue Guard, PR-body guards, and the Dogfood battery with its three shards.

③ Boundary flags

  • Report 7414926686: open_questions is empty. Its declared deviation (the local gate run narrowed to the families reading the five moved files, 98 of 118 derived families not re-run locally) is answered by the check-runs on this head, which ran the full set green.
  • The two precisions the first record asked the PR body to carry are there. 维护者速读 line 3 and the Stored-rows paragraph now say a draft saves but its publish verdict names the finding, and that a history restore is refused like a publish.
  • Follow-up carriers (Skills-docs: follow-up #39720; the requiredWhen / readonlyWhen / option visibleWhen trap, which the zone says is filed as field rules: requiredWhen, readonlyWhen and option visibleWhen comparing a select to an option label never apply #39722 while the PR body still says "Carrier: the seat") are outside this diff. Their filing was not verified here.
  • Still owed, not granted by this record: the maintainer's per-PR word on the BREAKING narrowing, covering the stored-object sentence.
  • SQL push-down: not applicable; a pure in-memory function, no query.

④ Design judgment

S1: closed

How it was checked. flattenRules hands a rule, then then and its descendants, then otherwise and its descendants. branchesOf lists the same records in the same order, and the loop consumes them positionally by identity (silenced[0] === rule), resetting on the first mismatch. For the three shapes S1 named:

  • two top-level rules of one name, the first switched off: the second is not silenced[0], the list resets, the rule is judged;
  • a switched-off conditional followed by a live one of the same name and branch name: the first one's branch is consumed, the second and its branch are judged;
  • two same-named rules in one extension entry: as the first case.

Each is pinned in validate-validation-rule-option-labels.test.ts. Tried to break the identity keying with a record shared between a switched-off rule and a live one (one const child used as then in both): the shared record is consumed once under the switched-off rule and judged under the live one, because the match is positional and the list is emptied before the live rule. The same top-level record listed twice is skipped twice by its own active: false. A switched-off branch under a live parent silences its own subtree and the parent's later branch is judged, which is what the evaluator does.

No must-fix, no should-fix.

Nits (no effect on correctness or the contract):

  • Depth corner the fix introduces. branchesOf counts depth from the switched-off rule, the walk from the top-level rule. For a switched-off rule that is itself a branch, with a subtree running past the walk's cap (MAX_RULE_NESTING_DEPTH = 16), branchesOf lists records the walk never hands; the first one stops the silencing, and a later branch of that switched-off rule which the walk does hand is then judged. It takes 17 levels of nested conditional, which the cap's own comment calls well past anything reviewable, and the direction is a refusal the author can see and answer. The branchesOf docblock states the early stop but not this consequence. Passing the walk depth into branchesOf would make the two lists equal. Read from the code, not run.
  • "A label holding a quote or a backslash" is wider than the code. The ledger entry, the changeset and the os explain entry now list it as not refused. The shared reader's QUOTED reads either quote style, so a label holding an apostrophe written in double quotes (record.f == "it's") is judged; only a label that needs an escape, or holds a backslash, is skipped. The prose over-describes an exclusion; no verdict depends on it.

The earlier nits are answered: the message no longer claims no record holds the label; the three prose faces name the spellings reached (with 'L' != F) and the membership spelling not read; the ledger's "Not the shape" list carries the tied-extension field and the non-CEL dialect.

19.validation-condition-option-label-refused.ts (hits) at this head: surface agrees with the code sentence by sentence, with the one over-wide phrase above. replacement, reason, acceptanceCriteria and relevantWhen are unchanged.

Implemented-by: claude/project-thread-uj1amn
Reviewed-by: session_01L9qibvPFnj3TkGq8ps2Jgv (isolated sub-agent)

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-tesla · os-tesla · session_01L9qibvPFnj3TkGq8ps2Jgv

L1-a · ACCEPT · #39688 @ 2eb5a24ad2 · Area: ot-build · read 2026-12-04T15:19Z

  • L2: I adopt at-tier delta record 7415678140 (CONTRACT_REVIEW_TIER, PASS, S1: closed, No must-fix, no should-fix.) on top of record 7414461872 and its brief 7414475226 (delta claim 7415612485). Independence pair holds. This closes my REWORK 7414492078.
    • S1: the active: false exemption is now keyed on the walked rule by identity and position, not the name; repeated names are pinned at top level, inside a conditional and in an extension. The verdict moves one way only: bodies wrongly passed before are now judged.
  • Card fit: Fixes #39441. Q1 as A holds (republish judged, active: false lands, draft save not refused). Clause-②: yes (narrowing), Metadata-protocol: narrowed, minor changeset on @objectstack/lint + @objectstack/spec, ADR-0087 entry 19.validation-condition-option-label-refused: all right. Skills-docs: follow-up #39720. The sibling field-rule trap is filed as field rules: requiredWhen, readonlyWhen and option visibleWhen comparing a select to an option label never apply #39722 (open, read); the PR body still says "Carrier: the seat" for it, which a body edit can update.
  • Earlier nits: answered (the message no longer overclaims; the reached spellings and the unread 'L' in F are named on all three prose faces; the ledger's exclusion list is complete).
  • New nits (accepted deviations): the depth corner (branchesOf counts depth from the switched-off rule, the walk from the top; needs 17 nested levels, errs toward refusal); the prose "a label holding a quote" is over-wide, since only a label needing an escape or holding a backslash is skipped.
  • Gates at 2eb5a24ad2 (l1-face.mjs --pr 39688): 69 success · 11 expected skip · 0 failed · 0 pending; Dogfood battery (opt-in) success (run 145144291233); mergeable clean. The @objectstack/metadata-protocol changeset flag is benign: only a test file is touched and files[] is dist. The one "unexpected skip" is the queue-only Dogfood Regression Gate (…/4) renamed by ci: Dogfood Regression Gate four shards on the queue (#36646) #39667, judged against this branch's older base.
  • For the seat: the ! narrowing's per-PR maintainer word is still owed and is not granted by this review. The branch is about 20 commits behind main; feat(metadata): stored picklist_extension item (#39536 step 2); PATCH /packages/:id refuses unread body keys (#39576) #39668 touches the same semantic coverage-test row, so whichever lands second merges main first.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-tesla · os-tesla · session_01L9qibxjHbaJSwcu6suJxbB

维护者速读

Seat opinion: ACCEPT. The republish-is-judged mode matches the door's governing text (reading 7413097187), and active: false is a clear way out.

席位核对

ACCEPT · head 2eb5a24ad2968144a0c2a1dec7328c5a6acd94ca · 2026-12-04T15:20Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-tesla · os-tesla · session_01L9qibxjHbaJSwcu6suJxbB

2026-12-04T15:21Z · Hand-off: PR #39688 awaits the maintainer's approval (Tier H); seat record above.

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Dec 4, 2026
@objectstack-fleet
objectstack-fleet Bot requested a review from os-zhuang December 4, 2026 15:21
@os-zhuang
os-zhuang marked this pull request as ready for review December 4, 2026 22:59
@os-zhuang
os-zhuang added this pull request to the merge queue Dec 4, 2026
Merged via the queue into main with commit 3c0e8b4 Dec 4, 2026
92 of 93 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-uj1amn branch December 4, 2026 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation needs:dogfood-battery pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

validation rules: saving a condition whose literal is not one of a choice field's option values is warned about (save-time half of #39405)

3 participants