Skip to content

fix(metadata-protocol): the bare doc read of the environment's own entry carries the environment's envelope - #38947

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-38659-bare-read-own-envelope
Dec 1, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-38659-bare-read-own-envelope

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread
Fixes #38659
Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:环境自己保存的文档与已安装包同名时,不带包名读取它,返回的归属信息改为"环境自有",不再冒充成某个包的内容;按包名读取不变。
  • 为什么做:同名文档归属治理的一部分,解决读写对同一条目归属说法不一致的问题(上一步已让环境条目优先被读到,这一步让它的身份标注也对)。
  • 出错会怎样:最坏情况是某个依赖旧标注的调用方读不到包编号,需改为显式按包名读取;改动只在读取路径,直接撤回本 PR 即可复原。
  • 要你做什么:无。

What changes

  • packages/metadata-protocol/src/protocol-package-bindings.ts: new predicate servesEnvironmentOwnItem(environmentEntry, served) — true when the bare doc read judged that the environment's own entry answers first (the existing refuseAmbiguousBareDocRead verdict) and the served item is bound to no package (storedItemPackageId, the store's own reading).
  • packages/metadata-protocol/src/protocol-meta-item-reads.ts (readMetaItem, at the artifact-envelope lookup only): when that predicate holds, no artifact envelope is looked up, so the package-less lookup no longer falls back to the first registered holder's artifact. The served item keeps its own _packageId (none) and _provenance; the envelope's packageId / provenance follow.
  • The lock is deliberately unchanged: it is the write doors' answer at that address. Measured on this rig, a save naming no package is refused 403 NOT_OVERRIDABLE while a holder ships the name (and the delete too, where a stored row exists), so lock: full, editable: false, deletable: false remain the truthful answer.
  • Step-19 migration entry doc-bare-read-environment-entry-first (packages/spec/src/migrations/entries/semantic/19.doc-bare-read-environment-entry-first.ts): the known-deviation sentence is dropped from acceptanceCriteria and replaced by the fixed behaviour.
  • Changeset .changeset/38659-bare-read-own-envelope.md (patch: metadata-protocol, spec).
  • New card-named test packages/runtime/src/domains/meta-bare-read-own-envelope-38659.test.ts (28 cases).

Tests

Red first, green, ablation
  • Red-first on base-built dist (fix committed, not yet built): 12 failed / 16 passed of 28. 8 were the envelope pins (all four cells, both entry forms); 4 were the first draft of the lock pin, which asked the delete door in the stamp-less form, where this host-config rig's delete has no row to remove. That pin was narrowed to ask the delete only where a stored row exists (see Acceptance notes).
  • Green after pnpm --filter @objectstack/metadata-protocol build: 28 passed (28), head a2de8f4.
  • Ablation (mutation: the predicate call guarded by an always-false length test on the string literal ABLATION-38659 via scripts/ablation-replace.mjs, rebuilt, ablation-dist-preflight.mjs marker present in 2 built files): 8 failed / 20 passed — exactly the 8 envelope pins; restore blob == HEAD, git diff HEAD empty, rebuilt, preflight --absent clean. A first ablation attempt used a comment marker, which the build strips (preflight reported it absent); that reading was discarded and redone.
  • Cells: one holder (registered first / last), two holders (alpha first / beta first); transports: runtime HttpDispatcher, RestServer registered handler, in-process protocol.getMetaItem; entry forms: stamp-less bare-slot registration, package-less stored row hydrated before the artifacts. CONTROL: each holder's ?package=X reads X's doc under X's envelope with the entry present; no entry: one holder served under its own envelope, two holders refused 409 RESOURCE_CONFLICT.

Acceptance notes

  • Card Done-when 1: met for the plain read on all three transports in all four cells, both registration orders, where the environment's entry sits in the registry's bare slot unstamped (a stamp-less registration, or a package-less stored row registered before the artifacts). Not met beside ONE holder when the hydrator (hydrateOverlayIntoRegistry) runs after the artifacts: it withholds the holder's envelope only beside two or more holders (protocol-registry-hydration.ts, environmentDoc), so the bare slot already carries the holder's stamp, no entry is judged and this arm is never reached (contract review 7317221531, ③ finding 1; the dev's class-b finding). That cell is the hydrator's and moves to metadata-protocol: boot hydration with one enabled holder stamps a package-less stored row as the package's, so the bare read serves the package doc instead of the environment's own item #38952, whose fix lets this arm answer it. /layers and /published were measured before the fix and carry no package envelope, so they are unchanged.
  • Card Done-when 2: the step-19 entry's known-deviation sentence is dropped.
  • The card's premise that "a write to the same address writes the environment's row" did not hold on this rig: the bare save is refused 403 NOT_OVERRIDABLE (sealed base) in every cell. The envelope's lock therefore stays full, which agrees with the write doors; changing the write door would be its own card.
  • Observation (not filed here, reported to the seat): beside ONE holder, a package-less row hydrated by loadMetaFromDb after the artifacts is stamped with the holder's envelope in the registry, and every bare door serves the holder's doc while the registry's bare slot holds the environment's body.
  • Observation: with a stamp-less bare entry and no stored row, deleteMetaItem naming no package resolves on this host-config rig while the read reports deletable: false.

Verification

Two-minute check: pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/domains/meta-bare-read-own-envelope-38659.test.ts after building @objectstack/metadata-protocol — expect 28 passed.

Files to read first: protocol-meta-item-reads.ts (the artifactItem ternary), protocol-package-bindings.ts (servesEnvironmentOwnItem), then the test.

Hand-over and take-over

Handed over by repo:objectstack@os-steve at a2de8f4 on the maintainer's order (Release 7314610017); taken over by repo:objectstack@os-support-ai (claim 7315270082, Resume-from: a2de8f41), which merged main in (no rebase) at 11bc369.

Lock question (dev report 7314551774): option A, as a premise correction by the seat — the bare write doors refuse 403 NOT_OVERRIDABLE while a holder ships the name, so lock full is the entry's own lock at that address and reads and writes agree (ruling 6942962369: "reads and writes give the same answer"). No behaviour change; B (the write doors) is not this card.

Readings at 11bc369 (after the main merge; turbo run build --filter=@objectstack/runtime..., 42 tasks):

  • New test: 28 passed (28).
  • Ablation re-run by the taker (call-site arm guarded false &&, metadata-protocol rebuilt): 8 failed / 20 passed, exactly the 8 envelope pins; restored with git restore --source=HEAD --staged --worktree, status clean, rebuilt.
  • Full pnpm --filter @objectstack/metadata-protocol vitest: 379 files passed, 9 skipped; 23868 tests passed, 45 skipped.
  • packages/spec src/migrations: 212 passed. pnpm --filter @objectstack/spec check:generated: all 14 generated artifacts up to date.
  • Typecheck: metadata-protocol 0, spec 0; runtime tsc --noEmit clean, its check:test-typecheck names 3 files outside this diff that import @objectstack/driver-turso, unbuilt in this filtered closure (TS2307; prerequisite, not a verdict; CI builds the full closure).
  • overlap-check.mjs: clean against origin/main and every open PR head.

Left to CI: the gate families the hand-over listed as NOT MEASURED.


🤖 Generated with Claude Code

https://claude.ai/code/session_01ADHkmNrdDzc1MxHJU3Tvyb

…try wears no holder's envelope

Claude-Session: https://claude.ai/code/session_01ADHkmNrdDzc1MxHJU3Tvyb
Co-authored-by: Claude <noreply@anthropic.com>
…rop the step-19 known deviation

Claude-Session: https://claude.ai/code/session_01ADHkmNrdDzc1MxHJU3Tvyb
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

3 anchor(s) derived from 2 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run.

What this run could not see
  • the SDK route bridge reached 71 of 254 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 184 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 202cc2860dfc789d3a9137e0ecf9352830a2a67a → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 29a71588e89aaa5278b4fd8758078bc4cbde3d41 — the merge of head 304f3ac298e054de359e77a9060194a6250c1a92 into base 202cc2860dfc789d3a9137e0ecf9352830a2a67a, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 29a71588e89aaa5278b4fd8758078bc4cbde3d41 && git checkout 29a71588e89aaa5278b4fd8758078bc4cbde3d41
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 202cc2860dfc789d3a9137e0ecf9352830a2a67a 304f3ac298e054de359e77a9060194a6250c1a92 && git checkout -B drift-repro 202cc2860dfc789d3a9137e0ecf9352830a2a67a && git merge --no-ff 304f3ac298e054de359e77a9060194a6250c1a92

node scripts/docs-audit/affected-docs.mjs --json 202cc2860dfc789d3a9137e0ecf9352830a2a67a

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhiGvpFMQX4XptMEtQ

Flake judgement · head 11bc3690 · 2026-12-01T15:36Z

Test Core (11/12) (run 46674630465, job 142741512490) is red on one case only: packages/plugins/plugin-approvals/src/flow-route.integration.test.ts > "[#38838] a fan-out to two approval steps is refused at publish" > "an active save is refused with 422 INVALID_METADATA…", Test timed out in 5000ms (1 failed / 2259 passed in that package). The case is a metadata SAVE; this diff changes only the bare doc READ's envelope lookup (readMetaItem), and touches no save path and no approvals code. Locally on the same head, after turbo run build --filter=@objectstack/plugin-approvals..., the file ran three times: 24 passed (24) each time. Judged a timing flake on a loaded runner; the failed jobs are re-run once through the relay. A second failure is read as real.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhiGvpFMQX4XptMEtQ

Contract-review-claim: session_01WGufzhiGvpFMQX4XptMEtQ · head 11bc369 · 2026-12-01T15:38Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhiGvpFMQX4XptMEtQ

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 11bc36902fc2862ddfc8047699c5745d7dbca949
Local-runs: none
Scope: packages/spec/src/migrations/entries/semantic/19.doc-bare-read-environment-entry-first.ts + packages/metadata-protocol/src/protocol-meta-item-reads.ts, packages/metadata-protocol/src/protocol-package-bindings.ts

Read for this record: card #38659 (body and all six comments), PR #38947 (body, file list, net diff against merge-base 645e6b1 restricted to the five files), and the check-runs on this head with their job logs. Nothing was built or run.

Gate state on this head, read off the check-runs: 60 green, 15 skipped, 2 red. The red pair is Test Core (11/12) on its latest attempt (attempt 2, job 142763569116, completed 15:56Z) and the Test Core aggregate. This record judges the contract; it does not clear that red (see ③).

① Derived judgments

  1. Accept set: nothing moves. No schema, zod or type change; the SemanticMigration shape is untouched. The spec delta is the string value of one entry's acceptanceCriteria and the comment above it. Right.
  2. The one behaviour change, a read's answer: GET /api/v1/meta/doc/NAME naming no package and the in-process getMetaItem / execution-face read with no packageId (one function, readMetaItem). When refuseAmbiguousBareDocRead returned the environment's entry (the registry's package-less answer beside one or more enabled holders) and the item the layers reached is bound to no package, no artifact is looked up. FROM item._packageId / _packageVersion the first registered holder's, _provenance: 'package', and the envelope's packageId / packageVersion / provenance likewise; TO none, and the entry's own provenance. Right by ruling 6942962369 as the card quotes it, and it brings the plain read into line with the layered read, which already lent the entry no artifact (protocol-meta-layered-reads.ts:470). Measured by CI: the new test 28/28 in Test Core (5/12) (four cells, two entry forms, three transports); @objectstack/metadata-protocol 379 files / 23868 tests green in (9/12).
  3. Unchanged, by reading. A read naming a package: the verdict is computed only when no package is named, so ?package=X never takes the new arm (pinned by the CONTROL cases). Every non-doc type: the verdict is undefined and the predicate is false on its first operand. Draft reads return before the changed line. Right.
  4. Derived and NOT pinned: the entry beside an enabled holder while the first registered holder is disabled. On main the package-less lookup's any-composite tier (registry-package-addressing.ts:616-621, which does not skip a disabled package) could stamp the entry with the disabled holder, and the item face judges that stamp (isItemOfDisabledPackage, protocol-meta-item-face.ts:1008); with no stamp the entry is served. Right in direction (metadata-protocol: a name held only by stored rows of two packages, one disabled, answers by save order, and /layers takes the first composite when the environment holds its own item (ADR-0150 D3) #32354 as the claims cite it: a disabled package holds no name); by reading only. For the lane seat and for metadata-protocol: the _env draft and layered reads answer 409 naming a DISABLED registry holder, against the principle that a disabled holder counts for nothing #38753's lane, whose excluded files this diff does not touch.
  5. Export surface: servesEnvironmentOwnItem is exported from an internal module only (not re-exported by the package index, no exports subpath). The new import @objectstack/metadata/stored-item-package is an existing dependency edge (six sibling modules import it). Right; nothing published moves beyond item 2 and the entry's string.

② Semver level

patch on @objectstack/metadata-protocol (the fix) and on @objectstack/spec (the entry's string ships in the package and is printed by os migrate meta --from 18); @objectstack/runtime gains a test only and takes no bump. Right. The kind Metadata-protocol: none is right (nothing a metadata author can write changes) and none takes patch (AGENTS.md, Post-Task Checklist step 3). The declaration Clause-②: no is right: no accept-set or export widening or narrowing; a read's answer changes in one cell, and the changeset body carries FROM, TO and the one-line fix for a caller that read the holder's id off the bare read. Both declaration lines are line-initial in the PR body and in the changeset body; Check Changeset is green on this head.

③ Boundary flags

  • Lock, option A against main (dev report 7314551774; claim 7315270082). The claim holds: A changes no lock behaviour. The diff only replaces artifactItem with undefined in this cell. With itemLock passed, mergeArtifactProtection takes the lock family from itemLock and lets the artifact contribute _packageId, _packageVersion and _provenance only (protocol-package-bindings.ts:176). itemLock is resolved from the read's address (artifactLockLayerAt plus the overlay rows). servedLockState computes lock, editable and deletable from itemLock and packagedBaseRefusal({ type, name, operation }), and reads only provenance, packageId and packageVersion off the body (protocol-lock-state.ts:92); resettable stays isArtifactBacked(type, name). None of those inputs is touched. CI pins the result: lock: full, editable: false, deletable: false in every cell and form, and the save naming no package refused 403 NOT_OVERRIDABLE. Two consequences for the seat: the card's Done-when words "its own ... lock" are met only under the seat's reading (the lock at the entry's address), and the card body's sentence that a write "writes the environment's row" is contradicted by that pinned refusal.
  • Option B: ESCALATE, not answered here. After this PR the read says the item is the environment's (no package, its own provenance) while the save at the same address is refused with the sealed base's NOT_OVERRIDABLE. The two doors agree on the verdict, not on whose item the address is, and the environment can neither edit nor delete its own entry while a holder ships the name. Whether that stands is a maintainer ruling (ADR-0146 D8, as the dev says): a decision card, outside this PR.
  • Dev out-of-scope finding 1 (class b, hydration beside ONE holder): confirmed by reading, not moved by this diff; ESCALATE to the seat's filing gate before ACCEPT. hydrateOverlayIntoRegistry withholds the envelope from a package-less doc row only when more than one package ships the name (environmentDoc, protocol-registry-hydration.ts:937). doc is not a package-scoped type, so beside one holder the package-less lookup lends that holder's artifact, and the bare slot holds the environment's body under the holder's _packageId and _provenance: 'package'. The registry's answer then carries a package, refuseAmbiguousBareDocRead returns no entry, and the new arm is never reached. See N1.
  • Dev out-of-scope finding 2 (the delete naming no package resolves when no stored row exists, while the read says deletable: false; "carrier: none"). On main already, untouched here. It is the same question as option B: fold it into that decision card so it has a carrier.
  • New, by reading, not measured (for the filing gate). (a) The list door still takes the old rule: protocol-meta-list-reads.ts:1138 looks each listed item's artifact up at envelopePackageId(packageId, it), and registry.listItems('doc') returns every registry value of the type, the bare-slot entry included, so GET /api/v1/meta/doc can still list the environment's entry under the first registered holder's envelope. Outside the card's Done-when and the entry's surface. (b) Beside holders that are ALL disabled the read judges no entry (packageScopedHoldersOf counts enabled holders), so the entry can still take a disabled holder's stamp; that is metadata-protocol: the _env draft and layered reads answer 409 naming a DISABLED registry holder, against the principle that a disabled holder counts for nothing #38753's ground.
  • Dev deviations. Status partial: closed by the take-over (claim 7315270082; the PR body now closes the card). Local gates and suites NOT MEASURED: answered by the check-runs, green except the red below. A card-named test file instead of a shared harness file: the lane seat's ACCEPT, no contract effect. The changeset also bumps @objectstack/spec: right (②).
  • The report's owed_reviews ("no governed surface touched") was wrong: the diff edits non-test packages/spec/src/**. Release 7314610017 and claim 7315270082 corrected it; this record is that review.
  • File surface: the five files of the PR are inside claim 7315270082's surface; the three excluded files and every write door are untouched.
  • PR author is objectstack-fleet[bot]: no off-relay note owed.
  • SQL push-down: no finding. The diff adds a pure predicate and one ternary arm; no read, no id materialisation, no in-app join.
  • Check-runs: the head is not green. Test Core (11/12) is red on both attempts of this head, and was red on the earlier head a2de8f4, each time with one signature: packages/plugins/plugin-approvals/src/flow-route.integration.test.ts, "[approvals: a node fanning out to two approval steps opens two pending requests in one run, and the second has no suspension, so deciding it never moves the run #38838] a fan-out to two approval steps is refused at publish", first case, Test timed out in 5000ms (141 of 142 files green, the other nine packages of the shard green). By reading it is unrelated to the diff: the case boots a kernel and saves a flow, and the changed code is one O(1) predicate inside the doc read's envelope step. The case is marginal against its default timeout: it took 2082 to 3909 ms on five green runs elsewhere (main at 44d0f88, 8338d07 and ad83af4; the heads of fix(formula)!: a flow condition's mixed bare / record. date arithmetic and record['FIELD'] index reads take the date-text verdicts #38949 and fix(spec)!: refuse a flow node that takes a branch which parks the run before its other out-edges #38970, both spec-touching, with this head's shard composition and cache profile), and on the three red runs the suite's transform and import phases were slower too (91.9 to 106.6 s and 1073 to 1264 s, against 63.6 to 85.1 s and 760 to 960 s on the green runs that printed them), which this diff cannot move. Still, 3 of 3 on this branch against 5 of 5 elsewhere is not settled by reading. The merge-base (645e6b1) ran shards 1 to 3 only, so there is no same-signature red on the merge-base to discount it. The all-green landing check therefore stands unmet on this head: a green re-run on this same head keeps this record; any commit that moves the head owes a new one.

④ Design judgment

No must-fix, no should-fix.

19.doc-bare-read-environment-entry-first.ts (hits). The dropped sentence described the defect this diff removes, and the new sentence holds against the code wherever the read judges an entry: with artifactItem undefined, mergeArtifactProtection returns the served item with the resolved lock family only, and servedLockState reads provenance and package off that body, so the item carries no _packageId or _packageVersion, its own _provenance, and the envelope follows. It also agrees with the other doors the entry's surface names: the layered read lent the entry no artifact before this diff. The comment above the entry is accurate. Card Done-when 2 is met. Against the accepted scenario: Done-when 1's cells (one and two holders, both registration orders, both HTTP transports plus in-process, ?package=X control) are each pinned and green in CI; its "own lock" is answered in ③. One limit of the evidence, for the lane seat: the test's "hydrated" form is laid by hand (registerItem with _provenance: 'org'), not by the hydrator, and only in the before-the-artifacts order.

  • N1 (nit, follow-up card): with the known-deviation sentence gone the entry states no deviation, while the entry's own surface counts "a package-less sys_metadata row once it is hydrated ... into the registry's bare slot" as an entry and, beside ONE holder hydrated after the artifacts, no sentence of the acceptance is reached (③, finding 1). That gap is in the unchanged first sentence, exists on main, and is not widened here; the card the seat files for it owns either the hydrator fix or a deviation note in this entry. Left on this head.

protocol-package-bindings.ts (servesEnvironmentOwnItem) and protocol-meta-item-reads.ts (the call-site arm). The code agrees with the contract sentence by sentence. Both conditions the docblock names are the code's two conditions (a verdict that is neither undefined nor null; a served item for which storedItemPackageId is undefined, sentinel included). The fallback it describes is the one in the tree (envelopePackageId names no package for such an item; the lookup's any-composite tier answers the first registered holder). "A package-less item the read did not judge ... keeps the base's envelope, as before" holds: the verdict exists only for a bare doc read. Attempts to break it: a served item that is package-less but is not the registry's entry can only be the environment's own stored row or the service's package-less copy, each the environment's own; a served item bound to a package (a declared override, a package's row) fails the second condition and keeps its own package's envelope, body and envelope consistent; a read naming a package never has a verdict. The arm sits at the one artifact lookup of the by-name read, after its layers have answered.

  • N2 (nit, jsdoc, unchanged lines 221-225): envelopePackageId's docblock still says the list and the by-name read take "the one rule" and that "one served body wears one envelope on both doors"; for this cell the by-name read now takes a rule the list does not (③, new item a). Left on this head; the list-door card owns it.
  • N3 (nit, jsdoc): the new docblock says the write doors "refuse a save and a delete there"; the delete naming no package resolves when no stored row exists (③, finding 2). The envelope's deletable: false is what the code computes; the sentence overstates the door. Left on this head.

Nits only; none is fixed on this head, since an edit to a code file would move it.

Implemented-by: claude/issue-38659-bare-read-own-envelope
Reviewed-by: subagent-of-session_01WGufzhiGvpFMQX4XptMEtQ

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhiGvpFMQX4XptMEtQ

The brief handed to the isolated contract-review sub-agent (served at CONTRACT_REVIEW_TIER, effort high) whose record is comment 7317221531. Additions beyond the template: the implementing files named (protocol-meta-item-reads.ts, protocol-package-bindings.ts), the re-run of Test Core (11/12), and a request to judge whether lock option A (dev report 7314551774) changes behaviour against main.

Contract review brief — PR #38947 @ 11bc36902fc2862ddfc8047699c5745d7dbca949 (card #38659)

You review at CONTRACT_REVIEW_TIER. Render ONE ## Contract review record on this head — its shape is
node scripts/pm/record-recognisers.mjs --template — with a PASS or FAIL verdict, and post it as ONE comment
on the PR or its card.

Inputs — these and nothing else:
· card #38659: its body and EVERY comment (rulings and earlier records included)
· PR #38947: its body, its file list, and the net diff against main at 11bc36902fc2862ddfc8047699c5745d7dbca949
· the check-runs on 11bc36902fc2862ddfc8047699c5745d7dbca949: their conclusions ARE the gate verdicts
⛔ Not the dispatch order, ⛔ not the dispatching seat's own conclusions — this brief is adversarial by design.

Scope — the paths reviewFace returns as hits on this PR's file list: packages/spec/src/migrations/entries/semantic/19.doc-bare-read-environment-entry-first.ts;
plus every file IN THIS DIFF that directly implements or enforces them — the gate that enforces a rule, the code
a jsdoc or schema line describes, the validator a skill teaches — reviewed for agreement with the contract.
Widen it freely, ⛔ never below hits; the record's Scope: line names the implementing files apart from hits.
The rest of the diff (tests, unrelated modules, lockfiles, generated output, changesets) is the lane seat's
ACCEPT at TIER_DEFAULT, exactly as a standalone PR of those files.
④ judges the hits files and those implementing files ONLY:
lockfiles, generated output, changesets and prose elsewhere in the PR are not reviewed;
code outside the diff is READ to judge them, never reviewed.

Security — if a hits path is under skills/** or ui/skills/** and the change teaches security, auth or permission
behaviour the path name doesn't show, the record says so and the seat adopting the record adds the security label.
The record says so on its Security-touching: line, and the arm lands on no alone: write no ONLY when no changed
hunk teaches permission, sharing, credential, token, authentication or other security behaviour, else yes.

Rule change — if a hits path is under .claude/**: the PR body declares Rule-change: and you verify it against the diff.
Write Rule-change-verified: none ONLY when no changed hunk alters what an agent may do without the maintainer
(merge, bypass a check, change repository settings), what gets done and in what order (grading, dispatch, scope), or
what must go to him (decisions, maintainer actions); process steps, scripts, wording, slimming and file moves are not rule
changes. Write ruled ONLY when every such hunk copies the ruling the PR body quotes on its Ruling-ref: line — check the
copy against the quoted words, do not re-rule it. Otherwise yes: the pull request then waits for the maintainer.

⛔ READ-ONLY. No worktree, no checkout, no build, no test run, no gate re-run, no ablation: the check-runs
on the head already answered every derived gate family, and a local run costs more than it returns.
If ONE probe is unavoidable, the record's Local-runs: line says probe — REASON; otherwise none.
Scratch space is scratchpad/pr-PR-NUMBER/ alone; nothing there you did not write this round is read.

Judge, in the record's own sections:
① Derived judgments — every accept-set and public-surface change the diff implies, each named right or wrong.
② Semver level — the changeset (or skip-changeset) matches what the diff publishes, and the Clause-②: line.
③ Boundary flags — every dev flag and every open_questions entry answered, or escalated.
On every face, SQL push-down: a new id materialisation or in-app join where SQL could push down is a
finding unless a reason is given (AGENTS.md, Prime Directive 5: SQL first).
④ Design judgment — for EVERY hits file: does the change hold against the code it cites and the
scenario it is accepted against? A skill file against the card's eval prompt and the spec it teaches
on main; a schema file against the ruling or ADR it implements and its first consumer; an ADR
against its first consumer and its execution plan. For EVERY implementing file in the diff: does the
code agree with the contract, sentence by sentence? Read the cited code in the live tree, and try to
break the design.
Grade each finding must-fix, should-fix or nit — a nit has no effect on correctness or the contract.
A must-fix is a FAIL; a must-fix or should-fix earns a delta review of its fix; nits alone end the round.
Spell a must-fix or should-fix with its id and grade, S1 (should-fix) — …, and a clean round as
No must-fix, no should-fix.: the queue guard reads a graded finding as OPEN on this head and
refuses the record; the delta record names those it closes by id alone, S1: closed.
A nit is fixed only on the prose faces, or left as an accepted deviation or a follow-up card: a fix
anywhere else moves the head, and this record no longer covers it.
⛔ Judge the tree, never the PR body's account of it.
Sign Implemented-by: with the dev's branch and Reviewed-by: with your session id — the value is the FIRST
thing after each colon.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm

L1 review · PR #38947 (#38659) · head 304f3ac (landing) · 2026-12-01T22:27Z

VERDICT: ACCEPT once one paper item is done (P1, body only, the head does not move). The code has no must-fix and no should-fix. I confirm on this same head when the body reads as below.

Next: the body patch, then my same-head confirm, then landing.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm

L1 confirm · PR #38947 (#38659) · head 304f3ac (same head) · 2026-12-01T22:30Z

VERDICT: ACCEPT. P1 of L1 7327911365 is closed on paper, and the head has not moved.

Next: landing. The merge closes #38659.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhPdWmTd47Fi2bKYZS

席位核对

ACCEPT — PR #38947 @ 304f3ac298 (card #38659; card thread of seat os-support-ai).

落地

reading value
check-governed-merges.mjs --pr 38947 NOT governed; 342 changed lines ≤ 3000
pr-state.mjs on 304f3ac2 62 success · 15 expected skip · 0 failed · 0 pending; mergeable_state clean
landing-k.mjs --pr 38947 K = 0 < 15
l1-face.mjs --pr 38947 one flag (changeset), judged above; every other leg ok

State change: ready for review + auto-merge, by the owning seat; on merge it closes #38659.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review December 1, 2026 22:34
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Dec 1, 2026
Merged via the queue into main with commit f13adae Dec 1, 2026
78 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-38659-bare-read-own-envelope branch December 1, 2026 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants