Skip to content

rest: change-owner on a missing record answers a userMessage through sendError without Vary: Accept-Language #38567

Description

@objectstack-fleet

repo:objectstack#5 · os-project-manager · session_01FEkQ5mzSTSPADAvwapnhxr

Filing gate: ② fleet. Source: out-of-scope finding of the #38542 dev, measured through the real route handler (dev report 7254247955 on #38542). Not dispatched: the seat's ux area is winding down (maintainer 2026-11-29 「ux 专区也不再接新卡」).
Grading: area:ux · Bug · p2 · reach: every caller of the change-owner door on a missing record, in any non-default language.
Same family as #38316, #38507, #38542 (localised refusals must carry Vary: Accept-Language).

维护者速读

  • 现象:改记录负责人的接口 POST /api/v1/data/:object/:id/change-owner 遇到记录不存在时,答 404 RECORD_NOT_FOUND,带了按语言翻译的提示,却没带 Vary: Accept-Language,缓存可能把一种语言的答复发给另一种语言的用户。
  • 要你做的:无。

Fact

Acceptance

  • That answer carries Vary: Accept-Language; a test through the real route handler pins it, with an ablation.
  • Check whether any other door answers a userMessage through sendError the same way; fix those in the same PR or list them.

Dedupe: change-owner Vary 0 open (only #38542); sendError Vary 0 open.

Activity

  1. added
    bug
    priority:p2
    pm:queue
    on Nov 29, 2026
  2. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · zhuangjianguo · session_01QsR2jRH2X4frz9bBiZHNk4

    Triage: lands in the change-owner door's error path (sendError in packages/types, or the door itself) with a test through the real route · area:ux · domain:server · Bug · p2 · pm:queue · size S. Grading line: area:ux · Bug · UX rule p2 · evidence measured (dev report 7254247955). Same family as #38316, #38507, #38542. Type set to Bug at this touch.

  3. added
    domain:server
    on Nov 29, 2026
  4. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-warren · session_01JQwxbamiNxp7695qyaEYsH
    Parked by zone o2-U (area:ux intake): waits on the in-flight sibling of the same family.
    Blocked-by: #38585
    Reason: open PR #38585 (Fixes #38542, seat 1 claim 7256078743) touches packages/rest/src/change-owner-routes.ts and adds packages/types/src/localized-answer-vary.ts, the same door and helper this card's fix needs. Same file, same family, in flight: this card waits rather than racing it.
    On unblock (PR #38585 merged): re-measure on main whether change-owner on a missing record still answers a userMessage through sendError without Vary: Accept-Language. If #38585 already covers it, close as completed with the reading; otherwise dispatch with the card's Acceptance unchanged.
    Grade unchanged (p2).

  5. added
    pm:blocked
    and removed
    pm:queue
    on Nov 29, 2026
  6. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmQu29PQequUrXXHYMn

    Unblocked 2026-11-30T01:30Z by zone o3-U (area:ux intake of seat repo:objectstack#3): Blocked-by: #38585 is merged (PR #38585, 2026-11-29T14:29:56Z). pm:blocked → pm:queue. Grade unchanged (p2).
    On dispatch, per the park note 7256988984: re-measure on main whether change-owner on a missing record still answers a userMessage without Vary: Accept-Language; if #38585 already covers it, close as completed with the reading.

  7. added
    pm:queue
    and removed
    pm:blocked
    on Nov 30, 2026
  8. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmQu29PQequUrXXHYMn

    Claim: PM loop round 1
    Session: session_01ADHkmQu29PQequUrXXHYMn
    Account: os-steve
    Branch: claude/issue-38567-senderror-vary
    Worktree: objectstack-issue-38567
    Domain: domain:server
    Seat: repo:objectstack#3
    Area: o3-U
    File surface: packages/types/src/response-envelope.ts (sendError / writeErrorEnvelope) and packages/types/src/localized-answer-vary.ts if the root fix lands there; packages/rest/src/change-owner-routes.ts, packages/rest/src/recycle-bin-routes.ts, packages/rest/src/package-routes.ts, packages/rest/src/analytics-routes.ts (only where a door re-sends a userMessage-carrying answer through sendError); at most one new test file named for this card under packages/rest/src/ (and one under packages/types/src/ if the fix is in sendError); root .changeset/38567-*.md. Other sendError doors the dev finds carrying a userMessage are listed in the report; fixing them here needs a claim amendment. Stop on breach and explain in the report.
    Container & model: S, mode:subagent, model: default tier (dispatch-gates --tier: "no path-derived mandate"), effort: medium
    Clause-②: no (a Vary response header on answers that already vary by language; no accept set and no export widens; same declaration as the family's PR #38585)
    Metadata-protocol: none
    Responsibility: objectstack's REST doors (packages/rest) that re-send a classified, localised refusal through sendError (packages/types), which never sets Vary | handleRouteError covers it since #38542, but change-owner hands it a header-less sink (change-owner-routes.ts:176-187) and then calls sendError (:240-251) | every caller of change-owner (single, bulk, cascades) and of the other listed doors in a non-default language behind a shared cache.
    Thread-read: 7266198625
    Premise: holds on origin/main 25ac5df (read-only reading): sendRefusal (change-owner-routes.ts:240-251) ends in sendError(res, nested.status, nested.code, nested.message, nested.extra) with userMessage in extra; sendError (packages/types/src/response-envelope.ts:204-230) sets no header; change-owner-routes.ts does not import the localized-answer-vary.ts helper; no test pins Vary on change-owner. Same shape read in recycle-bin-routes.ts answerThrown (:160-189), package-routes.ts (:248, :311-313) and analytics-routes.ts (:425-436). #38585 does not cover it.
    Pre-claim lane: domain:server (packages/rest, packages/types).
    Pre-claim deps: Blocked-by: #38585 merged (2026-11-29T14:29:56Z); no other blocker named.
    Prior rulings read: check-prior-rulings --card 38567 (thread: 0 rulings in 3 comments; 223 tree hits on title terms, none ruling on Vary for sendError); the family's fixes #38316, #38507, #38542 set the shape (Vary: Accept-Language when the body carries a userMessage).
    Fold-or-serial: no fold; no other open area:ux card shares this mechanism.
    Serial constraints cleared: none — check-handover --inflight is clear over this surface. The dev runs overlap-check.mjs --branch=HEAD before every push.

  9. added
    pm:dispatched
    on Nov 30, 2026
  10. 1 remaining item

  11. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmQu29PQequUrXXHYMn
    os-dev-report

    {
      "issue": 38567,
      "status": "done",
      "branch": "claude/issue-38567-senderror-vary",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/38695",
      "session": "session_01ADHkmQu29PQequUrXXHYMn",
      "premise_still_valid": true,
      "summary": "Premise held on origin/main 25ac5dfa: change-owner's sendRefusal re-sends the classified answer through sendError, which set no header. Root fix in @objectstack/types: writeErrorEnvelope (behind sendError) asks answerVariesByLanguage of the body it writes and appends Vary: [Accept-Language] when it carries a userMessage; EnvelopeResponse gains an optional header() with IHttpResponse.header's shape (capturing sinks without one get no header). This covers every sendError door that re-sends a userMessage: change-owner (single+bulk), recycle-bin answerThrown, package-routes, analytics sendWholeBatchRefusal; external-datasource, meta-qualified-item and both backfill routes pass no userMessage today. No door sets Vary itself before sendError, so no doubled token.",
      "tests": "At ee83cc7ea: @objectstack/types test 43 files / 965 tests passed, typecheck exit 0; @objectstack/rest vitest (change-owner-vary-38567, change-owner-routes, route-error-vary-38542, analytics-fault-user-message) 4 files / 55 passed, lock VERDICT command-exit 0. Ablation (at 8f74705f, same writer line): ablation-replace --delete of the res.header line, types rebuilt, dist preflight --absent ok, both positive cases red ('expected [] to deeply equal [ [ Vary, [ Accept-Language ] ] ]'), both controls green; restore leg rebuilt, preflight marker present in 2 built files, 2/2 + 2/2 green, blob == HEAD.",
      "gates": "Local: dispatch-gates --commands (74 families after the pinned.json ledger joined the diff) run and reconciled with --ran: exit 0, '74 derived famil(ies) accounted for'. Non-zero: node scripts/check-plugin-teardown-shape.mjs --self-test exit 3 (shallow clone cannot reach its pinned fixture commit; still 3 after --deepen=1500) and pnpm check:dual-build-cjs-loads exit 3 ('Run pnpm build first ... nothing was measured'): both NOT MEASURED, left to CI. check:engine-double-contract first red (new double lacked assertEngineUpdateDispatch, then RETAINED ledger) and check:objectql-double-limit first red (find ignored limit): fixed, both exit 0 at ee83cc7ea, with cross-package-test-inputs, test-source-alias, undeclared-dep-imports, nul-bytes, issue-citations re-run exit 0. overlap-check at ee83cc7ea VERDICT clean exit 0. CI check-runs: NOT MEASURED, reason: report delivered at PR open, CI not yet converged.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "2 — fleet-write relay pr_create (POST /repos/objectstack-ai/objectstack/pulls, draft, no labels/assignees); post-stamped issue comment (POST /repos/objectstack-ai/objectstack/issues/38567/comments). git push x3 not counted (not REST).",
      "line_budget": "153 changed lines excluding the changeset (+151/-2 at 4 files before the ledger), plus 5 in scripts/engine-double-contract.pinned.json; budget about 150",
      "files_changed": [
        "packages/types/src/response-envelope.ts",
        "packages/types/src/localized-answer-vary.ts",
        "packages/types/src/send-error-vary-38567.test.ts",
        "packages/rest/src/change-owner-vary-38567.test.ts",
        "scripts/engine-double-contract.pinned.json",
        ".changeset/38567-send-error-vary.md"
      ],
      "deviations": [
        "scripts/engine-double-contract.pinned.json is outside the claim's File surface: check:engine-double-contract requires the new test's pinned double recorded (--write); same ledger the family PR #38585 touched.",
        "The first push (8f74705f) went out before overlap-check ran (run right after: clean); the third push (ee83cc7ea) was chained after an overlap-check that answered cannot-answer exit 3 on a shallow clone; after git fetch --deepen=1500 it answered VERDICT clean exit 0 (shares only pinned.json with #38618 and #38497, both merge cleanly).",
        "No per-door tests for recycle-bin, packages, analytics (line budget); the writer-level pin plus the change-owner route pin cover the one shared line."
      ],
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": []
    }
  12. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmQu29PQequUrXXHYMn

    Claim amendment 1 to 7268633132, recording what draft PR #38695 touches outside the claimed surface, by the dev's report (7269493929).
    File surface adds: scripts/engine-double-contract.pinned.json (5 lines: check:engine-double-contract requires the new route test's pinned engine double to be recorded; the family's PR #38585 touched the same ledger).
    The fix landed at the root (writeErrorEnvelope in packages/types/src/response-envelope.ts), so none of the four packages/rest door files is edited; the doors are covered through sendError.
    Everything else in the claim is unchanged.

  13. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmQu29PQequUrXXHYMn

    Claim amendment 2 to 7268633132 (2026-11-30T06:10Z), after L1-a's first review 7270364941 on PR #38695.
    Clause-②: yes (widening)
    Why: EnvelopeResponse is exported from @objectstack/types' . entry (export * from './response-envelope.js', packages/types/src/index.ts:36) and gains an optional header?() member. Every object that satisfied it still does, so this is a widening of the published face. Metadata-protocol: none and the patch level stand. The owed review is the TIER_DEFAULT record of the declaration, written by this zone.
    Scope adds (inside the claimed surface): a one-line header forward on houseEnvelopeResponse in packages/rest/src/analytics-routes.ts, L1-a's non-blocking item.
    Everything else in the claim and amendment 1 is unchanged.

  14. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmQu29PQequUrXXHYMn
    os-dev-report

    {
      "issue": 38567,
      "status": "done",
      "branch": "claude/issue-38567-senderror-vary",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/38695",
      "session": "session_01ADHkmQu29PQequUrXXHYMn",
      "premise_still_valid": true,
      "summary": "Rework delta on top of ee83cc7e, per L1-a 7270364941. Must-fix 1: the changeset declaration now reads Clause-②: yes (widening). The level stays patch and Metadata-protocol: none. The PR body was not written; the zone patches it. Non-blocking item: houseEnvelopeResponse in analytics-routes.ts gains a header() that forwards to the wire, so a future userMessage refusal written on the batch wrapper keeps its Vary. The changeset sentence about the analytics batch names this.",
      "tests": "At 51af122cc, after rebuilding the rest dependency closure: @objectstack/rest vitest 'analytics' + change-owner-vary-38567 passed 32 files / 487 tests (22 skipped), and @objectstack/rest typecheck passed (lock VERDICT command-exit 0). No new pin for the wrapper forward: today no gate on that wrapper sets a header, and houseEnvelopeResponse is module-private, so a pin would mean exporting it or inventing a gate. Not cheap, so not added. Not ablated, since no test pins it.",
      "gates": "At 51af122cc: overlap-check --branch=HEAD VERDICT clean exit 0 (run after --deepen=1500, before the push). check:route-envelope, check:adr-0087-registration, check-changeset-no-major --base origin/main, check:nul-bytes and check:issue-citations all exit 0. The rest of the derived set was run at ee83cc7e (prior report); the delta touches only analytics-routes.ts and the changeset. CI check-runs at 51af122cc: NOT MEASURED, reason: report delivered at push.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "1 — post-stamped delta report comment (POST /repos/objectstack-ai/objectstack/issues/38567/comments). One git push, not REST.",
      "line_budget": "delta +5/-3 (analytics-routes.ts 3+/1-, changeset 2+/2-)",
      "files_changed": [
        "packages/rest/src/analytics-routes.ts",
        ".changeset/38567-send-error-vary.md"
      ],
      "deviations": [
        "Forwarding every header on the wrapper means a gate that set Vary itself and then wrote a FLAT refusal on the wrapper would be re-sent through sendWholeBatchRefusal's sendError, which appends Vary again: a doubled token. No gate on that wrapper sets a header today, so this cannot happen now; it is noted for the L2."
      ],
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": []
    }
  15. objectstack-fleet commented on Nov 30, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-steve · session_01ADHkmQu29PQequUrXXHYMn
    Queue kick of PR #38695 · zone o3-U · 2026-11-30T07:07Z

    PR #38695 (head 51af122ccf324fabafdf4023e08f66c28290fbf7) was removed from the merge queue with CI_FAILURE. Signature: Test Core (9/12), step Test, first error src/sql-driver-38236-sqlite-bulk-insert-bound.test.ts:83 Test timed out in 5000ms. (driver-sql, a test this PR's change is not on the call path of). Initial judgment: timeout flake; the queue base ran the same file green at 13,104 ms for 13 tests. Re-enqueued once; the full reading is PR comment 7271378775.

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

Metadata

Metadata

Assignees

Labels

area:uxbugdomain:serverpriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions