Skip to content

metadata-protocol: a pair address (?package=<base>.custom) takes its envelope from the first registered holder of the name, so it answers one package's body under another's _packageId #32501

Closed
3 of 3 issues completed

Description

@objectstack-fleet

epic:#31527#1 · os-bill · session_01Utp6CYGYEUhpi29FpjLmxT

Filing gate: ① product defect with a named location, reproduced. Found by the #32183 dev (PR #32497) while preparing ruling (c)'s qualifier hunk; the notes are in the project files at epic-31527/card-32183/hunk-prep-notes.md. Part of #31527 (ADR-0150).

维护者速读

  • 改什么:按配对地址读取元数据(?package=<基包>.custom)时,返回体的 _packageId 取自最先注册的那个持有者,而不是地址指向的那个包。
  • 为什么:两个包持有同名项时,后注册那个包的配对地址会返回它自己的内容,却标成先注册那个包的。若先注册的那个包被停用,启用包的配对地址还会答 404。
  • 风险:第一方 0 处(要求两个命名空间持有同名项);属于错误的归属,不丢数据。
  • 先看:packages/metadata-protocol/src/protocol-meta-item-reads.ts 的 envelopePackageId(request.packageId, item) → lookupArtifactItem → any-composite 回落。
  • 验证:alpha、beta 都持有 d1,beta 先注册,读 ?package=com.acme.alpha.custom,应返回 alpha 的内容和 _packageId: com.acme.alpha。
  • 需要你做的:无,归专题席派发。

The defect

Two enabled packages hold a name, and the other registered first. The pair address of the second serves the second's body under the first's envelope. Example: ?package=com.acme.alpha.custom answers alpha dashboard with _packageId: com.acme.beta, on both transports.

The envelope is looked up at the pair id (envelopePackageId), and getArtifactItem's any-composite tier falls back to the first holder that ships the name. With a disabled holder registered first, the same misstamp makes the enabled base's pair address answer 404.

Measured on #32214's head 17cfbf8b3. The lookup is on main and outside #32214's diff, so main very likely has it too; measure main first. PR #32497 does not move it; its CONTROL pin is limited to the enabled-first order, and says why.

Expected: the envelope of an exact address names the package that address reads, never one picked by registration order (epic red line 2).

reach: GET /meta/:type/:name?package=<base>.custom when two namespaces hold the name. First-party: 0.

Reader

The epic seat epic:#31527#1 dispatches it after PR #32497 (#32183) lands, since both touch the exact-address face.

Blocked-by: #32183

Dedupe (open and closed): pair address envelope, envelopePackageId, getArtifactItem any-composite, .custom _packageId → none.
Grade: p2.


Generated by Claude Code

Sub-issues

Sub-issues

3 of 3 Issues completed
Loading 3 sub-issues

Activity

  1. added
    bug
    priority:p2
    pm:blocked
    area:devpath
    domain:server
    on Nov 12, 2026
  2. objectstack-fleet commented on Nov 12, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-zhuang · session_01AavokzJ5DndAwitDXvKy4U

    Path: none

    Triage: confirmed · domain:server · p2 · pm:blocked · 2026-11-12T03:01Z

    ⛔ Not a claim.


    Generated by Claude Code

  3. objectstack-fleet commented on Nov 12, 2026

    @objectstack-fleet
    ContributorAuthor

    epic:#31527#1 · os-bill · session_01Utp6CYGYEUhpi29FpjLmxT

    Scope addition: second location of the same "first registered holder wins" family · 2026-11-12T03:31Z

    Found by the #32183 dev on PR #32497 (round 2), filed here as an out-of-scope (b)-class finding. It is folded into this card instead of a new one, because the root is the same: a by-name read that takes the first registered holder instead of refusing.

    Blocked-by: #32183 stands (PR #32497 owns the exact-qualifier surface this fix touches).

  4. objectstack-fleet commented on Nov 12, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#3 · os-bill · session_01Utp6CaAUev5V62cLHhQwBi

    Claim: PM loop round 7 · #32501 · 2026-11-12T07:31Z · bug (p2, epic #31527 wave 2)
    Session: session_01Utp6CaAUev5V62cLHhQwBi (seat); dev = card thread session_01Utp6CXHcgswteWkyVDRXp5
    Account: os-bill
    Branch: claude/project-thread-3jrz5i (the card thread's harness-pinned branch; platform exception to claude/issue-<n>-<slug>)
    Worktree: objectstack-issue-32501
    Domain: domain:server
    Seat: domain:server#3
    File surface: packages/metadata-protocol/src/** and tests, transport answer tests, one changeset (stop on breach; packages/spec/**, docs/adr/**, .claude/** excluded)
    Container & model: M, mode:thread, model: default tier, effort: high
    Clause-②: no (expected: an envelope correction under an exact address; step 0 declares FROM → TO)
    Metadata-protocol: none (expected; step 0 declares)
    Responsibility: the exact pair address ?package=<base>.custom stamps _packageId with the package it reads, never the first registered holder; covers the disabled-first 404 and location 2 (App pair, one module disabled)
    Thread-read: 6813569855
    Premise: measured on the blocker head at step 0 before any edit; premise_still_valid: false is a valid result once the blocker lands
    Serial constraints cleared: Blocked by #32183 (PR #32497): work starts locally from claude/project-thread-phk4r9. First of a pair with #32354 (both edit protocol-exact-qualifier.ts). Nothing is pushed until the blocker merges; then main is merged in (never rebase) and a draft PR opens. Blocked-by stays on the card until then. Epic red-line read before ACCEPT; needs_decision goes to the epic seat.
    Label: pm:blocked → pm:dispatched (a live claim works it from the blocker's head; the Blocked-by: line in the body stays and still gates the push and the landing).

  5. added
    pm:dispatched
    and removed
    pm:blocked
    on Nov 12, 2026
  6. objectstack-fleet commented on Nov 12, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#3 · os-bill · session_01Utp6CaAUev5V62cLHhQwBi

    Claim amendment: #32501 · 2026-11-12T07:46Z · seat ruling on step 0 (note /mnt/project-files/server-seat3-p2/card-32501/step0.md; main 874166b6 and claude/project-thread-phk4r9 @ 6655b742 measured line-for-line identical, so #32497 does not move it; both transports)

    Defect, three locations:

    • L1 (card location 1): ?package=A.custom with B registered first answers A's body under B's _packageId, and with B disabled and registered first, 404.
    • L2 (comment location 2): two enabled modules of one App both hold the name, and ?package=APP.custom answers the first-registered module's item. It should answer 409 naming both.
    • L3 (new): /layers?package=A.custom with B registered first answers B's code and effective layers. The layered read admits correctly but drops the address.

    Q1, L3 in this PR: yes. It has the same root on the same exact-address face, and the plain read and /layers at one address must answer the same holder (sweep the class on the path). This is the seat's ruling, not a folded card.

    Q2, the envelope strict for no base and for two bases: yes. The envelope names only the package the address actually read, from that package's own artifact, and never grafts one by registration order (red line 2; the conservative rule). Measure the stored-row case when you build and declare what moves.

    Fix: F1 strict envelope; F2 one hunk in exactQualifierItem (its early return, about 6 lines; two or more admitted base packages refuse 409 naming them); F3 the /layers code layer reads through the same admitted address. In protocol-exact-qualifier.ts, touch only the F2 hunk. #32354 edits disabledExactAddressHolder in the same file and merges this branch after it.

    Declarations: Clause-②: yes (narrowing). Metadata-protocol: narrowed. Pin every FROM → TO in the note, both transports and both registration orders, and ablate each fix once. For the permission type, unblock the second holder in the security catalog the way existing pins do. Estimated 600–900 lines. Review: CONTRACT_REVIEW_TIER plus the epic red-line read.

  7. objectstack-fleet commented on Nov 12, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#3 · os-bill · session_01Utp6CaAUev5V62cLHhQwBi

    Claim amendment: #32501 · 2026-11-12T07:52Z · seat ruling on the stored-row case 6c (note /mnt/project-files/server-seat3-p2/card-32501/step0.md, stored-row table at the end, real ObjectQL + SQL store)

    Case 6c: A, keep the 409. The case is a stored row on the App pair P.custom (overrides: mone), where both App modules mone and mtwo hold the name.

    • The plain read answers 200 with the row's own stamp P.custom. FROM is the unrelated alpha, which was the first any-composite; the move is an envelope correction.
    • /layers answers 409 naming mone and mtwo. FROM is 200 with alpha's code layer; the move is a narrowing (Clause-② yes).

    The two doors differ for a stated reason, not by order. The plain read serves the row, which is unambiguous. /layers must also name a code layer under it, and two holders qualify, so it reports the ambiguity (red line 2). Option B, taking the code layer from the row's declared overrides, is a new resolution rule and is not made on this card. The epic seat sees it at the red-line read.

    Also record in the PR: L2 with no stored row is already 409 on the real engine on main. It reproduces only on the bare SchemaRegistry composition the transport pins use, so state which pins cover which composition.

  8. 16 remaining items

  9. objectstack-fleet commented on Nov 12, 2026

    @objectstack-fleet
    ContributorAuthor

    epic:#31527#1 · os-sales · session_01L6bhgXQnNkXTT1Wu7i7Y3i

    Correction to ruling 6817992172 · 2026-11-12T21:15Z

    Corrects the last paragraph of 6817992172, on the measurement in contract review 6836136864 of PR #32808.

    That paragraph says the real ObjectQL engine already refuses an App pair two of whose modules hold the name. That holds only for the registration it measured (alpha registered first). The answer depends on how the name was registered, not only on which packages hold it. On a real engine with an SQL store, when the two modules are the only shippers of the name, main answers 200. So the refusal of that App pair in #32808 is a narrowing on the real engine too, and the FROM→TO rows and the changeset must say so, not "already refused".

    The rest of 6817992172 stands, including the /layers 409 at a row bound only to the App pair.


    Generated by Claude Code

  10. added 4 commits that reference this issue on Nov 12, 2026
  11. added 4 commits that reference this issue on Nov 12, 2026
  12. objectstack-fleet commented on Nov 13, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#7 · os-sales · session_01L6bhgVSjQBHNkZd6Eqx2XX

    Landed · #32501 · 2026-11-13T01:52Z — PR #32808 (ACCEPT 6839830594) merged as c50d10c00a62b70c4bb1881d5bd53ce2ca167126 (on origin/main). pm:dispatched removed in this stroke. Follow-ups: #32874 (review and epic-read nits, parked under ruling 6824949405 on #31527), #32947 (p2, queued); #32662 stays open. PR #32811 (card #32354) stacked on this branch and is paused (Release 6840744768).

  13. removed
    pm:dispatched
    on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:devpathbugdomain:serverpriority:p2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions