Skip to content

feat(cli): os migrate list-preferences deletes the stored ui.list.* preference rows the Console no longer reads - #36304

Merged
os-zhuang merged 5 commits into
mainfrom
claude/issue-35955-migrate-list-preferences
Nov 22, 2026
Merged

os-zhuang merged 5 commits into
mainfrom
claude/issue-35955-migrate-list-preferences

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread

Part of #35955

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:普通用户无感;运维人员升级后多了一个清理工具,可以删掉服务器上每个人旧的「列表个人偏好」数据(列宽、行高、标签页顺序,以及更早的排序和筛选)。
  • 为什么做:列表重做专题里「列表上的改动都是临时的、列宽只记在浏览器」这张卡,维护者定了已存下的偏好「清掉」,这是收尾的一步。
  • 出错会怎样:删的是已经没有任何地方读取的旧数据;默认只出报告不删,删之前强制写一份只有本人能读的备份文件并核对,误删可以从备份里找回,但平台不会自动恢复。
  • 要你做什么:这次会删除每个组织存量的旧列表偏好数据,按座位令由你本人审阅、批准并亲手合并。L1 ACCEPT 7075313108,契约 PASS 7075403391(head f4b177f,安全相关:是,按裁定的范围)。

What changes

A new operator command, os migrate list-preferences, deletes the per-reader list preference rows an earlier Console stored in sys_user_preference under ui.list.OBJECT. Since PR #36133 the Console no longer reads or writes them, and the maintainer ruled the stored rows cleared, not migrated (card item 6, verbatim: 「已存下的个人偏好不迁移:上线后服务端那一份不再读,所有人回到视图本来的样子,包括列宽、行高和标签页顺序。旧数据由升级脚本清掉。升级说明里写明。」; on stored sort/filter preferences: 「清掉」).

  • packages/cli/src/commands/migrate/list-preferences.ts (new, oclif-discovered, not exported from index.ts). Dry run by default: counts rows, readers and organizations, and per key the rows and readers holding it; never prints a value; boots read-only (the os migrate plan boot) and writes no row, table or file.
  • --apply deletes, only with --export PATH: every row the run deletes, as stored, written owner-only (0600, wx, never overwriting) and read back before the first delete; any failure there refuses the run with nothing deleted. Each delete is the engine's by-id delete in the system context. After the deletes the family is read again; any row still stored exits 1. A second run finds nothing, writes no export and exits 0.
  • packages/cli/src/utils/list-preference-sweep.ts (new): the read (driver-level, unscoped: every organization and every user, $startsWith: 'ui.list.'), the counts, the export document and its read-back check.
  • Precedent followed: os db orphans for the export (mandatory, owner-only, wx, read back, export_required / export_exists / export_failed / export_incomplete / confirmation_required, exit 1), the system-context by-id delete judged by read-back, the read-only report boot and the no-auto-run pin; the os migrate family for the command name, --apply, --yes, --force and the SQLite occupancy gate. Tenancy: every organization's rows, as os db orphans and os secret orphans read (driver-level, unscoped).
  • Confirmation: --apply without --yes asks once on a terminal; where stdin is not a terminal (or with --json) it reads nothing, deletes nothing and exits 1 naming --yes. That gate sits before the boot, as the os migrate family's confirmation pin requires.
  • sys_user_preference is declared by plugin-auth's identity objects, so the boot composes createIdentityObjectsPlugin() for its declarations only (the os user set-password shape): no auth manager, no hook, nothing started.
  • Docs: content/docs/deployment/cli.mdx (a Data migrations row and an os migrate list-preferences section) and content/docs/upgrading.mdx (an "Upgrading from 18.6.0 or earlier" note: run it once the upgraded Console is serving).
  • Changeset .changeset/35955-migrate-list-preferences.md, @objectstack/cli patch.

