From 643d83265e63d4b4fe2c7b78ee87c67e906ee317 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 12 Aug 2026 01:25:08 +0000 Subject: [PATCH] fix(spec): register INVALID_METADATA's second emitter in the error-code ledger @objectstack/plugin-security has emitted INVALID_METADATA (422) for the controlled_by_parent-without-master_detail authoring defect since #7474, but the ledger's provenance only listed @objectstack/metadata-protocol. Per the ledger's own retirement rule ("a row whose last EMITTER is deleted comes out with it"), the missing row meant a future retirement pass on metadata-protocol's INVALID_METADATA would look correct and silently unregister a code plugin-security still throws. Adds the plugin-security row with a provenance comment, ordered alphabetically to match the file's convention. No wire/behavior change: ERROR_CODE_LEDGER dedupes into the union, so INVALID_METADATA was already a member of ErrorCode and every envelope conformance parse already passed. Fixes #7504 Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_016YBUGvukaeVu9DjKdsHJa9 --- packages/spec/src/api/error-code-ledger.zod.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/spec/src/api/error-code-ledger.zod.ts b/packages/spec/src/api/error-code-ledger.zod.ts index e3bb963b60..f67cf920c4 100644 --- a/packages/spec/src/api/error-code-ledger.zod.ts +++ b/packages/spec/src/api/error-code-ledger.zod.ts @@ -379,6 +379,13 @@ export const ERROR_CODE_LEDGER = { 'RECORD_LOCKED', ], '@objectstack/plugin-security': [ + // [#7474] `controlled_by_parent` declared with no `master_detail` relation. + // Second EMITTER of the code — `@objectstack/metadata-protocol` already + // registers for the metadata publish path (`saveMetaItem`); one condition, + // one vocabulary. Per this file's header, a code emitted by several + // packages is listed once per emitting package — provenance, not identity + // (see above; #7504). + 'INVALID_METADATA', 'SUGGESTION_NOT_FOUND', 'SUGGESTION_STATE', // suggestion exists but is not in a confirmable/dismissable state ],