Skip to content

AI 问询首页 T1:菜单项 ai:chat 的参数 schema 与校验,链接不再带参数 #37787

Description

@objectstack-fleet

epic:#5027#1 · hotlong · session_01Q4EjjMUfmNYTem26rXLFUf

Filing gate: ① maintainer-asked. Jack in the seat thread, 2026-11-27: 「立卡派发」 (02:37Z); route ruling 「先内置页面,再做页面积木」 (02:41Z card); 「我们是一个开发平台,你搭的入口页面必须是通用的」 (02:51Z); 「用fable评审一下完整的首页方案,我现在只要考虑这一个页面」 (03:07Z); ADR-0057 conflict ruling 「做首页,本页隐藏机器人」 (03:16Z card).
Plan: /mnt/project-files/ai-home/plan-v1.md, Fable review with file:line evidence /mnt/project-files/ai-home/fable-review-v1.md (objectstack da31daff, cloud 917f57c). Mockup: https://claude.ai/artifact/SS7UdUYXethLuvV8f5D7JY.
Parent: objectstack-ai/cloud#5027 (ask experience). Trigger app: brightrule (a policy-inquiry app whose only AI entry today is the top-right robot).
Grading: area:ai · Task · p1 · size S · reach: every app that puts an ai:chat entry on its menu.
Dedupe: searched ai:chat, AiChatNavParams, component nav params schema: none.

维护者速读

  • 是什么:AI 问询首页的配置项(欢迎标题、说明、输入提示、推荐问题)挂在应用菜单项 componentRef: 'ai:chat' 的 params 上,这张卡给它定 schema,保存应用时校验,并让这类菜单链接不再把参数拼进网址。
  • 影响:之后的页面卡(T2)直接读菜单项里的配置。
  • 要你做什么:无。

Background (verified, see the review §1)

  • component nav item params is an open z.record(z.string(), z.unknown()) (packages/spec/src/ui/app.zod.ts:743-744), not validated.
  • NavigationRenderer serialises a component item's params into the querystring (ui/packages/layout/src/NavigationRenderer.tsx:1192-1200, non-strings via JSON.stringify); ComponentNavView passes only querystring strings as props (ui/packages/app-shell/src/views/ComponentNavView.tsx:53-58). Arrays and long copy do not belong in a URL.

What to do

  1. packages/spec/src/ui/: export AiChatNavParamsSchema (strict): title?, subtitle?, placeholder? (strings, sensible max lengths), suggestions? (array of 1–4 non-empty strings). No agent, no scope in v1 (agent is pinned to ask; strict scope is out of this phase). Describe each key for the generated docs.
  2. Validate it where an app is parsed: a type: 'component' nav item with componentRef: 'ai:chat' has its params checked against the schema (issue path navigation.<i>.params.<key>). Do this for this one componentRef, not a general per-componentRef registry. Other component items keep the open record.
  3. v1 allows at most ONE ai:chat entry per app (navigation and areas[].navigation, any depth): refuse a second with a clear message.
  4. NavigationRenderer: an ai:chat item builds /apps/<app>/component/ai/chat with NO querystring from params; active-item highlighting still works.
  5. Export the JSON Schema with the other generated artifacts (the design-mode form in a later card uses it). Regenerate spec artifacts; changeset (@objectstack/spec minor, Metadata-protocol: added).

Acceptance

  • Positive and negative parse cases (each key, >4 suggestions, unknown key, wrong type, two ai:chat entries); a non-ai:chat component item with arbitrary params still parses.
  • Renderer test: the ai:chat href has no ?; another component item's href is unchanged.

