Skip to content

fix(console): a session answered "not shown" sends no first-run checklist reads on later opens - #37184

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-6843hq
Nov 25, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-6843hq

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Warren · project thread

Fixes #37182

Clause-②: no
Metadata-protocol: none

维护者速读

  • 做了什么:看不到「开始使用」清单的会话(普通成员;控制面上的普通组织所有者),第一次被服务端答成「不显示」后,本机记住这个答案(按组织、用户、权限集合,24 小时);之后打开控制台不再多发 GET /api/settings。
  • 管理员不受影响:每次照旧读取并显示清单。权限变了、换人或换组织、过期、读取失败,都会重新读。
  • 结果:cloud 控制面计费页的预热打开回到 25 次请求;下一轮 cloud 抄版本把预算从 26 改回 25。
  • 要你做的:无。

What changes

  • firstRunChecklistLogic.ts: a device record of the server's "not shown" answer, os:first-run-checklist-not-shown:<orgId>:<userId>, holding the capability list it was read for and when (notShownRecordKey, wasAnsweredNotShown, markAnsweredNotShown, NOT_SHOWN_RECORD_TTL_MS = one day). It fails toward reading again: unreadable storage, a record that does not parse, a different capability set, an expired record, or one dated in the future all read.
  • firstRunChecklistState.tsx: the provider checks the record before scheduling its reads and asks nothing while it stands; when readChecklistSettings answers null (the server's answer that this session may not write localization), it writes the record. A read that throws writes nothing. An administrator's path is untouched.

Why

Since #36791 the provider is mounted above every app route and, after the first paint, sends GET /api/settings for every session whose systemPermissions is non-empty. For a session never shown the checklist that request buys nothing, on every console open. The cloud pin round cloud#4982 (PR cloud#4983) measured it as the 26th call of the control plane's page/pricing warm open, budget 25.

Why a remembered answer and not a capability check before the request: the session that red the budget, an ordinary organization owner on the control plane, holds setup.write; that plane re-registers localization with writePermission: manage_platform_settings (cloud control-plane-settings.ts). Which permission a deployment's manifest asks is known only once the list answers, and naming one in the console would be a second copy of the manifest's declaration that drifts on the next deployment that changes it. The first open on a device still pays the one read; every later open within the day does not.

Verification

  • pnpm exec vitest run apps/console/src/pages/settings/__tests__/firstRunChecklistLogic.test.ts apps/console/src/pages/settings/__tests__/FirstRunChecklist.test.tsx (from ui/): 119 passed.
  • New provider pins (a session answered "not shown" asks nothing again on this device): a member reads once then never; an owner holding setup.write where localization asks manage_platform_settings reads once across three opens; an administrator reads and is shown it on every open; a member made administrator reads again at once; a failed list read records nothing; another user in the same browser reads for themself. New logic pins cover the key, capability-set match, the one-day bound, a future-dated record, unreadable storage and unparseable records.
  • Ablation: with firstRunChecklistState.tsx reverted to main, the member and control-plane-owner pins fail (2 failed, 88 passed in that file); the other four pass on both, as preservation pins.
  • eslint on the four touched files: 0 errors (2 pre-existing react-refresh/only-export-components warnings on firstRunChecklistState.tsx).
  • Not run locally: the cloud console-boots budget. The next cloud pin round reads it and moves page/pricing maxCalls back to 25, with the reading recorded on cloud#2914.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (not touched)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (not touched)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JQwxbZaRxCTLgg8LsLBuFb

Adds the changeset. The checklist provider sits above every app route and,
after the first paint, listed settings manifests for every session holding
any capability, only to learn it may not write localization. A session the
server answered "not shown" now asks nothing again on that device for one
day, keyed on organization, user and capability set.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbZaRxCTLgg8LsLBuFb
@github-actions github-actions Bot added size/m 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 25, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

维护者速读

看不到「开始使用」清单的会话(普通成员,以及控制面上的普通组织所有者),第一次被服务端告知「不显示」后,这台设备记住这个答案 24 小时,之后打开控制台不再多读一次设置。管理员照旧每次都读。
要你做的:无。

席位核对 — ACCEPT (L1) · repo:objectstack#1 · head 17d71dc8 · 2026-11-25T02:31Z

  • Shape: 首次使用清单:不能看到清单的会话不再发设置读取 #37182. 5 files, +255 −3. The changes are in ui/apps/console only: firstRunChecklistLogic.ts, firstRunChecklistState.tsx, two test files and a patch changeset. No governed path. Clause-②: no, since the new exports are console-internal and the console is an app, not a published library surface. Metadata-protocol: none.
  • Read:
    • The memo is keyed os:first-run-checklist-not-shown:org:user and stores { held, at }. It is only written when readChecklistSettings resolves null, which is the server's answer. A failed list read rejects to the provider's existing .catch, so nothing is written and the next open reads again.
    • The memo fails toward reading in every doubtful case: no storage, a parse error, a capability set that differs, an age of 24 hours or more, or a timestamp in the future.
    • The administrator path is unchanged, since a non-null found never writes.
    • The new !userId guard is redundant with identity, which already needs userId, so it changes nothing.
    • The memo only suppresses a read and never widens what is drawn, so there is no security effect.
    • If a deployment later moves localization's writePermission, this session follows within a day. That is stated and accepted.
  • Tests: 6 provider cases cover a member, a control-plane owner, an admin who reads every time, a changed capability set, a failed read that is not an answer, and another user. 4 logic cases cover keying, a changed set, the TTL with a future date, and unreadable storage.
  • Gates: CI on 17d71dc8 is still running (4 success, 13 skipped, 19 in progress, 0 failed). The queue waits for the required checks.
  • Follow-through (card Done when 4): in the next cloud pin round after this merges, set page/pricing maxCalls in verify-console-pin.mjs back to 25 and record the reading on cloud#2914.
  • Landing: mark ready and turn on auto-merge now.
    No must-fix, no should-fix.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 25, 2026 02:33
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

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

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

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

  • Test UI (1/16) — 失败步骤: Run the ui tests (shard 1/16)

    × no ui source outside the builder spells one 17664ms
    FAIL   unit  packages/app-shell/src/views/studio-design/studioAddress.guard.test.ts > no Studio address is built by hand under ui/ (objectstack#36895) > no ui source outside the builder spells one
      ↳ 失败原因: Error: Test timed out in 15000ms.
    

↳ 失败原因 是判读的关键:超时(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 队列共有 5 个失败构建(不含本次)。

分诊清单:

  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 size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

首次使用清单:不能看到清单的会话不再发设置读取

2 participants