Skip to content

feat(security)!: View All and Modify All stop opening fields; viewAllFields is the one every-field bit - #37371

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

os-zhuang merged 17 commits into
mainfrom
claude/project-thread-o3bcge

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Alice · project thread

Fixes #36055

Draft. #37314 has merged (protocol 19, step19); this branch merged main and carries both halves: the 19 field-axis switch and the ADR-0087 conversion with ruling A's exclusions.

Maintainer quick read

  • From 19.0.0, View All (viewAllRecords) and Modify All (modifyAllRecords) widen records only. They cast no field vote. viewAllFields is the only "every field" channel: read only, never edit, and a set's own readable: false row beats it.
  • Error direction: an unconverted set sees fewer fields, never more. No hidden field opens.
  • Stored permission sets (Studio-saved) are read with the 19 meaning, never rewritten (ruling A, comment 7177446075). Source sets get viewAllFields: true from os migrate meta --from 18 --write. Studio has no viewAllFields control today, so a stored set is fixed by adding viewAllFields: true through the metadata API; a review list of affected stored sets is follow-up os migrate meta --stored: list the stored permission sets whose View All / Modify All lost their field reach in 19 (follow-up of #36055 ruling A) #37375.
  • Beyond the card's premise: Modify All's cross-set EDIT re-open is lost too, because viewAllFields votes read only. That includes the built-in admin beside an app set's edit lock (it still reads every field). This is the ruled field-axis split (ruling 6912661484); the D3 entry names it.
  • Beside Modify All, a set's own field rows now bind on both halves: its own readable: false row hides that field from its holders even with viewAllFields: true, and its own field row without editable: true no longer edits it. The D3 entry's one-step check and the changeset state both, with the fix for each (delete the own hide row; write editable: true on the row).

What changes

  • @objectstack/core: superuserFieldVote is replaced by viewAllFieldsReadVote(sets, object, field). buildEffectiveFieldPermissions asks it. holdsSuperuserBypass is unchanged and answers the record bypass only.
  • @objectstack/plugin-security: getFieldPermissions asks the same vote. Explain drops the "superseded by the Modify All Data field vote" branch (and ConditionedFieldEntry.supersededBy): a row-conditioned lock binds per row for every caller.
  • @objectstack/lint: security-superuser-field-mask-inert is retired (constant, catalog text, explanation, export). security-cross-set-field-reopen reports only a hidden field another set's viewAllFields re-opens, in all 11 locales. The controlled-by-parent master-reference rule and the roll-up source-visibility rules no longer skip a mask beside Modify All.
  • @objectstack/scenarios: persona-grant scoring no longer treats Modify All as overriding a field lock.
  • @objectstack/spec:
    • viewAllRecords / modifyAllRecords / viewAllFields descriptions state the new meaning (generated reference docs regenerated). The liveness ledger anchors viewAllFields at #viewAllFieldsReadVote.
    • New ADR-0087 D2 conversion permission-view-all-fields-beside-record-bypass (packages/spec/src/conversions/entries/19/): writes viewAllFields: true on every objects entry, '*' included, that has viewAllRecords: true or modifyAllRecords: true and no viewAllFields (an authored viewAllFields: false is left alone). A default flip: retiredFromLoadPath: true, retiredAfter: '18.6.0', fixture with 3 notices. Registered in a new MAJOR_19_CONVERSIONS (the sorted { conversion, order } shape of major 18) as CONVERSIONS_BY_MAJOR[19]; step19.conversionIds derives from it.
    • New D3 semantic entry permission-view-all-modify-all-cast-no-field-vote (packages/spec/src/migrations/entries/semantic/): every behaviour change, ruling A's one-step operator check with both own-row cases beside Modify All (an own readable: false row keeps hiding its field after the bit is added; an own field row without editable: true loses the edit), the source and stored paths, and the error direction. It says where the conversion replays: the authoring funnel skips it (retired from the load path), and the artifact door and the stored-row seam refuse it by id. It judges the conversion's edits (conversionIds).
    • ADMIN_FULL_ACCESS_CAPABILITIES (identity/eval-user.zod.ts): the comment on its '*' viewAllFields: true states the 19 meaning (the bit, not the record bits, keeps the platform administrator reading every field; it votes read, never edit). Comment only.
    • Ruling A, stored rows: applyConversionsToStoredItem refuses the id by name (module-local STORED_ROWS_NOT_REWRITTEN, merged into any caller's excludeConversionIds), so the database loader, the ObjectQL stored-row read, the metadata-protocol read and os migrate meta --stored never rewrite a stored set.
  • @objectstack/metadata-core: the artifact-ingestion door refuses the id (DEFAULT_FLIPS_NOT_REPLAYED_HERE, docblock extended with its reason).
  • Showcase: showcase_auditor (four View All entries) and ops' showcase_announcement Modify All entry carry viewAllFields: true, migrated by hand; the access-matrix snapshot records the five grants (the build's ADR-0090 D6 drift check named them).
  • Docs: field-level-security, authorization, permissions-matrix and the showcase security tour describe the 19 meaning.
  • Changeset: names the conversion id (ADR-0087 marker), the one-step check with both own-row cases beside Modify All, the stored-set reading and the D3 entry; @objectstack/metadata-core added as minor.

Where the 19 upgrade guidance lives

  • D3 entry: packages/spec/src/migrations/entries/semantic/19.permission-view-all-modify-all-cast-no-field-vote.ts.
  • Generated guide: pnpm --filter @objectstack/spec gen:upgrade-guide writes content/docs/protocol-upgrade/19.md (gitignored, built by the docs site, served at /docs/protocol-upgrade/19): the conversion row and the D3 entry, both saying stored sets are read with the 19 meaning and the fix is viewAllFields: true.
  • Changeset: .changeset/36055-view-all-stops-voting-on-fields.md (ships as CHANGELOG.md).

Why

Card #36055, step 3 of the field-axis split (#34365, ruling of record 6912661484): View All / Modify All widen records, viewAllFields reads fields.

Tests

  • packages/spec/src/conversions/entries/19/permission-view-all-fields-beside-record-bypass.test.ts (10 tests): registration and step-19 wiring, the three rewrite sites and their notices, entries left alone, field rows untouched, idempotence, the authoring funnel never replays it, the stored seam refuses it for both row spellings and a caller cannot opt back in, a firing control, and other retired entries still replay over a stored permission row.
  • packages/metadata-core/src/artifact-forward-conversion.test.ts: a new block, six tests: refused inside the floor window, after the strict parse, inside the per-entry window and the major-step half; a shut window; a firing control.
  • packages/spec/src/shared/retired-key-removal-version.pin.test.ts: a semantic row kind joins a default flip to the D3 entry an author meets (a default flip has no tombstone or refusal); it reads the entry's reason and acceptanceCriteria, which name protocol 19 and --from 18.

Acceptance notes

  • Acceptance measurement (one-shot script, not committed): pre-PR sources under the v18 merge vs the same sources converted, under the v19 merge, every single set and every pair. Built-in default sets alone: 9 sets, 45 combinations, 507 field cells, 0 conversion notices (their '*' entries already carry the bit), read 507/507 and edit 507/507 identical. Showcase + default sets: 18 sets, 171 combinations, 1314 cells, 5 conversion notices; read 1314/1314 identical; edit 1302/1314, the 12 differences all ruled (admin_full_access / organization_admin beside showcase_contributor / showcase_client_liaison no longer edit showcase_project.budget / spent / budget_remaining, which those sets lock). CRM + default sets: 11 sets, 66 combinations, 663 cells, all identical. No cell opened a field or an edit. The conversion of the pre-PR showcase source equals the branch's hand migration on all 9 sets. Control: an unconverted View All set beside a set hiding a field reads it under v18 (readable: true) and not under v19 (readable: false).
  • Other seams checked: the flow-only exclusions (CONVERSIONS_NOT_REPLAYED_AT_REHYDRATION, FLOW_FALLBACK_VERDICT_NOT_REPLAYED) never see a permission set; every stored-row caller (database loader, ObjectQL, metadata-protocol, os migrate meta --stored, translation and datasource rows) goes through applyConversionsToStoredItem; the only other includeRetired caller is the artifact door. No seam outside the two edited ones replays this id.
  • Mechanical consequences outside the card's listed surface, all test or fixture data: the major-18 fixture permission-modify-all-allow-delete-false-to-true carries viewAllFields: true beside its Modify All entries so the fixture table stays disjoint; scripts/conversions-major18-merge.test.ts reads major 18's slice of ALL_CONVERSIONS instead of its tail; the retired-key pin row above; the showcase access-matrix snapshot.
  • Ablation (one-shot): removing the id from STORED_ROWS_NOT_REWRITTEN turns 3 stored-seam tests red; removing it from DEFAULT_FLIPS_NOT_REPLAYED_HERE turns 4 door tests red; both restored byte-identical to HEAD (blob hashes matched, git diff HEAD empty). The first stored-seam attempt was refused by the replacement tool (its marker already occurred in the file) and changed nothing; it was rerun with a distinct marker.
  • The major-step leg of the door block expects authored-current while the permission flip is step 19's only retired entry: the refusal leaves nothing for that half to open.

Verification

Head 71a5990 is a text-only round on bad558d (the Contract review's S1, N1 and N2: the D3 entry, the changeset and one code comment). Nothing that runs changed, so the readings at bad558d below stand; this round's local runs are in the first block.

Fix round at 71a5990
  • @objectstack/spec build (lock VERDICT command-exit 0), then check:generated --fix: exit 0, all 14 generated artifacts up to date, nothing rewritten.
  • gen:upgrade-guide exit 0 (content/docs/protocol-upgrade/19.md carries the new criteria; gitignored), gen:spec-changes exit 0 (gitignored); no tracked file changed.
  • @objectstack/spec vitest run src/migrations/ scripts/upgrade-guide-docs.test.ts scripts/upgrade-guide-surface-span.test.ts src/shared/retired-key-removal-version.pin.test.ts src/identity/platform-admin-capabilities.test.ts: 9 files / 305 tests green (lock VERDICT command-exit 0).
  • Gates for the three touched files, exit 0: check-adr-0087-registration --base origin/main, check-changeset-no-major, check-empty-changeset, check-closing-keyword-parity, check-issue-citations, check-drift-comment, check:changeset-fixed, check:doc-authoring, check:keyed-text-bounds, check:closed-ceremony-text, check:corpus-claim-drift, check:role-word, check:nul-bytes, check:spec-docblock-symbol-anchors, check:adr-anchors, check:issue-citations, check:upgrade-guide, check:spec-changes, check:liveness. Exit 1, expected and unchanged: check:adr-symbol-anchors, the one ADR-0066:146 finding below. The other derived families were not rerun this round (declared narrowing); CI runs the full set.

Local on bad558d (the affected tests, the derived gate families and the dogfood battery; the rest is cited from CI on the same head):

Tests
  • @objectstack/spec vitest run --project local: 901 files, 28514 passed and 1 failed before the retired-key pin row (permission-view-all-fields-beside-record-bypass unjoined); after the row, src/conversions, src/migrations and the pin: 29 files / 1072 tests green; scripts/conversions-major18-merge.test.ts green.
  • @objectstack/metadata-core test: 27 files / 1070 tests green.
  • @objectstack/cli vitest run --project unit migrate: 44 files / 449 tests green (the integration tier is CI's).
  • After the merge with main: @objectstack/core src/security 75 files / 1493 tests green; @objectstack/lint 236 files / 9658 tests green. @objectstack/plugin-security and @objectstack/scenarios are cited from CI (Test Core success).
  • typecheck: @objectstack/spec and @objectstack/metadata-core green.
  • Ablation: stored seam 3 red, artifact door 4 red, each restored byte-identical (see Acceptance notes).
  • Dogfood battery (pnpm --filter @objectstack/dogfood test, lock VERDICT command-exit 0): 488 passed and 3 skipped of 491 files; 4137 passed and 68 skipped of 4205 tests.
Gates
  • node scripts/pm/dispatch-gates.mjs --commands: 132 families derived at bad558d; --ran reconciliation: 132 accounted, 128 run, 4 NOT MEASURED, 0 unrun.
  • 127 exit 0, among them check-adr-0087-registration (green now that the id is registered), @objectstack/spec check:generated, check:spec-changes, check:upgrade-guide, check:api-surface, check:authorable-surface, check:docs, check:liveness, check:type-check-debt, check:nul-bytes, check:platform-checklist, check:doc-security-posture.
  • Red, outside this surface (exit 1): check:adr-symbol-anchors on docs/adr/0066-unified-authorization-model.md:146, which anchors effective-object-permissions.ts#superuserFieldVote. docs/adr/** is out of this PR's surface; the anchor re-points to #viewAllFieldsReadVote in the ADR PR of weekly card ADR revisions, week of 2026-11-25: rolling checklist of ADR text out of step with main (one governed PR) #37245, which merges before this PR leaves draft.
  • NOT MEASURED (exit 3, prerequisite refused): check-plugin-teardown-shape --self-test (shallow clone), check:skill-examples, check:dual-build-cjs-loads, check:published-readme-exports (packages outside this diff not built here). CI runs them.
  • pnpm --filter @objectstack/spec gen:upgrade-guide writes content/docs/protocol-upgrade/19.md with the conversion row and the D3 entry.
  • CI at bad558d: 58 success, 10 skipped, 2 failure: Lint & Repo Gates and Lint · docs & code guards, whose log names the one check-adr-symbol-anchors finding above and nothing else. TypeScript Type Check, Test Core, Build Core success.

Clause-②: yes (narrowing)
Metadata-protocol: semantic

Skills-docs: follow-up #37374

ADR-0066 D2 ⑧ end-state note (text for the weekly ADR card #37245)

Note (19.0.0): View All and Modify All cast no field vote (#36055, step 3 of the field-axis split #34365, ruling of record 6912661484). A set's viewAllRecords or modifyAllRecords on an object widens which records it reaches and casts no vote in either field merge. The one object-wide field vote is viewAllFields: readable: true on every field of the object, never editable: true, and a set's own explicit readable: false row on a field beats its own bit (the note of 2026-11-15, now carried by viewAllFields alone). Both merges ask one function, packages/core/src/security/effective-object-permissions.ts#viewAllFieldsReadVote. Consequences: a set's own field rows bind beside its own View All or Modify All; another set's View All or Modify All re-opens no hidden or locked field; nothing re-opens a field edit lock across sets (the built-in admin sets read every field through their '*' viewAllFields and no longer edit a field another held set locks). The ADR-0087 conversion permission-view-all-fields-beside-record-bypass adds viewAllFields: true beside the bits in source; it is a default flip, refused by id at the artifact door and at stored-row reads, so stored sets take this meaning on upgrade (ruling A on #36055). security-superuser-field-mask-inert is retired; security-cross-set-field-reopen reports the viewAllFields re-open only.

Follow-ups to file

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_011y7As8b4YLdvodeGAQWNTQ

@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 26, 2026
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 6 package(s): @objectstack/core, @objectstack/lint, @objectstack/metadata-core, @objectstack/plugin-security, @objectstack/scenarios, @objectstack/spec, touching 49 documentable anchor(s). ⚠️ 5 changed file(s) yielded no anchor (packages/core/src/security/index.ts, packages/lint/src/index.ts, packages/plugins/plugin-security/src/agent-ceiling-clamp.ts, …), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

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

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

What this run could not see
  • 5 changed file(s) yielded no anchor (packages/core/src/security/index.ts, packages/lint/src/index.ts, packages/plugins/plugin-security/src/agent-ceiling-clamp.ts, …) — pages documenting those are invisible to this run
  • 15 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 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; 124 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 — 186 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 87af66e5b6c75af7989ecbdc8820f1ca4a66596a → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json 87af66e5b6c75af7989ecbdc8820f1ca4a66596a

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

…iew All and Modify All

ADR-0087 D2 entry permission-view-all-fields-beside-record-bypass, a default
flip retired from the load path: replayed by os migrate meta --from 18 only.
The stored-row seam and the artifact door refuse it by id, so stored sets
take the 19 meaning. Step 19 graduates it and carries the semantic entry
permission-view-all-modify-all-cast-no-field-vote with the one-step check.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As8b4YLdvodeGAQWNTQ
…ll default flip by id

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011y7As8b4YLdvodeGAQWNTQ
… access-matrix snapshot

The showcase build's ADR-0090 D6 drift check named five grants this branch
added by hand (showcase_auditor on four objects, showcase_ops on
showcase_announcement); the snapshot now records them for review.

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-alice · session_011y7As8wf3DSPRevwNnYLcM

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 71a5990508df8fab8b150a87dafb72aa85c772ad
Local-runs: none
Scope: packages/spec/src/conversions/entries/18/permission-modify-all-allow-delete-false-to-true.ts, packages/spec/src/conversions/entries/19/permission-view-all-fields-beside-record-bypass.ts, packages/spec/src/conversions/registry.ts, packages/spec/src/conversions/stored.ts, packages/spec/src/identity/eval-user.zod.ts, packages/spec/src/migrations/entries/semantic/19.permission-view-all-modify-all-cast-no-field-vote.ts, packages/spec/src/migrations/registry.ts.template, packages/spec/src/security/permission.zod.ts + packages/core/src/security/effective-object-permissions.ts, packages/core/src/security/index.ts, packages/plugins/plugin-security/src/permission-evaluator.ts, packages/plugins/plugin-security/src/explain-engine.ts, packages/plugins/plugin-security/src/agent-ceiling-clamp.ts, packages/plugins/plugin-security/src/objects/default-permission-sets.ts, packages/metadata-core/src/artifact-forward-conversion.ts, packages/lint/src/validate-security-posture.ts, packages/lint/src/validate-rollup-source-visibility.ts, packages/lint/src/index.ts, packages/qa/scenarios/src/score/scenario-tags.ts, packages/spec/liveness/permission.json
Security-touching: yes
Rule-change-verified: none

Delta review of PR #37371 for card #36055, on top of record 7196108575 (PASS on bad558d574b997d7bc271793693fab55085331a4). Read: the diff bad558d574..71a5990508 (2 commits, 4 files, +29 −17), the four changed files whole at this head, the code they describe, the 55-path file list and the check-runs on this head. The file list grew by one path, packages/spec/src/identity/eval-user.zod.ts; it is a governed path, so hits is 8 paths, one more than the previous record. The other 35 paths stay the lane seat's ACCEPT at TIER_DEFAULT.

① Derived judgments

Nothing that runs changed since bad558d574. The delta is: prose in the changeset; a docblock bullet in the conversion entry; // comment lines in eval-user.zod.ts (the ADMIN_FULL_ACCESS_CAPABILITIES value is untouched); and the replacement, reason and acceptanceCriteria strings of the protocol-19 semantic entry (id, surface and conversionIds untouched). No accept-set, export, predicate or seam moved, so ①, ②, ③ and the file-by-file reading of 7196108575 stand for this head.

Check-runs on this head, read once after the last one completed: 74 runs, none pending. 59 success, 12 skipped, 1 cancelled, 2 failure.

  • The cancelled run is the first PR-body guards run, superseded; its re-run is success.
  • RED: Lint · docs & code guards (52 gates: 51 passed, 1 red, 0 did not run) and its aggregate Lint & Repo Gates (red on that one lane; every other lint lane success). The red gate is check:adr-symbol-anchors, 1 finding across 163 records: docs/adr/0066-unified-authorization-model.md:146 anchors packages/core/src/security/effective-object-permissions.ts#superuserFieldVote, the symbol this PR removes. The job log carries no other finding. Same red as on the previous head; see ③ E1.
  • Green on the new text: both Check Changeset runs, Test Core 10/10 and its aggregate, Test UI 16/16, all five type-check runs, Spec property liveness, Build Core, Build Docs, Check Documentation Links, Governed Surface Queue Guard.

② Semver level

Clause-②: yes — unchanged: the PR body and the changeset still carry Clause-②: yes (narrowing) and Metadata-protocol: semantic; the bump table of the changeset is untouched by the delta.

③ Boundary flags

④ Design judgment

S1: closed
N1: closed
N2: closed

No must-fix, no should-fix.

Each new sentence, held against the code at this head:

  • Own readable: false row beside Modify All (changeset FROM → TO and one-step check; entry replacement and acceptanceCriteria). "Beside View All that restores every read. Beside Modify All it does not restore a field the same set's own readable: false row hides." Right: viewAllFieldsReadVote skips a field for which declaresOwnReadMask is true, and before 19 only Modify All overrode an own row. The sentence "nothing else is needed for the read" is gone from the entry; the changeset limits it to View All. The remedy (delete the row) is correct.
  • Own field row without editable: true (changeset, entry replacement, reason item (2), acceptanceCriteria, conversion docblock bullet). Right: FieldPermissionSchema.editable is z.boolean().default(false), the merge counts an edit vote only on entry.editable === true, and nothing else votes an edit on a field some row names. "With no second set involved" is accurate. The remedy (an explicit editable: true row in the set that should edit) is the one grant the merge reads.
  • The criteria no longer contradict reason item (3); the three places (changeset, entry, conversion docblock) now say the same two own-row cases.
  • N1. Both texts now say the authoring funnel skips the conversion because it is retired from the load path, and that the artifact door (DEFAULT_FLIPS_NOT_REPLAYED_HERE) and the stored-row seam (applyConversionsToStoredItem, through STORED_ROWS_NOT_REWRITTEN) refuse it by id. Both names exist at this head and do what is said.
  • N2. The comment on ADMIN_FULL_ACCESS_CAPABILITIES now says the two record bits cast no field vote from protocol 19 and that viewAllFields keeps the administrator's read, "read, never edit: a field another set locks stays locked for a holder of both". That agrees with buildEffectiveFieldPermissions: the built-in set has no field rows, so on a field another set's row names it adds a read vote and no edit vote.

No new wrong statement found. One wording note, not graded: "hides the field from the set's holders" is said per set, as it was before the delta; a holder who also holds another set that reads the field still reads it, which is the ordinary union and is stated elsewhere in the entry.

Implemented-by: claude/project-thread-o3bcge
Reviewed-by: session_011y7As8wf3DSPRevwNnYLcM

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-alice · session_011y7As8wf3DSPRevwNnYLcM

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 25e18d4cdb16f02bba83aee105073c9a2e46e56f
Local-runs: none
Scope: packages/spec/src/conversions/entries/18/permission-modify-all-allow-delete-false-to-true.ts, packages/spec/src/conversions/entries/19/permission-view-all-fields-beside-record-bypass.ts, packages/spec/src/conversions/registry.ts, packages/spec/src/conversions/stored.ts, packages/spec/src/identity/eval-user.zod.ts, packages/spec/src/migrations/entries/semantic/19.permission-view-all-modify-all-cast-no-field-vote.ts, packages/spec/src/migrations/registry.ts.template, packages/spec/src/security/permission.zod.ts + packages/core/src/security/effective-object-permissions.ts, packages/core/src/security/index.ts, packages/plugins/plugin-security/src/permission-evaluator.ts, packages/plugins/plugin-security/src/explain-engine.ts, packages/plugins/plugin-security/src/agent-ceiling-clamp.ts, packages/plugins/plugin-security/src/objects/default-permission-sets.ts, packages/metadata-core/src/artifact-forward-conversion.ts, packages/lint/src/validate-security-posture.ts, packages/lint/src/validate-rollup-source-visibility.ts, packages/lint/src/index.ts, packages/qa/scenarios/src/score/scenario-tags.ts, packages/spec/liveness/permission.json
Security-touching: yes
Rule-change-verified: none

Delta review of PR #37371 for card #36055 after a merge of main, on top of records 7196108575 (PASS on bad558d574b997d7bc271793693fab55085331a4) and 7197145451 (delta PASS on 71a5990508df8fab8b150a87dafb72aa85c772ad). Since 71a5990508 the branch carries two commits: the merge fdadfa6785256bce54141fc871e6523a9c821c39 (parents 71a5990508 and main at d92684a7b231421e58ff6c1e23104040f5b39790) and 25e18d4cdb, a regeneration of content/docs/references/api/protocol.mdx. Read: the net diff of the old head against its merge base (1dd682c147) and of this head against its merge base (d92684a7b2), compared path by path; the merge commit; the 35 commits main gained between the two bases; and the check-runs on this head.

① Derived judgments

  • The reviewed diff is unchanged. Both net diffs list the same 55 paths, and for every one of the 55 the added and removed lines are identical between the two. No path entered or left the PR; hits and the implementing files are the ones named in 7197145451. The verdicts of ①, ②, ③ and ④ in the two earlier records therefore apply to this head line for line.
  • The merge changed nothing outside the PR's own paths: the tree of the merge commit differs from main at d92684a7b2 only in the 55 paths of the PR.
  • Two paths were changed by both sides, both merged without a conflict hunk:
    • packages/spec/src/migrations/registry.ts.template. main (fix(spec,test): unblock the 19 Version PR: open the major-19 registry regions, parse prerelease versions in the MCP save test, key the objectui pin claim on the spec major #37557) added the empty 19: regions to RETIRED_KEYS_BY_MAJOR and RETIRED_DEFS_BY_MAJOR at the end of the file; the PR changes the step19 docblock, rationale and conversionIds some 180 lines above. At this head both are present: conversionIds: CONVERSIONS_BY_MAJOR[19]!.map((c) => c.id), the retired-key:19 and retired-def:19 marker pairs, and the PR's hunk against main is the same hunk as before the merge. Nothing from either side is lost.
    • content/docs/references/api/protocol.mdx. The merge commit's copy lacks the ValidateDataIssue.scope rows and nested-shape table main had gained (11 lines; the rest of its difference from main is the PR's own five rows). 25e18d4cdb regenerates the file and restores exactly those 11 lines. At this head the file differs from main only in the PR's own five rows (viewAllRecords and modifyAllRecords twice, when once), each the .describe() text of permission.zod.ts at this head. Consistent.
  • retiredAfter: '18.6.0' on the major-19 conversion, re-judged because main moved the label: chore: version packages (next) #35129 (version packages) took @objectstack/spec from 18.6.0 to 19.0.0-next.0. The type's rule for a prerelease label is "the newest published stable release, which sits below x.y.z", never the label; under 19.0.0-next.0 that is 18.6.0, the value three major-18 entries on main carry too. The value stays right; the reason in 7196108575 ("stable label, not yet versioned") no longer describes the tree, the prerelease clause does. .changeset/pre.json is in pre mode, the PR's changeset is still an added file, and its major bumps are unchanged.

Check-runs on this head, read once: 70 runs, all completed. 60 success, 10 skipped, 0 failure, 0 cancelled, none pending.

  • GREEN now: Lint · docs & code guards and its aggregate Lint & Repo Gates, the two runs that were red on both earlier heads. See ③ E1.
  • Green as before: Check Changeset, Test Core 10/10 and its aggregate, Spec property liveness, Governed Surface Queue Guard, PR-body guards, every other lint lane.
  • The skipped runs include Queue verdict and Borrowed queue verdict; the PR is still a draft.

② Semver level

Clause-②: yes — unchanged from 7196108575 and 7197145451: the changeset and its bump table are byte-identical in the PR's net diff, Clause-②: yes (narrowing) and Metadata-protocol: semantic included.

③ Boundary flags

④ Design judgment

S1: closed
N1: closed
N2: closed

No must-fix, no should-fix.

The design judged in 7196108575 and re-read in 7197145451 is the design at this head: the same lines against a newer main. The one thing the merge could have changed without changing a line of the PR is a neighbour that reads the old vote; ③ lists the search and it found none.

Implemented-by: claude/project-thread-o3bcge
Reviewed-by: session_011y7As8wf3DSPRevwNnYLcM

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-alice · session_011y7As8wf3DSPRevwNnYLcM

席位意见:ACCEPT,交维护者合并。

席位核对 — ACCEPT · head 25e18d4 (2026-11-26T18:23Z)

  1. Shape: 55 files, inside the claim's surface (claim 7177278985 + amendment 7177446075) plus test/fixture data the dev named (major-18 fixture, major18-merge test, a pin row, access-matrix.json for the drift check). Fixes #36055. Clause-②: yes (narrowing); title carries !. Hand-off tier per check-governed-merges --pr 37371: size limb (3213 > 3000) and the narrowing declaration → maintainer merge, pm:awaiting-merge.
  2. Premise measured: the conversion is retiredFromLoadPath, in CONVERSIONS_BY_MAJOR[19] and step19.conversionIds; its id is refused at applyConversionsToStoredItem and in DEFAULT_FLIPS_NOT_REPLAYED_HERE, removing either id turns the pins red (report 7195860041). Field-map acceptance: defaults 507/507 and CRM 663/663 identical, showcase reads 1314/1314, 12 edit cells lost, all the ruled Modify All edit loss; no field or edit opened.
  3. Review: Contract review 7196108575 (PASS, S1) → delta 7197145451 (S1, N1, N2 closed) → merge delta 7199460014 at this head (PASS, No must-fix, no should-fix., net diff over the 55 paths identical to the reviewed one; E1 closed by docs(adr): ADR-0066's viewAllFields vote anchor names holdsViewAllFields #37621).
  4. Gates: at this head 60 success, 10 expected skip, 0 failed, 0 pending; floors green. l1-face: one flag, dogfood owed — answered: dogfood_battery: 25e18d4 · os-verify-lock VERDICT command-exit 0 · Test Files 488 passed + 3 skipped / 491 · Tests 4137 passed + 68 skipped / 4205 · no failures.
  5. Out of scope / follow-ups: skills: View All / Modify All no longer open fields in 19 — re-teach objectstack-ai pitfall 2 and the objectstack-data security eval (follow-up of #36055) #37374, os migrate meta --stored: list the stored permission sets whose View All / Modify All lost their field reach in 19 (follow-up of #36055 ruling A) #37375 (both open). The D2 ⑧ end-state half of row 7178404228 on ADR revisions, week of 2026-11-25: rolling checklist of ADR text out of step with main (one governed PR) #37245 after merge (should say viewAllFieldsReadVote replaced superuserFieldVote). hotcrm sales_manager follow-up owed after merge.
  6. Accepted deviations: 试行偏离 (fresh agent per round; no in-agent CI wait; local runs limited to the affected tests and ratchets, rest read from CI at this head; dev ran l1-face). Pause and resume on the maintainer's concurrency orders (2026-11-26T00:09Z, 2026-11-26T12:59Z).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#7 · os-alice · session_011y7As8wf3DSPRevwNnYLcM

维护者速读

Review request: contract review PASS 7199460014 and seat ACCEPT 7200419422, both on head 25e18d4cdb16f02bba83aee105073c9a2e46e56f (2026-11-26T18:24Z).

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 26, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 26, 2026 18:42
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit eb683b8 Nov 26, 2026
76 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-o3bcge branch November 26, 2026 19:43
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…es of each standard unit of measure (ADR-0158 U6) (objectstack-ai#37389)

<!-- claude-projects-attribution: {"github_login":"os-bill"} -->
_Requested by **Bill** · [project
thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wg8ZBQe4UHadd2fGHGeWRW9V)_

repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS

Fixes objectstack-ai#35498
Refs objectstack-ai#35339

Clause-②: yes (widening)
Metadata-protocol: none

## 维护者速读

- 管理员在设置的「配置」下、「计量单位」下面多一个「标准单位设置」页,可以给千克、克、件等国际标准单位各设一个显示小数位(比如珠宝行把克设成
3 位,砂石场把千克设成 0 位);所有成员都能看到这些设置,别的组织看不到。
- 这是「计量单位」第一期里你选的「组织可改,新开一处设置」那一项;数量按单位显示的卡片会读它,本改动本身还不改变任何页面上数字的显示。
-
只有组织管理员能新增、修改或删除,删除即清除;每次改动都记审计;组织里还留着设置时不能删除该组织,要先删掉设置,和汇率一样;可以直接撤回,因为还没有地方读取它。
- 需要你做的:无。

## What changes

- **`@objectstack/platform-objects`**: new organization-owned object
`sys_standard_unit_setting` (ADR-0158 U6; Open item 10 option A),
registered in the first manifest beside `sys_unit`.
- `code`: text, max 3. A format rule admits exactly the `STANDARD_UNITS`
codes in exact uppercase (`STANDARD_UNIT_SETTING_CODE_PATTERN`). Unique
per organization, immutable after create.
  - `decimal_places`: 0 to 12, scale 0, required.
- Field history on both columns. No tenancy opt-out, so
`organization_id` is injected.
- Setup → Configuration → Standard Unit Settings, directly under Units
of Measure, with all eleven nav labels translated. The translation
bundles are regenerated; the zh-CN object strings are translated.
- **`@objectstack/plugin-security`**:
  - `member_default` reads it (read only).
- `organization_admin` gets an explicit line: create, edit and delete.
Clearing a setting is deleting its row.
- **`@objectstack/spec`**: `sys_standard_unit_setting` joins
`PLATFORM_OBJECTS_BY_PACKAGE['platform-objects']`.
- **`@objectstack/cli`**:
  - The organization-ownership inventory lists the object as attributed.
  - The Setup nav count pin goes from 36 to 37.
- `scripts/platform-object-tenancy-census.json` is regenerated.

**Precedent: `sys_unit.decimal_places`.** The setting follows the same
concept as an org unit's own decimal places: range 0 to 12, field
history, member read, organization-admin write. The settings-key route
(ADR-0144 D4's `localization.currency`) was measured and not followed,
for four reasons. It is one org-wide scalar. Members read it only
through a server projection. Its audit keeps hashes, not values. A
per-code map would need a new settings column kind. The area approved
this on claim amendments 7178077326 and 7178144166.

**Deviations from the first shape, all on the card (amendments
7178077326, 7178144166, 7179529249):**
- **No reader in this PR (amendment 7178077326).** The display card
objectstack-ai#35490 adds the reader with its first caller, and the ADR-0158 L4 clamp
to the field's `scale` goes there. "A member can read them" is met by
`member_default` read over the data API.
- **Clear = delete, not set-to-null (amendment 7178144166).** An
organization delete refuses `DELETE_RESTRICTED` while any
organization-owned row remains. Only `sys_unit` is exempt, through the
engine's own cascade. So a row with no delete would block the
organization delete forever. This follows `sys_exchange_rate`'s posture:
an admin deletes the setting, then the organization delete goes through.
Pinned below.

**Why `code` is text plus a format rule, not a select.** A select's
option values are stored lowercase (`kgm`), while a unit code is stored
in exact uppercase everywhere (U4). The rule's pattern is built from the
`STANDARD_UNITS` keys, so a code the table gains is admitted with no
second edit.

First files to read, by risk:
1.
`packages/plugins/plugin-security/src/objects/default-permission-sets.ts`:
the two `sys_standard_unit_setting` lines.
2.
`packages/platform-objects/src/system/sys-standard-unit-setting.object.ts`:
the format rule and the immutable-code rule.
3.
`packages/plugins/plugin-security/src/default-permission-sets.standard-unit-setting.integration.test.ts`:
the tenancy posture it boots under.

Two-minute check: `pnpm --filter @objectstack/plugin-security exec
vitest run --maxWorkers=2
src/default-permission-sets.standard-unit-setting.integration.test.ts`
prints 15 passed. It boots a real stack under the `isolated` tenancy
posture. It shows each of these:
- an admin and an owner set, change and clear a setting, each act
landing in `sys_audit_log` with old and new values;
- an admin changes and deletes a setting the owner created, and the
owner one the admin created (the `organization_admin` line, no superuser
bits);
- a member reads, and is refused 403 `PERMISSION_DENIED` on every write;
- another organization's setting is never read, changed or cleared;
- a non-standard or lowercase code, an out-of-range value, a duplicate
code and a changed code are each refused;
- an organization delete refuses 409 `DELETE_RESTRICTED` naming this
object, and succeeds once the setting is deleted.

## Tests

**Rework round 1 (L1 7180149059, contract record 7180135740), head
`98cbc47602`.** S1: the changeset sentence and the object's docblock now
state the posture the isolation holds under (`isolated`; `single` raises
no wall, `group` walls by membership, ADR-0105 D1), and N1 says the
display card objectstack-ai#35490 *will* read the value. S2: new cases where an admin
and an owner each change and delete a setting the other created, plus
the effective-permission map (delete kept, no `modifyAllRecords`).
Affected tests re-run: the real-stack suite 15 passed (15), the
declaration suite 14 passed (14). Ablation of the `organization_admin`
line to `allowEdit: false, allowDelete: false` turned 8 of 15 red, the
new cross-creator cases among them; restored, with the blob equal to
HEAD and `git diff HEAD` empty.

All readings below are on head `03e453e3`, and the tree is
byte-identical to the commit.

<details><summary>Package suites and typecheck (under the verify
lock)</summary>

- `@objectstack/plugin-security`,
`src/default-permission-sets.standard-unit-setting.integration.test.ts`:
Test Files 1 passed (1), Tests 12 passed (12).
- `@objectstack/platform-objects`, full suite: Test Files 127 passed
(127), Tests 2176 passed (2176). This includes the new
`sys-standard-unit-setting.object.test.ts`.
- `@objectstack/cli` unit layer,
`src/utils/organization-ownership-inventory.test.ts` and
`test/connect-agent-both-halves-wire.pin.test.ts`: Test Files 2 passed
(2), Tests 28 passed (28). The CLI integration layer is left to CI.
- `@objectstack/spec`,
`src/system/constants/platform-object-names.test.ts`: Test Files 1
passed (1), Tests 14 passed (14).
- Typecheck of `platform-objects`, `plugin-security`, `cli` and `spec`:
run in one `set -e` batch that reached its last part, so each exited 0.
`platform-objects` reports `check:test-typecheck: OK`.
- The full `plugin-security` suite and `test:repo` are left to CI.

</details>

<details><summary>Ablation: the member read grant</summary>

- `node scripts/ablation-replace.mjs` changed `member_default`'s
`sys_standard_unit_setting` line to `allowRead: false`. Evidence: anchor
x1 → x0, blob `d4a112e3` → `87691407`.
- The suite went 2 failed | 10 passed. The member read test and the
cross-organization read test both failed with `PermissionDeniedError`.
- Restored: the blob equals HEAD (`d4a112e3`) and `git diff HEAD` is
empty.

</details>

## Acceptance notes

- **The cross-organization pins need the `isolated` posture.** Under the
default `single` posture no tenant wall stands, so another
organization's row is visible. That is ADR-0105 D1's design, and every
organization-owned object behaves the same way. The suite registers
`tenancy: { posture: 'isolated' }`, as a deployment with organizations
runs. The first run without it showed the other organization's row,
which is how this was found. The `sys_unit` suite pins no
cross-organization read.
- **External members get no read**, the same as `sys_unit`. The display
card objectstack-ai#35490 already owes what an external member sees (comment
7030066814).
- **No ADR text in this diff.** The ADR-0158 amendment (U3, U6 and L4
notes, and the Open item 10 answer) is drafted in the card report; the
area lands it as row 7179515770 on the weekly ADR revisions card objectstack-ai#37245
after this PR merges.
- **Locale fill.** zh-CN carries translated object strings. The other
nine locales carry the generator's English fill; nav labels are
translated in all eleven.

## Verification

<details><summary>Derived gate families (106 families, 212 commands) and
the --ran reconciliation</summary>

- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 212 commands from the tree at
`03e453e3`. Each was run, with its exit code captured before any pipe.
- 211 exited 0. Five of those first exited 3 because a build
prerequisite was missing: `check-plugin-teardown-shape --self-test`
needed an unshallowed clone, and `check:skill-examples`,
`check:dual-build-cjs-loads`, `check:i18n-coverage` and
`check:published-readme-exports` needed a full build. All five exited 0
after `git fetch --unshallow` and a full turbo build (122 of 122 tasks).
- `pnpm check:platform-checklist` exited 1 on one problem:
`areas/automation.json` cites `FlowItemMoreMenu.tsx#FlowItemMoreMenu`, a
symbol the `ui/` file no longer declares. That is the base tree's own
state: this diff touches neither `ui/` nor `docs/qa/`, and the cited
file is the same on `origin/main`.
- `--ran` printed: "106 derived famil(ies) accounted for — 106 run, 0
NOT-MEASURED (a DERIVED zero — all 106 recorded an exit code and none of
them is 3)".

</details>

<details><summary>Overlap check</summary>

- `node scripts/pm/overlap-check.mjs --branch=HEAD` against origin/main
`02520ab480` printed "VERDICT clean exit 0". Two open PRs share a file,
objectstack-ai#37371 (`default-permission-sets.ts`) and objectstack-ai#37366
(`platform-objects/src/plugin.ts`); both merge cleanly with this branch.

</details>

<details><summary>Not measured locally</summary>

- The CLI `integration` layer, `test:repo`, the full `plugin-security`
suite and the repo-wide lint are left to CI.
- Dogfood: n/a. The title has no `!`, and Clause-② is a widening.

</details>

---

🤖 Generated with [Claude Code](https://claude.com/claude-code)

_Generated by [Claude
Code](https://claude.ai/code/session_01Utp6CXM7nqtiQ3M9JqGAqL)_

<!-- signed: repo:objectstack#5 · os-bill ·
session_01Utp6CbdHk3orAeensH6EzS -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
… can never offer (objectstack-ai#37382)

<!-- claude-projects-attribution: {"github_login":"os-bill"} -->
_Requested by **Bill** · [project
thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wg8ZBQe4UHadd2fGHGeWRW9V)_

repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS

Fixes objectstack-ai#36714
Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: follow-up objectstack-ai#35769 (row 7178935378:
skills/objectstack-data/rules/relationships.md, the three lint refusals)

## 维护者速读
-
用户能看到什么变化:应用作者在命令行校验、构建或检查应用时,若关联字段声明了「变更负责人时连带转移」而这种转移永远不会发生(父对象不提供变更负责人、经对象扩展加到不支持它的对象上、或子对象的接口不允许更新),现在会直接报错并写明怎么改;最终用户无感,运行时行为不变。
- 为什么做:数据模型专区「声明了就要生效」的收尾,替变更负责人连带转移功能补上作者期的提醒。
- 出错会怎样:若判断有误,作者的应用会在命令行校验时被误拦,改字段或对象即可通过;不影响已部署的应用和工作室保存,可直接撤回。
- 要你做什么:无。

## What changes

A `transferBehavior: 'cascade'` that the Change Owner endpoint can never
offer used to parse silently (ADR-0049, declared but not enforced). One
new `@objectstack/lint` rule, `validateTransferCascades`, refuses each
of the card's three cases at `error`, with the fix in the hint:

| Rule id | Case | Verdict from (spec, `@objectstack/spec/data`) |
|:---|:---|:---|
| `transfer-cascade-parent-without-change-owner` | 1: the reference
points at a parent in the stack that does not offer Change Owner |
`resolveUserActionTransfer` + `transferIneligibilityReason` (what the
endpoint's `changeOwnerOffReason` asks) |
| `transfer-cascade-extension-child-ineligible` | 2: an
`objectExtensions[].fields` field cascades onto an object that cannot
take a cascade | `transferCascadeIneligibilityReason` (what
`refuseIneligibleTransferCascades` and `transferCascadeRelations` ask) |
| `transfer-cascade-child-update-unexposed` | 3: the child's `enable`
block does not serve `update` | `apiExposureDenialReason`
(`canServeApiOperation` is its boolean face, the exposure filter in
`transferCascadeRelations`) |

- `packages/lint/src/validate-transfer-cascades.ts`: the walk only.
Objects are judged as served (`objectsAsServed`, every extension field
folded in), since `transferCascadeRelations` reads the registered,
merged definitions. An object the stack does not declare is skipped on
either side. Only single-value `lookup` / `master_detail` fields are
judged; off-type, multi-value and `sys_`-parent cascades stay the field
parse's refusals and are not reported twice.
- Registered in `authoring-rules.ts`: `gating`, all three commands,
`surfaces: CLI_ONLY` with a `surfaceReason` (see Acceptance notes).
Exported from the barrel (rule ids included), and the three ids have `os
explain` entries in `rule-explanations.ts` (inserted, not reordered).
-
`packages/spec/src/migrations/entries/semantic/18.transfer-cascade-never-offered-refused.ts`:
the ADR-0087 ledger entry `check:adr-0087-registration` requires for a
`Metadata-protocol: narrowed` changeset. It is a data file, not a schema
change.
- Docs: one sentence in `content/docs/api/data-api.mdx` beside the
existing multi-value refusal, and the CLI transcripts' author-time rule
count 79 → 80 (`check:docs-transcript-drift`).
- Changeset: `@objectstack/lint` minor, `@objectstack/spec` minor (the
kind is `narrowed`).

Mechanism assumptions measured at `origin/main` 98bda0a before code: A1
holds (the predicates are exported from `@objectstack/spec/data`; lint
imports them the way `validate-managed-api-methods.ts` does, no third
copy). A2: `error`, following `validateManagedApiMethods` (a declaration
decidable from the stack that the runtime silently drops) and the
parse's own refusal of the declaring object's half. A3 holds
(`child.enable` through the exposure predicate). A4: the two
`validate-predicate-path-refs.test.ts` pins count form predicates, not
registry entries; nothing moved.

Files to read first, by risk:
1. `packages/lint/src/validate-transfer-cascades.ts` —
`validateTransferCascades`, the served-object lookup and the `sys_` /
not-declared skips.
2. `packages/lint/src/authoring-rules.ts` — the new entry's tier and
`surfaceReason`.
3.
`packages/spec/src/migrations/entries/semantic/18.transfer-cascade-never-offered-refused.ts`.

## Tests

`packages/lint/src/validate-transfer-cascades-36714.test.ts`: every
fixture is a full `ObjectSchema` / `ObjectExtensionSchema` parse, so
each refusal is one the parse lets through. Each case is refused with
its rule, severity, `where`, `path` and the reason fragment its message
names; each eligible shape passes (an eligible parent, a parent outside
the stack, a `sys_` parent, an eligible extension target, a target
outside the stack, `update` served); the `packages[]` artifact shape is
read; and the `fieldPatches` arm is pinned as refused by the schema.

<details><summary>Local runs at 3e1fa4a (lint, spec,
ablation)</summary>

- `pnpm --filter @objectstack/lint test`: Test Files 236 passed (236),
Tests 9648 passed, 5 skipped (VERDICT command-exit 0).
- `pnpm --filter @objectstack/lint typecheck`: VERDICT command-exit 0.
- `pnpm --filter @objectstack/spec test`: Test Files 894 passed, 1
skipped (895), Tests 28417 passed (VERDICT command-exit 0).
- `pnpm --filter @objectstack/cli exec vitest run
test/migrate-meta-engine-guidance.test.ts`: 3 passed.
- Ablation (rule committed first): `scripts/ablation-replace.mjs`
replaced the walk's `for (const site of cascadeSites(stack))` with an
empty loop, x0 -> x1 on disk; the card's test file went 15 failed, 9
passed (24). Every refusal case red, every pass case green. Restored:
blob == HEAD, `git diff HEAD` empty.

</details>

## Acceptance notes

- The `Clause-②:` line carries the `(narrowing)` arm (body and
changeset, commit 8737482): Check Changeset reads `Metadata-protocol:
narrowed` beside a clause line without the arm as a contradiction. The
claim's `Clause-②: no` was copied first, at 3e1fa4a.
- Premise, partly narrower than written: case 2's `fieldPatches` arm
cannot occur. A field patch carries display properties only (`label`,
`description`, `inlineHelpText`, `placeholder`), and
`ObjectExtensionSchema` refuses `transferBehavior` there as an
unrecognized key, so the rule walks extension `fields` only; a test pins
the refusal.
- Not on the runtime publish gate yet (`surfaces: CLI_ONLY`): the door's
objects are served definitions carrying the injected `owner_id` as a
declared field, which the eligibility predicate reads (its `readonly`,
and on an external object whether it is declared). Crossing owes that
measurement or a read-back to the authored shape, as
`lintDuplicateFieldLabels` does. Until then a Studio or MCP save of
these shapes still passes. The runtime stays safe.
- Boundary: a cascade on a field an object declares itself, where only
an extension makes the served object ineligible, is not reported as case
2 (the card scopes case 2 to extension fields; the object's own half is
the parse's).
- File surface: the ADR-0087 ledger entry under
`packages/spec/src/migrations/entries/semantic/` is outside the claim's
listed surface. `check:adr-0087-registration` requires it for
`narrowed`; it changes no schema and no runtime.
- First-party exposure: zero. No example app, platform object, skill or
docs sample declares a cascade.
- Other open PRs that add an author-time rule (objectstack-ai#37354, objectstack-ai#37371) move the
same transcript count; whichever lands second gets a one-number docs
conflict or a `check:docs-transcript-drift` red.

## Verification

Two-minute check: `pnpm --filter @objectstack/lint exec vitest run
src/validate-transfer-cascades-36714.test.ts` prints 24 passed.

<details><summary>Gates: local derivation and reconciliation</summary>

`node scripts/pm/dispatch-gates.mjs --ran` at 3e1fa4a: 117 derived, 113
run, 4 NOT-MEASURED, 0 UNRUN. All 113 run exited 0. NOT-MEASURED, left
to CI:
- `check:type-check-debt`: the 300 s local timeout fired (repo-wide tsc
census).
- `check-plugin-teardown-shape.mjs --self-test`: shallow checkout.
- `spec check:skill-examples`: its client SDK surface reads
`packages/client-react` dist, not built locally.
- `check:dual-build-cjs-loads`: reads every workspace dist.

Outside the derivation, local-only: `check:dev-prereqs` exit 1, because
104 of 110 workspace packages are unbuilt in this container (machine
state, not this diff).

</details>

🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- signed: repo:objectstack#5 · os-bill ·
session_01Utp6CbdHk3orAeensH6EzS -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…-version pin, so Save to this view never publishes a moved draft (objectstack-ai#37387)

Fixes objectstack-ai#36350

Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: none — `skills/**` teaches no per-item metadata publish
request: 0 hits over `skills/` for a `/meta/…/publish` route,
`PublishMetaItem`, `publishMetaItem`, `draftVersion` or `parentVersion`
(the one `If-Match` hit is the data `PATCH` route's optimistic lock).

## 维护者速读

-
用户能看到什么变化:管理员点「保存到此视图」时,若另一位管理员恰好在同一视图上改名、置顶或设为默认,这次发布会被拒绝,别人尚未审过的草稿不会被顺带发布;草稿栏的「发布」也只发布它显示的那份草稿。
- 为什么做:维护者已裁定「别人尚未发布的草稿绝不替他发布」,此前实测这个空窗仍可复现,本次按维护者选定的方案在发布入口统一加草稿版本校验。
-
出错会怎样:最坏情况是本应成功的保存或发布被误拒并提示冲突,草稿原样保留、不丢数据;「保存到此视图」可直接再存一次,草稿栏的「发布」需重新打开视图设置、看过最新草稿后再发布;改动可整体撤回。
- 要你做什么:无。

## What changes

Ruling 7168616260 (A1) on objectstack-ai#36350, executed as ruled:

- **Spec** — `PublishMetaItemRequestSchema` gains one optional member,
`draftVersion`: the version token of the draft the caller wrote or read
and means to publish; its describe says the draft is judged first and
that an address refusal (`404 NO_DRAFT`) precedes both pins.
`parentVersion` (`If-Match`) keeps its shipped meaning, the active row's
token; its describe now points at the draft's own pin.
`MetadataConflictErrorSchema` names the draft pin: on the publish door a
refused `draftVersion` returns the draft's token, sent back as
`draftVersion`, never as `If-Match`, and `null` there means nothing is
pending to publish. The publish route's declaration in
`plugin-rest-api.zod.ts` lists the 409 causes, both body read keys and
the new 400. Generated reference
(`content/docs/references/api/protocol.mdx`) and
`authorable-surface/api.json` regenerated by the build /
`check:generated --fix`.
- **Protocol**
(`packages/metadata-protocol/src/protocol-history-and-publish.ts`) —
`promoteDraftForPublish` judges `draftVersion` against the draft row it
just read, before any authoring rule judges that draft, with the save
door's keyed comparison (`storedParentForToken`). A moved draft, or a
pinned draft no longer pending, is refused `409 METADATA_CONFLICT` with
`currentVersion` = the draft's current token (`null` when none), nothing
promoted, and the same optimistic-conflict audit row as the other
publish conflicts. An off-type `draftVersion` from an in-process caller
is refused `400 VALIDATION_ERROR`, never read as unpinned.
`PublishMetaItemRequest` (`protocol-door-requests.ts`, the public
`publishMetaItem` type) now declares `draftVersion` and `parentVersion`.
The existing `expectedDraftHash` keeps the promotion locked to that row
through the write. The conflict-to-refusal mapping moved into one local
helper shared by the pin and the promotion's own `catch` (same text and
audit as before for the existing two conflicts).
- **REST door** (`packages/rest/src/meta-item-history-routes.ts`) —
`POST /meta/:type/:name/publish` reads `draftVersion` from its body
beside `message` and forwards it when present; a present non-string is
refused `400 VALIDATION_ERROR`, never read as absent.
- **Client** (`ui/packages/data-objectstack`) — `MetadataClient.publish`
takes `draftVersion` and sends it in the body.
`ObjectStackAdapter.updateView`'s draft branch reads the draft through
`getDraft` (the envelope carries `version`) BEFORE the layered read it
merges from, and writes pinned to it (`If-Match`, or `If-None-Match: *`
when the read saw no draft).
- **Console** (`ui/packages/app-shell/src/views/`) — "Save to this view"
(`saveAndPublishRuntimeMetadata`) passes the version its own draft write
returned; a moved draft's `409` resolves `'pending-draft'` and the moved
draft is NOT discarded (it now holds the other writer's change); a `409`
with `currentVersion: null` (the draft was published or discarded by
someone else) rethrows, since there is no draft to review. The runtime
draft bar's Publish (`publishRuntimeMetadata`) passes the draft token
the bar shows: on open, the one its draft read
(`readRuntimeDraftForPublish`, through `getDraft`) returned; after its
host's own save, that save's receipt version, which the view settings
panel hands it as `savedDraftVersion` from its draft-version guard
(`useDraftSaveGuard().heldDraftVersion`). Never a blind re-read.

Absent `draftVersion` is unpinned everywhere, as before.

## Why

Measured on main before any code (report 7164597391, re-run on the
merged tree here): "Save to this view"'s draft write, then an
`updateView`-style draft write, then the publish pinned with the only
pin main offered (`If-Match` on the active row) answered 200 and
published the interleaved draft. Ruling 7058616478 (objectstack-ai#35955): an
unpublished draft is never published on someone else's behalf.

## Tests

- Acceptance pin, in the publish door's existing harness
`packages/rest/src/meta-item-publish-version-pin.test.ts` (new top-level
describe, ruling record 6583487846), real stack at the HTTP door:
- an `updateView` draft write (pinned, and unpinned) interleaved between
Save's draft write and its publish: refused `409 METADATA_CONFLICT`,
`currentVersion` = the moved draft's token (parsed by
`MetadataConflictErrorSchema`), active row unchanged, moved draft still
pending;
- control: no interleave, the pinned publish promotes; absent member:
unpinned as before; pinned draft no longer pending: `409`,
`currentVersion: null`; a draft token sent as `If-Match` still answers
the active row's refusal; non-string `draftVersion` (number, null,
object): `400 VALIDATION_ERROR`, nothing promoted; in process, an
off-type `draftVersion` is refused `400` by the protocol; the acceptance
refusal writes one `publish` / `denied` `metadata_conflict` audit row.
- The measurement file
`meta-item-publish-draft-interleave-36350.test.ts` is removed: its M1 is
now the acceptance pin above; M0 (token identity) is asserted there
(`readDraft().version` equals the receipt and the refusal's
`currentVersion`); M2 and M3 measured options B-extended and C, which
the ruling did not take, and their readings stay recorded in report
7164597391.
- Spec: `protocol.test.ts` pins `draftVersion` preserved through parse,
absent stays absent, non-strings refused.
- Client / console: `updateView.draft.test.ts` (new describe: `If-Match`
from the draft read, read before the layers; `If-None-Match: *` when the
read saw none; a `409` reaches the caller; no version pins nothing),
`metadata-client.publishPackageBinding.test.ts` (body carries
`draftVersion` beside `message`; omitted, no key),
`runtime-metadata-persistence.test.ts` (Save passes its receipt's
version; a moved draft resolves `pending-draft` and is not discarded;
`currentVersion: null` rethrows; draft bar passes the shown token),
`RuntimeDraftBar.test.tsx` (Publish sends the shown version; refusal
keeps the bar; after the host's own save the Publish is pinned to that
save's receipt version with no re-read; the save-then-publish window
refuses another writer's draft; a host with no receipt version stays
unpinned), `ViewConfigPanel.pinnedDraftSave-36137.test.tsx` (each landed
save hands the bar its own receipt version). Four existing draft-bar /
`updateView` doubles now answer `getDraft` and the drafts ledger.

<details><summary>Readings (head a0b4863; first round at
8cee422/8eee7080 in report 7179271525)</summary>

- `pnpm --filter @objectstack/rest exec vitest run
src/meta-item-publish-version-pin.test.ts` — `Tests 18 passed (18)`
(adds the in-process off-type pin and the audit-row assertion).
- Ablation, door check (round 1): the `draftVersion` check mutated,
metadata-protocol rebuilt, marker in `dist/`: `Tests 3 failed | 14
passed (17)`; restored blob == HEAD, rebuilt, `--absent` clean: `17
passed`.
- Ablation, bar pin after the host's save (this round, source-resolved
UI test, no build leg): `shownDraftVersionRef.current =
savedDraftVersion;` replaced via `scripts/ablation-replace.mjs` (blob
`da8e79d7` -> `e00baf11`): `RuntimeDraftBar.test.tsx` `Tests 2 failed |
11 passed (13)` (the after-save pin and the save-then-publish window);
restored, blob == HEAD, `git diff HEAD` empty.
- `pnpm --filter @objectstack/spec test` — `Test Files 895 passed
(895)`, `Tests 28420 passed | 1 todo`.
- `pnpm --filter @objectstack/metadata-protocol test` — `Test Files 370
passed | 9 skipped (379)`, `Tests 23435 passed | 45 skipped`.
- `pnpm --filter @objectstack/rest test` — `Test Files 429 passed
(429)`, `Tests 8852 passed | 351 skipped`.
- `ui` (`vitest run`): the draft-bar, persistence, view-settings and
report files plus all of `packages/app-shell/src/views/metadata-admin/`
— `Test Files 810 passed (810)`, `Tests 8717 passed | 1 skipped`.
`packages/data-objectstack/` (unchanged this round) — `127 passed` in
round 1. The full `packages/app-shell/` suite was not re-run this round;
`Test UI` carries it.
- Typecheck: `@objectstack/spec`, `@objectstack/metadata-protocol`,
`@objectstack/rest` `typecheck` and `@object-ui/app-shell` `type-check`,
chained with `&&`: `VERDICT command-exit 0`.

</details>

## Acceptance notes

- Where the draft pin is judged: right after the promotion's draft read,
before the authoring rules judge that draft, so a moved draft answers
the conflict rather than a rule refusal about someone else's body. The
active-row pin (`parentVersion`) is still judged where objectstack-ai#36601 put it,
inside the promotion.
- "Save to this view" on a moved draft resolves `'pending-draft'` (the
same answer as over a draft found pending before its write) and leaves
the draft for review. That draft holds this save's body with the other
writer's change on top; it is not discarded because it is no longer this
call's own.
- `updateView` now reads its draft sequentially (`getDraft`, then
`/layers`) instead of in parallel, one extra round trip, so a pin can
only be older than the body it merges, never newer.
- The draft bar, after its host's own save (`savedSignal`, which the
view settings panel bumps on every landed save), pins its Publish to
that save's receipt version (`savedDraftVersion`). A host that gives no
receipt version leaves that Publish unpinned, as before.
- After a refused Publish the bar keeps the token it showed, so a second
press is refused again until the author reopens the view settings and
sees the current draft. That is the safe direction: the bar never
re-pins itself to a draft it did not show.
- Out of scope, carried by the seat to a close-out card: eight other
draft-then-publish call sites in six files send no `draftVersion` yet
(`studio-design/studioSaveBar.tsx` twice,
`metadata-admin/DraftConflictDialog.tsx`,
`metadata-admin/detailSaveAtOnce.ts`, `recordTabsConfigSave.ts`,
`objectExtensionArrangementSave.ts`, `layout/designModeMenuSave.ts`
twice), and `@objectstack/client`'s `publishItem` can state neither pin.
The member is opt-in by ruling; ruling item 3 named the four callers
this PR pins.
- Contract-review-tier L2: recorded FAIL on 8eee708 (7179921339); this
head answers M1, M2, S1–S3 and N1–N5.

## Verification

<details><summary>Gates (local subset, derived by dispatch-gates.mjs
from the diff, on a0b4863)</summary>

- `node scripts/pm/dispatch-gates.mjs --ran` (exit codes recorded): `125
derived, 123 run, 2 NOT-MEASURED, 0 UNRUN`.
- NOT MEASURED, `node scripts/check-plugin-teardown-shape.mjs
--self-test`: exit 3, its positive control is pinned to a commit this
shallow clone cannot reach. CI runs it.
- NOT MEASURED, `pnpm check:dual-build-cjs-loads`: exit 3, packages
outside this diff have no `dist/` in this container (PREREQUISITE NOT
MET). CI runs it.
- `pnpm --filter @objectstack/spec run check:skill-examples`: exit 3
until `client-react` was built, then exit 0.
- `pnpm --filter @objectstack/spec check:generated`: `check:docs` stale
after the conflict-text edit, regenerated with `--fix` and committed;
`check:api-surface` green on the built dist.
- `overlap-check`: `VERDICT clean` against origin/main and the one PR
head sharing a file (objectstack-ai#37371, generated reference page: merges cleanly).

</details>

Two-minute check: `pnpm --filter @objectstack/rest exec vitest run
src/meta-item-publish-version-pin.test.ts` — expect `Tests 18 passed
(18)`, including the `[objectstack-ai#36350]` describe.

Read first (by risk):
`packages/metadata-protocol/src/protocol-history-and-publish.ts` (the
pin and the shared conflict helper),
`ui/packages/app-shell/src/views/RuntimeDraftBar.tsx` with
`ViewConfigPanel.tsx` (the pin after the host's save),
`ui/packages/app-shell/src/views/runtime-metadata-persistence.ts` (the
no-discard and nothing-pending branches).

## Human Minimum

- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes (CI-owned run).
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_012MmDsSpwtcn5gbWrBDA3Jm

---
_Generated by [Claude
Code](https://claude.ai/code/session_012MmDsSpwtcn5gbWrBDA3Jm)_

<!-- signed: repo:objectstack#6 · os-lizheng ·
session_012MmDsSBHy5paNUz6zke9Re -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
… regions, parse prerelease versions in the MCP save test, key the objectui pin claim on the spec major (objectstack-ai#37557)

Fixes objectstack-ai#37549

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户无感:发版流程里,版本号升到 19 之后,有三处会红,这里一起修掉:迁移登记表的生成不会再拒收第 19 版的下线条目;MCP
保存草稿的一条测试不再把预发布版本号(19.0.0-next.0)读坏;界面仓的版本说法检查不再写死 18。"版本发布"那个 PR
的核心测试和界面测试可以变绿。
- 为什么做:给发第一个 19 预发布版(next 渠道)清掉阻断。版本 PR 的必过检查一直是红的,现在没法合并。
- 出错会怎样:只给模板加了两个空区段,另外改了三份测试;不改任何已发布行为。出问题直接撤回这个 PR 即可。
- 要你做什么:无。

## What changes

- `packages/spec/src/migrations/registry.ts.template`: opens an empty
`retired-key:19` region in `RETIRED_KEYS_BY_MAJOR` and an empty
`retired-def:19` region in `RETIRED_DEFS_BY_MAJOR`, each placed and
shaped like its major-18 sibling. `semantic:19` and `step19` already
existed, so the migration-step side needed nothing.
- `retired-def:19` goes beyond the card's wording, as an in-place fix of
the same defect class. `build-schemas.ts` prescribes new retired-def
entry files under the same `CURRENT_MAJOR` (`renderNewEntryFiles`, used
for both kinds). So the first whole-def removal on the 19 tree would
have hit the same generator refusal. Same file, same gate family, same
mechanical fix.
- `scripts/build-migration-registry.ts` needs no change. Its lines
~422–441 are `--self-test` fixtures, not a region list: the generator
discovers regions from the template's markers.
- Pin (`packages/spec/scripts/build-migration-registry-entry.test.ts`,
new `describe`): every kind in `KINDS` has an open and close marker in
the template for each of two majors, the spec package's major (what
`build-schemas.ts` registers new entries under) and `PROTOCOL_MAJOR`. On
`main` today these are 18 and 19, so the pin reds on `main` before the
fix and names the missing region and the major.
- Why `PROTOCOL_MAJOR` and not "spec major + 1": the protocol major
moves first, on `main` (it reads 19 while the package is still 18.6.0).
It is the leading signal for the next major.
- "spec major + 1" would also red the Version PR tree itself (19 + 1 =
20), unless a major-20 region were opened now.
- Item 2 (seat-amended scope, card objectstack-ai#37549):
`packages/runtime/src/domains/mcp-authoring.test.ts`. The `[objectstack-ai#34774]`
describe parsed `SERVER` with `split('.')`, so on the Version PR tree
(`19.0.0-next.0`) the patch field was `0-next` and the built version was
`19.0.NaN`, which the door refuses as not SemVer. It now parses with
`SEMVER_2_0_0_VERSION_PATTERN` from `@objectstack/spec/kernel`, the
grammar the door itself judges with, and drops the prerelease from the
versions it builds. A new case declares the server's own version
verbatim and `${major}.${minor}.0-next.0`, and asserts both save
byte-identically to no declaration. Test-only; `@objectstack/runtime`
ships `dist` alone, so no runtime changeset is owed.
- Item 3 (seat-amended scope):
`ui/scripts/__tests__/doc-version-claims.test.ts`. The
`skills/objectui/SKILL.md` KNOWN_CLAIMS row was the literal
`@objectstack/spec 18.x`. It is now keyed on `SPEC_MAJOR`, read from
`packages/spec/package.json` under `workspaceRoot()`. The literal in the
skill can't go, because the root `check-skill-compatibility-version.mjs`
requires the pin and rewrites it with the version step. So `skills/**`
is not touched, and the PR stays off Tier H.
- Changeset `.changeset/37549-retired-key-19-region.md` (patch; the
template renders into the shipped `registry.ts`).

## Tests

<details><summary>Pin reds on the pre-fix template (origin/main 1af67b2
template restored, then put back)</summary>

```
× opens and closes `retired-key:19`
× opens and closes `retired-def:19`
AssertionError: src/migrations/registry.ts.template has no `os-generated retired-key:19` region, but major 19 is current (spec package 18.6.0, PROTOCOL_VERSION major 19); an entry registered there is refused by gen:migration-registry. ...
Tests  2 failed | 8 passed (10)
os-verify-lock: VERDICT command-exit 1
```
</details>

<details><summary>Version tree: spec temporarily at 19.0.0-next.0 (not
committed)</summary>

`pnpm gen:migration-registry && pnpm exec vitest run --maxWorkers=2
scripts/build-migration-registry-entry.test.ts
scripts/build-schemas-check-mode.retired-keys.test.ts` (both projects),
with `packages/spec/package.json` version set to `19.0.0-next.0`. The
run includes "the printed route registers: write exactly the files check
(b) names, run the generator, and (b) is silent", the case that fails on
objectstack-ai#35129.

```
Test Files  2 passed (2)
     Tests  20 passed (20)
os-verify-lock: VERDICT command-exit 0
```

The version was restored to `18.6.0` afterwards; `git status` was clean
apart from the intended diff.
</details>

<details><summary>18.6.0 tree: same two files</summary>

```
Test Files  2 passed (2)
     Tests  23 passed (23)
os-verify-lock: VERDICT command-exit 0
```
</details>

<details><summary>Items 2 and 3 on the Version tree (spec at
19.0.0-next.0 and the objectui skill pin at 19.x, both temporary,
restored after)</summary>

```
runtime mcp-authoring.test.ts      Tests 57 passed (57)
ui doc-version-claims.test.ts      Tests 29 passed (29)
```

Ablation on the same tree with the origin/main 1af67b2 versions of the
two tests: runtime `1 failed | 55 passed` (the `SemVer form (e.g.
18.6.0)` case), ui 2 failed (`skills/objectui/SKILL.md ::
@objectstack/spec 18.x`), matching objectstack-ai#35129's CI failures. On the 18.6.0
tree: runtime 57/57, ui 29/29. `ui` `scripts/` suite at the final head:
`172 passed | 2 skipped` files, `5130 passed` tests.
</details>

<details><summary>Spec package, local project, at 2fd0411: `pnpm
--filter @objectstack/spec test` and `pnpm typecheck`</summary>

```
Test Files  899 passed (899)
     Tests  28505 passed | 1 todo (28506)
os-verify-lock: VERDICT command-exit 0
typecheck (tsc + check:scripts-typecheck + check:test-typecheck): VERDICT command-exit 0
```

`test:repo` (the vitest `repo` project) belongs to CI's Test Core. Only
its one touched-path file,
`build-schemas-check-mode.retired-keys.test.ts`, was run locally
(above).
</details>

## Acceptance notes

- In-flight spec PRs objectstack-ai#37366, objectstack-ai#37371 and objectstack-ai#37422: `node
scripts/pm/overlap-check.mjs --pr=37366,37371,37422` gives `VERDICT
clean exit 0`. Their migration changes are major-18 semantic entry files
only, and none touches the template.
- L2: the template is the generator's skeleton for a gitignored
generated file. The two regions are empty, so no exported value or key
changes shape: `RETIRED_KEYS_BY_MAJOR[19]` / `RETIRED_DEFS_BY_MAJOR[19]`
become empty arrays.

Body amended by the seat (repo:objectstack#2 · os-sales ·
session_01L6bhgV6i8jfWwSXjpWJrjA) to cover the three items the card's
scope grew to; the dev report on objectstack-ai#37549 (7194227076) carries the full
evidence.

## Verification

Two-minute check: `pnpm --filter @objectstack/spec exec vitest run
--project local --maxWorkers=2
scripts/build-migration-registry-entry.test.ts`, expected to show `Tests
10 passed (10)`. Then set the spec version to `19.0.0-next.0` and run
`scripts/build-schemas-check-mode.retired-keys.test.ts`, which should
also be green.

Read first: (1) the two new template regions; (2) the pin's choice of
majors (spec package major and `PROTOCOL_MAJOR`).

Local gate subset at 2fd0411: derived by `node
scripts/pm/dispatch-gates.mjs --commands`. Verdicts are in the dev
report on the card. `check:doc-formula-expressions` is NOT MEASURED
locally (PREREQUISITE NOT MET: `@objectstack/formula` and
`@objectstack/lint` are not built in this worktree); CI runs it. The
full farm belongs to CI.

---

_Generated by [Claude
Code](https://claude.ai/code/session_01L6bhgV6i8jfWwSXjpWJrjA)_

<!-- signed: repo:objectstack#2 · os-sales ·
session_01L6bhgV6i8jfWwSXjpWJrjA -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
… another parent answers reference_out_of_scope (objectstack-ai#37567)

<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuDqyPrPQvkURDXnUDgkyFWB)_

Part of objectstack-ai#36794 (PR-1 of 2: the spec reason and the importer; the Import
Wizard text follows in PR-2 on the same branch once this one lands)

Clause-②: yes (widening)
Metadata-protocol: added (`ValidateDataIssueSchema.scope`, a new
optional key on the import cell error; the new `FieldErrorCode` value is
a wire code, no author-writable key)
Skills-docs: follow-up objectstack-ai#37590

## 维护者速读

-
导入时,查找列填了一个只在别的父记录下存在的记录(例如合同属于另一个客户),服务端现在单独报“不在本行的范围内”,并把限定它的列和单元格作为数据返回;真正不存在的值照旧报“找不到记录”。
- 这是导入查找报错专题的后半段:上一张已让报错文字带上限定列,这张让依赖错误码的界面(导入向导)也能分清两种情况。
- 只影响导入失败行的错误码和多出的一个可选字段,成功导入不受影响;按旧错误码筛“找不到”的客户端,在这种情况下会收到新码,可整张撤回。
- 无。

## What changes

- **`FieldErrorCode` gains `reference_out_of_scope`**
(`packages/spec/src/api/errors.zod.ts`, ADR-0114 D2 closed catalog),
beside `reference_not_found`. Ruled route A on the card.
- **Catalog sentence `import_reference_out_of_scope`** in all four
platform locales (`packages/spec/src/system/validation-message.ts`). The
English text is byte-identical to the sentence the scoped refusal
already shipped with (`Contract: no record matches "CTR-0006" (Account =
"Acme")`), now with `{{scope}}` as a parameter, so a deployment can
override it under `validation.field.import_reference_out_of_scope` and
the other three locales say it in their own word order.
- **`ValidateDataIssueSchema` gains an optional `scope: [{ field, value
}]`** (`packages/spec/src/api/protocol.zod.ts`), present only on an
import cell error whose code is `reference_out_of_scope`. This is the
thread's route decision, agreed by the seat at claim time: the card asks
the Wizard to name the scoping column and its cell while keying on the
code and never parsing server prose, and the row result carried no
structured column at all. Same `{ field, value }` naming the importer
already uses for the columns; additive, optional, Clause-② widening. The
contract review below judges it.
- **Core importer** (`packages/core/src/utils/import-coerce.ts`,
`import-runner.ts`): the objectstack-ai#36735 unscoped probe now answers the new
reason with the new message key and the `scope` entries; the runner
copies `scope` onto the row's `errors` element. A value nobody has keeps
`reference_not_found`.
- **A scoped read the field-predicate guard refused is never probed**
(`RefMatch.scopeDenied`, `isScopeFieldDenial`). A caller who cannot read
the scope field (a hidden `master_detail` field, or the `param` a
`dependsOn` entry names) has the scoped lookup refused, so its miss says
nothing about where the value lives. Before this PR the probe still ran
and the objectstack-ai#36735 sentence named the scope; with a code that now claims
"under another parent", that answer would be wrong for a record sitting
under the row's own parent. It keeps `reference_not_found` and the plain
sentence, which is what `content/docs/data-modeling/import-mappings.mdx`
already says for that caller. The guard is read off the error's declared
`details.reason === 'field_predicate_denied'` (the reason all four
field-predicate guards answer) naming a scope field, never its message.
- `packages/runtime/src/dispatcher-error-vocabulary.ts`: the new code's
`foreign-vocabulary` row (ADR-0112 D6), same wording as its three
siblings.
- Docs: `content/docs/api/error-catalog.mdx` field-code table and
`content/docs/data-modeling/import-mappings.mdx` scoped-lookup section.
Regenerated: `content/docs/references/api/{errors,export,protocol}.mdx`,
`packages/spec/authorable-surface/api.json`
(`api/ValidateDataIssue:scope`), the strictness-ledger count for `api/`
(537 → 538, the new nested object).
- Changeset: `@objectstack/spec` minor, `@objectstack/core` and
`@objectstack/runtime` patch. `Metadata-protocol: added`, not the
claim's `none`: `Check Changeset` reads the new
`api/ValidateDataIssue:scope` row in
`packages/spec/authorable-surface/api.json` as a key entered, and a kind
other than `none` grades the package that carries it at least `minor`.

## Tests

-
`packages/core/src/utils/import-runner-reference-master-scope.test.ts`:
the objectstack-ai#36159 describe now pins `reference_out_of_scope` for a `dependsOn`
scope and a master scope, by name and by pasted id, single and
multi-value, with `errors[0].scope` as data; a value nobody has keeps
`reference_not_found` with no `scope` key; the two objectstack-ai#33523 pins whose
value lives under another master move to the new code; a new pin: a
scope the field guard refuses answers `reference_not_found` and no
unscoped probe runs.
- `packages/rest/src/import-integration.test.ts`: a new top-level
describe drives the real `POST /data/:object/import` route on a real
engine and sqlite with a real `dependsOn` declaration: one row resolves,
one answers `reference_out_of_scope` with `scope: [{ field: 'project',
value: 'Gemini' }]`, one answers `reference_not_found` with no `scope`.
- `packages/spec/src/system/validation-message.test.ts`: every locale
interpolates `{{value}}` and `{{scope}}`; the English render is the
shipped sentence; the zh-CN render.
- Ablation: with `if (scopedMatch.scopeDenied) return refusal;`
commented out, the guard pin goes red (1 failed / 15 passed), restored
green.

<details><summary>Local readings (tree f4a201e + 2e8b0b9)</summary>

- `pnpm --filter @objectstack/spec test`: Test Files 900 passed (900),
Tests 28505 passed, 1 todo.
- `vitest run src/utils/import-runner-reference-master-scope.test.ts`
(core): 16 passed. `src/utils/import-coerce.test.ts`: passed.
- `vitest run src/import-integration.test.ts` (rest): 62 passed.
- `pnpm --filter @objectstack/spec check:generated`: 2 stale before
`--fix` (references docs, strictness ledger), both green after.
- `typecheck` spec, core, runtime: green; rest: one TS18048 in the new
pin, fixed in 2e8b0b9, `check:test-typecheck` OK.
- `node scripts/check-dispatcher-error-vocabulary.mjs`: exit 0.
- `node scripts/pm/overlap-check.mjs`: VERDICT clean exit 0 (main,
objectstack-ai#37422, objectstack-ai#37371).
- The `dispatch-gates.mjs --commands` derived list (118 commands) is
running; its reading goes on the PR when done.

</details>

## Acceptance notes

- **Narrowing question left to the contract review, as the card asks:**
a client matching `reason === 'reference_not_found'` to mean "the lookup
cell did not resolve" stops seeing the out-of-scope case under that
value. The schema only widens (a new enum member, a new optional key),
so this PR declares `Clause-②: yes (widening)`; whether the move of that
case is itself a narrowing for such a client is the L2's call.
- **Skill text made false, not fixed here (`Skills-docs: follow-up
owed`):** `skills/objectstack-data/rules/relationships.md:117` says
another master's detail answers `reference_not_found`. `skills/**` is
governed, and this PR's `Clause-②: yes` keeps it off the low-risk arm,
so the line here would make the whole PR Tier H; its follow-up card is
objectstack-ai#37590.
- Between this PR and PR-2 the Import Wizard meets a code it has no
`case` for, so `formatDryRunError` falls through to the server's own
sentence (already in the caller's locale, naming the scope) on both the
dry-run panel and the completion screen. PR-2 gives the code its own
Wizard key built from `scope`.

## Verification

Read first: `packages/core/src/utils/import-coerce.ts`
`referenceNotFound` (the new reason and the guard),
`packages/core/src/utils/import-runner.ts` the resolver's `catch`
(`isScopeFieldDenial`), `packages/spec/src/api/protocol.zod.ts`
`ValidateDataIssueSchema.scope`.

Two-minute check: `pnpm --filter @objectstack/rest exec vitest run
src/import-integration.test.ts -t "under another parent"` — one test,
green; row 2 answers `reference_out_of_scope` with its `scope`.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01L6bhgWgMUXf5juNBhN6rLX)_

<!-- signed: repo:objectstack#2 · os-sales ·
session_01L6bhgWgMUXf5juNBhN6rLX -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…lds (objectstack-ai#37621)

Refs objectstack-ai#37245 (one item: the symbol anchor at ADR-0066 line 146, the
anchor half of the row added in comment 7178404228)

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户能看到什么变化:用户无感;只改了权限设计记录里的一句话,把它指向代码的位置换成一个在「字段权限拆分」最后一步合并前后都存在的位置。
- 为什么做:属于「字段权限拆分」专题;最后一步那个改动会删掉这句话原来指向的位置,它自己的文档检查因此一直是红的,这次先把这一句改好给它让路。
- 出错会怎样:最坏是这句话读起来不如原来直白,只有读这份设计记录的人会碰到;纯文档,可以直接撤回,不影响任何功能。
- 要你做什么:请审这一句并亲手合并(设计记录须由你本人合)。

## What changes

One sentence of one dated note in
`docs/adr/0066-unified-authorization-model.md`: the note of 2026-11-24
under D2 ⑧, line 146. Nothing else in the file moves.

Before:

```text
The vote is cast inside `superuserFieldVote` (`packages/core/src/security/effective-object-permissions.ts#superuserFieldVote`), so both field merges answer the same.
```

After:

```text
The vote is cast inside the one function that calls `holdsViewAllFields` (`packages/core/src/security/effective-object-permissions.ts#holdsViewAllFields`), and both field merges call that function, so both field merges answer the same.
```

The anchor now names `holdsViewAllFields`, the predicate that reads the
`viewAllFields` bit. The sentence describes the vote function by its
relation to that predicate and no longer by its name.

## Why

- Draft pull request objectstack-ai#37371 (card objectstack-ai#36055, the last step of the
field-axis split) replaces `superuserFieldVote` with
`viewAllFieldsReadVote`. Line 146 is the only symbol anchor in
`docs/adr/**` that names the removed function, so
`check:adr-symbol-anchors` is red on that branch with exactly this one
finding.
- The replacement function is not on `main` until objectstack-ai#37371 merges. An
anchor to it would be red on `main` today, so this pull request cannot
use it.
- `holdsViewAllFields` is declared in that file on both trees, with the
same body. The liveness ledger already cites it as the evidence for the
`viewAllFields` key (`packages/spec/liveness/permission.json`).
- The reworded sentence is true on both trees. On `main` the one
function that calls the predicate is `superuserFieldVote`. On objectstack-ai#37371 it
is `viewAllFieldsReadVote`. On both,
`PermissionEvaluator.getFieldPermissions` and
`buildEffectiveFieldPermissions` call that function once per field.
- This is the anchor half of one row of the weekly ADR revisions card.
The other half of that row, the D2 ⑧ end-state note, waits for objectstack-ai#37371 to
merge. Every other row of the card stays with its own claimer.

### Read first

1. `docs/adr/0066-unified-authorization-model.md`, line 146. It is the
only hunk. The risk is in the rewording: the sentence must read true
against the code on both trees.
2. `packages/core/src/security/effective-object-permissions.ts`, not
changed here: `holdsViewAllFields` and its single call site. The call
site sits in `superuserFieldVote` on `main` and in
`viewAllFieldsReadVote` on objectstack-ai#37371.

### Two-minute check

Run `pnpm check:adr-symbol-anchors` on this branch. Expect exit 0 and a
line that starts `✅ check-adr-symbol-anchors: 4237 anchors across 163
records resolve`.

For the other tree: check out the head of objectstack-ai#37371, run `git merge
--no-commit` with this branch, then run the same command. Expect the
same line. Without the merge, that head exits 1 and prints one finding,
`[unresolved-symbol] docs/adr/0066-unified-authorization-model.md:146`.

## Tests

Docs only. No package is touched, so no build closure and no package
test is owed. No tested behaviour changed, so there is no ablation.

The before and after of the gate on the tree of objectstack-ai#37371 is the reverse
verification. Three heads of that branch were read, because it moved
twice during this work. Each merge was a throwaway in a scratch
worktree, never committed and never pushed; the worktrees are removed.

| Tree | `node scripts/check-adr-symbol-anchors.mjs` |
|:---|:---|
| This branch, `edbee340d4` (on `main` at `58570d8002`) | exit 0, 4237
anchors resolve |
| The objectstack-ai#37371 branch at `bad558d574`, as pushed | exit 1, one finding at
ADR-0066 line 146 |
| `bad558d574` with this branch merged in | exit 0, 4237 anchors resolve
|
| The objectstack-ai#37371 branch at `ecc008621e`, as pushed | exit 1, the same one
finding |
| `ecc008621e` with this branch merged in | exit 0, 4237 anchors resolve
|
| The objectstack-ai#37371 branch at `71a5990508`, as pushed | exit 1, the same one
finding |
| `71a5990508` with this branch merged in | exit 0, 4237 anchors resolve
|

All three merges were clean, with no conflicted path. The gate's
`--self-test` exits 0 on this branch and on each merged tree.

<details><summary>How each symbol answers the gate's own resolver, per
tree</summary>

`symbolResolutionClass` from `scripts/symbol-anchors.mjs`, asked with
the text of `packages/core/src/security/effective-object-permissions.ts`
at each commit:

| Commit | `holdsViewAllFields` | `superuserFieldVote` |
`viewAllFieldsReadVote` |
|:---|:---|:---|:---|
| `58570d8002` (`main`) | declaration | declaration | absent |
| `edbee340d4` (this branch) | declaration | declaration | absent |
| `bad558d574` (the split's branch) | declaration | absent | declaration
|
| `71a5990508` (the split's branch, latest) | declaration | absent |
declaration |

</details>

<details><summary>What the reworded sentence claims, counted on each
tree</summary>

- Call sites of `holdsViewAllFields` in
`packages/core/src/security/effective-object-permissions.ts`, comments
aside: one on `58570d8002` (line 1076, inside `superuserFieldVote`) and
one on `bad558d574` (line 1064, inside `viewAllFieldsReadVote`). The
function is not exported, so nothing outside the file calls it.
`packages/lint` keeps a separate author-time copy under the same name;
the anchor names the file, so it does not point there.
- Callers of that one function among the two field merges. On
`58570d8002`: `buildEffectiveFieldPermissions` (line 1175) and
`getFieldPermissions`
(`packages/plugins/plugin-security/src/permission-evaluator.ts`, line
590). On `bad558d574`: lines 1160 and 566 of the same two files.
- The file is byte-identical between `bad558d574`, `ecc008621e` and
`71a5990508`, so the second reading stands for all three.

</details>

## Acceptance notes

- **The end-state note is not written here.** The same row asks for a
dated note stating what is true once View All and Modify All stop voting
on fields. That note is written after objectstack-ai#37371 merges, as the card says of
every row whose prerequisite has not merged.
- **Sentences this pull request leaves alone.** The notes of 2026-11-02
and 2026-11-15, and the rest of the 2026-11-24 note, say that View All
and Modify All vote on fields. The first two each name
`superuserFieldVote` once in prose (lines 142 and 144). All of that is
true on `main` today. It becomes dated when objectstack-ai#37371 merges, and the
end-state note is what supersedes it. The gate passes on those two
mentions on both trees: it judges anchors, and a name in prose is not
one.
- **Why not the symbol the row proposed.** The row comment proposes
re-pointing at `viewAllFieldsReadVote`. That holds only after objectstack-ai#37371
merges. This pull request has to be green on `main` alone and has to
leave that branch green once it merges `main`.
- **An edit, not an added note.** Re-pointing an anchor changes the
sentence that carries it, so this is a one-sentence rewrite inside an
existing dated note. No decision text is touched.
- **No changeset.** The diff is `docs/adr/**` alone, which no package
ships. `skip-changeset` is declared with this pull request.
- **Governed path.** `docs/adr/**` lands by the maintainer's hand. This
pull request stays a draft and nobody is asked to review it from here.
- **Order of landing.** This one lands first. The objectstack-ai#37371 branch then
needs one merge of `main` to pick the sentence up, and its anchor gate
reads green from that commit on.
- **The generated index is untouched.** `pnpm check:adr-index` exits 0
at this head.
- **The protocol line.** The claim spells it as n/a, docs only. It is
written above in the closed vocabulary as `none`, which is what that
says.
- **Base.** The branch is cut from `main` at `58570d8002`. `main` has
since moved by one commit, `54d6726c09`. It changes a changeset, a CLI
test and two files of `packages/lint`, and nothing under `docs/adr`, in
the anchored file or in the gate.

## Verification

Local gates at head `edbee340d4`: 21 derived by `node
scripts/pm/dispatch-gates.mjs --commands`, 21 run, 21 exit 0. `--ran`
reconciles them: `21 derived, 21 run, 0 NOT-MEASURED, 0 UNRUN`. Every
exit code was captured before any pipe.

<details><summary>The 21 commands and what they printed</summary>

One command, `pnpm --filter @objectstack/lint run
check:doc-formula-expressions`, first exited 3: prerequisite not met,
nothing measured, because `@objectstack/formula` and `@objectstack/lint`
were not built. After `pnpm exec turbo run build
--filter=@objectstack/formula --filter=@objectstack/lint
--concurrency=2` under the shared verify lock (`VERDICT command-exit
0`), it exited 0. That second run is the one counted.

- `node scripts/check-adr-links.mjs` and its `--self-test`: exit 0
- `node scripts/check-closing-keyword-parity.mjs` and its `--self-test`:
exit 0
- `node scripts/check-comment-mask-corpus.mjs`: exit 0
- `node scripts/ci/plan-test-core-shards.mjs --self-test`: exit 0
- `pnpm --filter @objectstack/lint run check:doc-formula-expressions`:
exit 0
- `pnpm check:adr-anchors`: exit 0
- `pnpm check:adr-index`: exit 0
- `pnpm check:adr-symbol-anchors`: exit 0, `4237 anchors across 163
records resolve — 1452 symbol (1423 declaration, 29 literal), 2733
file-level, 52 cross-repo, 6 exempt, 96 continuation`
- `pnpm check:ci-filter-parity`: exit 0
- `pnpm check:closed-ceremony-text`: exit 0
- `pnpm check:cross-package-test-inputs`: exit 0
- `pnpm check:doc-authoring`: exit 0
- `pnpm check:driver-memory-census`: exit 0
- `pnpm check:gitlink-declared`: exit 0
- `pnpm check:nul-bytes`: exit 0
- `pnpm check:pm-governed-merges`: exit 0
- `pnpm check:pm-prior-rulings`: exit 0
- `pnpm check:refd-timer-probe`: exit 0
- `pnpm check:watch-hint-literal`: exit 0

The 52 cross-repo anchors are reported and not judged, because no
sibling checkout is present. That is the gate's ruled behaviour and the
same on every tree above.

</details>

Every other gate family is CI's to run on this pull request. `node
scripts/pm/overlap-check.mjs --branch=HEAD` at `edbee340d4` gives
`VERDICT clean`: the branch merges cleanly with `origin/main` at
`54d6726c09`.

---
_Generated by [Claude
Code](https://claude.ai/code/session_011y7As8wf3DSPRevwNnYLcM)_

<!-- signed: repo:objectstack#7 · os-alice ·
session_011y7As8wf3DSPRevwNnYLcM -->

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…ut of step with main (week of 2026-11-25) (objectstack-ai#38289)

<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DDypKu7B9nwbu5WuV7AEio8)_

Fixes objectstack-ai#37245

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户能看到什么变化:用户无感;只在十份设计记录里补了带日期的说明,写明主线现在实际怎么做,原有的决定文字一个字没动。
- 为什么做:属于「每周设计记录修订」滚动清单(11 月 25
日这一周);清单每一行指出一处「记录写的和主线不一致」,这次一并补齐,免得照着记录干活的人被过时说法带偏。
- 出错会怎样:最坏是某条补充说明写得不准,读这些设计记录的人会碰到;纯文档、只增不删,可以直接撤回,不影响任何功能。
- 要你做什么:请审这些补充说明并亲手合并(设计记录须由你本人合)。

## What changes

Ten ADR files gain notes dated 2026-11-28. Every diff line is an
addition: 239 lines added, 0 removed. No original decision text is
rewritten, and no decision changes. Each note follows the note
convention its own record already uses.

Each row's "what is true now" was read against the code on `main` before
it was written. Where a row was wrong or had gone stale, the note says
what `main` does, and the table and the list under it say so.

| Row (comment id on the card) | ADR and section | Result |
|:---|:---|:---|
| Card body row (from objectstack-ai#37238) | ADR-0146, the 2026-11-24 amendment, "32
registered types" | **Landed. Row stale.** The row asks for 33; the
registry holds 35 entries on `main`. The note states no count and points
at the registry and at ADR-0084's table. |
| 7155511307, nit 1 | ADR-0160 D1, the door's page cap sentence |
**Landed. Row stale.** The row says the door has no page cap. PR objectstack-ai#37354
added one. The note says what `main` does: the list is cut one row under
the door's cap, not at it. |
| 7155511307, nit 2 | ADR-0160 D1, "only contains braces" | **Landed**
as the row asks. |
| 7155511307, nit 3 | ADR-0160 D3, the link-field sentence | **Landed as
a note that the sentence stands.** |
| 7161785832 | ADR-0158, Open items 9 and 12 | **Landed.** |
| 7178404228, anchor half | ADR-0066, line 146 | **No edit.** PR objectstack-ai#37621
already landed it (record 7198334624). |
| 7178404228, end-state half, with 7201928772 | ADR-0066 D2 ⑧ |
**Landed.** Its prerequisite, PR objectstack-ai#37371, is merged. The proposed text is
tightened in two places, listed below. |
| 7179515770 | ADR-0158 U3, U6, L4, Open item 10 | **Landed.** |
| 7184833647 | ADR-0159, Context, "One name already taken" (line 109) |
**Landed as a note. The anchor line is untouched.** This is not a
no-edit row: the anchor resolves, onto the opposite meaning. See below.
|
| 7187445064 | ADR-0158 L1, L2, Open items 6, 8, 10 and 11, and a new
Open item 13 | **Landed.** |
| 7195437501 | ADR-0010, the amendment note of 2026-11-24 | **Landed**,
with one arm `main` has gained since the row was written. See below. |
| 7212321297, first row | ADR-0067 D3 | **Landed. Row wording wrong.**
The note carries the revert rule that the `form` type brought. See
below. |
| 7212321297, second row | ADR-0160, implementation split, row 7's
bullet | **Landed.** The row places the stale path near line 425; it is
near line 491. |
| 7213085888 | ADR-0048 §3.5 | **Landed.** The row's ready text, dated
2026-11-28, with symbol anchors where it had line numbers. |
| 7215202653, corrected by 7215223685, with 7224476684 | ADR-0150 D3,
the note of 2026-11-26 | **Landed.** Item 2 of the first row said the
two doors were still open. The later row supersedes it: PR objectstack-ai#37948
merged, and both doors now refuse. |
| 7217585102 | ui ADR-0057, A2 and A3 | **Landed. Row stale on one
line.** The plan-marker line is written as `main` is today, after PR
objectstack-ai#37970, and not only as it was after PR objectstack-ai#37720. |

Comments that are not rows: 7186949648 (triage note), 7196224618 (a
one-row claim), 7196910014 (its report), 7198334624 (its landing record)
and 7237786310 (this claim).

**No row is held.** Every prerequisite is merged on `main`: PRs objectstack-ai#37219,
objectstack-ai#37240, objectstack-ai#37268, objectstack-ai#37354, objectstack-ai#37366 (which carried objectstack-ai#37422), objectstack-ai#37371, objectstack-ai#37389,
objectstack-ai#37423, objectstack-ai#37449, objectstack-ai#37640, objectstack-ai#37720, objectstack-ai#37818, objectstack-ai#37931, objectstack-ai#37948, objectstack-ai#37970, objectstack-ai#37065,
objectstack-ai#36138 and objectstack-ai#37021. The card has 19 comments as of this pull request; a
row added after comment 7237786310 is not in it.

### Where a note differs from its row

- **ADR-0146.** The row offers two forms, "give the count" or "point to
ADR-0084's table". The note takes the second. A count written today
would already be the third reading (32, then 33, now 35).
- **ADR-0160 D1, the page cap.** The row's premise was true when it was
written and is not now. `RecordContextDoor.pageCap` exists, and both
doors answer it. The note records the one-row difference between the
amendment's words and the code: a list whose cut plus its probe row
would pass the cap is cut one row under the cap.
- **ADR-0160 D3, the link field.** The note leaves the wording alone.
- **ADR-0066 D2 ⑧.** Two changes to the proposed text. The note says in
words that `viewAllFieldsReadVote` replaced `superuserFieldVote`, and
anchors only the function that exists. And it does not say that nothing
re-opens a lock across sets: another set's `viewAllFields` still makes a
hidden field readable, and another set's field row with `editable: true`
still grants the edit, because field grants union without deny.
- **ADR-0159, line 109.** PR objectstack-ai#37422 was merged into PR objectstack-ai#37366's branch,
so the anchor `view.zod.ts#defineForm` resolves and the gate is green on
it. It now resolves onto the `form` type's factory, while the paragraph
describes the Studio helper, which is `defineMetadataForm` today. The
paragraph is Context and describes the tree before the ruling was
carried out, so the note leaves it as written and states both names.
- **ADR-0010.** The row covers the three restore doors of PR objectstack-ai#37423. The
same rule has since gained a second refusal, from PR objectstack-ai#37640: a restore
that would write a version the platform registered into a package's row.
The note has one sentence on it. That sentence goes beyond the row; cut
it if the note should carry the row alone.
- **ADR-0067 D3.** The row asks for a note "naming `form` as a
translated metadata type". D3 is about undo granularity and has no such
notion. The contract reviews of PR objectstack-ai#37422 sent one fact to this record:
a `form` item is reverted only after every `view` row its commit edited
is put back, and it joins `failed[]` otherwise. The note records that.
- **ADR-0048.** The row's text was dated 2026-11-24. The note is dated
2026-11-28, the day it was written into the record.
- **ADR-0150.** Besides answering "Not judged yet", the note qualifies
one sentence of the 2026-11-26 note that said too much: the draft
discard is newly refused only over a stored package-less draft. Where it
was already refused, only its sentence moved.
- **ADR-0158.** Row 7179515770 points at a draft held by its seat, which
this session could not read. The notes are written from the two rows and
the code. Open item 13 is a new numbered item at the end of the list,
carried from the display card; it is marked not built and not settled.
- **ui ADR-0057.** The row asks for "what main does after objectstack-ai#37720".
`main` has moved once more: since PR objectstack-ai#37970 the entry's marker stands
for a write that waits for approval. The note says that, and that A5's
"Not recorded yet" bullet held until that pull request merged.

## Tests

Docs only. No package is touched, so no build closure and no package
test is owed for the change. No tested behaviour changed, so there is no
ablation.

What was checked by hand, on the committed text:

- Each phrase a note quotes from its ADR was compared with the base
file.
- Each verbatim maintainer quotation was compared, byte for byte, with
its record on GitHub.
- Each cited path and symbol exists on `main`. The one exception is
deliberate: the ADR-0160 note names `packages/spec/src/ai/skill.form.ts`
to say that no such file exists.
- Upstream moved ten commits while this was written (`e42520c67b` to
`e2a0e90025`). None touches an ADR file or a file a note cites.
`overlap-check` answers `VERDICT clean exit 0` against `origin/main` at
`e2a0e90025`, and no open pull request shares a file with this branch.

The local gate set is the `dispatch-gates --commands` derivation for
this change set, 27 commands, run on the final commit `c2c3345747`. Each
exit code was captured before any pipe. Reconciliation: `Run
reconciliation — 27 derived, 27 run, 0 NOT-MEASURED, 0 UNRUN`, all 27
with a recorded exit code.

<details><summary>ADR gates on c2c3345 (all exit 0)</summary>

| Command | Exit | Verdict line |
|:---|:---|:---|
| `pnpm check:adr-symbol-anchors` | 0 | `check-adr-symbol-anchors: 4525
anchors across 164 records resolve`, 0 line anchors survive. On the base
commit the same gate reads 4478. |
| `node scripts/check-adr-links.mjs` | 0 | `check-adr-links: 1268
relative link destination(s) under docs/adr/ resolve` |
| `node scripts/check-adr-links.mjs --self-test` | 0 | |
| `pnpm check:adr-anchors` | 0 | |
| `pnpm check:adr-index` | 0 | `adr-index --report: OK —
docs/adr/README.md is current, every record parsed` |
| `pnpm check:doc-authoring` | 0 | |
| `pnpm check:nul-bytes` | 0 | `check-nul-bytes: OK (scanned 28605 text
file(s)`, no raw control bytes |
| `pnpm check:closed-ceremony-text` | 0 | |
| `pnpm --filter @objectstack/lint run check:doc-formula-expressions` |
0 | run after building `@objectstack/formula` and `@objectstack/lint`
under the verify lock |
| `pnpm --dir ui run check:new-line-citations` | 0 | `VERDICT
new-cross-file-line-citations: 0 new citation(s)`. Not in the derived
list; run because a ui ADR changed. |

</details>

<details><summary>The other derived families on c2c3345 (all exit
0)</summary>

`node scripts/check-closing-keyword-parity.mjs` and its `--self-test`,
`node scripts/check-comment-mask-corpus.mjs`, `node
scripts/ci/plan-test-core-shards.mjs --self-test`, `pnpm
check:ci-filter-parity`, `pnpm check:cross-package-test-inputs`, `pnpm
check:driver-memory-census`, `pnpm check:gitlink-declared`, `pnpm
check:pm-governed-merges`, `pnpm check:pm-prior-rulings`, `pnpm
check:published-files`, `pnpm check:refd-timer-probe`, `pnpm
check:registry-log-declared`, `pnpm check:rest-log-spy-declared`, `pnpm
check:tier-file-adoption`, `pnpm check:undeclared-dep-imports`, `pnpm
check:watch-hint-literal`.

Before the push: `node scripts/check-commit-card-trailers.mjs --range
origin/main..HEAD` exit 0, one commit message, no card relation and no
model identifier in the trailer pair.

</details>

<details><summary>The ui scripts test family: one prerequisite failure,
then green</summary>

Derived command: `pnpm --dir ui exec vitest run scripts/`, run under the
verify lock with `--maxWorkers=2`.

- First run: `VERDICT command-exit 1`. `Test Files 1 failed | 171 passed
| 2 skipped (174)`, `Tests 1 failed | 5144 passed | 2 skipped (5147)`.
The one failure was
`scripts/__tests__/unit-registry-absence-collision.test.ts`, with
`Failed to resolve entry for package "@objectstack/client"`. The package
had no build output in the fresh worktree. That is a missing
prerequisite, not a verdict on this change.
- After building the `@objectstack/client` closure under the lock, the
same command on the same commit: `VERDICT command-exit 0`. `Test Files
172 passed | 2 skipped (174)`, `Tests 5145 passed | 2 skipped (5147)`.

</details>

Not run locally: the repository test project behind `test:repo`, which
CI runs on the pull request and on the merge group. Every other family
CI runs is read from this pull request's check runs, not re-run here.

## Acceptance notes

- **Changeset.** None, and the pull request carries `skip-changeset`.
`docs/adr/**` and `ui/docs/adr/**` ship in no package: the ui tree's
root is a private workspace root and `ui/docs` is under no package
directory.
- **Governed surface.** `docs/adr/**` lands by the maintainer's hand.
This pull request stays a draft; the seat hands it over.
- **The registry count.** The card row and the amendment both carry a
number. The repository rule for a volatile count is to remove it and not
to sync it, so the note adds none.
- **Seen and left alone.** These are outside the card and are not
changed here.
- ADR-0084, near line 226, says `form` is not a registered type. It is
about the working names of the 2026-07-01 table, and `form` is
registered now. It is a candidate row for next week's card of this name.
- One internal skill playbook and ui ADR-0056 still use the Studio form
helper's old name. The review of PR objectstack-ai#37366 already recorded both.
- Comments in the console's chat scope helper still describe the
`app:PKG:build` dock key and the Studio copilot.

## Verification

### Read first

1. `docs/adr/0066-unified-authorization-model.md`, the note of
2026-11-28 under D2 ⑧. It is the highest-risk hunk: one long paragraph
on authorization, and it supersedes parts of three earlier notes. Check
the sentences on what another set can still re-open, and the sentence
that stored sets are read with the new meaning and never rewritten.
2.
`docs/adr/0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md`,
the amendment note of 2026-11-28. Check the four cells and their
remedies (enable, enable, name the package, name the package) against
the ruling it quotes.
3.
`docs/adr/0158-units-of-measure-standard-unit-table-org-units-quantity-unit-declaration-base-quantity.md`,
the notes under Open items 6 and 10 and the new Open item 13. Both notes
quote the maintainer, and item 10's records the shape of a new system
object.

### Two-minute check

Run `git diff --numstat origin/main...HEAD` on this branch. Expect ten
rows, nine under `docs/adr/` and one under `ui/docs/adr/`, each with `0`
in the removed column, and 239 added lines in total. Then run `pnpm
check:adr-symbol-anchors` and expect exit 0 with a line that contains
`check-adr-symbol-anchors: 4525 anchors across 164 records resolve`.

---
_Generated by [Claude
Code](https://claude.ai/code/session_016WV4cxRDKprCtjpEdtiPFW)_

<!-- signed: repo:objectstack#1 · os-elon-musk ·
session_016WV4cxRDKprCtjpEdtiPFW -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
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/xl 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