Repository navigation
feat(spec): an AI blueprint field declares multiple, accept and maxSize - #34287
Conversation
The AI blueprint field and its strict mirror gain the three keys the field contract already declares, with FieldSchema's own value shapes (strict side nullable). `multiple: true` is refused by name at the key on every type outside FieldSchema's declarable set, now exported as multiDeclarableFieldTypes(), and on radio as FieldSchema refuses it. A multi-value select takes no blueprint defaultValue, since the built field judges its default against the list contract. accept / maxSize follow FieldSchema and are not refused outside the media family; the describes say they are read only there. Claude-Session: https://claude.ai/code/session_01ADHkmTKhm2Pn8ghVWNkBbH Co-authored-by: Claude <noreply@anthropic.com>
…ld keys Claude-Session: https://claude.ai/code/session_01ADHkmTKhm2Pn8ghVWNkBbH Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 18 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 8 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 173 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 5018544683e98f056537a1457ed5ff0454b87528 && git checkout 5018544683e98f056537a1457ed5ff0454b87528
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin a00b42287669b261ae1c9fd9a42059bf87c91953 b8cd61943af04da53e3c3645e77eb28d90b2616e && git checkout -B drift-repro a00b42287669b261ae1c9fd9a42059bf87c91953 && git merge --no-ff b8cd61943af04da53e3c3645e77eb28d90b2616e
node scripts/docs-audit/affected-docs.mjs --json a00b42287669b261ae1c9fd9a42059bf87c91953
|
|
domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC Contract-review-handoff: review#2 — CONTRACT_REVIEW_TIER unavailable (maintainer-limited fable quota, 2026-11-16T04:28Z) · head dbb037a First review, for card #34275 (p2 + The seat has read these points and holds them:
|
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract-review-claim: session_01L9qibxTeW8xHnxoHxWNHWW · head dbb037a · 2026-11-16T04:30Z |
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract reviewServed-tier: Read at 2026-11-16T04:35Z. First review of this head; claim: comment 6907368086; lane request 6907342312 on mailbox #33873. Independence: implemented in an os-steve project thread, dispatched by domain:spec#2 (os-steve); reviewed by os-tesla, who neither dispatched nor implemented it. First review of this PR: there are no prior finding ids to continue. Read outside the diff, never reviewed: ① Derived judgments
② Semver level
CI on this head: 67 check-runs, 56 success, 10 skipped, 1 still running ( ③ Boundary flags
④ Design judgmentM1 (must-fix) — a multi-value S1 (should-fix) — the changeset's "nothing is removed or narrowed" and "nothing an author wrote before parses differently" are true at the build door, not of a direct parse. N1 (nit) — the stage-field path is newly reachable and unpinned. An object whose Implemented-by: VERDICT: FAIL |
A select with `multiple: true` holds no single option code per record, so the built field refuses an option `kind` there; the blueprint field now refuses it too, one issue per option at its `kind`, in FieldSchema's wording. The describe, the docblocks and the changeset claim only what the pins measure, and the changeset states what a direct parse now judges instead of stripping. Claude-Session: https://claude.ai/code/session_01ADHkmTKhm2Pn8ghVWNkBbH Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmTKhm2Pn8ghVWNkBbH Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmTKhm2Pn8ghVWNkBbH Co-authored-by: Claude <noreply@anthropic.com>
|
domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC Contract-review-handoff: review#2 — CONTRACT_REVIEW_TIER unavailable (maintainer-limited fable quota, 2026-11-16T05:31Z) · head b8cd619 Delta on r1 FAIL 6907437381 (head dbb037a). Dev report: 6908219910.
Card-thread readings at this head: check:generated 14/14; spec 844 files / 27024 tests; blueprint 132/132; derived gates 113/113 exit 0, 0 NOT-MEASURED. Body r2 is sent. |
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract-review-claim: session_01L9qibxTeW8xHnxoHxWNHWW · head b8cd619 · 2026-11-16T05:32Z |
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract reviewServed-tier: Read at 2026-11-16T05:36Z. Delta review of this head against FAIL 6907437381 at dbb037a; claim: comment 6908265112; lane request 6908254654 on mailbox #33873. Independence: implemented in an os-steve project thread, dispatched by domain:spec#2 (os-steve); reviewed by os-tesla, who neither dispatched nor implemented it. How the delta was read. Four commits sit on dbb037a: ① Derived judgmentsPrior findings (record 6907437381):
Re-derived for this head:
② Semver level
CI on this head: 72 check-runs, 60 success, 12 skipped, none running, none failed. The pull request reads mergeable and clean; main has moved one commit past a00b422, touching none of the eight files. ③ Boundary flags
④ Design judgmentNo must-fix, no should-fix. The added rule is the right shape: a third named function in the one refinement, so the dropped-refinements ledger does not move, refusing at the key the author must edit, with the remedy in the message. Leaving the pre-existing N1 (nit, continues S1) — the changeset's Implemented-by: VERDICT: PASS |
|
domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC ACCEPT · PR #34287 (#34275) · head
|
Requested by Steve · project thread
Fixes #34275
Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: none —
skills/**teaches no blueprint field key; the blueprint guide the design model reads lives with the applier in cloud, and cloud#4400 carries it.维护者速读
apply_blueprint解析的宽松版与站内设计模型生成用的 strict 版)新增multiple、accept、maxSize三个键,取值形状照抄对象字段契约;multiple: true只允许在对象字段本就允许的类型上,radio照旧拒收,均按名拒在该键上。multiDeclarableFieldTypes(),行为不变。回滚即 revert 本 PR。过渡期提醒:spec 发版后、cloud#4400 落地前,cloud 的映射器还不搬这三个键,多文件字段会被建成单文件(见 Acceptance notes)。packages/spec/src/ai/solution-blueprint.zod.ts的refuseUndeclarableMultiple与refuseUnfitDefaultValue新增的多值 select 分支;packages/spec/src/data/field.zod.ts的导出改名;solution-blueprint.test.ts末尾新 describe。pnpm --filter @objectstack/spec exec vitest run src/ai/solution-blueprint.test.ts,预期 132/132 通过,其中「refusesmultiple: trueon exactly the types the built field refuses it on」逐个类型对照 FieldSchema。What changes
BlueprintFieldSchema(lenient, whatapply_blueprintparses) andStrictField(the strict mirror the in-app design model generates against) gain three keys the object field contract already declares, withFieldSchema's own value shapes:multiplez.boolean().optional()(no.default(false), so a field that omits it parses as before).nullable()acceptz.array(z.string()).optional().nullable()FieldSchemamaxSizez.number().int().positive().optional().nullable()FieldSchemamultiple: truerefusal, by name at['multiple'].refuseUndeclarableMultiplereadsFieldSchema's own declarable set. That set was module-private (multiDeclarableTypeSet); it is now exported asmultiDeclarableFieldTypes()(renamed, body unchanged, still computed on first use for the TDZ reason in its docblock), so the type list is not copied.radiois in the set and refused by its own branch, as onFieldSchema. The message names the remedy types (the set minusradio). The two cross-key rules run in one refinement (refineBlueprintField), so the dropped-refinements ledger does not move.select's options take nokind(review r1 M1).refuseKindOnMultiValueSelect,FieldSchema's rule in its wording: a lifecycle kind says where one record stands, and the field holds no single option code per record. One issue per option that declares a kind, atoptions.N.kind, the same pathsFieldSchemarefuses.radiowithmultiple: trueis left to themultiplerefusal; themultiselect/checkboxes/tagskind case is unchanged.selecttakes no blueprintdefaultValue. Without this branch the widening opened a hole:{ type: 'select', multiple: true, defaultValue: 'open' }would parse here (the literal check reads{ type, options }) and the built field would refuse it (it judges the default against the list contract). Refused by name at['defaultValue']; thedefaultValuedescribe says so.accept/maxSizesay "Read only on the media family". None says the field "is built with" the key: each says "carried into the built field by the applier", the wordingdefaultValueuses (see Acceptance notes on the carrier).api-surface/data.jsonandexport-origins/data.json(the new export),authorable-surface/ai.json(threeai/BlueprintField:*rows),content/docs/references/ai/solution-blueprint.mdx.check:livenessandcheck:strictness-ledgerwere already current.Proposed public name (seat's call)
multiDeclarableFieldTypes()(returns a read-only set of type names), recommended. Alternatives: keep the old internal namemultiDeclarableTypeSet(zero rename, but it reads without "field" besideMULTI_CAPABLE_TYPES/FILE_REFERENCE_TYPESin thedatanamespace); or a predicateisMultiDeclarableFieldType(type)(narrower, but the refusal message needs the list, so a second export would follow).Tests
packages/spec/src/ai/solution-blueprint.test.ts, a new describe block for the three keys, 12 cases:FieldSchema: each key's lenient and strict leaf accept exactly the battery valuesFieldSchema.shape[key]accepts (23 values), absent on the lenient side, null-not-absent on the strict side;filefield declaring none of them parses and gains no key (strict: three nulls);{ type: 'file', multiple: true, accept: [...], maxSize: 10485760 }through both sides and intoFieldSchema;accept/maxSizeon file, lookup and select parse on both sides and onFieldSchema;multiple: truerefused ontextand onradio, one custom issue at the key, naming the field and (text) every remedy type;FieldType: the blueprint refusesmultiple: trueat the key iffFieldSchemarefuses it at['multiple'];falseis never refused;selectwith a default is refused atdefaultValue, andFieldSchemarefuses it too;select's kinded options are refused one by one atoptions.N.kind, at exactly the pathsFieldSchemarefuses (control: the same kinds on a single-value select, and a multi-value select without kinds, parse);stageFieldnames a multi-valueselectis refused atstageField(control: the single-value select is not refused there);multiDeclarableFieldTypes()andFILE_REFERENCE_TYPES, and promise no build.Forced test edits: every existing strict-mirror field fixture in the same file (10 fixtures) gains
multiple: null, accept: null, maxSize: null, because strict mode requires every key; thedefaultValue"refuses the key missing" fixture gains them too, sodefaultValuestays its only missing key. No assertion changed.Ablations (each committed, mutated through
scripts/ablation-replace.mjs, restored to the HEAD blob,git diff HEADempty; the suite importssrcdirectly):refuseUndeclarableMultiple(field, ctx);replaced by a comment: 3 failed / 127 passed (the text, radio and every-type pins).multiple === truereplaced byfalse: 1 failed / 129 passed (the multi-select default pin).refuseKindOnMultiValueSelect(field, ctx);replaced by a comment (review r1): 1 failed / 131 passed (the kind pin).Acceptance notes
git grepforSolutionBlueprint/BlueprintField/apply_blueprintoutsidepackages/spec:packages/lintreads the schema shape in one test,packages/cli/src/lint/metadata-eval.tsnames the expansion as an injected seam in a comment, andui/packages/app-shellreplays proposals in chat history. So cloud's applier (cloud#4400) is the only carrier, and the describes say "carried into the built field by the applier", never "is built with". WhetherdefaultValue's identical wording is true today is cloud's applier code, NOT MEASURED from this repository.multiple: truefile field would be built single-file with no feedback. cloud#4400 should take the pin bump and the allow-list together.accept/maxSizeon a non-media type parse and are read by nothing, matchingFieldSchema(card: followFieldSchema).apply_blueprintdoor the three keys were refused before, so nothing parses differently there. A directBlueprintFieldSchema.parseused to strip them:multiple: trueontext,maxSize: 0, or a multi-value select with a default parsed with the key dropped, and each is now refused at that key. The changeset states FROM and TO; the door-levelClause-②: yes (widening)stands.Verification
Review r1 (record 6907437381) was answered by one fix commit, a reference-page regeneration, and a merge of
origin/mainthroughscripts/pm/os-regen-merge.sh(K was 17), withauthorable-surface/ai.jsonregenerated from the merged tree. The PR's file list againstorigin/mainis still the same 8 files. Head and gate readings are in the os-dev-report comments on #34275.Generated by Claude Code