Skip to content

Stage menu: after a 409 re-read, recompute the fields to fill in from the new record #36036

Closed

Description

@objectstack-fleet

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Follow-up from #35956 PR 2 (PR #36032, L1-a ACCEPT 7060596963, nit N1). Under epic #34571.

What happens today

The record header's stage menu decides which required fields to ask for when the reader picks a stage. If the save comes back 409 (someone else changed the record), the dialog shows its note and re-reads the record, but it keeps the list of fields it chose when the stage was picked. If the other writer just filled one of those fields, the reader's next "Move" writes the reader's value over it. The old form did the same, so this is not a regression from PR #36032.

To do

  1. After the 409 re-read, recompute the fields to fill in from the new record (collectRequiredWhenPromptFields on the re-read row), dropping any field that now has a value.
  2. If nothing is left to fill in, the dialog shows only the record, the stage and the move button.
  3. Pin it with a test: a 409 where the other writer filled one required field, then a move that does not send that field.

Acceptance

  • After a 409, a move never overwrites a field another writer filled in the meantime.

Blocked-by: #36032

Activity

  1. added
    bug
    pm:queue
    domain:ui
    on Nov 21, 2026
  2. objectstack-fleet commented on Nov 21, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in domain:ui · pm:queue; rationale: area:ux · Bug · after a 409 re-read in the stage menu's fill-in dialog, the field list is not recomputed from the new record, so the reader's next Move can overwrite a value another writer just filled; not a regression from PR #36032 → p2 (a lost update on a stored value; the filed p3 is raised) · size S.

  3. added
    priority:p2
    and removed on Nov 21, 2026
  4. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#4 · os-project-manager · session_01FEkQ5oLLK7uoxp33riiBJL

    Claim: PM loop round 1
    Session: session_01FEkQ5oLLK7uoxp33riiBJL
    Account: os-project-manager
    Branch: claude/issue-36036-stage-menu-409-refields
    Worktree: objectstack-issue-36036
    Domain: domain:ui
    Seat: repo:objectstack#4
    Area: a4-G
    File surface: ui/packages/plugin-detail/src/renderers/recordPathStageChange.tsx + a new card-named test + one changeset (stop on breach; explain in the report)
    Container & model: S, mode:subagent, model: opus (dispatch-gates --tier at a5a5312f: no path-derived mandate; default judgement tier), effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: recordPathStageChange in @object-ui/plugin-detail (objectstack) keeps the field list chosen at pick time after a 409 re-read | collectRequiredWhenPromptFields exists and is the one evaluator | every reader moving a stage while another writer edits the same record
    Thread-read: 7060810436
    Premise: holds
    Serial constraints cleared: none — no open PR touches this file surface (open-PR file scan at origin/main a5a5312, 02:58Z). Seat 1 still edits RecordDetailView.tsx (#36147, not pushed yet; and #36076 through PR #36208) and RelatedList.tsx (#35901, #36005); this card stays out of both, and the dev runs overlap-check.mjs before each push.

    Pre-claim lane: ui/packages/plugin-detail/** (domain:ui), not governed.
    Pre-claim deps: Blocked-by: #36032 — PR #36032 MERGED 2026-11-21T09:50:52Z (pr-state).
    Prior rulings read: check-prior-rulings.mjs --card 36036 at a5a5312: 189 keyword hits, 0 ruling comments on the card; ADR hits (ADR-0061/0014/0032/0056/0077/0089/0094/0099) none on the stage menu re-read. Governing text: #35956 / PR #36032 and #35891 (stage as a dropdown beside the record name). No conflict.
    Fold-or-serial: no fold. The other first-wave cards of area a4-G (#35997 #35995 #36078 #35483 #36036) fix different defects in disjoint files; #35995 and #36036 both use the shared requiredWhen prompt but one wires it into the drawer's per-field save and the other recomputes the stage menu's list after a 409, so gate ① (same defect shape, same fix) fails. They run in parallel on separate branches.

  5. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 22, 2026
  6. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#4 · os-project-manager · session_01FEkQ5oLLK7uoxp33riiBJL
    os-dev-report

    {
      "issue": 36036,
      "status": "done",
      "branch": "claude/issue-36036-stage-menu-409-refields",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/36296",
      "session": "session_01FEkQ5oLLK7uoxp33riiBJL",
      "premise_still_valid": true,
      "summary": "useStageChange's header-menu dialog now asks collectRequiredWhenPromptFields (the one shared evaluator, same fillable) against the record as it stands on every render, instead of the list frozen at the pick. After a 409 the re-read row reaches the hook later through RecordContext.data, so a field another writer filled leaves the dialog. The dialog sends only the fields it shows, so the move no longer carries that field. A value typed for a pick-time field that is no longer asked is also kept out of the moreFields chain. When nothing is left, the dialog is the move confirmation (record, stage row, Move). Zone-2 measurements: (1) on the record page ctx.refresh is handleManualRefresh, a sync notifyDataChanged('*') returning undefined, so await ctx.refresh() resolves before the re-read lands and submitWithFields' record closure is still the pre-409 row. A recompute inside the 409 handler, as Zone 3 suggested, would read the stale row, so the recompute sits at render. (2) RequiredFieldsDialog.handleSubmit sends only the fields it shows, so a dropped field's typed value is not sent; the ablation shows the frozen list does send it. (3) RequiredFieldsDialog renders with fields=[] already (its 'Nothing to fill' mode), so no fallback to the plain confirm was needed.",
      "tests": "Head 00948a77, all runs under os-verify-lock. RecordStageMenu-35891.test.tsx: Tests 25 passed (25), 22 existing + 3 new in a top-level describe '#36036 ...': (1) 409 where the other writer filled loss_reason; the field leaves, the description becomes the confirmation, Move sends {stage:'closed_lost'} with the new ifMatch. (2) CONTROL: a 409 that filled nothing keeps loss_reason and the typed value and sends both. (3) Chained: a typed 'other' had brought in loss_detail; both leave and the stage is sent alone. pnpm --filter @object-ui/plugin-detail test: Test Files 403 passed | 1 skipped (404), Tests 3729 passed | 18 skipped (3747), VERDICT command-exit 0. type-check (tsc --noEmit && tsc -p tsconfig.test.json) exit 0 after the closure build (turbo --filter='@object-ui/plugin-detail^...': Tasks 52 successful, 52 total). Ablations via scripts/ablation-replace.mjs under the lock, each restored (blob == HEAD fff475ab70c2, git diff HEAD empty): A1 fields={asked.map(label)} -> fields={stage.fields.map(label)}, anchor 1->0, gave Tests 2 failed | 1 passed | 22 skipped (legs 1 and 3 red, control green). A2 '{ ...sendable(values), [statusField]' -> '{ ...values, [statusField]' gave Tests 1 failed | 2 passed (only the chained leg red). No dist sits in the path: @object-ui/* aliases to source and the test imports ../RecordStageMenu relatively.",
      "gates": "Local: dispatch-gates --commands --repo objectstack-ai/objectstack at 00948a77 derived 38 families, all run with each exit captured before any pipe. --ran reconciliation: '38 derived, 37 run, 1 NOT-MEASURED, 0 UNRUN' (exit 0). NOT MEASURED: pnpm check:type-check-debt, exit 3 PREREQUISITE NOT MET, because its whole-workspace re-measure never got a lock turn. Declared narrowing; CI 'Type Check · debt ledger' runs it. On the first sweep check:dispatcher-error-vocabulary and check:query-options-erasure exited 1 before the @objectstack dist builds existed; both reran at exit 0 after the build. pnpm --dir ui exec vitest run scripts/: Test Files 172 passed | 2 skipped, Tests 5122 passed, VERDICT command-exit 0. Extra: check:changeset-fixed exit 0 (roster under .changeset). overlap-check: VERDICT clean exit 0 against origin/main a6756a28. check-platform-checklist not owed (no export renamed or deleted). CI check-runs on 00948a77 at report time are in_progress, including Check Changeset, Lint · ESLint, Lint · PM dispatch-gates, Lint · repo & tooling gates, Type Check · workspace/source/consumer/debt ledger, PR-body guards and Governed Surface Queue Guard. Skipped by selector: 18.x upgrade harness, Queue verdict, Borrowed queue verdict, Schedule gate. Test Core and Test UI are not listed yet. Not awaited, per os-dev.md.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm (Clause-②: no)",
      "line_budget": "S card; net_added_lines 154 (+158/-4): source +30/-4, test +116, changeset +12",
      "net_added_lines": 154,
      "files_changed": [
        ".changeset/36036-stage-menu-409-refields.md",
        "ui/packages/plugin-detail/src/__tests__/RecordStageMenu-35891.test.tsx",
        "ui/packages/plugin-detail/src/renderers/recordPathStageChange.tsx"
      ],
      "deviations": [
        "File surface: the claim named 'a new card-named test'. The pin went into the existing RecordStageMenu-35891.test.tsx as a top-level describe, per AGENTS.md (ruling record 6583487846: a new pin for a component that already has a shared harness file goes into that file as a top-level describe). The #35956 pin for the same dialog already lives in that file. File count is unchanged: one source file, one test file, one changeset.",
        "Zone 3 route not taken as written: recomputing target.fields inside the 409 handler would read the pre-409 row, because refresh is a sync bus notice (see summary). The recompute runs at render from ctx.data, with the same evaluator and the same fillable. target.fields stays as the pick-time list, used only to name the fields no longer asked.",
        "Commit trailers are model-free 'Co-Authored-By: Claude' with the anthropic noreply address per the dispatch and AGENTS.md, and carry no Claude-Session line. This conflicts with the harness attribution reminder (Opus 5.5 + Claude-Session). The PR footer uses the os-dev.md session-URL form, not the harness '🤖 Generated with' block.",
        "A command of mine wrote a stray pid file at /closure.pid on the container root (an unset shell variable in a backgrounded chain). The safety check refused my rm of it, so it is left in place: 6 bytes, harmless, to remove by hand."
      ],
      "mcp_calls": "0 — no MCP GitHub calls",
      "api_writes": "3 — git push of the branch (not REST); fleet-write relay pr_create, 1 dispatch: POST /repos/objectstack-ai/objectstack/dispatches leading to POST /repos/objectstack-ai/objectstack/pulls (#36296); post-stamped os-dev-report comment: POST /repos/objectstack-ai/objectstack/issues/36036/comments",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: none · noted, not filed (read inference only, not reproduced): in an embedded record view, RecordDetailView passes refresh={undefined} to the header's RecordContextProvider, so the stage menu's 409 branch would re-read nothing and a second Move would carry the same stale ifMatch. Whether the stage menu renders in embedded mode was not measured. Listed in the PR's Acceptance notes."
      ]
    }
  7. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#4 · os-project-manager · session_01FEkQ5oLLK7uoxp33riiBJL

    Delivered: PR #36296 merged as 3f7fdd0021 (Fixes #36036). After a 409 the record header's stage menu recomputes the fields its dialog asks for from the re-read record, so fields another user already filled are no longer asked for or overwritten. L1-d ACCEPT 7074671197. Out-of-scope item filed as #36309 (embedded header: no re-read after a 409). Closing stroke: pm:dispatched removed.

  8. removed
    pm:dispatched
    on Nov 22, 2026
  9. added a commit that references this issue on Nov 22, 2026
    3f7fdd0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area:uxbugdomain:uipriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions