Skip to content

Commit 6e397de

Browse files
committed
docs(skills): the readonly trap names a declarative action, and the lock 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>
1 parent 0922ab3 commit 6e397de

4 files changed

Lines changed: 15 additions & 15 deletions

File tree

‎.changeset/37405-field-write-lock-adr-skill.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ docs(skills,spec): the `objectstack-data` skill teaches which of the four field
88
Clause-②: no
99
Metadata-protocol: none
1010

11-
`skills/objectstack-data/rules/validation.md` gains `## Locking a Field`: a two-by-two table of `readonly`, `readonlyWhen`, `uiReadonly` and `uiReadonlyWhen` (who is kept out, and when), one checked sales-order example, and what each column does at run time. The server lock (`readonly`, `readonlyWhen`) drops the value from every non-system write and answers success; the hand lock (`uiReadonly`, `uiReadonlyWhen`) stops the console offering the field while an action, an import and the API still write it, each write judged by the object's validations. A status field that only a Confirm action moves is `uiReadonly: true`; under `readonly: true` the action's own write is dropped. The section also covers the object-level `uiReadonlyWhen` and how a field replaces it, what a console create does with a `uiReadonly` field, and the refused pair.
11+
`skills/objectstack-data/rules/validation.md` gains `## Locking a Field`: a two-by-two table of `readonly`, `readonlyWhen`, `uiReadonly` and `uiReadonlyWhen` (who is kept out, and when), one checked sales-order example, and what each column does at run time. The server lock (`readonly`, `readonlyWhen`) drops the value from every non-system write and answers success; the hand lock (`uiReadonly`, `uiReadonlyWhen`) stops the console offering the field while an action, an import and the API still write it, each write judged by the object's validations. A status field that only a Confirm action moves is `uiReadonly: true`; under `readonly: true` a declarative action's own write is dropped. The section also covers the object-level `uiReadonlyWhen` and how a field replaces it, what a console create does with a `uiReadonly` field, and the refused pair.
1212

1313
One sentence the skill carried is corrected on the way: an import is not a system-context write, so `readonly: true` drops an imported value like any other client write. The two bullets that said otherwise are now one pointer at the new section, and `SKILL.md` § Conditional Field Rules routes there. `evals/objects-fields-relationships.json` gains case 30, a `uiReadonly` status field.
1414

‎scripts/check-skills-token-ratchet.mjs‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -914,14 +914,14 @@ export const CEILINGS = new Map([
914914
// `references/examples-objects.md` § Object Extension Model; the rule list `main` trimmed is
915915
// the routing table here). 8983 bytes on this tree, whose stamp line is 27 bytes: 8956 priced.
916916
// ceil(($(wc -c < skills/objectstack-data/SKILL.md) - 27) / 4) == ceil(8956 / 4)
917-
// 2239 -> 2223 (#37405, ADR-0163): LOWERED to the measurement. The first bullet of
917+
// 2239 -> 2224 (#37405, ADR-0163): LOWERED to the measurement. The first bullet of
918918
// `## Conditional Field Rules` keeps its trap (the value is dropped, the write is not
919-
// refused) and routes the choice of lock to `rules/validation.md` § Locking a Field in
920-
// place of the clause on which writers `readonly: true` binds, which that section now
921-
// carries. 8983 -> 8918 bytes (8956 -> 8891 priced), -65, -> 2223 tokens, pinned AT the
922-
// measurement.
923-
// ceil(($(wc -c < skills/objectstack-data/SKILL.md) - 27) / 4) == ceil(8891 / 4)
924-
['skills/objectstack-data/SKILL.md', 2223],
919+
// refused, a declarative action's included) and routes the choice of lock to
920+
// `rules/validation.md` § Locking a Field in place of the clause on which writers
921+
// `readonly: true` binds, which that section now carries. 8983 -> 8923 bytes (8956 ->
922+
// 8896 priced), -60, -> 2224 tokens, pinned AT the measurement.
923+
// ceil(($(wc -c < skills/objectstack-data/SKILL.md) - 27) / 4) == ceil(8896 / 4)
924+
['skills/objectstack-data/SKILL.md', 2224],
925925
// 5997 -> 6008 (the formula skills follow-ups of PRs #34443 and #34447): the
926926
// `label(record.f)` row teaches a multi-select (`multiple: true`) reading each
927927
// selected label in stored order, joined with `, `, and the built-ins line
@@ -1745,10 +1745,10 @@ export const CEILINGS = new Map([
17451745
// Rules become one pointer at the new section, which says the same once (and corrects their
17461746
// claim that an import is a system-context write); § Conditional Validation loses its first
17471747
// example and the lead-in of the second, whose `when` / `then` / `otherwise` rule shows
1748-
// everything the first did. -1035 bytes cut, +2621 added: 13861 -> 15447 bytes (+1586) ->
1748+
// everything the first did. -1035 bytes cut, +2622 added: 13861 -> 15448 bytes (+1587) ->
17491749
// 3862 tokens, no headroom to absorb any of it, ceiling +396, the measured remainder, pinned
17501750
// AT the measurement. Raise path 「A:先削重复,余额按实测提高」 (ruling record 6513306068).
1751-
// ceil($(wc -c < skills/objectstack-data/rules/validation.md) / 4) == ceil(15447 / 4)
1751+
// ceil($(wc -c < skills/objectstack-data/rules/validation.md) / 4) == ceil(15448 / 4)
17521752
['skills/objectstack-data/rules/validation.md', 3862],
17531753

17541754
// objectstack-platform

‎skills/objectstack-data/SKILL.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ over `record.*` (`P\`record.status == 'paid'\``), so every form and
8282
API write honours them.
8383

8484
- **`readonlyWhen` and `readonly: true` drop the value; they do not refuse the
85-
write**, a button's action included. A field that only actions, imports and
86-
the API change is `uiReadonly`
85+
write**, a declarative action's included. A field that only actions, imports
86+
and the API change is `uiReadonly`
8787
([Locking a Field](./rules/validation.md#locking-a-field)).
8888
- **`requiredWhen` is a transition gate, not an invariant**: it judges the
8989
write, not the stored row. A fact true of every stored record is a

‎skills/objectstack-data/rules/validation.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,9 @@ editable and the save succeeds without its change (logged); a formula reads
371371

372372
Two questions pick the key: who is kept out, and when.
373373

374-
| | Every non-system write | Only a person editing at the console |
374+
| | Every write | Only a person at the console |
375375
|:--|:--|:--|
376-
| Always | `readonly: true` | `uiReadonly: true` |
376+
| Always | `readonly: true` (system writes pass) | `uiReadonly: true` |
377377
| While a `record.*` predicate is TRUE | `readonlyWhen` | `uiReadonlyWhen` |
378378

379379
<!-- os:check -->
@@ -410,7 +410,7 @@ export const SalesOrder = ObjectSchema.create({
410410
- **Right column, the hand lock: forms, inline edit, grid cells and board or
411411
calendar drags do not offer the field, and every write still lands**,
412412
judged by the validations (a `state_machine` on `status`). Under `readonly`
413-
the Confirm action's own write would be dropped. Not security: whoever may
413+
a declarative Confirm's write would be dropped. Not security: whoever may
414414
edit the record can write the field through the API.
415415
- A console create leaves a `uiReadonly` field out: the record takes its
416416
`defaultValue`, and a `required` field without one fails the create.

0 commit comments

Comments
 (0)