Skip to content

AI 问询首页 T6: hide the ai:chat menu entry from people who cannot get an agent (no AI or no seat); the app home falls through to the next entry #37833

Description

@objectstack-fleet

repo:objectstack#1 · os-elon-musk · session_016WV4cwGVgec21LwQTtRY85

Filing gate: ③ maintainer-directed task. Source: maintainer — the AI 问询首页 plan ordered 「立卡派发」 (2026-11-27 02:37Z, quoted in #37788's body), handed to seat repo:objectstack#1 by epic:#5027#1 (mailbox comment 7209013967) and taken on Elon's tap 「全接,开新专区」 (accepted 7210179549). Scope rows: #37788 comment 7210202110 (Fable review §4, copied verbatim by hotlong).
Grading: area:ai · Feature · priority:p2 · size S · reach: every app with an ai:chat entry, opened by someone the deployment or their seat gives no agent.
Dedupe: open-issue search ai:chat hide seat: 3 hits (#37788 #37819 #6015, none a hide rule); "useAiSurface" navigation: 1 hit (#37788).
Blocked-by: #37788

维护者速读

Scope (from #37788 comment 7210202110; AS = ui/packages/app-shell/src)

  • Someone who cannot get the agent does not see the ai:chat item (component ref AI_CHAT_COMPONENT_REF from @objectstack/spec/ui), and the app's home falls to the next nav item instead of an unavailable page.

Evidence (read at objectstack da31daff; re-measure at claim)

  • AI entry points judge per person ("can this person get an agent"), not per deployment (AS/hooks/useAiSurface.ts:79-97).
  • requiresService (packages/spec/src/ui/app.zod.ts:451) covers deployment level only; no existing per-seat hide mechanism was found. Confirm at implementation; if the fix needs a new spec key, stop and report (a new key is its own card).

Acceptance

Activity

  1. added
    priority:p2
    area:ai
    on Nov 27, 2026
  2. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in area:ai · domain:ui · Feature · p2 · pm:blocked · size S; rationale: a follow-on of the AI 问询首页 page (#37788, p1), filed under the maintainer's 「立卡派发」. The filer's p2 stands. It waits on #37788 per the card's own Blocked-by: line. Recorded 2026-11-27T06:19Z.

    Blocked-by: #37788

  3. added
    domain:ui
    pm:blocked
    on Nov 27, 2026
  4. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-elon-musk · session_016WV4cwGVgec21LwQTtRY85

    Claim: PM loop round 2 · area o1-D (unblocked by #37788, PR #37889 merged 10:55Z) · 2026-11-27T11:00Z
    Session: session_016WV4cwGVgec21LwQTtRY85
    Account: os-elon-musk
    Branch: claude/issue-37833-hide-ai-entry
    Worktree: objectstack-issue-37833
    Domain: domain:ui
    Area: o1-D
    Seat: repo:objectstack#1
    File surface: ui/packages/app-shell/src/hooks/useNavMemberGates.ts (or the gate that feeds the already-gated navigation), the app-shell code that reads it, new test file(s) named for this card, one changeset; no packages/spec/src/** (a new spec key ⇒ stop and report) (stop on breach; explain in the report)
    Container & model: S, mode:subagent, model: default tier (dispatch-gates --tier on useNavMemberGates.ts: "no path-derived mandate"), effort: high (reason: the hide mechanism is a design choice the card leaves to measurement, so not mechanical)
    Clause-②: no
    Metadata-protocol: none
    Responsibility: n/a — not a defect card (Feature)
    Thread-read: 7211425805
    Premise: holds — on origin/main e50ab8f useAiSurfaceEnabled (hooks/useAiSurface.ts) answers per person from the access-filtered agent catalog (empty for seat-less users), and resolveLandingRoute (console/AppContent.tsx) lands on the first reachable entry among those the member is shown, with navigation arriving already gated (objectui#12426), so gating the ai:chat entry makes the home fall through.
    Serial constraints cleared: none: overlap-check on a probe branch touching useNavMemberGates.ts, AppContent.tsx and PhoneAppHome.tsx exit 0 against origin/main e50ab8fc91
    Pre-claim lane: ui/packages/app-shell/** ⇒ domain:ui (file ownership only); not governed.
    Pre-claim deps: Blocked-by: #37788 closed (PR #37889 merged).
    Prior rulings read: check-prior-rulings.mjs --card 37833 --terms useAiSurface,requiresService,seat-less: 9 ruling-face lines in AppContent.tsx (#28022 record 6545223246 letter A, declared landing first; objectui#10289 ruling A); none bounds gating an entry the member cannot use. ADR-0057 A4 (merged) leaves "who sees it" to this card.
    Fold-or-serial: not folded — other files than #37832 and #37790; parallel.

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

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-elon-musk · session_016WV4cwGVgec21LwQTtRY85
    os-dev-report

    {
      "issue": 37833,
      "status": "blocked",
      "branch": "claude/issue-37833-hide-ai-entry",
      "pr": null,
      "head_sha": "868742bfccc5f100e8dea595dd43a073151f6fde",
      "session": "session_016WV4cwGVgec21LwQTtRY85",
      "model_effort_actual": "claude-opus-5-5 (Opus tier, not the default tier the claim names: this subagent was launched on it) · effort high",
      "premise_still_valid": true,
      "summary": "Gate implemented and pinned, NOT shippable yet, so no PR. The hide lives in useNavVisibilityAndReads (hooks/useNavMemberGates.ts), the one visible-evaluator every navigation surface is built from (sidebar and so the phone app menu, the app-root landing, the command palette, the nav:menu block): an ai:chat component entry is drawn only when useAiSurfaceEnabled answers enabled, and while the catalog has not answered it is hidden AND reads as pending through readEntry, so AppRootLanding's existing pending-read hold (objectui#13097) waits instead of opening either the page or the next entry. The catalog is asked only while some app in the list (or the gated app) carries an ai:chat entry, through a new optional { enabled } on useAiSurfaceEnabled; with none, nothing is asked. BLOCKER, measured: useAiSurfaceEnabled's isLoading latch never clears for an EMPTY catalog served from useAgents' module cache (30 s TTL). Outside act (browser-like scheduling), a cold mount over the network settles to enabled=false/isLoading=false, but a warm-cache mount renders false/true and stays there: setIsLoading(true) and the cached promise's setIsLoading(false) collapse into one render, so fetchStartedRef is never set. For a seat-less member this gate would hold the app-root landing on its skeleton for good whenever the console already read the catalog (the top-bar robot reads it on every open). The fix belongs in plugin-chatbot useAgents.ts (report settlement, e.g. an additive settled flag), outside the claim's file surface, so I stopped there per the dispatch's breach rule.",
      "tests": "868742bf · lock VERDICT command-exit 0 · pnpm --dir ui exec vitest run packages/app-shell/src/console/__tests__/AppContent.aiChatEntryGate-37833.test.tsx: Test Files 1 passed (1), Tests 12 passed (12). Cases: menu absent on CE (agents 404) and with no seat (empty catalog), menu CONTROL with an agent, CONTROL no ai:chat entry asks nothing; home = next entry on CE and no-seat with the router's pathname log exactly [/apps/policy, /apps/policy/crm_case] (no stop on the page), CONTROL with an agent lands on component/ai/chat with no stop on the next entry; declared landing naming nav_ask passes to the next declared entry; declared landing naming only nav_ask falls to the first shown entry; direct link shows AiUnavailable and is not redirected; two warm-cache cases (green in the act environment only, see blocker). Ablation (committed first, node scripts/ablation-replace.mjs, anchor x1 -> x0, blob 8099e31a -> 0144c38a): gate term replaced by true, 8 failed / 4 passed (12); restore blob == HEAD 8099e31a, git diff HEAD empty. Blocker probe (scratchpad issue-37833/warmCatalogLatch.probe.test.tsx, createRoot with IS_REACT_ACT_ENVIRONMENT=false, not committed): printed 'PROBE cold-last=false/false warm-renders=false/true false/true', exit 1. pnpm --filter @object-ui/app-shell type-check: VERDICT command-exit 0 (tsc --noEmit and tsc -p tsconfig.test.json).",
      "gates": "local: app-shell type-check exit 0; derived list (dispatch-gates --commands --repo objectstack-ai/objectstack at 868742bf, 3 paths, 488 changed lines, under 3000) NOT MEASURED, reason: stopped at the file-surface breach before the PR; no --ran reconciliation; ci: none (no PR).",
      "line_budget": "n/a — no skills/** or ratcheted ledger touched",
      "files_changed": ["ui/packages/app-shell/src/hooks/useNavMemberGates.ts (+88/-4)", "ui/packages/app-shell/src/hooks/useAiSurface.ts (+5/-2)", "ui/packages/app-shell/src/console/__tests__/AppContent.aiChatEntryGate-37833.test.tsx (+389, new)"],
      "deviations": ["useAiSurface.ts edited (optional { enabled } passed to useAgents) — the gate's signal source, read as inside 'wherever measurement puts it'; named here in case the seat reads it as outside the surface", "stopped before the PR: the remaining fix is ui/packages/plugin-chatbot/src/useAgents.ts, outside the claim's surface", "no changeset yet (would come with the PR)", "model actually run: Opus tier, not the claim's default tier"],
      "ci": "none — no PR",
      "dogfood_battery": "n/a — no PR, no ! title, no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "1 — POST issue comment on #37833 (this report) via scripts/pm/post-stamped.mjs; plus git push (not REST)",
      "open_questions": [
        {
          "question": "Where does the empty-catalog latch fix land, so the gate can ship?",
          "options": [
            "A — widen this claim's file surface to ui/packages/plugin-chatbot/src/useAgents.ts (+ its test): useAgents reports settlement for the current apiBase (additive, e.g. settled: boolean), useAiSurfaceEnabled reads it instead of fetchStartedRef; about 15 lines plus a pin that mounts on a warm cache outside act. Fixes the AppAskPage direct-link hang too. Resume from claude/issue-37833-hide-ai-entry@868742bf.",
            "B — file the latch defect as its own card (it stands alone, see out_of_scope_findings), this card Blocked-by it; resume this branch after it lands.",
            "C — ship the gate without a pending state (unknown = hidden, no hold): rejected, a member WITH an agent then lands on the next entry on every cold load and the ai:chat home never opens."
          ],
          "recommendation": "A, because the gate cannot ship without it, the fix is small and additive, and one PR then closes both the gate and the direct-link hang; B costs a second dispatch round for the same 15 lines."
        }
      ],
      "security_findings": "none",
      "out_of_scope_findings": [
        "class: a · reach: public door — a seat-less member opens an app's ai:chat page by URL (/apps/APP/component/ai/chat) after the console has read the agent catalog within its 30 s cache life; the page stays on its blank loading state (app-ask-page-loading) and never draws AiUnavailable · evidence: useAiSurfaceEnabled's fetchStartedRef latch is set only by a render that sees isLoading true; with a cached empty catalog useAgents' setIsLoading(true) and setIsLoading(false) land in one render (probe outside act: warm-renders=false/true false/true); every useAiSurfaceEnabled consumer that mounts after the first read and waits on isLoading is affected (AppAskPage; the gate this card adds) · dedupe words: useAiSurfaceEnabled isLoading latch, fetchStartedRef, agents cache empty, AiUnavailable loading forever",
        "carrier: none · noted, not filed — a catalog that serves agents but not ask (e.g. ask inactive) still shows the entry, since the gate follows useAiSurfaceEnabled.enabled exactly as the page's own unavailable test does; the page's AiUnavailable covers it",
        "carrier: none · noted, not filed — an app whose ONLY entry is ai:chat shows a member with no agent the existing no-access empty state (desktop and phone), the landing's rule for an app that shows them nothing"
      ]
    }
  7. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-elon-musk · session_016WV4cwGVgec21LwQTtRY85

    Claim amendment · area o1-D · 2026-11-27T11:42Z
    File surface: + ui/packages/plugin-chatbot/src/useAgents.ts and its test, + ui/packages/app-shell/src/hooks/useAiSurface.ts (already edited at 868742b). Reason: the dev's report 7217346137 measured that useAiSurfaceEnabled's loading latch never clears when useAgents serves an empty catalog from its module cache, so the gate cannot ship without an additive "fetch settled" signal from useAgents. The same defect leaves a seat-less member on the ai:chat page's loading state on a direct link; it is fixed in this PR and recorded under its Acceptance notes, not filed separately (option A of the report, PM discretion: the fix is the gate's prerequisite).
    Serial constraints cleared: overlap-check on the branch plus useAgents.ts exit 0 against origin/main 73d5e34; shares useAiSurface.ts with #37924 (os-tesla, draft), merges cleanly.
    Resume-from: claude/issue-37833-hide-ai-entry@868742bfccc5f100e8dea595dd43a073151f6fde

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:aidomain:uipm:dispatchedpriority:p2

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions