Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

fix(app-shell): a Studio pillar never accepts an edit or a save on a buffer that is not the open item's (objectui#11272) - #11296

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-11272-buffer-bound-to-loaded-item
Oct 1, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-11272-buffer-bound-to-loaded-item

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #11272
Clause-②: no

Implemented on claude/issue-11272-buffer-bound-to-loaded-item, dispatched by the domain:ui seat 1 PM loop, session https://claude.ai/code/session_0122Knsowci76D2rBWReCzzZ. Triage 5920456880 is the ruling executed; claim 5921156111.

What changed

One rule: a pillar's buffer is bound to the item it was loaded for. It lives once, in useDraftAutoSave, beside the dirty period's since and target from PR objectui#11265.

where before now
useDraftAutoSave bound a dirty period to the item it began on (since / target) also takes loadedFor, the item whose document the buffer holds, in target's spelling. The one check, owned(), now also requires loadedFor === target. The timer, flush and sending all read it. sending returns no claim (null) when the buffer is not the open item's, and the hook returns loaded (the same comparison) for rendering
the four callers none each keeps the identity of its buffer in state, written only where its load installs a buffer: the page inspector (leafKeyOf), the Interfaces nav (app:NAME), Data (object:NAME) and Automations (flow:NAME)
explicit saves the Automations enable switch and the Data column reorder saved whatever the buffer held both ask sending first and send nothing without a claim. Add-field is an edit, so the autosave's timer covers it; it also refuses on !loaded
what a pillar shows during a load the previous item's buffer, editable, under the new item (details below) wherever a pillar reads the buffer, it waits for the open item's own document. The canvas and the Data views show the loading state, the page inspector's rail body is empty, the enable switch and add-field are not offered, and the field count and the "unpublished draft" badge are hidden. After a failed load there is no spinner, only the error banner
the page inspector's branch for a leaf with no editable draft (if (!current || !isEditable)) replaced the buffer with {} and left the dirty flag up stamps {} as that leaf's buffer and clears the dirty flag
the Data pillar's load cleared the dirty flag only at the load's start also clears it as it installs the buffer, as the page inspector's does
where StudioDesignSurface renders DataPillar / AutomationsPillar not keyed key={packageId}, the InterfacesPillar shape
the hook's comment "each caller's load clears it as it installs the new buffer" the parenthesis is removed from the objectui#11232 bullet. A new objectui#11272 bullet says where each caller's dirty flag falls, now that the non-editable branch and the Data load clear it on install

Zone 2, measured

  1. Member 1, the load window. It reproduces at the branch point b4333ab8a3, through the real pillars with the new item's load held. Each pin's first save reading is red with the card's exact write:
    • page inspector: 1 save of page landing carrying home's document (name: home, the hello block) with label 'Typed during load';
    • Automations: 1 save of flow nightly_digest carrying notify_owner's document with status 'obsolete';
    • Data: 1 save of object acme_note carrying acme_task's document (label 'Task', fields title, status, field_3).
  2. Member 2, a package switch. Measured through the real surface and its PackageSwitcher (the route keeps the surface mounted across :packageId).
    • Automations: 1 save of flow notify_owner with packageId com.beta.app.
    • Data, measured here for the first time: 1 save of object acme_task with packageId com.beta.app.
    • Decision: key both at their mount site, not drop the item in the list effect. The hook cannot see this case. The target flow:NAME does not change on a package switch, and the item's load (keyed on current) does not re-run.
    • The list effect is also the same-package re-read path (a publish, a copilot pulse, a create). It must keep the open item there, so changing it would couple two paths. It would also leave the rest of the pillar's package state to reset by hand: the dirty flag, the selection, the Data pillar's load-once ref, its namespace.
    • The key resets all of that by construction, the shape triage named for objectui#11203. The two costs are under Acceptance notes.
  3. Member 3, the non-editable round trip. It reproduces at the branch point: edit page home, open an object leaf, reopen home with its reload held. The result is 1 save of page home with body {}. Whether the server refuses an empty page body is NOT MEASURED: the harness double accepts it, and no backend was run. The hook's comment is corrected, as in the table.
  4. One rule, not three. Measured: it lives once. owned() is the single check for the timer, flush and every save a caller sends itself (through sending). loaded is the same comparison, read at render. No pillar carries its own variant; each pillar only says where its load installs a buffer.
  5. The UI during a load, measured at the branch point.
    • Page inspector: the canvas showed its spinner (it read loading). But the rail kept the page form over home's document ('Home') and the badge, and took edits.
    • Automations: the canvas showed its spinner. But the enable switch stayed, showing and flipping notify_owner's status.
    • Data: nothing in the render read loading; eslint reports that state as "assigned a value but never used" at the base. The header showed acme_task's field count under acme_note, add-field was offered, and the views rendered acme_task's buffer.
    • The smallest change: where a pillar reads the buffer, it renders what it already renders while loading (the spinner; an empty rail body), and the explicit-save controls are not offered.

Pins

They are added to the objectui#11232 pin file, StudioDesignSurface.autosaveSwitch-11232.test.tsx, beside its pins and on its harness: the real pillars, the real registered flow and page previews and inspectors, and a server double that records every save and can hold a load.

  • The load window, one pin per pillar: page form, enable switch, add-field. During the held load each pin uses whatever the pillar still offers, then reads the saves (zero), and records what was shown. After the load it reads zero again, and then the control: one edit saves once, to the item's own document. What was shown during the load is asserted last.
  • A package switch, Automations and Data through the real surface: an edit after the switch saves package B's own item, in B.
  • The non-editable round trip: no {} is sent; the edit after the reload saves home's own document once.

One objectui#11232 pin is adapted, and why. In "a save in flight across a page switch", the middle step typed into home's page form while it was shown under landing during landing's held load. Triage's ruling removes that form ("Nothing is shown under the new item until its own document is in"). So the step now uses whatever the rail offers, and the pin asserts last that nothing was offered. Its save readings are unchanged. Consequence: PR objectui#11265's leg C (the claim's target comparison removed) no longer turns that pin red. See leg C below; the comparison itself is kept, as settled behaviour. No other existing pin is modified.

Ablations (each on a committed head; mutation and restore proven on disk)

Every leg went through objectstack's scripts/ablation-replace.mjs in WRAP mode. Each mutation's anchor count fell by one and its blob moved. Each restore was proven with blob == HEAD 24700a93d71d and git diff HEAD empty. A two-mutation leg nests two WRAPs. The pins import the pillar source by a relative path, so there is no dist/ leg. The source blob is the same at 99b9420504 and f5af9cb962. f5af9cb962 only moves each load-window pin's UI facts to the end. The package-switch and round-trip pins are byte-identical between the two heads.

leg mutation predicted observed
base pins at c1df814853 over the branch-point source the six new pins red 6 failed / 8 passed, the readings in Zone 2
U (f5af9cb962) the hook's loaded forced true (UI half off, refusal kept) the three load-window pins and the adapted in-flight pin red at their UI facts only 4 failed / 10 passed, each at its last assertion (what was shown). Every save reading and the control before it passed, so the refusal holds the zero alone
UA (f5af9cb962) U plus owned() without its loadedFor comparison the three load-window pins red at their first save reading 4 failed / 10 passed: the three at that reading; the in-flight pin at its UI fact, because objectui#11232's since holds its saves
A (f5af9cb962) owned() without its loadedFor comparison, UI kept green: nothing stale is offered 14 / 14 passed. Through these pins the refusal is seen only with the UI half off (U vs UA)
UD (f5af9cb962) U plus the Data load's install-time dirty clear removed the Data pin red at its post-load reading 4 failed: the Data pin at that reading, 1 save of acme_note's own served document, unedited; the other three as in U
K (99b9420504) key={packageId} removed from Data and Automations the two package-switch pins red 2 failed / 12 passed, the branch-point readings
N (99b9420504) the non-editable branch's stamp and dirty clear both removed the round-trip pin red 1 failed / 13 passed: 1 save of home with body {}
N1 / N2 (99b9420504) only the clear, or only the stamp, removed green: each half holds alone 14 / 14 each
C (f5af9cb962) PR objectui#11265's claim target comparison removed green now: loadedFor also refuses there 14 / 14
UC (f5af9cb962) U plus C as U 4 failed, as U: the in-flight pin red only at its UI fact

Two attempts did not run, and their readings are void. K's first attempt was refused by the tool: the replacement was a substring of its anchor, so its count could not rise. UD's first attempt missed its anchor, because the shell quoting left a backslash-n literal. Both were rerun with corrected strings: the K and UD rows above.

Tests and gates

