Repository navigation
feat(metadata-core,metadata-protocol,metadata,platform-objects,spec)!: sys_view_definition retires as inert (ADR-0131 D13, C5 stage S1) - #22374
Conversation
…: retire sys_view_definition as inert (ADR-0131 D13) Drop the object, its two registrations, the kernel:ready active-row index migration and its pre-flight probe, the public exports that served only it, its PLATFORM_OBJECTS_BY_PACKAGE entry and the runbook. Absence pins on both registration sites and the platform-object registry; the duplicates e2e re-premises its runtime-migration control on the sys_metadata overlay index. Generated artefacts (i18n bundles, census, migration registry) follow in the next commit. Claude-Session: https://claude.ai/code/session_01EUBvqtauTDmHi2ZgY759p2 Co-authored-by: Claude <noreply@anthropic.com>
…undles and census for the sys_view_definition retirement The semantic entry sys-view-definition-retired and its step-18 rationale fragment; registry.ts regenerated by gen:migration-registry; the platform translation bundles regenerated by pnpm i18n:extract; the tenancy census regenerated by its own --write (registered 84 -> 83, in reach 49 -> 48); the changeset. Claude-Session: https://claude.ai/code/session_01EUBvqtauTDmHi2ZgY759p2 Co-authored-by: Claude <noreply@anthropic.com>
…-sys-view-definition
…e retired sys_view_definition ID leaf es-ES 46 -> 45, ja-JP 36 -> 35, zh-CN 35 -> 34 declared echoes: the regenerated bundles no longer carry the object, so its bare ID leaf left each ledger. Claude-Session: https://claude.ai/code/session_01EUBvqtauTDmHi2ZgY759p2 Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 6 package(s): 45 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 10 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 146 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 145feada81b8a055d6cc91d10bdb7747efaca298 && git checkout 145feada81b8a055d6cc91d10bdb7747efaca298
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 6a53564b9f1ce3021fe20e675b0094dc5f81fe70 26a4702abfb1ed4b09a41c065784920d868e52ab && git checkout -B drift-repro 6a53564b9f1ce3021fe20e675b0094dc5f81fe70 && git merge --no-ff 26a4702abfb1ed4b09a41c065784920d868e52ab
node scripts/docs-audit/affected-docs.mjs --json 6a53564b9f1ce3021fe20e675b0094dc5f81fe70
|
Contract reviewServed-tier: Written 2026-10-09T00:04Z; the head was re-read at this act and had not moved. Inputs, and nothing else: card #15206 (body and all thirteen comments: the triage re-verification 6018690577, the ruling pointers 6020252365 and 6028879062, the scope amendment 6037959748, the unlock 6065871067, the retriage pair 6066739347 and 6066851770, the claim 6067242116, the stage-0 os-dev-report 6067752061, the stage-plan record 6067844889, triage's answer 6068032120, the spec-seat note 6069774626, the S1 os-dev-report 6071298747); ADR-0131 (D13, section 7, section 8 and the v18-line bullet), ADR-0017 and ADR-0087 on ① Derived judgments
② Semver level
③ Boundary flags
CI on the head. 34 check-runs at 2026-10-09T00:03Z: 28 Implemented-by: VERDICT: PASS |
… merging main at e75dced (step 18: 64 conversions, 326 semantic entries) main added two step-18 semantic entries since b460153: sys-view-definition-retired (#22374) and try-catch-and-retry-policy-undeclared-keys-refused (#22380), and #22380 reworded the existing entry flow-builtin-node-config-undeclared-keys-refused. At protocol 18 both generators project every step-18 entry, so both documents gain the two entries and carry the reworded text. The conversion ids are unchanged. registry.ts is current as merged (check:migration-registry exits 0), so it is not regenerated. Claude-Session: https://claude.ai/code/session_01VZqqwTj2wsihZEbfT6yyYN Co-authored-by: Claude <noreply@anthropic.com>
Refs #15206 (S1)
Clause-②: no
ADR-0131 C5, stage S1:
sys_view_definitionretires as inert (D13, card item 1b). This PR closes no card; the card stays open for S2 to S6.What this PR does
sys_view_definitionwas declared for runtime-authored views (ADR-0017) and never used for them. No framework code writes or reads its rows. The console's view doors write the ADR-0005viewoverlay insys_metadatathrough the metadata API. This PR removes the object and everything that existed only to serve it.metadata-core), thekernel:readyactive-row index migration and its test (metadata-protocol/src/migrations/view-definition-active-index.ts), and the runbookscripts/migrate/overlay-views-to-sys-view-definition.md.assembleMetadataProtocol'sregisterApp) and registration B (MetadataPlugin'squeryableMetadataObjects) each provision the four metadata-storage objects.kernel:readyhook inassembleMetadataProtocolarms only thesys_settingrow-identity index and the seed/API tenancy backfill.runtime-index-preflight.tsloses itsidx_sys_view_def_activerow, soos migrate duplicatesreports three runtime-index entries.SysViewDefinitionObject, frommetadata-core, theplatform-objectsroot andplatform-objects/metadata.metadata-protocol:ensureViewDefinitionActiveIndex,resolveIndexExec,buildActiveIndexSql,VIEW_DEFINITION_TABLE,VIEW_ACTIVE_INDEX_NAME,VIEW_ACTIVE_PROBE_INDEX_NAME,VIEW_ACTIVE_INDEX_COLUMNS, and the threeEnsureViewIndex*types.classifyIndexFailureandIndexExecstay exported, now frompartial-index-probe.js(see Deviations).PLATFORM_OBJECTS_BY_PACKAGE['metadata-core']. A new ADR-0087 D3 entry,18.sys-view-definition-retired.ts, lands with one step-18 rationale fragment, andregistry.tsis regenerated bygen:migration-registry.pnpm i18n:extract. Seven files lose 295 lines, one contiguoussys_view_definitionblock each, and nothing else moves.--write.drivers.mdx,cli.mdx,packages.mdxand the checklist itemcli.migrate-duplicates-inventory(revision 6) now describe two migrations and three indexes.Measured first
Positive control (
git grep -l sys_view_definition). The control wordsys_metadataruns over the same pathspec.-- 'packages/**/src'(as written on the card)-- ':(glob)packages/**/src/**'sys_metadata, same globorigin/main41d0d4038c26a4702abfBefore equals stage 0's census (41 under
src, 65 repo-wide), measured at3599fef123, so nothing drifted. The census missed one importer, because it imports the camelCase symbol and has no snake-case hit:packages/metadata/src/migrations/migrate-project-id-to-environment-id.test.tsimportsSysViewDefinitionObject. It is edited here.The 31 files that still mention the name after the change, by class:
metadata-protocolplugin.metadata-objects-retired.test.ts(new) andruntime-index-preflight.test.ts.metadataplugin.test.ts.specplatform-object-names.test.ts.cliduplicates.contract.test.tsandduplicates.integration.test.ts.registry.ts.metadata-coreobjects/index.ts.metadata-protocolindex.ts,plugin.ts,overlay-index.ts,partial-index-probe.ts,runtime-index-preflight.tsandsys-setting-identity-index.ts.metadataplugin.ts.platform-objectsbundle-ownership.test.ts, andobjects-es-es-echo-decisions.test.ts,objects-ja-jp-echo-decisions.test.tsandobjects-zh-cn-echo-decisions.test.ts(a note beside each corrected size pin, added in the final commit).clischema-migrate.host-composition.integration.test.tsandplatform-migrations-arming.integration.test.ts.clischema-migrate.ts,schema-migration-plugins.tsandschema-migrate.teardown.integration.test.ts: past-tense measurements.objectqldangling-reference-audit.tsand its test: the pre-每个os migrate子命令关停时,悬空引用巡检都会把sys_metadata/sys_view_definition报成unreadableObjects(连接已关闭) #4747 symptom.platform-objectsecho-decision reasons: decision records that name the twin they copied.specview-item-owner-hidden-retirement.test.tsfixture comment.driver-sqldeclared-index-retired-keys.test.ts: an index-shape case that cites where the shape came from.Repo-wide, the remainder is the changeset, the checklist history row, ADR-0017, ADR-0029, ADR-0120 and ADR-0131, the v17 release notes, the CHANGELOGs, and one historical comment in
cli/test/migrate-apply-refuses-before-ddl.e2e.test.ts.No writer or reader of the rows. Every non-test, non-generated source hit on
origin/mainis a comment, a declaration, a registration, or the migration's own SQL. The only statements that touched rows were the active-row migration's presence and duplicate probes and the pre-flight's copy of the duplicate probe. One non-test comment claimed a reader that does not exist (metadata-manager.ts: "merged in by the REST layer";packages/resthas 0 hits). It is corrected here.No importer of the removed exports.
metadata-protocolandmetadata-core/platform-objects, other than the test edited here. The CLI tests only matched the migration's name string in the pre-flight output.origin/mainb1f0dcc00and at the pinned.objectui-shaa58626c88d, against 93 for the controlsys_metadataat both. Its onlymetadata-protocolimport isObjectStackProtocolImplementation.Entry export sets.
metadata-protocolsrc/index.ts: 0 names added; the ten listed above removed.metadata-coreobjects/index.tsandplatform-objectsmetadata/index.ts: 0 added;SysViewDefinitionObjectremoved.metadata-protocol/dist/index.d.ts, every removed name reads 0 hits, andclassifyIndexFailureandIndexExecread 2 and 6.check:api-surface: "public API surface + factory signatures unchanged".Nothing widens, so
Clause-②: nostands.What an existing database needs. Measured with the built CLI on a scratch SQLite project. The database carried a leftover
sys_view_definitiontable with one row. A control orphan column sat onsys_metadata_audit.os migrate applycreates nosys_view_definition. It creates eight platform tables plus the app table.os migrate plan --jsonreports the orphan column asunmapped_columnand says nothing about the table inchanges. With a host config present, the plan's informationalunmanagedTablessweep listssys_view_definition.os migrate apply --allow-destructive --yesdropped the orphan column. It left the table and its row in place.So no platform path drops the table. The ADR-0087 entry and the changeset say that, and they leave the drop to the operator, by hand. Stage 0's F4 ("the physical drop is the operator's
os migrate apply --allow-destructive") holds for a column, not for a whole table.Pins
plugin.metadata-objects-retired.test.tschecks thatregisterAppcarries exactly the four objects. Thekernel:readyhook, run against a recording seam, issues statements, and none of them names the table. The anti-vacuity check is that the hook did issue statements.plugin.test.tschecksMetadataPluginwith the same exact-set assertion.platform-object-names.test.tschecks thatPLATFORM_OBJECTS_BY_PACKAGE['metadata-core']equals the four names, and thatisPlatformProvidedObjectName('sys_view_definition')is false. The existing bidirectional conformance test still scans every*.object.ts.runtimeIndexProbes(). On every client (none, sqlite, pg, mysql2), it answers exactly the threemigration:table:indextriples that remain. The pre-flight fixture keeps a damagedsys_view_definitiontable, and the report never names it.registeredgoes 84 → 83 andinReachgoes 49 → 48, measured by the generator and held bycheck:platform-object-tenancy-census.Reverse verification. This ran from the committed tree at
26a4702abf, as a one-shot script with atraprestore. No file of it is committed.SysViewDefinitionObject.41d0d4038c.metadata-corethroughscripts/ablation-replace.mjs.queryableMetadataObjects(import and array) throughablation-replace.mjs.metadata-corewas rebuilt, andablation-dist-preflight.mjs @objectstack/metadata-core SysViewDefinitionObjectfound the marker in 4 built files.metadataplugin.test.ts: 1 failed, the new absence pin (expected [ 'sys_metadata', …(4) ] to not include 'sys_view_definition');check-platform-object-tenancy-census.mjs: exit 1 (totals.registered: committed 83 -> tree 84,+ sys_view_definition (in) is new to the population);specplatform-object-names.test.ts, projectrepo: 1 failed (registry group "metadata-core" is out of date).ablation-replace.mjs --restorebrought both files back: blob == HEAD,git diff HEADempty,git statusempty. The module was removed from the index.metadata-corewas rebuilt, and--absentfound the marker in none of the 12 built files, with a clean tree.Deviations from stage 0's S1 plan
classifyIndexFailureandIndexExecstay exported. They rode out on the retired module's export block, but neither is specific to it. Both live inpartial-index-probe.ts, andIndexExecis the parameter type of the still-exportedensureSysSettingIdentityIndexandresolveSysSettingIndexExec. They are re-pointed with byte-identical declarations, so nothing about them narrows.objects-*-echo-decisionsledger counts: es-ES 46 → 45, ja-JP 36 → 35 and zh-CN 35 → 34 echoes, because each lost the object's bareIDleaf;content/docs/plugins/packages.mdx, which also counted the MySQL-unbuildable indexes.driver-sqlindex-shape case, the two echo-decision reasons, and thespecfixture comment, for the reasons in the table above.sys_metadataoverlays with a NON-NULL organization. While building it, I found that a NULL-organization pair is reportedblockedby the overlay pre-flight, but the index CREATE accepts it. That is out of scope here (see Acceptance notes).Changeset and ADR-0087
.changeset/15206-sys-view-definition-retired.mddeclaresminoronmetadata-core,metadata-protocol,metadata,platform-objectsandspec, with the BREAKING banner and a FROM → TO mapping. It carriesClause-②: no (narrowing)and the dispositionregistered sys-view-definition-retired. Changesets is in pre mode (.changeset/pre.json, tagnext), and the fixed group is already majored by the v18 opening marker, so this ships as an18.0.0-next.N.runtimechanges one doc comment andclichanges tests only, so neither carries a changeset.Tests and gates
The final head is
26a4702abf. Each reading names the commit it ran at.Suites.
41dbe7962f; the later merge did not touch the package).442e585e93, after the merge); typecheck exit 0 (41dbe7962f). The pin files ran verbose: 2 files, 10 passed.41dbe7962f).plugin.test.tsran verbose: 18 passed (442e585e93).26a4702abf); typecheck exit 0 (442e585e93).local: 626 files, 18740 passed, 1 todo (442e585e93);repo: 54 files, 915 passed (26a4702abf);442e585e93);check:generated: all 15 artifacts up to date afterspecbuild (41dbe7962f).26a4702abf):--project unit: 268 files, 3951 passed;--project integrationover the five edited integration files: 5 files, 63 passed;OS_TEST_SHARD=i/3,26a4702abf, after a fullturbo run build --filter=!@objectstack/docs, 72/72 tasks):Gates.
node scripts/pm/dispatch-gates.mjs --commands(no paths) at26a4702abfderived 128 commands. All 128 ran, all exited 0.--ranwith the exit codes recorded answers "128 derived, 128 run, 0 NOT-MEASURED, 0 UNRUN".41dbe7962fthey exited 3 (prerequisite not met) and are not counted; at26a4702abfthey ran green. They arecheck:skill-examples,check:dual-build-cjs-loadsandcheck:i18n-coverage("13 config(s), … none new").check:adr-0087-registration:[BREAKING+bang+clause-②-narrowing] registered sys-view-definition-retired (new here: sys-view-definition-retired);check:changeset-no-major: "This diff introduces nomajorbump". The level axis is NOT APPLICABLE locally, because there is nopull_requestpayload;check:empty-changeset: OK;check:platform-object-tenancy-census: "83 platform-namespace objects, 48 in the machinery's reach, 35 outside it";check:i18n: all 9 packages in sync;check:platform-checklist: OK;check:nul-bytes: OK;spec check:api-surface: unchanged;check:doc-authoring: clean.Lint. This is a measured narrowing, not the CI-owned repo sweep.
eslint.config.mjsmatches**/*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}..ts/.mjsfiles in this diff,eslint --no-inline-config --format json: 38 files, 0 errors, 0 warnings, exit 0.eslint.config.mjs:328), so this diff cannot change the verdict on any untouched file.tscis green across the packages that imported the deleted modules.Cross-lane paths
These are declared on #6017 (
domain:spec), #6024 (domain:cli) and #6023 (domain:devx).packages/spec/src/system/constants/platform-object-names.tsand its test;packages/spec/src/migrations/entries/semantic/18.sys-view-definition-retired.ts;packages/spec/src/migrations/registry.ts.packages/cli/src/commands/migrate/data-commands.absent-database.integration.test.ts,duplicates.contract.test.tsandduplicates.integration.test.ts;packages/cli/src/utils/platform-migrations-arming.integration.test.tsandschema-migrate.host-composition.integration.test.ts.packages/runtime/src/standalone-stack.ts.content/docs/data-modeling/drivers.mdx,content/docs/deployment/cli.mdxandcontent/docs/plugins/packages.mdx;docs/qa/platform-checklist/areas/cli.json;scripts/platform-object-tenancy-census.json;scripts/migrate/overlay-views-to-sys-view-definition.md(deleted);.changeset/15206-sys-view-definition-retired.md.Serial constraints
registry.tsand the census were regenerated after this branch's final merge ofmain(442e585e93). Both came out byte-identical, with no text merge. After that merge,maingained four commits. None of them touchesregistry.ts, the census or any file in this diff (measured withgit diff --name-only). This PR does not touch #22307'sobjectqlplugin.tsorregistry.ts.Acceptance notes
blockedfor rows its index accepts.sys_metadataoverlays with the same type and name, both withorganization_idNULL.os migrate duplicatessays.idx_sys_metadata_overlay_activereadsstatus: blockedwithorganization_id: nullandrowCount: 2, and the summary readsruntimeIndexesBlocked: 1.CREATE UNIQUE INDEX … (type, name, organization_id, COALESCE(package_id, '')) WHERE state = 'active'succeeds on the same file, because the organization key part is bare and NULL-distinct ([metadata-protocol] ensureOverlayIndex 先 DROP 后 CREATE:partial 索引建失败时 sys_metadata 会静默地失去覆盖层唯一约束 #6418). The control pair, with organizationorg_x, is refused,UNIQUE constraint failed.GROUP BYfolds NULLs that the index keeps distinct. The pre-existing unit fixture inruntime-index-preflight.test.tspins the NULL-organization group asblocked.sys_view_definitionincontrol-plane-permissions.tsand in its platform-global list (stage 0's census; ADR-0131 section 7). Cloud carries that as C10. There is no cloud checkout in this container, so its symbol imports are NOT MEASURED here.cli/test/migrate-apply-refuses-before-ddl.e2e.test.ts, which is unedited and carries one historical comment. Neither vitest project selects it as named (FILTER SELECTED NOTHING).Generated by Claude Code