Skip to content

分源部署(控制台与 API 不同源)时,#37225 改过的 7 处请求仍不带令牌(接 #37225) #37509

Description

@objectstack-fleet

repo:objectstack#5 · os-bill · session_01Utp6Ca6EBDpTBZk8v46Jjv

Filing gate: ② review finding S4 of the seat's L2 on PR #37489 (#37225), record 7187820695; the seat asked the owning zone to card it under #37225. Source: reviewer.
Grading: area:ux · Bug · p2 (triage grades) · reach: a console deployed with the API on another origin (split origin), under a bearer-only session · evidence: L2 record 7187820695; os-dev report 7187574466.

维护者速读

What

Acceptance

  • Under a split-origin config with a bearer-only session, the 7 calls carry the bearer to the configured API origin and never to any other origin; pins for both.

Blocked-by: #37225

Activity

  1. added
    bug
    priority:p2
    pm:blocked
    domain:ui
    on Nov 26, 2026
  2. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in area:ux · domain:ui · Bug · priority:p2 · pm:blocked · size S; rationale: a follow-up of #37225 (same-server reads under a bearer-only session), filed from L2 record 7187820695: the seven calls #37225 fixed still send no token on a split-origin deployment. p2 as filed; blocked by #37225.

  3. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Unlock · #37509 · 2026-11-27T06:29Z: the card's only Blocked-by: line names #37225, which was closed as completed at 2026-11-26T11:21Z. No later block is recorded on this card. pm:blocked → pm:queue; grade, area and size unchanged. Re-read the premise at claim, because the blocker's landing may have changed the surface this card names.

  4. added
    pm:queue
    and removed
    pm:blocked
    on Nov 27, 2026
  5. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU
    2026-11-28T13:42Z · Maintainer ruling (Tesla, tapped on the seat decision card cmsg_01AXsQkLFKRdQCqQ3RTr6Jao5tXcN5dZGHAU8We7jFKKG1): 「只信任已配置的接口服务地址」.

    • Route A: in a split-origin deployment the host request channel sends the platform token to the configured API server origin only, the same origin the other platform requests already use. A separately configured AI address is not trusted by this card; that waits until someone asks for it.
    • Shape: exact origin equality (scheme, host and port) against the build-time configured server URL; no new configuration key.
    • Options declined: also trusting the AI address; a new trusted-origin list setting; docs-only.
    • Analysis behind the card: seat file, Fable read at origin/main 333e6f3.
    • The card stays p2 in the queue for dispatch.
  6. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

    Claim: PM loop round 1
    Session: session_01L9qibyUSf2nKJWW6qBemSU
    Thread session: session_01L9qibx7DSQZnugnuX8CpCM
    Account: os-tesla
    Branch: claude/project-thread-ciejge
    Worktree: objectstack-issue-37509
    Domain: ui
    Area: o3-ux (area:ux p2, the zone thread)
    Seat: repo:objectstack#3
    Seat rulings on the pre-claim report (main 600197a):

    • Premise holds: the host request channel (ConsoleShell.tsx ~280, the 7 calls of Plugin packages' same-server reads stay cookie-only and break under a bearer-only session: the #37080 family outside app-shell and the console (16 files), plus two app-shell reads the #37185 ratchet does not see #37225) and three other app-shell builders (useConsoleActionRuntime.tsx ~452, ContextSelectors.tsx ~217, personalViews.ts ~403) send the token to the page's own origin only, so a split-origin deployment sends none.
    • Route: the maintainer ruling 7240131451 (route A). createAuthenticatedFetch gains one optional trusted origin. A cross-origin URL gets the headers only when its parsed origin equals that origin exactly (scheme, host and port); a URL that does not parse is untrusted.
    • The trusted origin is derived once from the build-time VITE_SERVER_URL, only when it is an absolute http(s) URL. The separately configured AI base is not read for this; a separate AI host stays as today.
    • All four builders pass it: the configured server is this platform in every one of them, the same reason the ruling gives. Each builder keeps its same-origin behaviour otherwise.
      File surface:
    • ui/packages/auth/src/createAuthenticatedFetch.ts, its test, ui/packages/auth/README.md (option row).
    • One new app-shell module for the configured origin, and the four builders above.
    • rendererFetch.bearerSession-37225.test.tsx (split-origin rows); useConsoleActionRuntime.sameOriginOnly-5702.test.tsx and sameServerFetch.bearer.ratchet.test.ts if they read the builder spelling.
    • .changeset/*.md: @object-ui/auth minor (new option), @object-ui/app-shell patch.
      Stop on breach and explain in the report.
      Container & model: S, mode:subagent, model: opus (default tier — dispatch-gates.mjs --tier at 600197a6: "no path-derived mandate"), effort: high, reason: exact origin comparison on a request boundary
      Writes: the PR only through the relay pr_create; comments, labels and bodies only through the relay write tools; report both numbers.
      Clause-②: no
      Metadata-protocol: none
      Skills-docs: none (no authorable metadata changes)
      Review owed: L1-a; the landing tier per check-governed-merges.mjs at landing.
      Responsibility: a split-origin deployment (console and API server on different origins) keeps the signed-in session on the 7 requests of Plugin packages' same-server reads stay cookie-only and break under a bearer-only session: the #37080 family outside app-shell and the console (16 files), plus two app-shell reads the #37185 ratchet does not see #37225 and the other three builders, and sends nothing extra to any other origin.
      Premise: holds, read on origin/main 600197a
      Serial constraints cleared: open PR #38304 touches useConsoleActionRuntime.tsx far from ~452; overlap-check before the first push
      Readings owed in the report: the split-origin pins (configured origin carries the token; another domain, same host on another port or scheme, a host with the server host as prefix or suffix, and the separate AI origin carry none), the createAuthenticatedFetch unit rows with one ablation each, the derived gates.
  7. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 28, 2026
  8. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibx7DSQZnugnuX8CpCM
    os-dev-report

    {
     "issue": 37509,
     "status": "done",
     "branch": "claude/project-thread-ciejge",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/38360",
     "head": "14868cfd21ba50bc5bd61fc5728761fdabadc908",
     "session": "session_01L9qibx7DSQZnugnuX8CpCM",
     "premise_still_valid": true,
     "summary": "createAuthenticatedFetch (@object-ui/auth) gains one optional trustedOrigin read with sameOriginOnly: a cross-origin http(s) URL gets Authorization, X-Tenant-ID and Accept-Language only when new URL(url, location.href).origin equals it exactly; any other origin, a non-http(s) URL and an unparsable URL still go to the bare fetch, and behaviour without the option is unchanged. A new app-shell module console/configuredServerOrigin.ts derives CONFIGURED_SERVER_ORIGIN once at module load from the build-time import.meta.env.VITE_SERVER_URL, only for an absolute http(s) URL (VITE_AI_BASE_URL is never read), and the four sameOriginOnly builders (ConsoleShell, useConsoleActionRuntime, ContextSelectors, personalViews) pass it. Premise held on 600197a6. Deviation from the claim: the changeset grades @object-ui/auth patch, not minor, because check-changeset-no-major refuses any minor beside Metadata-protocol: none (CI Check Changeset success on the patch grading). origin/main was merged at e27f21b4c after the first CI run was red on the split-origin rows' exact request sequence (main added a row read before the in-chat approval); the rows now assert origin and bearer per request plus each required request.",
     "tests": "Final head 14868cfd2: pnpm --dir ui exec vitest run (createAuthenticatedFetch.test.tsx, rendererFetch.bearerSession-37225.test.tsx, useConsoleActionRuntime.sameOriginOnly-5702.test.tsx, sameServerFetch.bearer.ratchet.test.ts, plugin-chatbot useHitlInChat.test.tsx) under os-verify-lock: VERDICT command-exit 0, Test Files 5 passed (5), Tests 71 passed (71); the two target files: 54 tests. Package runs on 0225a3ab2: @object-ui/auth build exit 0, type-check exit 0, test Test Files 51 passed (51) Tests 555 passed (555); @object-ui/app-shell type-check exit 0 (re-run exit 0 on 14868cfd2), test Test Files 2443 passed | 1 skipped (2444) Tests 23942 passed | 9 skipped (23951). Unit rows: exact trusted origin (string, URL, Request), page origin, and none to another domain, :8443, http:, prefix host api.example.com.evil.test, suffix host evilapi.example.com, subdomain, userinfo URL, blob URL, unparsable URL, non-exact trustedOrigin spelling, 401 from trusted origin reaches session-ended, CONTROL without trustedOrigin. Split-origin pins: VITE_SERVER_URL stubbed and configuredServerOrigin reloaded; share dialog list/revoke/create + agents, models, pending list/approve, in-chat row read and approve all carry the bearer to https://api.example.com and go nowhere else; another domain, :8443, http:, prefix and suffix hosts carry none; separate VITE_AI_BASE_URL origin carries none while the server keeps it; CONTROL empty/relative/unparsable/ftp VITE_SERVER_URL trusts nothing. Builder pin: every sameOriginOnly createAuthenticatedFetch in app-shell carries trustedOrigin: CONFIGURED_SERVER_ORIGIN. Ablations (scripts/ablation-replace.mjs, every leg 'ok mutation landed' then 'ok restored: blob == HEAD and git diff HEAD is empty', no dist involved since vitest aliases @object-ui/auth to src): A1 no trust 5 red; A2 startsWith on origin 4 red (port, prefix); A3 hostname-only 5 red (port, scheme); A4 hostname endsWith 8 red (suffix, subdomain, port, scheme); A5 raw-url startsWith 7 red (prefix, port, userinfo, unparsable); A6 parse failure trusted 1 red; A7 no protocol check 1 red (blob); A8 module no protocol check 1 red (ftp CONTROL); A9 ContextSelectors drops trustedOrigin 2 red (builder pin); A10 trust any origin 15 red; A11 absent option trusts 7 red. A1-A5, A8, A10, A11 re-run on 14868cfd2 with identical counts. First A5 attempt refused by the tool (replacement contained the anchor) and did not run; re-spelled and run.",
     "gates": "Local: dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 38 commands at 14868cfd2 (same 38 as at 0225a3ab2); all 38 run, each exit 0 captured before any pipe; --ran: 'Run reconciliation — 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN.' 'a DERIVED zero'. ui check:new-line-citations: 0 new citations exit 0. overlap-check before each push: VERDICT clean exit 0 (first push: #38304 merges cleanly). CI check-runs on 14868cfd2, all completed, no failure: Lint & Repo Gates success, TypeScript Type Check success, Test Core success, Build Core skipped, Governed Surface Queue Guard success, Lint UI success, Type Check UI success, Test UI success (shards 1-9/16 success), Build & E2E UI success, Live E2E UI success, Dogfood Regression Gate success, Check Changeset success, Check PR Size success, PR-body guards success, Lint · PM dispatch-gates success, Type Check · workspace/source/consumer/debt success. Earlier head 0225a3ab2: Test UI (5/16) failure (split-origin exact-sequence rows vs main's new in-chat row read), fixed in e004a0484 and 14868cfd2.",
     "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
     "mcp_calls": "0",
     "api_writes": "3 — relay pr_create (POST pulls + issue assignees leg, PR #38360), relay issue_patch on #38360 (PR body, trailer-signed), post-stamped comment on #37509 (this os-dev-report); git push x4 not counted",
     "open_questions": [],
     "security_findings": "none",
     "out_of_scope_findings": [
      "carrier: none · noted, not filed — in vitest, vi.stubEnv reaches import.meta.env.X but not the (import.meta as any).env spelling used by resolveApiBase/aiApiBase, so env-driven pins of those resolvers cannot stub them; a test-harness property, not a product defect (recorded in the PR acceptance notes)"
     ]
    }
  9. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibx7DSQZnugnuX8CpCM
    os-dev-report

    {
     "issue": 37509,
     "status": "done",
     "addendum_to": "comment 7242296224",
     "round": "rename (seat ruling 16:32Z)",
     "branch": "claude/project-thread-ciejge",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/38360",
     "head": "61127ae1c780cd968ec4656da3b9f6c538373561",
     "session": "session_01L9qibx7DSQZnugnuX8CpCM",
     "summary": "Only the two test files changed. Near-miss hosts renamed: another domain -> other.test, prefix host -> api.example.com.other.test (the server host is still a prefix), suffix host -> otherapi.example.com (the server host is still a suffix), userinfo URL -> api.example.com@other.test, the 401 row's second URL -> other.test. 8 lines changed (auth test 5, split-origin test 3). git diff origin/main...HEAD has 0 case-insensitive matches for the old word. The changeset, the source, the README and the row titles are unchanged.",
     "tests": "On 61127ae1c, under os-verify-lock, VERDICT command-exit 0: pnpm --dir ui exec vitest run packages/auth/ plus rendererFetch.bearerSession-37225.test.tsx, useConsoleActionRuntime.sameOriginOnly-5702.test.tsx and sameServerFetch.bearer.ratchet.test.ts gave Test Files 54 passed (54) and Tests 582 passed (582). Ablations re-run on the renamed rows, each leg mutated on disk and then restored to blob == HEAD: A2 startsWith 4 red (prefix and port rows, unit and split), A4 hostname endsWith 8 red (suffix row included), A5 raw-URL startsWith 7 red (prefix and userinfo rows included), A10 trust any origin 15 red. These counts match the earlier heads.",
     "gates": "dispatch-gates.mjs --commands --repo objectstack-ai/objectstack at 61127ae1c: 38 commands, all exit 0; --ran: 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN (a DERIVED zero). overlap-check: VERDICT clean exit 0 (origin/main bc31d453e merges cleanly, 0 PR heads). CI on 61127ae1c: every check-run completed with no failure. Required: Lint & Repo Gates, TypeScript Type Check, Test Core, Governed Surface Queue Guard, Lint UI, Type Check UI, Test UI, Build & E2E UI, Live E2E UI and Dogfood Regression Gate all success, Build Core skipped. Check Changeset success.",
     "api_writes": "2 this round — relay issue_patch on #38360 (PR body: renamed hosts plus the new head readings, trailer-signed, read-back identical, 14014 bytes); this post-stamped addendum on #37509. git push x1 (no force) is not counted.",
     "mcp_calls": "0",
     "security_findings": "none",
     "open_questions": []
    }
  10. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU
    2026-11-28T17:21Z · Claim amendment 1 to 7240196840: Clause-②: yes (widening), not no. @object-ui/auth publishes a new optional trustedOrigin option. Review owed becomes L1-a plus a TIER_DEFAULT record at the reviewed head. The changeset level stays patch (Metadata-protocol none), as the dev report explains.

  11. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibx7DSQZnugnuX8CpCM
    os-dev-report

    {
     "issue": 37509,
     "status": "done",
     "addendum_to": "comments 7242296224, 7242941474",
     "round": "declaration (seat 17:21Z)",
     "branch": "claude/project-thread-ciejge",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/38360",
     "head": "1e97c051480543c27ccbb249bca42146fd2f50d8",
     "session": "session_01L9qibx7DSQZnugnuX8CpCM",
     "summary": "Only the declaration changed, from 'Clause-②: no' to 'Clause-②: yes (widening)', in .changeset/37509-trusted-server-origin.md (1 line, commit 1e97c0514) and in the PR body's declaration line. Both packages stay patch and Metadata-protocol: none stays.",
     "tests": "No source or test file changed. The changeset gate was driven offline with a pull_request event carrying the new body: node scripts/check-changeset-no-major.mjs --base origin/main --event event.json exit 0, 'LEVEL AXIS: this PR declares clause-② yes (widening) and metadata-protocol none, and it introduces no changeset entry graded minor or above ... a non-protocol change at patch'. check-adr-0087-registration exit 0 (no declared-breaking changeset). check-empty-changeset exit 0.",
     "gates": "dispatch-gates.mjs --commands at 1e97c0514 derived the same 38 commands. 37 exited 0 on the first pass. 'pnpm --dir ui exec vitest run scripts/' exited 1 on the first pass: the recreated worktree had no @objectstack/spec dist ('Cannot find package @objectstack/spec/ui'). After the closure build (72 of 72 turbo tasks cached) it was rerun under os-verify-lock: exit 0, Test Files 172 passed and 2 skipped (174). The --ran record keeps both lines; the tool reads that family as 1 (two codes recorded) and otherwise reports 38 run, 0 NOT-MEASURED. overlap-check: VERDICT clean exit 0. CI on 1e97c0514: all 55 check-runs completed with no failure. Required checks success (Build Core skipped). Check Changeset ran twice, both success; the 17:28Z run came after the 17:24Z body edit, so it read 'yes (widening)'.",
     "api_writes": "2 this round — relay issue_patch on #38360 (declaration line plus a head note, trailer-signed, read-back identical, 14218 bytes); this addendum comment. git push x1 (no force) is not counted.",
     "mcp_calls": "0",
     "security_findings": "none",
     "open_questions": []
    }
  12. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1
    2026-11-28T17:55Z

    Contract review

    Served-tier: TIER_DEFAULT
    Head-sha: 1e97c051480543c27ccbb249bca42146fd2f50d8
    Local-runs: none

    PR #38360, card #37509. The maintainer's ruling (route A) is 7240131451. The claim is 7240196840 and amendment 1 is 7242965773. The dev reports are 7242296224 and 7243367615.

    Why TIER_DEFAULT. The review is owed by the Clause-②: yes (widening) declaration alone. The 10 committed files touch no packages/spec/src/**, no governed path and no narrowing, and Metadata-protocol: none creates no face. It is run in the seat's L1 thread, with no second agent.

    ① Derived judgments

    • D1 @object-ui/auth: CreateAuthenticatedFetchOptions gains an optional trustedOrigin?: string. This is additive. Without it, and without sameOriginOnly, the wrapper behaves byte-for-byte as before.
    • D2 The rule. Under sameOriginOnly, a URL goes to the bare global fetch when isCrossOrigin(url) && !isTrustedOrigin(url, trustedOrigin). Read strictly:
      • isTrustedOrigin parses the URL against the page and requires http: or https:. It answers true only on target.origin === trustedOrigin, a whole-string equality of the parsed origin.
      • No prefix, suffix, substring or hostname-only comparison appears anywhere in the diff.
      • A URL that does not parse, no page, or no trustedOrigin answers false. The pre-existing isCrossOrigin answers true on a parse failure, so such a URL still goes out bare.
      • The sameOriginOnly short-circuit is never dropped. It is narrowed by exactly one exact origin, and only when one is configured.
    • D3 The trusted value. CONFIGURED_SERVER_ORIGIN is a module-level constant computed once from the build-time import.meta.env.VITE_SERVER_URL.
      • serverOriginOf returns URL.origin, the normalised spelling that D2 compares against, only for an absolute http: or https: URL. Empty, relative and unparsable values give undefined.
      • Nothing at runtime writes it: no runtime config, no storage, no query parameter.
      • VITE_AI_BASE_URL is not read.
    • D4 Consumers. All four app-shell sameOriginOnly: true builders pass trustedOrigin: CONFIGURED_SERVER_ORIGIN: ConsoleShell (apiProviderFetch), useConsoleActionRuntime, ContextSelectors and personalViews. No other site sets the option. With no configured cross-origin server, each one behaves as before.

    ② Semver level

    Right. Metadata-protocol: none is true: nothing an author writes moves. Under AGENTS.md Post-Task 3, a none kind takes patch, and a non-protocol widening ships patch. @object-ui/auth is patch. @object-ui/app-shell is private, so its entry is harmless. Both declaration lines start a line in the changeset and the PR body. The amendment records the declaration.

    ③ Boundary flags

    • Evidence:
      • 11 ablation sets each turned the pins red. They cover a prefix compare, a hostname-only compare, a suffix compare and trust on a parse failure.
      • auth 555 of 555 (582 with the related files), and app-shell green.
      • 38 of 38 derived gates exit 0. A first ui/scripts run failed only on a missing spec build in a fresh worktree and passed after the build; both runs are kept.
    • CI at this head: 40 success, 15 expected skips, 0 failed, 0 pending. Mergeable is clean, and l1-face is clean.
    • Public text (the changeset, the README rows and example, the docblocks and the test names) describes behaviour only.
    • open_questions: none. security_findings: none from this read.
    • SQL push-down: not applicable.

    No must-fix, no should-fix.

    Implemented-by: claude/project-thread-ciejge
    Reviewed-by: session_01L9qibwSEecrzDjKjbk24r1

    VERDICT: PASS

  13. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1
    2026-11-28T17:56Z

    L1-a: ACCEPT, PR #38360 (#37509) at 1e97c051480543c27ccbb249bca42146fd2f50d8.

    • Scope: 10 files, all inside the claim and amendment 1. The PR follows route A as ruled in 7240131451.
    • Behaviour: under sameOriginOnly, a cross-origin http(s) URL gets the auth headers only when its parsed origin equals trustedOrigin exactly. Every other origin, and a URL that does not parse, still goes out bare.
    • Where the trusted origin comes from: the console reads it once from the build-time VITE_SERVER_URL, and only when that value is an absolute http(s) URL. All four sameOriginOnly builders pass it. Nothing else changes.
    • Contract review: owed by Clause-②: yes (widening) alone. It is the TIER_DEFAULT record 7243401930, PASS. No isolated L2 is owed, because the PR touches no spec, governed or narrowing path.
    • Evidence: 11 ablation sets go red. auth passes 555/555 and app-shell is green. 38/38 gates pass.
    • CI at this head: 40 success, 0 failed. Mergeable is clean.
  14. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU
    2026-11-28T18:25Z · 收口:PR #38360 经合并队列合入(eef1cbfe),本卡随 Fixes 关闭;去掉 pm:dispatched。按维护者裁决,分源部署下只把登录令牌发给构建时配置的接口服务地址。

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:uxbugdomain:uipriority:p2

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions