Repository navigation
feat(cli): os migrate list-preferences deletes the stored ui.list.* preference rows the Console no longer reads - #36304
Conversation
…preference rows (wip) Claude-Session: https://claude.ai/code/session_01FEkQ5oY5WCqqqBMtn9qt7m Co-Authored-By: Claude <noreply@anthropic.com>
…d changeset 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>
📓 Docs Drift CheckThis PR changes 1 package(s): 14 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 3 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 40 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # 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
|
…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>
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5oY5WCqqqBMtn9qt7m Final head for L1 · area a4-F · 2026-11-22T06:22Z |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5p6jXqGTcs8wueR5ma 席位核对 · L1-c · ACCEPT · head
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5krBqrrgxCYgjXmfbv Contract reviewServed-tier: ① Derived judgmentsRead: the diff
② Semver level
③ Boundary flags
④ Design judgmentJudged against the card (item 6 and 「清掉」), the #24949 family rules and the No must-fix, no should-fix.
Implemented-by: VERDICT: PASS |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5krBqrrgxCYgjXmfbv 席位核对Awaiting the maintainer's merge (seat order: stored-data delete) · 2026-11-22T06:34Z · head
|
Requested by Leehom · project thread
Part of #35955
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
A new operator command,
os migrate list-preferences, deletes the per-reader list preference rows an earlier Console stored insys_user_preferenceunderui.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 fromindex.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 (theos migrate planboot) and writes no row, table or file.--applydeletes, 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.os db orphansfor 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; theos migratefamily for the command name,--apply,--yes,--forceand the SQLite occupancy gate. Tenancy: every organization's rows, asos db orphansandos secret orphansread (driver-level, unscoped).--applywithout--yesasks once on a terminal; where stdin is not a terminal (or with--json) it reads nothing, deletes nothing and exits1naming--yes. That gate sits before the boot, as theos migratefamily's confirmation pin requires.sys_user_preferenceis declared by plugin-auth's identity objects, so the boot composescreateIdentityObjectsPlugin()for its declarations only (theos user set-passwordshape): no auth manager, no hook, nothing started.content/docs/deployment/cli.mdx(a Data migrations row and anos migrate list-preferencessection) andcontent/docs/upgrading.mdx(an "Upgrading from 18.6.0 or earlier" note: run it once the upgraded Console is serving)..changeset/35955-migrate-list-preferences.md,@objectstack/clipatch.Not in this pull request: the sign-out keep (#36110), related-tab widths (#35892), the spec
columnStateretirement.Read first (by risk)
packages/cli/src/commands/migrate/list-preferences.ts, the--applyhalf 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.packages/cli/src/utils/list-preference-sweep.ts,readListPreferenceRows: the delete set is exactly the driver's case-sensitive$startsWithanswer forui.list.(dot included).packages/cli/src/commands/migrate/list-preferences.integration.test.ts: the seeded survivors (ui.record.account,ui.recent, bareui.list,ui.listx.account,UI.LIST.account).Two-minute check
os migrate list-preferences --database-url file:PATH-TO-A-DB-WITH-UI-LIST-ROWSprints the rows perui.list.*key and "Dry run only — no row or table was written or deleted."; adding--apply --export ./backup.jsonasks once, writes./backup.jsonwith 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 --exportdeletes the four family rows in both organizations and keeps the five survivors, the export is mode0600and 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,failednames it); a second run deletes nothing and writes no export;export_required,export_exists,export_failedandconfirmation_requiredeach 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 findsserve.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 thebootSchemaStackcaller 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,--applyruns 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--yesoff a terminal exits 1 with nothing written. Ablation onf4b177f6: the non-TTY gate disabled turns the pin red (1/60, "list-preferences - text face: exit 1").Acceptance notes
@objectstack/climinor; the changeset ispatch, becauseMetadata-protocol: nonegrades every introduced entrypatch(check:changeset-no-major, AGENTS.md Post-Task Checklist step 3).LIKEfolds case. Ablating that filter stayed green (8/8): the driver's$startsWithis case-sensitive (textMatchPredicatewithout folding), so the second filter was removed rather than kept untested. The export read-back still judges each row's key.test-budgetheader says "134 cases";vitest listcounts 189 on this head (184 before this PR). Not touched here.os db orphans --deleteandos secret orphans --deletein a non-interactive shell without--yesdelete nothing, print "Aborted", and exit 0 — the migrate family exits 1 #36331:os db orphans --deleteandos secret orphans --deletewithout--yesoff a terminal print "Aborted" and exit 0 (read from source); they are outside the migrate family's confirmation pin.Verification
Head
f4b177f6: CI green (40 success, 15 skipped by selector). Onf4b177f6locally:vitest runoftest/migrate-confirmation-exit.pin.test.ts, the two list-preferences suites andtest/exit-signal.pin.test.ts: Test Files 4 passed (4), Tests 220 passed (220);dispatch-gates --commands103 families derived, 103 run, 0 unrun. The rest on headedcf4e1bunless 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/cliunit and integration projects are CI's (Test Core).Build and typecheck
pnpm --filter '@objectstack/cli^...' buildunder the lock:VERDICT command-exit 0.pnpm --filter @objectstack/cli typecheckunder the lock (tsc --noEmitandcheck: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.tsonedcf4e1b: Test Files 2 passed (2), Tests 13 passed (13).src/utils/schema-migrate.one-shot-family.integration.test.ts,test/exit-signal.pin.test.tsandtest/vitest-tiers-partition.test.tsond6d3bf8c(the last commit adds two module-top imports to the new suite only): Test Files 5 passed (5), Tests 371 passed (371).vitest listshows the five new family cases formigrate list-preferences.Ablations (one-off, through scripts/ablation-replace.mjs; the tool proved the mutation landed and the restore equals HEAD)
return rows.filter(...)replaced byreturn rows;) on65c4733b: the integration suite stayed green, 8/8. Read as: the driver's$startsWithis already exact, so that filter was removed (commitd6d3bf8c).$startsWith: 'ui.list') ond6d3bf8c: 4 of 8 red. The dry run's counts differ;--applyrefuses withexport_incompletenamings_bareands_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 HEADempty.Gates (derived with dispatch-gates --commands; 102 families, all run, reconciled with --ran: 102 run, 0 unrun)
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 ond6d3bf8c(the new suite reached@objectstack/platform-objects/pluginand@objectstack/plugin-securitythrough dynamic imports in a clocked window); module-top imports added inedcf4e1b; re-run exit 0.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