Skip to content

design mode 3/9: optimistic concurrency for every design-mode commit (two admins editing the same item) #39372

Description

@objectstack-fleet

repo:objectstack@hotlong · hotlong · session_2d709547c1624199b93584a53fbaaca2

Part of epic #39368 (rulings and invariants there).

Depends on child 0. Verify the current behaviour first: this was not read.

Today

  • Drafts pin first-write (ifNoneMatch: '*'), publish pins to the draft just written, and a conflict returns 409 (ui/packages/app-shell/src/views/runtime-metadata-persistence.ts, around 873-877).
  • The menu additionally pins the published version it read (design mode menu save: id-less twins, a 404 stored read, moves into a contributed group, and no version pin #36538; layout/designModeMenuSave.ts:22-24, 46-52).
  • Unverified: whether a dashboard, report, view or object-layout commit pins the published version read when the item was opened. If it does not, the later writer silently overwrites the earlier one. Longer staging (epic) widens that window.

Change

Every design-mode commit pins to the published version read when the item was first staged, the same way the menu does. A conflict marks that item failed in child 0's result list with a clear reason ("changed by someone else since you opened it"), and its staged edits stay.

Acceptance

  • One test per staged kind: change the published document after staging, then save. The item is refused, nothing is overwritten, and the edits stay staged.

Activity

  1. objectstack-fleet commented on Dec 3, 2026

    @objectstack-fleet
    ContributorAuthor

    triage@hotlong · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in area:ux · domain:ui · Feature · p2 · pm:blocked · size M, touched 2026-12-03T16:17Z. Rationale: The maintainer approved the epic's rulings, scope and card split on 2026-12-03 (「按建议整体通过,立专题卡」), so the feature is pre-authorised. Runtime design mode is how the app looks and is used in place (area:ux ①②), and the grade is the epic's p2. Child 3 (optimistic concurrency) depends on child 0; the card says to verify current behaviour first.
    Blocked-by: #39369
    Grade: area:ux · Feature · p2 · admins in design mode · read (epic #39368).

  2. added
    domain:ui
    pm:blocked
    priority:p2
    on Dec 3, 2026
  3. objectstack-fleet commented on Dec 3, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4cypQd6ZDPDmXL5MaWR

    Premise reading for this card's "Unverified" line (read-only, origin/main 5c00c57, zone dm-39368; no claim, the card stays pm:blocked on #39369):

    Kind Pins the PUBLISHED version it read? What it does pin
    dashboard no draft: first write ifNoneMatch: '*', publish draftVersion (DashboardInPageEditor.tsx:513 → saveInPlace → saveAndPublishRuntimeMetadata)
    report no same path (ReportView.tsx:321)
    list view no share/publish via saveAndPublishRuntimeMetadata (objectViewViewSharing.ts:88); draft save pins the loaded draft only (ViewConfigPanel.tsx:222-294)
    header pins no draft pins only (designModeHeaderPinsSave.ts:167,177,187)
    record tabs no draft pins only (recordTabsConfigSave.ts:162,182)
    app menu yes publishedPinOf(layers) → parentVersion (designModeMenuSave.ts ~303/347)

    parentVersion is passed nowhere else under ui/packages/app-shell/src. The server side exists: the REST publish route reads If-Match and forwards parentVersion (packages/rest/src/meta-item-write-routes.ts:499-506, ~555); the metadata service's own comparison was not read. So the premise holds: with no pending draft, a later publish silently overwrites an earlier one. Suggested route (not a ruling): thread the /layers read's published pin through saveAndPublishRuntimeMetadata as parentVersion, as the menu does.

  4. objectstack-fleet commented on Dec 4, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4cypQd6ZDPDmXL5MaWR

    2026-12-04T01:53Z · Unblocked: Blocked-by: #39369 is closed (PR #39433 merged). Back to pm:queue for zone dm-39368.

  5. added
    pm:queue
    and removed
    pm:blocked
    on Dec 4, 2026
  6. objectstack-fleet commented on Dec 4, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4cypQd6ZDPDmXL5MaWR

    2026-12-04T02:00Z · Serial queue in zone dm-39368: the fix threads the published pin through every design-mode save path (dashboard, list view, object layout), which in-flight siblings are rewriting now. It waits for them so it lands once on their final code.

    Blocked-by: #39371, #39376, #39377

  7. added
    pm:blocked
    and removed
    pm:queue
    on Dec 4, 2026
  8. objectstack-fleet commented on Dec 4, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4cypQd6ZDPDmXL5MaWR

    2026-12-04T08:05Z · Blocked-by #39371, #39376 and #39377 are all closed (#39377 by PR #39514, d7ac4aba61). Back to pm:queue for zone dm-39368.

  9. added
    pm:queue
    and removed
    pm:blocked
    on Dec 4, 2026
  10. objectstack-fleet commented on Dec 4, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4cypQd6ZDPDmXL5MaWR

    Claim: PM loop round 4
    Session: session_016WV4cypQd6ZDPDmXL5MaWR
    Account: os-elon-musk
    Area: dm-39368
    Branch: claude/issue-39372-wip
    Worktree: objectstack-issue-39372
    Domain: domain:ui
    Seat: repo:objectstack@os-elon-musk
    File surface: ui/packages/app-shell/src/views/runtime-metadata-persistence.ts (publish pin), the design-mode commit paths per staged kind (layout/designModeObjectSave.ts, layout/designModeHeaderPinsSave.ts, the dashboard and report commits in views/DashboardInPageEditor.tsx / views/reportInPageEdit.ts and their helpers, the shared-view commit in views/objectViewViewSharing.ts), layout/designMode.tsx (result-list reason only), ui/packages/i18n/src/locales/*.ts (new conflict reason keys), tests, a changeset. layout/designModeMenuSave.ts is read as the precedent, not changed.
    Container & model: L, mode:subagent, model: opus (default; no path-derived mandate), effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: n/a — not a defect card
    Thread-read: 7405497508
    Premise: open — the card marks per-kind pinning unverified; the dev measures each staged kind on main 4494911d74 first and reports which already pin.
    Serial constraints cleared: #39519 (same zone, in the merge queue) touches DashboardInPageEditor.tsx refusal code, not the commit; #39561 (same zone) removes locale keys only; #39573 (same zone, claimed now) touches studio-design/ only. First green lands first, the other merges main.
    Prior rulings read: check-prior-rulings.mjs --card 39372: keyword hits only (no ADR decision answers this card's question); epic #39368's rulings and invariants bind.
    Pre-claim lane: domain:ui (ui/**).
    Pre-claim deps: Blocked-by: #39371, #39376, #39377 all closed; #39374 (report commit) merged as 6aa7b9fe84.

  11. added
    pm:dispatched
    and removed
    pm:queue
    on Dec 4, 2026
  12. objectstack-fleet commented on Dec 4, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4cypQd6ZDPDmXL5MaWR
    os-dev-report

    {
     "issue": 39372,
     "status": "done",
     "branch": "claude/issue-39372-wip",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/39609",
     "session": "session_016WV4cypQd6ZDPDmXL5MaWR",
     "premise_still_valid": true,
     "summary": "Premise measured on origin/main 4494911d74, by code read, and confirmed by ablation (the new acceptance tests fail on those sources):\n- Dashboard, report, shared list view and object layout (header pins, record tabs, field groups, highlights; own package or installed extension) all publish UNPINNED to the published row. Only the draft first-write pin and the publish-to-own-draft pin apply, so a second admin's Save silently overwrites the first.\n- The app menu is pinned, but to the row read AT SAVE (prepareAppMenuSave), not at staging. It replays edits by entry id, so a publish between staging and Save is merged, not refused. 'The same way the menu does' therefore holds only in part. The menu is left unchanged, as the claim says.\nFix:\n- saveAndPublishRuntimeMetadata takes ctx.publishPin (If-Match overlayVersion, or If-None-Match * for no row). On a 409 it takes back its own draft, pinned to its draft version. If the take-back succeeds, the published row moved and the new outcome is 'published-moved'. If it fails, the result stays 'pending-draft'.\n- Each kind reads the pin when it opens or first stages the item (new sibling module views/inPlacePublishPin.ts) and carries it with the staged value. On 'published-moved' the item is marked failed with the reason designModeChangedElsewhere ('Changed by someone else since you opened it...'). Its edits stay staged.\n- New i18n key designMode.results.changedElsewhere in all 11 packs (zh-Hant via gen:zh-hant).\n- Deliberate behaviour change: a customization pair that held no row when the item was opened now publishes If-None-Match *. 5 existing expectations were updated to match.\n- PR assignee os-elon-musk is set by pr_create. No review request was sent: the write budget is three writes.",
     "tests": "All at head 558b911905, under os-verify-lock:\n- 85 touched and affected app-shell test files, from ui/ (`pnpm exec vitest run --maxWorkers=2 FILES`): Test Files 85 passed (85), Tests 912 passed (912), VERDICT command-exit 0.\n- New acceptance tests, one per kind, each through the real design mode:\n  - DashboardView.inPageEdit-36372\n  - ReportView.designMode-39374\n  - ObjectView.sharedViewDesignMode-39377\n  - designModeObjectSave-39376, as it.each over own package and installed extension\n  - plus 3 seam tests in runtime-metadata-persistence.test.ts\n- app-shell type-check (tsc --noEmit && tsc -p tsconfig.test.json): VERDICT command-exit 0.\n- i18n: vitest packages/i18n/ gave 110 files passed, 1874 tests passed, 13 skipped. i18n type-check exit 0.\n- Ablation: the 10 implementation files were checked out from 4494911d74 (grep -c publishPin = 0), and the -t 39372 describes were run. Result: 7 failed, 1 passed, 118 skipped. The one that passes is the draft-moved -> pending-draft case, which is unchanged behaviour. The files were restored with git checkout HEAD --; git diff HEAD is empty and every blob hash equals HEAD.",
     "gates": "Local subset at 558b911905: dispatch-gates --commands derived 44 commands. 43 were run, each exit code captured before any pipe, and all 43 exit 0 (e.g. check:nul-bytes, check:published-files, check:type-check-coverage, check:type-check-debt, check:undeclared-dep-imports, check-empty-changeset, check-changeset-no-major, check:changeset-fixed, check-sdui-manifest).\nNOT-MEASURED: pnpm --dir ui exec vitest run scripts/. The memory cgroup OOM-killed the vitest worker on the shared box (dmesg: anon-rss 8.1GB). It was a kill, with no verdict of its own. CI runs it.\n--ran reconciliation: 44 derived, 43 run, 1 NOT-MEASURED, 0 UNRUN.\nPR check-runs at head 558b911905, read once: 24 total, 17 pending, 7 skipped. CI has not converged; that wait is the PM's.",
     "mcp_calls": "0",
     "api_writes": "2 relay writes plus git push: (1) fleet-write pr_create -> POST /repos/objectstack-ai/objectstack/pulls (#39609, draft, assignees os-elon-musk); (2) post-stamped os-dev-report -> POST /repos/objectstack-ai/objectstack/issues/39372/comments. git push of claude/issue-39372-wip (3 pushes).",
     "classifier_refusals": [],
     "open_questions": [],
     "security_findings": "withheld",
     "deviations": "- Files touched beyond the claim's surface (the helpers the claimed kinds commit through): views/objectViewViewCrud.tsx, layout/designModeObjectChange.ts, views/objectExtensionArrangementSave.ts, and the test double views/__tests__/draftPublishDoor-37440.ts.\n- 5 existing test expectations changed on purpose (customization pair now pinned If-None-Match *): DashboardInPageEditor.test.ts (2), DashboardView.inPageEdit-36372, ReportView.shippedReportSave-36716, RecordTabsConfigInstalled-36499.\n- The harness moved three long foreground runs to the background at its 600s cap: the dependency build, the derived-gate loop, and the scripts vitest run. Each was read to completion in the same turn.\n- The harness attribution asks for a review request on the PR. Not sent (write budget).",
     "out_of_scope_findings": [
      "carrier: none - noted, not filed. The app menu (designModeMenuSave) is pinned at Save, not at staging. Its replay-by-entry merges a concurrent publish, so same-entry edits stay last-writer-wins. Not a defect against a declared contract; recorded in the PR's Acceptance notes for epic #39368.",
      "carrier: none - noted, not filed. The object kind reads its pin at the first stage (async), not at selection, so a publish that lands between page load and the first stage is not caught. Recorded in the PR's Acceptance notes."
     ]
    }
  13. objectstack-fleet commented on Dec 4, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4cypQd6ZDPDmXL5MaWR

    2026-12-04T10:00Z · Claim amendment (same session, nothing else changes): File surface, as PR #39609 touches it.
    Added: the helpers the claimed kinds commit through — views/objectViewViewCrud.tsx, layout/designModeObjectChange.ts, views/objectExtensionArrangementSave.ts, the new sibling views/inPlacePublishPin.ts, and the test double views/__tests__/draftPublishDoor-37440.ts. Five existing test expectations change on purpose (a customization pair with no row when the item was opened now publishes If-None-Match: *): DashboardInPageEditor.test.ts (2), DashboardView.inPageEdit-36372, ReportView.shippedReportSave-36716, RecordTabsConfigInstalled-36499. layout/designModeMenuSave.ts is still not touched.
    Premise, measured (dev report 7408104794): dashboard, report, shared list view and object layout all published unpinned on main 4494911d74; the menu pins at Save, not at staging.

  14. objectstack-fleet commented on Dec 4, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4cypQd6ZDPDmXL5MaWR

    2026-12-04T10:21Z · Final head for L1: 558b9119053e3fbe6bcb989eda6feaa7574d79b0 (zone dm-39368, card #39372, PR #39609; claim 7406137476 + amendment, dev report 7408104794). Check runs: 45 success, 15 expected skip, 0 failure; mergeable clean; +795 / -41. No PM commits. Premise measured by the dev and confirmed by ablation: on main 4494911d74 dashboard, report, shared list view and object layout published unpinned; the menu pins at Save (not at staging) and is left unchanged. Deliberate behaviour change: a customization pair with no row when the item was opened now publishes If-None-Match: * (five existing expectations updated). Two out-of-scope notes are in the PR's Acceptance notes (menu pinned at Save; the object kind reads its pin at first stage). L1 requested from thread L1-a.

  15. objectstack-fleet commented on Dec 4, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4cypQd6ZDPDmXL5MaWR

    2026-12-04T10:49Z · Closed by PR #39609 (merged as dee265e820, Fixes #39372).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:uxdomain:uienhancementpriority:p2

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions