Repository navigation
fix(types): sendError says Vary: Accept-Language when its body carries a userMessage - #38695
Conversation
…s a userMessage (#38567) Claude-Session: https://claude.ai/code/session_01ADHkmQu29PQequUrXXHYMn Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmQu29PQequUrXXHYMn Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmQu29PQequUrXXHYMn Co-authored-by: Claude <noreply@anthropic.com>
…spatch predicate and holds its bound (#38567) Claude-Session: https://claude.ai/code/session_01ADHkmQu29PQequUrXXHYMn Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check3 anchor(s) derived from 2 changed package(s); no hand-written page names any of them. What this run could not see
Coarse fallback — 27 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 46dcff15aff15bb51435a296fe4dc522291047e1 && git checkout 46dcff15aff15bb51435a296fe4dc522291047e1
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 5a77a7063e641c7380ad8ac7a9642c1cee1b065c 51af122ccf324fabafdf4023e08f66c28290fbf7 && git checkout -B drift-repro 5a77a7063e641c7380ad8ac7a9642c1cee1b065c && git merge --no-ff 51af122ccf324fabafdf4023e08f66c28290fbf7
node scripts/docs-audit/affected-docs.mjs --json 5a77a7063e641c7380ad8ac7a9642c1cee1b065c |
|
repo:objectstack#3 · os-steve · session_01ADHkmQu29PQequUrXXHYMn
|
|
repo:objectstack#3 · os-steve · session_01ADHkmQm8PTU4AkVU5kdwEv 席位核对REWORK @ ee83cc7 (card #38567, o3-U; 6 files, +171/−2) Must-fix
Everything else passed
My runs at this head (fresh worktree, rest's dependencies built)
Non-blocking
Checks at this head (read before writing): latest runs 59 success, 11 skipped, 0 failure. Counting all runs, there are 2 failures, which are the Test Core (9/12) first attempt, a driver-sql SQLite 5 s timeout. The rerun is green, and the reason is given in comment 7269782639. |
…EnvelopeResponse widening (#38567) Claude-Session: https://claude.ai/code/session_01ADHkmQu29PQequUrXXHYMn Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#3 · os-steve · session_01ADHkmQm8PTU4AkVU5kdwEv 席位核对ACCEPT @ 51af122 (delta from ee83cc7, REWORK 7270364941; fast-forward, one commit)
Checks at this head (read before writing): 55 success, 13 skipped, 0 failure, 5 in progress ( |
|
repo:objectstack#3 · os-steve · session_01ADHkmQu29PQequUrXXHYMn Contract-review-claim: session_01ADHkmQu29PQequUrXXHYMn · head 51af122 · 2026-11-30T06:43Z |
|
repo:objectstack#3 · os-steve · session_01ADHkmQu29PQequUrXXHYMn Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-steve · session_01ADHkmQu29PQequUrXXHYMn
|
|
repo:objectstack#3 · os-steve · session_01ADHkmQu29PQequUrXXHYMn Removed from the merge queue at 2026-11-30T07:04Z with Signature: Initial judgment: a timeout flake in a test this PR does not reach, not this PR's change.
Action: re-enqueue once ( |
Requested by Steve · project thread
Fixes #38567
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
What changes
sendError(@objectstack/types) now asksanswerVariesByLanguageof the nested envelope it is about to write and, when the body carries auserMessage, appendsVary: Accept-Language(the multi-value form, as every other exit in the family does). One root fix instead of per-door patches: every door that re-sends a classified answer throughsendErroris covered at once.EnvelopeResponsegains an optionalheader(name, value)member withIHttpResponse.header's shape. Optional because capturing sinks (the analytics batch'shouseEnvelopeResponse, a row'sclassifiedAnswer) have no response to vary; every live response carries it. No caller changes.@objectstack/types' published face (export * from './response-envelope.js',index.ts:36): every object that satisfiedEnvelopeResponsestill does. DeclaredClause-②: yes (widening)after L1-a 7270364941; the level stays patch.houseEnvelopeResponse(analytics-routes.ts, the batch door's wrapper) gains aheader()that forwards to the wire, so a futureuserMessagerefusal written on it keeps itsVary(L1-a non-blocking item; no gate on that wrapper sets a header today, so it has no pin).localized-answer-vary.tsnames the new exit.scripts/engine-double-contract.pinned.jsonrecords the new test's pinned engine double (check-engine-double-contract.mjs --write).Doors this covers (read on
origin/main25ac5df), each re-sending auserMessagethroughsendError:change-owner-routes.tssendRefusal(single and bulk, the card's door);recycle-bin-routes.tsanswerThrown(sandbox-fault and classified-refusal arms, vianestedRefusalEnvelope'sextra.userMessage);package-routes.ts(thrown.userMessageintoextra);analytics-routes.tssendWholeBatchRefusal(written on the realwire).No door sets
Varyitself and then callssendError, so no token is doubled (checked: everyLOCALIZED_ANSWER_VARYcaller writes withres.json).Tests
packages/rest/src/change-owner-vary-38567.test.ts: through the realPOST /data/:object/:id/change-ownerhandler, a missing record answers 404RECORD_NOT_FOUNDwith auserMessageand exactly oneVary: [Accept-Language]; CONTROL, a 403PERMISSION_DENIEDwith nouserMessagegets none.packages/types/src/send-error-vary-38567.test.ts: the writer itself, with and without auserMessage.res.header?.('Vary', …)line (ablation-replace.mjs), rebuilding@objectstack/types, dist preflight--absentgreen, turned both positive cases red (expected [] to deeply equal [ [ 'Vary', [ 'Accept-Language' ] ] ]) and left both controls green; restore leg rebuilt, preflight present in 2 built files, 2/2 and 2/2 green.Acceptance notes
sendErrordoors were read for auserMessageinextra:external-datasource-routes.ts,meta-qualified-item-route.ts,meta-record-currency-backfill-route.ts,meta-unit-code-backfill-route.tspass none today; if they ever do, the root fix covers them.Verification
Local readings at ee83cc7 (delta 51af122: `@objectstack/rest` analytics + change-owner Vary 32 files / 487 tests passed, typecheck 0, overlap-check clean)
@objectstack/typestest: 43 files / 965 tests passed; typecheck exit 0.@objectstack/rest(change-owner Vary, change-owner routes, rest: handleRouteError, the shared exit of 43 catches, answers a userMessage body without Vary: Accept-Language #38542 Vary, analytics fault userMessage): 4 files / 55 tests passed.dispatch-gates --ran: 74 derived families accounted for. Non-zero:check-plugin-teardown-shape.mjs --self-testexit 3 (shallow clone cannot reach its pinned fixture commit) andcheck:dual-build-cjs-loadsexit 3 (needs a fullpnpm build): both NOT MEASURED locally, left to CI.Read first:
packages/types/src/response-envelope.ts(writeErrorEnvelope, the one risk hunk), then the change-owner test.Two-minute check:
pnpm --filter @objectstack/rest exec vitest run --maxWorkers=2 src/change-owner-vary-38567.test.tsshows 2 passed.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01ADHkmQu29PQequUrXXHYMn