From 2a063ee81491085910bb0d41d08aeec6b948045f Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 3 Dec 2026 14:42:57 +0000 Subject: [PATCH 1/3] 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 Claude-Session: https://claude.ai/code/session_01Utp6CYAcXpQMmT3KPQGzfJ --- .changeset/39176-own-field-row-18x-note.md | 17 ++++++++++++++ .../cli/src/utils/own-field-row-narrowing.ts | 17 ++++++++++---- .../own-field-rows-beside-modify-all.ts | 22 +++++++++++++++---- ...-view-all-modify-all-cast-no-field-vote.ts | 22 ++++++++++++++----- 4 files changed, 65 insertions(+), 13 deletions(-) create mode 100644 .changeset/39176-own-field-row-18x-note.md diff --git a/.changeset/39176-own-field-row-18x-note.md b/.changeset/39176-own-field-row-18x-note.md new file mode 100644 index 00000000000..c73546b8031 --- /dev/null +++ b/.changeset/39176-own-field-row-18x-note.md @@ -0,0 +1,17 @@ +--- +'@objectstack/spec': patch +'@objectstack/cli': patch +--- + +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 + +Clause-②: no +Metadata-protocol: none + +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. + +- **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. +- **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: + - 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; + - 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. +- 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. diff --git a/packages/cli/src/utils/own-field-row-narrowing.ts b/packages/cli/src/utils/own-field-row-narrowing.ts index a3379afd4c4..fad0c1889ad 100644 --- a/packages/cli/src/utils/own-field-row-narrowing.ts +++ b/packages/cli/src/utils/own-field-row-narrowing.ts @@ -7,14 +7,21 @@ * * The edit line the chain prints for such an entry is right: the bit keeps the * reads Modify All cast on every field the set's own rows leave alone. What it - * cannot keep is Modify All's vote OVER the set's own rows: up to protocol 18 a - * set with Modify All on `contact` and its own `'contact.salary': + * cannot keep is Modify All's vote OVER the set's own rows: from 18.3.0 to + * 18.6.0 a set with Modify All on `contact` and its own `'contact.salary': * { readable: false }` row read and edited `salary`; from 19 that row binds * and the field is hidden from the set's holders. Validate and build stay * green either way, so without a line naming the row the upgrade takes the * field away silently. The predicate is the spec's * ({@link ownFieldRowsBesideModifyAll}), shared with the `--stored` review * list; this module only walks a source stack for it and prints it. + * + * The protocol-18 answer printed is 18.3.0's to 18.6.0's: `--from` names a + * major, so the list cannot tell a source last run on an earlier 18.x. Its + * header says which releases it describes, and the step-19 semantic entry, + * printed in every run that crosses into 19 whether this list is empty or + * not, carries the note for 18.0.0 to 18.5.0 (see the spec predicate's + * "Which 18.x the answer describes"). */ import chalk from 'chalk'; @@ -82,7 +89,7 @@ export function ownFieldRowNarrowingSites( } const PROTOCOL_18: Record = { - 'read-and-edit': 'read and edit (Modify All voted over the set\'s own row)', + 'read-and-edit': 'read and edit on 18.3.0 to 18.6.0 (Modify All voted over the set\'s own row)', }; const PROTOCOL_19: Record = { @@ -105,7 +112,9 @@ export function printOwnFieldRowNarrowing(sites: readonly OwnFieldRowNarrowingSi if (sites.length === 0) return; console.log(chalk.bold(chalk.yellow( ` ${sites.length} own field row(s) beside Modify All that protocol 19 narrows — ` - + 'the `viewAllFields: true` written beside the bit does not keep them:', + + 'the `viewAllFields: true` written beside the bit does not keep them ' + + '(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 ' + + 'manual change on View All and Modify All below):', ))); for (const site of sites) { console.log( diff --git a/packages/spec/src/conversions/own-field-rows-beside-modify-all.ts b/packages/spec/src/conversions/own-field-rows-beside-modify-all.ts index 4400123e4ea..1f2da89eaa6 100644 --- a/packages/spec/src/conversions/own-field-rows-beside-modify-all.ts +++ b/packages/spec/src/conversions/own-field-rows-beside-modify-all.ts @@ -8,8 +8,9 @@ * * ## The shape * - * Up to protocol 18 Modify All (`modifyAllRecords`) voted `readable: true` and - * `editable: true` on every field of its object, OVER the set's own field rows: + * From 18.3.0 to 18.6.0, the last protocol-18 releases, Modify All + * (`modifyAllRecords`) voted `readable: true` and `editable: true` on every + * field of its object, OVER the set's own field rows: * a set holding Modify All on `contact` and its own `'contact.salary': * { readable: false }` row still read and edited `salary`. From 19 the bit * casts no field vote; the conversion `permission-view-all-fields-beside-record-bypass` @@ -40,11 +41,24 @@ * key (field rows have no wildcard, ruling of record 6912661484), so it is * inert on both sides of the split. * - * View All (`viewAllRecords`) alone is not this shape: up to 18 the set's own + * View All (`viewAllRecords`) alone is not this shape: on 18.6.0 the set's own * row already beat its own View All (ADR-0066 D2 ⑧, note of 2026-11-15), and * View All never voted an edit, so its own rows give the same answer on both * sides of the split. * + * ## Which 18.x the answer describes + * + * The protocol-18 answer is 18.6.0's, and 18.3.0's to 18.5.0's beside Modify + * All. A source last run on an earlier 18.x differs, and no predicate here can + * tell, since `--from` names a major only; the step-19 semantic entry + * (`permission-view-all-modify-all-cast-no-field-vote`) carries the note: + * - 18.3.0 to 18.5.0: View All also read over the set's own `readable: false` + * row, so such a row beside View All alone hides a field on 19 that it did + * not hide there, and this list does not name it; + * - 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 conversion + * writes opens a field another set hides. + * * ## Which entries * * Exactly the entries the conversion rewrites (it is run here, its emitted @@ -67,7 +81,7 @@ import { permissionViewAllFieldsBesideRecordBypass } from './entries/19/permission-view-all-fields-beside-record-bypass.js'; -/** What a holder of the set read and edited on the field through this set on protocol 18. */ +/** What a holder of the set read and edited on the field through this set on 18.3.0 to 18.6.0. */ export type OwnFieldRowProtocol18Outcome = 'read-and-edit'; /** What a holder of the set reads and edits on the field through this set on protocol 19. */ diff --git a/packages/spec/src/migrations/entries/semantic/19.permission-view-all-modify-all-cast-no-field-vote.ts b/packages/spec/src/migrations/entries/semantic/19.permission-view-all-modify-all-cast-no-field-vote.ts index 3f839a01ca5..7ab4100860a 100644 --- a/packages/spec/src/migrations/entries/semantic/19.permission-view-all-modify-all-cast-no-field-vote.ts +++ b/packages/spec/src/migrations/entries/semantic/19.permission-view-all-modify-all-cast-no-field-vote.ts @@ -30,7 +30,7 @@ export const entry: SemanticMigration = { + '`editable: true` field row in the set that should edit it.', reason: 'From protocol 19 View All (`viewAllRecords`) and Modify All (`modifyAllRecords`) widen RECORDS only and ' - + 'cast no field vote. Until 19 View All voted every field of the object readable and Modify All voted ' + + 'cast no field vote. From 18.3.0 until 19 View All voted every field of the object readable and Modify All voted ' + 'every field readable and editable, so one set\'s bit re-opened a field another set hid with ' + '`readable: false` and unlocked a field another set locked with `editable: false`. Reading every field ' + 'is now `viewAllFields: true`, which votes read on every field of the object (fields added later ' @@ -58,7 +58,14 @@ export const entry: SemanticMigration = { + 'own field row beside a Modify All bit it writes `viewAllFields: true` beside in that run, where the row ' + 'now hides its field, locks it (on every row or on the rows its `when` matches) or limits its edit to the ' + 'rows its `when` matches, with its protocol-18 and protocol-19 answer and the choice: change the row to ' - + 'keep the protocol-18 answer, or accept the narrowing. It names no row beside an entry that already ' + + 'keep the protocol-18 answer, or accept the narrowing. That protocol-18 answer is 18.3.0\'s to 18.6.0\'s; ' + + '`--from` names a major, so a source last run on an earlier 18.x is told it too, and differs: from 18.3.0 ' + + 'to 18.5.0 View All also read a field over the set\'s own `readable: false` row (18.6.0 lets the row ' + + 'bind), 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; 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. It names no row beside an entry that already ' + 'carries `viewAllFields` (a source the edit was applied to, by `--write` or by hand): review those rows ' + 'against the criteria below. The conversion replays only there: it is a default flip, ' + '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 = { + 'control today (it keeps the key when it saves a set that already carries it), so restore a stored ' + 'set\'s reads by adding `viewAllFields: true` to its entry through the metadata API. ' + '`os migrate meta --stored` lists every affected entry of a stored set (`viewAllFieldsReview`, read-only: ' - + 'it writes nothing), and under an entry with Modify All each own field row protocol 19 narrows beside it. ' - + 'The error direction is fewer fields seen, never a field opened.', + + 'it writes nothing), and under an entry with Modify All each own field row protocol 19 narrows beside it ' + + '(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 ' + + 'deployment last run on one). ' + + 'From a source last run on 18.3.0 or later the error direction is fewer fields seen, never a field ' + + 'opened.', acceptanceCriteria: 'Before or after moving a deployment to protocol 19, the one-step check, for every permission set in ' + 'source and every one stored in the deployment: the set is ' + 'affected when one of its `objects` entries, the `*` entry included, has `viewAllRecords: true` or ' + '`modifyAllRecords: true` and no `viewAllFields`. For each such entry whose holders should still read ' - + 'every field of the object, add `viewAllFields: true`. Beside View All that restores every read. Beside ' + + 'every field of the object, add `viewAllFields: true`. Beside View All that restores every read 18.6.0 ' + + 'gave (a source last run on 18.3.0 to 18.5.0 also read a field the set\'s own `readable: false` row ' + + 'hides: delete that row where they should still read it). Beside ' + 'Modify All it does not restore a field the same set\'s own `readable: false` row hides: that row now ' + 'hides the field from the set\'s holders, so delete it where they should still read the field. Sets in ' + 'source: run `os migrate meta --from 18 --write`, which adds the bit to every such entry, then delete it ' From 0e3ececebaeba15b91a1d72b85c10b5538c8c7db Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 3 Dec 2026 20:54:42 +0000 Subject: [PATCH 2/3] fix(cli): keep the earlier-18.x note to what the own-field-row list describes Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01Utp6CYAcXpQMmT3KPQGzfJ --- .changeset/39176-own-field-row-18x-note.md | 3 +-- .../src/conversions/own-field-rows-beside-modify-all.ts | 3 +-- ...19.permission-view-all-modify-all-cast-no-field-vote.ts | 7 ++----- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.changeset/39176-own-field-row-18x-note.md b/.changeset/39176-own-field-row-18x-note.md index c73546b8031..c1deed64d93 100644 --- a/.changeset/39176-own-field-row-18x-note.md +++ b/.changeset/39176-own-field-row-18x-note.md @@ -13,5 +13,4 @@ Who sees it: a developer running `os migrate meta --from 18` (with or without `- - **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. - **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: - 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; - - 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. -- 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. + - before 18.3.0 neither bit cast a field vote, so a listed row already answered as it does on 19. diff --git a/packages/spec/src/conversions/own-field-rows-beside-modify-all.ts b/packages/spec/src/conversions/own-field-rows-beside-modify-all.ts index 1f2da89eaa6..e0b261ecbf8 100644 --- a/packages/spec/src/conversions/own-field-rows-beside-modify-all.ts +++ b/packages/spec/src/conversions/own-field-rows-beside-modify-all.ts @@ -56,8 +56,7 @@ * row, so such a row beside View All alone hides a field on 19 that it did * not hide there, and this list does not name it; * - 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 conversion - * writes opens a field another set hides. + * answered as it does on 19. * * ## Which entries * diff --git a/packages/spec/src/migrations/entries/semantic/19.permission-view-all-modify-all-cast-no-field-vote.ts b/packages/spec/src/migrations/entries/semantic/19.permission-view-all-modify-all-cast-no-field-vote.ts index 7ab4100860a..d7926d52914 100644 --- a/packages/spec/src/migrations/entries/semantic/19.permission-view-all-modify-all-cast-no-field-vote.ts +++ b/packages/spec/src/migrations/entries/semantic/19.permission-view-all-modify-all-cast-no-field-vote.ts @@ -63,9 +63,7 @@ export const entry: SemanticMigration = { + 'to 18.5.0 View All also read a field over the set\'s own `readable: false` row (18.6.0 lets the row ' + 'bind), 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; 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. It names no row beside an entry that already ' + + 'listed row already answered as it does on 19. It names no row beside an entry that already ' + 'carries `viewAllFields` (a source the edit was applied to, by `--write` or by hand): review those rows ' + 'against the criteria below. The conversion replays only there: it is a default flip, ' + 'retired from the load path, so the authoring funnel skips it, and the artifact-ingestion door and every ' @@ -78,8 +76,7 @@ export const entry: SemanticMigration = { + 'it writes nothing), and under an entry with Modify All each own field row protocol 19 narrows beside it ' + '(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 ' + 'deployment last run on one). ' - + 'From a source last run on 18.3.0 or later the error direction is fewer fields seen, never a field ' - + 'opened.', + + 'The error direction is fewer fields seen, never a field opened.', acceptanceCriteria: 'Before or after moving a deployment to protocol 19, the one-step check, for every permission set in ' + 'source and every one stored in the deployment: the set is ' From ecc86859f701c48c1b4cbc6b36d2602686e0a1b4 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 3 Dec 2026 21:37:47 +0000 Subject: [PATCH 3/3] fix(cli): pin the 18.x release span of the own-field-row answer, and narrow the changeset to --from Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01Utp6CYAcXpQMmT3KPQGzfJ --- .changeset/39176-own-field-row-18x-note.md | 2 +- packages/cli/test/migrate-meta-own-field-row-38924.test.ts | 6 ++++++ .../src/conversions/own-field-rows-beside-modify-all.ts | 4 ++-- .../19.permission-view-all-modify-all-cast-no-field-vote.ts | 3 ++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.changeset/39176-own-field-row-18x-note.md b/.changeset/39176-own-field-row-18x-note.md index c1deed64d93..59c806d4b4f 100644 --- a/.changeset/39176-own-field-row-18x-note.md +++ b/.changeset/39176-own-field-row-18x-note.md @@ -8,7 +8,7 @@ fix(cli): `os migrate meta --from 18` says which 18.x release its own-field-row Clause-②: no Metadata-protocol: none -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. +Who sees it: a developer running `os migrate meta --from 18` (with or without `--write`) to move a project to protocol 19. The `--stored` review's rows are unchanged; the step-19 entry's note covers a deployment last run on an earlier 18.x. - **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. - **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: diff --git a/packages/cli/test/migrate-meta-own-field-row-38924.test.ts b/packages/cli/test/migrate-meta-own-field-row-38924.test.ts index e285b3c4326..af1efb8dc4d 100644 --- a/packages/cli/test/migrate-meta-own-field-row-38924.test.ts +++ b/packages/cli/test/migrate-meta-own-field-row-38924.test.ts @@ -138,6 +138,12 @@ describe('os migrate meta --from 18 — the own field rows beside Modify All pro expect(text).toContain('protocol 19: hidden, no read and no edit'); expect(text).toMatch(/choice: to keep the protocol-18 read and edit, .*otherwise accept the narrowing\./); expect(text).not.toContain('so their field reads are kept'); + // The protocol-18 answer names the releases it describes, and the step-19 manual change + // carries the note for a source last run on an earlier 18.x (`--from` names a major only). + expect(text).toContain('the protocol-18 answer is 18.3.0 to 18.6.0\'s'); + expect(text).toContain('protocol 18: read and edit on 18.3.0 to 18.6.0'); + expect(text).toContain('from 18.3.0 to 18.5.0 View All also read a field over the set\'s own `readable: false` row'); + expect(text).toContain('before 18.3.0 neither bit cast a field vote'); // The control set rides in the same stack and is not named. expect(text).not.toContain("permission set 'auditor'"); }, 60_000); diff --git a/packages/spec/src/conversions/own-field-rows-beside-modify-all.ts b/packages/spec/src/conversions/own-field-rows-beside-modify-all.ts index e0b261ecbf8..14175269093 100644 --- a/packages/spec/src/conversions/own-field-rows-beside-modify-all.ts +++ b/packages/spec/src/conversions/own-field-rows-beside-modify-all.ts @@ -48,8 +48,8 @@ * * ## Which 18.x the answer describes * - * The protocol-18 answer is 18.6.0's, and 18.3.0's to 18.5.0's beside Modify - * All. A source last run on an earlier 18.x differs, and no predicate here can + * The protocol-18 answer is 18.3.0's to 18.6.0's (beside Modify All they + * agree). A source last run on an earlier 18.x differs, and no predicate here can * tell, since `--from` names a major only; the step-19 semantic entry * (`permission-view-all-modify-all-cast-no-field-vote`) carries the note: * - 18.3.0 to 18.5.0: View All also read over the set's own `readable: false` diff --git a/packages/spec/src/migrations/entries/semantic/19.permission-view-all-modify-all-cast-no-field-vote.ts b/packages/spec/src/migrations/entries/semantic/19.permission-view-all-modify-all-cast-no-field-vote.ts index d7926d52914..cb2de4e92bf 100644 --- a/packages/spec/src/migrations/entries/semantic/19.permission-view-all-modify-all-cast-no-field-vote.ts +++ b/packages/spec/src/migrations/entries/semantic/19.permission-view-all-modify-all-cast-no-field-vote.ts @@ -30,7 +30,8 @@ export const entry: SemanticMigration = { + '`editable: true` field row in the set that should edit it.', reason: 'From protocol 19 View All (`viewAllRecords`) and Modify All (`modifyAllRecords`) widen RECORDS only and ' - + 'cast no field vote. From 18.3.0 until 19 View All voted every field of the object readable and Modify All voted ' + + 'cast no field vote. From 18.3.0 until 19 View All voted every field of the object readable (on 18.6.0 ' + + 'except over the set\'s own `readable: false` row) and Modify All voted ' + 'every field readable and editable, so one set\'s bit re-opened a field another set hid with ' + '`readable: false` and unlocked a field another set locked with `editable: false`. Reading every field ' + 'is now `viewAllFields: true`, which votes read on every field of the object (fields added later '