Pass counts are read from vitest's own summary lines. Heavy runs went through the shared verify lock.

  • Build closure: turbo run build --filter='@object-ui/app-shell^...' --concurrency=2, 28 of 28 tasks, exit 0, at 99b9420504. The diff touches no package in that closure.
  • pnpm --filter @object-ui/app-shell type-check (tsc --noEmit && tsc -p tsconfig.test.json): exit 0 at f5af9cb962. tsc -p tsconfig.test.json --listFilesOnly lists the pin file once.
  • The pin file: 14 / 14 at f5af9cb962.
  • packages/app-shell/src/views/studio-design/, every test file (82; the git ls-files listing and the tree agree), in three chunks at f5af9cb962: 29 files / 137 tests, 25 / 137, 28 / 207. That is 82 files / 481 tests passed, 0 failed.
  • Outside readers, every test file outside that directory that git grep -l finds naming StudioDesignSurface, useDraftAutoSave or a pillar: 21 files / 326 tests passed at f5af9cb962. They include StudioRoute.test.tsx, StudioRoute.landingI18n.test.tsx and studio-locale.i18n.test.tsx.
  • eslint as CI runs it, on the two changed source files: 0 errors. StudioDesignSurface.tsx has 17 warnings. The base version has one more, the Data pillar's never-read loading, which is now read. The pin file has none. No type-aware lint is configured, so the diff cannot move another file's verdict.
  • Gates, each exit 0 at f5af9cb962:
    • check:metadata-write-doors, check:new-line-citations (0 new), check-changeset-presence, changeset:check, check:control-bytes;
    • check:changeset-claims: one pending changeset names this file, 6681-declared-lazy-marketplace-routes.md. Read: its static-import claim about SuggestedBindingsPanel still holds, and no import line moved;
    • check:pending-changeset-literals, check:test-path-roots, check:vi-mock-specifiers, check:vi-mock-inherit, check:vi-mock-override-shape, check:i18n-keys;
    • check-governed-queue-guard --test: NOT GOVERNED, 3 paths.
  • main moved six commits past the branch point; none touches studio-design/.
  • NOT MEASURED: CI (the full farm, pnpm lint, e2e) and a browser run.

Acceptance notes

  • The cost of the key on a package switch. On Data and Automations, an edit made less than 1.5 s before a package switch is dropped with the remount, as on Interfaces since PR objectui#11265. A standing live surface request (the pending-changes sheet's object link) is also re-applied on the remount. That is what a pillar-tab round trip does today. Object names belong to one package, so it can only re-open the named object on a return to that package. Read at source, not measured.
  • The claim's target comparison (PR objectui#11265, leg C) has no pin that fails on it alone now. Over the only window in which the buffer still equals what was sent, loadedFor refuses too (legs C and UC). It is kept as settled behaviour.
  • The Data pillar's same-object reload (a publish): an edit taken while the reload is in flight is now dropped with no save. Before, the reload replaced the buffer but left the flag up, so the served document was sent back as a draft. Read at source.
  • A failed load leaves the previous item's buffer in place. The pillars now show only the error there, and refuse every save on it. Read at source, not pinned.
  • Observation, not filed (no write; carrier: none): the Data pillar's "last saved" hint is not reset on an object switch, so it shows the previous object's time under the next one. Read at source.

Generated by Claude Code

…ed for (red first)

Six sequences through the real pillars, each red at the branch point:
the load window on the page inspector, the Automations enable switch and
Data's add-field; Automations and Data across a package switch; and the
page inspector's non-editable round trip. Each ends on the control, an
edit after the load that saves once to its own item.

Claude-Session: https://claude.ai/code/session_0122Knsowci76D2rBWReCzzZ
Co-authored-by: Claude <noreply@anthropic.com>
…buffer that is not the open item's