Not in this pull request: the sign-out keep (#36110), related-tab widths (#35892), the spec columnState retirement.

Read first (by risk)

  1. packages/cli/src/commands/migrate/list-preferences.ts, the --apply half from "The export, written and READ BACK" down: the export is written and checked before the first delete, and the outcome is judged by the read-back.
  2. packages/cli/src/utils/list-preference-sweep.ts, readListPreferenceRows: the delete set is exactly the driver's case-sensitive $startsWith answer for ui.list. (dot included).
  3. packages/cli/src/commands/migrate/list-preferences.integration.test.ts: the seeded survivors (ui.record.account, ui.recent, bare ui.list, ui.listx.account, UI.LIST.account).

Two-minute check

os migrate list-preferences --database-url file:PATH-TO-A-DB-WITH-UI-LIST-ROWS prints the rows per ui.list.* key and "Dry run only — no row or table was written or deleted."; adding --apply --export ./backup.json asks once, writes ./backup.json with mode 600, and prints "Deleted N sys_user_preference row(s)".

Tests

  • list-preferences.integration.test.ts (8 cases, real boot, real SQLite, rows in two organizations): the dry run's counts and a byte-identical database with no file; --apply --export deletes the four family rows in both organizations and keeps the five survivors, the export is mode 0600 and holds each row as stored; the first delete finds the export already complete on disk (order pin, with an injected refusal judged by read-back: exit 1, failed names it); a second run deletes nothing and writes no export; export_required, export_exists, export_failed and confirmation_required each exit 1 with nothing deleted.

  • list-preferences.no-auto-run.test.ts (5 cases, unit tier): no non-test source imports the command or its plan module; positive controls first (the scanner finds serve.ts's dynamic import of the boot migration gate, and the command's own import of its plan).

  • schema-migrate.one-shot-family.integration.test.ts: the command is added to the bootSchemaStack caller table (its first case would otherwise go red by file name); 5 new cases: the dry run leaves the database byte-identical and creates no missing SQLite file, --apply runs no seed write, and neither mode creates key material.

  • test/migrate-confirmation-exit.pin.test.ts: the command joins the family roster (--apply --export, confirm --yes); its text face without --yes off a terminal exits 1 with nothing written. Ablation on f4b177f6: the non-TTY gate disabled turns the pin red (1/60, "list-preferences - text face: exit 1").

Acceptance notes

  • The dispatch order said @objectstack/cli minor; the changeset is patch, because Metadata-protocol: none grades every introduced entry patch (check:changeset-no-major, AGENTS.md Post-Task Checklist step 3).
  • A first version re-filtered the driver's rows with an in-memory prefix test, on the belief that SQLite LIKE folds case. Ablating that filter stayed green (8/8): the driver's $startsWith is case-sensitive (textMatchPredicate without folding), so the second filter was removed rather than kept untested. The export read-back still judges each row's key.
  • Observation: the one-shot family pin's test-budget header says "134 cases"; vitest list counts 189 on this head (184 before this PR). Not touched here.
  • Out of scope, filed cli: os db orphans --delete and os secret orphans --delete in a non-interactive shell without --yes delete nothing, print "Aborted", and exit 0 — the migrate family exits 1 #36331: os db orphans --delete and os secret orphans --delete without --yes off a terminal print "Aborted" and exit 0 (read from source); they are outside the migrate family's confirmation pin.
  • Tests deleted, migrated or rewritten: none.

Verification

Head f4b177f6: CI green (40 success, 15 skipped by selector). On f4b177f6 locally: vitest run of test/migrate-confirmation-exit.pin.test.ts, the two list-preferences suites and test/exit-signal.pin.test.ts: Test Files 4 passed (4), Tests 220 passed (220); dispatch-gates --commands 103 families derived, 103 run, 0 unrun. The rest on head edcf4e1b unless noted. Local runs were narrowed, and said so here: the shared verification lock never reached this run for ~45 minutes (three 9-minute queue timeouts behind other worktrees' builds), so after the one locked build and typecheck the single-file test runs ran unlocked with --maxWorkers=1. The full @objectstack/cli unit and integration projects are CI's (Test Core).

Build and typecheck
  • pnpm --filter '@objectstack/cli^...' build under the lock: VERDICT command-exit 0.
  • pnpm --filter @objectstack/cli typecheck under the lock (tsc --noEmit and check:test-typecheck): VERDICT command-exit 0; "check:test-typecheck: OK".
Tests
  • pnpm --filter @objectstack/cli exec vitest run --maxWorkers=1 src/commands/migrate/list-preferences.integration.test.ts src/commands/migrate/list-preferences.no-auto-run.test.ts on edcf4e1b: Test Files 2 passed (2), Tests 13 passed (13).
  • The same two plus src/utils/schema-migrate.one-shot-family.integration.test.ts, test/exit-signal.pin.test.ts and test/vitest-tiers-partition.test.ts on d6d3bf8c (the last commit adds two module-top imports to the new suite only): Test Files 5 passed (5), Tests 371 passed (371). vitest list shows the five new family cases for migrate list-preferences.
Ablations (one-off, through scripts/ablation-replace.mjs; the tool proved the mutation landed and the restore equals HEAD)
  • The in-memory prefix re-filter (return rows.filter(...) replaced by return rows;) on 65c4733b: the integration suite stayed green, 8/8. Read as: the driver's $startsWith is already exact, so that filter was removed (commit d6d3bf8c).
  • The trailing dot dropped from the read ($startsWith: 'ui.list') on d6d3bf8c: 4 of 8 red. The dry run's counts differ; --apply refuses with export_incomplete naming s_bare and s_lookalike (the export read-back judges each key); the order pin's first delete is never reached; the re-run case exits 1. Restored: blob equals HEAD, git diff HEAD empty.
Gates (derived with dispatch-gates --commands; 102 families, all run, reconciled with --ran: 102 run, 0 unrun)
  • Exit 0: 94 families, among them check:cli-command-ids, check:cli-examples-parity, check:doc-anchors, check:doc-authoring, check:changeset-no-major --base origin/main, check:adr-0087-registration --base origin/main, check:empty-changeset, check:closing-keyword-parity, check:nul-bytes, check:type-check-coverage, check:system-context-census, check:cross-package-test-inputs, check:issue-citations.
  • check:test-source-alias: exit 1 on d6d3bf8c (the new suite reached @objectstack/platform-objects/plugin and @objectstack/plugin-security through dynamic imports in a clocked window); module-top imports added in edcf4e1b; re-run exit 0.
  • NOT MEASURED (exit 3, the gate's own prerequisite refusal, unrelated packages unbuilt in this worktree, a shallow clone, or the lock unreachable): check:plugin-teardown-shape --self-test (shallow clone), @objectstack/spec check:skill-examples, check:dual-build-cjs-loads, check:i18n, check:i18n-coverage, check:i18n-walk-parity, check:type-check-debt (lock queue timeout). CI runs them.

Generated by Claude Code

…preference rows (wip)

Claude-Session: https://claude.ai/code/session_01FEkQ5oY5WCqqqBMtn9qt7m
Co-Authored-By: Claude <noreply@anthropic.com>
… case-sensitive prefix match alone

The ablation of the second, in-memory prefix filter stayed green: the
driver's $startsWith already answers the family exactly.

Claude-Session: https://claude.ai/code/session_01FEkQ5oY5WCqqqBMtn9qt7m
Co-Authored-By: Claude <noreply@anthropic.com>
… module top in the list-preferences suite

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

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

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

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

  • content/docs/data-modeling/drivers.mdx (via OS_DATABASE_URL (literal, a string literal in flags))
  • content/docs/data-modeling/external-datasources.mdx (via OS_DATABASE_URL (literal, a string literal in flags))
  • content/docs/data-modeling/objects.mdx (via sys_user_preference (literal, a string literal in LIST_PREFERENCE_OBJECT))
  • content/docs/deployment/backup-restore.mdx (via OS_DATABASE_URL (literal, a string literal in flags))
  • content/docs/deployment/cli.mdx (via OS_DATABASE_URL (literal, a string literal in flags), database_busy (literal, a string literal in MigrateListPreferences), scan_failed (literal, a string literal in MigrateListPreferences), sys_user_preference (literal, a string literal in LIST_PREFERENCE_OBJECT), os migrate list-preferences (command, read off packages/cli/src/commands/migrate/list-preferences.ts))
  • content/docs/deployment/environment-variables.mdx (via OS_DATABASE_URL (literal, a string literal in flags))
  • content/docs/deployment/production-readiness.mdx (via OS_DATABASE_URL (literal, a string literal in flags))
  • content/docs/deployment/self-hosting.mdx (via OS_DATABASE_URL (literal, a string literal in flags))
  • content/docs/deployment/single-project-mode.mdx (via OS_DATABASE_URL (literal, a string literal in flags))
  • content/docs/getting-started/your-first-project.mdx (via OS_DATABASE_URL (literal, a string literal in flags))
  • content/docs/permissions/system-context.mdx (via sys_user_preference (literal, a string literal in LIST_PREFERENCE_OBJECT))
  • content/docs/plugins/index.mdx (via OS_DATABASE_URL (literal, a string literal in flags))
  • content/docs/ui/views.mdx (via sys_user_preference (literal, a string literal in LIST_PREFERENCE_OBJECT))
  • content/docs/upgrading.mdx (via sys_user_preference (literal, a string literal in LIST_PREFERENCE_OBJECT), os migrate list-preferences (command, read off packages/cli/src/commands/migrate/list-preferences.ts))

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

  • content/docs/releases/v15.mdx (via sys_user_preference (literal, a string literal in LIST_PREFERENCE_OBJECT))
  • content/docs/releases/v16.mdx (via sys_user_preference (literal, a string literal in LIST_PREFERENCE_OBJECT))
  • content/docs/releases/v17/17-5.mdx (via sys_user_preference (literal, a string literal in LIST_PREFERENCE_OBJECT))

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
  • 10 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 67 of 249 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 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; 123 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 — 40 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 8925d5bcb1a96beb59ff6ae35fada6f69f4f893d → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json 8925d5bcb1a96beb59ff6ae35fada6f69f4f893d

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

…nd exits 1 without --yes off a terminal

The migrate family's confirmation pin: a run that did not give its
confirmation applies nothing and exits 1, naming --yes.

Claude-Session: https://claude.ai/code/session_01FEkQ5oY5WCqqqBMtn9qt7m
Co-Authored-By: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5oY5WCqqqBMtn9qt7m

Final head for L1 · area a4-F · 2026-11-22T06:22Z
Head-sha: f4b177f
Checks: 55 check-runs on this head before the body edit, 40 success and 15 skipped, 0 failed (read now); the body edit reruns PR-body guards on the same head.
Declaration: Clause-②: no; Metadata-protocol: none; changeset @objectstack/cli patch (the claim's "minor" is superseded by the level rule; Check Changeset green). File surface beyond the claim: two existing family pins carry the new command's row (utils/schema-migrate.one-shot-family.integration.test.ts, test/migrate-confirmation-exit.pin.test.ts); they only deliver the claimed command.
Governed handling: this PR deletes stored data. L1 → thread L1-c; then the seat's Fable record and the four pieces; the maintainer merges. The area never readies or lands it.
Body: updated by the area for commit f4b177f6 (confirmation gate before the boot, roster row, verification) and the out-of-scope filing #36331.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5p6jXqGTcs8wueR5ma

席位核对 · L1-c · ACCEPT · head f4b177f6 · 2026-11-22T06:24Z

Read: the diff at f4b177f6 (merge-base a5a5312f, 9 files, +1022/-0) against l1-review-checklist.md; dispatch order seat4/a4-F/order-35955-3b.md (card item 6, 「清掉」, seat 1's claim 7064104023 scope); the precedent os db orphans; the engine and driver paths the delete rests on.

Mechanical face (l1-face.mjs --pr 36304). Draft, base main, Part of #35955, no closing keyword; changeset @objectstack/cli patch (the order's minor was graded down to patch under Metadata-protocol: none, as the body explains); Clause-②: no (oclif-discovered, nothing exported from index.ts). Lint & Repo Gates and TypeScript Type Check are success. Check Changeset was pending at the first read and finished success (run 137119119815). Every check at f4b177f6 is now 42 success and 17 skipped, with 0 failed.

The delete set is exactly the family (checked on the code).

  • The read is the driver's $startsWith: 'ui.list.', unscoped. The SQL arm is case-exact on every dialect (packages/core/src/utils/text-match-sql.ts dialectTextMatchSql): SQLite uses GLOB without lower() unless folding, Postgres and Oracle compare the plain column, MySQL uses CAST(… AS BINARY), and MSSQL uses its case-exact collation. So UI.LIST.account and ui.listx.account are out, as the integration suite seeds and holds.
  • Defence in depth: the export read-back (exportedIds) judges each key byte-exact with isListPreferenceKey. A folding driver would therefore refuse the run with export_incomplete rather than delete a stray row. The body's dot-dropped ablation shows exactly that refusal.
  • Live writers: on origin/main, ui.list appears in UI source only in a comment naming "the retired server row" (app-shell/src/views/listLayoutStore.ts:25). ui.record.<object> (RecordPreferencesProvider) is a separate family and untouched.

The delete itself. engine.delete(object, { where: { id }, context: { isSystem: true } }) is the precedent's own call (db/orphans.ts:319); a scalar where.id is the single-row delete. sys_user_preference carries the platform prefix, so recycleBinTakesObject keeps it out of the recycle bin. The delete is hard, and "the export is the only copy" (CLI text and docs) is true. The order is right: export written 0600 with wx, read back and checked, then deletes of only the exported ids, then a re-read judged by what is gone. Rows written after the export are counted unlisted and exit 1 without deletion.

Gates and boot. The confirmation gate sits before the boot and joins the family's migrate-confirmation-exit roster; the body's ablation turns that pin red. The dry run boots read-only (deferSchemaDdl + readOnlyProbe), and --apply takes the plain boot, as os db orphans --delete does. The no-auto-run pin has positive controls first.

Changeset and docs (read sentence by sentence): .changeset/35955-migrate-list-preferences.md, the content/docs/deployment/cli.mdx row and section, and the content/docs/upgrading.mdx note.

Noted, no action:

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5krBqrrgxCYgjXmfbv

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: f4b177f6c29fb39860ae7834ced27ca4114e2beb
Local-runs: none
Scope: no reviewFace hit in the committed tree (no governed path, no published schema; reviewed at tier on the seat's stored-data-delete order) + packages/cli/src/commands/migrate/list-preferences.ts, packages/cli/src/utils/list-preference-sweep.ts, packages/cli/src/commands/migrate/list-preferences.integration.test.ts, packages/cli/src/commands/migrate/list-preferences.no-auto-run.test.ts, packages/cli/test/migrate-confirmation-exit.pin.test.ts, packages/cli/src/utils/schema-migrate.one-shot-family.integration.test.ts
Security-touching: yes
Rule-change-verified: none

① Derived judgments

Read: the diff origin/main...f4b177f6 (9 files, +1022/−0, merge base a5a5312ff4, the merge commit of PR 3a #36133), the card body and its 12 comments, the PR body, dev report 7075257646, L1-c record 7075313108, #24949 and its pin, and the cited code outside the diff (read, not reviewed). The head's check-runs: 42 success, 17 skipped, none red. The PR is a draft, mergeable_state clean.

  1. The delete set is the retired family and nothing beside it.
    • The family's key. At a5a5312f^, ListPreferencesProvider.tsx:125,129 writes ui.list. plus the object name and nothing else, and :449 together with ConsoleShell.tsx:430 loads every row under that prefix as list state. So the prefix was the family's own namespace, not a shared one.
    • Other preference families at the head: ui.record., ui.recent, ui.favorites, ui.app.last, ui.flow.palette.recents. None starts with ui.list.. The related-tab widths of 相关子表的页签改成完整的列表:左上子表名、排序和筛选、底部计算行;去掉「在列表中打开」;改过后出现「放弃」(图 41) #35892 sit in the ui.record. row (RelatedList.tsx:1521).
    • The command issues two queries and no third: the family read (readListPreferenceRows: object sys_user_preference, key $startsWith ui.list.) and the by-id delete on the same object. No other table and no other settings row is named anywhere in the diff.
    • The read is case-exact and escaped on every SQL dialect (packages/core/src/utils/text-match-sql.ts: SQLite GLOB without lower(), Postgres and Oracle the plain column, MySQL a binary cast, MSSQL a binary collation). The SQL driver's find applies no default row cap, so the read is the whole family.
    • A second guard that does not depend on the driver: the ids to delete must each be in the export as read back from disk, and exportedIds admits a row only when isListPreferenceKey passes byte for byte. A driver that returned a stray row would end in export_incomplete with nothing deleted.
    • The delete: engine.delete(object, { where: { id }, context: { isSystem: true } }), one call per exported id, the call db/orphans.ts makes. A scalar where.id is the single-row path. No object declares a reference to sys_user_preference, so no cascade follows. The platform prefix keeps the object out of the recycle bin (recycle-bin/capture.ts:85), so the delete is hard and "the export is the only copy" is true.
  2. Scope by organization, user and kind. Every organization and every user, on purpose: card item 6 (「所有人回到视图本来的样子」) and the maintainer's 「清掉」. The read is driver-level and unscoped; the delete runs as the system. The kind is the key prefix alone. The integration suite seeds two organizations and holds five survivors (ui.record.account, ui.recent, bare ui.list, ui.listx.account, UI.LIST.account).
  3. Safe by default.
    • Default run: a dry run on the read-only boot (deferSchemaDdl, readOnlyProbe), counts per key, never a value.
    • --apply needs --export; the export is written 0600 with wx, read back and checked before the first delete.
    • Count before deleting: the plan and "Deleting N row(s)" print before the export and the first delete.
    • Confirmation: --yes, or one prompt on a terminal.
    • Non-zero exits: export_required, export_exists, database_busy, confirmation_required, the text face off a terminal, boot_failed, no_engine, export_failed, export_incomplete, scan_failed, and any row still stored after the deletes all exit 1.
    • Idempotent: a second run reads zero rows, writes no export and exits 0 (pinned).
    • Outcome judged by a re-read of the family, not by what a delete returned.
  4. The os migrate apply --allow-destructive in a non-interactive shell without --yes applies nothing, prints "Confirmation required", and exits 0 — a script reads success, while os migrate comment-reactions --apply without --yes exits 1 #24949 family rules hold. The command is in the discovered population and carries its roster row (--apply --export, confirm --yes, writes BOOT). Its gate sits before the boot. Off a terminal without --yes it exits 1 and names --yes; under --json it answers confirmation_required with exit 1. A decline at the prompt exits 0, which is the pin's own control ("an operator's decline is a choice").
  5. Ordering with PR 3a: no live reader. PR 3a is the merge base. At the head and at origin/main 99fbaa6d18, ui.list appears in source only as a comment (listLayoutStore.ts:25). The Console change and this command are both unreleased (@objectstack/cli is 18.6.0, and the two 在列表上的改动都改成临时的(排序、筛选、分组、列的显示和顺序):立即生效但不保存,出现「放弃」和「保存」;列宽、行高、标签页顺序只记在浏览器里;退掉服务端的个人列表偏好 #35955 Console changesets are still pending), so "Upgrading from 18.6.0 or earlier" is right. A run against a Console older than 3a breaks no screen: a reader with no row is the state every new user starts in, and the older Console writes the rows again, which the docs and the exit-1 re-read both say.
  6. Pins and ablations, read against the code.
    • The integration suite runs a real boot on real SQLite; its order pin intercepts ObjectQL.prototype.delete and proves the export is complete on disk at the first delete.
    • The no-auto-run pin has positive controls first (serve.ts's dynamic import, and the command's own import of its plan).
    • Ablation 2 (trailing dot dropped, 4 of 8 red) matches the code: the two look-alike rows enter the read, the dry-run counts move, exportedIds refuses them, the order pin is never reached and the re-run case exits 1; the four refusal cases stop before the read and stay green.
    • Ablation 3 (non-terminal gate disabled) matches too: the text face falls through to confirm(), which answers false off a terminal, prints "Aborted" and exits 0.
    • Ablation 1 (the in-memory re-filter stayed green and was removed) is consistent with the case-exact read. I did not re-run any of them.
  7. Docs and changeset, sentence by sentence. The cli.mdx row and section, the upgrading.mdx note and the changeset each match the code: flags, the 0600 no-overwrite export, exit codes, "reads every organization's rows", "never run for you", re-runnable. The PR body's "40 success, 15 skipped" predates the body edit that re-ran the PR-body guards; the head now reads 42 and 17.

② Semver level

@objectstack/cli patch is right. Metadata-protocol: none is true: nothing a metadata author can write changes, and none takes patch (AGENTS.md, Post-Task Checklist step 3). Clause-②: no is true by the rule in contract-review.md: the published surface is the package's exports map (., ./console, ./hook-body), and the diff adds nothing to packages/cli/src/index.ts; the command is reached by oclif discovery only. It is not a narrowing: no declared capability is taken from any consumer, and the rows it deletes have no reader. No ADR-0087 disposition is owed. Precedent is mixed and consistent with this reading: #29615 (a new os migrate command) declared no; #25039 declared a widening for a new exported ObjectQL method.

③ Boundary flags

  • Governed handling. No path in the diff is on the governed register, so the queue guard does not hold this PR by path. It is held by the seat's order (claim 7073280272: a stored-data delete lands only by the maintainer's hand) and the PR body asks for that. It is treated as governed: draft, unarmed, unqueued. This record does not ready it.
  • Security-touching: yes. The changed hunks teach tenant-isolation behaviour: an unscoped driver-level read of every organization's rows, deletes in the system context across organizations, and one export file holding rows of every organization. That scope is the ruled one and matches os db orphans and os secret orphans; the line is yes because the hunks state it, not because it is wrong.
  • Rule-change-verified: none. No hunk changes what an agent may do without the maintainer, the order of work, or what goes to him. The diff touches no .claude/** path, so the line carries no landing weight here.
  • Dev deviations, each answered.
    • Changeset patch where the order said minor: correct, see ②.
    • Two family pins outside the claimed file list: both go red by name until a new member is rostered; they deliver the claimed command only.
    • Local runs narrowed because the shared lock timed out: stated in the body; the head's own check-runs carry Test Core on all ten shards.
    • PR body written at edcf4e1b: since updated by the area for f4b177f6 (record 7075287677); the body now describes the gate before the boot.
    • Model-free commit trailers and the AGENTS.md footer: within AGENTS.md.
    • First push before overlap-check: an empty branch, nothing to overlap.
  • open_questions: none. security_findings: none agrees with this read. The out-of-scope item is filed as cli: os db orphans --delete and os secret orphans --delete in a non-interactive shell without --yes delete nothing, print "Aborted", and exit 0 — the migrate family exits 1 #36331.
  • SQL push-down check. The command materialises every family row and deletes by id, one call per row. A reason is given for --apply and it holds: the export must hold each deleted row as stored, and the delete set must be exactly the exported ids, so a predicate delete would also remove rows written after the export. The dry run has no such reason; see N2.

④ Design judgment

Judged against the card (item 6 and 「清掉」), the #24949 family rules and the os db orphans precedent: the design holds. The command deletes what was ruled cleared, cannot delete a row it has not first written to disk and read back, and reports honestly when rows remain.

No must-fix, no should-fix.

  • N1 (nit) — the terminal prompt is asked before the boot, so before the run has counted anything; the count prints after the answer and before the first delete. This is the family's shape (the pin: "most gates sit before the boot"; security-catalog-overlays --apply, which also deletes, among them) and it has a reason: a declined run then boots nothing, where a plain --apply boot would already have run its schema sync. os db orphans asks after showing its count. The docs say dry run first, and the prompt names the whole family. A later pass could add "run without --apply to see the count" to the question.
  • N2 (nit) — the dry run reads whole rows, values included, to produce counts it could ask the database for (a projection of id, key, user_id, organization_id, or a grouped count). The values never leave the process. On a large deployment --apply also holds the whole family in memory and deletes row by row outside a transaction; a partial run is safe to repeat.
  • N3 (nit) — planListPreferenceSweep counts a null organization_id or user_id as one organization or reader, so a deployment whose rows carry no organization reports "1 organization(s)".
  • N4 (nit) — --export without --apply is accepted and unused, yet an existing file at that path refuses the dry run with export_exists.
  • N5 (nit) — the no-auto-run pin reads import specifiers inside packages/cli/src; a caller that reached the command by its oclif id would not be seen. Same reach as the db/orphans pin it copies.
  • N6 (nit) — the new cli.mdx table row sits before comment-parent-pair; cosmetic, already noted by L1-c.

Implemented-by: claude/issue-35955-migrate-list-preferences
Reviewed-by: session_01FEkQ5krBqrrgxCYgjXmfbv

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#4 · os-project-manager · session_01FEkQ5krBqrrgxCYgjXmfbv

席位核对

Awaiting the maintainer's merge (seat order: stored-data delete) · 2026-11-22T06:34Z · head f4b177f6c29fb39860ae7834ced27ca4114e2beb

@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 22, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 22, 2026 07:19
@os-zhuang
os-zhuang enabled auto-merge November 22, 2026 07:20
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit 482afcc Nov 22, 2026
68 of 69 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-35955-migrate-list-preferences branch November 22, 2026 07:38
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 pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants