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

  8. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

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

    {
      "issue": 37833,
      "status": "done",
      "branch": "claude/issue-37833-hide-ai-entry",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/37960",
      "head_sha": "4ca23ec3ab67f9f85e981a7ecc1d30d2a67f29f2",
      "session": "session_016WV4cwGVgec21LwQTtRY85",
      "model_effort_actual": "claude-opus-5-5 (Opus, the fleet's default tier) · effort high",
      "premise_still_valid": true,
      "summary": "A member who cannot get an agent no longer sees an app's ai:chat entry. This covers a deployment with no AI (catalog route 404, an empty catalog, or a failed read) and a member with no seat (empty catalog). The hide applies on every surface whose visible-evaluator is built in useNavVisibilityAndReads (useNavMemberGates.ts): the sidebar and so the phone app menu, the app-root landing, the palette and nav:menu. The home falls to the next shown entry. Loading choice: until the catalog answers, the entry is hidden and readEntry reports it as pending, so the landing's existing pending-read hold (objectui#13097) shows the skeleton and lands once, never opening the page and then the next entry (or the reverse). A declared landing naming the entry is passed over by resolveDeclaredLandingRoute, as for any entry the member is not shown: the next declared entry that holds lands, else the first shown entry. A direct link still draws AiUnavailable. The catalog is read only while some app carries an ai:chat entry (useAiSurfaceEnabled({ enabled })). The prerequisite latch fix (claim amendment 7217405838, option A) is included: useAgents returns an additive settled flag per apiBase, and useAiSurfaceEnabled reads it instead of fetchStartedRef, so an empty catalog answered from the cache no longer reads as loading for ever. That defect is recorded under the PR's Acceptance notes as fixed here and was not filed. useAgents consumers checked by grep (useAiSurface, useAskAiHandler, AiUsageIndicator, ChatDockConversation, ChatDock, AiChatPage, AppAskPage, HomePage): each destructures fields that are unchanged, and the only new field is settled.",
      "tests": "Head ce385345: vitest run over useAgents.settledWarmCache-37833, useAiSurface.warmCatalog-37833 and AppContent.aiChatEntryGate-37833 gave Test Files 3 passed (3), Tests 19 passed (19). Reverse check: useAgents.ts and useAiSurface.ts were put back to their 868742bf content in the working tree only (settled hits 0/0, latch hits 3); result Tests 5 failed, 14 passed (19). The five red cases: useAgents (a) cold, (b) warm-cache empty and (c) failed read; the hook's warm-catalog case (renders false/true); the page's warm direct link (AiUnavailable never drawn). Restored with git checkout HEAD; git diff HEAD empty; both blobs equal HEAD. Gate ablation at 868742bf (scripts/ablation-replace.mjs, anchor hits 1 to 0): the aiChat term replaced by true gave 8 failed, 4 passed (12); restore blob equal to HEAD. Wide run at ce385345 (plugin-chatbot/ plus app-shell hooks/, console/, layout/, chrome/, views/__tests__/ and providers/): Test Files 1 failed, 807 passed (808); Tests 3 failed, 7025 passed (7028). The failing file was HomePage.openMarksRead ('No useAiSurfaceEnabled export is defined on the mock'), a stale fixture caused by this change; repaired in 4ca23ec3, where it shows Tests 3 passed (3). Type-check: pnpm --filter @object-ui/app-shell --filter @object-ui/plugin-chatbot run type-check, both Done, lock VERDICT command-exit 0. Note: the app-root warm-cache landing case also passes on the pre-fix code in this harness; the discriminating pins are the hook-level and page-level ones.",
      "gates": "dispatch-gates --commands (39 families) ran at ce385345. 38 check and script families exited 0, except check:type-check-debt: its first run exited 3 while queued behind the verification lock, and the re-run exited 0 (re-measure OK, surplus none). pnpm --dir ui exec vitest run scripts/ gave Test Files 172 passed, 2 skipped. --ran reconciliation: 39 derived, 39 run, 0 NOT-MEASURED, 0 UNRUN. Re-run on the final head 4ca23ec3: check:nul-bytes, check:test-source-alias, check:cross-package-test-inputs and check:undeclared-dep-imports, all exit 0. CI on PR #37960 at 4ca23ec3, read about a minute after create: Check PR Size success, Governed Surface Queue Guard success, PR-body guards success; Lint, Type Check, Test UI, Live E2E UI and Check Changeset in_progress.",
      "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 (+10/-13)",
        "ui/packages/plugin-chatbot/src/useAgents.ts (+14/-2)",
        "ui/packages/app-shell/src/console/__tests__/AppContent.aiChatEntryGate-37833.test.tsx (+475, new)",
        "ui/packages/app-shell/src/hooks/__tests__/useAiSurface.warmCatalog-37833.test.tsx (+91, new)",
        "ui/packages/plugin-chatbot/src/__tests__/useAgents.settledWarmCache-37833.test.tsx (+113, new)",
        "ui/packages/app-shell/src/hooks/__tests__/useAiSurface.test.ts (+11/-2)",
        "ui/packages/app-shell/src/console/home/__tests__/HomePage.openMarksRead.test.tsx (+6/-1)",
        ".changeset/37833-hide-ai-chat-entry-without-agent.md (+20, new)"
      ],
      "deviations": [
        "Two test files outside the amended surface were edited. useAiSurface.test.ts, the test of useAiSurface.ts: its mocked useAgents result carries settled. HomePage.openMarksRead.test.tsx: its useAiSurface mock was stale, and this change turned it red (the Home bell's roster now asks useAiSurfaceEnabled through useNavMemberGates). os-dev.md says a red that is this change's consequence is fixed in the same PR; that conflicts with the order's stop-on-breach rule, so it is named here.",
        "New test files were added in useAiSurface.warmCatalog-37833 and useAgents.settledWarmCache-37833 rather than as describes in the existing harnesses: useAiSurface.test.ts mocks useAgents, so it cannot exercise the real cache, and the useAgents test harness runs under act, which hides the defect.",
        "The wide test run is a declared narrowing of app-shell's suite to the directories that read the gate or the catalog; Test UI in CI runs all of it.",
        "Merged origin/main into the branch at resume (merge commit 3f3c961c), per the Resume-from rule."
      ],
      "ci": "PR #37960 head 4ca23ec3: in_progress (Check PR Size, Governed Surface Queue Guard and PR-body guards success; the rest running)",
      "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "4 — POST issue comment on #37833 (first report, 7217346137, post-stamped); pr_create (relay run 46004481429, PR #37960, assignee os-elon-musk, read-back identical 9197 bytes); POST issue comment on #37833 (this report, post-stamped); plus git pushes (not REST)",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: none · noted in the PR's Acceptance notes, not filed — the empty-catalog cache latch defect (a seat-less member's direct link to the ai:chat page stayed on its loading state) is fixed in this PR, per the claim amendment",
        "carrier: none · noted, not filed — a catalog that serves agents but not ask still shows the entry; 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"
      ]
    }
  9. removed
    pm:dispatched
    on Nov 27, 2026
  10. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

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

    Closed by PR #37960 (merged through the queue). pm:dispatched removed with this note. Area o1-D.

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

Metadata

Metadata

Assignees

Labels

area:aidomain:uipriority:p2

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions