Skip to content

docs(skills): lint-rules table states both tiers of relationship/master-detail-required - #22370

Merged
os-zhuang merged 1 commit into
mainfrom
claude/issue-22111-lint-rules-master-detail-severity
Oct 9, 2026
Merged

os-zhuang merged 1 commit into
mainfrom
claude/issue-22111-lint-rules-master-detail-severity

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #22111

Clause-②: no

The published objectstack-data skill's lint-rules table said relationship/master-detail-required is a warning everywhere. Since the lint change that landed with the parent card (#9139, PR #22109), that is false on one class of object. This PR changes that one table row so both cells are true in both cases, in the table's own terse style.

The row

Before (skills/objectstack-data/references/lint-rules.md:13):

| `relationship/master-detail-required` | warning | a `master_detail` that isn't `required` (a detail can't exist without its master) |

After:

| `relationship/master-detail-required` | warning; error under `controlled_by_parent` | a `master_detail` that isn't `required` — or, under `controlled_by_parent`, is `readonly`/`system` |

What the rule does on main (verified in code, each fact at its line)

  • packages/lint/src/data-model-rules.ts:256 — one rule id, relationship/master-detail-required, on both tiers.
  • :863 — the tier is chosen by obj.sharingModel === 'controlled_by_parent'.
  • :324-325, :344 — on a controlled_by_parent object the finding is severity: 'error' whenever required !== true, or readonly: true, or system: true (so required: true + readonly: true and required: true + system: true are refused there).
  • :866-868 — on every other object only required !== true fires, at severity: 'warning', unchanged.
  • Pinned by packages/lint/src/data-model-rules.master-detail-required.test.ts:52-57 (the three unsafe shapes at error) and :111-131 (private / public_read / public_read_write / unset: still a warning; readonly/system draw nothing there).

Budget — the file sat at its token ceiling

scripts/check-skills-token-ratchet.mjs holds this file at 970 tokens and it was at 970/970 (headroom 0), so a longer row cannot land without deleting content in the same file. The payment is the intro clause "not just naming/labels but the relationship/master-detail/roll-up patterns", which duplicated the table's own heading "Data-model rules (in addition to naming/label/i18n)"; the row also drops its parenthetical rationale. Re-wrapped so the file keeps its line count.

reading before after
lines 53 53 (net 0)
bytes 3880 3856
tokens (ceil(bytes/4), ceiling 970) 970 (headroom 0) 964 (headroom 6)
the row, bytes 136 191

scripts/pm/check-skill-line-ratchet.mjs does not cover the published skills/ root (its header says so by design), so the token ratchet is the only ratchet on this file; it stays green and its ceiling row is untouched.

Scope check inside the skill

