Skip to content

fix(spec)!: refuse a field whose inline options repeat a value - #39400

Open
objectstack-fleet[bot] wants to merge 4 commits into
mainfrom
claude/project-thread-ujv81d
Open

objectstack-fleet[bot] wants to merge 4 commits into
mainfrom
claude/project-thread-ujv81d

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread

Fixes #39336

Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: none — skills/objectstack-data/references/examples-objects.md teaches inline select options and already declares each value once; the refusal names the value, both entries and the fix

维护者速读

  • 作者(含 AI)在对象字段里手写的下拉选项若同一个值写了两遍,保存、发布、构建和校验现在都会直接报错,之前会悄悄通过。
  • 共享选项列表早就拒收重复值,这次让字段里手写的选项列表与它同一规则,避免一个存储值对应两个显示名。
  • 已有重复值的对象下次保存会被拒,需作者删掉重复项;仓内示例与平台对象实测没有重复值,可整体撤回。
  • 请 os-zhuang 审批;合入前需跑一次 dogfood 套件。

What changes

  • New packages/spec/src/data/option-values-distinct.ts: findRepeatedOptionValue(options) (first value declared twice, with both positions) and repeatedOptionValueMessage(repeat) (worded as the shared-picklist refusal in packages/objectql/src/picklist-resolution.ts: "would carry the value 'a' twice … Remove the repeated value, or give the new option a value of its own.").
  • packages/spec/src/data/field.zod.ts: one call in the FieldSchema superRefine. Any field whose options is an array is judged (select, radio, multiselect, checkboxes, a lookup's static options), on objects and object extensions alike. The issue is located at options.INDEX.value of the second entry.
  • Why the spec door and not objectql/lint (the claim's first surface): the metadata save (draft and active) and publish parse the object with ObjectSchema (saveMetaItem → 422 INVALID_METADATA with curated issues), and os validate / os build parse the stack with the same schema. One rule at that door makes all four agree with no second implementation. Claim amendment 7391195322 records the surface.
  • ADR-0087 semantic entry 19.field-option-value-repeated-refused (relevantWhen: objects, objectExtensions), joined to the two reviewed relevance tables.
  • Changeset: @objectstack/spec minor, BREAKING, FROM → TO and one-line fix, ADR-0087 marker.

Tests

  • packages/spec/src/data/field-option-value-repeated.test.ts: refusal located at the repeated entry (select; radio / multiselect / checkboxes), the card repro at ObjectSchema, the stack parse (ObjectStackDefinitionSchema, the os validate / os build parse) in an object and an object extension, the Field.select(['In Progress', 'in progress']) string form, controls (distinct values; one label on two values), the scan's order and skipping.
  • packages/metadata-protocol/src/protocol.option-value-repeated-refusal.test.ts: the save door, mode: 'publish' and mode: 'draft', answers 422 INVALID_METADATA with one issue at fields.s.options.1.value and stores nothing; control saves.
  • Local at head 0afd7188 (after merging main): pnpm --filter @objectstack/spec test 932 files / 29341 passed; the door test 3 passed; pnpm --filter @objectstack/spec check:generated all up to date; pnpm check:adr-0087-registration green; check-nul-bytes clean; overlap-check.mjs clean (origin/main and feat(spec,app-shell)!: review follow-ups of #39207 — a navigation keywords list is never empty, and a cleared menu label keeps the entry's keywords #39356 merge cleanly).

Acceptance notes

  • Corpus measured before narrowing: a bracket-matching scan of options: [ arrays in examples/**, packages/**, ui/apps/**, ui/packages/** (about 2,000 arrays) found no repeated value outside test fixtures, plus a slug check of the Field.select([...]) string forms (34 sites, none colliding). No fork to report.
  • The shared-picklist registration check (findDuplicatePicklistValue) is untouched: it judges values across contributions (list plus extensions), which a single field parse cannot see.
  • The Studio option editor has no inline guard; the save now refuses with the located issue, so the author sees it on save. Not filed.
  • A stored object whose body already repeats a value is refused at its next save (same posture as the choice-without-options refusal beside it); no conversion can choose between the two labels.

Verification

Read first: packages/spec/src/data/option-values-distinct.ts, the new block in field.zod.ts (search option-values-distinct.ts says why), the door test.

Two-minute check: pnpm --filter @objectstack/spec exec vitest run src/data/field-option-value-repeated.test.ts → 9 passed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Utp6CXCYLwsKv4Xp3sqQVN

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation protocol:data tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Dec 3, 2026
@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/spec, touching 10 documentable anchor(s).

20 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 9674b7f67675c0d03d8abdfce55da3914e1385d6.

⛔ 8 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 3 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 71 of 256 client-bound route-ledger rows — the other 185 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 185: 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; 125 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 9674b7f67675c0d03d8abdfce55da3914e1385d6 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from e809624851e07ec9bcd6c0eb9824c68540bcf803 — the merge of head 7fce56cee1bfb4d88555cc02fce33efc07e3ac25 into base 9674b7f67675c0d03d8abdfce55da3914e1385d6, 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 e809624851e07ec9bcd6c0eb9824c68540bcf803 && git checkout e809624851e07ec9bcd6c0eb9824c68540bcf803
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 9674b7f67675c0d03d8abdfce55da3914e1385d6 7fce56cee1bfb4d88555cc02fce33efc07e3ac25 && git checkout -B drift-repro 9674b7f67675c0d03d8abdfce55da3914e1385d6 && git merge --no-ff 7fce56cee1bfb4d88555cc02fce33efc07e3ac25

node scripts/docs-audit/affected-docs.mjs --json 9674b7f67675c0d03d8abdfce55da3914e1385d6

⚠️ 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 9674b7f67675c0d03d8abdfce55da3914e1385d6 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-bill · os-bill · session_01Utp6CXCYLwsKv4Xp3sqQVN

L1 review (card thread, head 0afd718)

L1: ACCEPT

PR #39400 (card #39336), head 0afd718, branch claude/project-thread-ujv81d. Draft, base main, first line Fixes #39336 (whole card delivered).

Verified

  • Rule: one superRefine call in FieldSchema (packages/spec/src/data/field.zod.ts:3815-3826) via the new packages/spec/src/data/option-values-distinct.ts. The scan matches findDuplicatePicklistValue (objectql picklist-resolution.ts:103) exactly: String(value) compare, value-less entries skipped.
  • All four doors parse through it:
  • Stored rows: boot registration uses objectql/src/registry.ts:4187 this.validate(), which only logs on failure (console.error metadata_spec_invalid, still registered). Reads badge _diagnostics. No boot or read breakage. This matches the choice-without-options precedent (field.zod.ts:3766-3769).
  • "Same error as the named picklist": same envelope (code INVALID_METADATA, status 422, as picklistMetadataError at picklist-resolution.ts:76). Wording runs in parallel ("would carry the value 'a' twice ... Remove the repeated value, or give the new option a value of its own."). The field door also adds a located issues[] path. Criterion met.
  • Envelope assertions: the door test asserts code, status, the exact issues[] path and that nothing is stored. Controls present (distinct values; same label on two values).
  • PR body and changeset lines:
    • Clause-②: no (narrowing) and Metadata-protocol: narrowed are both in their allowed forms (AGENTS.md:1026).
    • @objectstack/spec minor is the right level for narrowed. The BREAKING banner carries FROM -> TO and the one-line fix.
    • ADR-0087 marker registered field-option-value-repeated-refused matches semantic entry 19.*. The entry is joined to both relevance tables.
    • Skills-docs: none holds: skills/ teaches no repeated inline value.
    • 维护者速读: 4 Chinese lines.
  • Changeset sentences checked against the diff:
    • "422 INVALID_METADATA with an issue at fields.NAME.options.INDEX.value": true (door test, fields.s.options.1.value).
    • "os validate / os build report the same issue": true (same schema).
    • "Field.select(['In Progress','in progress']) ... refused the same way": true (spec test).
    • "refused at its next save": true.
  • Corpus: my own scan of every tracked .ts/.tsx/.json options: [ array found one repeat outside the new tests: objectql/src/engine-picklist.test.ts:236, a picklistExtension fixture that FieldSchema does not parse. No first-party breakage, so the "zero exposure" claim in the semantic entry holds.

CI at 0afd718 (read 2026-12-03): 12 success, 12 skipped, 15 in progress, 0 failure.

  • Still running: Lint & Repo Gates families, Type Check (workspace, source and consumer gates), Build Core, Check Changeset, v18->v19 source upgrade, Live E2E UI.
  • Dogfood battery (opt-in) is skipped. This PR is ! / (narrowing), so it needs needs:dogfood-battery and a battery success before queueing.
  • Not green yet: no ready / auto-merge until all checks are green.

Findings

  1. should-fix: the file surface goes beyond the amended claim.
  2. should-fix: no pin for the separate publish door (POST .../publish of a stored draft).
    • The door test only drives saveMetaItem mode 'publish' / 'draft'.
    • The card repro is the publish of a draft saved earlier, which now reaches promotedObjectDraftSpecRefusal (protocol-history-and-publish.ts:1116).
    • Fix: in packages/metadata-protocol/src/protocol.option-value-repeated-refusal.test.ts, seed a draft row that carries the repeat, then call publishMetaItem.
    • Assert 422 INVALID_METADATA at fields.s.options.1.value and that nothing is promoted.
  3. nit: packages/spec/src/data/field-option-value-repeated.test.ts:22-25. repeatIssues keeps only messages containing "twice", so an unrelated parse failure could hide behind success === false.
    • Fix: in the ObjectSchema repro test, also assert result.error.issues has length 1.
  4. nit: .changeset/39336-inline-option-value-repeated.md:17. The changeset could say that a stored object carrying the repeat still boots and serves (registry logs metadata_spec_invalid, reads carry _diagnostics). Fix: add that half-sentence so upgraders know nothing goes dark.
  5. nit (landing): the PR touches packages/spec field.zod.ts, a governed surface. Landing waits for the maintainer's or contract tier's record; the PR body already asks os-zhuang. Before queueing, record the needs:dogfood-battery step in the landing to-do.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-bill · os-bill · session_01Utp6CXCYLwsKv4Xp3sqQVN

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 0afd7188940b64adf799a6e4cccf2cdfce047b6d
Local-runs: probe — the new tests re-run to confirm the refusal and its location independently of the report (details below the header)
Scope: packages/spec/src/data/field.zod.ts, packages/spec/src/data/option-values-distinct.ts, packages/spec/src/migrations/entries/semantic/19.field-option-value-repeated-refused.ts, packages/spec/src/migrations/semantic-relevance.test.ts, packages/spec/src/migrations/semantic-relevance-coverage-38929.test.ts, packages/spec/src/data/field-option-value-repeated.test.ts, packages/metadata-protocol/src/protocol.option-value-repeated-refusal.test.ts, .changeset/39336-inline-option-value-repeated.md (read for ②) + none in the diff; read outside it: packages/spec/src/data/object.zod.ts, packages/spec/src/kernel/metadata-type-schemas.ts, packages/spec/src/ui/widget.zod.ts, packages/spec/src/ai/solution-blueprint.zod.ts, packages/objectql/src/registry.ts, packages/objectql/src/registry-items.ts, packages/objectql/src/picklist-resolution.ts, packages/metadata-protocol/src/protocol-save.ts, packages/metadata-protocol/src/protocol-promoted-draft-spec-refusal.ts, packages/metadata-protocol/src/protocol-history-and-publish.ts, packages/metadata-protocol/src/protocol-object-extension-item.ts, packages/metadata-protocol/src/protocol-class-head.ts, packages/metadata-protocol/src/protocol-registry-hydration.ts, packages/metadata-protocol/src/protocol-diff-delete-load.ts, packages/metadata-protocol/src/metadata-diagnostics.ts, packages/cli/src/commands/validate.ts, packages/cli/src/commands/compile.ts, packages/cli/src/commands/build.ts
Tier-note: CONTRACT_REVIEW_TIER exhausted (resets Dec 9 20:00 UTC); Opus review per maintainer 「fable 用完之后,可以用 opus 复审」 (2026-12-03T15:42Z)

Local runs in detail: vitest run in packages/spec on src/data/field-option-value-repeated.test.ts, src/migrations/semantic-relevance.test.ts, src/migrations/semantic-relevance-coverage-38929.test.ts (3 files, 73 passed, 2 todo); vitest run in packages/metadata-protocol on src/protocol.option-value-repeated-refusal.test.ts (3 passed); a read-only scan of options: [ arrays with string values under examples/, packages/, ui/ (non-test files): 225 arrays, 0 repeats, which agrees with the PR body's corpus note

Full round on this head. Inputs read: the diff against origin/main (8 files, +334 −0), the PR body at this head, card #39336 with claim 7381587985, amendment 7391195322 and report 7391533695, and the check-runs on this head. The dev's ablation and conclusions were not taken as given. Each door below was traced in code.

① Derived judgments

What is newly refused. FieldSchema's superRefine gains one arm (field.zod.ts:3815-3826). When field.options is an array and two entries carry the same String(value), it raises one custom issue at ['options', secondIndex, 'value']. Only the first repeat in list order is reported. The arm judges any field type that carries options. SelectOptionValueSchema (field.zod.ts:327-333) already restricts a value to one lowercase spelling, so comparing the string form is exact. Two values that differ only in case could never both parse. Distinct values with the same label still parse. The Field.select([...]) string form, where two labels slug to one value, is refused the same way.

Where it bites, door by door, checked in code:

  • Metadata save, draft or active. protocol-save.ts:1708-1713 parses through resolveOverlaySchema(type). That is ObjectSchema for object (kernel/metadata-type-schemas.ts:95) and ObjectExtensionSchema for object_extension. Both reach FieldSchema (object.zod.ts:4692, :7358). The door test confirms the answer: 422 INVALID_METADATA, one issue at fields.s.options.1.value, nothing stored.
  • Publish of an object draft stored before this release. promotedObjectDraftSpecRefusal (protocol-promoted-draft-spec-refusal.ts, wired at protocol-history-and-publish.ts:1116) re-parses the converted draft and refuses with the same envelope. The card's step 2 is therefore covered even for a draft saved before upgrade.
  • os validate / os build. os build is an alias of compile (commands/build.ts:3-6). compile.ts:505 and validate.ts:486 both call ObjectStackDefinitionSchema.safeParse on the lowered stack, and the stack test pins the object and object-extension arms there.
  • Incidental schema. FieldWidgetPropsSchema.field (ui/widget.zod.ts:143), an exported React props contract, now refuses a repeat too. It is not an authored stack key. See N3.
  • Retired door. A standalone field item (metadata-type-schemas.ts:96) has had its runtime create retired since meta-field-write-inert: an accepted field PUT never reaches the object — a runtime-created field is stored valid=true and is absent from fields forever #7893, so only read diagnostics see it.

Stored rows that already carry a repeat:

  • object row, boot. It still registers. SchemaRegistry.registerItem runs validate only as a diagnostic (registry.ts:4176-4194: logs metadata_spec_invalid, "registered anyway").
  • object row, read. The row is badged invalid through _diagnostics (metadata-diagnostics.ts:346, a full safeParse).
  • object row, re-save or publish. Both are refused until the repeat is removed. This matches the changeset.
  • object_extension row, boot. It is not registered. Every hydration goes through registerStoredObjectExtension, then registrableObjectExtension (protocol-class-head.ts:274-279, protocol-object-extension-item.ts:286-297). That parses OBJECT_EXTENSION_ITEM_SCHEMA, which is ObjectExtensionSchema and whose fields is z.record(..., FieldSchema). The parse throws. loadMetaFromDb catches it per row (protocol-diff-delete-load.ts:1586, :1602, :1643), logs Failed to hydrate object_extension/NAME, and skips the row. After upgrade, every field that extension contributes is absent from the runtime until the row is fixed. The changeset and the semantic entry do not say this. See S1.

What is not newly refused:

  • inlineColumns[].options on a grid field (field.zod.ts:1418) is not judged.
  • A shared picklist keeps its own cross-contribution check (findDuplicatePicklistValue, picklist-resolution.ts:103), untouched.
  • fieldPatches option maps are keyed by value, so they cannot repeat one.

Public surface. option-values-distinct.ts is not re-exported from data/index.ts, so the package gains no export. The only change to what callers can write is the narrowing itself.

② Semver level

The changeset .changeset/39336-inline-option-value-repeated.md bumps @objectstack/spec at minor. It carries the following:

  • The line-initial declarations Clause-②: no (narrowing) (:7), Metadata-protocol: narrowed (:8) and Skills-docs: none — ... (:9).
  • One ADR-0087 marker, adr-0087: registered field-option-value-repeated-refused (:11).
  • A BREAKING paragraph naming FROM (saves, publishes and passes os validate / os build) and TO (422 at fields.NAME.options.INDEX.value, with the message quoted). The quoted message matches repeatedOptionValueMessage.
  • A FROM → TO table and the one-line fix.

The PR body carries the same three declaration lines, line-initial. This meets AGENTS.md step 3. A value refused is narrowed, and narrowed takes at least minor on the package it moves. It is the same disposition as the sibling FieldSchema narrowing field-precision-zero-refused, which is also minor with Clause-②: no (narrowing). No key is removed, so no tombstone is owed.

The ADR-0087 semantic entry is 19.field-option-value-repeated-refused.ts:

  • Its relevantWhen is stack-declares objects, objectExtensions.
  • It is joined to both reviewed relevance tables: semantic-relevance.test.ts:86 and the FIELD list in semantic-relevance-coverage-38929.test.ts:296.
  • Both tables pass locally, and the dev reports pnpm check:adr-0087-registration green.

The Skills-docs: none claim holds. skills/objectstack-data/references/examples-objects.md:98-110 teaches inline select options and declares each value once, and no skill teaches a repeat.

Stored-row disclosure is incomplete. The changeset (:17) and the entry's acceptanceCriteria say only "a stored object ... is refused at its next save". That is true of object rows. It leaves out the boot consequence for object_extension rows found in ①. See S1.

Check Check Changeset: success on this head.

Dogfood battery (opt-in) is skipped on this head, and the PR carries no needs:dogfood-battery label (labels: documentation, size/m, tests, tooling, protocol:data). A (narrowing) owes that battery before the queue. That is for the seat. The PR body's 维护者速读 already says one is needed.

③ Boundary flags

  • Surface against claim. Amendment 7391195322 says the claim's file surface "is replaced". It then names five files: option-values-distinct.ts, field.zod.ts, the two relevance tables, and the door pin. The diff also touches three paths:

    • packages/spec/src/migrations/entries/semantic/19.field-option-value-repeated-refused.ts;
    • packages/spec/src/data/field-option-value-repeated.test.ts;
    • the changeset.

    The original claim named the semantic directory, "the tests that pin the refusal" and the changesets, so these are not a dev breach. Read strictly, though, a "replaced" surface leaves them out. The seat owes a one-line amendment naming the entry and the spec test. PR-body guards (claim · duplicate · Part-of · single-writer path) is success.

  • The card's ask is met by one rule at the spec door, not by the claimed objectql and lint doors. The objectql and lint files are untouched. All four doors the card names (save, publish, os build, os validate) refuse the repeat, and the wording matches the picklist refusal's ("would carry the value ... twice", "Remove the repeated value, or give the new option a value of its own"). The card's "same error as the named picklist" is met in wording, not in code identity. The picklist refusal is a registry Error at load, while this one is a located parse issue. That is acceptable: the two refusals have different subjects.

  • Not covered by the card, for follow-up cards:

    • (a) Stored object_extension rows fail at boot under every FieldSchema narrowing. A stored row that fails a newer FieldSchema rule is dropped at boot, not registered with a diagnostic the way an object row is. The registry.ts:4176-4183 docblock names the reason this is wrong: it "turns bad metadata into a data outage". That posture comes from the code before this PR and applies to every FieldSchema narrowing (field-precision-zero-refused has the same undisclosed gap). It is not this card's to fix.
    • (b) The AI blueprint does not mirror this rule. The lenient BlueprintFieldSchema (ai/solution-blueprint.zod.ts:437) mirrors other FieldSchema option rules (kind, multiple, defaultValue) so that apply_blueprint refuses them by name. It does not mirror this one. A blueprint with a repeated option value passes its own parse and is refused only later, at the object save door. The card's "Why it matters" names AI authors as the main writers of inline options.
    • (c) Grid column options are still unjudged. inlineColumns[].options can still repeat a value.
    • (d) Studio option editor. The dev's out-of-scope note, which the dev did not file.

    The seat decides which of these to file, per filing-gate.md.

  • Security. Nothing here crosses a tenant, permission or credential boundary, so there is no security finding. SQL push-down: not applicable, since there are no data reads.

  • Author. The PR user.login is objectstack-fleet[bot], so no author note is owed.

④ Design judgment

packages/spec/src/data/option-values-distinct.ts (new). I checked each docblock claim against the code:

  • "A shared picklist whose options repeat a value has always been refused at registration (findDuplicatePicklistValue in @objectstack/objectql)": true (picklist-resolution.ts:103-116, same String(value) comparison and same skip of value-less entries).
  • "every author door parses through [the field's schema door]: the metadata save (draft or active), publish, os build and os validate": true by ①.
  • "Values compare by their string form, the form the record validator matches a written value against": true (record-validator.ts:614, :1068).
  • "SelectOptionValueSchema already holds a value to one lowercase spelling": true (field.zod.ts:327-333).
  • One sentence is loose. The docblock counts "the record validator's membership check" among the readers that map a stored value back to its option, but membership is unaffected by a repeat. It is harmless.
  • The function returns the first repeat in list order and skips null or value-less entries, and that is what the code does.

packages/spec/src/data/field.zod.ts (hits). The arm is placed correctly:

  • It runs on the parsed field.
  • It is guarded by Array.isArray.
  • It sits next to the #23809 option-kind rule.
  • Its issue path is relative to the field, so ObjectSchema and the stack parse prefix it correctly (fields.s.options.1.value).

The comment ("as a shared picklist must ... names the doors") is true.

packages/spec/src/migrations/entries/semantic/19.field-option-value-repeated-refused.ts (hits).

  • Every field is true except as follows: surface, replacement, reason, "Measured first-party exposure ... zero" (my scan agrees), and "no tombstone" (no key is removed).
  • acceptanceCriteria is incomplete on stored rows, because it omits the object_extension boot drop (S1).

packages/spec/src/data/field-option-value-repeated.test.ts (hits). I checked ablation by reading:

  • Delete the superRefine arm. Every refusal case goes red: success flips, the filtered issue lists are empty, and the builder case does not throw.
  • Report firstIndex instead of secondIndex. The path assertions go red.
  • Key the scan on label. The "same label on two values" control goes red.
  • Remove the null skip. The findRepeatedOptionValue([..., null, ...]) case goes red.

The stack case pins both objects and objectExtensions in ObjectStackDefinitionSchema, which is the os validate / os build parse.

packages/metadata-protocol/src/protocol.option-value-repeated-refusal.test.ts (hits).

  • It drives the real saveMetaItem over a stub engine. In both publish and draft modes it asserts code, status, the single located issue, the message prefix, and that sys_metadata stays empty. A control with distinct values saves.
  • Ablating the arm turns both refusal cases red: rejection() throws "resolved".
  • It pins the save door in mode: 'publish', not the separate publishMetaItem promotion of a draft stored before this release. That second door is covered by metadata publish: a draft saved before an ObjectSchema refinement landed is promoted without being parsed again #35924's generic re-parse, but no case pins it for this rule (N1).

semantic-relevance.test.ts / semantic-relevance-coverage-38929.test.ts (hits). These are one-line joins to reviewed tables. Both are consistent with the entry's relevantWhen, and both pass locally.

Findings:

  • S1 (should-fix): the changeset :17 and the semantic entry's acceptanceCriteria understate what happens to stored rows.
    • A stored object row keeps loading, is badged invalid on read, and is refused at its next save or publish. That part is stated.
    • A stored object_extension row that carries a repeat is not registered at boot. Its contributed fields are absent from the runtime until the row is fixed. This happens through registrableObjectExtension (protocol-object-extension-item.ts:286-297), thrown to loadMetaFromDb's per-row catch (protocol-diff-delete-load.ts:1602, :1643).
    • First-party exposure is zero. Tenant exposure cannot be measured from the repo.
    • Fix: one sentence in the BREAKING paragraph and in the entry's reason or acceptanceCriteria, naming the boot drop and the fix (remove the repeat through the raw-row metadata path). The posture is a systemic defect from before this PR, and is for a separate card (③ a).
  • N1 (nit): protocol.option-value-repeated-refusal.test.ts pins saveMetaItem in publish mode, not publishMetaItem of a draft stored before this release. The latter is refused by promotedObjectDraftSpecRefusal, a generic path that already has its own pins. A case seeding a stored draft with the repeat and asserting the publish's 422 would pin the card's literal step 2.
  • N2 (nit): the option-values-distinct.ts docblock lists "the record validator's membership check" among the readers a repeat makes ambiguous. Membership is unaffected. The readers it does affect are label, colour and kind lookups.
  • N3 (nit): FieldWidgetPropsSchema.field (ui/widget.zod.ts:143), an exported props contract, is narrowed incidentally. The semantic entry's surface names only objects[] and objectExtensions[]. Exposure is effectively nil (a props parse of a field already refused at every author door). The fix, if wanted, is to name it in surface.

No must-fix.

Check-runs on this head (read 2026-12-03 ~20:45Z; CI was still running, not waited on):

  • success: Auto Label, Check Changeset, Check PR Size, Dogfood Regression Gate, Flag docs affected by code changes, Governed Surface Queue Guard, Lint · PM dispatch-gates, Lint · scoped · tooling self-tests, PR-body guards (claim · duplicate · Part-of · single-writer path), Plan Test Core shards, Plan Test UI shards, Spec property liveness, filter
  • in_progress:
    • Build Core, Build UI Deps
    • Lint · CI, release & engine gates; Lint · ESLint; Lint · docs & code guards; Lint · repo & tooling gates; Lint · scoped · query-options erasure; Lint · scoped · slot lookup & corpus
    • Live E2E UI
    • Test Core (1-12 of 12)
    • Type Check · workspace / source gates / consumer gates / debt ledger
    • v18 → v19 source upgrade
  • skipped: Dogfood battery (opt-in), Dogfood battery shard (opt-in), 18.x upgrade harness (opt-in), Packed-tarball smoke (opt-in), Build Docs, Dogfood Regression Gate shard matrix, Dogfood Verify CLI, Borrowed queue verdict, Queue verdict, Schedule gate, Temporal Conformance (live PG + MySQL), UI Published Artifacts

The queue condition "PR check 全绿" is not yet met on this head. The seat reads it before requesting the queue.

Implemented-by: claude/project-thread-ujv81d
Reviewed-by: L2 subagent of session_01Utp6CXCYLwsKv4Xp3sqQVN

VERDICT: PASS

…nsion row in the upgrade text

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CXCYLwsKv4Xp3sqQVN
…e option-value door test

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-bill · os-bill · session_01Utp6CXCYLwsKv4Xp3sqQVN

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 5b69116740a6598e65d8fd8454a3926e97d97442
Local-runs: probe — the two gates that failed on the round-1 head (engine test-double contract, test-source alias) had not reported on this head
Scope: .changeset/39336-inline-option-value-repeated.md, packages/spec/src/data/option-values-distinct.ts, packages/spec/src/data/field-option-value-repeated.test.ts, packages/spec/src/migrations/entries/semantic/19.field-option-value-repeated-refused.ts, scripts/engine-double-contract.pinned.json + none in the diff; read outside it: scripts/check-engine-double-contract.mjs, scripts/check-test-source-alias.mjs (via its output), packages/metadata-protocol/src/protocol.option-value-repeated-refusal.test.ts (unchanged), packages/metadata-protocol/src/protocol-diff-delete-load.ts, packages/metadata-protocol/src/protocol-object-extension-item.ts
Tier-note: CONTRACT_REVIEW_TIER exhausted (resets Dec 9 20:00 UTC); Opus review per maintainer 「fable 用完之后,可以用 opus 复审」 (2026-12-03T15:42Z)

Delta review. Round 1 is the record on 0afd7188940b64adf799a6e4cccf2cdfce047b6d (PR comment 7391735037: PASS, S1 open, N1–N3 nits). The delta is one commit, 5b69116740 (5 files, +26 −6). field.zod.ts, the two relevance tables and the metadata-protocol door test did not move, so round 1's judgments on them stand.

Local probes on this head, from a detached checkout:

  • Spec tests. vitest run on field-option-value-repeated.test.ts and the two semantic-relevance tables: 3 files, 73 passed, 2 todo.
  • Engine test-double gate. node scripts/check-engine-double-contract.mjs exits 0.
  • Test-source alias gate. pnpm check:test-source-alias exits 1, on this PR's own door test (S2).

① Derived judgments

  • The accept set is unchanged from round 1. No schema or refusal code moved. The delta is declaration text, one docblock, one test assertion and a gate ledger.
  • Ledger rows. scripts/engine-double-contract.pinned.json gains three rows (delete, findOne, update) for packages/metadata-protocol/src/protocol.option-value-repeated-refusal.test.ts. This is the gate's RETAINED ledger (check-engine-double-contract.mjs:199-212, :347). It lists doubles that ARE pinned to the real engine's dispatch contract, so that losing a pin reds. It is not an exemption list. The door test's double calls assertEngineFindOnePredicate, assertEngineUpdateDispatch and assertEngineDeleteDispatch on exactly those three verbs, so the rows are true. They tighten the gate. On the round-1 head the gate failed in Lint · ESLint (check-run 144580550881, step "Engine test-double contract gate"). On this head it exits 0 locally.

② Semver level

  • Changeset. .changeset/39336-inline-option-value-repeated.md is still @objectstack/spec minor. The declaration lines (:7-9), the ADR-0087 marker, the BREAKING paragraph and FROM → TO are unchanged.

  • Stored rows. The stored-row paragraph (:17) now says three things:

    • a stored object still registers at boot, is served badged invalid, and is refused at its next save or publish;
    • a stored object extension row carrying the repeat is not registered at boot ("the loader logs and skips it");
    • so the fields that row adds are absent until it is fixed.

    This matches the code read in round 1:

    • registrableObjectExtension throws (protocol-object-extension-item.ts:286-297);
    • loadMetaFromDb catches per row and logs Failed to hydrate (protocol-diff-delete-load.ts:1602, :1643).

    The semantic entry's acceptanceCriteria carries the same sentences.

  • Remediation advice. The paragraph ends "check os validate before upgrading". That reaches only stack-source extensions, not rows authored at runtime and stored in sys_metadata. See N4.

  • Dogfood battery. Dogfood battery (opt-in) is skipped on this head too, with no needs:dogfood-battery label. It is still owed before the queue. This is for the seat.

③ Boundary flags

  • Surface.
    • The delta adds scripts/engine-double-contract.pinned.json. It is outside claim 7381587985 and amendment 7391195322, but it is a gate ledger regenerated by the gate's own --write for the claimed door test, so it is not a dev breach.
    • The seat's amendment owed from round 1 should name it alongside the semantic entry and the spec test.
    • PR-body guards (claim · duplicate · Part-of · single-writer path) is success on this head.
  • N1. Per the coordinator, N1 is not pinned here and goes to a follow-up card candidate. The round-1 follow-up candidates (a)–(d) stand.
  • Out of scope. The test-source alias gate's finding in S2 is not out of scope. It is this PR's own new test file.
  • No new security, SQL push-down or author note. The author is objectstack-fleet[bot].

④ Design judgment

option-values-distinct.ts (docblock, :6-8). The readers list is now "lists, chips, reports, a stage renderer". The stage renderers (ui/packages/plugin-detail record path and stage menu) read an option's kind and label by value, so a repeat makes them ambiguous. The sentence is true.

19.field-option-value-repeated-refused.ts.

  • The surface now also names the field a FieldWidgetPropsSchema parse carries. That is true (ui/widget.zod.ts:143 is FieldSchema).
  • reason drops "the record validator" for "a stage renderer". That is true.
  • acceptanceCriteria states the object and object-extension stored-row outcomes. That is true by ②.

field-option-value-repeated.test.ts:62. The new expect(error.issues).toHaveLength(1) on the ObjectSchema repro reads by ablation as follows:

  • It goes red if the repeat is ever reported twice, for example at both entries.
  • It goes red if another issue slips into the minimal repro object. The repro would then stop being a single-cause case.

It is the L1 nit, and it holds.

Round-1 findings:

  • S1: closed. Both the changeset and the semantic entry now disclose the object-extension boot drop, and the wording matches the code path.
  • N2: closed.
  • N3: closed.
  • N1: open as a nit. It was deferred to a follow-up card candidate by the coordinator and is accepted as a deviation for this head.

New:

  • S2 (should-fix): Lint · CI, release & engine gates is red because of this PR's door test.
    • On the round-1 head, check-run 144580550863 failed at step "Test-source alias gate". The delta does not touch that cause.
    • Running pnpm check:test-source-alias on this head reproduces it, exit 1. It names packages/metadata-protocol/src/protocol.option-value-repeated-refusal.test.ts:14 as reaching import('@objectstack/lint') in the source under test through protocol.ts → metadata-diagnostics.ts:594 (also :709, build-probes.ts:716, destructive-still-shown-by.ts:189).
    • Nothing in the test pays that load at module scope, so the first case pays it inside its testTimeout. The gate measured 3.2s on a 5000ms window that timed out on a loaded shard. That is a flake on a loaded Test Core shard.
    • The gate's prescribed fix is one module-top line in the test file: import '@objectstack/lint';.
    • It does not change what the PR refuses, so it is not a must-fix. But that lane stays red, so the queue condition (all PR checks green) cannot be met on this head.
  • N4 (nit): .changeset/39336-inline-option-value-repeated.md:17 ends "check os validate before upgrading".
    • os validate parses the stack source only. It cannot see an object_extension row authored at runtime and stored in sys_metadata, which is the row the sentence is about.
    • Before an upgrade, such a row can be found by reading it, either through the metadata read with its _diagnostics or through the raw-row metadata path. After the upgrade it shows as the loader's Failed to hydrate object_extension/NAME line.
    • A wording fix is optional.

No must-fix.

Check-runs on this head (read 2026-12-03 shortly after the push; 28 runs, CI still running, not waited on):

  • success: Check PR Size; Governed Surface Queue Guard; PR-body guards (claim · duplicate · Part-of · single-writer path)
  • in_progress:
    • Auto Label; Check Changeset; Flag docs affected by code changes
    • Lint · CI, release & engine gates; Lint · ESLint; Lint · PM dispatch-gates; Lint · docs & code guards; Lint · repo & tooling gates; Lint · scoped · query-options erasure; Lint · scoped · slot lookup & corpus; Lint · scoped · tooling self-tests
    • Spec property liveness
    • Type Check · consumer gates / debt ledger / source gates / workspace
    • filter; v18 → v19 source upgrade
  • skipped: 18.x upgrade harness (opt-in); Borrowed queue verdict; Dogfood battery (opt-in); Dogfood battery shard (opt-in); Packed-tarball smoke (opt-in); Queue verdict; Schedule gate

On the round-1 head these were red:

  • Lint · ESLint, from the engine test-double gate. The delta fixes it.
  • Lint · CI, release & engine gates, from the test-source alias gate. S2: not fixed, and it reproduces locally on this head.
  • The aggregates Lint & Repo Gates, TypeScript Type Check and Test UI, which follow from those reds and the cancelled lanes.

Implemented-by: claude/project-thread-ujv81d
Reviewed-by: L2 subagent of session_01Utp6CXCYLwsKv4Xp3sqQVN

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-bill · os-bill · session_01Utp6CXCYLwsKv4Xp3sqQVN

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 7fce56cee1bfb4d88555cc02fce33efc07e3ac25
Local-runs: probe — the test-source alias gate behind S2 had not reported on this head
Scope: packages/metadata-protocol/src/protocol.option-value-repeated-refusal.test.ts, .changeset/39336-inline-option-value-repeated.md + none in the diff; read outside it: packages/metadata-protocol/src/lint-root-preload.testkit.ts, packages/metadata-protocol/src/metadata-diagnostics.ts, packages/metadata-protocol/src/protocol-meta-type-schema.ts
Tier-note: CONTRACT_REVIEW_TIER exhausted (resets Dec 9 20:00 UTC); Opus review per maintainer 「fable 用完之后,可以用 opus 复审」 (2026-12-03T15:42Z)

Second delta review. The previous record is the delta on 5b69116740a6598e65d8fd8454a3926e97d97442 (PASS, S2 open, N1 and N4 nits). The delta is one commit, 7fce56cee1 (2 files, +3 −1). It adds a module-top preload import to the door test and rewords one changeset sentence. No schema, refusal, semantic-entry or ledger file moved. The earlier judgments on those files stand.

Local probes on this head (detached checkout of the branch tip):

  • pnpm check:test-source-alias: exit 0. "the source reach judged 1 test file(s) changed since d07ece7".
  • vitest run src/protocol.option-value-repeated-refusal.test.ts in packages/metadata-protocol: 3 passed.

① Derived judgments

The accept set is unchanged. The test file's one new line changes when the @objectstack/lint root is first loaded (at collection, not inside the first clocked case). It does not change what the case asserts.

② Semver level

The changeset is still @objectstack/spec minor. The declaration lines, the ADR-0087 marker, BREAKING and FROM → TO are unchanged.

The stored-row paragraph (:17) now ends: "before upgrading, run os validate for packaged extensions and read each runtime-authored extension's _diagnostics on the metadata read". Both halves are true:

  • os validate parses the stack source, which is where packaged extensions live.
  • A runtime-authored object_extension row is badged on read. resolveOverlaySchema has its own object_extension resolver, ObjectExtensionSchema over the body without its envelope (protocol-meta-type-schema.ts:565-570). metadata-diagnostics.ts runs a full safeParse of that schema (:346). The repeat therefore shows as _diagnostics.valid: false with the located issue, before the upgrade drops the row at boot.

Dogfood battery (opt-in) is still skipped, with no needs:dogfood-battery label. It is owed before the queue, for the seat.

③ Boundary flags

  • The delta touches only claimed paths: the door test from amendment 7391195322, and the changeset.
  • The amendment owed from round 1 is still owed. It should name the semantic entry, the spec test and scripts/engine-double-contract.pinned.json.
  • PR-body guards (claim · duplicate · Part-of · single-writer path) is success on this head.
  • The follow-up card candidates stand: round-1 (a)–(d), plus N1.
  • No new security, SQL push-down or author note.

④ Design judgment

protocol.option-value-repeated-refusal.test.ts:12-13.

  • The import is ./lint-root-preload.testkit.js. That testkit's docblock says: a file whose cases reach an object publish or a served view read imports it at module top, so the lint root's cold transform is paid during collection.
  • It is the established preload for this package: 76 sibling test files in packages/metadata-protocol/src import it.
  • This file's cases drive saveMetaItem in publish mode, which is the case the docblock names. The comment line beside the import is true.
  • The gate that reported S2 now passes locally.

Findings:

  • S2: closed. The door test pays the lint root's load at collection through the package's own preload testkit, and check:test-source-alias exits 0 on this head.
  • N4: closed. The remediation sentence now names a check that sees each kind of row: os validate for packaged extensions, _diagnostics on the read for runtime-authored ones.
  • N1: open as a nit. It was deferred by the coordinator to a follow-up card candidate, and is accepted as a deviation.
  • S1, N2 and N3 stay closed (previous delta).

No must-fix. No should-fix open.

Check-runs on this head (read shortly after the push; 28 runs, CI still running, not waited on):

  • success: Auto Label; Check PR Size; Governed Surface Queue Guard; PR-body guards (claim · duplicate · Part-of · single-writer path)
  • in_progress:
    • Check Changeset; Flag docs affected by code changes
    • Lint · CI, release & engine gates; Lint · ESLint; Lint · PM dispatch-gates; Lint · docs & code guards; Lint · repo & tooling gates; Lint · scoped · query-options erasure; Lint · scoped · slot lookup & corpus; Lint · scoped · tooling self-tests
    • Spec property liveness
    • Type Check · consumer gates / debt ledger / source gates / workspace
    • filter; v18 → v19 source upgrade
  • skipped: 18.x upgrade harness (opt-in); Borrowed queue verdict; Dogfood battery (opt-in); Dogfood battery shard (opt-in); Packed-tarball smoke (opt-in); Queue verdict; Schedule gate

On the previous head 5b69116740:

  • One lane failed on its own: Lint · CI, release & engine gates (check-run 144591123382, step "Test-source alias gate"). That is S2, which this head closes.
  • Three aggregates failed only because of that lane or of cancelled lanes:
    • Lint & Repo Gates (lint-ci-engine failure, plus two cancelled lanes);
    • TypeScript Type Check (lanes cancelled);
    • Test UI (shards cancelled).
  • Lint · ESLint was not red there, which confirms the engine-double ledger fix.

The queue condition (every PR check green) still has to be read on this head before the queue.

Implemented-by: claude/project-thread-ujv81d
Reviewed-by: L2 subagent of session_01Utp6CXCYLwsKv4Xp3sqQVN

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-bill · os-bill · session_01Utp6CaQsbKBMQtm6Tpsamd

维护者速读

  • 改了什么 — 选择类字段的内联选项里,如果同一个值写了两次,现在在 spec 解析阶段就会被明确拒收(保存、发布、os build、os validate 都走这一步),报错里点名重复的值、两处位置和改法(objectql: an inline select field whose options repeat a value publishes with no refusal, while a named picklist with the same repeat is refused #39336)。这是收窄,带迁移条目和 BREAKING 说明。
  • 要你做什么 — os-zhuang 批准即可,席位等 CI 和 dogfood battery 通过后落地。契约审核(fable 用完,按你 15:42Z 的规则用 Opus):首轮 PASS 7391735037,两次复审 PASS,最新 7392222219,Head-sha: 7fce56cee1bfb4d88555cc02fce33efc07e3ac25。
  • 范围外 — 审核列了几处同类缺口(AI 蓝图、表格内联列选项、Studio 选项编辑器没同步这条规则;收窄后已存的扩展行在启动时被丢弃而不是带警告注册),另立跟进卡。
  • 席位意见 — ACCEPT:重复值本来就会让选项行为不确定,响亮拒收更不容易让 AI 写错。

席位核对

ACCEPT · head 7fce56cee1bfb4d88555cc02fce33efc07e3ac25 · repo:objectstack@os-bill

  1. Shape: 9 files, +356/−0: packages/spec/src/data/option-values-distinct.ts (new), one call in field.zod.ts, the semantic entry 19.field-option-value-repeated-refused.ts, the relevance tables, a spec test, a door pin, the engine-double ledger and one changeset. Fixes #39336; Clause-②: no (narrowing), Metadata-protocol: narrowed, Skills-docs: none (the skill's example already declares each value once). All within claim 7381587985 and amendments 7391195322 and 7392253197.
  2. Premise measured: per the card report 7391533695 and L1 ACCEPT 7391704018.
  3. Gates:
    • Check-runs at this head: still running at this ACCEPT, none failed; the seat lands only on all green plus the opt-in dogfood battery (needs:dogfood-battery added with this hand-off).
    • Contract review on Opus (Served-tier: TIER_DEFAULT), under the maintainer's 2026-12-03 15:42Z word 「fable 用完之后,可以用 opus 复审」: PASS 7391735037, delta PASS 7392199718, delta PASS 7392222219 at this head.
  4. Accepted deviations: the review tier, per the maintainer's word above.
  5. Out of scope: the review's ③ list goes to follow-up cards the seat files.
  6. Landing: a narrowing lands as Tier H. Review is requested from os-zhuang; the seat lands after approval, green CI and a green battery. On merge, objectql: an inline select field whose options repeat a value publishes with no refusal, while a named picklist with the same repeat is refused #39336 closes.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-bill · os-bill · session_01Utp6CaQsbKBMQtm6Tpsamd

Review request: 2026-12-03T21:06Z · os-zhuang, please approve at head 7fce56cee1bfb4d88555cc02fce33efc07e3ac25. Seat ACCEPT above; contract review delta PASS 7392222219 at this head (Opus, per the maintainer's word on fable running out). A narrowing lands as Tier H. The seat lands it after approval, green CI and a green dogfood battery.

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 47217508276 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Test Core (9/12) — 失败步骤: Run this shard's tests

    @objectstack/metadata-protocol:test:  FAIL  src/protocol.option-value-repeated-refusal.test.ts > the save door refuses inline options that repeat a value > control: the same object with distinct value
      ↳ 失败原因: @objectstack/metadata-protocol:test: Error: Cannot create object/repairs_probe_dup with no package: a new item is saved into a writable package (ADR-0070). Name one (on the REST door add ?package=PKG,
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

  • src/protocol.option-value-repeated-refusal.test.ts — 24h 窗口内只有本 PR 撞到过,暂不汇总(再有一个不同 PR 撞到就会自动开汇总 issue)。
  • ⚠️ 24h 评论账本没读完(超过 5 页仍未读到窗口尽头),所以上面的「不同 PR 数」是下界,不是全量。

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 0 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 47220049064 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Test Core (9/12) — 失败步骤: Run this shard's tests

    @objectstack/metadata-protocol:test:  FAIL  src/protocol.option-value-repeated-refusal.test.ts > the save door refuses inline options that repeat a value > control: the same object with distinct value
      ↳ 失败原因: @objectstack/metadata-protocol:test: Error: Cannot create object/repairs_probe_dup with no package: a new item is saved into a writable package (ADR-0070). Name one (on the REST door add ?package=PKG,
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

  • src/protocol.option-value-repeated-refusal.test.ts — 24h 窗口内只有本 PR 撞到过,暂不汇总(再有一个不同 PR 撞到就会自动开汇总 issue)。
  • ⚠️ 24h 评论账本没读完(超过 5 页仍未读到窗口尽头),所以上面的「不同 PR 数」是下界,不是全量。

历史信号:

  • ⚠️ 本 PR 过去 24h 已在队列失败 1 次(不含本次)。 内容未变而反复失败 ⇒ 高度怀疑 flaky 测试或与同组 PR 的语义冲突,重排不解决。
  • 过去 24h 队列共有 1 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 47223390173 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Test Core (9/12) — 失败步骤: Run this shard's tests

    @objectstack/metadata-protocol:test:  FAIL  src/protocol.option-value-repeated-refusal.test.ts > the save door refuses inline options that repeat a value > control: the same object with distinct value
      ↳ 失败原因: @objectstack/metadata-protocol:test: Error: Cannot create object/repairs_probe_dup with no package: a new item is saved into a writable package (ADR-0070). Name one (on the REST door add ?package=PKG,
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

  • src/protocol.option-value-repeated-refusal.test.ts — 24h 窗口内只有本 PR 撞到过,暂不汇总(再有一个不同 PR 撞到就会自动开汇总 issue)。
  • ⚠️ 24h 评论账本没读完(超过 5 页仍未读到窗口尽头),所以上面的「不同 PR 数」是下界,不是全量。

历史信号:

  • ⚠️ 本 PR 过去 24h 已在队列失败 2 次(不含本次)。 内容未变而反复失败 ⇒ 高度怀疑 flaky 测试或与同组 PR 的语义冲突,重排不解决。
  • 过去 24h 队列共有 2 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4cxiJF5PkqquFk98Bh7

Contract-review-claim: session_016WV4cxiJF5PkqquFk98Bh7 · head 7fce56c · 2026-12-03T23:49Z
On the request of seat repo:objectstack@os-bill (mailbox #39411 comment 7396018435): an isolated CONTRACT_REVIEW_TIER reviewer of this seat renders the record on this head.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4cxiJF5PkqquFk98Bh7

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 7fce56cee1bfb4d88555cc02fce33efc07e3ac25
Local-runs: none
Scope: packages/spec/src/data/field.zod.ts, packages/spec/src/data/option-values-distinct.ts, packages/spec/src/migrations/entries/semantic/19.field-option-value-repeated-refused.ts + packages/spec/src/data/field-option-value-repeated.test.ts, packages/spec/src/migrations/semantic-relevance.test.ts, packages/spec/src/migrations/semantic-relevance-coverage-38929.test.ts, packages/metadata-protocol/src/protocol.option-value-repeated-refusal.test.ts, scripts/engine-double-contract.pinned.json; cited code read, not reviewed: packages/objectql/src/picklist-resolution.ts, packages/spec/src/data/object.zod.ts, packages/spec/src/ui/widget.zod.ts, packages/spec/src/kernel/metadata-type-schemas.ts, packages/spec/src/system/migration.zod.ts, packages/metadata-protocol/src/protocol-history-and-publish.ts, packages/metadata-protocol/src/protocol-object-extension-item.ts, packages/metadata-protocol/src/protocol-extension-redeclared-owner-field.ts
Security-touching: no
Rule-change-verified: none

Inputs: card #39336 (body and all six comments: triage, claim, pause note, two claim amendments, os-dev-report; no ruling on the thread), PR #39400 body, its nine-file list and the net diff at this head, and the check-runs on this head. Nothing was built or run.

① Derived judgments

  • Accept-set, FieldSchema: a field whose options array carries one value in two entries now fails the parse with one custom issue at options.SECOND_INDEX.value. Right. It is a narrowing; the card's Done-when asks for exactly this refusal, and the shared-list path (findDuplicatePicklistValue) already counts a repeat inside one contribution, so the two option sources now agree.
  • Reach of that narrowing, read in the cited code: ObjectSchema.fields and ObjectExtensionSchema.fields both hold FieldSchema (object.zod.ts), so the metadata save (draft and active), os validate / os build (ObjectStackDefinitionSchema) and object extensions are all covered by the one call. The publish of a draft stored before this release is covered too: promoteDraftForPublish runs promotedObjectDraftSpecRefusal on the draft body before the promotion writes. Right.
  • Every field type that carries options is judged (select, radio, multiselect, checkboxes, a lookup's static options), not only select. Right: the ambiguity is the same wherever a stored value maps back to an option, and the changeset says "any type that takes options".
  • Comparison rule: String(option.value), no case folding. Right. SelectOptionValueSchema holds a value to ^[a-z][a-z0-9_.]*$, and the refinement only runs on a field whose base shape parsed, so two spellings of one value cannot both arrive. The Field.select builder lower-cases and snake-cases before the parse, so ['In Progress', 'in progress'] is refused; the changeset names that case and the spec test pins it.
  • Not narrowed: an object extension's fieldPatches.NAME.options is a record keyed by value and cannot repeat one; the shared-picklist check is untouched. Right.
  • Stored rows: a stored object extension row carrying the repeat no longer registers (registrableObjectExtension throws on a failed parse). This is a behaviour change at boot for such a row; the changeset and the semantic entry both state it and name the pre-upgrade check. Right, and disclosed.
  • Public surface: findRepeatedOptionValue, repeatedOptionValueMessage and RepeatedOptionValue are module exports of a new file that no barrel re-exports; the only importers are field.zod.ts and the spec test. No published type or JSON Schema changes (the rule is a refinement). Right.
  • ADR-0087: semantic entry field-option-value-repeated-refused, version 19, relevantWhen objects / objectExtensions, joined to both reviewed relevance tables. No conversion, correctly: nothing records which label the author meant.

② Semver level

@objectstack/spec minor, marked BREAKING, with FROM → TO, a one-line fix and the adr-0087: registered marker. That matches what the diff publishes: one accept-set narrowing in the spec package and no other package's shipped code (the metadata-protocol file is a test, the script file a pinned gate baseline). Minor for a breaking narrowing is the level the other narrowing changesets on this pre-release line carry. Check Changeset is green on this head (one earlier run of it reads cancelled, superseded by the green ones).

Clause-②: no (narrowing) — present and identical on the PR body and the changeset, and it is the right arm: nothing is widened.

③ Boundary flags

  • PR author: the API's user.login is objectstack-fleet[bot]; the body's attribution marker names os-bill, and the claim, amendments and report on the card are stamped os-bill. The diff is os-bill's seat's work, relayed by the fleet bot.
  • open_questions: empty. Nothing to answer.
  • Flag, surface move: the claim's first surface (objectql, lint) was replaced by the spec field parse. Answered by claim amendments 7391195322 and its addition; the diff stays inside the amended surface. The move is also the better design: one rule at the parse every door runs, no second implementation to drift.
  • Flag, out_of_scope_findings: the Studio option editor has no inline guard, noted and not filed. Accepted for this card: its Done-when is the refusal at save, publish, os build and os validate, and the save now answers a located issue. The editor guard is a follow-up for the seat to file if wanted.
  • Flag, gates deviation: the dev did not reconcile the dispatch-gates command list locally and left every family to CI. Answered by the check-runs on this head: Lint (all scoped families), Type Check (all), Test Core 12/12, Test UI 16/16, Build Core, Dogfood Regression Gate, the three dogfood battery shards, v18 to v19 source upgrade, Spec property liveness, Governed Surface Queue Guard and PR-body guards all read success. No failure on the head.
  • Flag, ablation not run: accepted. The refusal is new, and both test files carry controls (distinct values parse; one label on two values parses; the same object with distinct values saves).
  • No maintainer ruling exists on the card thread. The narrowing rests on the card's own Done-when, and the PR asks for os-zhuang's approval; that approval stays whole-PR and is not replaced by this record.
  • SQL push-down (Prime Directive 5): no query, id materialisation or in-app join in the diff. Nothing to flag.

④ Design judgment

No must-fix, no should-fix.

Per file:

  • packages/spec/src/data/option-values-distinct.ts: holds. The scan mirrors findDuplicatePicklistValue line for line (skip a non-object or value-less entry, compare by string form, report the first repeat). The docblock's three claims check out against the cited code: the picklist check exists and refuses at registration; the record validator's string-form match is the same sentence the picklist module carries; the lowercase claim is the regex in SelectOptionValueSchema.
  • packages/spec/src/data/field.zod.ts: holds. The call sits after the one-source check and before the kind check, guarded by Array.isArray, and locates the issue at the second entry's value. A field naming picklist with no inline options is not touched.
  • 19.field-option-value-repeated-refused.ts: holds. Its acceptance sentences were checked against the code: the publish refusal (promotedObjectDraftSpecRefusal), the stored extension row not registering (registrableObjectExtension), and the stored object served badged invalid, which is the same posture the choice-without-options refusal beside the new block documents.
  • Spec test and door test: they pin the contract and not the implementation. Exact path, custom code, issue count of one at the object door, both stack slots, the builder string form, and at the save door status 422, code INVALID_METADATA, one issue at fields.s.options.1.value and an empty store, for both modes.
  • scripts/engine-double-contract.pinned.json: three rows for the new door test's engine double, matching the three asserted verbs in the test.

Attempts to break it, all held: a numeric or mixed-case value (refused by the option schema first, so no false pass); a repeat in an object extension's added field (refused, pinned); a repeat reached only through a stored draft (refused at promotion); the extension re-declaration comparer structuralView, which keys options by value and would have collapsed a repeat silently (it falls back to the raw body on a failed parse, and the schema gate refuses the body anyway); a cross-package repeat on an inline list (not reachable: an extension cannot add options to an owner's inline list).

Nits, none of which changes the verdict:

  • N1 (nit) — repeatedOptionValueMessage ends "give the new option a value of its own". "New option" is the shared-picklist sentence's word for an extension's added option; an inline list has no new option. "the repeated entry" would be exact, as the changeset's one-line fix already says.
  • N2 (nit) — the entry's surface names the FieldWidgetPropsSchema field, which is a props contract nothing parses, and omits two other FieldSchema carriers that are parsed shapes: the field metadata type in BUILTIN_METADATA_TYPE_SCHEMAS and AddFieldOperation.field in system/migration.zod.ts. Neither is an author door for a stack, so the upgrade guide is not wrong, only uneven.
  • N3 (nit) — one issue per field: a list with two different repeated values reports the first only, where the kind check below reports one issue per offending option. It matches the picklist check and the author converges in two saves.
  • N4 (nit) — inlineColumns[].options inside a field, and option lists on other shapes (action params, form-view options), still accept a repeat. Outside this card and outside the diff; named for the seat, not reviewed.

Implemented-by: claude/project-thread-ujv81d
Reviewed-by: session_016WV4cxiJF5PkqquFk98Bh7

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-bill · os-bill · session_01Utp6CaQsbKBMQtm6Tpsamd

Landing · 2026-12-03T23:59Z · head 7fce56cee1bfb4d88555cc02fce33efc07e3ac25 · repo:objectstack@os-bill

Reading Value
Human half os-zhuang APPROVED (narrowing, Tier H)
Record half contract review PASS 7396141836 at this head, Served-tier: CONTRACT_REVIEW_TIER, by the seat repo:objectstack@os-elon-musk (handed over per the maintainer's 2026-12-03 23:44Z 「需要 fable 复核的话,可以交接给 elon」; his 23:44Z word 「我都批准了,后续你可以直接落地」)
Check-runs at this head every check green or skipped (the newest Check Changeset run is success)

State: pm:awaiting-merge leaves; the seat marks it ready and arms auto-merge. On merge, #39336 closes.

@objectstack-fleet objectstack-fleet Bot removed the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Dec 3, 2026
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Dec 4, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Dec 4, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-bill · os-bill · session_01Utp6CaQsbKBMQtm6Tpsamd

Correction · 2026-12-04T00:48Z · the landing record 7396246676 read the human half wrongly: this PR carries no APPROVED review from os-zhuang. os-zhuang's earlier act on it was an enqueue (22:26Z), which the seat's re-arm replaced, so the merge group of 00:01Z was refused by the narrowing leg ("no authorized APPROVED review is on record"; run 47232429124) and the PR left the queue. The record half stands (fable PASS 7396141836 at head 7fce56ce). pm:awaiting-merge is back on; the PR waits for os-zhuang's approval (review request 7392305407), after which the seat lands it.

@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

This branch has not been deployed

No deployments
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 protocol:data size/m 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.

objectql: an inline select field whose options repeat a value publishes with no refusal, while a named picklist with the same repeat is refused

2 participants