Repository navigation
docs(metadata-core): name the real write-path labels on MetadataEvent.source - #24675
objectstack-fleet[bot] merged 1 commit into
Conversation
….source The describe listed "studio", "rest", "ai" and "git-import", which no producer writes. It now says the field is an open write-path label with examples the repositories and the protocol really stamp; the two sys_metadata_history comments agree with it. z.string() is unchanged. Claude-Session: https://claude.ai/code/session_01AHeUBbe6S3JRawcpbLejXD Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 1 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 — 4 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 bcf649040a66bc366819b64947189be77b0fc532 && git checkout bcf649040a66bc366819b64947189be77b0fc532
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin bfc1539fe00a33bc3215614a8d6c76a05eb8e8aa 197216c57fc5b4b29eca3133d26b93a820f148b9 && git checkout -B drift-repro bfc1539fe00a33bc3215614a8d6c76a05eb8e8aa && git merge --no-ff 197216c57fc5b4b29eca3133d26b93a820f148b9
node scripts/docs-audit/affected-docs.mjs --json bfc1539fe00a33bc3215614a8d6c76a05eb8e8aa
|
席位核对 · ACCEPT ·
|
Fixes #24336
Clause-②: no
What changed
MetadataEventSchema.sourcein@objectstack/metadata-coredescribed itself asOrigin label: "fs", "studio", "rest", "ai", "git-import", …. No producer on this tree writesstudio,rest,aiorgit-import, so a reader of the published schema was pointed at values it will never see. The describe now says what the field is: the write path that produced the event, an open label its writer stamps, not an enum of authoring surfaces to pick from or match against. Its examples are labels real producers stamp:protocol.saveMetaItem,protocol.publishMetaItem,migrate-stored,sys-metadata-repo(SysMetadataRepository's default) andfs(FileSystemRepository). The field staysz.string().The two
sys-metadata-history.object.tscomments (the module header and the comment abovesource) now agree with the describe. They list the labels that actually reach thesys_metadata_history.sourcecolumn, and they no longer listfs:FileSystemRepositorywrites its events to its own JSONL change log, never to this table.No key, type, export, accepted value or emitted value changes. One
patchchangeset on@objectstack/metadata-core(.changeset/24336-metadata-event-source-describe.md, carryingClause-②: no).Producers measured on
origin/mainbfc1539fe0(non-test code)SysMetadataRepository(packages/metadata-protocol/src/sys-metadata-repository.ts)opts.source, elsesys-metadata-repo(put / delete),sys-metadata-repo.publish(promoteDraft and the promoted draft-row drop),sys-metadata-repo.revert(restoreVersion);history()passes the stored value through and answerssys-metadata-repofor a row that stored nonesys_metadata_history,MetadataEventpackages/metadata-protocol/src/protocol.ts)protocol.saveMetaItem,protocol.publishMetaItem,protocol.deleteMetaItem,protocol.rollbackMetaItem,protocol.revertCommitSysMetadataRepositorymigrate-stored(the protocol'smigrateStoredMetadata, andservice-automation'sflow-credential-migration.ts)saveMetaItemos migrate security-catalog-overlaysos migrate security-catalog-overlaysSysMetadataRepository.delete@objectstack/metadataDatabaseLoader(database-loader.ts)database-loadersys_metadata_historydirectly@objectstack/metadata-fsFileSystemRepositoryfsInMemoryRepository(metadata-core)in-memoryLayeredRepository(metadata-core)LAYER:SOURCE)The card's list missed
DatabaseLoader, the three further protocol labels, the CLI migration and the two metadata-core repositories; none of them writesstudio,rest,aiorgit-importeither. No consumer comparessourceagainst a fixed value.Generated artifacts: nothing reads this describe. A repo-wide search for
Origin labelandgit-importfinds only the source line, the governed ADR sketch below and two changelog/changeset entries of the earlier spec-half fix.metadata-coreis notpackages/spec, socheck:generateddoes not cover it and nothing was regenerated.File surface
packages/metadata-core/src/types.ts:MetadataEventSchema.source's.describe()only.packages/metadata-core/src/objects/sys-metadata-history.object.ts: the module header bullet and the comment abovesource..changeset/24336-metadata-event-source-describe.md.Verification (head
197216c57f)pnpm --filter '@objectstack/metadata-core...' build(metadata-core and its dependency closure): exit 0. The builtdist/index.jsanddist/index.cjseach carry the new describe once andgit-importzero times.pnpm --filter @objectstack/metadata-core test: 18 files, 774 tests passed.pnpm --filter @objectstack/metadata-core typecheck(tsc --noEmit && tsc --noEmit -p tsconfig.test.json): exit 0.node scripts/pm/dispatch-gates.mjs --commands, from the real diff): 57 commands, every one run with its exit code captured before any pipe. 56 exited 0.pnpm check:lean-entry-closurefirst answered PREREQUISITE NOT MET (exit 3) and exited 0 after building@objectstack/objectql's closure.pnpm check:dual-build-cjs-loads. It refuses with exit 3 until all of the roughly 90 workspace packages are built, and only a whole-workspace build satisfies it. CI'sLint & Repo Gatesruns it. Declared narrowing.node scripts/pm/dispatch-gates.mjs --ran: 57 derived families accounted for, 56 run, 1 NOT MEASURED, 0 UNRUN.Acceptance notes
domain:spec, not taken here (it is that lane's file):packages/spec/src/api/protocol.test.ts(around lines 2141 to 2162) calls its fixture "a verbatim-shaped capture of a realhistoryMetaItemreturn", but the update event carriessource: 'studio'. A real save through that door stampsprotocol.saveMetaItem.docs/adr/0008-metadata-repository-and-change-log.mdline 226, the section 2.4 sketch, still readssource: string; // 'fs', 'studio', 'rest', 'ai', 'git-import', …. It is illustration only, and correcting it is a maintainer's edit.Generated by Claude Code