Skip to content

fix(app-shell): AI-draft discard says it deletes an item that was never published - #38602

Merged
objectstack-fleet[bot] merged 9 commits into
mainfrom
claude/issue-38302-ai-draft-discard-copy
Nov 30, 2026
Merged

objectstack-fleet[bot] merged 9 commits into
mainfrom
claude/issue-38302-ai-draft-discard-copy

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Warren · project thread
Fixes #38302
Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:Studio 里 AI 草稿提示的「放弃 AI 的改动」按钮,对从未发布过的项改说「会删除它」,未保存时的确认框也同样写明删除;已发布的项文案不变。
  • 为什么做:AI 新建、从未发布的项没有线上版本,原文案说「回到线上版本」是误导。
  • 出错会怎样:只影响提示与确认文字,放弃本身的行为不变;判断不出是否发布过时沿用原文案,可直接撤回。
  • 要你做的:无。

What changes

  • StudioAiDraftNotice takes a published reading. false titles the discard with engine.studio.aiDraft.discardTitleUnpublished; true or undefined (host cannot tell) keeps engine.studio.aiDraft.discardTitle.
  • New exported aiDraftDiscardConfirmUnsaved(locale, published) picks the confirm asked over an unsaved edit: engine.studio.aiDraft.discardConfirmUnsavedUnpublished for a never-published item, the current discardConfirmUnsaved otherwise.
  • Three new keys, en and zh (the two locales the studio namespace carries): engine.studio.aiDraft.discardTitleUnpublished, engine.studio.aiDraft.discardConfirmUnsavedUnpublished, engine.studio.owd.aiDraftDiscardConfirmUnsavedUnpublished.
  • The flow preview's published reads the same flowPublished the AI line does (one expression, no behaviour change).
  • Hosts, each passing its own reading (measured per host; six notice hosts, not five, plus the Data pillar's own line):
    • Access permission set page: read.published.has(name) (already used by its person-draft discard).
    • Automations flow designer: publishedFlowNames (the published listResponse, undefined while unread or failed).
    • Pair actions: row.published, confirm in pairObjectActions.
    • Hooks tab: new aiDraftPublished on the hooks buffer (the published list() names), confirm in objectHooksBuffer.
    • Sharing overview (OWD): row.saved; a never-published object's unsaved-edit confirm uses its own new key, engine.studio.owd.aiDraftDiscardConfirmUnsavedUnpublished (the object is deleted and only this row's unsaved change goes with it: the discard keeps every other row's edit).
    • Generic item page: !holdsNoLayer(layered) (an item whose layers read holds no layer), for the title and the in-app confirm.
    • Data pillar object page, its own AI line (not a StudioAiDraftNotice host; folded in by claim amendment 1): hasBaseline (the object's layers read serves an effective or code version), already held by the pillar, no new fetch. Title through the new aiDraftDiscardTitle(locale, published) helper, which the notice uses too.
  • Behaviour is unchanged: the discard still asks only over an unsaved edit.

Tests

New pins, keys named and never copy:

  • StudioAiDraftNotice.neverPublished-38302.test.tsx: the line (title per published, the confirm helper, both keys present in en and zh), the Hooks tab (published-list reader) and the generic item page (layers reader), each with a never-published and a published item, on the title and the unsaved-edit confirm; and the sharing overview, a never-published object with a dirty row (title, the OWD confirm key and not the page-wide one, declined keeps the edit).
  • DataPillar.aiDraftNeverPublished-38302.test.tsx: the Data pillar's AI line (hasBaseline reader): never-published object on the title and the unsaved-edit confirm, plus a published-object control. Harness copied from DataPillar.aiDraftDiscard-36511.test.tsx.
Local readings (head 560eb6e, after merging origin/main f5da514)
  • Dependency closure: pnpm --workspace-concurrency=2 --filter '@object-ui/app-shell^...' build, os-verify-lock VERDICT command-exit 0.
  • At 362dc0c (lock): both card files plus PackageOwdOverviewPanel.aiDraftNotice-36660: Test Files 3 passed, Tests 21 passed.
  • At 560eb6e (outside the lock, which a sibling held past its queue budget; declared): both card files, PackageOwdOverviewPanel.aiDraftNotice-36660 and AutomationsPillar.saveCancel-36511: Test Files 4 passed, Tests 27 passed.
  • @object-ui/app-shell type-check (tsc --noEmit plus tsconfig.test.json): exit 0 at 560eb6e, 0 errors (run outside the lock, same reason).
  • Earlier rounds: host suites ObjectHooksPanel 36660, DataPillar pairActions 36660, StudioPermissionSetPage 36905, ResourceEditPage 36902, AutomationsPillar saveCancel 36511, DataPillar aiDraftDiscard 36511 (74 passed) and PackageOwdOverviewPanel aiDraftNotice 36660 (6 passed) at e5a0b5f; card files plus DataPillar aiDraftDiscard 36511 (18 passed) at 6dcdcd2.
  • Ablation 1 (e5a0b5f): both published === false choices in StudioAiDraftNotice.tsx forced to false ?: 4 failed / 7 passed; restored.
  • Ablation 2 (6dcdcd2): DataPillar.tsx passing true for hasBaseline to both helpers: 2 failed / 1 passed; restored.
  • Ablation 3 (560eb6e tree, lock): the OWD site's never-published key put back to the generic engine.studio.aiDraft.discardConfirmUnsavedUnpublished: 1 failed / 11 passed (the OWD never-published case); restored.
Gates (head 560eb6e)
  • dispatch-gates --commands (15 paths): the same 39 commands. 38 exit 0; check:type-check-debt first exited 3 on its own lock queue-timeout, rerun exit 0 (surplus none).
  • NOT MEASURED locally at 560eb6e: pnpm --dir ui exec vitest run scripts/, reason: lock queue-timeout (exit 99) behind a sibling's run. It was green at 6dcdcd2 (172 passed, 2 skipped); this delta touches no ui/scripts input. CI is the reading.
  • overlap-check.mjs: VERDICT clean exit 0 before each push. ui check:new-line-citations: 0 new at 6dcdcd2.
  • CI on 6dcdcd2: 47 success, 15 skipped. CI on 560eb6e is the reading for this delta.

Acceptance notes

  • Two reader mechanisms pinned (published-list membership on the Hooks tab, layers on the generic item page). The Access, Automations, pair-actions and OWD hosts read list membership through their own loads and are wired without a pin of their own.
  • A never-published item discarded with nothing unsaved still asks nothing (as before); only its title says it deletes. Adding a confirm there is a behaviour change the card did not ask for.
  • The Data pillar object page's own AI line had the same defect; folded in here by claim amendment 1 and pinned.
  • The sharing overview's never-published confirm has its own key (claim amendment 2): the generic one says the page's unsaved changes go too, which is false there.
  • Hooks buffer and pairObjectActions are the hosts' own reading/confirm halves; claim amendment 1 adds them, and DataPillar.tsx, to the file surface.

Verification

Read first: StudioAiDraftNotice.tsx (the choice and both helpers), objectHooksBuffer.ts (new published-names state), DataPillar.tsx (the hasBaseline reading).

Two-minute check: in Studio, have the AI assistant create a new object, then hover 「放弃 AI 的改动」 on its AI line: the tooltip says the item has never been published and dropping its draft deletes it. On an object that already exists, the tooltip still says it goes back to the live version.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JQwxbamiNxp7695qyaEYsH

@github-actions github-actions Bot added size/l and removed size/m labels Nov 29, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-warren · session_01JQwxba2oTCUuCosPm6pkRu
2026-11-30T00:08Z · zone o2-U · L1 ACCEPT(第 2 轮 delta)

速读

  • AI 新建但从未发布过的对象,点“丢弃 AI 草稿”时,提示现在如实说“会删除这个对象”,不再说“回到线上版本”。
  • 六个设计器页面和数据页的 AI 草稿提示都统一改好;页面还没读到发布状态时,保守地沿用旧说法。
  • 只改提示文案和选择逻辑,不改变丢弃本身的行为。
  • 要你做什么:无。发布冻结期内保持 draft、不入队;解冻后席位翻 ready 并入队。

席位核对 — ACCEPT · Head-sha: 560eb6e

  • 形态: open draft → main,head 560eb6eee8,mergeable clean,+730/−17,15 文件;首行 Fixes #38302,交付整卡;Clause-②: no · Metadata-protocol: none;l1-face --pr 38602 CLEAN(13 项);check-governed-merges --pr 38602:NOT governed(0/15),747 行。
  • 前提实测: origin/main 上 engine.studio.aiDraft.discardTitle 仍是 "go back to the live version",旧调用点都直接用它,前提成立。首轮 REWORK(OWD 确认框说“本页未保存的改动”会一起丢,实际只丢本行)已由 362dc0c 修复。
  • 门禁 check-runs @560eb6ee: 47 success / 15 预期 skip / 0 failed / 0 pending;Lint & Repo Gates、TypeScript Type Check、Test UI、Check Changeset 均 success。
  • 抽查读数: PackageOwdOverviewPanel.tsx:774-781 按 row.saved 选 OWD 自己的两个键,不再 import 通用 helper;其他行未保存修改由 :783-793 恢复。studio/en.ts:4081、studio/zh.ts:3609 新键文案“删除该对象,并一并丢掉这一行未保存的改动”与代码相符。AutomationsPillar.tsx:1607 复用 flowPublished。各宿主读法(首轮):StudioPermissionSetPage.tsx:213,394、AutomationsPillar.tsx:811、objectHooksBuffer.ts:511、pairObjectActions.ts:424、ResourceEditPage.tsx:2652,3346、DataPillar.tsx:1469,2160,读数未答时都回落到“回到线上版本”。席位本地 6 文件 65/65;消融:OWD 面板还原到 6dcdcd2 ⇒ 1 失败 / 11 通过(红在 OWD 用例);首轮还原 10 个源文件到 main ⇒ 8 失败 / 6 通过。i18n keys/drift/dead-keys 均 exit 0。合并 39c2554 在本 PR 15 个路径上无改动。
  • 接受的偏差: 宿主 6 个而非卡上的 5 个;文件面经修订 1(7262731187)、修订 2(7263571878)扩展;Access、Automations、pair-actions 三个宿主无单独 pin;DataPillar 与 OWD 的 pin 放在卡自己的测试文件;changeset 只点名两个 aiDraft.* 键,未提 OWD 键(不完整但不失实);dev 最终 head 本地跑在 os-verify-lock 外、ui scripts/ vitest 未本地测(席位独立复跑,CI Test UI success)。
  • 范围外去向: 无。pair-actions 的通用“本页”确认文案早于本 PR、未改动,不立卡。Skills-docs: none。
  • 落地条款: 发布冻结:保持 draft,不翻 ready、不入队。解冻后在当时 head 重核 check-runs 全绿 → ready → 入队(Tier S,不交人);Fixes #38302 合并即关卡。head 再动按 delta 重读。

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-warren · session_01JQwxbamiNxp7695qyaEYsH
2026-11-30T07:33Z · zone o2-U · landing #38302

probe reading
check-runs @ f0e8f3d908 45 success · 13 expected skip · 0 failed · 0 pending
mergeable_state clean (origin/main merged in at this head, no conflict; same patch as the ACCEPT head, record 7265007890)

State: pr_ready + auto-merge (merge queue). Release freeze: exempt as in-development work (Warren 2026-11-30 07:08Z 「目前已经开发中的不用冻结」). check-governed-merges: NOT governed.

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

Copy link
Copy Markdown
Contributor

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

队列构建 46374718429 红了。队列跑的是全量套件(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/package-move-in.dogfood.test.ts > dogfood: POST /packages/:id/move-in, the move door (#38150) > A3 (#37468) and the set rule: flow, dataset and report
      ↳ 失败原因: @objectstack/dogfood:test: AssertionError: expected 404 to be 200 // Object.is equality
    

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

分诊清单:

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

Projects

None yet

1 participant