Skip to content

console list page: a lookup target object is read twice (presence read, then by name), adding one request layer #35306

Closed

Description

@objectstack-fleet

repo:objectstack#5 · os-bill · session_01Utp6CbUb7TcZK1XUAddUmQ

Filing gate: maintainer ruling on #34211, option A, condition 2 (analysis project file objectstack-seat5/area-ux/decision-34211.md). ⛔ Not a claim. Lease ux-2.

What happens (read from code, not yet traced live)

When a list has a lookup field to an object that is outside the package (on the showcase, sys_user), the console first asks whether the object exists with one ?names= read: servedByName → readObjectPresence (ui/packages/app-shell/src/.../appObjectScope.ts:499-512, :522-538). That answer already carries the definition (fetchScopeNames, MetadataProvider.tsx:1529-1546). Once the name is answered as served, readNames(lookups) (appObjectScope.ts:800) asks for it again by name (fetchScopeName → readItem → getObjectSchema, MetadataProvider.tsx:1472-1474, :1031-1038). The pair came in with PR #34299 (presence read to stop 404s). On the showcase list page this is the trailing request layer; about 0.5 s separates the two reads, and the cause is unknown.

The batch scope is kept apart on purpose (MetadataProvider.tsx:182-194: no sortability envelope, cannot tell absent from refused). The fix has to keep that distinction.

Do

Trace it on a real app first (showcase and HotCRM list pages, network panel) and confirm both reads and their order. Then serve the by-name read from the presence answer when it carries everything the by-name path needs, or explain in the PR why it cannot.

Done when

The list page reads a lookup target once. The layer count before and after is measured on both apps, the absent/refused distinction stays pinned, and #34299's no-404 pin still passes.

Activity

  1. added
    priority:p2
    pm:queue
    finding
    domain:ui
    on Nov 19, 2026
  2. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    First touch (rules of #35223): area:ux (page load) · Bug · Impeded (one extra request layer on the list page) · end users, daily · from the #34211 ruling → p2, as filed. Issue type set to Bug.

  3. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ

    Claim: PM loop round 5 · area ux-2 (lease:ux-2, leased by seat 5; condition 2 of ruling 6999004977 on #34211) · 2026-11-19T05:33Z
    Session: session_01Utp6CZrgaiMgTJCnswR6jQ
    Account: os-bill
    Branch: claude/issue-35306-lookup-target-single-read
    Worktree: objectstack-issue-35306
    Domain: domain:ui
    Seat: repo:objectstack#5
    File surface: ui/packages/app-shell/src/console/appObjectScope.ts, ui/packages/app-shell/src/providers/MetadataProvider.tsx, their tests, root .changeset/. ⛔ No packages/spec/**, no server/route change, no change to the batch scope's absent/refused distinction. Stop on breach and report.
    Container & model: M, mode:subagent, model: default — no path-derived mandate, effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: ui app-shell console metadata scope in objectstack reads a lookup target object twice on the list page (?names= presence read, then by name); no platform path dedupes it; every console reader of a list with a lookup to an out-of-package object
    Thread-read: 6999098610
    Premise: holds in code (live trace is step 1 of the order) — on origin/main: servedByName → readObjectPresence (appObjectScope.ts) answers presence from fetchScopeNames, which already carries the definition; readNames(lookups) then calls fetchScopeName → readItem → getObjectSchema for the same name. The #34211 dev measured meta/object?names=sys_user ~1015 ms then meta/object/sys_user ~1571 ms on the showcase list page
    Serial constraints cleared: none — no open PR touches appObjectScope.ts or MetadataProvider.tsx (live read of all open PRs' files at claim time)
    Pre-claim lane: domain:ui (ui/packages/app-shell/**)
    Pre-claim deps: #34211 closed by hand per ruling (PR #35304 merged de8d54975c); #34299's presence read is on main and its no-404 pin must keep passing
    Prior rulings read: console, list, lookup, target, presence, names → ruling 6999004977 (#34211 option A, condition 2 names this card) binds; MetadataProvider.tsx:182-194 batch-scope rationale (absent vs refused) kept; script hits ADR-0099 D3, ADR-0155 D1 are term matches only, none answers this card

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

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ
    os-dev-report

    {
     "issue": 35306,
     "status": "done",
     "branch": "claude/issue-35306-lookup-target-single-read",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/35398",
     "head": "047e7f29",
     "session": "session_01Utp6CZrgaiMgTJCnswR6jQ",
     "premise_still_valid": true,
     "summary": "Traced the showcase list page live first: meta/object?names=sys_user then meta/object/sys_user, 0.64-0.76 s apart, every run. The ?names= item is deep-equal to the by-name item; the by-name envelope's extras (sortability, cascadeDeleteObjects) ride the adapter's copy under symbol keys and never reached a scope. MetadataProvider.readObjectScope now answers a by-name scope read from the definition the batched names scope (presence read) SERVED, bumping once so a reader that asked for the side effect re-renders; a name the presence read left out, has not answered, or failed is still asked by name (absent vs refused unchanged), and the draft preview never takes it. Same rule also removes the by-name re-read of served requiresObject and dashboard-widget objects. HotCRM NOT MEASURED: the permission classifier refused pnpm install in a HotCRM clone.",
     "A1": "HOLDS: showcase /apps/com.example.showcase/showcase_task, 5 before-runs, each ?names=sys_user (L4-L6) then meta/object/sys_user (L9-L11); initiators both React render -> appObjectScope, second via adapter getObjectSchema",
     "A2": "HOLDS: live read, same server+session: ?names= items[sys_user] deep-equal by-name item; by-name envelope adds sortability + cascadeDeleteObjects (symbol-keyed on adapter copy, dropped by cloneServedObject structuredClone); disabledActions present on both (list keyed by object)",
     "A3": "PARTLY: the refusal distinction was pinned only for the by-name read (MetadataProvider.scopeRefusal-13052 (a)/(b), AppContent.disabledPackageDeepLink-13052) and those stay green unchanged; no existing test pinned that a route never takes the batch scope's ABSENCE, so a new describe in scopeRefusal-13052 pins it: presence left out -> by-name read -> OBJECT_PACKAGE_DISABLED named (flat+wrapped), CONTROL plain absence",
     "A4": "CAUSE MEASURED (2 instrumented runs, longtask observer): presence answer lands inside a 390-468 ms main-thread long task; the by-name request starts at the end of a later render task (2022 vs task end 2022; 1954 vs 1955): it waited for the render that consumed the presence answer",
     "layers": {
      "showcase": {
       "before": {
        "requests": [
         26,
         26,
         26,
         26,
         26
        ],
        "chain_depth": [
         11,
         11,
         10,
         12,
         10
        ],
        "card_grouping": 6,
        "sys_user_definition_reads": 2
       },
       "after": {
        "requests": [
         25,
         25,
         25
        ],
        "chain_depth": [
         11,
         12,
         9
        ],
        "card_grouping": 6,
        "sys_user_definition_reads": 1
       }
      },
      "hotcrm": "NOT MEASURED: reason: auto-mode permission classifier refused `pnpm install --frozen-lockfile` in a shallow HotCRM clone (Unauthorized Access); not retried by another route"
     },
     "tests": "head 047e7f29: cd ui && pnpm exec vitest run packages/app-shell/src/console/ packages/app-shell/src/providers/ packages/app-shell/src/hooks/ packages/app-shell/src/views/__tests__/ apps/console/src/ (lock VERDICT command-exit 0): Test Files 847 passed (847), Tests 7852 passed (7852); pnpm --filter @object-ui/app-shell run type-check exit 0. Ablations via scripts/ablation-replace.mjs (source-resolved suites, no dist leg): `if (present) {` -> `if (present && false) {` 16 failed/21 passed incl. the new served-name pin; `if (answeredFromPresence) bump();` deleted 2 failed/16 passed (expected 'sys_invitation' to be 'sys_invitation,sys_user'); both restored blob == HEAD, git diff HEAD empty.",
     "gates": "dispatch-gates --commands on 047e7f29: 38 families; 37 + `pnpm --dir ui exec vitest run scripts/` (171 files passed, 2 skipped) each exit 0, check:type-check-debt first call exit 3 PREREQUISITE NOT MET (lock queue-timeout 99) then re-run under the lock exit 0 'OK — 0 ledger entr(ies) re-measured'; --ran: 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN. pnpm check:new-line-citations (ui) exit 0, 0 new. CI check-runs at report time: all gate-carrying runs in_progress (Lint ·*, Type Check ·*, Governed Surface Queue Guard, Check Changeset, PR-body guards); none concluded.",
     "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
     "line_budget": "n/a — no skills/** or ledger file touched",
     "files_changed": [
      "ui/packages/app-shell/src/providers/MetadataProvider.tsx",
      "ui/packages/app-shell/src/console/appObjectScope.ts (comment only)",
      "ui/packages/app-shell/src/providers/__tests__/MetadataProvider.scopeRefusal-13052.test.tsx",
      "ui/packages/app-shell/src/console/__tests__/appObjectScope-12811.test.tsx",
      "ui/packages/app-shell/src/console/__tests__/AppContent.objectScope-12811.test.tsx",
      "ui/packages/app-shell/src/console/__tests__/AppContent.emptyPackageScope-13046.test.tsx",
      "ui/packages/app-shell/src/console/__tests__/AppContent.packagelessReads-29416.test.tsx",
      "ui/packages/app-shell/src/console/__tests__/AppContent.packagelessRecordRelated-29552.test.tsx",
      "ui/packages/app-shell/src/console/__tests__/AppContent.packagelessRoot-29552.test.tsx",
      "ui/packages/app-shell/src/console/__tests__/AppContent.pageRouteObjects-12980.test.tsx",
      "ui/packages/app-shell/src/console/__tests__/AppContent.dashboardRouteReads-28784.test.tsx",
      "ui/packages/app-shell/src/hooks/__tests__/packagelessChromeScope-12980.test.tsx",
      ".changeset/35306-lookup-target-single-read.md"
     ],
     "deviations": [
      "Fence: test files outside the two named source files' own tests were edited (9 AppContent/hook test files) — they are pins of the old double-read shape, which the claim's 'their tests' covers only loosely; no source file outside the claim was touched",
      "HotCRM install refused by the permission classifier; recorded NOT MEASURED, not routed around",
      "Metadata-protocol: none and Clause-②: no measured as stated (no spec, no key, no value change)",
      "test:repo not run locally (diff touches no repo-project test); declared to CI",
      "Commit trailers: model-free pair as AGENTS.md requires; the harness-suggested model-named Co-Authored-By trailer was not used"
     ],
     "mcp_calls": "0",
     "api_writes": "2 — relay pr_create (POST /repos/objectstack-ai/objectstack/pulls + POST /issues/35398/assignees, one dispatch run 44484209830); post-stamped os-dev-report comment POST /repos/objectstack-ai/objectstack/issues/35306/comments",
     "open_questions": [
      {
       "question": "Close the card on merge with HotCRM unmeasured and the layer count unchanged (6 -> 6) on the showcase?",
       "options": [
        "A keep `Fixes #35306`: the code ask (one read of the lookup target) is met, HotCRM NOT MEASURED is what the dispatch allowed",
        "B switch to `Part of #35306` and have the cloud lane measure HotCRM after release"
       ],
       "recommendation": "A, because the change is app-neutral and the card's 'reads a lookup target once' is measured; the layer number does not move because the trailing group still holds sys_notification_receipt, which is outside this card"
      }
     ],
     "security_findings": "none",
     "out_of_scope_findings": [
      "carrier: none · noted, not filed: the showcase list page's trailing request group is data/sys_notification_receipt, which waits on data/sys_inbox_message (inbox badge); it, not the lookup read, now sets the page's last layer"
     ]
    }
  6. objectstack-fleet commented on Nov 19, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-bill · session_01Utp6CZrgaiMgTJCnswR6jQ

    Closed-out · area ux-2 · 2026-11-19T10:39Z

    reading value
    PR #35398 MERGED through the merge queue as 20badaea24 (Fixes #35306; this card closed completed)
    contract record none owed (not governed); L1-a ACCEPT 7003826152, delta ACCEPT 7006269128 after the main merge

    Delivered: the console answers a by-name object read from the presence batch it already served, so the showcase cold load reads sys_user once instead of twice (26 → 25 requests), and the home page's recent list no longer re-reads each object by name after its batch read.
    Not done here: the HotCRM re-measure stays with the cloud lane (condition 4 of ruling 6999004977); the trailing sys_notification_receipt layer is follow-up #35410.
    State: pm:dispatched removed; card closed.

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

Metadata

Metadata

Assignees

Labels

area:uxdomain:uifindingperformancepriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions