Skip to content

fix(app-shell): a position created from Setup is saved live and shows in the list - #26269

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-26192-position-create-live
Oct 26, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-26192-position-create-live

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #26192

Clause-②: no
Metadata-protocol: none

Premise (answered first, as the card asks)

Setup → Positions → New carried no packageId. Positions register no EditPage, so New opens the generic MetadataResourceEditPage; its save sends mode: 'draft' and adds a package only under ?package=, and Setup carries none. By the ruling's own condition ("a draft written with none is itself the defect"), the fix is the save path, not a drafts list.

Measured red-first on origin/main df8aac41f2 with the new test below: the create sent one PUT with mode: "draft" and package: null.

What changes

  • ui/packages/app-shell/src/services/builtinComponents.tsx: the position resource registers createLive: true, the key the permission set already carries (objectui#7611). Where the key lives: the permission set's createLive sits in anchors.ts (registerBuiltinAnchors, beside its object anchor), but the position has no anchor entry there; its only registration is the registerMetadataResource({ type: 'position', ... }) call in builtinComponents.tsx, so the key goes there. The registry merges per type, so either home would read the same at runtime; the position's single home keeps it in one place.
  • No change to ResourceEditPage.tsx: its existing rule already writes a createLive type live when no package binding is active, and as a package draft under ?package=.
  • The server admits the live write: the spec's metadata-type registry row for position carries allowRuntimeCreate: true.

Result: a position saved from Setup → Positions → New is written live (one PUT, no mode, no package, If-None-Match: *), shows in the Positions list right after Save, and its detail page reads it at once. Under ?package= the create stays a package draft (ADR-0086 P0/P2).

Out of scope (stated per the claim): later edits of an existing position in Setup still save as drafts, the generic editor's rule for every type. Changing that is a product choice and is not made here.

Tests

New ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.positionCreateLive-26192.test.tsx, after the liveCreate-7611 pattern: the REAL page over a REAL MetadataClient, the position's registration taken from the real builtinComponents module, the transport an in-memory server recording each PUT's mode, package and first-write pin.

  • outside a package: exactly one PUT { name: 'regional_lead', mode: null, packageId: null, ifNoneMatch: '*' }, then the editor opens /metadata/position/regional_lead;
  • under ?package=com.acme.crm (control): one PUT { mode: 'draft', packageId: 'com.acme.crm', ifNoneMatch: '*' }.

Readings (all under scripts/pm/os-verify-lock.sh, shared box):

  • Red first, test commit 739f7ba6 (no fix): Tests 1 failed | 3 passed (4); the live case received "mode": "draft" against expected null. The 7611 permission control passed in the same run.
  • Green at head 41bbd17a: the new test, ResourceEditPage.liveCreate-7611, ResourceListPage.positionGrants-25333, ResourceEditPage.permissionSetsFeed-12126: Test Files 4 passed (4), Tests 14 passed (14), VERDICT command-exit 0.
  • @object-ui/app-shell type-check (both tsconfig.json and tsconfig.test.json) at 41bbd17a: VERDICT command-exit 0, 0 error TS.
  • NOT MEASURED, reason: lock queue-timeout twice behind a whole-package app-shell run held by another worktree. The wider set of 41 app-shell test files that load builtinComponents or name position is left to CI (the UI test jobs).

Gates

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack at 41bbd17a: 35 derived commands, each run with its exit captured before any pipe: 34 exit 0. pnpm check:type-check-debt exit 3 = PREREQUISITE NOT MET (its closure build never got a turn on the verify lock), NOT MEASURED, left to CI Lint & Repo Gates. --ran reconciliation: 35 derived, 35 run, 0 UNRUN. scripts/sdui-manifest.* untouched (check-sdui-manifest exit 0).

Acceptance notes

This PR was authored by session session_01SMps7wq7rBTk53e8KTSEup (domain:ui seat 2 dispatch).


Generated by Claude Code

Red first on origin/main: Setup -> Positions -> New writes a draft with no
package binding, which the Positions list never shows.

Claude-Session: https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup
Co-authored-by: Claude <noreply@anthropic.com>
Register createLive: true on the position resource, the key the permission
set carries: Setup -> Positions -> New outside a package binding now writes
one live PUT, so the position shows in the list right after Save. Under
?package= the create stays a package draft.

Claude-Session: https://claude.ai/code/session_01SMps7wq7rBTk53e8KTSEup
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling labels Oct 26, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

ACCEPT · seat 2 · 2026-10-26T18:17Z · PR #26269 head 41bbd17a (#26192)

check reading
scope 3 files, +170/−0: one createLive: true on the position registration in app-shell/src/services/builtinComponents.tsx, a new page-level pin, a root .changeset/; app-shell has no sdui record
behaviour outside ?package= Setup → Positions → New writes the position live (no mode, no package, If-None-Match: *), as the permission set does (objectui#7611); under ?package= it stays a package draft (ADR-0086); ResourceEditPage.tsx unchanged
red first at 739f7ba6 the live case got mode: draft, 1 failed / 3 passed; green at head with the 7611 / 25333 / 12126 neighbours, 14/14
CI at head 46 success, 8 skipped, no failure (Test UI 1–16, Type Check UI, Build & E2E UI, Lint UI included)
gates 35 derived, 35 run; check:type-check-debt NOT MEASURED locally (lock prerequisite), green in CI as "Type Check · debt ledger"
governance NOT governed, 170 lines
landing git merge-tree against origin/main clean; no commit on main touches builtinComponents.tsx, ResourceEditPage.tsx or registry.ts since the base

Noted, not filed: later Setup edits of a position still save as drafts (the generic editor's rule for every type; a product choice outside this card), and registry.ts's createLive JSDoc still names only a type with its own EditPage. Seat's route: ready + auto-merge.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 26, 2026 18:18
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 26, 2026
Merged via the queue into main with commit d613fdc Oct 26, 2026
55 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-26192-position-create-live branch October 26, 2026 19:27
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/m tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setup Positions: a new position saved as a draft does not appear in the list, with no unpublished badge and no Publish action

2 participants