`useDraftAutoSave` takes `loadedFor`, the item whose document the buffer
holds, set by each caller where its load installs a buffer. Until it is
the target, the timer and `flush` send nothing, `sending` gives no claim
(the Automations enable switch and the Data column reorder ask it first),
and `loaded` is false: the pillars show and offer nothing of the buffer
under the open item (the page form, the enable switch, add-field and the
Data views wait for the item's own document).

The page inspector's non-editable branch stamps its `{}` as that leaf's
and clears the dirty flag, so reopening a page no longer sends `{}` as
its draft. The Data pillar's load clears the dirty flag as it installs.
Data and Automations are keyed by package at their mount site, as
Interfaces is, so a package switch no longer keeps the open item.

Claude-Session: https://claude.ai/code/session_0122Knsowci76D2rBWReCzzZ
Co-authored-by: Claude <noreply@anthropic.com>
…re what was shown

What a pillar showed during the held load is recorded there and asserted
last, so an ablation of the UI half reads through to the post-load and
control readings instead of stopping at the first UI fact.

Claude-Session: https://claude.ai/code/session_0122Knsowci76D2rBWReCzzZ
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

changeset-claim-re-read

⚠️ 1 pending changeset(s) describe a file this change touches

Their bodies publish verbatim into the CHANGELOG at the next release, so this is a request to re-read them against your diff — addressed here because you are the one seat that can answer it without re-deriving anything.

⛔ Nothing here blocks, and nothing here is a verdict on your change. This gate exits 0, is not a required context, and judges name resolution, never meaning: it asked whether a pending body names a file you touched. "Is this sentence still true?" is the one question it will not answer, and the one you are being asked to answer.

.changeset/6681-declared-lazy-marketplace-routes.md

  • names views/studio-design/StudioDesignSurface.tsx → packages/app-shell/src/views/studio-design/StudioDesignSurface.tsx — edited by this change

    Both marketplace chunks were held by CHUNK CO-TENANCY, not by any import of the page: rolldown had parked components/SuggestedBindingsPanel.tsx (statically imported by the eager views/studio-design/StudioDesignSurface.tsx) in the first, and console/marketplace/InstalledListWidget.tsx (bare-imported by the package barrel for its SDUI registration) in the second. An app-shell-eager-leaves group in apps/console/vite.config.ts isolates those co-tenants so the three declared-lazy pages chunk by their own dynamic-only reachability. The console eager closure moves 3180.2 KB → 3171.5 KB gzipped (−8,888 bytes, 48 → 45 eager chunks) with the three per-chunk ceilings unmoved.

Read the paragraph, not the line: both false halves of the objectui#8617 claim sat in one paragraph, and correcting either alone would have left it asserting the same wrong thing.

If a claim did go false, correct the body. That is precedented and prose-only, frontmatter untouched; check-changeset-overwrite.mjs will report the correction as its own case 2 ("correcting a declaration on purpose … legitimate"), which is the intended shape — one gate asks for the read, the other records the write.

Not covered, stated so nobody reads this as more: a born-false claim that spells no line address at all (objectui#9495 coordinated one by ORDINAL — "a grep finds that member first" — and deciding that means reading what the sentence means), a claim spelled as a symbol or a package rather than a backticked file name, and a file named ambiguously.

Compared the checked-out tree with 969d4f291 (merge-base with origin/main): 2 file(s) changed outside .changeset/, read against 1860 pending declaration(s) that publish a body (2472 pending in total). · run

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 330 chunks) 3584.7 KB 3607.4 KB
Main entry chunk (gzip) 150.1 KB 350 KB
Entry file index-QAuSAUve.js —
Status PASS —

The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it.


📦 Bundle Size Report

Package Size Gzipped
app-shell (consoleActionDispatch.js) 0.20KB 0.19KB
app-shell (index.js) 16.88KB 6.25KB
app-shell (runtime-config.js) 20.68KB 7.36KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 10.11KB 3.87KB
auth (ActiveOrganizationStorage.js) 27.95KB 10.04KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 2.07KB 1.00KB
auth (AuthProvider.js) 40.22KB 10.61KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 18.17KB 5.40KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.72KB 2.24KB
auth (SocialSignInButtons.js) 9.70KB 3.93KB
auth (UserMenu.js) 3.39KB 1.21KB
auth (auth-gate-events.js) 1.29KB 0.66KB
auth (authStyles.js) 5.04KB 1.72KB
auth (createAuthClient.js) 40.70KB 10.94KB
auth (createAuthenticatedFetch.js) 8.54KB 3.46KB
auth (index.js) 3.63KB 1.64KB
auth (invitation-status.js) 1.22KB 0.70KB
auth (org-roles.js) 6.66KB 2.78KB
auth (phone-identifier.js) 1.11KB 0.66KB
auth (types.js) 0.59KB 0.35KB
auth (useAuth.js) 5.30KB 1.02KB
auth (useWorkspaceAdminStatus.js) 11.08KB 4.58KB
collaboration (CommentThread.js) 27.13KB 7.95KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.49KB 2.64KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (index.js) 1.68KB 0.73KB
collaboration (useCollaborationTranslation.js) 6.05KB 2.52KB
collaboration (useCommentSearch.js) 1.98KB 0.88KB
collaboration (useConflictResolution.js) 7.75KB 1.86KB
collaboration (useMentionNotifications.js) 1.81KB 0.68KB
collaboration (usePresence.js) 6.33KB 1.84KB
collaboration (useRealtimeSubscription.js) 7.91KB 2.01KB
components (index.js) 570.17KB 136.43KB
core (index.js) 10.00KB 3.96KB
create-plugin (index.js) 27.94KB 9.51KB
data-objectstack (index.js) 228.86KB 63.53KB
fields (index.js) 261.11KB 66.26KB
i18n (LocalizationContext.js) 1.76KB 0.96KB
i18n (builtinAggregateLabels.js) 0.86KB 0.49KB
i18n (currency.js) 2.59KB 1.22KB
i18n (fallbackInterpolation.js) 6.25KB 2.77KB
i18n (i18n.js) 8.87KB 3.64KB
i18n (index.js) 5.24KB 2.27KB
i18n (pickLocalized.js) 9.86KB 3.95KB
i18n (provider.js) 39.40KB 12.91KB
i18n (translateFn.js) 0.20KB 0.18KB
i18n (useDisplayLocale.js) 3.52KB 1.76KB
i18n (useObjectLabel.js) 34.35KB 9.18KB
i18n (useSafeTranslation.js) 5.60KB 2.33KB
layout (index.js) 41.23KB 11.53KB
mobile (MobileProvider.js) 0.92KB 0.49KB
mobile (ResponsiveContainer.js) 0.94KB 0.38KB
mobile (breakpoints.js) 1.51KB 0.70KB
mobile (createOfflineDataSource.js) 5.61KB 1.75KB
mobile (index.js) 1.99KB 0.87KB
mobile (offlineQueue.js) 3.91KB 1.35KB
mobile (pwa.js) 0.97KB 0.49KB
mobile (serviceWorker.js) 1.48KB 0.62KB
mobile (serviceWorkerSource.js) 3.41KB 1.48KB
mobile (useBreakpoint.js) 1.54KB 0.65KB
mobile (useGesture.js) 6.96KB 1.98KB
mobile (useOfflineSync.js) 1.99KB 0.72KB
mobile (usePullToRefresh.js) 6.62KB 2.45KB
mobile (useResponsive.js) 0.72KB 0.42KB
mobile (useSpecGesture.js) 5.52KB 2.10KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 13.86KB 5.00KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 6.52KB 2.26KB
permissions (discardProofCache.js) 1.04KB 0.55KB
permissions (evaluator.js) 8.33KB 3.07KB
permissions (index.js) 0.93KB 0.41KB
permissions (store.js) 0.91KB 0.42KB
permissions (useFieldPermissions.js) 1.28KB 0.53KB
permissions (usePermissions.js) 4.83KB 2.27KB
plugin-ai (index.js) 16.01KB 3.93KB
plugin-calendar (index.js) 52.17KB 15.06KB
plugin-charts (index.js) 84.09KB 22.93KB
plugin-chatbot (index.js) 198.22KB 46.97KB
plugin-dashboard (index.js) 139.27KB 37.26KB
plugin-designer (index.js) 216.32KB 44.56KB
plugin-detail (index.js) 244.72KB 64.45KB
plugin-editor (index.js) 2.23KB 1.05KB
plugin-form (index.js) 173.75KB 44.64KB
plugin-gantt (index.js) 173.03KB 43.07KB
plugin-grid (index.js) 231.61KB 63.61KB
plugin-kanban (index.js) 48.62KB 15.21KB
plugin-list (index.js) 116.63KB 28.97KB
plugin-map (index.js) 23.50KB 7.82KB
plugin-markdown (index.js) 13.88KB 4.80KB
plugin-report (index.js) 44.04KB 12.21KB
plugin-timeline (index.js) 33.05KB 9.67KB
plugin-tree (index.js) 11.20KB 3.89KB
plugin-view (index.js) 90.32KB 22.76KB
providers (DataSourceProvider.js) 0.75KB 0.39KB
providers (MetadataProvider.js) 1.37KB 0.59KB
providers (ThemeProvider.js) 1.90KB 0.85KB
providers (UploadProvider.js) 11.81KB 3.58KB
providers (index.js) 0.45KB 0.23KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.62KB 2.34KB
react (LazyPluginLoader.js) 4.47KB 1.63KB
react (SchemaRenderer.js) 119.55KB 39.23KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 4.50KB 2.06KB
react (schema-input.js) 4.25KB 2.04KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (body-dialect.js) 4.50KB 1.99KB
sdui-parser (codegen.js) 9.45KB 3.76KB
sdui-parser (dashboard-widget-options.js) 3.08KB 1.30KB
sdui-parser (index.js) 6.06KB 2.68KB
sdui-parser (input-type.js) 2.84KB 1.40KB
sdui-parser (parse.js) 25.28KB 7.80KB
sdui-parser (provenance.js) 3.84KB 1.90KB
sdui-parser (types.js) 0.28KB 0.23KB
sdui-parser (validate.js) 21.42KB 7.05KB
types (ai.js) 4.39KB 2.17KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 4.12KB 1.61KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (complex.js) 3.19KB 1.62KB
types (crud.js) 0.20KB 0.18KB
types (dashboard-filter-alias.js) 6.23KB 2.74KB
types (data-display.js) 3.75KB 1.85KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (designer.js) 1.85KB 0.85KB
types (disclosure.js) 0.20KB 0.18KB
types (error-code.js) 1.54KB 0.88KB
types (expression.js) 0.20KB 0.18KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (http-inflight.js) 8.87KB 3.73KB
types (http-retry.js) 4.32KB 2.02KB
types (icon-key-migration.js) 4.26KB 1.63KB
types (index.js) 4.74KB 2.26KB
types (layout.js) 0.20KB 0.18KB
types (managed-by.js) 0.19KB 0.18KB
types (mobile.js) 5.00KB 2.39KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 2.52KB 1.31KB
types (plugin-scope.js) 0.20KB 0.18KB
types (record-components.js) 0.20KB 0.19KB
types (record-semantics.js) 1.28KB 0.67KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (select-option.js) 0.20KB 0.19KB
types (spec-report.js) 4.99KB 1.96KB
types (spec-ui-namespace.js) 0.20KB 0.19KB
types (strict-authoring-face.js) 21.59KB 7.71KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 6.28KB 2.87KB
types (ui-action.js) 8.11KB 3.32KB
types (views.js) 0.20KB 0.18KB
types (widget.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: f5af9cb96223fb4f3b076b5ef71c8ced1e7f8d19
Local-runs: none

① Derived judgments

Inputs: card #11272 (body; triage 5920456880; claim 5921156111; dev report 5922037936), PR #11296 (body, its 3 files, the net diff against main from the merge-base b4333ab8a3: +425/−55), and the head's check-runs, read three times. Read-only beside them, for the binding this PR extends: PR #11265 (merged fc650380d7) and card #11232's comments (triage 5915804318, claim 5918635427, dev report 5919488482, record 5919729760, ACCEPT 5919754584). Nothing built, run or re-run.

Accept sets and public surface: none move. useDraftAutoSave and DraftSend stay module-private to StudioDesignSurface.tsx; the new loadedFor: string option is required, so all four in-file callers pass it or fail Type Check (green on the head). sending now returns DraftSend | null; its only readers are the two in-file explicit saves, and both return on null (toggleEnabled at :4513, doReorderFields at :3574). packages/app-shell/src/index.ts exports StudioDesignSurface and StudioDesignSurfaceProps from this file (:436), not the pillars and not the hook; StudioDesignSurfaceProps and every pillar's props are unchanged (key is React's at the mount site, not a prop). No new i18n key (engine.studio.loading and engine.studio.unpublishedDraft are reused; check:i18n-keys green). Named right.

(a) One rule, read at source. The hook's single check owned() is now since === target && loadedFor === target (:299); the timer's send, flush and sending all go through it, and loaded is the same loadedFor === target read in render (:329). Each caller writes its stamp only where a load installs a buffer: the page inspector at the editable load's install (:2274) and in the non-editable branch (:2245); the Interfaces nav at the app load's install (:2134; the readOnly revert at :1868 re-installs the same app's baseline, so the stamp stays true); Data at its install (:3356); Automations at its install (:4439). No pillar carries a comparison of its own: every pillar-side read (draftLoaded, objLoaded, flowLoaded, the addField guard) is the hook's output, the UI half of one rule. Inside triage's "extend that binding" and its ⛔ on a per-pillar variant. Right.

(b) The three members and their pins.

  • Member 1, the load window. Page inspector: the canvas shows the spinner on !draftLoaded, the rail body renders empty, the badge waits. Automations: the enable switch is not rendered on !flowLoaded and toggleEnabled asks sending first; canvas and inspector wait; badge waits. Data: the views show the spinner on !objLoaded; add-field is not rendered and addField refuses on !objLoaded; the reorder asks sending first and now mutates the buffer only after a claim (right: a refused reorder must not rewrite another object's buffer); field count, header icon, badge and the field-inspector aside wait. After a failed load the pillars show the error with no spinner and nothing offered (disclosed). Pins: one per pillar on the finding(app-shell): switching Studio to another flow or page inside the autosave debounce writes the previous item's whole document into the newly opened one (Automations, page inspector measured); family closure with objectui#11203 #11232 harness, each sequence the card's; the save readings come first (zero during the held load, zero after it), then the control (one save of the item's own document: page landing with LANDING.regions; flow nightly_digest with start Begin and status obsolete; object acme_note with fields body, field_2), and what was shown is asserted last. Red-first at the branch point with the card's exact wrong-document writes (dev-measured, per pin). Ablation U/UA separates the halves: with the UI forced on, the hook's refusal alone holds every zero. Right.
  • Member 2, a package switch. DataPillar and AutomationsPillar get key={packageId} at their mount site (:1402, :1410), the InterfacesPillar shape. The honest fix, not a workaround: the hook cannot see this case (flow:NAME and object:NAME do not change on a package switch, and the item load is keyed on current); the list effect's keep-current is the same-package re-read path (publish, copilot pulse, create) and must keep the open item there; and the state the remount drops is package-scoped (selection, view mode, field selection, the Data load-once ref and namespace, the dirty flag), nothing an author expects to carry across packages. The one cost, an edit under 1.5 s old dropped without a prompt, is the pillar-tab switch's behaviour today and is what fix(app-shell): a Studio switch inside the autosave debounce never writes the previous item's buffer into the one just opened (objectui#11232) #11265 accepted for Interfaces; before this PR that same edit was the wrong-package write. Stated in the changeset. The card's own direction names this shape, and triage's direction cites the Interfaces key as the precedent. Pins: through the real surface and PackageSwitcher, B's own item opens and the edit saves it in com.beta.app (Data measured for the first time); leg K reads both red. Right.
  • Member 3, the non-editable round trip. The branch stamps {} as that leaf's and clears ifDirty (:2244-2247), ending the dirty period as it replaces the buffer, as the card's direction asked. Measured first, as triage asked: 1 save of page home with body {} at the branch point. Pin: zero saves across the round trip with home's reload held, then the control once with HOME.regions; leg N 1 red, N1/N2 each green (each half holds alone, disclosed). The hook's comment is corrected to the callers as they now are. Right.
  • The control is present in all six pins and saves exactly once, to the item's own document. Right.

(c) The deviations.

  1. The adapted finding(app-shell): switching Studio to another flow or page inside the autosave debounce writes the previous item's whole document into the newly opened one (Automations, page inspector measured); family closure with objectui#11203 #11232 pin. Its two save readings are unchanged; the middle step types only if the rail offers a form and asserts last that it did not. The consequence, measured by the dev (legs C, UC): PR fix(app-shell): a Studio switch inside the autosave debounce never writes the previous item's buffer into the one just opened (objectui#11232) #11265's claim-target comparison no longer has a pin that fails on it alone. Read at source: that comparison gates only the dirty-flag clear in each doSave (page :2305, Data :3516, Automations :4472); its effect is observable only while the buffer still equals the sent snapshot, and over that whole window loadedFor differs from target, so the timer, flush and sending refuse regardless and the next install clears the flag. The behaviour the old pin held (no save of home's document as landing's) is still pinned; the mechanism is now doubly held (leg UA: with loadedFor removed, since still holds that pin's saves). A pin that fails on the comparison alone would need two items with byte-identical documents. Acceptable loss; the comparison stays as settled behaviour, as the PR says. Right.
  2. The Data load clears its dirty flag at install. Inside the rule's caller contract (every install clears the flag, which the corrected hook comment now states truthfully) and the claim's file surface; leg UD shows it load-bearing with the UI half off. Its side effect on a same-object reload (a publish): an edit taken during the reload is dropped with no save, where before the install replaced it and the served document was sent back as a draft. The edit was lost both ways; the pointless write is gone. Disclosed. Right.
  3. The Interfaces nav passes loadedFor. Required by the option's type; set only at the app load's install. In-package the stamp lags appName only between setAppName and the install (the first load, or a re-read whose app name changed, which then installs), so the nav autosave, finding(app-shell): Studio's Interfaces nav autosave drops edits it has shown — "Done" inside the debounce leaves the edit unsent, and an Add while a save is in flight is silently lost (the objectui#11124 / objectui#11136 family's nav closure card) #11189's Done-flush and the finding(app-shell): switching package in Studio after discarding an unsaved nav edit makes the nav autosave write the NEW package's unedited navigation as a draft — a draft row on a package the author only opened #11203 pins are unchanged. Right.
  4. sending returns DraftSend | null, 5. addField moved below the hook call (temporal dead zone), 6. badge, field count and header icon gated on loaded: all inside the claim's one file and inside triage's "nothing is shown under the new item until its own document is in". Right.
  5. Commit trailers and the PR footer: outside the diff; noted.

② Semver level

One changeset, .changeset/11272-buffer-bound-to-loaded-item.md, '@object-ui/app-shell': patch (the package is at 17.6.0). patch is right: no export moves (① above), the hook and its claim type are module-private, no prop, schema, accept set or i18n key changes, and what ships is a behaviour fix in an internal Studio view. The changeset's three bullets match the diff: the load window (editor, switch, add-field, reorder, field count and badge wait), the package switch (both pillars start fresh; an edit under 1.5 s old is dropped), the non-editable leaf (the page's unsent edit is dropped and no empty draft is sent). The pending 6681-declared-lazy-marketplace-routes.md names this file; its static-import claim about SuggestedBindingsPanel still holds, no import line moves in the diff (Changeset Claim Re-read reports 1 pending declaration, exit 0). Changeset Bump Policy, Changeset Declaration and Changeset Fixed Group Check are success on the head. Clause-②: no on the PR and in the claim is right for the same reason: nothing a consumer accepts or imports changes.

③ Boundary flags

  • open_questions: none. Deviations 1 to 7: each answered under ①(c).
  • Out-of-scope observation, the Data "last saved" hint. Confirmed at source: savedAt is written only in doSave (:3517) and rendered in the Data header outside the objLoaded gate (:3666), so it shows the previous object's time under the next one until that object is saved; the new key resets it on a package switch only. Not in scope of this card's rule: it is not the buffer, there is no write, and it persists after the load completes, so it is not a load-window member. An Acceptance note is the right carrier as filed; the seat's filing gate asks a measured reach and this is read at source. If the seat wants it filed, the pillar already exposes data-testid="data-saved-at", so one reading after an object switch on the finding(app-shell): switching Studio to another flow or page inside the autosave debounce writes the previous item's whole document into the newly opened one (Automations, page inspector measured); family closure with objectui#11203 #11232 harness meets the gate. Not blocking.
  • Leg A is green (the hook's loadedFor comparison removed, UI kept): the committed pins hold the refusal only through the UI half. Accepted: triage's pin is the sequence's zero-save reading, which holds; the hook half is where the rule lives and is load-bearing for any edit that does not come through the gated UI (a programmatic patch during a load), and the dev measured it alone (U vs UA). Noted for the seat; not blocking.
  • A failed load keeps the previous item's buffer, shows the error only and refuses every save on it. Read at source, not pinned; inside the rule. Accepted.
  • The dropped edit on a package switch (Data and Automations, under 1.5 s, no prompt): accepted as fix(app-shell): a Studio switch inside the autosave debounce never writes the previous item's buffer into the one just opened (objectui#11232) #11265 accepted it for Interfaces; before this PR it was the wrong-package write. Stated in the changeset.
  • The server's answer to an empty page body: not measured; moot, no {} is sent now.
  • main since the branch point: 11 commits, none touches the PR's three paths, so no textual overlap.
  • Scope: 3 files, Fixes #11272, no label writes; the PR is a draft for the seat to flip after its ACCEPT.
  • CI on the head, read at 2026-10-01T00:24:18Z: 43 check-runs, 38 success, 3 skipped (Test (coverage), Test (coverage shard) and dependabot, the expected skips on this PR), 0 failure. Success includes Type Check, Lint, Build & E2E, Spec Main Shape Gate, Test (dist pins), Test (shard 2/8) through Test (shard 8/8), Governed Surface Queue Guard, Line Citation Gate, Control Byte Scan, Inert vi.mock Specifier Check and the four changeset gates. Not concluded: Test (shard 1/8) (in_progress) and the Test roll-up (queued). Not read as pass or fail; the ACCEPT re-reads them. The dev's local readings (type-check exit 0, pin file 14/14, 82 files / 481 tests in studio-design/, 21 outside readers / 326 tests) are the dev's, not CI's.

Implemented-by: claude/issue-11272-buffer-bound-to-loaded-item
Reviewed-by: session_0122Knsowci76D2rBWReCzzZ

VERDICT: PASS

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 1, 2026 00:28
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 1, 2026 00:28
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 1, 2026
Merged via the queue into main with commit 5f2d967 Oct 1, 2026
45 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-11272-buffer-bound-to-loaded-item branch October 1, 2026 00:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

2 participants