Skip to content

Commit 2a063ee

Browse files
committed
fix(cli): os migrate meta --from 18 names the 18.x its own-field-row answer describes
The protocol-18 answer of the own field rows beside Modify All is 18.3.0's to 18.6.0's (core 18.0.0 to 18.2.0 ship no superuserFieldVote; 18.3.0 to 18.5.0 ship it without declaresOwnReadMask). The list header and row line name those releases, and the step-19 semantic entry, printed in every run that crosses into 19, carries the note for a source last run on 18.0.0 to 18.5.0. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CYAcXpQMmT3KPQGzfJ
1 parent 850d240 commit 2a063ee

4 files changed

Lines changed: 65 additions & 13 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@objectstack/spec': patch
3+
'@objectstack/cli': patch
4+
---
5+
6+
fix(cli): `os migrate meta --from 18` says which 18.x release its own-field-row answer describes, and what differs for a source last run on an earlier 18.x
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
Who sees it: a developer running `os migrate meta --from 18` (with or without `--write`) or `os migrate meta --stored` to move a project or deployment to protocol 19.
12+
13+
- **The own-field-row list names its releases.** The list of own field rows beside Modify All that protocol 19 narrows printed a "protocol 18" answer that is the one 18.3.0 to 18.6.0 give. Its header and each row's protocol-18 line now say so.
14+
- **The View All and Modify All manual change carries a note for an earlier 18.x.** `--from` names a major, so the tool cannot tell which 18.x a source last ran on. The note, printed in every run that crosses into 19 whether the list is empty or not, says what differs:
15+
- from 18.3.0 to 18.5.0 View All also read a field over the set's own `readable: false` row, so beside View All without Modify All that row now hides its field and is not listed: delete it where the set's holders should still read the field;
16+
- before 18.3.0 neither bit cast a field vote, so a listed row already answered as it does on 19, and the `viewAllFields: true` the command writes opens a field another set hides, which that source never did: delete it where the set should not read such fields.
17+
- The entry's "fewer fields seen, never a field opened" now holds only for a source last run on 18.3.0 or later, and says so.

‎packages/cli/src/utils/own-field-row-narrowing.ts‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,21 @@
77
*
88
* The edit line the chain prints for such an entry is right: the bit keeps the
99
* reads Modify All cast on every field the set's own rows leave alone. What it
10-
* cannot keep is Modify All's vote OVER the set's own rows: up to protocol 18 a
11-
* set with Modify All on `contact` and its own `'contact.salary':
10+
* cannot keep is Modify All's vote OVER the set's own rows: from 18.3.0 to
11+
* 18.6.0 a set with Modify All on `contact` and its own `'contact.salary':
1212
* { readable: false }` row read and edited `salary`; from 19 that row binds
1313
* and the field is hidden from the set's holders. Validate and build stay
1414
* green either way, so without a line naming the row the upgrade takes the
1515
* field away silently. The predicate is the spec's
1616
* ({@link ownFieldRowsBesideModifyAll}), shared with the `--stored` review
1717
* list; this module only walks a source stack for it and prints it.
18+
*
19+
* The protocol-18 answer printed is 18.3.0's to 18.6.0's: `--from` names a
20+
* major, so the list cannot tell a source last run on an earlier 18.x. Its
21+
* header says which releases it describes, and the step-19 semantic entry,
22+
* printed in every run that crosses into 19 whether this list is empty or
23+
* not, carries the note for 18.0.0 to 18.5.0 (see the spec predicate's
24+
* "Which 18.x the answer describes").
1825
*/
1926

2027
import chalk from 'chalk';
@@ -82,7 +89,7 @@ export function ownFieldRowNarrowingSites(
8289
}
8390

8491
const PROTOCOL_18: Record<OwnFieldRowProtocol18Outcome, string> = {
85-
'read-and-edit': 'read and edit (Modify All voted over the set\'s own row)',
92+
'read-and-edit': 'read and edit on 18.3.0 to 18.6.0 (Modify All voted over the set\'s own row)',
8693
};
8794

8895
const PROTOCOL_19: Record<OwnFieldRowProtocol19Outcome, string> = {
@@ -105,7 +112,9 @@ export function printOwnFieldRowNarrowing(sites: readonly OwnFieldRowNarrowingSi
105112
if (sites.length === 0) return;
106113
console.log(chalk.bold(chalk.yellow(
107114
` ${sites.length} own field row(s) beside Modify All that protocol 19 narrows — `
108-
+ 'the `viewAllFields: true` written beside the bit does not keep them:',
115+
+ 'the `viewAllFields: true` written beside the bit does not keep them '
116+
+ '(the protocol-18 answer is 18.3.0 to 18.6.0\'s; for a source last run on an earlier 18.x, see the '
117+
+ 'manual change on View All and Modify All below):',
109118
)));
110119
for (const site of sites) {
111120
console.log(

‎packages/spec/src/conversions/own-field-rows-beside-modify-all.ts‎

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
*
99
* ## The shape
1010
*
11-
* Up to protocol 18 Modify All (`modifyAllRecords`) voted `readable: true` and
12-
* `editable: true` on every field of its object, OVER the set's own field rows:
11+
* From 18.3.0 to 18.6.0, the last protocol-18 releases, Modify All
12+
* (`modifyAllRecords`) voted `readable: true` and `editable: true` on every
13+
* field of its object, OVER the set's own field rows:
1314
* a set holding Modify All on `contact` and its own `'contact.salary':
1415
* { readable: false }` row still read and edited `salary`. From 19 the bit
1516
* casts no field vote; the conversion `permission-view-all-fields-beside-record-bypass`
@@ -40,11 +41,24 @@
4041
* key (field rows have no wildcard, ruling of record 6912661484), so it is
4142
* inert on both sides of the split.
4243
*
43-
* View All (`viewAllRecords`) alone is not this shape: up to 18 the set's own
44+
* View All (`viewAllRecords`) alone is not this shape: on 18.6.0 the set's own
4445
* row already beat its own View All (ADR-0066 D2 ⑧, note of 2026-11-15), and
4546
* View All never voted an edit, so its own rows give the same answer on both
4647
* sides of the split.
4748
*
49+
* ## Which 18.x the answer describes
50+
*
51+
* The protocol-18 answer is 18.6.0's, and 18.3.0's to 18.5.0's beside Modify
52+
* All. A source last run on an earlier 18.x differs, and no predicate here can
53+
* tell, since `--from` names a major only; the step-19 semantic entry
54+
* (`permission-view-all-modify-all-cast-no-field-vote`) carries the note:
55+
* - 18.3.0 to 18.5.0: View All also read over the set's own `readable: false`
56+
* row, so such a row beside View All alone hides a field on 19 that it did
57+
* not hide there, and this list does not name it;
58+
* - before 18.3.0: neither bit cast a field vote, so a listed row already
59+
* answered as it does on 19, and the `viewAllFields: true` the conversion
60+
* writes opens a field another set hides.
61+
*
4862
* ## Which entries
4963
*
5064
* Exactly the entries the conversion rewrites (it is run here, its emitted
@@ -67,7 +81,7 @@
6781

6882
import { permissionViewAllFieldsBesideRecordBypass } from './entries/19/permission-view-all-fields-beside-record-bypass.js';
6983

70-
/** What a holder of the set read and edited on the field through this set on protocol 18. */
84+
/** What a holder of the set read and edited on the field through this set on 18.3.0 to 18.6.0. */
7185
export type OwnFieldRowProtocol18Outcome = 'read-and-edit';
7286

7387
/** What a holder of the set reads and edits on the field through this set on protocol 19. */

‎packages/spec/src/migrations/entries/semantic/19.permission-view-all-modify-all-cast-no-field-vote.ts‎

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const entry: SemanticMigration = {
3030
+ '`editable: true` field row in the set that should edit it.',
3131
reason:
3232
'From protocol 19 View All (`viewAllRecords`) and Modify All (`modifyAllRecords`) widen RECORDS only and '
33-
+ 'cast no field vote. Until 19 View All voted every field of the object readable and Modify All voted '
33+
+ 'cast no field vote. From 18.3.0 until 19 View All voted every field of the object readable and Modify All voted '
3434
+ 'every field readable and editable, so one set\'s bit re-opened a field another set hid with '
3535
+ '`readable: false` and unlocked a field another set locked with `editable: false`. Reading every field '
3636
+ 'is now `viewAllFields: true`, which votes read on every field of the object (fields added later '
@@ -58,7 +58,14 @@ export const entry: SemanticMigration = {
5858
+ 'own field row beside a Modify All bit it writes `viewAllFields: true` beside in that run, where the row '
5959
+ 'now hides its field, locks it (on every row or on the rows its `when` matches) or limits its edit to the '
6060
+ 'rows its `when` matches, with its protocol-18 and protocol-19 answer and the choice: change the row to '
61-
+ 'keep the protocol-18 answer, or accept the narrowing. It names no row beside an entry that already '
61+
+ 'keep the protocol-18 answer, or accept the narrowing. That protocol-18 answer is 18.3.0\'s to 18.6.0\'s; '
62+
+ '`--from` names a major, so a source last run on an earlier 18.x is told it too, and differs: from 18.3.0 '
63+
+ 'to 18.5.0 View All also read a field over the set\'s own `readable: false` row (18.6.0 lets the row '
64+
+ 'bind), so beside View All without Modify All that row now hides its field and is not listed: delete it '
65+
+ 'where the set\'s holders should still read the field; before 18.3.0 neither bit cast a field vote, so a '
66+
+ 'listed row already answered as it does on 19, and the `viewAllFields: true` the command writes opens a '
67+
+ 'field another set hides, which that source never did: delete it where the set should not read such '
68+
+ 'fields. It names no row beside an entry that already '
6269
+ 'carries `viewAllFields` (a source the edit was applied to, by `--write` or by hand): review those rows '
6370
+ 'against the criteria below. The conversion replays only there: it is a default flip, '
6471
+ 'retired from the load path, so the authoring funnel skips it, and the artifact-ingestion door and every '
@@ -68,14 +75,19 @@ export const entry: SemanticMigration = {
6875
+ 'control today (it keeps the key when it saves a set that already carries it), so restore a stored '
6976
+ 'set\'s reads by adding `viewAllFields: true` to its entry through the metadata API. '
7077
+ '`os migrate meta --stored` lists every affected entry of a stored set (`viewAllFieldsReview`, read-only: '
71-
+ 'it writes nothing), and under an entry with Modify All each own field row protocol 19 narrows beside it. '
72-
+ 'The error direction is fewer fields seen, never a field opened.',
78+
+ 'it writes nothing), and under an entry with Modify All each own field row protocol 19 narrows beside it '
79+
+ '(its protocol-18 answer is again 18.3.0\'s to 18.6.0\'s: the note on an earlier 18.x above holds for a '
80+
+ 'deployment last run on one). '
81+
+ 'From a source last run on 18.3.0 or later the error direction is fewer fields seen, never a field '
82+
+ 'opened.',
7383
acceptanceCriteria:
7484
'Before or after moving a deployment to protocol 19, the one-step check, for every permission set in '
7585
+ 'source and every one stored in the deployment: the set is '
7686
+ 'affected when one of its `objects` entries, the `*` entry included, has `viewAllRecords: true` or '
7787
+ '`modifyAllRecords: true` and no `viewAllFields`. For each such entry whose holders should still read '
78-
+ 'every field of the object, add `viewAllFields: true`. Beside View All that restores every read. Beside '
88+
+ 'every field of the object, add `viewAllFields: true`. Beside View All that restores every read 18.6.0 '
89+
+ 'gave (a source last run on 18.3.0 to 18.5.0 also read a field the set\'s own `readable: false` row '
90+
+ 'hides: delete that row where they should still read it). Beside '
7991
+ 'Modify All it does not restore a field the same set\'s own `readable: false` row hides: that row now '
8092
+ 'hides the field from the set\'s holders, so delete it where they should still read the field. Sets in '
8193
+ 'source: run `os migrate meta --from 18 --write`, which adds the bit to every such entry, then delete it '

0 commit comments

Comments
 (0)