Uh oh!
There was an error while loading. Please reload this page.
fix(metadata-protocol): draft package inheritance reads the active base across scopes (#11087 layer 1b) - #11171
Conversation
…se across scopes (#11087 layer 1b) The console's session carries an active org, so its draft lands in the org overlay scope while the active base row is env-wide (ADR-0005 overlay order). The inheritance lookup went through whereFor, which pins organization_id to the repo's own scope — so for exactly the console-session saves this inheritance exists for, it found nothing and the draft stayed package_id NULL (measured live on staging after the layer-1 deploy: an org-scoped view draft over an env-wide active row bound to app.k9qk). Resolve the base with the same $or two-scope reach listDrafts applies; a null-org repo keeps the env-wide-only equality. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 11 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 3 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 7 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 2726ddf86d2d12035441f690e78fb47bee1ceacf && git checkout 2726ddf86d2d12035441f690e78fb47bee1ceacf
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 10485009a693b07cf90c98e81a0d8b824c62be95 13bd431a0b6f5e1fe41d34460619cf84f4846593 && git checkout -B drift-repro 10485009a693b07cf90c98e81a0d8b824c62be95 && git merge --no-ff 13bd431a0b6f5e1fe41d34460619cf84f4846593
node scripts/docs-audit/affected-docs.mjs --json 10485009a693b07cf90c98e81a0d8b824c62be95
|
Uh oh!
There was an error while loading. Please reload this page.
What
The #11139 inheritance resolved the overlaid active row through
whereFor, which pinsorganization_idto the repo's own scope. A console session carries an active org → its draft saves land in the ORG overlay scope → the inheritance looked for an org-scoped active row — but the active base is ENV-WIDE (ADR-0005 overlay order), so for exactly the saves this inheritance exists for it found nothing and the draft stayedpackage_id NULL(measured live on staging after the layer-1 deploy: org-scoped view draft over an env-wide active row bound toapp.k9qk,_drafts?packageId=still 0). The base is now resolved with the same$ortwo-scope reachlistDraftsapplies; null-org repos keep the env-wide equality.Tests
New pin (org repo + env-wide bound active → org-scoped draft inherits
app.k9qk); suite now 5/5, fullmetadata-protocolgreen, tsc at the frozen DEBT count.Part of #11087 (final layer). Cloud pin bump + live bar verification to follow.
🤖 Generated with Claude Code