Repository navigation
test(runtime): get_record_context answers one caller with the same bytes on the /mcp and stdio doors over a real kernel - #37350
Merged
objectstack-fleet[bot] merged 5 commits intoNov 25, 2026
Conversation
…io plugin from runtime tests Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzi13yZRqVcp2mGonWK
…ot a deliverable) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzi13yZRqVcp2mGonWK
…cord-context-http-rig
…cp and stdio answer one caller with the same bytes Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CbeF2saT6wUBV4E9uc
…th doors Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CbeF2saT6wUBV4E9uc
Contributor
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
Contributor
Author
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X 维护者速读
席位意见:ACCEPT。 席位核对Head-sha:
|
objectstack-fleet
Bot
deleted the
claude/issue-37175-record-context-http-rig
branch
November 25, 2026 21:48
This was referenced Nov 25, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #37175
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
describein the shared harness filepackages/runtime/src/mcp-record-context-tools-bridge.test.ts:get_record_contextover one real kernel, asked through both MCP doors for one caller, every answer compared byte for byte (isErrorand the text content), refusals included.ObjectQLonSqlDriver(better-sqlite3), the realSecurityPlugin(a permission set with an object refusal, a field-level refusal and a row rule), the realObjectStackProtocolImplementation, and the realRecordContextServicePluginregistered as therecord-contextservice. Nothing of the metadata plane, the data plane or the executor is a double./mcpdoor:HttpDispatcher.handleMcpinto the realMCPServerRuntime, so the call goes through this package's HTTP data bridge (packages/runtime/src/domains/mcp.ts).MCPServerPlugin's long-lived session (createStdioDataBridge) over an in-process transport, principal-bound toOS_MCP_STDIO_API_KEY./mcprequest carries the contextresolveAuthzContextplusassembleExecutionContextbuild for the same key the stdio session resolves (ownerusr_member, active inorg_1). A precondition case checks that the stdio door's root read carried the sameuserId,tenantId,permissionsandpositions.not_visiblenote; the lookup whose target isapiEnabled: falseis answerednotVisible: true, never expanded or named (amendment 4: the door decides an expansion target's API exposure); the related row the caller's row rule refuses is absent; the body is carried whole;PERMISSION_DENIED403 before any pack is looked up, equal toget_record's answer for the same object and record on both doors;PERMISSION_DENIED403 for the whole call, the child unnamed (see Acceptance notes for the gap to ADR-0160 as amended);PERMISSION_DENIED403, named;OBJECT_PACKAGE_DISABLEDfor it, checked in the case):PERMISSION_DENIED403, unnamed;RESOURCE_NOT_FOUND404;protocol.saveMetaItem(served from the metadata registry, not shipped by the stack, no_packageId): read on both doors.packages/runtime/src/domains/mcp-record-context-37175.test.ts(console output, from the resumed backup0fa37da2) is deleted. Its rig is now thedescribeabove.packages/runtime/package.json, the lockfile andpackages/runtime/vitest.config.tsare unchanged: PR fix(mcp,runtime): get_record_context reads a package's context packs on both MCP doors #37255 already landed the two devDependencies and the two alias rows this rig needs.Tests
Final head
9c9d8a634.pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/mcp-record-context-tools-bridge.test.tsunder the verify lock:Tests 15 passed (15), VERDICT command-exit 0. Of the 15, 8 are thisdescribe's; the 7 earlier ones are unchanged and still pass.pnpm --filter @objectstack/runtime typecheck(tsc pluscheck:test-typecheckovertsconfig.test.json, which compiles this file, counted with--listFiles): exit 0, "test layer compiles … 27 file(s) / 183 error(s) … held in test-typecheck-debt.json", the ledger unchanged.["r1","r2"]and its test goes red. Sor2is absent because of the row rule, and the case can fail. The file was restored withgit checkout HEAD --;git diff HEADis empty and the blob hash equals HEAD's.Acceptance notes
stdioto equalhttp(isErrorand text). "The registry-served pack is read": the last case.executeGetRecordContextstill refuses the whole call (refuseObject(entry.object, false), step 4a). The case pins today's answer and says so in its title. When the executor changes, this case goes red on purpose. Routed by the seat, not fixed here:packages/services/service-record-context/**is outside this card's fence.packages/services/service-record-context/src/door.ts(query): a door decides each expansion target's API exposure. That file is fenced off for this card, because sibling work is in flight there. The behaviour half is pinned here (thevaultlookup case). That is why this PR saysPart of: the sentence is the half left open.maina182fbe37:RECORD_NOT_FOUNDfor a row the HTTP door read. Cause: the WIP's key resolved to a caller with no organization, while the row is inorg_1. It was the rig, not a door defect. With the key active inorg_1and the same context handed to/mcp, both doors read the row.sharingservice, and the private-OWD read filter is that service's (resolveSharingReadFilterinplugin-securityreturnsnullwhenresolveKernelService('sharing')has nobuildReadFilter). The rig now uses an authored row rule on the permission set. Both doors honour it.describe). The claim namedpackages/runtime/src/domains/**for a new file; this is a declared change of surface, and the deleted WIP file underdomains/is the only change there.Duration 18.59s (… import 17.77s, tests 655ms). The 8 new cases take under a second.Verification
Derived gates (dispatch-gates --commands, 50 families) — local
48 exit 0. Two are NOT MEASURED, each exit 3 PREREQUISITE NOT MET, so they belong to CI:
node scripts/check-plugin-teardown-shape.mjs --self-test(its positive control is pinned to a commit this shallow clone does not hold) andpnpm check:dual-build-cjs-loads(it needs every package built).dispatch-gates --ranwith recorded exit codes: "50 derived famil(ies) accounted for — 48 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3)".node scripts/pm/overlap-check.mjs --branch=HEAD: VERDICT clean exit 0 before each push.Read first (by risk):
packages/runtime/src/mcp-record-context-tools-bridge.test.ts, the lastdescribe. The risky hunk is thekeyedQlproxy, which stands in for the key's auth tables, and thecallerassembly beside it.Two-minute check:
pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/mcp-record-context-tools-bridge.test.tsshould printTests 15 passed (15).Not run locally (declared): the runtime package's full
pnpm test(653 files). The diff is this one test file, and CI'sTest Coreruns the suite. No changeset: the diff is a test file undersrc/, andpackages/runtimepublishesdist,README.mdandCHANGELOG.mdonly, with tests excluded from its build tsconfig, soskip-changeset.repo:objectstack#5 · os-bill · session_01Utp6CbeF2saT6wUBV4E9uc
Generated by Claude Code