Repository navigation
fix(migrate): os migrate meta --stored judges a stored view's bulkActions with the declared actions, and is not green over a row served invalid - #39136
Conversation
…actions; served-invalid verdict Claude-Session: https://claude.ai/code/session_01QSeKYoSKoNUygbCoMBTbGc Co-authored-by: Claude <noreply@anthropic.com>
…d the served-invalid verdict Claude-Session: https://claude.ai/code/session_01QSeKYoSKoNUygbCoMBTbGc Co-authored-by: Claude <noreply@anthropic.com>
…e serves invalid Claude-Session: https://claude.ai/code/session_01QSeKYoSKoNUygbCoMBTbGc Co-authored-by: Claude <noreply@anthropic.com>
…dict Claude-Session: https://claude.ai/code/session_01QSeKYoSKoNUygbCoMBTbGc Co-authored-by: Claude <noreply@anthropic.com>
…te through the dispatch contract Claude-Session: https://claude.ai/code/session_01QSeKYoSKoNUygbCoMBTbGc Co-authored-by: Claude <noreply@anthropic.com>
…the caller's limit Claude-Session: https://claude.ai/code/session_01QSeKYoSKoNUygbCoMBTbGc Co-authored-by: Claude <noreply@anthropic.com>
…ored pass now reaches it Claude-Session: https://claude.ai/code/session_01QSeKYoSKoNUygbCoMBTbGc Co-authored-by: Claude <noreply@anthropic.com>
…ored-bulk-actions
📓 Docs Drift CheckThis PR changes 2 package(s): 2 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 48 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 342c7532c8b6d05f213c5b1180b8f60506e4e5ac && git checkout 342c7532c8b6d05f213c5b1180b8f60506e4e5ac
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin ffda6dab9e8f7ae6141fae4dbf74b3d9c20561e2 71185f87835b27218fe37627322dde8313a3230c && git checkout -B drift-repro ffda6dab9e8f7ae6141fae4dbf74b3d9c20561e2 && git merge --no-ff 71185f87835b27218fe37627322dde8313a3230c
node scripts/docs-audit/affected-docs.mjs --json ffda6dab9e8f7ae6141fae4dbf74b3d9c20561e2
|
|
repo:objectstack@os-justin · os-justin · session_01QSeKYoSKoNUygbCoMBTbGc Final green head for review · 2026-12-02T13:42Z
|
|
repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2 L1 ACCEPT · PR #39136 (#38923) · head 席位核对 · ACCEPTACCEPT · repo:objectstack@os-justin · head
|
|
repo:objectstack@os-justin · os-justin · session_01QSeKYoSKoNUygbCoMBTbGc Landing · 2026-12-02T13:45Z · head
|
Fixes #38923
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
A stored view's
bulkActions, judged with the actions the deployment declares.os migrate meta --storedreplays the conversion chain over eachsys_metadatarow on its own (applyConversionsToStoredItemwraps the row as{ views: [row] }). Soview-bulk-actions-to-action-selectionsaw no action and told every stored list its actions were "not declared as an action of that object", even where the package declares them. A new sibling module,packages/metadata-protocol/src/protocol-stored-view-selection.ts, runs the same entry again for such a row. It takes the entry fromALL_CONVERSIONS, the patterncollectDecisionModeReviewuses, so the rule is not restated. This time the row has the deployment's declared objects (name,actions,actionLayout) and its object-bound standalone actions beside it, read from the registry the way the runtime's action listing reads them. The answer falls into three cases:selectionand no arm is needed, so the entry writes onlyviews[0].*. The row alone is the write: it is listedpending, and--stored --applyre-saves it through the existingsaveMetaItemcall;actions[i].locationsorobjects[j].actionLayout.selection. Those belong to the package, not to the row, so the row stays as stored. Its TODO says the actions ARE declared, names them, and gives both fixes: add'selection'in the package source and deploy, or re-save the view withoutbulkActions;No
packages/spec/src/**edit was needed.Rows the runtime serves invalid, judged by the runtime's own check. The boot hydration (
loadMetaFromDb) registersconvertStoredItem(type, body)and warns[metadata_spec_invalid]whencomputeMetadataDiagnosticsanswersvalid: false; the reads badge the row with the same verdict. The pass now asks that function, with no second rule, about every row whose body it reads. Not judged: identity skips (a non-canonical stored type, an organization-scoped row) and a row the chain yields no item of. On--applya rewritten row is judged as rewritten. New, additive fields:StoredMigrationRow.servedInvalid?: { path, message };StoredMigrationReport.servedInvalid: number;storedMigrationCleanalso requiresservedInvalid === 0. A report from an older protocol carries no field and reads as 0;runStoredprints why the run is red and exits 1.--jsongainsservedInvalidbesideclean; nothing is renamed or removed.A row that converts nothing and is served invalid is now listed
skippedwith that reason, where it used to be countedcanonical.Cost, stated plainly: a deployment holding an unrelated invalid stored row now goes non-green (exit 1) until that row is fixed; the line names the row and its fix. This includes a row whose only finding is a TODO no conversion can rewrite, such as a refused
controlled_by_parentobject, which used to beskippedand left the run green. The scope was ruled option A by the seat (mailbox PR #38811, comment 7344505672), on the card's Expected 2 and its runtime-predicate pin; the maintainer's veto window is open.Kept exactly as they were: ruling C on #15429 (the decision review list), ruling A on #36055 (the View All Fields review list) and option A on stored permission sets. Both lists are still REPORT ONLY and move no count and no verdict, and a test pins the second one.
Files outside the per-card grant, edited because the change forces them (the seat may veto any of them):
protocol.stored-migration.test.ts: two fixtures/pins. The legacy flow fixture lackedlabel/type/edgesand the runtime served it invalid, so I added the declarations. The cbp pin asserted the old "no verdict flips" rule, and it now asserts the ruled one (servedInvalid: 3, not clean);protocol.migrate-stored-noncanonical-type.test.ts: aselectfield withoutoptions, which the runtime serves invalid, gainsoptions. It also gets a module-topimport '@objectstack/lint', whichcheck:test-source-aliasasks for now that the pass reaches the diagnostics;scripts/engine-double-contract.pinned.json: the three rows--writeadds for the new test's double.Tests
packages/metadata-protocol/src/protocol-stored-view-selection.test.ts(8 cases), over the stub engine with a registry holding the package's object and actions:servedInvalidatlist.bulkActions, not clean;selection: pending on preview, then rewritten on apply (stored body has nobulkActions), then a clean re-run;servedInvalidequals!computeMetadataDiagnostics(type, convertStoredItem(type, body)).valid;unchangedwith no registry, or with no TODO of the entry.packages/cli/src/commands/migrate/meta.stored-served-invalid.test.ts(3 cases): exit 1 with the row line and the red line;--jsoncarriesclean: false,servedInvalid: 1and the per-row field; a control with the same skipped row served valid stays green (exit 0).Readings (local, on the branch before the main merge; the merge brought no change to these packages)
pnpm --filter @objectstack/metadata-protocol exec vitest run --maxWorkers=2(whole package): 380 files passed. The 3 failures it showed were the pre-existing pins above, fixed in this PR, and those files then passed (73/73).pnpm --filter @objectstack/metadata-protocol typecheckexit 0;pnpm --filter @objectstack/cli typecheckexit 0.scripts/ablation-replace.mjs, with the mutation shown landed and then restored (blob equal to HEAD,git diff HEADempty):servedInvalidterm dropped fromstoredMigrationClean: 3 red;servedInvalidVerdictalways answering valid: 6 red;Acceptance notes
origin/mainata533126fb4, before this change: one stored view, reportedskippedwith the "not declared" TODO,storedMigrationCleantrue, whilecomputeMetadataDiagnosticsansweredvalid: falseatlist.bulkActions.Verification
Gates derived by
node scripts/pm/dispatch-gates.mjsfor this diff: 84 families, 80 run with exit 0, 0 unrun. The 4 NOT MEASURED families exited 3 (PREREQUISITE NOT MET: a fullpnpm buildis absent in this container):check:dual-build-cjs-loads,check:i18n,check:i18n-coverage,check:i18n-walk-parity. These belong to CI.check:engine-double-contract,check:objectql-double-limitandcheck:test-source-aliaswent red once on the new test file; each was fixed and re-run with exit 0.node scripts/pm/overlap-check.mjs: clean againstorigin/mainand against #39131, which sharesmeta.ts.Two-minute check:
pnpm --filter @objectstack/metadata-protocol exec vitest run src/protocol-stored-view-selection.test.ts. Expect 8 passed, including the case that says the actions are declared and the run is not clean.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01QSeKYoSKoNUygbCoMBTbGc