Skip to content

feat(studio): every human editor saves live; an item's unpublished AI changes can be dropped on its page (#36511, PR 3 of 3) - #36652

Merged
objectstack-fleet[bot] merged 32 commits into
mainfrom
claude/issue-36511-studio-save-cancel-3
Nov 23, 2026
Merged

objectstack-fleet[bot] merged 32 commits into
mainfrom
claude/issue-36511-studio-save-cancel-3

Conversation

@os-warren

@os-warren os-warren commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by Warren · project thread

Fixes #36511

Clause-②: no
Metadata-protocol: none

维护者速读

What changes

PR 3 of 3 for the card. PR 1 (#36597) moved an object's fields, validations, actions and settings to the Studio top-bar Cancel/Save; PR 2 (#36634) moved hooks, an installed app's added actions, and flows. This PR finishes the list:

  • Permission sets (PermissionMatrixEditor, inside Studio's Access pillar). Grants stay on the page until Save; Save writes the draft and publishes that one set at its package. A refused publish keeps the grant unsaved, says why, and takes back the draft it wrote. The full-metadata item page keeps its own buttons, as the card says.
  • OWD overview (PackageOwdOverviewPanel). Its own "Save" button is gone; its rows register with the top-bar Save. Each changed object is saved as a draft and published at once. The controlled-by-parent prerequisite confirm still applies. Rows the server refuses stay edited and are named in the refusal; the rest are saved. When a later row asks the prerequisite, the rows already published are read back first, so none shows as unsaved and Cancel never restores a value the server no longer holds.
  • Field layout. The form designer writes through the object's buffer that PR 1 put on Save/Cancel, so no code changed. A new suite pins it: moving a section sends nothing; Cancel restores the order; Save sends one draft PUT, then the publish.
  • Creates. Creating an object, a flow or a permission set now publishes the new item right away, and those three dialogs say "Create" / 「创建」 (engine.studio.createLive). Every other create dialog still writes a draft and still says "Save as draft". CreateItemDialog.oneLabel-11787 pins which is which.
  • Item 6: an item with the AI's unpublished changes (objects and flows). The page opens on the AI's version, as before. A line says 「这一项有 AI 未发布的改动,保存会一并生效」, with a 「放弃 AI 的改动」 button. The button discards that one item's draft at its package (DELETE /meta/:type/:name?state=draft&package=), never the package's batch discard. It asks first if the page has unsaved edits. The page goes back to the live version, and the Changes count re-reads the ledger, so it drops by that item. A draft a person wrote draws neither the line nor the button.
  • Changes count. Live saves and the AI discard no longer report a "draft saved". That report held the count at one or more. They send the metadata refresh pulse instead, so the count reads the ledger again.

Why

The maintainer ruled on 2026-11-22 that a human edit is saved and confirmed one item at a time. Drafts plus the batch publish stay for the AI. This PR moves the last human editors off the draft autosave and adds the card's item 6.

Acceptance

Card acceptance line Where Test
Add a field to an object: nothing is written before Save; after Save it is live, no publish needed #36597 DataPillar.saveCancel-36511 › an edit sends nothing until Save; Save writes the draft, then publishes
Cancel/Save sit at the top-bar right where Publish was; hidden with no edit #36597 StudioDesignSurface.saveBar-36511, studioSaveBar.partialSave-36511 › is drawn only while a buffer is dirty
A field, the display name in Settings and a validation, one Save: all three live #36597 studioSaveBar.partialSave-36511 › sends every dirty buffer in order; DataPillar.saveCancel-36511
Drag a field in the field layout: nothing written before Save; Cancel puts the canvas back this PR DataPillar.layoutSaveCancel-36511 (2 tests)
Validations, actions, settings, hooks, permissions: each edit saved is live; no Draft chip, no Changes/Publish #36597, #36634, this PR DataPillar.saveCancel-36511, ObjectHooksPanel.saveCancel-36511, PermissionMatrixEditor.studioSave-36511, PackageOwdOverviewPanel*, StudioDesignSurface.saveBar-36511 › with no draft pending
Create a flow and save; switch it on: live with no publish #36634, this PR AutomationsPillar.saveCancel-36511 › the switch is live at once; a new flow is published as it is created
Delete a field and save: a confirm names the consequence #36597 DataPillar.saveCancel-36511 › removing a published field asks at Save; DataPillar.destructiveChange-34931
Save something that uses an unsaved new field: refused, says which item to save first, edits kept #36597 DataPillar.saveCancel-36511 › an edit that cannot be sent yet holds the whole Save and names what it needs; a refused publish keeps the edits unsaved
AI left a draft: notice shows; 「放弃 AI 的改动」 goes back to live; Changes count drops this PR DataPillar.aiDraftDiscard-36511 (4 tests), AutomationsPillar.saveCancel-36511 › flow AI block (2 tests)
HotCRM object: an edit is saved and live; visible in /customizations #36597, #36634 DataPillar.baseObjectExtension-28575, DataPillar.pairActions-30088 (writes the .custom pair, then publishes there)
A person mid-edit while the AI edits the same item: say what happens this PR (below) StudioDesignSurface.draftVersionConflict-11773
The PR body lists every editor changed and every test retired or rewritten each PR lists below

A person and the AI edit the same item at once. Neither side's change is dropped silently:

  • The page keeps the person's edits in its buffer until Save. The AI's write goes to the item's draft on the server.
  • On Save, the draft write carries the version the page read (If-Match, or If-None-Match: * when the page read no draft). If the AI wrote in between, the server refuses with a version conflict, and the existing draft-conflict dialog opens.
  • The dialog offers overwrite. It asks once more, then sends the page's version pinned to the version the refusal served, and that version goes live.
  • It also offers reload: the page takes what the AI saved, and the next Save is built on it.
  • Nothing is written until the person picks one.
  • StudioDesignSurface.draftVersionConflict-11773 pins the refusal and both choices (the "two editors", "reload" and "overwrite" cases).

Editors changed in this PR

  • metadata-admin/PermissionMatrixEditor.tsx: permission sets in Studio.
  • studio-design/PackageOwdOverviewPanel.tsx: org-wide default overview.
  • studio-design/StudioDesignSurface.tsx: object / flow / permission creates; the object and flow AI notice and discard.
  • New studio-design/StudioAiDraftNotice.tsx: the flow page's notice line.
  • Field layout: no code change; pinned by a test.

Tests added, rewritten or retired

Added:

  • DataPillar.aiDraftDiscard-36511
  • DataPillar.layoutSaveCancel-36511
  • PermissionMatrixEditor.studioSave-36511
  • PackageOwdOverviewPanel.partialSave-36511: a refused row keeps its edit and is named while the other goes live, with the draft taken back; the controlled-by-parent prerequisite asked after an earlier row went live
  • AutomationsPillar.saveCancel-36511: the flow AI block

Rewritten:

  • CreateItemDialog.oneLabel-11787. The three live creates must say Create; every other dialog must say Save as draft. Two CONTROL tests are included.
  • All nine PackageOwdOverviewPanel* suites. "owd-save" becomes the top-bar studio-save, and the fake clients gain publish/reset.
    • layersUnsaved-11799: its FRESH layers count goes from 0 to 1, the publish.
    • sharedSelect-11865 and refusalClearsOnRevert-26846: a "disabled Save" now reads as "no Save drawn".
  • StudioDesignSurface.changesCount-11787 now drives Create app, which still writes a draft. A permission set no longer leaves one.
  • StudioDesignSurface.draftVersionConflict-11773: it asserts the publish, and its save pins now read If-None-Match: * three times.
  • StudioDesignSurface.accessCreateTaken-26836 and accessGuard: the client gains publish, and the create is asserted to publish.

Label-only (Save as draft → Create):

  • CreateItemDialog.storedName-11792
  • createObjectOwd
  • flowPresets-11861
  • flowStatusTruth-11779
  • heldDataCreate-26845
  • newFlowTrigger-11788
  • sharedSelect-11865
  • createTaken-26917
  • PermissionMatrixEditor.recordScope-26187 and saveSurface-12725: the Studio save harness

Retired: none.

Verification

Rework at head a4ee300c4 (contract review 7096256689). Two things changed: the OWD prerequisite path, and three comments.

cd ui && pnpm exec vitest run packages/app-shell/src/views/studio-design/PackageOwdOverviewPanel
 Test Files  11 passed (11)
      Tests  49 passed (49)
# the new partialSave-36511 suite against the previous PackageOwdOverviewPanel.tsx: 2 of 3 fail (the prerequisite cases); with the fix: 3 passed
pnpm exec turbo run type-check --filter=@object-ui/app-shell :: 69 tasks successful
pnpm check:test-source-alias :: exit 0

Run at head f9e6bada7 (main merged at f590f3eb3):

cd ui && pnpm exec vitest run packages/app-shell/src/views/studio-design packages/app-shell/src/views/metadata-admin/PermissionMatrix* scripts/__tests__/check-i18n-en-drift.test.ts packages/i18n
 Test Files  511 passed (511)
      Tests  5100 passed | 13 skipped (5113)
(the ten suites given warm imports in the last commit, re-run after it: 10 files, 145 tests passed)

pnpm --dir ui run check:i18n-drift            :: exit 0 (every changed designer en value followed by its zh row)
pnpm check:test-source-alias                  :: exit 0
pnpm exec turbo run type-check --filter=...[merge-base] (affected UI packages) :: 105 tasks successful
pnpm --dir ui exec eslint <changed .ts/.tsx>  :: 0 errors

Permission-set work after the merge from main: a file-by-file check confirmed it is all still there.

  • For the permission-only files, each file's added/removed line counts are the exact reverse of PR 2's split commit:
    • PermissionMatrixEditor.tsx +97/-7
    • studioSave-36511 +201
    • recordScope-26187 +15/-7
    • saveSurface-12725 +10/-3
    • accessPairCopy-29674 +3
  • In the shared files (StudioDesignSurface.tsx, en.ts, zh.ts), every permission line the split took out is back.
  • The split commit itself is not in this branch's history.

Acceptance notes

  • Item 6 is wired for objects and flows: the pages that read the draft's per-change provenance (draftChanges[].by). Hooks, actions and permission sets do not read it, so they show no AI line. Their draft still opens and is saved live as the AI's version plus the person's edit. Adding that read is a separate change if wanted.
  • The merge from main (1371428) also carries one changeset wording edit. .changeset/36511-studio-save-cancel.md now says permission sets moved to Save in a later change.
  • DataPillar.panelHold-27629 failed once in an earlier full local run of the studio-design tests. It passes when run alone, and it passed in the final full run above. It looks like a timing flake under load, in code this PR does not touch.

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: n/a.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English (the maintainer brief is the allowed Chinese channel).
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JQwxbWaN9FFV8GYdeZHvuB

…udio-save-cancel

# Conflicts:
#	ui/packages/app-shell/src/views/studio-design/DataPillar.formViewLayout-30057.test.tsx
#	ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx
…ounce in its own module

Claude-Session: https://claude.ai/code/session_01ADHkmPsv99YG2tCHoSe8Nb
Co-authored-by: Claude <noreply@anthropic.com>
…ve for the extension

The customize journey's extension step now asserts the new save: nothing
is written before the top bar's Save, which writes the extension's draft
into the pair and publishes that one item there, leaving no draft.

Claude-Session: https://claude.ai/code/session_01ADHkmPsv99YG2tCHoSe8Nb
Co-authored-by: Claude <noreply@anthropic.com>
…ancel' into claude/issue-36511-studio-save-cancel-2
… pillar and saved by the top bar

Claude-Session: https://claude.ai/code/session_01ADHkmPsv99YG2tCHoSe8Nb
Co-authored-by: Claude <noreply@anthropic.com>
…on are live at once

Claude-Session: https://claude.ai/code/session_01ADHkmPsv99YG2tCHoSe8Nb
Co-authored-by: Claude <noreply@anthropic.com>
…d is live at once

The Access pillar's matrix no longer autosaves a draft: Save writes it and
publishes the set alone; Cancel puts back what the editor last read. The
inspector footers, the access banners and the landing lead say Save, not Publish.

Claude-Session: https://claude.ai/code/session_01ADHkmPsv99YG2tCHoSe8Nb
Co-authored-by: Claude <noreply@anthropic.com>
…ancel' into claude/issue-36511-studio-save-cancel-2
… bar's Save

The flow's saved badge retires with its autosave; a Save re-reads the flow's verdict.

Claude-Session: https://claude.ai/code/session_01ADHkmPsv99YG2tCHoSe8Nb
Co-authored-by: Claude <noreply@anthropic.com>
…udio-save-cancel-2

# Conflicts:
#	ui/packages/app-shell/src/views/studio-design/DataPillar.pairActions-30088.test.tsx
#	ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx
… changes can be dropped on its page

- The Access pillar's record-sharing overview drops its own Save: the top
  bar's Save writes each changed object's draft and publishes it; Cancel puts
  the dials back; a refused object keeps its edit and is named.
- New object and new permission set are published as they are created, like a
  new flow; their dialogs, and the new flow's, say Create.
- An object or a flow holding the AI assistant's unpublished draft says Save
  makes it live too, and offers to discard that one item's draft.
- The field layout's Save and Cancel are pinned.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbWaN9FFV8GYdeZHvuB
…udio-save-cancel-3

# Conflicts:
#	.changeset/36511-studio-save-cancel-2.md
#	ui/packages/app-shell/src/views/studio-design/AutomationsPillar.saveCancel-36511.test.tsx
… in the edited suites

check:test-source-alias asks every edited test file that reaches a lazy
@objectstack/lint or @objectstack/formula import to pay that load during
collection.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbWaN9FFV8GYdeZHvuB
@os-warren os-warren self-assigned this Nov 23, 2026
@github-actions github-actions Bot added size/xl 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 23, 2026

Copy link
Copy Markdown
Collaborator Author

DELIBERATE CORRECTION. This is a correction, not a filename collision. Check Changeset is red on f9e6bada7 by design and stays red until the dispatching seat's record confirms the correction.

The note corrected is .changeset/36511-studio-save-cancel.md. PR 1 of the same card (#36597) added it, and it is still pending. The edit is the last sentence only.

  • Base: "Other Studio editors (flows, hooks, list and form views, navigation, permissions) keep their draft autosave for now."
  • This PR: "Hooks, flows and permission sets moved to the same Save in later changes; list views and navigation keep their draft autosave for now."

The base sentence is no longer true. Hooks and flows moved to Save in #36634, and permission sets move in this PR. Restoring it from the base would publish that false sentence in the release notes. No other pending changeset is changed.


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: f9e6bada7dae37ef5ed98cf0b1576c297a0bcbfd
Local-runs: none
Scope: .changeset/36511-studio-save-cancel.md, .changeset/36511-studio-save-cancel-3.md, ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.tsx, ui/packages/app-shell/src/views/studio-design/PackageOwdOverviewPanel.tsx, ui/packages/app-shell/src/views/studio-design/StudioAiDraftNotice.tsx, ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx, ui/packages/i18n/src/namespaces/studio/en.ts, ui/packages/i18n/src/namespaces/studio/zh.ts, the 29 changed test files (diff read for removed assertions) + ui/packages/app-shell/src/views/studio-design/studioSaveBar.tsx, ui/packages/data-objectstack/src/metadata-client.ts, packages/rest/src/rest-server.ts, packages/rest/src/meta-item-history-routes.ts, scripts/check-changeset-no-major.mjs, scripts/check-empty-changeset.mjs, .claude/skills/pm-dispatch/references/landing-operations.md, AGENTS.md, issues #36511 and #36510, PR comment 7096114323
Security-touching: yes
Rule-change-verified: none

Diff base: f590f3eb322a75259f55e7e604978fe94dd9a3fe (merge-base with origin/main). 37 files, all under .changeset/ and ui/packages/.

① Derived judgments

  • Clause-②: no is true. The diff touches no file under packages/, so nothing in packages/spec/src/** moves.
  • Metadata-protocol: none is true. No schema, no authorable baseline, no server route and no protocol code is in the diff.
  • Package exports: unchanged. No index.ts is in the diff. PermissionMatrixEditPage is the one exported component touched; it gains one optional prop, onSaved. PackageOwdOverviewPanel loses its onDraftSaved prop, and StudioAiDraftNotice is new; neither is exported from @object-ui/app-shell.
  • i18n: en and zh carry the same key set after the change. Six keys added (engine.studio.aiDraft.notice, .discard, .discardTitle, .discardConfirmUnsaved, .discardFailed, engine.studio.createLive), five values reworded, three keys removed (engine.studio.owd.save, .saveNone, .saved). No source file still reads the three removed keys.
  • The AI discard is per item. DataPillar.discardItemDraft calls client.reset('object', name, { state: 'draft', packageId }), where packageId is the address the object's draft was read at (current.addedIn ?? railPackageId). AutomationsPillar.discardFlowDraft calls client.reset('flow', name, { state: 'draft', packageId }) at the package the flow was read at. MetadataClient.reset sends DELETE /meta/:type/:name?state=draft&package=. Neither calls packages.discardDrafts.
  • The server accepts it. META_ITEM_RESET_PARAMS in packages/rest/src/rest-server.ts is ['state', 'dropStorage', 'package', member]. The route is not changed by this PR.

② Semver level

  • .changeset/36511-studio-save-cancel-3.md: @object-ui/app-shell patch and @object-ui/i18n patch. Correct for Metadata-protocol: none, which requires every entry to be patch. Both declaration lines are in the changeset body and in the PR body, and they agree.
  • The new note's claims were checked against the head and hold: object, flow and permission-set creates call publishSavedItem (StudioDesignSurface.tsx lines 6633, 8846, 10779); the app, page, dashboard, report and dataset dialogs still use engine.studio.createDraft; the OWD panel has no Save button of its own; a permission set in Studio blocks the autosave (saveByTopBar).

DELIBERATE CORRECTION confirmed: no — this record is FAIL, so it confirms nothing at this head. The sentence itself is judged true, and that judgment stands for a later head that leaves the sentence unchanged. Note corrected: .changeset/36511-studio-save-cancel.md, last sentence only; no other pending changeset is modified.

③ Boundary flags

  • should-fix 1 — OWD overview, controlled-by-parent confirm after an earlier row went live. PackageOwdOverviewPanel.doSave saves and publishes rows one by one. When a later row answers 409 DESTRUCTIVE_CHANGE, it opens the prerequisite dialog and returns declined from inside the loop, without the load() the normal partial path runs. Rows already published in that pass are live but still shown as "Unsaved". If the person closes the dialog and presses the top bar's Cancel, doCancel puts those dials back to the stale loaded value, so the page shows a record-visibility setting the server no longer holds. Before this PR the early return left only drafts behind; now it leaves live changes. Fix: reload and restore only the unsaved rows' edits before returning, or handle the prerequisite before any row is published. Pin it with a two-row test.
  • should-fix 2 — the OWD partial-refusal path has no test. The code reads correctly: a refused row keeps its edit, saved rows go live, the reason names each refused row, and a refused publish takes back the draft that pass wrote (publishSavedItem with row.hasDraft). But none of the nine OWD suites makes publish or a second row's save refuse; every fake publish resolves. The PR body claims this behaviour. It is new logic on a record-visibility surface and needs a pin.
  • Permission-set refused publish: correct and pinned. doSave calls publishSavedItem(..., hadDraftRef.current). On refusal it returns refused, does not reset the baseline (the grant stays dirty), and the draft the Save wrote is deleted when no draft was pending before. PermissionMatrixEditor.studioSave-36511 asserts PUT, POST, then DELETE ...?state=draft&package=, the box still checked, Save still drawn, and no success toast. A draft that was pending before the Save is kept, as designed.
  • AI discard asks first: yes. Both discards call window.confirm when the page is dirty (dirty for the object, autoDirty for the flow) and send nothing when declined. Pinned in DataPillar.aiDraftDiscard-36511.
  • Person-written draft shows no AI notice: yes. The object line needs agentDraftCount > 0 and the flow line needs a draftChanges entry whose by is copilot or mcp. Both have a CONTROL test.
  • Weakened tests: none found. Removed assertions were re-stated against the top bar: "Save disabled" became "no Save drawn"; layersUnsaved-11799 goes from 0 to 1 layer reads because the object is now published; changesCount-11787 moved to Create app, which still writes a draft; oneLabel-11787 gained a second control.
  • Server-side authority: unchanged. No server file is in the diff. The client uses three existing doors (draft PUT, POST /meta/:type/:name/publish, DELETE ...?state=draft), and each decides for itself who may act. A permission set now goes live through the per-item publish door instead of the package publish door. I did not compare the two doors' gates line by line.
  • note — the per-item discard asks nothing when the page is clean, and it cannot be undone. On an item the AI created and that was never published, the discard removes the item, while the button title says "go back to the live version". The Access pillar's own discard asks, with a separate sentence for a never-published set.
  • note — in the OWD partial path, when the only refused row kept a draft that was pending before, the reload shows the row as clean and the !isDirty effect clears the inline banner. The top bar's toast still carries the reason.
  • note — comment drift: StudioDesignSurface.tsx near line 11382 ("each writes a draft") above createLive; the studio prop doc in PermissionMatrixEditor.tsx ("Presentation only: every write, gate and autosave is the routed page's"), now untrue because studio selects the save path; the "package's atomic Publish promotes" comment above saveVersioned.

④ Design judgment

  • Nothing in the diff contradicts the ruling 「人改一项、点保存、立刻生效。草稿加整包发布只留给 AI」. Human edits to permission sets, the OWD overview and field layout are now buffered and go live on Save. Changes and Publish are left to drafts.
  • note — card item 6 is done for objects and flows only, and the PR body says so. A permission set, a hook, an added action or an OWD row that holds an AI draft publishes that draft with the person's Save and draws no AI line. For a permission set this means AI-written grants go live with an unrelated human grant. The page does open on the draft version, the Access pillar still offers "Discard draft", and the OWD row shows "Unpublished draft" until it is edited. This is a scope limit, not a contradiction of the ruling. The seat should decide whether it needs a follow-up card.
  • No design fork needs the maintainer.

Implemented-by: claude/issue-36511-studio-save-cancel-3
Reviewed-by: session_01JQwxbZeHNsF3RWcWpj7rGj

VERDICT: FAIL

… controlled-by-parent prerequisite

A Save walks the changed rows one by one, each published as it is saved.
When a later row answered 409 DESTRUCTIVE_CHANGE, the Save opened the
prerequisite dialog without reading back the rows it had already
published, so they still showed as unsaved and the top bar's Cancel put
their dials back to a value the server no longer held. The page now reads
the rows back before it asks, keeping only the unsaved rows' edits.

A new suite pins that, the confirm saving the remaining row alone, and the
partial refusal: the refused row keeps its edit and is named, the other
row is live, and the draft the Save wrote is taken back. Three comments
that still described a draft-only save are brought up to date.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbWaN9FFV8GYdeZHvuB
@objectstack-fleet

Copy link
Copy Markdown
Contributor

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: a4ee300c4a52bd4dbf534029517ceeb7b80e6e72
Local-runs: none
Scope: git diff f9e6bada7..a4ee300c4 — ui/packages/app-shell/src/views/studio-design/PackageOwdOverviewPanel.tsx, ui/packages/app-shell/src/views/studio-design/PackageOwdOverviewPanel.partialSave-36511.test.tsx, ui/packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.tsx, ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx + .changeset/36511-studio-save-cancel.md, .changeset/36511-studio-save-cancel-3.md, the round-1 record for f9e6bada7dae37ef5ed98cf0b1576c297a0bcbfd and every file it cites
Security-touching: yes
Rule-change-verified: none

Round 2: one commit on top of the round-1 head, a4ee300c4a ("fix(studio): the OWD overview reads live rows back before it asks the controlled-by-parent prerequisite"). Four files, all under ui/packages/app-shell/. It changes PackageOwdOverviewPanel.doSave, adds one test suite, and rewords three comments. Nothing under .changeset/, packages/ or ui/packages/i18n/ moves. Both round-1 should-fix items are closed. The round-1 judgments not named below carry unchanged, because the code they rest on is not in this delta.

① Derived judgments

  • Carried from round 1, still true: Clause-②: no and Metadata-protocol: none; no package export moves; en and zh keys are in parity; the AI discard is per item (DELETE /meta/:type/:name?state=draft&package=) and the server accepts it (META_ITEM_RESET_PARAMS).
  • The delta adds no export, no i18n key and no route call that round 1 did not already cover. reloadKeeping is a local function inside doSave.

② Semver level

  • Carried: .changeset/36511-studio-save-cancel-3.md is @object-ui/app-shell patch and @object-ui/i18n patch, correct for Metadata-protocol: none. The file is unchanged in this delta, and the fix stays inside what it describes.

DELIBERATE CORRECTION confirmed: yes — .changeset/36511-studio-save-cancel.md, last sentence only. The file is byte-identical to the round-1 head (git diff f9e6bada7..a4ee300c4 -- .changeset is empty), and no other pending changeset is modified.

③ Boundary flags

  • Round-1 should-fix 1: closed. doSave now records each published row in savedNames. On a 409 DESTRUCTIVE_CHANGE after at least one row went live, it calls reloadKeeping before it opens the dialog. The rows read back from the server, and only rows not yet saved keep their edit. Cancel then restores from fresh rows, so it can no longer show a value the server does not hold.
  • Round-1 should-fix 2: closed. PackageOwdOverviewPanel.partialSave-36511 has three tests on a stateful server double: a refused publish (the other row live, the refused row still edited and named, the draft taken back at the package); the prerequisite after an earlier row went live, then Cancel; the confirm's second pass.
  • The tests bind the fix. On the old code, tests 2 and 3 fail at expect(queryByTestId('owd-dirty-a_alpha')).toBeNull(), because the early return did no reload. Test 3 would also see a second save and publish of a_alpha. Test 1 pins behaviour the old code already had; that is the pin round 1 asked for.
  • Second pass scope: correct. After the reload the saved rows are clean, so changed holds only the remaining rows. force is still sent only on rows with relations.length > 0. confirmPrereq reads the doSave of the latest render, so it sees the reloaded rowState.
  • Shared path: the final partial-refusal branch now calls the same reloadKeeping with changed minus savedNames. That is the same set as the old refused list, with the same edits.
  • note — the dials are not disabled while a Save is in flight. load() resets every edit, so a dial changed during the save or the reload is dropped. This was already true of the normal save path before this PR; the fix adds one more reload with the same window. Not introduced here.
  • note — a row refused earlier in the same pass loses its reason line when the prerequisite dialog opens (the pass returns declined). Its edit is kept, and the second pass sends it again.
  • Carried: permission-set refused publish is correct and pinned; both AI discards ask before dropping unsaved edits; a person-written draft draws no AI line; no test was weakened; server-side authority is unchanged (no server file in the PR; the per-item publish door's gates were not compared line by line with the package publish door's).
  • Carried note — the per-item discard asks nothing when the page is clean, and on a never-published AI item it removes the item while the title says "go back to the live version". The dev left this as is.
  • Round-1 comment-drift note: closed. The studio prop doc, the comment above saveVersioned, and the comment above the permission-set dialog's createLive now match the code.

④ Design judgment

  • Carried: nothing contradicts the ruling 「人改一项、点保存、立刻生效。草稿加整包发布只留给 AI」. The fix makes the OWD page say the truth about which rows are live.
  • Carried note — the AI line exists for objects and flows only. An AI draft on a permission set, a hook, an added action or an OWD row goes live with a person's Save and draws no AI line. This is a scope limit the PR body states, not a contradiction of the ruling. The seat decides whether it needs a follow-up card.
  • No design fork needs the maintainer.

Implemented-by: claude/issue-36511-studio-save-cancel-3
Reviewed-by: session_01JQwxbZeHNsF3RWcWpj7rGj

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor

repo:objectstack#1 · os-warren · session_01JQwxbZeHNsF3RWcWpj7rGj

维护者速读

「人改完点保存、立刻生效」这件事的最后一步:权限集、对象访问总览、字段布局也改成右上角「取消 / 保存」,保存即生效;新建对象、流程、权限集时按钮写「创建」,建好就生效。
AI 留下没发布的改动时,页面会提示「保存会一并生效」,也可以只放弃这一项 AI 的改动。人和 AI 同时改一项时,保存会被拦下并让人选「覆盖」或「重新载入」,不会悄悄丢改动。
复核两轮后通过;CI 除一项按规则预期的红灯外全绿,约 1500 行(多为测试),非受管面,席位落地。合并后这张卡关闭。
要你做的:无。

席位核对 — ACCEPT (L1) · repo:objectstack#1 · head a4ee300c · 2026-11-23T09:38Z

  • Shape: Fixes #36511, PR 3 of 3 (PR 1 feat(studio): the object page saves with Cancel and Save in the top bar, live at once #36597 and PR 2 feat(studio): hooks, an installed app's added actions and flows save with Cancel and Save, live at once #36634 merged). 37 files under ui/packages/app-shell/src/views/{studio-design,metadata-admin} and ui/packages/i18n/src/namespaces/studio/{en,zh}.ts; one new patch changeset plus a one-line edit to PR 1's. Tier S (check-governed-merges: 0 of 37 paths governed, +1228/−172 under the human-merge threshold). Clause-②: no, Metadata-protocol: none: no spec, server route or exported contract moves, so no L2 face.
  • Ruling held: epic 专题:Studio 的保存方式和用词(人工修改保存即生效,草稿加整包发布只留给 AI;设置页说业务话;页签和顶部导航重排) #36510, 「人改一项、点保存、立刻生效。草稿加整包发布只留给 AI」. Every human editor named on the card is now save-and-publish one item at a time; the batch publish stays for the AI. The full-metadata item page keeps its own buttons, as the card says.
  • Read: the AI discard sends DELETE /meta/:type/:name?state=draft&package= for that one item, the per-item draft reset the CLI already uses (packages/cli/src/commands/meta/delete-reset-carriers.test.ts), never the package batch discard; it asks first when the page has unsaved edits, and a person's own draft draws neither the notice nor the button. Concurrent person + AI edits stay version-pinned (If-Match / If-None-Match: *) and open the existing conflict dialog; nothing is written until the person picks overwrite or reload (draftVersionConflict-11773). A refused permission-set publish keeps the grant unsaved and takes back the draft it wrote. Live saves send the metadata-refresh pulse instead of a "draft saved" report, so the Changes count re-reads the ledger.
  • Tests: four suites added, every rewritten or label-only suite listed in the body, none retired, none skipped. The OWD suites' rewrites follow the button moving to the top bar (owd-save → studio-save, the fakes gain publish). Thread's local run at this head: 511 files / 5100 tests passed; check:i18n-drift, check:test-source-alias, type-check (105) and ESLint clean.
  • Branch: main merged in at f590f3eb (no rebase); split commit c496e8b7b8 is not an ancestor. K = 2 first-parent commits behind main (< 15), re-read at this ACCEPT.
  • DELIBERATE CORRECTION: Check Changeset is red by design: the PR rewrites the last sentence of PR 1's pending note .changeset/36511-studio-save-cancel.md (declared in 7096114323). The PR also changes code, so the confirmation is the same-head at-tier contract-review PASS 7096452455 at a4ee300c, which quotes the base and new sentence and judges the new one true of main plus this PR; this ACCEPT cites it and names the same note. Round 1 (7096256689, FAIL at f9e6bada) had two should-fix items on the OWD overview: rows already live left marked Unsaved when a later row asks the controlled-by-parent prerequisite, and no partial-refusal pin. Both closed in a4ee300c (reloadKeeping; new PackageOwdOverviewPanel.partialSave-36511, two of whose three tests fail on the old code). Open notes, non-blocking: the AI notice covers objects and flows only; the per-item discard asks nothing on a clean page.
  • Gates: 62 check-runs on a4ee300c: 45 success · 15 skipped · 2 failed, both Check Changeset (jobs 137592717355, 137593198887), the DELIBERATE CORRECTION red by design, confirmed above by the same-head PASS 7096452455. Every Test UI shard green.
  • Landing: ready + auto-merge now. On merge Studio 里人工修改改成「保存」「取消」,保存后这一项立刻生效;不再自动存草稿,不用整包发布 #36511 closes and the seat clears its pm:dispatched.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 23, 2026 09:39
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit 9fa05c6 Nov 23, 2026
61 of 63 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-36511-studio-save-cancel-3 branch November 23, 2026 10:01
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…of 2026-11-21) (objectstack-ai#37045)

<!-- claude-projects-attribution: {"github_login":"huangyiirene"} -->
_Requested by **Irene** · [project
thread](https://claude.ai/code/project/chan_01TJXtQ1tVD26ecLDZxFS67x?thread=cmsg_01TJXtQ1tVD26ecLDZxFS67x8Be2AAcUBhodBsvnWLd3Xs)_

Fixes objectstack-ai#36086

Clause-②: no
Metadata-protocol: none

## 维护者速读
-
用户能看到什么变化:用户无感;十二份内部设计记录在与现行代码不一致的地方各加一条注明日期的补注,原决定文字不动,只有访客模型里一句已被裁决撤回的接口说明照裁决改掉。
- 为什么做:这是本周的设计记录修订合集;AI 席位改代码前会读这些记录,这十五处已与上线代码不一致,会把 AI 带偏。
- 出错会怎样:只改说明文字,不动代码和功能;补注若写错,读记录的 AI 和人会拿到错误说明,整个合并可以直接撤回。
- 要你做什么:审阅后批准一次(设计记录必须由你亲手批)。

## What changes

Seventeen append-only dated notes, for the 15 rows of this week's card
whose code is on `main`, in twelve records. Each note sits directly
under the passage it amends, says what `main` does now, and links its
card and its landing PR. One clause is rewritten, in ADR-0138, as its
row and the ruling on it ask. No other decision text is rewritten,
struck or reordered. Six records whose header indexes their amendments
gain a pointer entry there (ADR-0050, 0066, 0090, 0138, 0151, 0158).

| # | ADR · section | What it said | What `main` does | Landing PR |
Note location |
|:--|:--|:--|:--|:--|:--|
| 1 | ADR-0158 · Open item 12 | Which aggregates count as "raw" is left
to the aggregate card | `sum`, `avg`, `min` and `max` over a
`record`-mode quantity are refused unless the query groups by the
quantity's own `unitField`: ObjectQL aggregate `INVALID_FIELD` / 400,
`summary` field `INVALID_METADATA` / 422, cube measure `INVALID_FIELD` /
400 on each query. `count`, `count_distinct`, a `fixed`-mode quantity
and a plain number are not judged. No error code is added | objectstack-ai#36060 |
under Open item 12; status entry |
| 2 | ADR-0066 · D2 ⑧ | View All and Modify All are the bits that vote
on every field of an object | A set may carry `viewAllFields`: a read
vote, never an edit vote, on every field of the object. The set's own
`readable: false` row beats it. It grants no object access, no record
and no admin posture | objectstack-ai#36085 | under D2 ⑧, after the 2026-11-15 note;
status entry |
| 3 | ADR-0090 · D5 | The high-privilege list refused on an `everyone`
binding | The list gains `viewAllFields` on any object entry | objectstack-ai#36085 |
under D5; status entry |
| 4 | ADR-0090 · D12, condition (a) | No `viewAllRecords` or
`modifyAllRecords` on `'*'` | Condition (a) also refuses `viewAllFields`
on `'*'`; the bit on a named object stays inside the boundary | objectstack-ai#36085 |
under D12's 2026-10-17 amendment |
| 5 | ADR-0151 · D3 | The bits the agent ceiling removes | The clamp
also clears `viewAllFields` on every object entry; assigning a set that
carries it to an account is refused by name | objectstack-ai#36085 | under D3; header
entry |
| 6 | ADR-0050 · Decision 2, the 2026-10-20 note | "a per-list open
mode, if ever wanted, is the list's existing `navigation.mode`" | On an
object's list `navigation.mode` is deprecated and no longer picks how a
record opens: the name opens the full page, the hover icon the side
panel. `none` still means the rows open nothing. A page block still
honours every value | objectstack-ai#35910 | under Decision 2, after the 2026-10-20
note; status entry |
| 7 | ADR-0050 · the same note | The create form is chosen by convention
from the object's form views | The console's record create and edit
forms are the object's own, laid out by `fieldGroups`, less a
`showOnCreate: false` field on a create. An internal form view steers
nothing there. A public form and a named form an action opens keep their
own definition | objectstack-ai#36543 | second note under Decision 2 |
| 8 | ADR-0052 · section 5b, tier 1 | "Opt-in (like Feed Tracking) keeps
the stream from becoming change-noise" | Old and new values show by
default. Off per object with `enable.fieldHistory: false`, per field
with `fieldHistory: false`. An entry serves a field's values only to a
reader who is served that field | objectstack-ai#36399, objectstack-ai#36580, objectstack-ai#36613, objectstack-ai#36641, objectstack-ai#36661
| under tier 1 |
| 9 | ADR-0146 · D1 | Studio is where metadata is edited | A workspace
administrator also edits in the running app: the menu and the pinned
header actions in design mode, a dashboard on its page, a report on its
builder page, a view's settings on the view. Each save is one item's
draft and publish, and writes nothing over a pending draft | objectstack-ai#36397,
objectstack-ai#36437, objectstack-ai#36629, objectstack-ai#36405, objectstack-ai#36644, objectstack-ai#36411, objectstack-ai#36848 | end of D1, after the
2026-11-24 amendment's table |
| 10 | ADR-0146 · D5 (two card rows) | The bridge draws on the app
switcher row and the app bar entry | From 768 px up the entries are two
rows of the app-name menu. "Design layout" turns on design mode. "Edit
app" opens Studio, and reads "View in Studio" for a read-only package.
The page header draws neither | objectstack-ai#36437, objectstack-ai#36621, objectstack-ai#36789 | under D5 |
| 11 | ADR-0146 · D10, the 2026-11-22 note | An extension places only
what it brings; the base's arrangement stays the base's | The App's
paired `.custom` package may declare whole `fieldGroups` and
`relatedLists`. Each key it writes replaces the folded result whole. Any
other package is refused and prescribed `place` | objectstack-ai#36517 | under D10,
after the 2026-11-22 note |
| 12 | ADR-0146 · D10, the same note | (the same) | `actionLayout` is
the third such key. Only the paired `.custom` package writes it on an
extension. Each arm it writes replaces the served arm whole. The server
refuses the shape; the reference is refused by design mode's Save and by
the CLI rule only | objectstack-ai#36629 | second note under D10 |
| 13 | ADR-0138 · D2, the 2026-11-20 amendment | The restriction profile
is served on the unscoped route "and its environment-scoped twin" | Only
the unscoped route is mounted. A request to the twin gets the host's
ordinary not-found answer. A server that mounts the scoped base alone
serves no profile | objectstack-ai#36531 | the clause is rewritten in place; a dated
amendment under it; status entry |
| 14 | ADR-0149 · D3, rules 4 and 5 | Both rules apply to an unknown
word beside a grouping word; the record did not say which governs | Rule
4 governs the unknown word: the labelled fallback, nothing asked. Rule 5
is the rule for a question that names no number. Beside a fallback the
note ends with one conditional sentence | objectstack-ai#36509 | under D3, after the
2026-11-19 note |
| 15 | ADR-0027 · roadmap row M2 | "explicit, batched publish" | In
Studio's designers a person's Save writes the draft and publishes that
one item at once. Drafts and the package's batch publish remain for an
AI's changes | objectstack-ai#36597, objectstack-ai#36634, objectstack-ai#36652 | under the roadmap table |
| 16 | ADR-0037 · the product-boundaries amendment | "Publish remains
the single commit gate shared by every surface" | The publish is the
item's own, issued by the Save itself. The top bar's Publish is drawn
only while a draft is pending | objectstack-ai#36597, objectstack-ai#36634, objectstack-ai#36652 | under that
sentence |
| 17 | ADR-0085 · section 2 | `relatedLists` is "the one place" where
the re-arrange rejection yields | `actionLayout` is the second: a ruled
exception (the maintainer's ruling on objectstack-ai#36635), on the object, with a
`list` arm and a `record` arm | objectstack-ai#36629, objectstack-ai#36815 | under section 2, after
the 2026-11-22 note; dated 2026-11-23 |

The 15 card rows are the 17 lines above: the `viewAllFields` row is
lines 2 to 5, and the two ADR-0146 D5 rows are line 10.

**Rows not carried**

- ADR-0085, the `fieldGroups[].collapse` row: already on `main` through
objectstack-ai#36817. The record carries "Addendum (2026-11-22): on the synthesized
record page the reader folds every titled group", which says what the
row asks for. Nothing is added.

No `scripts/adr-anchors/**` entry moves. No `**Status**:` line changes
in the part the index projects, so `docs/adr/README.md` stays current.

## Why

AI seats read the ADRs before they change code in governed territory
(AGENTS.md Prime Directive objectstack-ai#13). These passages say something `main` no
longer does, so a seat that trusts them is steered wrong. This is the
week's rolling ADR revisions card: its rows land together as one
governed `docs/adr/**` PR and one approval, on the maintainer's word of
2026-11-20 (「adr接受你的建议」).

## Tests

Docs-only diff: no package, test or build input is touched, so no
package test or typecheck applies, and nothing a test pins changes.

## Acceptance notes

- Every row was read against the code on `main` at `a73edb3cd`, not
against PR state. Each landing commit is an ancestor of the branch, and
each note names the file or symbol that makes it true. `main` has moved
once since (`9c57bd283`); that commit touches no `docs/adr/**` file and
no file a note names.
- Where a row's claim is not what `main` does, the note states what
`main` does:
- **ADR-0052.** The row gives the per-field switch as `trackHistory:
false`. On `main` it is `fieldHistory: false`; `trackHistory: false`
reads as unset.
- **ADR-0146 D1.** Three sentences of the row are not written. "The fate
of Studio's Interfaces pillar is still open": the 2026-11-24 amendment
of D1, already on `main`, retires the pillars. "Studio is not changed by
this batch": the same amendment changes it. "Each of these writes the
same paired package": a report's save and a change to an existing view's
settings name no package, and the menu, the action arrangement and a
dashboard go to the item's own package when it is writable. The note
says where each save lands. It does not repeat what that amendment
already says about dashboards and reports opening in the app.
- **ADR-0146 D5.** Both card rows describe a state objectstack-ai#36789 has since
replaced: the row of objectstack-ai#36437 has the page header's button enter design
mode, and the row of objectstack-ai#36621 has the app-name menu's "Edit app" enter it.
On `main` the entry into design mode is "Design layout", and "Edit app"
opens Studio. The two rows are written as one note that states the end
of that sequence.
- **ADR-0027.** The row says later PRs will move the other Studio
editors. They have landed (objectstack-ai#36634, objectstack-ai#36652) and the note cites them. It
quotes the maintainer's own sentence on the epic, not the epic's summary
line.
- **ADR-0037.** The row says a pending draft now means an AI's draft.
Studio's generic item page still saves a person's drafts (its move is
declared by D1's amendment and not built), and the note says so.
- **ADR-0085.** The row says the row menu is queued and not built.
objectstack-ai#36815 built it, and it follows the `record` arm; the note says so. The
`list` arm still has one reader.
- Header entries: added where a record's header indexes its amendments
(ADR-0050, 0066, 0090, 0138, 0151, 0158). Not added to ADR-0146: its
status block lists only the maintainer's in-place amendments, its
2026-11-22 note under D10 has no entry there, and open PR objectstack-ai#36957 edits
that block. Not added to ADR-0027, 0037, 0052, 0085 and 0149, whose
headers hold no such list.
- Dates: every note is dated 2026-11-24, except ADR-0085's, dated
2026-11-23 as its row sets (that record dates its notes by ruling).
ADR-0138's amendment is dated 2026-11-24 and names the ruling's date,
2026-11-22.
- ADR-0151 is `Proposed`; its note follows the form of the dated notes
it already carries.
- The spec docblock sentence the ADR-0085 row mentions landed with
objectstack-ai#36629, so nothing outside `docs/adr/**` is owed.
- Noted, not filed (read-only observations, nothing was run to exercise
them):
- A report's save, and a change to an existing view's settings, from the
running app name no package. For an item of an installed package whose
stored rows are not bound to exactly one package, the server then
addresses the package-unbound row, not the paired `.custom` package
ADR-0146 D2 points customizations to. Whether a door refuses that write
was not measured.
- Two source comments still say design mode is entered from "Edit app"
(the page-actions module header and the design-mode module's gate
paragraph). Comments only.
- Landing tier: Tier H (`docs/adr/**`, governed; the maintainer
approves). The diff is +243 / -5 over 12 files.

## Verification

Read first, by risk:

1.
`docs/adr/0138-guest-model-anonymous-principal-doors-grants-and-organization.md`,
the D2 hunk: the one place earlier text is rewritten.
2.
`docs/adr/0146-studio-designs-setup-administers-one-editor-per-item-paired-customize-package.md`,
the note at the end of D1: the widest claim, where each in-app save
lands.
3. `docs/adr/0066-unified-authorization-model.md`, the note under D2 ⑧,
with its ADR-0090 D12 twin: permission semantics.

Two-minute check: `pnpm check:adr-symbol-anchors` prints a green line
that starts `check-adr-symbol-anchors: 3904 anchors across 160 records`,
and `git diff origin/main...HEAD --stat` shows 12 files, 243 insertions
and 5 deletions.

<details><summary>Gate readings on e5c60bf</summary>

`node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived the same 21 families on `8c705bc2c`
and on `e5c60bff0`. The readings below are the second run, on
`e5c60bff0`, each exit captured before any pipe:

```text
node scripts/check-adr-links.mjs :: exit 0
node scripts/check-adr-links.mjs --self-test :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0
pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 0
pnpm check:adr-anchors :: exit 0
pnpm check:adr-index :: exit 0
pnpm check:adr-symbol-anchors :: exit 0
pnpm check:ci-filter-parity :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:doc-authoring :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:pm-governed-merges :: exit 0
pnpm check:pm-prior-rulings :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:watch-hint-literal :: exit 0
```

On the first run `check:doc-formula-expressions` answered 3,
prerequisite not met, until `formula` and `lint` were built under
`os-verify-lock` (VERDICT command-exit 0, 5 of 5 tasks). `--ran`
reconciliation: 21 derived, 21 run, 0 NOT-MEASURED (a derived zero).
`node scripts/adr-index.mjs --check`: exit 0, the README is current.
`check-commit-card-trailers --range origin/main..HEAD`: exit 0, 2 commit
messages. `overlap-check`: `origin/main` and objectstack-ai#36957 both merge cleanly,
VERDICT clean exit 0. `check-governed-merges --branch`: GOVERNED, 12 of
12 paths on the register, Tier H. Control-byte scan of the twelve files:
0 hits.

</details>

## Human Minimum

- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(No schema touched.)
- [x] 2. Every name I added uses the casing for its kind. (No name
added.)
- [ ] 3. No formatter ran; `pnpm lint` passes. (No formatter ran. `pnpm
lint` was not run locally on this Markdown-only diff; CI judges it.)
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset. (Publishes
nothing: `skip-changeset`.)
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed. (Not touched.)
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [ ] The *Before Submitting* list in CONTRIBUTING.md is done. (Not
walked item by item; the derived gates above are what ran.)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01J8VVAoUbebHyRXKT4GxBTV

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…tire the 18.6.0 i18n keys no code reads (objectstack-ai#37230)

Fixes objectstack-ai#37223

Clause-②: yes (narrowing)
Metadata-protocol: none
Skills-docs: none — no file under skills/ or content/docs names any of
the 67 retired keys (git grep, each key)

## 维护者速读

- 用户无感:合并后主干进入预发布阶段,下一次出版本得到 19.0.0-next.0;同时把 18.6.0 已发布、现已没有代码读取的 67
条界面文案在新大版本里声明退役。
- 属于「界面文案清理」大卡;按你「下一版是大版本 19.0.0」和「走预发布路线」两次裁决,照上一次开大版本(18)时的同款做法。
- 合并本身不发布任何东西:每一次预发布都要你批准才会发出,普通安装拿到的仍是
18.x;若有部署改写过这些文案,改写不再生效;在切出第一个预发布版之前,删掉三个新文件即可撤回。
- 要你做的两件事(按 7158089101 的裁决 A):① 合并前给本单加上 `allow-major` 标签,作为你对 19.0.0
大版本的人工确认;在加标签之前,「Check Changeset」因级别检查(`Metadata-protocol: none` 旁有
`major`)保持红色,属预期,门禁本身不改。② 由你亲自合并本单(和上次开 18 一样,席位只审不合)。

## What changes

1. **`.changeset/pre.json`**, written by `pnpm changeset pre enter next`
(`@changesets/cli` 3.0.3) and committed as the tool wrote it: `{ "mode":
"pre", "tag": "next" }`. ⛔ No `changeset version` output is committed,
and nothing was published.
2. **`.changeset/37223-v19-line-opens.md`**, front matter
`"@objectstack/spec": major`: the v19 line's opening note (rulings
7153326968 and 7153441862), `Clause-②: no`, and its ADR-0087
`not-required (no-migration-prescription)` disposition, in the form the
v18 opening (objectstack-ai#22084) used. Why spec: the protocol lockstep admits
`PROTOCOL_VERSION` one major ahead only in pre mode WITH a pending
`@objectstack/spec` major, and `scripts/sync-protocol-version.mjs`
derives the protocol version from spec's major.
3. **`.changeset/37223-i18n-removed-released-keys.md`**,
`'@object-ui/i18n': major`: the **BREAKING** banner, its own ADR-0087
disposition, and the 「Removed translation keys」 list (67 keys, each
once, with its locales). Two majors in one `fixed` group still give one
19.0.0; the changeset says so.
4. **`ui/packages/i18n/scripts/released-keys-removed.mjs`** (zero
third-party deps): reads the package's published catalogues out of git
at the tag `@object-ui/i18n@18.6.0` and at a ref (default
`origin/main`), and prints every key the tag has that the ref lacks,
grouped by namespace, with the locales it was removed from. Which files
are catalogues is read from the package: `package.json` `exports`, the
all-packs door `src/locales/index.ts`, and each non-pack-shaped
namespace's `index.ts` (`studio`).

No code change, no key restored, no `PROTOCOL_VERSION` edit, no
`allow-major` label, no edit to `.changeset/config.json`, to either
changeset guard, or to `release.yml`.

## Reproduction

```
$ node ui/packages/i18n/scripts/released-keys-removed.mjs
Keys in @object-ui/i18n@18.6.0 absent at origin/main (d15e439): 67
## locales (32)    every one removed from all 11 locales (ar, de, en, es, fr, ja, ko, pt-BR, ru, zh-Hans, zh-Hant)
## studio (35)     every one removed from both locales the namespace ships (en, zh)
```

The 35 Studio keys are the ones the card expected (objectstack-ai#36501, objectstack-ai#36652). The
32 language-pack keys are extra; some of them are also named in earlier
pending `patch` changesets, and this one lists the whole 18.6.0 set once
for the major's notes. Keys that the open PRs objectstack-ai#37169, objectstack-ai#37166 and objectstack-ai#37168
remove are still on main, so they are not reported or declared here. No
non-test file under `ui/`, `apps/` or `packages/` quotes any of the 67
keys.

## The no-major guard reads `pre.json` from the head checkout

| Leg | Reading at `e43e989948` |
|---|---|
| As committed, `node scripts/check-changeset-no-major.mjs --base
origin/main` | exit 0: `Changesets is in pre-release mode (tag: next) —
major bumps are the expected product of an RC window; skipping the
no-major guard.` |
| Control, `.changeset/pre.json` deleted from the working tree only |
exit 1: `This PR introduces changeset(s) that declare a major bump.` |
| Restored with `git checkout HEAD -- .changeset/pre.json` | `git diff
HEAD` empty (0 bytes), blob hash equals the HEAD blob, guard exit 0
again |

## Pins (throwaway detached worktree at `e43e989948`, never committed,
removed after)

- `pnpm changeset version` exits 0. All 112 `fixed`-group members read
`19.0.0-next.0`. `pre.json` is unchanged. `packages/spec/CHANGELOG.md`
and `ui/packages/i18n/CHANGELOG.md` each open `## 19.0.0-next.0` / `###
Major Changes`.
- `node scripts/sync-protocol-version.mjs` (the root `version` script's
next step) rewrites `PROTOCOL_VERSION` in
`packages/spec/src/kernel/protocol-version.ts`: `PROTOCOL_VERSION 18.0.0
→ 19.0.0 (lockstep with @objectstack/spec@19.0.0-next.0)`.
- `protocol-version.test.ts` on that tree: `Test Files 1 passed (1)`,
`Tests 3 passed (3)`.

## `release.yml` in pre mode: `next` gets the prerelease, `latest` stays
18.x

A reading of the files; nothing edited, nothing run.

- Job `publish`, step `Publish to npm + push version tags` runs `pnpm
run release`, which ends in `scripts/release-publish.sh`, which runs
`changeset publish` with no `--tag`.
- `@changesets/cli` 3.0.3 `getReleaseTag`
(`dist/getPublishPlan.mjs:599-601`): with a pre state and no `--tag`,
the tag is `preState.tag` = `next`, unless every published version of a
package is already a `next` prerelease. `dist/publish.mjs` refuses a
custom tag in pre mode.
- `npm view` today: `@objectstack/spec` and `@object-ui/i18n` read
`latest` = `18.6.0`, `next` = `0.0.0-next-20261125013212` (a snapshot,
whose prerelease id is not `next`), so neither is "only-pre". Each
publishes `19.0.0-next.0` to `next`; `latest` stays `18.6.0`.

## Acceptance notes

- **Open question: the level axis stays red.**
`check-changeset-no-major.mjs`'s level axis refuses `Metadata-protocol:
none` beside any entry at `minor` or above (verdict `none-minor`). It
runs whatever the pre mode is, and only `allow-major` skips the step.
Measured at `e43e989948` with a `pull_request` payload carrying this
body's two lines: the no-major guard is exempt (pre mode), and the level
axis exits 1. The v18 opening passed because its body had no
`Metadata-protocol:` line. This PR changes neither the gate nor the
declaration.
- **The version-PR lane refuses the protocol move.** `release.yml`'s
`version-pr` validation marks a pass that rewrites
`packages/spec/src/kernel/protocol-version.ts` as UNVALIDATED and
refuses it, because the example apps declare `engines.protocol: '^18'`
(`examples/app-crm`, `app-showcase`, `app-todo`) and the ADR-0087 D1
handshake would refuse them under 19. So the version step would sync the
constant, but that lane will not carry it: `PROTOCOL_VERSION` → 19.0.0
still needs its own reviewed PR (objectstack-ai#37229), which should also move the
example apps' `engines.protocol`. With this PR's pre mode and pending
spec major, the protocol lockstep admits the constant one major ahead.
- `pnpm check:pm-dispatch-gates` is green with `pre.json` tracked (`2313
cases pass`), and the objectstack-ai#22084 amendment (`CONSUMED_PRERELEASE_EXCLUDED`
in `scripts/check-adr-0087-registration.mjs`) is still on main. No gate
script is edited.
- Landing: the maintainer merges (precedent objectstack-ai#22084); seats review only.
The PR stays draft.

## Verification

Two-minute check: `node scripts/check-changeset-no-major.mjs --base
origin/main` prints the pre-mode exemption line and exits 0; `node
ui/packages/i18n/scripts/released-keys-removed.mjs` prints `67` on its
first line.

Read first:
1. `.changeset/pre.json` and `.changeset/37223-v19-line-opens.md`: the
line opening.
2. `.changeset/37223-i18n-removed-released-keys.md`: the list.
3. `ui/packages/i18n/scripts/released-keys-removed.mjs`, `discover()`.

<details><summary>Local gates at e43e989: 36 commands, all exit
0</summary>

```
exit 0 :: cd ui && node scripts/check-ui-root-lookups.mjs
exit 0 :: node scripts/check-adr-0087-registration.mjs --base origin/main
exit 0 :: node scripts/check-adr-0087-registration.mjs --self-test
exit 0 :: node scripts/check-changeset-fixed.mjs
exit 0 :: node scripts/check-changeset-fixed.mjs --self-test
exit 0 :: node scripts/check-changeset-no-major.mjs --base origin/main
exit 0 :: node scripts/check-changeset-no-major.mjs --self-test
exit 0 :: node scripts/check-closing-keyword-parity.mjs
exit 0 :: node scripts/check-closing-keyword-parity.mjs --self-test
exit 0 :: node scripts/check-comment-mask-corpus.mjs
exit 0 :: node scripts/check-empty-changeset.mjs --base origin/main
exit 0 :: node scripts/check-empty-changeset.mjs --self-test
exit 0 :: node scripts/check-sdui-manifest.mjs
exit 0 :: node scripts/check-sdui-manifest.mjs --self-test
exit 0 :: node scripts/ci/snapshot-next.mjs --self-test
exit 0 :: node scripts/pm/check-governed-queue-guard.mjs --self-test
exit 0 :: node scripts/pm/release-rehearsal-clone.mjs --self-test
exit 0 :: node scripts/release-pending-publish.mjs --self-test
exit 0 :: pnpm check:adr-anchors
exit 0 :: pnpm check:changeset-gate-self-tests
exit 0 :: pnpm check:closed-ceremony-text
exit 0 :: pnpm check:dispatcher-error-vocabulary
exit 0 :: pnpm check:docs-image-tag
exit 0 :: pnpm check:driver-memory-census
exit 0 :: pnpm check:gitlink-declared
exit 0 :: pnpm check:nul-bytes
exit 0 :: pnpm check:pm-dispatch-gates
exit 0 :: pnpm check:published-files
exit 0 :: pnpm check:refd-timer-probe
exit 0 :: pnpm check:registry-log-declared
exit 0 :: pnpm check:rest-log-spy-declared
exit 0 :: pnpm check:skill-identifier-liveness
exit 0 :: pnpm check:test-source-alias
exit 0 :: pnpm check:tier-file-adoption
exit 0 :: pnpm check:undeclared-dep-imports
exit 0 :: pnpm check:watch-hint-literal
```

`node scripts/check-governed-merges.mjs --pr 37230`: `0 of 4 path(s) hit
the register` · `NOT governed` · `368 changed line(s) ≤ 3000`.

Dogfood battery (`!` title): `Test Files 487 passed | 3 skipped (490)`,
`Tests 4128 passed | 68 skipped (4196)`, lock VERDICT command-exit 0,
measured at `e90f9aa1b9`. The commits after it add `.changeset/` files
and rework a script nothing imports.

</details>

---
_Generated by [Claude
Code](https://claude.ai/code/session_01QSeKYkkwuF6UuFtu85Yd5H)_

<!-- signed: repo:objectstack#4 · os-justin ·
session_01QSeKYkkwuF6UuFtu85Yd5H -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
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/xl 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.

Studio 里人工修改改成「保存」「取消」,保存后这一项立刻生效;不再自动存草稿,不用整包发布

2 participants