Skip to content

fix(ui): plugin same-server reads and me/localization carry the stored bearer - #37489

Merged
objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/issue-37225-plugin-bearer-fetch
Nov 26, 2026
Merged

objectstack-fleet[bot] merged 8 commits into
mainfrom
claude/issue-37225-plugin-bearer-fetch

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #37225
Clause-②: no
Metadata-protocol: none

维护者速读

  • 只用登录令牌、没有会话 Cookie 的用户(例如嵌入在别的网站里、浏览器拦了第三方 Cookie):分享链接、AI 助手列表、模型列表、待审批操作、对话内审批、字段选择器和界面语言,以前都被当成未登录,现在能正常加载。
  • 属于“会话凭证统一携带”这条线:插件和控制台的早期请求之前漏带了令牌,这次补齐,并让守卫覆盖全部前端包。
  • 若出错,影响的是上述几个面板仍显示为空或未登录;改动只在前端请求里多带一个请求头,可直接撤回。控制台与接口不同源的部署这次还没覆盖,已另立跟进卡。
  • 无

What changes

The renderer packages' same-server reads sent the bare global fetch with the cookie only, so a session held by its bearer token alone was answered as anonymous. Every site the card lists is now converted or recorded with its reason:

  • components / ShareDialog (3 calls: list, create, revoke) and plugin-chatbot (useAgents, useAiModels, usePendingActions, useHitlInChat) send through the host's SchemaRendererContext.apiFetch (the console builds it as createAuthenticatedFetch({ sameOriginOnly: true })), falling back to the global fetch with no host. credentials: 'include' stays, so cookie sessions are unchanged. No renderer package gains a dependency on @object-ui/auth (layering per ui/AGENTS.md; no cycle introduced).
  • app-shell / field selector widget (fetchFieldSelectorOptions) goes through createAuthenticatedFetch(); app-shell already depends on auth.
  • console / me-localization: the stored bearer rides all three legs, the early index.html seed request, languageSeed.fetchAndCacheSeed, and LocalizationFetchProvider. Both TS legs build the init through one helper, meLocalizationInit(preferred), so the in-flight share key (inflightGetKey) still matches between the seed and the provider. The helper reads the token through TokenStorage.get(), so a storage-blocked embed still sends the token sign-in kept in memory; index.html runs before the bundle and stays on localStorage (rework round 1, S5).
  • field selector path: the object name is now encodeURIComponent-encoded into /api/v1/objects/NAME/fields (rework round 1, N3; not separately pinned, since the helper is module-private).
  • Ratchet widened (sameServerFetch.bearer.ratchet.test.ts): it now scans every ui/packages/*/src plus the console, and names the nine renderer packages explicitly so a dropped root fails loudly. A new arm counts a global fetch on a written /api/ literal with no init, or with an inline init without credentials, as bare. The allow list stays shrink-only: the LocalizationFetchProvider row is removed (now 0 found), and two rows are added for sites read and recorded: auth/LoginForm.tsx (SSO sign-in, before any session exists) and permissions/MePermissionsProvider.tsx (the fetcher ?? fetch fallback; the console passes the authenticated fetch).

Sites recorded but not converted, because they already ride the host's authenticated fetch (apiFetch ?? fetch, with the reason in their header docs): useRecordCrudVerdicts, useRowApprovalLocks, useRecordEditable, stageChangeStarts, queueClaim, ObjectChart, DatasetWidget, ReportDateRange. Injection only, with no bare fallback: preferenceOptions, ShareableObjectRefField.

Tests

New pins (bearer-only server double, each with a cookie-only control)
  • app-shell/src/console/rendererFetch.bearerSession-37225.test.tsx: ShareDialog list, useAgents, useAiModels, usePendingActions (list + approve) and useHitlInChat (decide), each mounted in a SchemaRendererProvider that carries the console's composition. With a stored token, the request carries Authorization: Bearer TOKEN beside credentials: 'include'. CONTROL, with no token: cookie-only, the 401 is refused, and it reaches the session-ended event.
  • FieldSelectorWidget.loadFailure.test.tsx: a new describe for the bearer-only session, plus a cookie-only control.
  • console/src/__tests__/sessionCheckBootDedup.test.tsx: a cold load sends one me/localization request carrying the bearer; the share key of the slot equals meLocalizationInit('zh-CN') and contains the authorization header; on a later boot with a cached seed, the provider alone sends the bearer. CONTROL, no token: two requests, neither carrying Authorization. CONTROL, a token stored after parse: the second request carries it.
  • Doubles in three neighbouring field-selector suites gained headers (the authenticated fetch reads set-auth-token off every response), and two gained the module-top collection imports check:test-source-alias asks for.
Readings (head f66978d)
  • Ratchet: 4/4 passed.
  • Pins at the merged head: 5 files / 82 tests passed.
  • Rework round 1 (head b0a4db6): the localization and field-selector pins plus the boot-dedup and App boot suites: 11 files / 139 tests passed.
  • Narrowed affected suites (app-shell metadata-admin, components share, plugin-chatbot, console subset): 168 files / 1722 tests passed; console subset 26 files / 371 tests passed.
  • Type-check (turbo, the 4 touched packages and their deps): 83/83 tasks successful.
  • pnpm --dir ui exec vitest run scripts/: 172 passed, 2 skipped.
Ablations (restored through ablation-replace; blob equals HEAD; git diff HEAD empty)
  • ShareDialog list read reverted to the bare fetch: the ratchet goes red (unlisted site), and both ShareDialog pins go red, including the control's session-end half. 3 failed / 8 passed.
  • The Authorization line deleted from meLocalizationInit: the 4 bearer cases go red and the cookie control stays green. 4 failed / 49 passed.
  • Rework round 1: storedToken() reverted from TokenStorage.get() to the direct localStorage read: only the new memory-fallback pin goes red. 1 failed / 53 passed.

Acceptance notes

  • Deviation from the card's Expected, ruled A by the seat. The card's Expected names a per-call createAuthenticatedFetch. The renderer packages instead send through the host's apiFetch. In the console that host fetch is createAuthenticatedFetch({ sameOriginOnly: true }), so sameOriginOnly and the settle signal are applied once, at the host, and the renderer packages stay free of an auth dependency. The cost: a host that mounts no provider stays cookie-only.
  • Changesets name the scope this PR covers: same-origin requests. Split-origin layouts still go out without the token (see 分源部署(控制台与 API 不同源)时,#37225 改过的 7 处请求仍不带令牌(接 #37225) #37509). They also note that a stored token now takes precedence over an Authorization a caller passes, and that the host's tenant and language headers ride these calls (N1).
  • The field selector reads /api/v1/objects/NAME/fields. No server route registers that path, and no form in either tree declares the widget, so it is dormant. Read only, not filed.
  • A cross-origin VITE_AI_BASE_URL / server URL goes bare through the sameOriginOnly host fetch, as the card allows.
  • Out-of-card bare sites, read and not converted: auth/LoginForm (1), auth/createAuthClient (3, fenced to the auth lane), data-objectstack/index (2, via an injected fetchImpl), data-objectstack/metadata-client (1), react/useElementApiDataSource (1, host fallback), react/useDatasetDimensionLabels (1, host fallback).

Follow-up cards (rework round 1)

Verification

Two minutes: pnpm --dir ui exec vitest run --maxWorkers=2 packages/app-shell/src/console/rendererFetch.bearerSession-37225.test.tsx. Expect 7 passed: each bearer case carries Bearer stored-session-token, and each control goes out cookie-only.

Read first, by risk:

  1. ui/apps/console/src/languageSeed.ts: meLocalizationInit. The share key between the seed and the provider depends on both legs building the same headers.
  2. ui/packages/app-shell/src/sameServerFetch.bearer.ratchet.test.ts: the widened roots and the new bare-literal arm.
  3. ui/apps/console/index.html: the early seed script reads the token in a try block.

Generated by Claude Code

…; me/localization carries the stored bearer

The share dialog and the chatbot hooks (agents, models, pending actions,
in-chat approvals) send through SchemaRendererProvider's apiFetch, the
field selector read goes through createAuthenticatedFetch, and the
me/localization boot read states the stored bearer in its init on all
three legs (index.html, the seed, the provider).

Claude-Session: https://claude.ai/code/session_01Utp6Ca6EBDpTBZk8v46Jjv
Co-authored-by: Claude <noreply@anthropic.com>
…rer reads under a bearer-only session

Claude-Session: https://claude.ai/code/session_01Utp6Ca6EBDpTBZk8v46Jjv
Co-authored-by: Claude <noreply@anthropic.com>
… bearer-only session; changesets

Claude-Session: https://claude.ai/code/session_01Utp6Ca6EBDpTBZk8v46Jjv
Co-authored-by: Claude <noreply@anthropic.com>
… signed-out answer

Claude-Session: https://claude.ai/code/session_01Utp6Ca6EBDpTBZk8v46Jjv
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l 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 Nov 26, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head f66978d · 2026-11-26T09:13Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract review

Served-tier: TIER_DEFAULT
Head-sha: f66978d970d56aac0c914a018499dfecaca7a21b
Local-runs: none
Security-touching: yes

PR #37489 · card #37225 · declaration face (Clause-②: no). Read: the card body and its 5 comments, the PR body, report 7187574466, the diff against origin/main (20 files, +713/−72), the cited code at the head, and the head's 58 check-runs (45 success, 13 skipped, 0 failed). Nothing was built or run.

① Derived judgments

Security (auth plumbing).

  • Bearer to a foreign origin: no. createAuthenticatedFetch (ui/packages/auth/src/createAuthenticatedFetch.ts) returns the bare fetch(input, init) before any header work when sameOriginOnly is set and the URL resolves off-origin (an unparseable URL counts as off-origin). The seven renderer calls (ShareDialog list/create/revoke, useAgents, useAiModels, usePendingActions, useHitlInChat) take whatever the host hands as apiFetch; the console's only provider with one is ConsoleShell.tsx:281/340, withSettleSignal(createAuthenticatedFetch({ sameOriginOnly: true })), and nested providers inherit it (SchemaRendererContext.tsx). Their URLs are built from the apiBase prop, so an off-origin apiBase goes out bare. The field selector calls createAuthenticatedFetch() without the option, on a relative literal /api/v1/objects/NAME/fields, which cannot leave the origin. The three me/localization legs set the header by hand on SERVER_BASE/api/v1/auth/me/localization: no origin check, but the base is deployment config, not author-written, and early-discovery.ts:110 already does the same.
  • Token logged or in a URL: no. It travels only as the Authorization header. It does become part of the in-flight key (inflightGetKey concatenates the headers) and of slot.init on the Symbol.for('objectui.earlyLanguageSeed') global. Both are page memory with the same reach as the localStorage entry they are read from; neither file logs the key or the init.
  • Silent cookie fallback. In the console the fallback arm (apiFetch ?? fetch) is not reached: the routes mount under ConsoleShell / ProtectedRoute, both through ConnectedShell (read at the mount points, not traced per consumer). A host that mounts no provider stays cookie-only by design, stated in each doc comment and changeset. Two places where a bearer-only session still reads as anonymous are S4 and S5.
  • The two new ratchet rows hide no gap. auth/LoginForm.tsx:584 is the SSO sign-in, sent before a session exists; routing it through the authenticated fetch would also fire the session-ended event on a refused sign-in. permissions/MePermissionsProvider.tsx falls back only when no fetcher is injected, and the console injects createAuthenticatedFetch() (AppContent.tsx:480-484). The row's count understates the file, see S1.

Card acceptance. Each listed site is converted or recorded (6 converted plus localization; the 8 "already on host apiFetch" and 2 injection-only readings hold at the head). The localization share key is pinned against the real index.html script (inflightGetKey(slot.url, slot.init) equals the key of meLocalizationInit('zh-CN')). One patch changeset per moved package. The measured cases each have a cookie-only control; the two reported ablations go red on the right cases.

Findings.

  • S1 (should-fix) — The ratchet cannot see the fallback spelling this PR standardises. Its header says the global fetch "as the fallback of ?? / ||" counts as bare, and its own case (apiFetch ?? fetch)(…, { credentials: 'include' }) expects 1. The seven converted calls and the ten pre-existing sites write the same thing through a const (const doFetch = apiFetch ?? fetch) and count 0; const f = fetch; f(…) would count 0 too. MePermissionsProvider.tsx has two fallback sites (line 153 inline, line 296 aliased) and its row says 1. So the ratchet pins "the global fetch is not written at the callee", not "the call rides the host fetch". Either say in the header that the aliased host fallback is the sanctioned renderer spelling and is not counted, or resolve a same-file const whose initialiser is the global fetch.
  • S2 (should-fix) — The bare /api/ arm is correct on template literals (head and every span are read; a no-substitution template is covered by isStringLiteralLike) and false-negative elsewhere: a URL held in a variable, which is the dominant spelling (data-objectstack/src/index.ts:8243 and :8305, fetch(url, { headers }) on BASE/api/data/…/upload); + concatenation ('/api/v1/x/' + id is a binary expression); an explicit credentials: 'same-origin', which the case table pins at 0 although it is the same cookie-only request; an init passed by name or by spread; and a template with no written /api/ (ShareDialog's own APIBASE/v1/share-links). The card's wording ("a call with no init on a /api/ path") is met for the written literal only. Resolve a same-file const URL the way includeConsts resolves an init, read +, and count 'same-origin' as bare.
  • S3 (should-fix) — The out-of-card sites are reported as "carrier: none · noted, not filed" and need a card each before ACCEPT: (a) data-objectstack — uploadFile / uploadFiles send the global fetch with the adapter's config token only and no credentials, bypassing the injected config.fetch, so under the console an upload likely carries neither the stored bearer nor a session-ended signal (read, not measured), plus metadata-client.ts 1; (b) react — useElementApiDataSource.ts:391 and useDatasetDimensionLabels.ts:147, the same host fallback, to be recorded with S1; (c) auth/createAuthClient.ts 3 — fenced, so a card in the auth lane (the get-session retry at line 890 is bearer-less on purpose); (d) the field selector's route /api/v1/objects/NAME/fields has no server registrar and no form declares the widget (confirmed by grep at the head): the PR converts and pins a read nothing serves, so a card should either register the route or retire the widget.
  • S4 (should-fix) — Under a split-origin deployment (VITE_SERVER_URL / VITE_AI_BASE_URL naming another origin, the layout where the cookie is most likely withheld) the sameOriginOnly host fetch sends all seven converted calls bare, so they stay anonymous, while me/localization (header set by hand) does carry the bearer to that same server. The card allows it and the report notes it, but with no carrier, and the changesets' "a cross-site embed" reads wider than what is fixed. File it: letting the host fetch trust the configured server origin would close it for these seven and the eight recorded sites in one place.
  • S5 (should-fix) — languageSeed.ts storedToken() reads localStorage directly, while TokenStorage.get() falls back to memory when storage is unavailable. In a storage-blocked embed, itself a bearer-only case, the provider's read after sign-in sends no bearer although every createAuthenticatedFetch call does. The stated reason (suites mock @object-ui/auth) is thin: both languageSeed.ts and LocalizationFetchProvider.tsx already import from it. Use TokenStorage.get() in meLocalizationInit; index.html keeps localStorage, and the keys then differ exactly as in the pinned "token stored after parse" control.
  • N1 (nit) — createAuthenticatedFetch does headers.set('Authorization', …), so when a token is stored it now overrides an Authorization a caller passed through the hooks' headers or ShareDialog's fetchHeaders; X-Tenant-ID and Accept-Language (the document language) newly ride these calls too. The changesets' "options unchanged" is true of the signature, not of precedence. The agents catalog cache is keyed by apiBase alone while its request now varies by language and tenant (read only).
  • N2 (nit) — The new pin builds its own createAuthenticatedFetch({ sameOriginOnly: true }) rather than mounting ConsoleShell's apiProviderFetch, so it does not pin the console's wiring. ShareDialog create and revoke are not measured (the ratchet covers their bare spelling). The token key auth-session-token is now written in four places (createAuthClient.ts, early-discovery.ts, languageSeed.ts, index.html) and no test ties them.
  • N3 (nit) — fetchFieldSelectorOptions interpolates objectName into the path unencoded. Pre-existing, and the request cannot leave the origin, but it now carries the bearer; encodeURIComponent costs nothing.

No must-fix.

② Semver level

Clause-②: no holds. No exported signature changes: ShareDialog's props and the four hooks' options and return types are as on main; fetchAgentsCached and call are module-private; ApiFetch and SchemaRendererContext are existing exports of @object-ui/react, already a dependency of components and plugin-chatbot, so no package.json moves. meLocalizationInit is a new export of an app module (@object-ui/console), not a published package surface. No spec, schema or governed path is in the diff.

Four changesets, all patch, one per moved package (@object-ui/components, @object-ui/plugin-chatbot, @object-ui/app-shell, @object-ui/console), each with Clause-②: no and Metadata-protocol: none. patch is right: a fix with no API change. Check Changeset is green on the head.

③ Boundary flags

  • Open question — A (host apiFetch) or B (per-call createAuthenticatedFetch): keep A. (1) Layering: components depends on core / react / types and is "Pure UI" in ui/AGENTS.md; plugin-chatbot, fields, plugin-grid and permissions carry no auth dependency either. B would not create a cycle (auth depends on types alone) but would bind every renderer package to the console's localStorage token store and break any host with its own auth. (2) Precedent: the eight recorded sites, the two injection-only ones and @object-ui/react's own two hooks already ride the host fetch; B would leave two channels. (3) Security: A gets sameOriginOnly and the settle signal once, at the host; under B each of seven calls with a host-supplied apiBase must remember sameOriginOnly, and one omission sends the bearer to any URL containing /api/. (4) S4 is fixable in one place under A. The cost of A is that a provider-less host stays cookie-only and the ratchet cannot see that arm (S1). The card's Expected names a per-call createAuthenticatedFetch; A meets it in the console because the host fetch is that function, and the seat should record the deviation when it adopts A.
  • Report flags. security_findings: none — agreed for leaks; S4 and S5 are availability gaps, not exposures. The deviation on reading localStorage directly is answered by S5. The out_of_scope_findings with no carrier are answered by S3 and S4. check:type-check-debt not measured locally: Type Check · debt ledger is success on the head.
  • Ratchet, shrink-only. One row removed (LocalizationFetchProvider, 0 found), two rows added for trees the scan did not read before. No count is raised, and "every row is still exact" keeps a stale row from surviving. Adding a row is still by review only, as on main. Completeness is S1 and S2.
  • SQL push-down. Not applicable: the diff is browser-side request plumbing and tests; no query, id materialisation or join.
  • Fences. No fenced file is touched (createAuthClient.ts and the auth types are unchanged).

Implemented-by: claude/issue-37225-plugin-bearer-fetch
Reviewed-by: session_01Utp6CYtTDvfPQDzMbZnN5X

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

席位核对

Head-sha: f66978d970d56aac0c914a018499dfecaca7a21b
REWORK: L1, seat repo:objectstack#5. Contract record 7187820695 (declaration face, TIER_DEFAULT) reads PASS, with no must-fix. Nothing leaks a bearer off-origin, and the ratchet stays shrink-only. One small code fix is owed and the rest need carriers before ACCEPT.

  1. Shape: open draft against main, 20 files (+713/−72), Fixes #37225, Clause-②: no, four patch changesets. Not governed. Security-touching: yes. 45 success, 13 expected skips, 0 failed.
  2. Open question, the seat's ruling: A, the host apiFetch. It keeps the renderer packages free of an auth dependency (ui/AGENTS.md "Pure UI"). It matches the eight sites already on the host fetch, and it applies sameOriginOnly and the settle signal once, at the host. This is recorded as a deviation from the card's Expected: the console's host fetch is createAuthenticatedFetch.
  3. Owed before ACCEPT:
    • S5, fix in this PR. languageSeed.ts storedToken() reads localStorage directly, so in a storage-blocked embed the provider's read after sign-in carries no bearer. Use TokenStorage.get() in meLocalizationInit (both files already import @object-ui/auth), and keep index.html on localStorage. Add a pin for the memory-fallback case.
    • S1 + S2, one card under 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, on ratchet completeness:
      • the aliased fallback const doFetch = apiFetch ?? fetch counts 0, and MePermissionsProvider has two fallback sites against a row of 1;
      • a URL held in a const, + concatenation, credentials: 'same-origin', and an init passed by name or by spread are all missed.
    • S3, cards (or rows on an existing card):
      • (a) data-objectstack uploadFile / uploadFiles use the global fetch and bypass the injected config.fetch, plus metadata-client.ts;
      • (b) react useElementApiDataSource / useDatasetDimensionLabels, which ride with the S1 card;
      • (c) auth/createAuthClient.ts ×3, a card in the auth lane;
      • (d) the field-selector route /api/v1/objects/NAME/fields that no server serves: register it or retire the widget.
    • S4, card. Under split-origin (VITE_SERVER_URL / VITE_AI_BASE_URL off-origin) the seven converted calls go bare. Let the host fetch trust the configured server origin. Also narrow the changesets' "cross-site embed" wording to what is fixed.
    • Put the card numbers in the PR body. The same reviewer reads the delta.
  4. Accepted deviations (nits, record only):
    • N1: a stored token now overrides a caller's Authorization, and X-Tenant-ID / Accept-Language newly ride these calls. Say so in the changesets.
    • N2: the pin builds its own fetch rather than mounting ConsoleShell's, and the token-key literal appears in four places.
    • N3: encodeURIComponent(objectName) in the field selector, which ride with S5's commit if cheap.
  5. Out of scope and where it went: S1 to S4 go to the area-filed cards under 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.
  6. Landing terms: ungoverned, default tier. Owed: S5 fixed, S1 to S4 carried, required contexts green, a same-head delta PASS and an ACCEPT. Then the maintainer names it for landing, because the area's auto mode refuses --land.

…arrow changeset scope

The seed and the provider now read the stored token through TokenStorage, so a
storage-blocked embed still sends the token sign-in kept in memory (index.html
stays on localStorage). Pinned with a memory-fallback case. The changesets now
name the scope actually fixed (same-origin), say that split-origin requests
still go without the token, and note header precedence. The field selector
encodes the object name into its path.

Claude-Session: https://claude.ai/code/session_01Utp6Ca6EBDpTBZk8v46Jjv
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract review

Served-tier: TIER_DEFAULT
Head-sha: b0a4db683fb930af97e81a604d4ca5025c07c684
Local-runs: none
Security-touching: yes

PR #37489 · card #37225 · declaration face (Clause-②: no) · delta round 1, replacing record 7187820695 (head f66978d970). Read: the seat's REWORK 7187938179, report 7189175282, the PR body at this head, the one-commit delta f66978d970..b0a4db683f (6 files, +39/−17; the whole PR is 20 files, +737/−74 against origin/main), cards #37505 to #37509, and the head's check-runs. Nothing was built or run.

Check-runs on this head: 62 runs — 46 success, 15 skipped, 1 cancelled, 0 failed. The cancelled one is the first PR-body guards run, superseded by a successful rerun after the body edit. Taking the latest run per name gives the report's 44 success, 14 skipped, 0 failed.

① Derived judgments

Security, re-read on the delta. Nothing in the first record's reading changes. The delta moves one token read from localStorage to TokenStorage.get() (same key, same value when storage is reachable, the in-memory copy only when access throws), encodes one path segment, and edits changeset prose. No new request, no new destination, no token in a URL or a log. The bearer still cannot reach a foreign origin through the host fetch (sameOriginOnly), and the field selector's URL is still a relative literal.

The delta.

  • languageSeed.ts: storedToken() is now TokenStorage.get() || ''; the local TOKEN_KEY literal is gone. index.html stays on localStorage, as it must (it runs before the bundle). When the two differ, the inits differ and the provider sends its own read, which is the already-pinned "token stored after parse" shape.
  • sessionCheckBootDedup.test.tsx: a new pin makes the localStorage getter throw, stores the token through TokenStorage.set, and asserts that meLocalizationInit and the provider's one request both carry the bearer. The suite's afterEach restores mocks (line 128), so the throwing getter does not leak. The reported ablation (direct localStorage read restored) turns only this pin red.
  • widgets.tsx: encodeURIComponent(objectName) in the field-selector path.
  • Three changesets: the components and plugin-chatbot ones now say "on the console's own origin", state that an off-origin AI or server URL still goes out without the token, and note the header precedence; the console one names the in-memory read and that the parse-time request reads storage only.

Cards, each read against the finding it carries. All five are open, pm:blocked, Blocked-by: #37225, and cite record 7187820695.

Findings, status at this head.

No must-fix. Every should-fix is closed or carried by an open card.

② Semver level

Clause-②: no still holds. The delta changes no exported signature: meLocalizationInit keeps its shape, storedToken is module-private, and TokenStorage is an existing export of @object-ui/auth, which the console already imports. No package.json moves and no file under ui/packages/auth is in the PR.

Four changesets, all patch, one per moved package, each with Clause-②: no and Metadata-protocol: none. The reworded bodies describe behaviour more narrowly and add the precedence note; the level is unchanged and right. Check Changeset is green on this head.

③ Boundary flags

  • Open question, A or B. Ruled A by the seat (7187938179), matching the first record's recommendation. The PR body now records it as a deviation from the card's Expected, with its cost (a host that mounts no provider stays cookie-only). Answered.
  • Report 7189175282. open_questions is empty. security_findings: none is agreed. Each out_of_scope_findings entry now names a carrier, and each carrier exists and matches. check:type-check-debt was not run locally; Type Check · debt ledger is success on this head.
  • Ratchet. Untouched by the delta: still shrink-only, with its completeness carried by 同服务器令牌棘轮:别名、拼接 URL、spread 参数等写法数漏,react 宿主回退仍走裸 fetch(接 #37225) #37505.
  • SQL push-down. Not applicable: browser-side request plumbing, tests and changeset prose.
  • Fences. No fenced file is touched.

Implemented-by: claude/issue-37225-plugin-bearer-fetch
Reviewed-by: session_01Utp6CYtTDvfPQDzMbZnN5X

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

席位核对

Head-sha: b0a4db683fb930af97e81a604d4ca5025c07c684
ACCEPT — L1, seat repo:objectstack#5

  1. Shape: open draft against main, Fixes #37225, Clause-②: no, four patch changesets. Not governed. Security-touching: yes.
  2. Premise: the plugin same-server reads and the me/localization legs carry the stored bearer through the host's sameOriginOnly fetch, which is ruling A, recorded as a deviation in the PR body. No request destination changes, so the bearer cannot leave the origin.
  3. Gates:
    • Delta record 7189281366, from the same reviewer and verified on the transcript, reads PASS.
    • S5 is closed: meLocalizationInit reads through TokenStorage.get(), with a memory-fallback pin and its ablation.
    • The S4 wording is closed.
    • Checks at b0a4db683f: 46 success · 15 expected skip. The one "failed" entry is the first PR-body guards run, cancelled by the body edit; its rerun is green. Mergeable clean.
  4. Accepted deviations:
  5. Out of scope and where it went: 同服务器令牌棘轮:别名、拼接 URL、spread 参数等写法数漏,react 宿主回退仍走裸 fetch(接 #37225) #37505–分源部署(控制台与 API 不同源)时,#37225 改过的 7 处请求仍不带令牌(接 #37225) #37509 under 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. The security label goes on.
  6. Landing terms: ungoverned, default tier. Same-head delta PASS plus this ACCEPT. o5-U's auto mode refuses --land, so the seat lands it once the maintainer names it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Security label: Security-touching: yes per contract record 7189281366 (auth plumbing: same-server reads now carry the stored bearer; no off-origin path).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Probe Reading
check-governed-merges --pr 37489 NOT governed, +737 / −74 ≤ 3000
landing-k --pr 37489 CAN'T ANSWER, because no Test Core shard ran on this UI-only diff. Measured by hand: K = 10 first-parent commits on main since merge base eaa9e5447e (< 15)
pr-state --pr 37489 at b0a4db683f 47 success · 19 expected skip · 0 pending, mergeable clean. The one "failed" entry is the first PR-body guards run, cancelled by the body edit; its rerun is green
os-regen paths in diff none

Landing on seat ACCEPT 7189296371, which sits on the same-head delta PASS 7189281366. The maintainer named this PR on the seat thread's decision card: 「合并 #37489」 on 「合并已 ACCEPT 的非受管 PR #37489(插件请求带登录令牌)吗?」, 2026-11-26T10:35Z. Action: ready + auto-merge. Closes #37225 on merge.

@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 45803113341 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Dogfood Regression Gate (3/3) — 失败步骤: Boot example apps and exercise real user flows

    @objectstack/dogfood:test:  FAIL   isolated  test/expression-conformance.test.ts > ADR-0058 D7 — expression surface conformance ledger > is a sound conformance ledger + ratchet (ADR-0060 checkLedger)
      ↳ 失败原因: @objectstack/dogfood:test: AssertionError: UNCLASSIFIED surface — add a ledger row (ADR-0060): data/field.zod.ts:FieldSchema.uiReadonlyWhen: expected [ Array(1) ] to deeply equal []
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 7 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

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 security size/l 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