Skip to content

feat(spec, lint): a permission set can acknowledge a meant roll-up read with rollupSourceUnreadableReason - #34775

Merged
os-zhuang merged 6 commits into
mainfrom
claude/project-thread-wq8blv
Nov 17, 2026
Merged

os-zhuang merged 6 commits into
mainfrom
claude/project-thread-wq8blv

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread

Fixes #34664

Clause-②: yes (widening) — one new optional authorable key, rollupSourceUnreadableReason on FieldPermissionSchema (a permission set's fields entry); nothing that parsed before is refused
Metadata-protocol: added
Skills-docs: follow-up #34742

维护者速读

  • 改了什么:权限集里某个汇总列的字段条目可以写 rollupSourceUnreadableReason: '理由',声明「这个集本就该看汇总、不看明细」;写了之后,这个集这一列的 security-rollup-source-unreadable 由 warning 降为 info 并引出理由,os lint --strict 不再因它失败。
  • 为什么改:这条规则自己说「这种组合合法且常是有意的」,但 --strict 把 warning 判失败、又没有任何确认办法,HotCRM(hotcrm#2557/fix(automation): bind flow triggers on cold boot, not just after HMR reload #2560,账户下挂发票与收款)只能二选一:给子对象开读权限(会放开所有行)或藏掉总额。键名与落位由席位定(卡上 6943835606)。
  • 风险与回滚:纯新增可选键,运行时不读这个键;但理由只能写在字段条目上,而条目本身在字段合并里投 readable: true 一票(最宽者胜),原本没有该列条目的集为挂理由新加条目,会让同时持有屏蔽集的用户重新看到这一列,文档与 describe 已写明(L2 S1)。空白理由、readable: false 旁带理由在解析时拒收。其它集、其它列和 row-scoped 提示不受影响。回滚即还原本 PR。
  • 先看:packages/lint/src/validate-rollup-source-visibility.ts 的 acknowledgedReason 与 unreadable 闭包;packages/spec/src/security/permission.zod.ts 新键与第二个 .refine;packages/lint/src/validate-rollup-source-visibility-acknowledged-34664.test.ts。
  • 两分钟验证:pnpm --filter @objectstack/lint exec vitest run src/validate-rollup-source-visibility-acknowledged-34664.test.ts,预期 9 例全绿。
  • 需要你做的:契约改动(packages/spec/src),L1 与 L2 通过后由席位请 os-zhuang 批准。

What changes

security-rollup-source-unreadable is advisory by its own header ("the pair is legal and is often meant"), but it emits a warning, os lint --strict fails on any warning (packages/cli/src/commands/lint.ts:1175-1179), and packages/lint / the CLI had no per-finding acknowledgement. The seat named the key and its placement (card comment 6943835606): option A of the three offered.

  • Spec (packages/spec/src/security/permission.zod.ts). FieldPermissionSchema gains rollupSourceUnreadableReason: string (optional). Two parse refusals: a blank reason (NON_BLANK_STRING, which projects into the JSON Schema), and a reason beside readable: false (a second object .refine on path rollupSourceUnreadableReason; the column is hidden, so there is no read to acknowledge). The describe says the key is read only at authoring time, and (contract review S1) that the entry carrying it is an ordinary declaring entry: it votes readable: true in the field merge, so on a set with no entry for the column, adding one restores the column for holders whose other sets mask it. The same sentence is in the jsdoc, rule-explanations.ts, fields.mdx and security.mdx. FieldPermissionSchema is also reused by GetObjectPermissionsResponseSchema.fieldPermissions; per the seat the type is not split, and the server never sends the key.
  • Lint (packages/lint/src/validate-rollup-source-visibility.ts). acknowledgedReason(set, column) reads the set's OWN entry for the summary column. When it carries a non-blank reason, every security-rollup-source-unreadable finding for that set and column (object, aggregated-field and filter-field arms) is emitted at info, same rule id, message ending Acknowledged on the set: plus the reason as a JSON string literal (quotes and line breaks stay escaped), path permissions[i].fields["OBJECT.SUMMARY"].rollupSourceUnreadableReason, and a hint saying how to restore the warning. Other sets, other columns, and security-rollup-source-row-scoped are unchanged. Docblock table and a new section document it.
  • Docs. rule-explanations.ts (the rule's explanation gains the acknowledgement paragraph), content/docs/data-modeling/fields.mdx (roll-up section, with an example), content/docs/deployment/validating-metadata.mdx (the advisory row), content/docs/protocol/objectql/security.mdx (the field permission reference, which enumerates the entry's keys; added after the docs-drift comment named the page).
  • Ledgers and generated. packages/spec/liveness/permission.json gains fields.children.rollupSourceUnreadableReason = live (lint is the whole feature, the same posture as dashboard widgets.suppressWarnings); regenerated authorable-surface/security.json, liveness/state-counts/permission.md, content/docs/references/security/permission.mdx, content/docs/references/api/protocol.mdx.
  • Changeset .changeset/34664-rollup-source-unreadable-reason.md: @objectstack/spec minor, @objectstack/lint minor.

Tests

  • New packages/lint/src/validate-rollup-source-visibility-acknowledged-34664.test.ts (9 cases, through runAuthoringRules): control without the key (both roll-ups warn); key on one column ⇒ that finding info, reason quoted, path at the key, the other column still warning; every column acknowledged ⇒ no warning left; another set reading the same column still warns; a blank reason on the raw door acknowledges nothing; the row-scoped note is untouched; the aggregated-field and filter-field arms are acknowledged the same way; a quote and a line break in the reason stay inside the quoted literal; a parsed set answers what the raw one does.
  • packages/spec/src/security/permission.test.ts: 5 new cases under rollupSourceUnreadableReason (accepts and keeps it; absent key does not materialise; blank and non-string refused; refused beside readable: false; rides a permission set's fields).
  • No existing test was changed.

Acceptance notes

Verification

Premise on origin/main f6f5b50
  • The rule header calls the pair "legal and often meant" and emits severity: 'warning'.
  • packages/cli/src/commands/lint.ts:1175-1179: failing = errors.length + (strict ? warnings.length : 0).
  • No acknowledgement or suppression in packages/lint/src or the CLI; the only metadata suppression key is the dashboard widget's suppressWarnings (packages/spec/src/ui/dashboard.zod.ts:1415); packages/lint/src/index.ts:1127 states "the CLI has no per-rule suppression".
  • node scripts/pm/check-prior-rulings.mjs --card 34664: ADR-0035/0061/0063/0071/0074/0079 hits; none rules on acknowledging an advisory finding. ADR-0035's roll-up semantics are unchanged.
Package tests and typecheck
  • pnpm --filter @objectstack/lint test: Test Files 216 passed (216), Tests 9124 passed (9124).
  • pnpm --filter @objectstack/spec test: Test Files 848 passed (848), Tests 27174 passed, 1 todo.
  • pnpm --filter @objectstack/lint typecheck and pnpm --filter @objectstack/spec typecheck (with NODE_OPTIONS=--max-old-space-size=4096): exit 0, test-typecheck debt held.
Ablations (both legs restored, `git diff HEAD` empty)
  • Lint: acknowledgedReason made to return undefined (anchor return nonBlank(reason) ? reason.trim() : undefined;, 1 → 0, via scripts/ablation-replace.mjs) ⇒ the new suite goes red, 4 failed / 3 passed (the four acknowledged cases; the control, blank-reason and row-scoped cases stay green, as expected).
  • Spec: the readable: false refine made vacuous ((p) => true || …) ⇒ refuses a reason beside readable: false goes red, 1 failed / 4 passed.
Derived gates

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack, each command run with < /dev/null, exit captured before any pipe; reconciliation --ran: 115 derived, 114 run, 1 NOT-MEASURED, 0 UNRUN, every run family exit 0. After the security.mdx commit (head 7a8180f) the derived set is unchanged; the docs families re-run on it (check:doc-anchors, check:doc-authoring, check-affected-docs, check-drift-comment, check:docs-transcript-drift, check:nul-bytes) exit 0.

  • First pass red only on generated artefacts (check:docs, check:liveness counts) and on prerequisites (lint dist not built; a shallow clone for check-plugin-teardown-shape --self-test). Regenerated with gen:schema, gen:docs, gen:liveness-counts, built @objectstack/lint, unshallowed, and re-ran those families: all exit 0.
  • check:generated (derived after merging origin/main) exit 0 with NODE_OPTIONS=--max-old-space-size=4096 (without it the test-typecheck step runs out of heap, not a finding).
  • NOT MEASURED: pnpm check:dual-build-cjs-loads, which needs every package's dist/ (a full pnpm build); CI runs it.
  • Record: /mnt/project-files/objectstack-seat2/34664-gates-ran.txt (project file).
Rework round (contract review 6945280556: S1, N1, N2, N4, N5)
  • Head after the round: b61b6d7 (commit f592705 plus a merge of origin/main).
  • Lint: the two rule suites + rule-explanations tests, 60/60; @objectstack/lint typecheck exit 0. Spec: permission.test.ts 127/127.
  • After the merge: @objectstack/spec rebuilt; check:generated exit 0 (with NODE_OPTIONS=--max-old-space-size=4096). Re-run, all exit 0: check:docs, check:authorable-surface, check:liveness, check:doc-anchors, check:doc-authoring, check-affected-docs, check:docs-transcript-drift, check:nul-bytes, check:doc-security-posture.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ADHkmQbFKVWVEYrgUsNnfJ


Generated by Claude Code

…ad with rollupSourceUnreadableReason

security-rollup-source-unreadable is advisory, but os lint --strict fails on
any warning and there was no way to declare a meant pair. A set's entry for a
summary column can now carry a non-blank reason; that one finding becomes an
info note quoting it. The runtime reads no part of the key.

Claude-Session: https://claude.ai/code/session_01ADHkmQbFKVWVEYrgUsNnfJ
Co-authored-by: Claude <noreply@anthropic.com>
…SourceUnreadableReason

Claude-Session: https://claude.ai/code/session_01ADHkmQbFKVWVEYrgUsNnfJ
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/lint, @objectstack/spec, touching 7 documentable anchor(s). ⚠️ 3 changed file(s) yielded no anchor (packages/spec/authorable-surface/security.json, packages/spec/liveness/permission.json, packages/spec/liveness/state-counts/permission.md), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

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

  • content/docs/data-modeling/fields.mdx (via rollupSourceUnreadableReason (literal, a string literal in FieldPermissionSchema))
  • content/docs/deployment/validating-metadata.mdx (via rollupSourceUnreadableReason (literal, a string literal in FieldPermissionSchema))
  • content/docs/protocol/objectql/security.mdx (via FieldPermissionSchema (symbol, a top-level const), rollupSourceUnreadableReason (literal, a string literal in FieldPermissionSchema))

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

  • content/docs/releases/v17/17-0.mdx (via FieldPermissionSchema (symbol, a top-level const))

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

What this run could not see
  • 3 changed file(s) yielded no anchor (packages/spec/authorable-surface/security.json, packages/spec/liveness/permission.json, packages/spec/liveness/state-counts/permission.md) — pages documenting those are invisible to this run
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 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 — 173 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 c12fe6649ffeb8a83dae916e8c420fa68c88a2cc → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json c12fe6649ffeb8a83dae916e8c420fa68c88a2cc

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

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 17, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq

Contract-review-claim: session_01ADHkmP44onN8RMzsPMqjRq · head 6b6146d · 2026-11-17T10:15Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq

Contract-review-claim: session_01ADHkmP44onN8RMzsPMqjRq · head 7a8180f · 2026-11-17T10:17Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 7a8180f2f6ca2fe580d1bc7559828d0012f022f5
Local-runs: none
Scope: packages/spec/src/security/permission.zod.ts + packages/lint/src/validate-rollup-source-visibility.ts, packages/lint/src/rule-explanations.ts, packages/spec/liveness/permission.json

How this head was read: the net diff of 6b6146d0c4dfa00c67e63b635f2adada3b52cad2 against its merge-base with main from git objects (13 files), plus the one file the head commit 7a8180f2 adds on top of it, content/docs/protocol/objectql/security.mdx (+4/-1), read from the PR's file list because that commit is not in the local object store. The PR file list at this head (14 files, +330/-13) differs from the 13-file diff by that one prose file only; the hunks of the other 13 files in the PR file list match the local diff. Card #34664 body and all five comments, the PR body, and the check-runs on this head were read. Nothing was built or run.

Security-touching: yes (the field-level permission surface of a permission set).

① Derived judgments

  • Accept-set of FieldPermissionSchema: widened by one optional string key, rollupSourceUnreadableReason. Right. The shipped name and placement match the seat's name ruling 6943835606 on the card exactly (the key, on the set's fields entry, value a reason string, no separate type).
  • New refusals, both confined to inputs that carry the new key, so nothing that parsed on main is refused. Right.
    • Blank reason: z.string().refine(NON_BLANK_STRING, ...) on the key itself, path rollupSourceUnreadableReason, message FIELD_PERMISSION_ROLLUP_REASON_BLANK. NON_BLANK_STRING is the shared self-declaring predicate, so the published JSON Schema carries the non-blank pattern.
    • Reason beside readable: false: a second object-level .refine, path ['rollupSourceUnreadableReason'], message FIELD_PERMISSION_ROLLUP_REASON_ON_HIDDEN. It runs on the defaulted value, so an absent readable (default true) is accepted and only a literal false is refused, which is the ruling's "readable that is not true". The object-level refine is a dropped refinement in the JSON Schema; dropped-refinements.baseline.json already declares the root site of security/FieldPermission (for the when rule) and a second refine at the same site adds no row; the key's describe states the rule in prose, as the when rule does.
  • Both refusals are real pins in permission.test.ts: three blank spellings with the message asserted, a non-string, and the readable: false case asserted by issue path and message; the accept case, the no-materialisation case and the PermissionSetSchema.fields case are pinned too.
  • Where the refusal applies: every parse of FieldPermissionSchema, which is PermissionSetSchema.fields and GetObjectPermissionsResponseSchema.fieldPermissions. On the permission set that is right. On the response it is inert: read in the live tree, no server code implements getObjectPermissions (the protocol method is optional and only the client re-exports the type), and both field merges (PermissionEvaluator.getFieldPermissions, buildEffectiveFieldPermissions) build fresh { readable, editable } entries from votes and never copy an authored entry, so the reason does not reach /auth/me/permissions or any per-object field projection. The jsdoc sentence "the server never sends it on the permission responses that reuse this shape" holds. No disclosure of author notes through the runtime responses; the reason is visible only where the permission set's own metadata is, like its description. The reuse is not a reason to move the key: the published response reference now lists the key, with a description that says the runtime does not read it. Accepted as the ruling decided.
  • Lint public surface: security-rollup-source-unreadable can now be emitted at info (same rule id, path extended to the key, message suffixed with the quoted reason, a different hint). Right, and stated in the rule's docblock table. The one consumer that filters by id without severity, packages/qa/scenarios/src/runner/orchestrate.ts#rollupSourceCharges, was read: its message patterns are anchored at the start and unanchored at the end, so the suffixed message still reads and a reason cannot spoof a clause; an acknowledged pair is still charged, which is the right posture for the eval.
  • Generated and ledger surfaces: authorable-surface/security.json gains exactly security/FieldPermission:rollupSourceUnreadableReason in sorted position; liveness/state-counts/permission.md moves 40 to 41 live and 44 to 45 classified, consistent with one new live row. Right.
  • Liveness (ADR-0049): the row names validate-rollup-source-visibility.ts#acknowledgedReason as the reader, which is true in the tree, says the runtime reads no part of the key, which the merge code confirms, and cites the dashboard widgets.suppressWarnings precedent for a live authoring-only consumer, which exists in liveness/dashboard.json. The Spec property liveness check concluded success on this head.

② Semver level

Clause-②: yes (widening) — one new optional authorable key; Metadata-protocol: added. The line is on the PR body and in the changeset, and both agree with the diff.

The changeset declares @objectstack/spec minor and @objectstack/lint minor. Those are the only two published packages the diff touches (the rest is content/docs prose and spec ledgers inside the spec package); both sit in the fixed version group. Minor is the right level for an additive key and an additive lint behaviour. Check Changeset concluded success on this head (both runs).

③ Boundary flags

  • Dev open_questions: one entry, "Contract review owed at head 6b6146d". Answered by this record, on the head the PR moved to; the only change since is the one prose file named above.
  • Dev security_findings: none. Dev deviations: none.
  • Dev out_of_scope_findings: the skill line and eval go to skills: teach rollupSourceUnreadableReason beside security-rollup-source-unreadable (follow-up of #34664) #34742. Judged: skills/objectstack-data/rules/relationships.md teaches "Never finish with security-rollup-source-unreadable standing" with two remedies (grant the child read, or mask the summary). After this PR that text is incomplete, not wrong: both remedies still work, the metadata it produces still parses, and the scenario runner still charges an acknowledged pair, so the stricter teaching stays consistent with its own eval. No published skill teaches something this PR makes false. The deferral holds; skills: teach rollupSourceUnreadableReason beside security-rollup-source-unreadable (follow-up of #34664) #34742 should decide whether the skill names the acknowledgement at all, given the eval charges it.
  • PR-body acceptance note "a stale acknowledgement is not reported": see N3.
  • SQL push-down: not applicable. The diff adds no data access, no id materialisation and no join; the rule reads authored metadata in memory.
  • Check-runs on this head. Concluded success: Governed Surface Queue Guard, Spec property liveness, Check Changeset, Check PR Size, Check Documentation Links, Flag docs affected by code changes, PR-body guards (the rerun; the first run was cancelled and superseded), Lint · PM dispatch-gates, Lint · scoped · tooling self-tests, Dogfood Regression Gate, Plan Test Core shards, Plan Test UI shards, filter, Auto Label. Skipped by design: the opt-in and schedule jobs. PENDING when this record was written, and therefore not verdicts: Type Check · workspace, Type Check · source gates, Type Check · consumer gates, Type Check · debt ledger, Lint · ESLint, Lint · repo and tooling gates, Lint · docs and code guards, Lint · CI, release and engine gates, Lint · scoped · query-options erasure, Lint · scoped · slot lookup and corpus, Build Core, Build Docs, Build UI Deps, Live E2E UI, Test Core 1/8 to 8/8. No check had concluded failure. The generated-artefact, typecheck and test families are among the pending ones; the seat reads their conclusions before adopting this record.

④ Design judgment

packages/spec/src/security/permission.zod.ts against ruling 6943835606 and its first consumer (the lint rule):

  • The key, its two refusals, their placement, paths and messages implement the ruling as written, and the first consumer reads exactly the shape the schema accepts (acknowledgedReason reads the set's own entry for the column and requires a non-blank string; a parsed set and a raw set answer the same, pinned).

S1 (should-fix) — the published text says the acknowledgement "changes nothing at runtime: the column is read under the parent field's own field-level security either way", and the jsdoc says "the field merge, the read mask ... are unchanged". That is true of the key and false of the act the key requires. The key can only be written on a fields entry, and an entry is a declaring vote: in the field merge only sets that declare an entry vote, most permissive wins, and a parsed entry defaults readable: true (fieldPermissionVote, getFieldPermissions, buildEffectiveFieldPermissions, read in the live tree; the rule's own hint says "to keep it for some holders, declare readable: true in the sets they hold"). So a set that had NO entry for the summary column and gains one only to carry the reason now votes readable: true, and for every user who also holds a set that masks that column with readable: false the mask stops binding. In the card's own scenario the sets are service, marketing and the default set; an entry on a set every user holds defeats every other set's mask of that total. The behaviour is the documented merge and may well be what the author means, but the describe, the jsdoc, rule-explanations.ts, fields.mdx and the new security.mdx note all tell the author the edit is runtime-neutral, on a security surface, at the moment they are adding a read vote. Fix: one sentence in the key's describe and jsdoc (then regenerated references), repeated in the rule explanation and fields.mdx: the entry that carries the reason is an ordinary declaring entry and votes readable: true in the field merge, so on a set that had no entry for the column it restores the column for holders whose other sets mask it. No behaviour change is asked for.

S2 (should-fix) — the new cross-key refusal has a second authoring door that this PR leaves able to produce the refused shape. Read, not reviewed: ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.tsx#updateFieldPerm starts from the stored entry as is (fieldRuleSeed returns the entry), spreads it, and on Read off deletes when only, with the comment that the spec refuses when beside readable: false so the matrix "never authors that shape". With an entry that carries rollupSourceUnreadableReason, Read off now yields readable: false beside the reason, which this schema refuses; the matrix has no control that shows or clears the key, so an admin taking the very remedy the acknowledged finding's hint names (stop the set reading the column) meets a refused save with no in-editor way out. The failure is closed (nothing is widened or lost). Separately permission-slice.ts#withFieldBits (the bulk shortcuts) rebuilds the entry keeping when and silently drops the reason; that direction is safe (the warning returns) but it is an unannounced loss of authored text. That the save door parses with the spec is taken from the editor's own when comment, not traced further. Fix: mirror the when cascade for the new key in the matrix (Read off clears it; the bulk shortcut either carries or deliberately drops it, said in the comment), in this PR or on a follow-up card the seat files and names here; either disposal closes S2.

packages/lint/src/validate-rollup-source-visibility.ts against the contract, sentence by sentence:

  • "that one finding, this set and this column": holds. The reason is read from set.fields[column] of the set being judged, with column the parent object and summary field name; nothing is read object-wide, set-wide or from a co-held set. All three arms of the rule (child object, aggregated field, filter field) go through the same closure, and each set and column yields at most one finding.
  • "every other finding unchanged": holds. The unacknowledged branch is byte-identical to main (severity, path, message, hint); the row-scoped finding does not go through the closure.
  • "quotes the reason": the trimmed reason is appended in double quotes after the full original message, so the pair and the cause stay readable. It is plain text into the finding message; no markup or shell sink was found on the path read.
  • A raw blank reason acknowledges nothing; a raw readable: false entry never reaches the closure because the set is first judged not to read the column. Both agree with the schema's refusals.
  • The new test pins the downgrade (severity, quoted reason, path), and the non-downgrade of the neighbours: another column of the same set, another set on the same column, and the row-scoped note; the control without the key is pinned in the same file.

packages/lint/src/rule-explanations.ts: the new paragraph agrees with the behaviour (one set, one column, note quoting the reason, neighbours and the row-scope note as before, the two refusals). It carries the S1 sentence.

packages/spec/liveness/permission.json: agrees with the tree, as judged under ①.

Prose read for agreement with the schema only: content/docs/data-modeling/fields.mdx, content/docs/deployment/validating-metadata.mdx, content/docs/protocol/objectql/security.mdx (the file the head commit adds), and the two generated reference pages. All agree with the schema and the rule, apart from the S1 sentence and N2. The security.mdx link target fields#calculation-types exists (heading "Calculation Types"), and the link check concluded success.

Nits (no effect on correctness or the contract):

  • N1 — FIELD_PERMISSION_ROLLUP_REASON_ON_HIDDEN says the entry "hides the column and there is no read to acknowledge". For a set that holds Modify All on the parent, readable: false is inert and the set still reads the column; the refusal is still right (the fix it names, readable: true, is correct) but the stated cause is not true in that corner.
  • N2 — security.mdx comments the key as "on a summary column only". The schema accepts it on any entry; "meaningful only on a summary column" is what is true.
  • N3 — a reason on an entry that raises no finding today (a non-summary column, or a set that can currently read the child) is silent, as the PR body says. It also pre-acknowledges: if the child read is later removed, the finding first appears already at info. The seat chose not to report stale acknowledgements in this PR; a follow-up card is the right home.
  • N4 — the new lint suite acknowledges only the child-object arm. The aggregated-field and filter-field arms share the closure, so they are covered by construction, not by a pin.
  • N5 — the reason is interpolated between double quotes without escaping, so a reason containing a double quote or a line break renders raw in the message. Cosmetic.

S1 and S2 are open on this head. Neither changes a parse result or the rule's judgment, so the verdict is PASS on the contract as ruled; each fix that moves a file in Scope owes a delta review on the new head.

Implemented-by: claude/project-thread-wq8blv
Reviewed-by: session_01ADHkmP44onN8RMzsPMqjRq

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 7a8180f2f6ca2fe580d1bc7559828d0012f022f5
Local-runs: none
Scope: packages/spec/src/security/permission.zod.ts + packages/lint/src/validate-rollup-source-visibility.ts, packages/lint/src/rule-explanations.ts, packages/spec/liveness/permission.json

How this head was read: the net diff of 6b6146d0c4dfa00c67e63b635f2adada3b52cad2 against its merge-base with main from git objects (13 files), plus the one file the head commit 7a8180f2 adds on top of it, content/docs/protocol/objectql/security.mdx (+4/-1), read from the PR's file list because that commit is not in the local object store. The PR file list at this head (14 files, +330/-13) differs from the 13-file diff by that one prose file only; the hunks of the other 13 files in the PR file list match the local diff. Card #34664 body and all five comments, the PR body, and the check-runs on this head were read. Nothing was built or run.

Security-touching: yes

Security-touching reads yes: the field-level permission surface of a permission set.

① Derived judgments

  • Accept-set of FieldPermissionSchema: widened by one optional string key, rollupSourceUnreadableReason. Right. The shipped name and placement match the seat's name ruling 6943835606 on the card exactly (the key, on the set's fields entry, value a reason string, no separate type).
  • New refusals, both confined to inputs that carry the new key, so nothing that parsed on main is refused. Right.
    • Blank reason: z.string().refine(NON_BLANK_STRING, ...) on the key itself, path rollupSourceUnreadableReason, message FIELD_PERMISSION_ROLLUP_REASON_BLANK. NON_BLANK_STRING is the shared self-declaring predicate, so the published JSON Schema carries the non-blank pattern.
    • Reason beside readable: false: a second object-level .refine, path ['rollupSourceUnreadableReason'], message FIELD_PERMISSION_ROLLUP_REASON_ON_HIDDEN. It runs on the defaulted value, so an absent readable (default true) is accepted and only a literal false is refused, which is the ruling's "readable that is not true". The object-level refine is a dropped refinement in the JSON Schema; dropped-refinements.baseline.json already declares the root site of security/FieldPermission (for the when rule) and a second refine at the same site adds no row; the key's describe states the rule in prose, as the when rule does.
  • Both refusals are real pins in permission.test.ts: three blank spellings with the message asserted, a non-string, and the readable: false case asserted by issue path and message; the accept case, the no-materialisation case and the PermissionSetSchema.fields case are pinned too.
  • Where the refusal applies: every parse of FieldPermissionSchema, which is PermissionSetSchema.fields and GetObjectPermissionsResponseSchema.fieldPermissions. On the permission set that is right. On the response it is inert: read in the live tree, no server code implements getObjectPermissions (the protocol method is optional and only the client re-exports the type), and both field merges (PermissionEvaluator.getFieldPermissions, buildEffectiveFieldPermissions) build fresh { readable, editable } entries from votes and never copy an authored entry, so the reason does not reach /auth/me/permissions or any per-object field projection. The jsdoc sentence "the server never sends it on the permission responses that reuse this shape" holds. No disclosure of author notes through the runtime responses; the reason is visible only where the permission set's own metadata is, like its description. The reuse is not a reason to move the key: the published response reference now lists the key, with a description that says the runtime does not read it. Accepted as the ruling decided.
  • Lint public surface: security-rollup-source-unreadable can now be emitted at info (same rule id, path extended to the key, message suffixed with the quoted reason, a different hint). Right, and stated in the rule's docblock table. The one consumer that filters by id without severity, packages/qa/scenarios/src/runner/orchestrate.ts#rollupSourceCharges, was read: its message patterns are anchored at the start and unanchored at the end, so the suffixed message still reads and a reason cannot spoof a clause; an acknowledged pair is still charged, which is the right posture for the eval.
  • Generated and ledger surfaces: authorable-surface/security.json gains exactly security/FieldPermission:rollupSourceUnreadableReason in sorted position; liveness/state-counts/permission.md moves 40 to 41 live and 44 to 45 classified, consistent with one new live row. Right.
  • Liveness (ADR-0049): the row names validate-rollup-source-visibility.ts#acknowledgedReason as the reader, which is true in the tree, says the runtime reads no part of the key, which the merge code confirms, and cites the dashboard widgets.suppressWarnings precedent for a live authoring-only consumer, which exists in liveness/dashboard.json. The Spec property liveness check concluded success on this head.

② Semver level

Clause-②: yes (widening) — one new optional authorable key; Metadata-protocol: added. The line is on the PR body and in the changeset, and both agree with the diff.

The changeset declares @objectstack/spec minor and @objectstack/lint minor. Those are the only two published packages the diff touches (the rest is content/docs prose and spec ledgers inside the spec package); both sit in the fixed version group. Minor is the right level for an additive key and an additive lint behaviour. Check Changeset concluded success on this head (both runs).

③ Boundary flags

  • Dev open_questions: one entry, "Contract review owed at head 6b6146d". Answered by this record, on the head the PR moved to; the only change since is the one prose file named above.
  • Dev security_findings: none. Dev deviations: none.
  • Dev out_of_scope_findings: the skill line and eval go to skills: teach rollupSourceUnreadableReason beside security-rollup-source-unreadable (follow-up of #34664) #34742. Judged: skills/objectstack-data/rules/relationships.md teaches "Never finish with security-rollup-source-unreadable standing" with two remedies (grant the child read, or mask the summary). After this PR that text is incomplete, not wrong: both remedies still work, the metadata it produces still parses, and the scenario runner still charges an acknowledged pair, so the stricter teaching stays consistent with its own eval. No published skill teaches something this PR makes false. The deferral holds; skills: teach rollupSourceUnreadableReason beside security-rollup-source-unreadable (follow-up of #34664) #34742 should decide whether the skill names the acknowledgement at all, given the eval charges it.
  • PR-body acceptance note "a stale acknowledgement is not reported": see N3.
  • SQL push-down: not applicable. The diff adds no data access, no id materialisation and no join; the rule reads authored metadata in memory.
  • Check-runs on this head. Concluded success: Governed Surface Queue Guard, Spec property liveness, Check Changeset, Check PR Size, Check Documentation Links, Flag docs affected by code changes, PR-body guards (the rerun; the first run was cancelled and superseded), Lint · PM dispatch-gates, Lint · scoped · tooling self-tests, Dogfood Regression Gate, Plan Test Core shards, Plan Test UI shards, filter, Auto Label. Skipped by design: the opt-in and schedule jobs. PENDING when this record was written, and therefore not verdicts: Type Check · workspace, Type Check · source gates, Type Check · consumer gates, Type Check · debt ledger, Lint · ESLint, Lint · repo and tooling gates, Lint · docs and code guards, Lint · CI, release and engine gates, Lint · scoped · query-options erasure, Lint · scoped · slot lookup and corpus, Build Core, Build Docs, Build UI Deps, Live E2E UI, Test Core 1/8 to 8/8. No check had concluded failure. The generated-artefact, typecheck and test families are among the pending ones; the seat reads their conclusions before adopting this record.

④ Design judgment

packages/spec/src/security/permission.zod.ts against ruling 6943835606 and its first consumer (the lint rule):

  • The key, its two refusals, their placement, paths and messages implement the ruling as written, and the first consumer reads exactly the shape the schema accepts (acknowledgedReason reads the set's own entry for the column and requires a non-blank string; a parsed set and a raw set answer the same, pinned).

S1 (should-fix) — the published text says the acknowledgement "changes nothing at runtime: the column is read under the parent field's own field-level security either way", and the jsdoc says "the field merge, the read mask ... are unchanged". That is true of the key and false of the act the key requires. The key can only be written on a fields entry, and an entry is a declaring vote: in the field merge only sets that declare an entry vote, most permissive wins, and a parsed entry defaults readable: true (fieldPermissionVote, getFieldPermissions, buildEffectiveFieldPermissions, read in the live tree; the rule's own hint says "to keep it for some holders, declare readable: true in the sets they hold"). So a set that had NO entry for the summary column and gains one only to carry the reason now votes readable: true, and for every user who also holds a set that masks that column with readable: false the mask stops binding. In the card's own scenario the sets are service, marketing and the default set; an entry on a set every user holds defeats every other set's mask of that total. The behaviour is the documented merge and may well be what the author means, but the describe, the jsdoc, rule-explanations.ts, fields.mdx and the new security.mdx note all tell the author the edit is runtime-neutral, on a security surface, at the moment they are adding a read vote. Fix: one sentence in the key's describe and jsdoc (then regenerated references), repeated in the rule explanation and fields.mdx: the entry that carries the reason is an ordinary declaring entry and votes readable: true in the field merge, so on a set that had no entry for the column it restores the column for holders whose other sets mask it. No behaviour change is asked for.

S2 (should-fix) — the new cross-key refusal has a second authoring door that this PR leaves able to produce the refused shape. Read, not reviewed: ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.tsx#updateFieldPerm starts from the stored entry as is (fieldRuleSeed returns the entry), spreads it, and on Read off deletes when only, with the comment that the spec refuses when beside readable: false so the matrix "never authors that shape". With an entry that carries rollupSourceUnreadableReason, Read off now yields readable: false beside the reason, which this schema refuses; the matrix has no control that shows or clears the key, so an admin taking the very remedy the acknowledged finding's hint names (stop the set reading the column) meets a refused save with no in-editor way out. The failure is closed (nothing is widened or lost). Separately permission-slice.ts#withFieldBits (the bulk shortcuts) rebuilds the entry keeping when and silently drops the reason; that direction is safe (the warning returns) but it is an unannounced loss of authored text. That the save door parses with the spec is taken from the editor's own when comment, not traced further. Fix: mirror the when cascade for the new key in the matrix (Read off clears it; the bulk shortcut either carries or deliberately drops it, said in the comment), in this PR or on a follow-up card the seat files and names here; either disposal closes S2.

packages/lint/src/validate-rollup-source-visibility.ts against the contract, sentence by sentence:

  • "that one finding, this set and this column": holds. The reason is read from set.fields[column] of the set being judged, with column the parent object and summary field name; nothing is read object-wide, set-wide or from a co-held set. All three arms of the rule (child object, aggregated field, filter field) go through the same closure, and each set and column yields at most one finding.
  • "every other finding unchanged": holds. The unacknowledged branch is byte-identical to main (severity, path, message, hint); the row-scoped finding does not go through the closure.
  • "quotes the reason": the trimmed reason is appended in double quotes after the full original message, so the pair and the cause stay readable. It is plain text into the finding message; no markup or shell sink was found on the path read.
  • A raw blank reason acknowledges nothing; a raw readable: false entry never reaches the closure because the set is first judged not to read the column. Both agree with the schema's refusals.
  • The new test pins the downgrade (severity, quoted reason, path), and the non-downgrade of the neighbours: another column of the same set, another set on the same column, and the row-scoped note; the control without the key is pinned in the same file.

packages/lint/src/rule-explanations.ts: the new paragraph agrees with the behaviour (one set, one column, note quoting the reason, neighbours and the row-scope note as before, the two refusals). It carries the S1 sentence.

packages/spec/liveness/permission.json: agrees with the tree, as judged under ①.

Prose read for agreement with the schema only: content/docs/data-modeling/fields.mdx, content/docs/deployment/validating-metadata.mdx, content/docs/protocol/objectql/security.mdx (the file the head commit adds), and the two generated reference pages. All agree with the schema and the rule, apart from the S1 sentence and N2. The security.mdx link target fields#calculation-types exists (heading "Calculation Types"), and the link check concluded success.

Nits (no effect on correctness or the contract):

  • N1 — FIELD_PERMISSION_ROLLUP_REASON_ON_HIDDEN says the entry "hides the column and there is no read to acknowledge". For a set that holds Modify All on the parent, readable: false is inert and the set still reads the column; the refusal is still right (the fix it names, readable: true, is correct) but the stated cause is not true in that corner.
  • N2 — security.mdx comments the key as "on a summary column only". The schema accepts it on any entry; "meaningful only on a summary column" is what is true.
  • N3 — a reason on an entry that raises no finding today (a non-summary column, or a set that can currently read the child) is silent, as the PR body says. It also pre-acknowledges: if the child read is later removed, the finding first appears already at info. The seat chose not to report stale acknowledgements in this PR; a follow-up card is the right home.
  • N4 — the new lint suite acknowledges only the child-object arm. The aggregated-field and filter-field arms share the closure, so they are covered by construction, not by a pin.
  • N5 — the reason is interpolated between double quotes without escaping, so a reason containing a double quote or a line break renders raw in the message. Cosmetic.

S1 and S2 are open on this head. Neither changes a parse result or the rule's judgment, so the verdict is PASS on the contract as ruled; each fix that moves a file in Scope owes a delta review on the new head.

Implemented-by: claude/project-thread-wq8blv
Reviewed-by: session_01ADHkmP44onN8RMzsPMqjRq

VERDICT: PASS

…es readable: true in the field merge

Contract review S1: the key is not read at runtime, but the entry that carries
it is a declaring vote, so adding one to a set with no entry restores the column
for holders whose other sets mask it. Also: the reason is quoted as a string
literal, the hidden-entry refusal states its cause precisely, and the
aggregated-field and filter-field arms are pinned.

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

Copy link
Copy Markdown
Contributor Author

l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq

Contract-review-claim: session_01ADHkmP44onN8RMzsPMqjRq · head b61b6d7 · 2026-11-17T10:34Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: b61b6d75111e8747f7fcfec1abfb3703cf1a535d
Local-runs: none
Scope: packages/spec/src/security/permission.zod.ts + packages/lint/src/validate-rollup-source-visibility.ts, packages/lint/src/rule-explanations.ts, packages/spec/liveness/permission.json

Delta review on top of record 6945332987 (PASS on head 7a8180f2f6ca2fe580d1bc7559828d0012f022f5, S1 and S2 open, nits N1 to N5).

How this head was read: the rework commit f592705f against 7a8180f2 from git objects (8 files, +70/-23); the merge commit that is the head; the net diff of the head against its merge-base with main (c12fe664, 14 files, +377/-13, the same 14 files and counts as the PR file list); whole files at head for the schema, the lint rule, its new suite, the spec test and the two field merges. Card #34664 body and all five comments (name ruling 6943835606), record 6945332987, the PR body, follow-up card #34786 with its one comment, and the check-runs on this head were read. Nothing was built or run.

The merge: the head has two parents, f592705f and c12fe664 (the PR base). The files the merge brings are exactly the 67 files main changed between the previous merged-in point and c12fe664; none of them is one of the PR's 14 files, and each of the 14 is blob-identical at f592705f and at the head. So the PR's own content on this head is f592705f and nothing else. What main brought was not reviewed. main moved none of the files the earlier record read to judge this PR: packages/core/src/security/effective-object-permissions.ts, packages/plugins/plugin-security/src/permission-evaluator.ts, ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.tsx, ui/packages/app-shell/src/views/metadata-admin/permission-slice.ts and packages/qa/scenarios/src/runner/orchestrate.ts are all absent from the 67.

Security-touching: yes

The diff is on the field-level permission surface of a permission set.

① Derived judgments

  • Accept-set and refusals of FieldPermissionSchema: unchanged by the rework. The delta in permission.zod.ts is text only: the FIELD_PERMISSION_ROLLUP_REASON_ON_HIDDEN message, the schema jsdoc, the key jsdoc and the key's describe. No predicate, path, key or default moved, so every derived judgment of 6945332987 on the parse surface stands as written.
  • The refusal message changed its wording, not its identity. The spec test pins it by issue path and by the substring "refused beside readable: false", which the new message still carries; permission.test.ts is untouched by the rework and still reads the message. Right.
  • Lint finding shape: the acknowledged message now ends with the reason rendered by JSON.stringify in place of the reason between two literal double quotes. For a reason with no double quote, backslash or control character the output is byte-identical to the previous head, so the earlier pin (the message contains the reason in double quotes) holds unchanged. Rule id, severity, where, path and hint are untouched. Right.
  • Consumers of that message: a search of the head tree for the suffix text finds the rule and its own suite only. orchestrate.ts#rollupSourceCharges reads findings through readRollupSourceFinding, whose two message patterns are anchored at the start and open at the end, and whose where pattern does not involve the reason; the suffix, in either rendering, is past everything they capture. An acknowledged pair is still read and still charged. No consumer depends on the changed part.
  • Generated references: the describe string was reassembled from the schema source at head and compared with the three generated rows (two in content/docs/references/security/permission.mdx, one in content/docs/references/api/protocol.mdx): all three contain it verbatim, and the three rows moved in the same commit as the describe. They read as regenerated, not hand-edited; the gate that proves it is among the pending Lint jobs (see ③).
  • Ledgers: authorable-surface/security.json, liveness/permission.json and liveness/state-counts/permission.md are untouched by the rework and by the merge. Spec property liveness concluded success on this head.

② Semver level

Unchanged. Clause-②: yes (widening), one new optional authorable key; Metadata-protocol: added. Both lines are on the PR body and in the changeset, and the changeset file is byte-identical to the one judged before: @objectstack/spec minor and @objectstack/lint minor. The rework adds no key, no refusal and no new finding; a re-worded refusal message and an escaped rendering of the quoted reason do not move the level. Check Changeset concluded success on this head (both runs).

③ Boundary flags

  • Dev open_questions: the card carries no new report since 6945083656; its one entry (contract review owed) is answered on this head by this record. The PR body's rework section names the round and the head; it raises no question.
  • Dev security_findings: none. deviations: none. out_of_scope_findings: the skill line and eval on skills: teach rollupSourceUnreadableReason beside security-rollup-source-unreadable (follow-up of #34664) #34742, judged in 6945332987; nothing in the delta changes that judgment.
  • S2 disposal: console permission matrix: turning Read off leaves rollupSourceUnreadableReason behind (refused shape) and the bulk shortcut drops it silently #34786 exists and is open, titled for the console permission matrix, filed against S2 of record 6945332987 and Blocked-by #34664. Its body states both halves: turning Read off in PermissionMatrixEditor updateFieldPerm deletes only when, leaving readable: false beside the reason, a shape the schema refuses, with no way in the editor to clear it; and the bulk shortcut withFieldBits rewrites the entry and silently drops the reason. It asks for both to be pinned against the spec schema. The PR's Acceptance notes name console permission matrix: turning Read off leaves rollupSourceUnreadableReason behind (refused shape) and the bulk shortcut drops it silently #34786 with the same two facts. That is the follow-up disposal the earlier record accepted.
  • SQL push-down: not applicable. The delta adds no data access, no id materialisation and no join.
  • Check-runs on this head. Concluded success: Governed Surface Queue Guard, Spec property liveness, Check Changeset (both runs), Check PR Size, Check Documentation Links, Flag docs affected by code changes, PR-body guards (the rerun; the first run was cancelled and superseded), Lint · PM dispatch-gates, Lint · scoped · tooling self-tests, Type Check · source gates, Dogfood Regression Gate, Plan Test Core shards, Plan Test UI shards, filter, Auto Label. Skipped by design: the opt-in, schedule and queue-verdict jobs. PENDING when this record was written, and therefore not verdicts: Type Check · workspace, Type Check · consumer gates, Type Check · debt ledger, Lint · ESLint, Lint · repo and tooling gates, Lint · docs and code guards, Lint · CI, release and engine gates, Lint · scoped · query-options erasure, Lint · scoped · slot lookup and corpus, Build Core, Build Docs, Build UI Deps, Live E2E UI, Test Core 1/8 to 8/8. No check had concluded failure. Three of the four typecheck jobs, every Test Core shard, and the Lint jobs that carry the generated-artefact gates (check:docs, check:authorable-surface live in the lint workflow) are pending; the seat reads their conclusions before adopting this record.

④ Design judgment

packages/spec/src/security/permission.zod.ts against ruling 6943835606, the merge code it now describes, and its first consumer:

  • The S1 sentence, as now written in the describe and both jsdocs: the runtime does not read the key, but the entry that carries it is an ordinary declaring entry that votes readable: true in the field merge, where only declaring sets vote and the most permissive vote wins, so on a set that had no entry for the column, adding one restores the column for holders whose other sets mask it. Checked against the head tree, clause by clause:
    • "the runtime does not read the key": fieldPermissionVote reads readable, editable and when only, and both merges build fresh { readable, editable } entries. True.
    • "only declaring sets vote": getFieldPermissions and buildEffectiveFieldPermissions iterate each set's own fields entries; a set with no entry contributes nothing (the super-user vote apart, which the when describe already states). True.
    • "votes readable: true": the vote is entry.readable === true; a parsed entry carries the schema default true, and the schema refuses the reason beside readable: false, so every parsed entry that carries the reason votes read. True for a parsed entry; see N6 for the unparsed one.
    • "most permissive wins", "restores the column": both merges set the accumulated readable to true on any read vote and never clear it, so one read vote overrides every co-held readable: false. True.
  • The statement is no longer "runtime-neutral": the old sentences ("changes nothing at runtime", "the field merge, the read mask ... are unchanged") are gone from the head tree; a search for them finds nothing.
  • Ruling 6943835606 asked that the describe say the key is read by authoring-time lint only, never at runtime. It still does, in its first sentence.
  • The re-worded refusal ("that entry declares no read of the column, so there is nothing to acknowledge") no longer claims the column is hidden, so it is true for a Modify All holder too.

packages/lint/src/rule-explanations.ts: the explanation's last sentence pair now carries the same statement (does not read the key; the entry votes readable: true in the field merge; restores the column for holders whose other sets mask it). Agrees with the schema text and the merge.

packages/lint/src/validate-rollup-source-visibility.ts: two changes. The docblock gains the entry-vote clause, which agrees with the above. The acknowledged message renders the trimmed reason with JSON.stringify, judged under ①: a string literal, so a double quote or a line break in the reason can no longer close the quotes or break the line. The unacknowledged branch is untouched.

packages/lint/src/validate-rollup-source-visibility-acknowledged-34664.test.ts (in the diff, read as the pin of the above):

  • The aggregated-field arm: the set reads both objects, so the object arm cannot fire, and hides invoice_line.amount; the control asserts one warning at the invoice.total column, and the same set with the reason asserts info at the same place. A real pin of that arm: remove the acknowledgement there and the second assertion fails.
  • The filter-field arm: a filtered count with no aggregated field, the set reads both objects and hides the filtered field band, so only the filter arm can produce the finding; control warning, acknowledged info. A real pin.
  • The literal: a reason holding a double quote and a line break, asserted by endsWith on the exact escaped text. A real pin of the new rendering, and it would fail on the previous head's interpolation.

packages/spec/liveness/permission.json: unchanged; agrees with the tree as judged before.

Prose read for agreement with the schema only: content/docs/data-modeling/fields.mdx and content/docs/protocol/objectql/security.mdx now carry the entry-vote statement, and both agree with the merge; security.mdx says "readable: true by default", which is the precise form. security.mdx now comments the key as "meaningful on a summary column", which is what the schema does. content/docs/deployment/validating-metadata.mdx is unchanged and makes no runtime claim. The two generated references agree with the describe, as judged under ①.

Prior findings:

S1: closed
S2: closed
N1: closed
N2: closed
N3: closed
N4: closed
N5: closed

S2 is closed by the follow-up card #34786, named in the PR's Acceptance notes; N3 by the Acceptance note that states the pre-acknowledgement and the seat's choice.

New nits (no effect on correctness or the contract):

  • N6 — "votes readable: true" is exact for a parsed entry. The merge reads each bit as === true ("an unparsed one votes only what it spells"), so an unparsed entry that carries the reason and spells no readable would cast a declaring vote that is not a read vote, while the lint rule (which hides a column only on a literal readable: false) reports that set as reading the column and acknowledges it. That asymmetry between a raw and a parsed entry is the merge's own, on main, and is not this PR's; whether any runtime door hands the merge an unparsed permission set was not traced. The schema jsdoc and security.mdx already say "its default" and "by default", and the fields.mdx example spells readable: true. Nothing is asked for here.
  • N7 — the changeset body, which becomes the changelog entry, still ends "The key is read only at authoring time; the runtime does not read it", without the entry-vote sentence the other five places gained. True as written, only less complete than the describe.
  • N8 — one test title in permission.test.ts still phrases the refusal as "the column is hidden, there is no read to acknowledge", and the comment on the second refine says "beside a mask there is no read": the wording N1 retired from the message. A title and a comment only.

No must-fix, no should-fix.

The rework changes text and one message rendering; no parse result and no judgment of the rule moved, the statements added are true to the merge code at head, and the follow-up for the console editor is filed. The verdict rests on the tree; the pending check-runs named under ③ are not part of it and are the seat's to read.

Implemented-by: claude/project-thread-wq8blv
Reviewed-by: session_01ADHkmP44onN8RMzsPMqjRq

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmPJxG4vBVaLCBWLcWJ

Final head · 2026-11-17T11:05Z
Head: b61b6d75111e8747f7fcfec1abfb3703cf1a535d

  • CI: every check on this head completed, none red.
  • Contract review: first review 6945332987 (PASS, S1/S2 open) on 7a8180f2; delta 6945683949 on this head, PASS, S1, S2 and N1–N5 closed, nothing owed. S2 is carried by console permission matrix: turning Read off leaves rollupSourceUnreadableReason behind (refused shape) and the bulk shortcut drops it silently #34786. Nits N6–N8 left as written.
  • Scope: one new optional key rollupSourceUnreadableReason on the permission set's field entry (name ruling 6943835606), the rule reading it, refusals for a blank reason and a reason beside readable not true, docs and regenerated references, changeset. +377 / -13. check-governed-merges --pr 34775: NOT governed by the register, but it touches packages/spec/src, so it lands through the seat (Tier H) and stays draft.
  • Skills-docs: follow-up #34742.
    Sent to L1 for a first review on this head.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmQtnGcx7hYEL11ptVs

席位核对

L1 first review: ACCEPT · PR #34775 · card #34664 (name ruling 6943835606) · area o2-A · L1-a2 · 2026-11-17T11:09Z

Head-sha: b61b6d75111e8747f7fcfec1abfb3703cf1a535d

Final-head comment 6946277914. Contract review: first review 6945332987 at 7a8180f2 (PASS, S1/S2 open), and delta 6945683949 at this head (PASS, S1, S2 and N1–N5 closed).

Checklist

  • Shape. Draft, base main. Fixes #34664 is the only closing keyword, and it is right: the PR delivers the acknowledgement the card asks for. Clause-②: yes (widening) holds. FieldPermissionSchema is a strictObject, so on main any rollupSourceUnreadableReason key was already refused. The new key is optional, and its two parse refusals (blank, and beside readable: false) touch only values that were refused before, so nothing that parsed before is refused now. Metadata-protocol: added and Skills-docs: follow-up #34742 are right. skills: teach rollupSourceUnreadableReason beside security-rollup-source-unreadable (follow-up of #34664) #34742 is open and names this key.
  • Scope (14 paths, +377/−13): the spec schema and its test, the lint rule, rule-explanations.ts and a new lint suite, the generated ledgers and references, four docs pages, and the changeset. Commits 242c64f5, a192ea44, 7a8180f2 and f592705f, plus merges 6b6146d0 and b61b6d75. git show --remerge-diff is empty for both merges.
  • Against the name ruling 6943835606, item by item:
    • Key and place: rollupSourceUnreadableReason on the set's fields['<object>.<summary>'] entry, a string. Matches.
    • Behaviour: that set × that column reports info and quotes the reason, and every other finding is unchanged. acknowledgedReason(set, column) reads only the set's own entry, and unreadable() switches severity, path and hint only when the reason is there. The row-scoped arm does not call it. Matches.
    • Parse refusals: a blank reason (NON_BLANK_STRING), and a reason beside a readable that is not true. The refine is readable !== false, and readable is a boolean that defaults to true, so "not true" and "false" are the same set of values. Matches.
    • Reuse by GetObjectPermissionsResponse: the describe says that only authoring-time lint reads the key. No server implements getObjectPermissions in packages/ outside spec and client, so the JSDoc sentence that the server never sends the key holds. Matches.
    • Skills not in this PR: none touched. The line is in Skills-docs:. Matches.
  • The S1 sentence (the entry carrying a reason votes readable: true in the field merge) is in the describe, the JSDoc, the lint docblock and the fields docs. It is the behaviour an author must know before they add an entry only to carry a reason, and the PR states it rather than changing the merge.
  • Refinement ledger. The second .refine sits at the schema root. dropped-refinements.baseline.json already lists site "" for security/FieldPermission (the when rule), and the ledger counts sites, so its row does not move. The property-level non-blank check projects as non-blank-string.
  • Message safety. The reason is quoted with JSON.stringify, so quotes and line breaks stay inside the literal. A suite case pins this.
  • Liveness. fields.children.rollupSourceUnreadableReason = live, with evidence at acknowledgedReason. This is build-time-only by contract, the same posture as dashboard widgets.suppressWarnings. Spec property liveness is green.
  • Pins.
    • Lint: 9 cases through runAuthoringRules, covering the control, one column acknowledged, all columns acknowledged, another set, a blank reason on the raw door, the row-scoped arm, the aggregated-field and filter-field arms, quoting, and parsed equal to raw.
    • Spec: 5 cases.
    • Ablations (body): acknowledgedReason returning undefined gives 4 red / 3 green. The 3 green are the controls, as expected. A vacuous readable: false refine gives 1 red. Both were restored. No existing test changed.
  • Out-of-scope leftovers each have a #N or a stated reason.
  • Changeset. Root .changeset/, @objectstack/spec minor and @objectstack/lint minor, which is right for a new authorable key and a new rule outcome. Each sentence matches the diff.
  • Gates. 115 derived, 114 run, 1 NOT-MEASURED (check:dual-build-cjs-loads, which needs every package's dist/; CI carries it). Docs and generated families re-ran after the rework and merge, all exit 0.
  • CI on this head (check-runs, filter=latest, 72 runs): success=59, skipped=12, cancelled=1. The cancelled run is PR-body guards (10:31:50Z). The same check succeeded on this head at 10:32:05Z, later than the cancelled run. Nothing is red or pending.

L2 and landing

  • L2: owed (CONTRACT_REVIEW_TIER: packages/spec/src and Clause-②: yes), and on file. PASS 6945683949 is at b61b6d75, the same head.
  • Landing tier. node scripts/pm/check-governed-merges.mjs --pr 34775 reads NOT governed, 390 changed lines ≤ 3000. However, the PR touches packages/spec/src outside tests, so it is spec surface: 「spec 面,交席位 Tier H」. The area does not land it. L1 ACCEPT and L2 PASS are both at this head. The seat takes the final steps, including the os-zhuang approval. ⛔ Do not mark it ready or arm auto-merge before that approval.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmQ2SN4K183oqAvUajA

Seat record · 2026-11-17T11:19Z · Head-sha: b61b6d7

维护者速读

  • 改了什么:权限集里某个汇总列的字段条目可以写 rollupSourceUnreadableReason: '理由',声明「这个集本就该看汇总、不看明细」;写了之后,这个集这一列的 security-rollup-source-unreadable 由 warning 降为 info 并引出理由,os lint --strict 不再因它失败。
  • 为什么改:这条规则自己说这种组合合法且常是有意的,但 --strict 把 warning 判失败又没有确认办法;HotCRM(账户下挂发票与收款)只能二选一:给子对象开读权限(放开所有行)或藏掉总额。键名与落位由席位定(6943835606)。
  • 风险与回滚:纯新增可选键,运行时不读它。但理由只能写在字段条目上,条目本身在字段合并里投 readable: true 一票(最宽者胜):原本没有该列条目的集为挂理由新加条目,会让同时持有屏蔽集的用户重新看到这一列,文档与 describe 已写明。空白理由、readable 非 true 旁带理由在解析时拒收。回滚即撤回本 PR。
  • 先看:packages/spec/src/security/permission.zod.ts 新键与第二个 .refine;packages/lint/src/validate-rollup-source-visibility.ts 的 acknowledgedReason。
  • 两分钟验证:pnpm --filter @objectstack/lint exec vitest run src/validate-rollup-source-visibility-acknowledged-34664.test.ts,预期 9 例全绿。
  • 需要你做的:用 os-zhuang 审读并批准(spec 面,按 Tier H 交人)。契约复审 PASS 6945683949,钉在 Head-sha b61b6d75111e8747f7fcfec1abfb3703cf1a535d。批准在案后由席位翻 ready,经合并队列落地。

席位意见:同意合并。给有意的「只看汇总」一个声明式出口,比让作者放开明细或藏掉总额更安全;副作用(条目投一票)已写进文档。

席位核对

  1. 形态:14 个文件,+377/−13,Fixes #34664;Clause-②: yes (widening),Metadata-protocol: added,Skills-docs: follow-up #34742。spec 面 ⇒ Tier H。
  2. 前提实测:main 上该规则对此组合恒报 warning,--strict 失败,无确认键(卡上复现)。
  3. 门禁 check-runs:head b61b6d75 上 72 条,59 绿、12 跳、1 取消(PR-body guards 被同 head 后一次运行取代,后者绿)、0 红。
  4. 接受的偏差:L1-a2 ACCEPT 6946360676;契约复审首审 6945332987 的 S1 已在本 PR 补文案,delta PASS 6945683949。
  5. 范围外去向:S2(控制台权限矩阵编辑器留下或丢掉理由)立 console permission matrix: turning Read off leaves rollupSourceUnreadableReason behind (refused shape) and the bulk shortcut drops it silently #34786;技能文档 skills: teach rollupSourceUnreadableReason beside security-rollup-source-unreadable (follow-up of #34664) #34742。
  6. 落地条款:os-zhuang 授权批准在案后,席位翻 ready,经合并队列落地;合并即关 lint: security-rollup-source-unreadable is advisory ("the pair is legal and is often meant") but has no way to acknowledge a meant pair, so os lint --strict forces either a widened child read or a hidden total #34664。

@github-actions

Copy link
Copy Markdown
Contributor

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

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

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

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

  • Dogfood Regression Gate (2/3) — 失败步骤: Boot example apps and exercise real user flows

    @objectstack/dogfood:test:  FAIL   isolated  test/activity-text-predicate.dogfood.test.ts > [#21154] a query over activity text or the approval snapshot, by a reader withheld a field of its record > a
      ↳ 失败原因: (这条 FAIL 之后 12 行内没有可识别的原因行 —— 点进 job 看)
    @objectstack/dogfood:test:  FAIL   isolated  test/activity-text-predicate.dogfood.test.ts > [#21154] a query over activity text or the approval snapshot, by a reader withheld a field of its record > a
      ↳ 失败原因: (这条 FAIL 之后 12 行内没有可识别的原因行 —— 点进 job 看)
    @objectstack/dogfood:test:  FAIL   isolated  test/activity-text-predicate.dogfood.test.ts > [#21154] a query over activity text or the approval snapshot, by a reader withheld a field of its record > a
      ↳ 失败原因: @objectstack/dogfood:test: AssertionError: {"object":"sys_activity","records":[],"total":0,"hasMore":false}: expected 200 to be 403 // Object.is equality
    

↳ 失败原因 是判读的关键:超时(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,按失败测试文件聚合):

历史信号:

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

分诊清单:

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

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

Merged via the queue into main with commit 13057ce Nov 17, 2026
77 of 78 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-wq8blv branch November 17, 2026 12:45
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 pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue 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

3 participants