You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The published-seed read still runs a two-attempt org-then-env ladder whose first rung is now a byte-identical repeat — seed is allowOrgOverride: false and getMetaItem gates it #15068
Filed unassigned by the domain:cli execution seat from PR #15063's report (card #14771). ⚠️ Filed unassigned and unlabelled — grading and domain:* are triage's to produce.
⭐ The reporting dev was instructed to bound the class and ⛔ not to fix it, so this is the second of the two members it found — and the bound is the valuable part: exactly two comments under packages/runtime/src/** state the pre-gate rule. #14771 repaired one. This is the other, and unlike its sibling it is not comment-only.
The site
packages/runtime/src/domains/packages.ts — locate by content, not by line (it was :1245 when the dev measured, :1229 on main as I write this; the file moves daily):
// Read the just-published seed body. Try the active org first, then// fall back to an env-wide read — a workspace seed is often stored// org-wide (organization_id IS NULL), and resolving the wrong scope// here is what silently produced "0 rows loaded".constattempts=organizationId
? [{type: 'seed', name, organizationId },{type: 'seed', name }]
: [{type: 'seed', name }];
let item: any;for(constargsofattempts){try{item=awaitprotocol.getMetaItem(args);if(item)break;}catch(e){/* … */}}
Why the first rung is dead
Verified on origin/main, each reading with a positive control on the same pathspec:
That predicate answers undefined for every type the registry declares non-overridable.
⇒ { type: 'seed', name, organizationId } and { type: 'seed', name } now resolve to the identical env-wide read. The loop's first iteration either returns the item — in which case the second never runs and nothing is lost — or returns nothing, and the second attempt repeats the same query verbatim.
⭐ And the code carries a rung that cannot do anything — a redundant round-trip on the publish path whenever organizationId is set. That is what makes this bigger than its sibling, and why it was correctly filed rather than folded into a comment-only PR.
What the fix owes
⛔ Do not "restore" org-awareness to the seed read.seed is non-overridable by declaration and the gate is the repair, exactly as on the app read one function up — read #14771's replacement comment before touching this one.
The honest shapes are one of:
collapse the ladder to the single read the gate already produces, and rewrite the comment to say the scope is decided by the registry flag rather than by this call site; or
keep the ladder and state why — if there is a reading under which the two attempts can still differ, name it. ⚠️ I could not find one and neither could the reporting dev, but a claim of deadness deserves the ablation: neuter the second attempt and show nothing reddens, with a positive control that the ladder is reached at all.
The behaviour-preservation question is the whole risk here: the original comment says resolving the wrong scope "is what silently produced 0 rows loaded", so this ladder was written to fix a real outage. ⇒ ⛔ Do not delete it on a reading of the registry alone — pin the publish-then-read path first.
The method that found it, worth reusing
Enumerate every non-test metadata read call site under ':(glob)packages/runtime/src/**/*.ts' for getMetaItems|getMetaItem|getMetaItemLayered|listMetaItems|getMetaDiagnostics|findReferencesToMeta ⇒ 9 sites. Liveness: the same pathspec returns more when test files are included, so a zero would have been a reading. ⚠️ A git grep pathspec using **without:(glob) matches zero silently.
Non-members, checked and distinguished rather than skipped: readMergedSkillRows's docblock in domains/mcp.ts already states the correct rule for skill; the getMetaItemLayered note at domains/meta.ts:334 describes a primitive the read gate does not reach (protocol.ts's own docblock says the /layers door never reaches getMetaItems); and the four domains/meta.ts read sites comment on masking and draft preview, asserting nothing about org scope.
Filed unassigned by the⚠️ Filed unassigned and unlabelled — grading and
domain:cliexecution seat from PR #15063's report (card #14771).domain:*are triage's to produce.⭐ The reporting dev was instructed to bound the class and ⛔ not to fix it, so this is the second of the two members it found — and the bound is the valuable part: exactly two comments under
packages/runtime/src/**state the pre-gate rule. #14771 repaired one. This is the other, and unlike its sibling it is not comment-only.The site
packages/runtime/src/domains/packages.ts— locate by content, not by line (it was:1245when the dev measured,:1229onmainas I write this; the file moves daily):Why the first rung is dead
Verified on
origin/main, each reading with a positive control on the same pathspec:seeddeclaresallowOrgOverride: false—packages/spec/src/kernel/metadata-plugin.zod.ts:808.getMetaItemappliesorganizationIdForMetaRead(request.type, request.organizationId)itself, landed by fix(metadata-protocol): gategetMetaItem's overlay read on the metadata registry #14908 (the singular-read sibling of Where does the allowOrgOverride read gate belong for metadata sweeps that read MORE THAN ONE type per request?getMetaItemsapplies none of its own #14683/fix(metadata-protocol): apply the allowOrgOverride read gate inside getMetaItems, so multi-type sweeps are scoped per type #14767's pluralgetMetaItemsgate).undefinedfor every type the registry declares non-overridable.⇒
{ type: 'seed', name, organizationId }and{ type: 'seed', name }now resolve to the identical env-wide read. The loop's first iteration either returns the item — in which case the second never runs and nothing is lost — or returns nothing, and the second attempt repeats the same query verbatim.So this is two defects, not one
runtime/domains/packages.ts:594says the package-export read is "left org-aware on purpose — a layered read is a superset, never a loss"; PR #14767 makes that false forapp#14771 repaired, same file, same package.organizationIdis set. That is what makes this bigger than its sibling, and why it was correctly filed rather than folded into a comment-only PR.What the fix owes
⛔ Do not "restore" org-awareness to the seed read.
seedis non-overridable by declaration and the gate is the repair, exactly as on theappread one function up — read #14771's replacement comment before touching this one.The honest shapes are one of:
The behaviour-preservation question is the whole risk here: the original comment says resolving the wrong scope "is what silently produced 0 rows loaded", so this ladder was written to fix a real outage. ⇒ ⛔ Do not delete it on a reading of the registry alone — pin the publish-then-read path first.
The method that found it, worth reusing
Enumerate every non-test metadata read call site under⚠️ A
':(glob)packages/runtime/src/**/*.ts'forgetMetaItems|getMetaItem|getMetaItemLayered|listMetaItems|getMetaDiagnostics|findReferencesToMeta⇒ 9 sites. Liveness: the same pathspec returns more when test files are included, so a zero would have been a reading.git greppathspec using**without:(glob)matches zero silently.Non-members, checked and distinguished rather than skipped:
readMergedSkillRows's docblock indomains/mcp.tsalready states the correct rule forskill; thegetMetaItemLayerednote atdomains/meta.ts:334describes a primitive the read gate does not reach (protocol.ts's own docblock says the/layersdoor never reachesgetMetaItems); and the fourdomains/meta.tsread sites comment on masking and draft preview, asserting nothing about org scope.Refs
runtime/domains/packages.ts:594says the package-export read is "left org-aware on purpose — a layered read is a superset, never a loss"; PR #14767 makes that false forapp#14771 / PR docs(runtime): correct the publish-drafts app-read comment the meta read gate falsified #15063 — the sibling sentence, repaired; its report bounded this class.getMetaItem's overlay read on the metadata registry #14908 — thegetMetaItem(singular) gate that made this rung inert.getMetaItemsapplies none of its own #14683 (closed) / fix(metadata-protocol): apply the allowOrgOverride read gate inside getMetaItems, so multi-type sweeps are scoped per type #14767 — thegetMetaItems(plural) gate, and the decision behind both.?type=diagnostics call site still tells the next reader thatgetMetaItemsapplies no registry gate — true when it was written, false since #14767 #15034 — the same class one package over, inpackages/rest.