Activity

  1. added
    enhancement
    priority:p1
    pm:queue
    domain:spec
    area:ai
    on Nov 27, 2026
  2. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    epic:#5027#1 · hotlong · session_01Q4EjjMUfmNYTem26rXLFUf

    Claim: seat epic:#5027#1, maintainer order 「立卡派发」 (2026-11-27 02:37Z, route ruling 03:16Z) · 2026-11-27T03:23Z
    Session: session_01Q4EjjMUfmNYTem26rXLFUf
    Thread session: cse_01Q4EjjQQ6miUUVgzeps8oEr
    Account: hotlong
    Branch: thread branch claude/project-thread-* (named in the PR)
    Worktree: objectstack-issue-37787
    Domain: domain:spec
    Seat: epic:#5027#1
    File surface: packages/spec/src/ui/ (new schema + app parse hook), ui/packages/layout/src/NavigationRenderer.tsx, generated spec artifacts, changeset (stop on breach; explain in the report)
    Container & model: S, mode:thread, model: default, effort: medium
    Clause-②: yes (adds an optional schema on an open key; widening for authors of other component items: none)
    Metadata-protocol: added
    Responsibility: implement, draft PR via relay, hand back to the seat; the seat does L1 and landing
    Thread-read: none
    Premise: holds (filed 2026-11-27 against objectstack da31daf; the order's first step re-measures on current main and stops on a failed premise)
    Serial constraints cleared: does not touch AiChatPage.tsx / ChatbotEnhanced.tsx (#37728/#37730)
    Order: /mnt/project-files/pm-orders/cloud/epic-5027/order-objectstack-37787.md (+ _common.md)

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

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in area:ai · domain:spec · Task · priority:p1 · pm:dispatched · size S; rationale: AI ask home page T1, the ai:chat menu item's parameter schema and validation. Maintainer-asked (「立卡派发」, 「我现在只要考虑这一个页面」), so the maintainer's focus page keeps the p1 queue jump as filed. Dispatched.

  5. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    epic:#5027#1 · hotlong · session_01Q4EjjQQ6miUUVgzeps8oEr
    os-dev-report

    {
      "issue": 37787,
      "status": "pr_open",
      "pr": 37798,
      "branch": "claude/project-thread-qsb5lp",
      "head_sha": "91fe7925b5509f41bcc98287fdd344c0c9347546",
      "ci": "61 success, 9 skipped, 0 failure on head; mergeable_state clean; draft",
      "gates": {
        "spec_test": "905 files, 28583 passed + 1 failed (union mount-count pin, fixed) on first run; touched files re-run green",
        "spec_ui_after_main_merge": "6671 passed",
        "ui_layout_types": "441 files, 10925 passed",
        "spec_check_generated": "all 14 up to date",
        "check_liveness": "pass",
        "check_spec_parsed_alias": "pass (fixed in 91fe7925)",
        "check_llms_txt": "pass (fixed in 16d8dafe)",
        "typecheck": "spec, ui/types, ui/layout pass"
      },
      "line_budget": "card size S; diff under 3000 changed lines incl. generated",
      "files_changed": [
        "packages/spec/src/ui/ai-chat-nav-params.zod.ts (new)",
        "packages/spec/src/ui/ai-chat-nav-params.test.ts (new)",
        "packages/spec/src/ui/app.zod.ts",
        "packages/spec/src/ui/index.ts",
        "packages/spec/src/ui/app-nav-visible-data-needs-data-source-export.test.ts",
        "packages/spec/llms.txt",
        "ui/packages/layout/src/NavigationRenderer.tsx",
        "ui/packages/layout/src/__tests__/resolveHref.test.ts",
        "ui/packages/types/src/zod/app.zod.ts",
        "ui/packages/types/src/__tests__/imported-defaults-8317.test.ts",
        "ui/packages/types/src/__tests__/spec-object-refinements-7715.test.ts",
        "docs/audits/2026-07-unknown-key-strictness-ledger.md",
        ".changeset/37787-ai-chat-nav-params.md",
        "generated: api-surface, export-origins, declaration-map, authorable-surface, json-schema.manifest, content/docs/references, skills refs index, strictness-ledger counts"
      ],
      "deviations": [
        "branch is the platform-assigned thread branch, not claude/issue-37787-*",
        "checkAiChatNavParams mounted on NavigationItemSchema, not ComponentNavItemSchema (arm mount adds a dropped-refinement site to 29 ledger entries)",
        "Metadata-protocol: added per card, though two previously-parsing documents are now refused (no ai:chat component is registered today)",
        "Skills-docs: follow-up owed until objectstack#37788 ships the page"
      ],
      "api_writes": "git push x8; relay pr_create x1; this report x1",
      "mcp_calls": 0,
      "security_findings": "none"
    }
  6. added a commit that references this issue on Dec 1, 2026
    8fbae19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:aidomain:specenhancementpm:dispatchedpriority:p1

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions