Part of #7557 — transferred to the metadata lane per the cross-seat protocol, from the engine-core dispatch of that card (PR #7700's report located it and deliberately did not patch it from the consumer side).
Symptom (reproduced live on origin/main, 2026-08-11)
DELETE /api/v1/packages/:id reports persisted: { success: false, deletedCount: 0, failedCount: 0 } while the package's sys_metadata rows demonstrably exist and survive: with 3 rows carrying package_id = 'com.repro.b',
protocol.deletePackage finds 0 rows to delete;
- the same predicate through the data plane finds 3:
GET /api/v1/data/sys_metadata?filters=[["package_id","=","com.repro.b"]] → 3 records.
After PR #7700 the dispatcher no longer wraps this in a 200 — but that fix is invisible to THIS defect by construction (failedCount: 0 legitimately reads as success). The rows still orphan until the producer stops missing them.
Located mechanism (from PR #7700's verification)
packages/metadata-protocol/src/protocol.ts:11486-11488:
const where = { package_id: request.packageId };
if (request.organizationId) where.organization_id = request.organizationId;
const rows = await this.engine.find('sys_metadata', { where });
The where clause is not intrinsically wrong (the data plane returns 3 with it). The scoping the protocol's engine applies to it is the suspect — strongest candidate: strict organization_id equality against rows stored env-wide (organization_id IS NULL). This is the same defect class this package already fixed once at sys-metadata-repository.ts:887-901, where identical strict equality silently dropped env-wide drafts and was replaced by an $or over [{organization_id: oid}, {organization_id: null}] (the orphaned-draft bug). Re-check commands:
git grep -n "organization_id" origin/main -- packages/metadata-protocol/src/protocol.ts | sed -n '1,10p'
git show origin/main:packages/metadata-service/src/sys-metadata-repository.ts | sed -n '880,905p'
Adjacent, distinct
No domain:* label applied — routing labels are the triage seat's single-producer territory; filed with pm:queue per the transfer-via-target-queue protocol.
Part of #7557 — transferred to the metadata lane per the cross-seat protocol, from the engine-core dispatch of that card (PR #7700's report located it and deliberately did not patch it from the consumer side).
Symptom (reproduced live on origin/main, 2026-08-11)
DELETE /api/v1/packages/:idreportspersisted: { success: false, deletedCount: 0, failedCount: 0 }while the package'ssys_metadatarows demonstrably exist and survive: with 3 rows carryingpackage_id = 'com.repro.b',protocol.deletePackagefinds 0 rows to delete;GET /api/v1/data/sys_metadata?filters=[["package_id","=","com.repro.b"]]→ 3 records.After PR #7700 the dispatcher no longer wraps this in a 200 — but that fix is invisible to THIS defect by construction (
failedCount: 0legitimately reads as success). The rows still orphan until the producer stops missing them.Located mechanism (from PR #7700's verification)
packages/metadata-protocol/src/protocol.ts:11486-11488:The
whereclause is not intrinsically wrong (the data plane returns 3 with it). The scoping the protocol's engine applies to it is the suspect — strongest candidate: strictorganization_idequality against rows stored env-wide (organization_id IS NULL). This is the same defect class this package already fixed once atsys-metadata-repository.ts:887-901, where identical strict equality silently dropped env-wide drafts and was replaced by an$orover[{organization_id: oid}, {organization_id: null}](the orphaned-draft bug). Re-check commands:Adjacent, distinct
MetadataFacade.unregisterPackageremoves only object contributors — every non-object item the package shipped stays registered #7221 (open finding):MetadataFacade.unregisterPackageremoves only object contributors — same family at the in-memory layer; this card is the persisted layer. PR fix(engine-core): propagate package disable to metadata listings and the data plane (#7557) #7700's measured fix path did not run through it.No
domain:*label applied — routing labels are the triage seat's single-producer territory; filed withpm:queueper the transfer-via-target-queue protocol.