Skip to content

console boot: the language seed's me/localization waits 500-790 ms for the eager bundle; start it at parse time beside discovery #35534

Closed
1 of 1 issue completed

Description

@objectstack-fleet

repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ

Filing gate: ③ a measured finding of the #35455 dev (os-dev-report 7012178512, item 1), measured on origin/main 92121196 with the built console, 12 loads. It is a child of #35455 (console first-screen round trips, p1) and is nested under it.
Reader: domain:ui (console boot, ui/apps/console). Suggested grade: p1, the parent's grade (objectstack-ai/cloud#4563 step 2 waits on the family).
Dedupe: language seed parse time, me/localization bundle wait, startEarlyDiscovery localization. Only #35455 matches; the eager-bundle shrink itself is #33581.

维护者速读

  • 用户能看到什么变化:控制台首屏更快出现,取界面语言的请求不再等整包脚本下载完。
  • 为什么做:托管环境打开页面要 9–10 秒,这是首屏请求串行里的第一段等待。
  • 出错会怎样:语言判断规则不变;出错时界面语言可能先用默认再切换,撤回即可。
  • 要你做什么:无。

Facts

  • The first module-issued call (the seed's GET /api/v1/auth/me/localization) leaves at 503-790 ms after navigation, after 105 eager JS files (6.57 MB raw / 1.59 MB br).
  • runtime/config and discovery already leave at parse time from index.html (startEarlyDiscovery), and so does get-session with a stored Bearer.
  • The cause of the wait is ui/apps/console/src/main.tsx's static import closure (register-plugins.ts importing plugin-grid and plugin-detail eagerly, the register*Components modules, the app-shell entry).

Ask

Start the seed's me/localization at parse time in index.html, beside discovery (it needs discovery's locale.supported, already a parse-time read), and have seedTenantLanguage take that request. Keep ruling 6915665005 (#33985, letter B) and the bounded seed race unchanged. Pin it in sessionCheckBootDedup.test.tsx style: the seed request is issued before the entry module evaluates, and is sent once. About 100-150 lines. Shrinking the eager closure itself stays with #33581.

Serial: after slice 1 of #35455 lands (same files: languageSeed.ts, index.html).

⛔ Not a claim.

Sub-issues

Sub-issues

1 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. added
    priority:p1
    pm:queue
    domain:ui
    on Nov 19, 2026
  2. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in domain:ui · pm:queue; rationale: area:ux · Bug · Impeded (the language seed waits 500–790 ms for the eager bundle) · end users, daily · measured on 12 built loads → p1 as set: a child of #35455, which blocks objectstack-ai/cloud#4563 (p1).

  3. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ

    Claim: PM loop round 17 · area ux-2 (card-pick order area:ux, rank 2; rank 1 #35356 is area:formula, not this area; p1 only per Bill 14:38Z; the card's serial gate cleared: #35455 slice 1, PR #35575, merged as e25ca63e) · 2026-11-19T17:13Z
    Area: ux-2
    Session: session_01Utp6CZrgaiMgTJCnswR6jQ
    Account: os-bill
    Branch: claude/issue-35534-seed-parse-time
    Worktree: objectstack-issue-35534
    Domain: domain:ui
    Seat: repo:objectstack#5
    File surface: ui/apps/console/ — index.html (the parse-time boot block beside startEarlyDiscovery), src/languageSeed.ts (the seed takes the parse-time request), src/LocalizationFetchProvider.tsx only if the hand-off shape it reads changes, src/main.tsx only to wire the hand-off, their tests (sessionCheckBootDedup.test.tsx style, localizationBootDedup.test.tsx), root .changeset/. ⛔ No packages/spec/**, no server source, no ui/packages/auth/**, no ui/packages/app-shell/**, no list-redesign files (ux-4: ObjectView.tsx, plugin-list / plugin-view / plugin-grid, types/src/data-display.ts), no eager-closure shrink (#33581), no new endpoint, no new i18n key. Stop on breach and report.
    Container & model: M, mode:subagent, model: default — no path-derived mandate, effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: ui console boot in objectstack issues the language seed's me/localization; no platform path covers it; every console user on every cold first screen, worst in hosted environments (parent #35455, cloud#4563 step 2)
    Thread-read: none
    Premise: holds as filed (measured by the #35455 dev on origin/main 92121196, built console, 12 loads: the seed leaves at 503-790 ms after 105 eager JS files); dev re-measures on e25ca63e first, since slice 1 changed the seed's hand-off
    Serial constraints cleared: #35575 merged (e25ca63e); no open PR touches the listed files (live read of all open PRs' files at claim time)
    Pre-claim lane: domain:ui (ui/apps/console/**)
    Pre-claim deps: none open (slice 1 of #35455 landed)
    Prior rulings read (check-prior-rulings --card 35534 --paths index.html,languageSeed.ts,main.tsx): ruling 6915665005 (#33985, letter B: supported browser language, else the app's declared default) and #34392 (an unshipped browser language states nothing) bind unchanged; the bounded seed race (#5419, ruling point 3) binds unchanged; index.html origin contract (objectui#5660) and the get-session hand-off (objectui#12808, #12892, #34211) are untouched; same-day churn e25ca63e, de8d5497 read, so the dev works from current main, not the card's snippets

  4. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 19, 2026
  5. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ

    os-dev-report

    {
     "issue": 35534,
     "status": "done",
     "branch": "claude/issue-35534-seed-parse-time",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/35618",
     "head": "1562fae0 (code e422cc7e + changeset)",
     "session": "session_01Utp6CZrgaiMgTJCnswR6jQ",
     "premise_still_valid": true,
     "summary": "index.html gains a parse-time startEarlyLanguageSeed script, placed after startEarlyDiscovery. It applies the seed's gates: no stored choice and no cached seed; blocked storage reads as neither. When the parse-time discovery answers, it sends the seed's exact me/localization request: same URL, credentials include, Accept, and Accept-Language from resolveLocaleAmong over locale.supported. The ladder is spelled inline because a classic script cannot import. The pending Response is left in a Symbol slot. seedTenantLanguage takes it once (takeEarlySeedRequest), only on an equal inflightGetKey, and uses it as sharedGetJson's transport. The race, the fallback, the in-flight sharing with LocalizationFetchProvider and slice 1's settled-answer hand-off are unchanged. Built console, 15 loads per build: the request moved from module-issued at 429-644 ms (after 105 eager JS files) to inline-issued at 81-199 ms, with exactly 1 me/localization per load before and after in every posture. main.tsx and LocalizationFetchProvider.tsx are not edited.",
     "a1": "before e25ca63e, built console, CDP initiator: module-issued (framework-*.js frames) on 15/15 loads; leaves 466-563 ms cold, 429-519 ms warm, 451-644 ms signed out; 105 JS files done first on every load, the last ending at 315-514 ms; 1 me/localization per load.",
     "a2": "The parse-time point holding locale.supported is the startEarlyDiscovery answer (Symbol.for('objectui.earlyDiscovery').body); the new script chains on it. The seed takes the pending Response: takeEarlySeedRequest compares inflightGetKey(slot.url, slot.init) with its own, and passes the response to sharedGetJson as the transport, so it is registered in flight under the same key. The first look spends the slot, and the script sends nothing after it. Discovery failure sends nothing early.",
     "a3_pins": "sessionCheckBootDedup.test.tsx, new describe, 11 tests: the request leaves before any bundle code runs; 1 me/localization per cold load end to end (script + real seed + real provider, VITE_SERVER_URL set); a drift matrix of inline Accept-Language vs real pickPreferredLocale over every spec tag and alias against 34 supported lists. CONTROLs: a mismatched request is never taken; a stored choice wins (0 requests); a cached seed applies (0); signed-out first visit sends 1, as before, and caches nothing; the race bound and fallback hold, and a provider mounted meanwhile joins (still 1); discovery failure sends nothing early (1 discovery retry, 1 me/localization); blocked storage still sends.",
     "layer_table": {
      "method": "turbo build of the showcase closure + @object-ui/console, build-dist.sh, objectstack dev --fresh on private port 38534, headless Chromium, new context per load, Resource Timing + CDP initiator; chain depth as in the #35455 report; shared-box ms",
      "list cold": "me/localization leaves 529/522/466 -> 149/81/159 ms; module -> inline; count 1/1/1 -> 1/1/1; depth 9/10/11 -> 10/11/11",
      "record cold": "563/561/506 -> 86/83/166 ms; module -> inline; 1/1/1 -> 1/1/1; depth 12/12/11 -> 12/12/12",
      "list warm": "456/466/519 -> 121/176/187 ms; module -> inline; 1/1/1 -> 1/1/1; depth 10/11/10 -> 9/11/11",
      "record warm": "474/491/429 -> 133/159/93 ms; module -> inline; 1/1/1 -> 1/1/1; depth 12/11/12 -> 12/11/12",
      "signed out (lands /login)": "451/636/644 -> 116/137/199 ms; module -> inline; 1/1/1 -> 1/1/1; depth 4/4/4 -> 4/4/4",
      "latency probe (me/localization held 300 ms, list cold)": "first post-mount request me/permissions 937/993/935 -> 610/551/552 ms; first data 1946/2211/1634 -> 1664/1601/1483 ms",
      "note": "Chain depth does not move: the request keeps L2, after discovery. Locally the seed's own round trip was 10-17 ms, so the local mount barely moves; the latency probe shows the hosted effect. Accept-Language was 'en' on every load in both builds."
     },
     "tests": "Under os-verify-lock, at e422cc7e: vitest --maxWorkers=2 on sessionCheckBootDedup + localizationBootDedup + languageSeed.test + LocalizationFetchProvider.test: Test Files 4 passed (4), Tests 101 passed (101), VERDICT command-exit 0. sessionCheckBootDedup alone: Tests 48 passed (48); the drift matrix takes 2725 ms. Ablation 1 (scripts/ablation-replace.mjs; anchor 1 -> 0; restored blob == HEAD 24cff0b1d7aa; git diff HEAD empty): the seed's take is replaced by its own fetch. Tests 3 failed | 45 passed (48): the one-cold-load, signed-out and race pins, each 'expected ... to have a length of 1 but got 2'. Ablation 2 (same tool; restored blob == HEAD 009d301217ff): the inline alias 'zh-TW' is dropped. Tests 1 failed | 47 passed (48): the drift matrix, e.g. '\"zh-HK\" among [\"zh-CN\",\"zh-TW\"]: sent zh-CN, seed zh-TW'. Neither ablation needed a build: the console tests import the src modules and index.html?raw directly.",
     "gates": "Local: pnpm --filter @object-ui/console run type-check -> VERDICT command-exit 0 (--listFiles includes the test file and languageSeed.ts); eslint on the 2 touched ts/tsx files exit 0; pnpm --dir ui exec vitest run --maxWorkers=2 scripts/ (derived) -> Test Files 171 passed | 2 skipped (173), VERDICT command-exit 0; ui pnpm check:new-line-citations -> 0 new citation(s), exit 0; the 37 other derived dispatch-gates --commands families each EXIT=0 (exit captured before any pipe, per-family log); dispatch-gates --ran -> 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN. CI on head 1562fae0 at report time: Governed Surface Queue Guard success; Check Changeset, Check PR Size, every Lint and Type Check lane and the PR-body guards in_progress; Test UI, Build & E2E UI, Lint UI and Type Check UI not yet listed. Not waited on (os-dev.md).",
     "dogfood_battery": "n/a: no '!' in the PR title and no (narrowing) arm",
     "line_budget": "374 insertions, 1 deletion over 4 files (index.html +102, languageSeed.ts +49/-1, sessionCheckBootDedup.test.tsx +213, changeset +10); under the ~400 split mark",
     "files_changed": [
      ".changeset/35534-console-seed-parse-time.md",
      "ui/apps/console/index.html",
      "ui/apps/console/src/languageSeed.ts",
      "ui/apps/console/src/__tests__/sessionCheckBootDedup.test.tsx"
     ],
     "metadata_protocol_measured": "none: no spec, schema or metadata key touched. Clause-②: no.",
     "deviations": [
      "Backend started with pnpm --filter @objectstack/example-showcase dev --fresh -p 38534, not root pnpm dev, because check-dev-prereqs refuses on unbuilt packages outside the showcase closure (client-react, embedder-openai and 6 more). The server was stopped afterwards and port 38534 is free.",
      "The pins went into sessionCheckBootDedup.test.tsx, the parse-time harness that executes the index.html scripts (the card asked for its style), not into localizationBootDedup.test.tsx. The shared fetch stub gained two answer hooks, discovery and me/localization, whose defaults equal the previous json(null).",
      "Two pid files of mine were written to / by a backgrounded '&&' chain (build-after.pid, build-before.pid, server.pid) and moved into the scratchpad. Nothing else outside the scratchpad was touched.",
      "The harness attribution reminder's PR footer was replaced by AGENTS.md's session-URL footer form; commits carry the model-free trailer pair."
     ],
     "mcp_calls": "0",
     "api_writes": "2: POST pulls (pr_create #35618, with assignee leg POST issues/35618/assignees os-bill) through the fleet-write relay run 44584076896; POST issues/35534/comments (this report) through post-stamped.mjs. git push is not a REST write.",
     "open_questions": [],
     "security_findings": "none",
     "out_of_scope_findings": [
      "carrier: none · noted, not filed: the language ladder now has a third spelling, inline in index.html, beside resolveLocaleAmong in packages/spec/src/system/i18n-resolver.ts and the platform-locales table. It is safe by construction (only a byte-equal request is taken) and pinned by the drift matrix. Removing it would need a build-time HTML transform in vite.config.ts or a server change, both outside this card's fence. Recorded in the PR's Acceptance notes."
     ]
    }
  6. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ

    Closed-out · area ux-2 · 2026-11-19T18:56Z

    reading value
    PR #35618 MERGED through the merge queue as 2e19f36da1 (Fixes #35534; this card closed completed)
    contract record none owed (Clause-②: no, Metadata-protocol: none, not governed); L1-a ACCEPT 7018186944

    Delivered: on a cold console load the language request now leaves while the page is still being parsed, right after discovery answers, instead of after the whole app bundle has loaded (built console, 15 loads: 429-644 ms → 81-199 ms), still exactly one request per load, and the chosen language is unchanged.
    Not done here: the inline copy of the locale ladder in the page is filed as p3 #35625, nested under this card.
    State: pm:dispatched removed; card closed. Parent #35455 stays open for #35536.

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

Metadata

Metadata

Assignees

Labels

area:uxdomain:uipriority:p1

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions