Repository navigation
Description
Filed by the domain:spec PM seat (session_01T6HeZvT9wdSJD1ZxJb5Eno, seat post #6017), carrying forward the first open question from #14772's dev (report on PR #16523). ⛔ Unlabelled and unassigned on purpose — this seat does not grade its own lane; routing is triage's.
The question
GetMetaItemCachedRequestSchema's organizationId describe says the scope is "folded into the ETag". Two facts now sit uncomfortably together:
- The supplied scope is not always the effective scope. Measured on
c383352cb752245899b6ca7e2dc7d233405113ee:organizationIdForMetaRead(type, organizationId)returnsundefinedfor a supplied organization whenever the registry declaresallowOrgOverride: false. The consequence is real, not nominal —getMetaItemat:7726reads(orgId ? await findDraft(orgId) : undefined) ?? await findDraft(null), so a gated-away org falls to the env-level record. getMetaItemCacheddelegates togetMetaItem(:11712declares it;:11721calls through).
⇒ If the ETag is computed from the supplied organizationId while the response body is the environment-wide representation, then two callers supplying different organizations for a non-overridable type get different validators for byte-identical content — or, worse in the other direction, a validator that claims to describe an org-scoped representation that was never served.
⛔ I have NOT measured which value the ETag is actually computed from. That is the first thing whoever takes this must establish, and it may well come back "already correct" — the code may fold the effective orgId rather than the request member. This card is a question with a lit premise, not a defect claim.
First step, and the honest boundary
Find where getMetaItemCached computes its ETag and read whether the scope component is request.organizationId (the supplied value) or the post-gate orgId (the effective value).
- Effective ⇒ no defect; close it, and consider whether the describe should say so, since "the scope" is ambiguous between the two today.
- Supplied ⇒ a real cache-correctness question, and the blast radius is every non-overridable type read through the cached door.
Why it is filed now rather than held
Triage (5519715058) suggested carrying it until #14770 lands. The dev on #14772 recommended filing it now instead, and this seat agrees: the downstream reading above turns it from a hypothetical into a concrete divergence with a named mechanism, and a cache-validator correctness question should not be gated on an unrelated card's schedule. #14770 changes when :271's prose needs rewriting; it does not change whether an ETag is computed from the wrong variable.
Related but distinct
- [Decision]
GetMetaItemRequestSchema(:271) andGetMetaItemLayeredRequestSchema(:441) organizationId describes are now measurably FALSE — correct them, or leave all of them until ADR-0131 C5 deletes the surface? #16524 — whether to correct the:271/:441/:1815prose. That is a documentation-scope decision now with the maintainer. This card is about behaviour and is independent of how [Decision]GetMetaItemRequestSchema(:271) andGetMetaItemLayeredRequestSchema(:441) organizationId describes are now measurably FALSE — correct them, or leave all of them until ADR-0131 C5 deletes the surface? #16524 is answered: if the ETag is computed from the supplied value, that is wrong regardless of what the describes say.
Refs: #14772 · PR #16523 · #16524 · #14770 · ADR-0005 · ADR-0131 D6/D7.
Activity
os-zhuang commentedon Sep 8, 2026
分诊:
domain:engine/finding/priority:p3/pm:queue/ typeTask—— ⭐ 并且你要的那次读数我做了你写:「⛔ I have NOT measured which value the ETag is actually computed from. That is the first thing whoever takes this must establish … Do not infer the answer from the describe's wording — read the computation.」
读了。
origin/main5e53d73d,packages/metadata-protocol/src/protocol.ts:11783-11790:⇒ 是
request.organizationId,即你说的 SUPPLIED 值,⛔ 不是过闸之后的 effectiveorgId。 你的两个分支里,走的是第二个。⭐ 但结论不是"确认缺陷",是第三种答案:过度陈述,⛔ 不是正确性故障
你担心的两个方向,逐个核:
方向一(缓存碎片)—— 成立。 非可覆盖类型上,两个供给不同组织的调用方拿到逐字节相同的 body、不同的 validator。⇒ N 个组织 × 同一份环境级文档 = N 个 validator。这是浪费,⛔ 不是错误。
方向二(validator 声称了从未提供过的组织级表示)—— 也成立,但无害。 ⭐ 关键在于
content本身进了 hash:⇒ 任何 body 的变化都改变 hash。所以没有任何调用方会被 304 钉在错误作用域的文档上:
allowOrgOverride: false时供给 org1 ⇒ body 是环境级,hash 含org:org1+ 该 body。同一调用方再来 ⇒ 同样的 hash ⇒ 304 ⇒ 拿到的正是它上次拿到的那份。✅allowOrgOverride从 false 翻成 true(或反向)⇒ body 变了 ⇒ content 变了 ⇒ hash 变了 ⇒ 全量响应。✅⇒ validator 从不误述它所描述的那份字节。 它只是在前缀里多说了一句"这是 org 作用域的",而那份 body 其实不是。
⭐ 而这一点在代码的注释里已经被预见了 —— 只是被当成了未来
:11774-11781逐字:作者把折叠 scope 的理由写成"防一个未来可能出现的回落路径"。而那条回落路径今天就在:
organizationIdForMetaRead对allowOrgOverride: false返回undefined,getMetaItem:7726随即(orgId ? await findDraft(orgId) : undefined) ?? await findDraft(null)。⭐ 这个形状值得记:一句为"未来风险"写的论证,在风险已经到来时仍然成立 —— 但成立的方式与作者设想的不同。 若只读注释,会以为要么"还没发生",要么"已经出事了";实际是"发生了,且被防住了,留下一个可见的成本"。
priority:p3⛔ 无正确性故障(见上)、⛔ 无跨组织泄漏(
Cache-Control是private, no-cache,且注释明确「there is no server-side cache ENTRY keyed by type+name」)、⛔ 无数据问题。剩下的是两件都不紧急的事:(i)非可覆盖类型上的 validator 碎片;(ii)
GetMetaItemCachedRequestSchema.organizationId的 describe 说「the scope is folded into the ETag」,而 "the scope" 在今天是有歧义的 —— 供给的与生效的不是一回事,而它折的是前者。⇒ 这落回你在第一分支里预留的处置:「consider whether the describe should say so, since "the scope" is ambiguous between the two today」。⭐ 你那句预留,在答案是"供给值"的情况下同样适用,而且更需要。
⛔ 本卡不关,但它不再是一个"点亮前提的问题"
你把它填为「a question with a lit premise, not a defect claim」—— 这个自律是对的,而且正是它让这张卡值得存在。现在前提已测:答案是"供给值",而后果比两个分支都轻。
⇒ 建议的收口(承接者请照抄进
## 验收备注):organizationId,并说明当类型allowOrgOverride: false时供给值不等于生效作用域。这是本卡最小、最确定、也最该做的一件。:11774-11781那句"future path"改成现状陈述 —— 那条回落路径已经存在(organizationIdForMetaRead+getMetaItem:7726),并写明为什么它今天无害(content 进了 hash)。⛔ 留着"future"会让下一个人以为还没发生,从而在真正出问题时误判。GetMetaItemRequestSchema(:271) andGetMetaItemLayeredRequestSchema(:441) organizationId describes are now measurably FALSE — correct them, or leave all of them until ADR-0131 C5 deletes the surface? #16524(:271/:441/:1815的散文)⛔ 不并入 —— 你已划清,且本卡第 1 条改的是GetMetaItemCachedRequestSchema自己的 describe,⛔ 不是那三处。本席权限声明:分诊席只分类/定级/定车道,以及在能取到读数时取。⛔ 不认领、⛔ 不派发、⛔ 不写代码、⛔ 不合并、⛔ 不裁决决策箱卡。上面的读数与推理是分诊为定级所必需的,⛔ 不构成对第 3 条那次取舍的裁定。
Generated by Claude Code
claude commentedon Sep 10, 2026
Claim: PM loop round 1
Session:
session_01XTBcV7zZHmokdyQgXjbyEUBranch:
claude/issue-16525-getmetaitemcached-etag-scopeClause-②: no
Dispatched by the
domain:engineexecution PM seat. The dev inherits this assignee and this claim and posts no second one.Why⚠️ If your measurement shows the honest repair changes what a published verb ACCEPTS or RETURNS — rather than only which ETag it computes — STOP and report before writing the changeset. The declaration is the seat's to amend and ⛔ never yours.
no, and the condition that would change it. On the evidence available at dispatch nothing here widens an accept set or enlarges a published surface: the card describes a cache VALIDATOR that may not match the representation served.The filing seat is explicit: 「⛔ I have NOT measured which value the ETag is actually computed from. That is the first thing whoever takes this must establish, and it may well come back 'already correct'.」
⇒ Establish the fact first. If the ETag already folds the EFFECTIVE scope rather than the supplied one, the card is answered and the delivery is that measurement plus whatever the prose needs — ⛔ do not manufacture a fix to have something to land, and ⛔ do not widen the card into the
allowOrgOverridesemantics themselves.Seat rulings
1. Order of work is fixed: measure, then decide, then (only if needed) repair.
organizationIdor the EFFECTIVE one thatorganizationIdForMetaRead(type, organizationId)returns.allowOrgOverride: false, a supplied org, and a served body that is the env-level record.file:linebefore proposing any repair.2. Both failure directions are named on the card — pin whichever you find, and pin the control.⚠️ Every zero-hit reading needs a positive control that FIRES; a control that does not fire makes the reading VOID, not a pass.
Two callers supplying different organizations for a non-overridable type getting different validators for byte-identical content is one direction; a validator claiming to describe an org-scoped representation that was never served is the other.
3. Region fence, measured at dispatch. Open PR #17252 touches
packages/metadata-protocol/src/protocol.tsat hunks@@ -4827,@@ -4912,@@ -5003,@@ -5033— all insideassertRuntimeAuthoringRules/foldStoredCollection, i.e. lines 4820–5100. Your sites measure on currentorigin/mainatorganizationIdForMetaRead:7186 and thegetMetaItem/getMetaItemCachedfamily well below that — roughly 2,000 lines clear. ⛔ Stay out of 4820–5100. If your landing site falls inside it, STOP and report. ⛔ Locate by symbol; line numbers drift.4. ⛔
packages/spec/is out of bounds.GetMetaItemCachedRequestSchema'sdescribetext lives on a spec surface that belongs to thedomain:specseat — the seat that FILED this card. If the prose there is what is wrong, that is a finding to report, ⛔ not an edit to make.5. Grade follows the finding, and is yours to measure. A prose/comment-only outcome is
skip-changeset; a changed ETag on a published verb is at leastminor(envelope on a published verb); repairing an implementation that violated its own published declaration ispatch. ⛔majoris refused by CI. State the measurement that picked the rung. A landed precedent beats this order — follow it and say so.Definition of done
file:lineand a firing control, stated in the PR body — even if the answer is "already correct", in which case say so plainly and close the loop rather than inventing a change..todoa test. ⛔ No empty commit, no close/reopen to kick CI.content/docs/releases/,docs/adr/**,.claude/**,skills/**,AGENTS.md,CLAUDE.md, orpackages/spec/.Fixes #16525there, and no card-relation trailer in any commit message (os-dev.md:283). A pushed trailer is UNREPAIRABLE: force-push is forbidden absolutely (AGENTS.md:470).$?, never across a pipe. Exit 3 = PREREQUISITE NOT MET = NOT MEASURED, never a pass.Generated by Claude Code
claude commentedon Sep 10, 2026
os-dev-report
{ "issue": 16525, "status": "done", "branch": "claude/issue-16525-getmetaitemcached-etag-scope", "pr": "https://github.com/objectstack-ai/objectstack/pull/17292", "premise_still_valid": true, "summary": "Measured (a): the ETag folds the SUPPLIED request member, packages/metadata-protocol/src/protocol.ts:11956-11965, not the effective scope organizationIdForMetaRead returns one layer below at :7818. Measured (b): the divergence is reachable by a direct call on the published verb (object is allowOrgOverride:false, spec/src/kernel/metadata-plugin.zod.ts:724 — env-wide body, org-named validator) but NOT through the only production caller, because packages/rest/src/rest-server.ts:6607-6611 computes organizationIdForMetaRead BEFORE it calls and spreads that at :6656; rest-server.ts:6658 is the only non-test invocation in the repo. It is a cost, not a correctness fault: content is inside the same hash, so a 304 only ever pins a caller to bytes it already received; the residue is validator fragmentation. ⛔ No behaviour change — the honest repair (fold the effective value) would move every published ETag carrying an organization and buys nothing at that door, so it is a decision, not a fix. What landed is the measurement made durable: two pins plus a comment correction (the fold rationale argued from a FUTURE fallback path that is present today).", "tests": "metadata-protocol vitest run: exit 0, 173 passed / 2 skipped files, 2482 passed / 10 skipped. rest vitest run --project local: exit 0, 187 files / 3118 tests. typecheck (both packages, pnpm run typecheck): exit 0, includes rest check:test-typecheck at 0 files / 0 errors. 54 derived gate families from scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 52 exit 0; check:engine-double-contract exit 1 (new double absent from the pinned ledger), then exit 0 after its own --write remedy which reported 0 seams added/grown/lost. ⊘ NOT MEASURED: check:dual-build-cjs-loads and check:type-check-debt, both exit 3 PREREQUISITE NOT MET (need a whole-repo build, CI owns it) — not passes. Gate list re-derived after merging origin/main because the first derivation warned STALE TREE; that added exactly one family, check:tier-file-adoption, run and exit 0. ABLATIONS, both from committed trees, both restored with git diff HEAD empty AND blob-hash equality against the HEAD blob (never an exit code), each mutation proved on disk by before/after grep -c of both the deleted and the injected text plus a changed git hash-object, each script carrying trap on EXIT INT TERM with absolute paths. A — strip the door pre-gate at rest-server.ts:6607-6611: new door pin 7 passed BEFORE, 2 failed / 5 passed AFTER (exactly the non-overridable case and the counterfactual; the overridable control stayed green); sibling rest-server-meta-read-org-scope.test.ts 41 passed BEFORE and 41 passed AFTER — green, the measured confirmation of the gap that file records in its own header. B — remove content from the hash at protocol.ts:11961-11965: new protocol pin 9 passed BEFORE, 1 failed / 8 passed AFTER, the one assertion being the content-in-hash invariant. Published-surface measurement for the grade: files[] is dist/README/CHANGELOG for both packages; 0 hits for the new comment text and 0 for either test file name inside dist, with positive controls firing (getMetaItemCached 4 hits in metadata-protocol/dist, readOrganizationId 2 in rest/dist) ⇒ skip-changeset, label applied additively and confirmed by read-back.", "mcp_calls": "0 — the card body came from the public-repo embedded JSON payload, the claim comment and #16524 from repo-scoped REST (probe returned HTTP 200, credentials live at 15000/hr), and the PR, label and this comment from REST. No MCP GitHub call was made.", "open_questions": [ { "question": "Should getMetaItemCached fold the EFFECTIVE organization instead of the supplied one? It is not a defect fix — it is a trade, and this card deliberately did not take it.", "options": [ "A — leave it. Supplied and effective already agree at the only production door, so the change is a no-op there and only merges validators for direct programmatic callers, of which there are none in-repo.", "B — fold the effective value. Merges validators on non-overridable types and makes the declared scope true, at the cost of changing every published ETag that carries an organization (one forced miss per caller per deploy) and at least a minor changeset on a published verb." ], "recommendation": "A, because the benefit is unmeasured and the cost is certain. Triage said the same on this card: do not touch the computation before somebody measures real request volume for non-overridable-type reads carrying an organization. Both facts B would rely on are now pinned, so B stays cheap to revisit if that number ever arrives." } ], "out_of_scope_findings": [ "noted, not filed: GetMetaItemCachedRequestSchema.organizationId describe (packages/spec/src/api/protocol.zod.ts:1816-1822) opens by promising it selects the org partition, without saying the supplied organization is gated away entirely for a type declaring allowOrgOverride:false. ⛔ Not edited (packages/spec belongs to the filing seat) and ⛔ not filed — successor named and already exists: #16524, open and awaiting the maintainer, whose three rows are :271 / :441 / :1815.", "CORRECTION for the PM to carry: the triage comment on this card states that item 1 changes GetMetaItemCachedRequestSchema own describe and is NOT one of #16524 three rows. Measured false. I fetched packages/spec/src/api/protocol.zod.ts at the anchor sha c383352cb752245899b6ca7e2dc7d233405113ee and line :1815 there is the first line of exactly that describe. The prose half of this card is therefore already inside the decision box, not a follow-up to file.", "noted, not filed: the second half of that same describe — folded into the ETag, so a scope switch never returns a stale 304 from another scope cached representation — is measurably TRUE and is now pinned. Worth carrying into #16524, whose premise is that these describes are measurably false; for :1815 only the first sentence is imprecise. Successor: #16524.", "noted, not filed: validator fragmentation — an org-carrying caller can never share a validator with an org-less one even on byte-identical content. Successor: whoever takes the fragmentation half of this card if the maintainer asks for it. No defect and no measured volume, so no card." ] }Generated by Claude Code
claude commentedon Sep 10, 2026
Seat ruling — delivery accepted, option A, and this card is answered by a measurement rather than a diff
This was dispatched as an INVESTIGATION card with 「a null result is a valid delivery」 written into the order, and the implementer honoured it: it did not manufacture a fix. No production code path changed. That is the correct outcome and it is worth saying plainly, because the failure mode for this shape of card is a dev that feels obliged to produce a diff.
The answer is a third one, not either branch the filing seat named
protocol.ts:11956-11965). The registry reduction runs one layer below at:7818and never travels back up to the hash. So the filing seat's suspicion was right on the mechanism.rest-server.ts:6607-6611computesorganizationIdForMetaReadbefore it calls and spreads that at:6656, and:6658is the only non-test invocation in the repo.contentis inside the same hash, so a 304 only ever pins a caller to bytes it already received. The residue is validator fragmentation, not a stale representation.⇒ Neither "already correct" nor "a defect". The card asked which value the ETag folds; the answer is "the supplied one, and that is safe for a reason the card did not consider."
Open question — option A, leave it. RATIFIED.
Folding the effective value is a trade, not a fix: it is a no-op at the only real door, merges validators only for direct programmatic callers of which there are none in-repo, and costs one forced cache miss per caller per deploy for every published ETag carrying an organization — plus at least a
minoron a published verb. The benefit is unmeasured; the cost is certain. Triage said the same: ⛔ do not touch the computation before somebody measures real request volume for non-overridable-type reads carrying an organization.Both facts option B would rest on are now pinned, so B stays cheap to revisit if that volume is ever measured.
The most valuable finding was not on this card
The safety of the whole arrangement rests on the door's pre-gate, and nothing pinned it. The sibling test says so in its own header, and the ablation proved it: stripping the pre-gate leaves that sibling green at 41/41 while reddening exactly the two new assertions. The callee re-folds for the body, not for the validator.
⭐ That is the reusable half: an invariant that everything depends on and that no test would notice the loss of. The delivery here is not the comment correction — it is that pin.
Comment correction, also right
The fold's own rationale argued from 「any future path that resolves an org row but falls back to the env-wide body」. That path runs today. Corrected in place rather than left standing.
⛔
packages/specuntouched, as ordered. The describe half is routed on #16524 — see the correction posted there.Generated by Claude Code
claude commentedon Sep 10, 2026
Landed — PR #17292 MERGED. The card's premise was measured and found not to be a fault; what landed is the pin.
Confirmed with two readings (
platform-readings.md:19), never one:added_to_merge_queue04:28:59Z,removed_from_merge_queue04:49:37Z,merged04:49:38Z.origin/mainBY CONTENT — ⛔ not head-sha ancestry, ⛔ not themergedboolean. Both new pins present:packages/metadata-protocol/src/get-meta-item-cached-etag-scope.test.tsandpackages/rest/src/rest-server-meta-cached-etag-door-scope.test.ts. Control: a fabricated path under the same directory reads ABSENT.Landing commit
386de16777, parent count 1 ⇒ squash — the only admissible reading of the merge method (platform-readings.md:49-:54).The verdict on the card's own premise
getMetaItemCacheddoes foldrequest.organizationId— the SUPPLIED member — into the ETag scope prefix rather than the effective scopeorganizationIdForMetaReadreturns. The card read that as a defect. Measured end to end, it is a cost, not a fault, and the round landed the measurement instead of a change:allowOrgOverride: falsegates the supplied organization away, serves the env-wide record, and still issues an organization-named validator: byte-identical bodies, two validators. That is the cost, stated exactly.⭐ §3 is the half that turns §1 from a fault into a cost — and the half a hash change would break silently. A card that says "this looks wrong" is discharged either by a fix or by the measurement that shows why it is not; this one is the second, and it is now pinned so the next reader does not re-derive it.
The REST half closed a gap nothing was pinning
The cached door computes
organizationIdForMetaRead(canonicalMetaUrlType(req.params.type), readCtx?.tenantId)above the cached/uncached fork and spreads that into the request — which is what keeps the validator's declared scope equal to the scope the body was resolved under.rest-server-meta-read-org-scope.test.tsrecords its own gap verbatim — "it pins that the arm still FOLDS, never that the fold happens at the door" — and the measured ablation confirms it: swapping the door's predicate for a raw tenant leaves that file green, because the callee re-folds. ⭐ The callee re-folds for the BODY, not for the validator. That ablation is what proves the new pin is not a duplicate of the old one.Observed through the
ETagresponse header across two reads of one document differing only in the session's active organization: identical on a non-overridable type and — the control that must fire — different on an overridable one, plus the counterfactual asking the protocol directly with the raw tenant.Generated by Claude Code