Repository navigation
fix(spec,lint): os lint reports an omitted cbp master required on the default defineStack door - #34020
Conversation
… default defineStack door
defineStack records, on the parsed field it returns, that the author
omitted `required` on a controlled_by_parent object's master_detail
(the parse writes `false` there first). relationship/master-detail-required
reads the record, so the omitted spelling is reported on the default strict
door as it already was on { strict: false } and raw configs. The parsed
value and every runtime reading are unchanged.
Claude-Session: https://claude.ai/code/session_01ADHkmSUpRcnYp68V8zPYaB
Co-authored-by: Claude <noreply@anthropic.com>
…fineStack door Claude-Session: https://claude.ai/code/session_01ADHkmSUpRcnYp68V8zPYaB Co-authored-by: Claude <noreply@anthropic.com>
…eset Claude-Session: https://claude.ai/code/session_01ADHkmSUpRcnYp68V8zPYaB Co-authored-by: Claude <noreply@anthropic.com>
… back to the default defineStack door The omitted required on a cbp object's sole master_detail is now reported by os lint on the default strict door; rev 4 said it was not. Claude-Session: https://claude.ai/code/session_01ADHkmSUpRcnYp68V8zPYaB Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): 16 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 11 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 97f6814cf6fe5158d5204430de53c07504d9f88c && git checkout 97f6814cf6fe5158d5204430de53c07504d9f88c
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 0d1443d0bf7560a6be9a1a7be8012db26159baa4 7e6f3db193e37290d890a922c478eb687ad709f5 && git checkout -B drift-repro 0d1443d0bf7560a6be9a1a7be8012db26159baa4 && git merge --no-ff 7e6f3db193e37290d890a922c478eb687ad709f5
node scripts/docs-audit/affected-docs.mjs --json 0d1443d0bf7560a6be9a1a7be8012db26159baa4
|
|
domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC Contract-review-claim: session_01ADHkmQjrEpxMVxEiDUJHqC · head eb7616f · 2026-11-15T16:30Z |
|
domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC Contract reviewServed-tier: Read: card #33940 (body and all 6 comments, dev report 6897644993), ruling record 6687830530 on #30905, closed card #31470 and merged PR #31523, PR #34020 (body, 11 files, net diff against the merge base), and the head's check-runs. The ledgers Check-runs on this head at review time. Completed, success: Check Changeset, Lint · repo & tooling gates, Lint · CI, release & engine gates, Lint · docs & code guards, Lint · ESLint, Lint · PM dispatch-gates, the three scoped Lint runs, Lint & Repo Gates, Type Check · source gates, Spec property liveness, Governed Surface Queue Guard, PR-body guards, Check Documentation Links, Dogfood Regression Gate, Build UI Deps. Still in progress, so NOT yet a verdict: Build Core, Test Core 1/8 to 8/8, Type Check · workspace, Type Check · consumer gates, Type Check · debt ledger, Type Check UI, Test UI 1/16 to 16/16, Build & E2E UI, Live E2E UI. This PASS is the design verdict; it does not stand in for those runs, and the seat lands only on their green. ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentNo must-fix, no should-fix. Against the ruling. Record 6687830530, option A: the raw parse reads an omitted Tried to break the stamp on every path between
Declared contract or side channel. Declared: the reader is a named, ledgered export with a module header that states producer, reader, placement and fail direction; the sole consumer imports it rather than re-deriving the symbol; and the shape follows two standing precedents ( Per file:
Nits (no effect on correctness or on the ruled contract; prose-face fix or a follow-up card, not a head move):
Out of the diff, read only: the same docblock's older line "a missing Implemented-by: VERDICT: PASS |
|
domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC Contract-review-claim: session_01ADHkmQjrEpxMVxEiDUJHqC · head 6e1439c · 2026-11-15T17:22Z |
|
domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC Contract reviewServed-tier: Read: round 1 record 6897754784 in full; the merge commit What sits between the two heads: one commit, the merge of Check-runs on this head (GET commits/6e1439cc/check-runs, 68 runs): all completed, none failed, none pending. Success (57): Check Changeset, Check PR Size, Auto Label, filter, Flag docs affected by code changes, Check Documentation Links, PR-body guards, Governed Surface Queue Guard, Spec property liveness, Lint & Repo Gates, Lint · repo & tooling gates, Lint · CI, release & engine gates, Lint · docs & code guards, Lint · ESLint, Lint · PM dispatch-gates, the three scoped Lint runs, TypeScript Type Check, Type Check · source gates, Type Check · workspace, Type Check · consumer gates, Type Check · debt ledger, Type Check UI, Build Core, Build UI Deps, Build & E2E UI, Live E2E UI, Dogfood Regression Gate, Plan Test Core shards, Test Core and 1/8 to 8/8, Plan Test UI shards, Test UI and 1/16 to 16/16. Skipped (11, opt-in, queue-only or path-filtered): 18.x upgrade harness, Packed-tarball smoke, Queue verdict, Borrowed queue verdict, Schedule gate, Build Docs, Lint UI, Dogfood Verify CLI, the unexpanded Dogfood matrix row, Temporal Conformance, UI Published Artifacts. The runs round 1 listed as still in progress are all green here. ① Derived judgments
② Semver levelUnchanged from round 1 and still right: ③ Boundary flags
④ Design judgmentNo must-fix, no should-fix. Round 1's design verdict carries to this head. Stamp survival against the merged main. Of the 32 main commits, none changes a file on the path between The main commits that could have interacted, read:
PR body against the current head: the description of the change, the tests, the ablations and the acceptance notes are still exact, because the diff is the same. One sentence is dated, see N3. Per file: unchanged from round 1; all five still hold. Nits (no effect on correctness or on the ruled contract; prose-face fix or a follow-up card, not a head move):
Implemented-by: VERDICT: PASS |
|
domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC Contract-review-claim: session_01ADHkmQjrEpxMVxEiDUJHqC · head d468bb8 · 2026-11-15T17:29Z |
|
domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC Contract reviewServed-tier: Read: round 2 record 6898381389 in full; the merge commit ① Derived judgments
② Semver levelUnchanged and still right: ③ Boundary flags
④ Design judgmentNo must-fix, no should-fix. Round 1's design verdict carries to this head. Stamp survival against the merged main. Zero diff in
None of the three is PR body: the Nits (no effect on correctness or on the ruled contract):
Implemented-by: VERDICT: PASS |
|
domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC ACCEPT · PR #34020 (#33940) · head
|
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 43745631259 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 43747952342 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 43751141623 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
…-76da2l Conflict in docs/qa/platform-checklist/areas/cli.json, item cli.validate-v18-authoring-verdicts: main's revision 5 (--reporter=tree on acceptance[0].verify) is kept as written; this branch's default-door os lint row is renumbered to revision 6 on top of it and the item revision set to 6. Claude-Session: https://claude.ai/code/session_01ADHkmSUpRcnYp68V8zPYaB 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-15T23:09Z) · head 7e6f3db Merge-of-main review: the 4th origin/main merge (ea6de74) under the K ≥ 15 landing rule. The last at-tier record is on the previous head. Per the card thread, 10 of 11 PR-diff files are byte-identical to the reviewed state; |
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract-review-claim: session_01L9qibxTeW8xHnxoHxWNHWW · head 7e6f3db · 2026-11-15T23:14Z |
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract reviewServed-tier: Read at 2026-11-15T23:35Z. Merge delta review of this head against PASS 6898462116 at d468bb8; claim: comment 6903002386; lane request 6902955391 on mailbox #33873. Independence: implemented in an os-steve project thread, dispatched by domain:spec#2 (os-steve); reviewed by os-tesla. Read: card #33940 (body and comments), the PR body and all its comments (records 6897754784 and 6898462116 in full, the three merge-queue triage comments, hand-off 6902949582), the merge commit ① Derived judgments
② Semver levelUnchanged and right: CI on CI completed before posting: 72 check-runs, 59 success, 13 skipped, 0 failed, none in progress. ③ Boundary flags
④ Design judgmentNo must-fix. One should-fix for a follow-up card, S1 below; it does not ask for a head move. Independent reading of the contract at this head (the prior records were rendered by the implementing lane's own seat). Ruling A on #30905 (record 6687830530) has two halves: the parse admits an omitted Tried to break it, in the head tree:
Findings:
Implemented-by: VERDICT: PASS |
|
domain:spec#2 · os-steve · session_01ADHkmQjrEpxMVxEiDUJHqC ACCEPT · PR #34020 (#33940) · head
|
Requested by Steve · project thread
Fixes #33940
Clause-②: yes
Metadata-protocol: none
维护者速读
defineStack解析时,如果作者在controlled_by_parent对象的master_detail上没写required,spec 会在解析后的字段上悄悄记一笔“作者省略了”;os lint的relationship/master-detail-required读这笔记录,在默认写法下也报 error。os lint对省略写法报错;但默认 strict 解析先把省略填成 false,lint 永远看不到,迁移说明那句话在最常见的写法下是假的。required: false,可选主字段),栈照常加载,os validate/os build不变;只是os lint在这一种写法上多报一条 error。回滚即 revert 本 PR。packages/spec/src/data/master-detail-required-omission.ts(记录与读取),packages/spec/src/stack.zod.ts中recordMasterDetailRequiredOmissions的调用,packages/lint/src/data-model-rules.ts中optionalMaster那一行。defineStack({ … })里加一个 cbp 对象,唯一的 master_detail 不写 required,跑os lint --json:应 exit 1,报 relationship/master-detail-required 在.required;改成required: false后应 exit 0。What changes
@objectstack/spec— new modulesrc/data/master-detail-required-omission.ts. After a strictdefineStackparse succeeds,recordMasterDetailRequiredOmissions(normalized.objects, data.objects)stamps a non-enumerable, non-writableSymbol.for('objectstack.field.masterDetailRequiredOmitted')on each parsedmaster_detailfield of acontrolled_by_parentobject whose authored definition writes norequired. The one published reader ismasterDetailRequiredOmitted(field)(@objectstack/spec/data); the stamp is internal (not re-exported), mirroringstack-provenance.ts. The parsed value is untouched (required: false), so the ruled reading (option A: the omission is admitted as the optional master) holds at every runtime reader, and nothing refuses the stack.@objectstack/lint—cbpMasterReferenceFinding(R2) treats a solemaster_detailas the optional master only whenrequired === falseAND the field does not carry the record. On the default door the omitted spelling now gets the same finding, path and fix it already got on{ strict: false }and on a raw config.loadConfig(packages/cli/src/utils/config.ts) spreads the default export into a new object, which drops a stack-level symbol (that is why it readsstackConversionsOfbefore the spread). Theobjectsarray and each field reachlintDataModelby reference, so a field-level record needs nopackages/clichange and no second load of the user's module. Measured:composeStacks(error / override / merge) keeps the record on the composed field too.packages/spec/api-surface/data.json,packages/spec/export-origins/data.json(one added export each).docs/qa/platform-checklist/areas/cli.json, itemcli.validate-v18-authoring-verdicts. Revision 4 (PR docs(qa): name the strict:false door for the os lint arm of cli.validate-v18-authoring-verdicts #33929, merged into main while this card was in flight) moved the item'sos lintarm to{ strict: false }and said the default strict door givesos lintexit 0 with no finding. That is no longer true, so revision 6 (stacked on main's revision 5, PR docs(qa): cover the #33761 ledger gaps and name --reporter=tree for per-file pin scoring #34068, which only adds--reporter=treeto acceptance[0].verify) moves steps[2] and acceptance[3] back to the default door, states that the default door reports onlyrelationship/master-detail-required(notsecurity-controlled-by-parent-no-relation, because the parsed field is the optional master the runtime derives access from) and keeps{ strict: false }as the second door. No other clause changed.data-model-rules.ts(R2 header),controlled-by-parent-master.ts(module header). The semantic entrycbp-optional-master-admittedis unchanged: its sentence "os lintreports the omission aterror" is now true on the default door, which was the seat's call (fix the reach, not the prose).Why
The maintainer ruling on #30905 (record 6687830530), option 「A 放行为可选主字段(推荐)」, keeps the omitted
requiredreadable as the optional master at the parse and pairs it with the lint: "os linterrors on the omitted spelling". The published entry repeats that promise. On the ordinary authoring door it did not hold (measured on #33842 / PR #33929).Tests
New, no existing assertion edited (no forced test edits):
packages/spec/src/data/master-detail-required-omission.test.ts(7 cases): strictdefineStackrecords an omittedrequiredon the sole master and on a secondmaster_detailbeside a required one; nothing for explicitfalse/true, for another sharing model, for a lookup, for{ strict: false }, or for a bareObjectSchema.safeParse; the record is invisible toObject.keys,JSON.stringifyandFieldSchema, and a copy drops it.packages/lint/src/data-model-rules.master-detail-required.test.ts, new top-leveldescribe(4 cases) over stacks a realdefineStackbuilt: omitted → one error at.requiredwith both spellings; CONTROLS explicitfalseandtrue→ clean;{ strict: false }→ the same finding as before; a copied field → clean (the pre-record reading).Ablations (each committed first, mutated through
scripts/ablation-replace.mjs, rebuilt,ablation-dist-preflighthit, then restored with blob == HEAD and rebuilt with the marker absent from dist):the sole master_detail without requiredturns red (1 failed / 33 passed); the CLI on the default door readsos lintexit 0, passed true, 0 R2 findings (the defect).defineStackstops stamping: spec unit 3 failed / 4 passed (src), lint unit 1 failed / 33 passed (spec dist), CLI default dooros lintexit 0 with 0 R2 findings.Acceptance notes
Clause-②: yesdiffers from the claim's expectedno: the diff adds one public export,masterDetailRequiredOmittedon@objectstack/spec/data, and the spec lane charter counts any widening of the public surface as Clause ②. No parse accept set moves, soMetadata-protocol: noneand patch changesets.security-controlled-by-parent-no-relationdoes not, because the stack the runtime loads really does derive the optional master from the parsedfalse. On{ strict: false }both fire, as before.ObjectSchema.safeParserecord nothing (neither runsos lint);ObjectSchema.create()still forces an omittedrequiredtotrue.packages/specas a declared producer record beside the provenance mark, not as business logic: it states what the author wrote and nothing reads it at runtime.pnpm --filter @objectstack/spec check:generatedexits 1 at Node's default heap in this container: itscheck:test-typecheckleg'stscdies without diagnostics. AtNODE_OPTIONS=--max-old-space-size=6144(the heaplint.ymlsets for the ledger re-measure) it exits 0 with all 14 artifacts current, andcheck:test-typecheckalone reads OK (52 files / 240 errors / 131 pinned signatures held).Verification
Verification head:
7e6f3db1(mainea6de745merged in viascripts/pm/os-regen-merge.sh). That merge had one conflict,docs/qa/platform-checklist/areas/cli.jsonitemcli.validate-v18-authoring-verdicts: PR #34068 had meanwhile taken revision 5 on the same item. Resolution: main's revision 5 row and its acceptance[0] edit are kept as written; this PR's row is renumbered to revision 6 and the item'srevisionset to 6. Apart from those two numbers the PR's diff is byte-identical to the one verified at6e1439cc(per-file hunks ofgit diff e71ecc1b d468bb80andgit diff ea6de745 7e6f3db1match in 10 of 11 files; cli.json differs only in"revision": 5→6on the item and the row). Re-read at7e6f3db1afterpnpm install --frozen-lockfile,rm -rf packages/runtime/.objectstackand a full./packages/**rebuild under the verify lock:check:generatedexit 0 at heap 6144 (all 14 artifacts current), spec test 844 files / 26973 tests passed, lint test 212 files / 9030 tests passed,check:platform-checklistexit 0 (16 areas, 433 items). The readings below were verified at6e1439cc(mainb4ce310bmerged in viascripts/pm/os-regen-merge.sh; no conflict, the regen chain found nothing to rewrite). Re-read at6e1439ccafterpnpm install --frozen-lockfile,rm -rf packages/runtime/.objectstackand a full./packages/**rebuild under the verify lock:check:generatedexit 0 (all 14 artifacts current), spec test 843 files / 26968 tests passed, lint test 212 files / 9030 tests passed, the four end-to-end readings below unchanged, and the 96 derived gates all exit 0 at heap 6144 (--ran: 96 run, 0 NOT-MEASURED). CI on6e1439cc: every check-run completed, all required contexts success. The readings below were first taken ateb7616fe(main0ac112fcmerged in), with the same results.End to end: the #33929 reproduction and its controls (scratch copy of examples/app-todo, CLI from the tree)
Base reading (#33929, at 895783a): the first case gave
os lint --jsonexit 0 with no finding. The shipped examples app-crm and app-todo lint with no R2 finding (their cbp masters are built byObjectSchema.create(), which writesrequired: true); app-showcase's config could not load here (its connector-slack dist is not in the CLI closure), and its two cbp masters areObjectSchema.create()withrequired: truein source.Package tests and typecheck (under the verify lock)
The cli integration layer is declared to CI (no spawn entry or integration file touched).
Derived gates (dispatch-gates --commands at eb7616f, re-run at 6e1439c)
96 derived families, 96 run, reconciled with
--ran: "96 run, 0 NOT-MEASURED (a DERIVED zero)". 95 exited 0 at the default heap;check:generatedexited 1 there (the out-of-memorytscabove) and 0 at the CI heap of 6144, which is the line reconciled.check:platform-checklistexit 0 (16 areas, 429 items).check:dev-prereqs(local-only family): NOT MEASURED, 34ui/packages unbuilt in this container.Human Minimum
packages/specholds no runtime logic (the record is a producer stamp beside the provenance mark; nothing reads it at runtime).pnpm lintis CI's.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.