You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f32b7d6
Browse filesBrowse the repository at this point in the historyBrowse files
fix(cli): os migrate meta --from 18 names the 18.x its own-field-row answer describes (#39403)
<!-- claude-projects-attribution: {"github_login":"os-bill"} -->
_Requested by **Bill** · [project
thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wgQwQhn6sVVyeM8UEmMGvRnK)_Fixes#39176
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 用户能看到什么变化:开发者用迁移预演从 18 升到 19 时,"自己设了隐藏/只读字段的权限集"清单会写明它描述的是 18.3–18.6
的结果,并附一段说明早期 18.x 的不同之处。
- 为什么做:清单把所有 18.x 都按 18.6 写,从 18.0–18.2 升级会被告知一个不会发生的收窄,从 18.3–18.5
升级会悄悄丢一个读权限却不点名。
- 出错会怎样:只改提示文字,迁移本身写什么不变;可直接撤回。
- 要你做什么:无。
## What changes
`os migrate meta --from 18` cannot tell which 18.x a source last ran on
(`--from` names a major). The own-field-row list printed a "protocol 18"
answer that is the one 18.3.0 to 18.6.0 give, and the step-19 semantic
entry described only that span. Measured on the published
`@objectstack/core` tarballs: `superuserFieldVote` is absent from 17.7.0
to 18.2.0 and present from 18.3.0; `declaresOwnReadMask` ships only in
18.6.0.
This takes the card's second shape (the text names the 18.x it
describes, and a short note covers the earlier ones; precedent:
"Upgrading from 18.5.0 or earlier" in `content/docs/upgrading.mdx`). No
contract changes: no type, key or exported symbol moves.
- `packages/cli/src/utils/own-field-row-narrowing.ts`: the list header
says its protocol-18 answer is 18.3.0 to 18.6.0's and points at the View
All and Modify All manual change; each row reads `protocol 18: read and
edit on 18.3.0 to 18.6.0 (…)`.
-
`packages/spec/src/migrations/entries/semantic/19.permission-view-all-modify-all-cast-no-field-vote.ts`:
the SOURCE paragraph carries the note, printed in every run that crosses
into 19 whether the list is empty or not. 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. Before 18.3.0, neither bit cast a field vote, so a listed
row already answered as it does on 19. The STORED paragraph says the
same note holds for a deployment last run on an earlier 18.x. The "Until
19" sentence reads "From 18.3.0 until 19". The acceptance criteria's
"Beside View All that restores every read" names 18.6.0 and the 18.3.0
to 18.5.0 row.
- `packages/spec/src/conversions/own-field-rows-beside-modify-all.ts`:
module header and the `OwnFieldRowProtocol18Outcome` docblock say which
releases the answer describes ("Which 18.x the answer describes").
- `.changeset/39176-own-field-row-18x-note.md`: patch,
`@objectstack/spec` and `@objectstack/cli`.
- `packages/cli/test/migrate-meta-own-field-row-38924.test.ts`: the
fixture run now asserts the header's release span, the row's `read and
edit on 18.3.0 to 18.6.0`, and both lines of the earlier-18.x note.
The review follow-ups on the same files (#39177) are not in this PR.
## Tests
<details><summary>Measurement before the fix (built CLI, head
850d240)</summary>
- An 18.2-shaped source (View All + Modify All on `contact`, own
`'contact.salary': { readable: false }`): the list printed `protocol 18:
read and edit`. On core 18.2.0 the set never read `salary` (no field
vote).
- An 18.4-shaped source (View All alone, the same own row): nothing
listed. On core 18.4.0 the set read `salary` over its own row, and on 19
the row binds, so that read is lost silently.
</details>
<details><summary>After the fix (head 0e3ecec; pin added at
ecc8685)</summary>
- 18.2-shaped source: the header names 18.3.0 to 18.6.0, the row prints
`protocol 18: read and edit on 18.3.0 to 18.6.0 (…)`, and the manual
change carries the before-18.3.0 note.
- 18.4-shaped source: the manual change prints `from 18.3.0 to 18.5.0
View All also read a field over the set's own readable: false row … that
row now hides its field and is not listed: delete it where the set's
holders should still read the field`.
- `pnpm --filter @objectstack/cli exec vitest run
test/migrate-meta-own-field-row-38924.test.ts
test/migrate-meta-engine-guidance.test.ts
src/commands/migrate/meta.stored-view-all-fields.test.ts`: 3 files, 10
tests passed.
- `pnpm --filter @objectstack/spec exec vitest run src/conversions
src/migrations`: 35 files, 1136 passed, 2 todo.
- `pnpm --filter @objectstack/metadata-protocol exec vitest run
src/stored-own-field-rows`: 2 passed.
- At ecc8685: `test/migrate-meta-own-field-row-38924.test.ts` 4 passed.
Ablation: with the row's text reverted to `read and edit (Modify All …)`
on disk, the case went red (`expected … to contain 'protocol 18: read
and edit on 18.3.0 …'`); restored.
- `pnpm --filter @objectstack/spec run typecheck` and `pnpm --filter
@objectstack/cli run typecheck`: exit 0.
</details>
<details><summary>Derived gates (head 0e3ecec)</summary>
`node scripts/pm/dispatch-gates.mjs --commands`: 88 commands derived, 88
run (`--ran` reconciliation: 88 derived, 88 run, 0 unrun); 84 exit 0.
Four did not measure, all for prerequisites outside this diff:
- `node scripts/check-plugin-teardown-shape.mjs --self-test`: shallow
clone, the fixture commit is unreachable;
- `pnpm check:dual-build-cjs-loads`: needs a whole-workspace build
(`packages/qa/scenarios/dist` absent);
- `pnpm check:i18n-coverage`: `examples/app-showcase` needs
`@objectstack/service-print` built;
- `pnpm check:query-options-erasure`: self-test passed; the repo-wide
lint pass ran past the 150 s local cap.
CI runs all four.
</details>
## Acceptance notes
- The tool still cannot ask which 18.x a source last ran on. The first
shape the card names (an answer true for the source's own 18.x) would
need a new input, and with it a contract change, so it is not taken
here.
- The `--stored` review line
(`packages/metadata-protocol/src/stored-own-field-rows.ts`) still prints
"protocol 18 read and edit". The step-19 entry's STORED paragraph
carries the note for it. The file is outside the card's landing points,
so it is left alone here.
## Verification
Read first: the SOURCE paragraph of the step-19 semantic entry (the
note), then `printOwnFieldRowNarrowing`.
Two-minute check: `pnpm --filter @objectstack/cli exec vitest run
test/migrate-meta-own-field-row-38924.test.ts`. Expected: 4 passed,
including the release span and both earlier-18.x note lines.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Utp6CYAcXpQMmT3KPQGzfJ
<!-- signed: repo:objectstack@os-bill · os-bill ·
session_01Utp6CYAcXpQMmT3KPQGzfJ -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
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`) 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.
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.
0 commit comments