Skip to content

docs(adr,skills): ADR-0163 records the two-tier field write lock; objectstack-data teaches the four locks - #38428

Merged
os-zhuang merged 3 commits into
mainfrom
claude/project-thread-bqsxpg
Nov 29, 2026
Merged

os-zhuang merged 3 commits into
mainfrom
claude/project-thread-bqsxpg

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

Fixes #37405

Clause-②: no (no accept set or export changes; governed rules text, so one contract-review-tier review before the queue; Tier H)
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:给应用建数据模型的人和 AI,现在能从技能里学到「锁定一个字段」的四种写法各在什么时候用(比如销售订单的状态只让「确认」按钮改、不让人手改);把两种锁同时配在一个字段上时,校验报错会指出该看哪份设计说明。平台行为不变。
  • 为什么做:你对「字段只读分两级」那张决策卡已经定了长远模型,功能也已上线,但设计说明和技能里一直没有记下来,这一步是补上记录。
  • 出错会怎样:最坏是说明里某句话和平台实际做法对不上,作者照着配错了锁;只改文字和一句报错提示,可以直接撤回。
  • 要你做什么:设计说明和技能文件的改动需要你批准合并。

What changes

No key, schema, accepted value, default or runtime behaviour changes. This records the ruling of record on #36806 (ruling record 7180466652, 「按长远模型」) and the two object-level rulings on #37402 (ruling records 7235326611 and 7237772411), whose code landed in #37436, #37888 and #38169.

  • docs/adr/0163-field-write-locks-two-tiers-two-forms-two-levels-ui-prefix-admission.md (new, Accepted (2026-11-26) on the ruling record; it reaches main only by the Tier H approval). D1 two tiers (server lock readonly / readonlyWhen, hand lock uiReadonly / uiReadonlyWhen), D2 two forms (readonlyWhen: P\true`is the set-once spelling), D3 two levels (the object'suiReadonlyWhen; a field's own declaration wins; uiReadonly: falseis not a declaration), D4 what "by hand" is, D5 the admission rule of theui prefix (uiVisibleWhen/uiRequiredWhenare not admitted), D6 contradictions, D7 the server lock stays a strip. The record keeps two kinds of statement apart: Decision carries only what the rulings say, quoted; "As built" says whatmaindoes atc610020`, by symbol anchor. A third section, "Ruled and not yet held", lists the three places the ruling covers and the code does not reach yet, each with its open carrier card.
  • docs/adr/README.md: regenerated by node scripts/adr-index.mjs (164 records).
  • skills/objectstack-data/rules/validation.md: new section ## Locking a Field: a two-by-two table of the four keys (who is kept out, and when), one checked sales-order example (the hotcrm#2716 case: a status only the Confirm action moves), and five bullets on what each column does at run time.
  • skills/objectstack-data/SKILL.md § Conditional Field Rules: the first bullet keeps its trap (the value is dropped, the write is not refused, a declarative action's included) and routes to the new section.
  • skills/objectstack-data/evals/objects-fields-relationships.json: case 30, a uiReadonly status field (must_contain: uiReadonly: true, state_machine). evals/README.md names it.
  • packages/spec/src/data/field.zod.ts: the parse refusal for uiReadonly: true beside readonly: true keeps its wording and now ends The two locks and which one to choose: ADR-0163 (D1, D6). This is the text objectstack validate prints for the pair. Pinned in field-ui-readonly.test.ts.
  • .changeset/37405-field-write-lock-adr-skill.md: @objectstack/spec and @objectstack/skills, patch.

One sentence of the skill is corrected, not only moved. rules/validation.md said "Imports and migrations are system-context writes too." An import is not a system-context write. The readonly describe in FieldSchema says so ("A normal (non-system) import is NOT system-context and still strips"), importControlOptOutRefusal in packages/rest/src/import-prepare.ts refuses the historical-import opt-out to every HTTP caller, and the #36806 measurement found the same. The new section lists an import among the writes readonly: true drops, and a migration among the system writers it lets through.

Token ratchet (scripts/check-skills-token-ratchet.mjs), two rows:

  • skills/objectstack-data/SKILL.md 2239 → 2224: lowered to the measurement.
  • skills/objectstack-data/rules/validation.md 3466 → 3862 (+396). The section is ordered into this skill by the ruling of record on spec: a field a person changes only through actions — read-only on every UI surface, still writable by the API, import and action writes, judged by validations #36806 (ruling record 7180466652: the four spellings, which one to use, the sales-order status example), and the raise follows the standing ruling, verbatim: 「A:先削重复,余额按实测提高」 (ruling record 6513306068). Paid down first in the same file, 1035 bytes cut against 2622 added:
    • the two readonly / readonlyWhen bullets of § Conditional Field Rules are now one pointer at the new section, which says the same once;
    • § Conditional Validation loses its first example (enterprise_requires_manager) and the lead-in of the second, whose when / then / otherwise rule shows everything the first did.

Skills readings (lines / bytes / tokens)

before after
skills/objectstack-data/rules/validation.md 392 / 13861 / 3466 421 / 15448 / 3862
skills/objectstack-data/SKILL.md 167 / 8983 / 2239 167 / 8923 / 2224
skills/objectstack-data/evals/objects-fields-relationships.json (not ratcheted) 520 / 37381 533 / 38751
skills/objectstack-data/evals/README.md (not ratcheted) 17 / 969 18 / 1016
all of skills/objectstack-data/** 4643 / 252853 4686 / 255797
all skills/*/SKILL.md 4386 / 228159 4386 / 228099
all of skills/** 23333 / 1230467 23376 / 1233411
ratcheted (authored) total, tokens 200510 200891

Round 2 (head 6e397de): the contract review of 0922ab3

The review (comment 7248470779, PASS) left one should-fix and one nit. Both are done in one commit.

  • S1, SKILL.md: "a button's action included" was true of a declarative action only. A script action's body runs in a system context, so its write to a readonly: true field lands (ADR-0163, Alternatives, row 3). The clause now reads "a declarative action's included". The ratchet row follows the file to its measurement, 2224 (2223 at the previous head).
  • N1, rules/validation.md: the table's left column was headed "Every non-system write" over readonlyWhen too, which binds system writes as well. The header is now "Every write" and the readonly: true cell carries "(system writes pass)". The right header lost one word to pay for it ("Only a person at the console"), and the Confirm sentence names "a declarative Confirm". The file is 15448 bytes and its row stays 3862.
  • The changeset's sentence on the Confirm action says "a declarative action's own write" to match.

Tests

  • packages/spec/src/data/field-ui-readonly.test.ts: the existing refusal case also asserts the message ends with ADR-0163 (D1, D6). vitest run src/data/field-ui-readonly.test.ts in packages/spec: 5 of 5 pass.
  • The new skill example carries the os:check marker, so check:skill-examples type-checks it against the built @objectstack/spec declarations. Exit 0: 353 marked examples type-check, this one among them. The example was also parsed by ObjectSchema and read by validateStackExpressions in two scratch vitest files (not committed): it parses, and the expression lint reports no issue for readonlyWhen: Ptrue or `uiReadonlyWhen: P`false.
  • check:skill-eval-tokens: exit 0; both must_contain tokens of case 30 are taught by the bundle.
  • Not run: a model-driven round of the skill evals. Case 30 has a new hash and no recorded answer yet.

Acceptance notes

Verification

Two-minute check: node scripts/check-skills-token-ratchet.mjs, expect exit 0 with skills/objectstack-data/rules/validation.md 3862 / 3862 and skills/objectstack-data/SKILL.md 2224 / 2224.

Read first, by risk:

  1. skills/objectstack-data/rules/validation.md § Locking a Field (it ships to third parties verbatim): the left-column bullet, where the writers readonly: true drops and lets through are listed, and the import correction.
  2. docs/adr/0163-…md D3 and D4 against the ruling records, then "Ruled and not yet held".
  3. scripts/check-skills-token-ratchet.mjs: the two rows and their arithmetic.
Local gates at 6e397de (only what reads the two changed skill files)

Not the whole list again: the second commit changes two skill files, the ratchet rows and one changeset sentence. Re-run, each exit 0: check-skills-token-ratchet.mjs (and --self-test), ui check:skill-eval-tokens, check:skill-links, check:skill-frame-sync, check:skill-identifier-liveness, spec check:skill-examples (353 examples), check:skill-docs, check:skill-refs, check:skill-served-sections, check-nul-bytes.mjs.

Local gates at 0922ab3

node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --ran FILE, each command recorded as CMD :: exit N: 124 derived, 120 run, 4 NOT-MEASURED, 0 UNRUN. Every run family exit 0, among them check-skills-token-ratchet.mjs (and --self-test), check:adr-index, check:adr-anchors, check:adr-symbol-anchors, check-adr-links.mjs, check:skill-links, check:skill-frame-sync, check:skill-identifier-liveness, spec check:docs / check:api-surface / check:authorable-surface / check:skill-docs / check:skill-refs / check:liveness, check-empty-changeset.mjs, check-adr-0087-registration.mjs --base origin/main, check:ratchet-remedy-authority, check:type-check-debt.

  • The four recorded exit 3 (prerequisite not met), as the tool reads the record:
    • check-plugin-teardown-shape.mjs --self-test: NOT MEASURED. Its positive control is pinned to a commit this shallow clone cannot reach. The gate itself (without --self-test) ran, exit 0.
    • check:doc-formula-expressions, check:dual-build-cjs-loads, check:lean-entry-closure: exit 3 on the first pass (their build closures were missing). After the closures were built each was run again alone, exit 0. The record keeps both lines, and the tool reads a command with two codes as the worse one, so its count stays 4.
  • Outside the derived list, run by hand: spec check:skill-examples (exit 3 before the @objectstack/client-react closure was built, exit 0 after: 353 examples), ui check:skill-eval-tokens (exit 0), ui check:skills-paths (exit 0).
  • scripts/pm/overlap-check.mjs: clean against origin/main (3579cf1) and the one open PR that shares a file (chore: version packages (next) #38192, skills/objectstack-data/SKILL.md).
  • Built at c610020e plus this diff; main moved three commits since (none under this diff's paths), not merged in.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgTpyo8gQyqf9Tj9mfz

…he ui-prefix admission rule

Claude-Session: https://claude.ai/code/session_01L6bhgTpyo8gQyqf9Tj9mfz
Co-authored-by: Claude <noreply@anthropic.com>
… point the uiReadonly + readonly refusal at ADR-0163

skills/objectstack-data/rules/validation.md gains "Locking a Field": the
two-by-two of readonly / readonlyWhen / uiReadonly / uiReadonlyWhen, one
checked sales-order example and what each column does at run time. The two
readonly bullets of Conditional Field Rules become a pointer at it, and the
claim that an import is a system-context write is corrected there. SKILL.md
routes to the section; evals gain case 30, a uiReadonly status field.

The token ratchet rows follow: SKILL.md 2239 -> 2223 (lowered to the
measurement), rules/validation.md 3466 -> 3862 (restatement cut first, the
measured remainder raised under ruling record 6513306068; the section is
ordered by ruling record 7180466652).

packages/spec: the parse refusal for uiReadonly: true beside readonly: true
ends with "ADR-0163 (D1, D6)", pinned in field-ui-readonly.test.ts.

Claude-Session: https://claude.ai/code/session_01L6bhgTpyo8gQyqf9Tj9mfz
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation protocol:data tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 29, 2026
@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/spec, touching 1 documentable anchor(s).

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

  • content/docs/concepts/metadata-driven.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/data-modeling/external-datasources.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/data-modeling/field-types.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/data-modeling/validation-rules.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/deployment/troubleshooting.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/deployment/validating-metadata.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/getting-started/quick-reference.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/kernel/contracts/data-engine.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/protocol/backward-compatibility.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/protocol/objectql/types.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/protocol/objectui/concept.mdx (via FieldSchema (symbol, a top-level const))

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

  • content/docs/releases/v17/17-0.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/releases/v17/17-1.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/releases/v18/18-3.mdx (via FieldSchema (symbol, a top-level const))
  • content/docs/releases/v18/18-4.mdx (via FieldSchema (symbol, a top-level const))

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

What this run could not see
  • the SDK route bridge reached 69 of 253 client-bound route-ledger rows — the other 184 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 184: 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; 125 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 — 181 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 d751790ced3d1c8d998cc6dbc3f9e014317778ec → packageMentionDocs.

Which tree this was computed on

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

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

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

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 0922ab3aace05c52d7f13b3104eed7004912a410
Local-runs: none
Scope: packages/spec/src/data/field.zod.ts, docs/adr/0163-field-write-locks-two-tiers-two-forms-two-levels-ui-prefix-admission.md, docs/adr/README.md, skills/objectstack-data/SKILL.md, skills/objectstack-data/evals/README.md, skills/objectstack-data/evals/objects-fields-relationships.json, skills/objectstack-data/rules/validation.md + packages/spec/src/data/field-ui-readonly.test.ts, scripts/check-skills-token-ratchet.mjs
Security-touching: yes

Read: card #37405 (body, triage, claim 7247702130, amendment 7247733027, os-dev-report), PR #38428 (body, 10 files, net diff against main 3579cf1, merge base c610020), the 49 check-runs on the head. Judged against the amended claim. Outside hits and the two implementing files, .changeset/37405-field-write-lock-adr-skill.md is the lane seat's ACCEPT.

Security-touching is yes on the hunks, not the path names: the new skill section and the ADR teach which writers a lock binds and which it lets through, that the hand lock is not a permission, and where field permissions sit beside it. The adopting seat adds the security label.

① Derived judgments

  • Accept set of FieldSchema: unchanged. The refinement's condition (uiReadonly === true beside readonly === true), its code and its path are untouched; one string gains a tail. Right.
  • Public surface of @objectstack/spec: no export, key, default or describe text changes; the refusal message is the only published text that moves. Right.
  • skills/**: one new section, two bullets folded into a pointer, one example removed from Conditional Validation, one eval case (id 30, after 29 on main). No taught key is new to main: the four field keys and the object key are in field.zod.ts and object.zod.ts on main. Right.
  • docs/adr/**: one new record, number 0163 free on main (0162 is the highest), README row and counts 163 to 164 / 158 to 159 numbers / Accepted 139 to 140 consistent with one added Accepted record. Right.
  • Ratchet rows: ceil(8891 / 4) = 2223 and ceil(15447 / 4) = 3862; the main rows are 2239 and 3466 on 8983 and 13861 bytes, as the comments say. Arithmetic right; the byte counts of the head are the gate's to confirm (pending, below).

Gate verdicts on the head at read time, 49 check-runs: success on Check Changeset, PR-body guards, Governed Surface Queue Guard, Spec property liveness, Check Documentation Links, Check PR Size, Flag docs affected, Auto Label, Dogfood Regression Gate, both shard planners and filter; 11 skipped by design. PENDING, not waited for: Test Core 1/12 to 12/12, Build Core, Build UI Deps, Live E2E UI, Type Check (workspace, consumer gates, debt ledger; source gates completed during the read), Lint (ESLint, docs and code guards, repo and tooling gates, CI release and engine gates, PM dispatch-gates, tooling self-tests, slot lookup and corpus, query-options erasure). The gates that answer this diff directly (token ratchet, adr-index, adr-symbol-anchors, skill-examples, skill-eval-tokens, the field-ui-readonly.test.ts pin) sit in those pending families: this record does not stand in for them.

② Semver level

@objectstack/spec patch and @objectstack/skills patch. A refusal message gaining a pointer, with no accept-set or export change, is a patch; skill prose and one eval case are a patch. The changeset matches what the diff publishes. Check Changeset: success.

Clause-②: no — holds. Present on the PR body and in the changeset, with Metadata-protocol: none; nothing in the diff narrows or widens what parses.

③ Boundary flags

④ Design judgment

packages/spec/src/data/field.zod.ts against the card's Done-when ("the refusal text for uiReadonly + readonly points at the ADR") and its first consumer (objectstack validate prints the issue message). The tail names the record and the two D-items that answer the reader's question, in the form the spec's other messages use. D1 and D6 of the record say what the message says. Holds.

packages/spec/src/data/field-ui-readonly.test.ts (implementing). Pins the head of the message and now its tail, anchored at the end. Agrees with the contract.

docs/adr/0163-…md against the card's Asked §1, item by item, and the code it cites on main:

  • two tiers, set-once as readonlyWhen true: D1, D2. stripReadonlyWhenFields is not run on insert (readonlyWhenBindings docblock: "INSERT is exempt from the strip entirely"), which is what makes it set-once. Holds.
  • two levels, field over object: D3 matches effectiveUiReadonlyWhen and declaresOwnHandLock in ui/packages/core/src/evaluator/handLock.ts sentence by sentence, the uiReadonly: false case and "a server lock is not a hand-lock declaration" included. Holds.
  • by hand and not by hand: D4 matches the card's list; the As built surfaces match the handLock.ts header and the uiReadonly describe. Holds.
  • the ui-prefix admission rule, uiVisibleWhen / uiRequiredWhen refused: D5. Holds; "refused" is by the rule (neither key exists, a strict parse answers unknown key), which the PR body states and the card's wording allows.
  • contradictions: D6 matches the refinement and its comment. Holds.
  • the strip stays a strip: D7 matches applyDroppedFieldsHeader and ReadonlyFieldRejectedError. Holds.
  • As built, spot-read: validate-expressions.ts judges a field's and an object's uiReadonlyWhen; object-schema-fls-references.ts serves the lock closed to a caller who cannot read an operand; mcp.ts describeServedObject serves the hand lock under its own keys; the dogfood file proves the PATCH, import and declarative-action doors and the readonly control. All present on main as described.
  • Builds-on citations: ADR-0085 §2 (admission test, "fails if its honest name contains a page name"), ADR-0092 (finding 1, readonly as a UI hint), ADR-0137 D2, ADR-0162 (Proposed, a record lock that refuses): each says what the record says it says. All seven linked files exist.
  • First consumer and execution plan: the consumer is the refusal message, which lands here; the three unheld points each name an open carrier. Status Accepted on a ruling that predates the PR, landing by Tier H approval, is consistent with the card's Done-when.
  • Tried to break: D1 "no client may write" against a system writer and against a script action. The record's own Alternatives row says a script action runs in a system context and so writes a readonly field; that is true on main (packages/runtime/src/sandbox/script-runner.ts: an action body runs elevated). The ADR is consistent with itself and the code here. See S1 for the skill.

docs/adr/README.md. Generated; one row, counts consistent. Holds, subject to the pending adr-index gate.

skills/objectstack-data/rules/validation.md against eval case 30's prompt and the spec on main:

  • The table, the example (keys, sharingModel value, P constants) and the five bullets agree with FieldSchema, ObjectSchemaBase and the engine: readonly: true exempts isSystem writes, readonlyWhen does not exempt them and is not judged on a create, an import is not system-context (the readonly describe: "A normal (non-system) import is NOT system-context and still strips"). The corrected sentence was wrong on main and is right here.
  • The left-column bullet says "a declarative action", which is exact.
  • Cuts: the removed enterprise_requires_manager example is referenced nowhere else in skills/, scripts/ or content/; the remaining example shows when / then / otherwise. No taught fact is lost.
  • N1 (nit) — the table's left column is headed "Every non-system write" over both rows, while readonlyWhen also binds system-context writes; the bullet under it says so ("holds for everyone"). The header reads narrower than the row. Accepted deviation or a follow-up; no effect on what an author declares.

skills/objectstack-data/SKILL.md:

  • S1 (should-fix) — the first bullet of Conditional Field Rules now reads "readonlyWhen and readonly: true drop the value; they do not refuse the write, a button's action included." For readonly: true that is true of a declarative action only. A type: 'script' action's body runs in a system context and its write to a readonly: true field lands: script-runner.ts on main, and this PR's own ADR, Alternatives row 3 ("readonly plus a script action, which runs in a system context: the button works"). The sentence it replaced on main carried the qualifier ("binds non-system writes only"), and the section it routes to says "a declarative action". SKILL.md is the always-loaded file, so the unqualified form is what an author model reads first, and it contradicts the record landing beside it. Fix: qualify the clause ("a declarative action's write included"), then re-measure the 2223 row.
  • The routing link and anchor (./rules/validation.md#locking-a-field) resolve to the new heading. Holds.

skills/objectstack-data/evals/objects-fields-relationships.json, case 30, and evals/README.md. The prompt is the card's hotcrm#2716 scenario; the expected output is correct for the declarative Confirm it describes and both must_contain tokens are taught by the new section. README names the case. Holds. Once S1 is fixed the prompt needs no change.

scripts/check-skills-token-ratchet.mjs (implementing). Two rows, each with its formula line; SKILL.md lowered to the measurement, validation.md raised by the measured remainder after cuts in the same file, under the standing ruling the file already cites (6513306068). Agrees with the amended claim. The S1 fix moves the SKILL.md row again.

One should-fix (S1), one nit (N1), no must-fix. S1's fix earns a delta review on the new head.

Implemented-by: claude/project-thread-bqsxpg
Reviewed-by: session_01L6bhgV6i8jfWwSXjpWJrjA

VERDICT: PASS

…ock table says which row a system write passes

Contract review of the previous head, one should-fix and one nit:

- skills/objectstack-data/SKILL.md: "a button's action included" was true of
  a declarative action only; a script action's body runs in a system context
  and its write to a readonly: true field lands. The clause now reads "a
  declarative action's included". The ratchet row follows to the
  measurement, 2224.
- skills/objectstack-data/rules/validation.md: the lock table's left column
  was headed "Every non-system write" over readonlyWhen too, which binds
  system writes as well. The header is "Every write" and the readonly: true
  cell carries "(system writes pass)"; the Confirm sentence names a
  declarative Confirm. 15448 bytes, the row stays 3862.

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 6e397de7845d8b00a51a7c57dc7c97ac00a70788
Local-runs: none
Scope: packages/spec/src/data/field.zod.ts, docs/adr/0163-field-write-locks-two-tiers-two-forms-two-levels-ui-prefix-admission.md, docs/adr/README.md, skills/objectstack-data/SKILL.md, skills/objectstack-data/evals/README.md, skills/objectstack-data/evals/objects-fields-relationships.json, skills/objectstack-data/rules/validation.md + packages/spec/src/data/field-ui-readonly.test.ts, scripts/check-skills-token-ratchet.mjs
Security-touching: yes

Delta review of record 7248470779 (head 0922ab3a). The new head is one commit on top of it (6e397de7, parent 0922ab3a, compare status ahead 1 / behind 0, no force-push). The delta touches four files: skills/objectstack-data/SKILL.md, skills/objectstack-data/rules/validation.md, scripts/check-skills-token-ratchet.mjs and the changeset. Every other hits file is byte-identical to the head record 7248470779 judged, and its judgment there stands on this head.

Security-touching stays yes for the reason the first record gives: the skill section and the ADR teach which writers a lock binds and where permissions sit beside it. The delta adds one such clause (which row a system write passes).

① Derived judgments

  • No accept-set or public-surface change in the delta: skill prose, two ratchet comment blocks with one cap, one changeset sentence. Right.
  • Ratchet rows: SKILL.md 8983 to 8923 bytes, 8896 priced, ceil(8896 / 4) = 2224; the bullet grows by 5 bytes over the prior head (8918 to 8923). validation.md 15447 to 15448 bytes, ceil(15448 / 4) = 3862, cap unchanged; the four edits net +1 byte (-11, -8, +21, -1). Arithmetic right; the measured bytes are the gate's to confirm (pending).

Gate verdicts on 6e397de7 at read time, 41 check-runs: success on PR-body guards, Governed Surface Queue Guard, Spec property liveness, Check Documentation Links, Check PR Size, Auto Label, Dogfood Regression Gate, filter; the opt-in and schedule families skipped by design. PENDING, not waited for: Check Changeset, Flag docs affected, Plan Test Core shards, Plan Test UI shards (Test Core shards not yet created), Build Core, Build UI Deps, Live E2E UI, Type Check (workspace, consumer gates, source gates, debt ledger), every Lint family. The gates that answer this delta directly (token ratchet, skill-examples, skill-eval-tokens, skill-links) sit in the pending families: this record does not stand in for them.

② Semver level

Unchanged: @objectstack/spec patch, @objectstack/skills patch. The changeset's sentence now says "a declarative action's own write is dropped", matching the skill. Check Changeset on this head: pending.

Clause-②: no — holds; the delta changes no parse behaviour.

③ Boundary flags

  • No new dev flag or open_questions entry on this delta.
  • The flags of record 7248470779 stand as answered there, including its two limits (the ruling-record quotes in the ADR were checked against the card and the code, not against the ruling records; whether another open pull claims 0163 was not read).
  • SQL push-down: nothing in the delta queries or joins.

④ Design judgment

S1: closed — skills/objectstack-data/SKILL.md now reads "readonlyWhen and readonly: true drop the value; they do not refuse the write, a declarative action's included." That is true of both keys on main and no longer covers a script action, whose body runs in a system context. It agrees with rules/validation.md ("a declarative action") and with the ADR's Alternatives row 3. The ratchet row is re-measured to 2224 with its formula line.

N1: closed — the table's left column is headed "Every write", the readonly: true cell carries "(system writes pass)", and the readonlyWhen cell stands under "Every write" bare, which is what the engine does (isSystem is not an exemption on the conditional strip) and what the bullet below says. The Confirm sentence now says "a declarative Confirm's write would be dropped".

Delta read for new matter, sentence by sentence:

  • "Only a person at the console" (was "editing at the console"): same meaning, shorter. Holds.
  • scripts/check-skills-token-ratchet.mjs (implementing): both comment blocks restate the new byte counts and formula lines consistently with the caps. Agrees.
  • The eval case, the ADR, the README row, field.zod.ts and its pin are untouched; case 30's expected output ("every non-system write ... the Confirm action's own update is such a write") stays correct for the declarative Confirm its prompt describes.

No must-fix, no should-fix.

Implemented-by: claude/project-thread-bqsxpg
Reviewed-by: session_01L6bhgV6i8jfWwSXjpWJrjA

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

席位核对 — ACCEPT · head 6e397de · card #37405 · area s2-data · 2026-11-29T01:32Z

L1 checklist

Tier: H. Landing: hand-off to the maintainer follows this record.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Tier H hand-off · 2026-11-29T01:33Z · head 6e397de · approver os-zhuang

维护者速读

@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 29, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 29, 2026 01:37
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 29, 2026
Merged via the queue into main with commit 038ccf5 Nov 29, 2026
86 of 87 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-bqsxpg branch November 29, 2026 02:04
@objectstack-fleet objectstack-fleet Bot removed the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 29, 2026
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 protocol:data security size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

3 participants