The only other sentence in skills/objectstack-data/** that speaks to this rule's severity is rules/relationships.md:16 — "Forced only under controlled_by_parent; else lint-warned". That is true as written (the builder forces required under controlled_by_parent; the lint warning is the other case), so it is left alone.

Changeset

skills/** is in no released package's files[] (no package.json under packages/ names it; the catalog ships through npx skills add from this repo), so this diff publishes nothing from any released package: no .changeset/*.md, and the skip-changeset label is the repo's skip form.

Gates

Derived from the merge base at 6dc260aae with node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack (24 families), each run with its exit code captured before any pipe, then reconciled with --ran: 24 derived, 24 run, 0 NOT-MEASURED, 0 UNRUN.

  • 23 of 24 exit 0 on the first pass. pnpm --filter @objectstack/lint run check:doc-formula-expressions exited 3 (PREREQUISITE NOT MET: @objectstack/formula and @objectstack/lint not built); after the gate's own fix line, pnpm exec turbo run build --filter=@objectstack/formula --filter=@objectstack/lint, under the verify lock (VERDICT command-exit 0, held 161s, waited 0s), it exits 0 — "22 record-scoped formula example(s) across 471 files / 1384 TS blocks judged clean".
  • node scripts/check-skills-token-ratchet.mjs exit 0 — "skills/objectstack-data/references/lint-rules.md is 964 tokens (ceiling 970; headroom 6)"; its --self-test exit 0.
  • pnpm --filter @objectstack/spec run check:skill-refs exit 0 (it generates references/_index.md from the Zod map, not from this file, so nothing to regenerate).
  • pnpm check:nul-bytes exit 0; a control-byte scan over the edited file finds none.
  • Artifact-roster block (the 52 families the derivation scores silent for every card): 47 exit 0. Three are PR-context guards that refuse without PR_NUMBER/PR_BODY — check:partof-closing-keyword re-run with this body exits 0; check-closing-target-claim and check-single-claim-paths are run against the PR once it exists, result in the report comment on the card. Two need a whole-tree dist (check:dts-closure, check:published-readme-exports: exit 3, PREREQUISITE NOT MET) — NOT MEASURED locally; a skills-only diff cannot move either roster and CI runs both.
  • pnpm lint (repo-level eslint) was not run locally; the diff is one .md file. CI owns that run.

Acceptance notes

  • The card's landing text assumed a line ratchet on skills/**; there is none — the binding gate was the token ratchet at zero headroom, which is why a one-cell change carries an intro-clause deletion.
  • Governed surface, Tier H (skills/**): this PR stays draft; landing waits for an authorized approval and the seat's contract-tier review of the skills hunk.

维护者速读(草稿)

  • 改了什么: 已发布的 objectstack-data 技能里,lint 规则表中 relationship/master-detail-required 这一行。原来只写 warning;现在写明:默认 warning,在 controlled_by_parent 对象上是 error,且在那里 readonly/system 的主从引用也会被拒。
  • 为什么改: os lint 已经按两档执行(PR feat(lint)!: relationship/master-detail-required refuses the three unsafe master-reference shapes at error on a controlled_by_parent object #22109 落地)。技能文本还在教"到处都只是建议",按它写出的 controlled_by_parent 明细对象会被 os lint 拒绝。文件已顶到 token 上限(970/970),所以多出来的字用删掉一句与表头重复的引言来付,行数不变。
  • 风险与代价(含回滚): 纯文本改动,不碰代码、不发包、无 changeset。回滚即还原这一个文件的一次提交。
  • 席位意见:
  • 你要做的: 看一眼第 13 行这一行表述是否认可,认可就给一个批准。

Generated by Claude Code

…er-detail-required

The published objectstack-data skill said the rule is a `warning` everywhere.
`packages/lint/src/data-model-rules.ts` fires it at `error` on a
`sharingModel: 'controlled_by_parent'` object, where it also refuses a
`readonly` or `system` master reference; on every other object it stays a
`warning`. The row now says so in both cells.

The file sits at its token ceiling (970/970), so the longer row is paid for
by dropping the intro clause that duplicated the table's own "in addition to
naming/label/i18n" framing. Net 0 lines; 970 -> 964 tokens.

Claude-Session: https://claude.ai/code/session_01RPo7FUd6bSnAfkWMAKi848
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

维护者速读

domain:spec seat 3 (#18883) · os-justin · session session_01RPo7FUd6bSnAfkWMAKi848 · 2026-10-08T23:33Z · 席位对照 6dc260aae 的 diff 校正了正文草稿。

改了什么: 已发布的 objectstack-data 技能里 lint 规则表的一行,relationship/master-detail-required。

  • 原来只写 warning。现在写明:默认是 warning,在 controlled_by_parent 对象上是 error,而且在那里主从字段即使 required,只要标了 readonly 或 system 也会被拒。
  • 这个文件已经顶到 token 上限(970/970),为放下更长的这一行,删掉了引言里一句与表头重复的话,外加该行原来括号里的解释。行数不变,现在 964/970。

为什么改: os lint 从 PR #22109 起就按两档执行,技能却还在教「到处只是建议」。AI 照它写出的 controlled_by_parent 明细对象,会被 os lint 直接拒掉。

风险与代价(含回滚): 纯文本,不碰代码,不发包,也不需要 changeset。新写法已逐条对照 packages/lint/src/data-model-rules.ts 的两档逻辑。回滚就是 revert 本 PR。

席位意见: 建议批准。

  • 席位 ACCEPT 见 6071013571。
  • 契约复审 PASS,见 6071098942。
  • 6dc260aae 上 39 项检查已全部结束:24 项成功,15 项按预期跳过(只改 skills/**,构建、文档、dogfood 等按路径跳过),没有失败。

你要做的: 看一眼第 13 行这一行。认可就在本 PR 上批准(approve)一次,之后由席位落地。你也可以直接合并。


Generated by Claude Code

@os-zhuang
os-zhuang marked this pull request as ready for review October 8, 2026 23:56
@os-zhuang
os-zhuang enabled auto-merge October 8, 2026 23:56
@os-zhuang
os-zhuang added this pull request to the merge queue Oct 8, 2026
Merged via the queue into main with commit 16096e8 Oct 9, 2026
48 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-22111-lint-rules-master-detail-severity branch October 9, 2026 00:11
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 size/s skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

3 participants