Skip to content

feat(spec): declare the params of an ai:chat menu entry (AI inquiry home page copy) - #37798

Merged
os-zhuang merged 10 commits into
mainfrom
claude/project-thread-qsb5lp
Nov 27, 2026
Merged

os-zhuang merged 10 commits into
mainfrom
claude/project-thread-qsb5lp

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Jack · project thread

Fixes #37787

维护者速读

  • 是什么:应用菜单里 componentRef: 'ai:chat'(AI 问询首页)那一项的 params 现在有固定格式:标题、说明、输入提示、推荐问题(最多 4 条)。拼错键、超长、填 agent / scope 会在保存应用时报错并指出位置;每个应用最多一个这样的入口;其他组件菜单项不受影响。侧栏链接到这个页面时不再把参数拼进网址。
  • 影响:页面卡 AI 问询首页 T2:平台通用的应用内 AI 问询页面(首页态、提问、恢复对话,本页隐藏机器人) #37788 直接从菜单项读这些配置。今天还没有页面注册在 ai:chat 下,所以没有任何现有应用会被拒。
  • 要你做什么:这个 PR 改到了生成的 skills/objectstack-ui/references/_index.md,属于 Tier H,需要你批准,席位会在你批准后落地。

What changes

  • packages/spec/src/ui/ai-chat-nav-params.zod.ts (new): AI_CHAT_COMPONENT_REF = 'ai:chat', AiChatNavParamsSchema (closed: title ≤60, subtitle ≤200, placeholder ≤100, suggestions 1–4 non-empty strings ≤100 each; every key described for the generated docs; agent / scope refused with guidance, no rename), and two exported checks:
    • checkAiChatNavParams — judges params only for type: 'component' + componentRef: 'ai:chat', re-raising each issue under params.<key>. Mounted once on NavigationItemSchema (beside navItemVisibleDataNeedsDataSource), so it reaches navigation, areas[].navigation, children at any depth and contribution items. Not a per-componentRef registry: every other component entry keeps the open record.
    • checkAppSingleAiChatEntry — at most one ai:chat entry per app across navigation and every areas[].navigation, any depth; each extra one is refused at its own path, naming the first. Mounted on AppSchema after checkAppLandingItems.
  • ui/packages/layout resolveHref: an ai:chat item builds /apps/<app>/component/ai/chat with no querystring. Other component items unchanged. Active-item matching already compares pathnames, so highlighting holds (pinned, including with a ?c= conversation param).
  • ui/packages/types app mirror: chains both spec checks (flat nav arm, AppComponentSchema), and the two census tests name them (imported-defaults-8317, spec-object-refinements-7715).
  • Generated: api-surface, export-origins, declaration-map, authorable-surface/ui.json, json-schema.manifest/ui.json (the JSON Schema ui/AiChatNavParams is emitted with the other generated schemas), reference docs, skill refs index, strictness-ledger counts plus its hand-written ui/ triage row.
  • Changeset: @objectstack/spec minor, @object-ui/types minor, @object-ui/layout patch.

Why

Card objectstack#37787 (T1 of the AI inquiry home page, epic objectstack-ai/cloud#5027). The page card objectstack#37788 reads these keys off the navigation entry; it is the schema's consumer (ADR-0049 liveness: the keys are declared here and consumed there; check:liveness is green because the keys live inside the params record, not a walked ledger key). Premise re-measured on origin/main 00cb37b0 (branch since merged with main at b6536238; spec rebuilt, check:generated clean, packages/spec/src/ui 6671 and ui/packages/types + resolveHref 10545 tests re-run green): params open at app.zod.ts:743-744, querystring serialisation in NavigationRenderer.tsx component branch, ComponentNavView forwards only querystring strings. All held.

Judgement points for review:

  • Metadata-protocol: added, as the card asks. Strictly, two documents that parsed before are now refused (bad ai:chat params, a second ai:chat entry). No component is registered under ai:chat today, so no working document is refused; I did not classify it narrowed.
  • The mount is on the union, not on ComponentNavItemSchema: mounting on the arm added a new dropped-refinement site to 29 published schemas' ledger entries, while the union site is already declared. Same posture as navItemVisibleDataNeedsDataSource (the exported per-branch schema does not chain it). app-nav-visible-data-needs-data-source-export.test.ts now expects two union checks, this one second.
  • A package navigation contribution is merged after parse, so an ai:chat entry it adds is not counted by the one-per-app check (documented on the function).

Skills-docs: follow-up owed — the objectstack-ui skill should teach the ai:chat entry once objectstack#37788 ships the page; documenting a menu entry that opens nothing today would advertise an unshipped capability.

Verification

Clause-②: yes (widening)
Metadata-protocol: added

  • pnpm --filter @objectstack/spec test — 905 files: 28583 passed, 1 failed, 1 todo on the first run; the one failure was the union mount-count pin, updated in c7235ae8, and that file plus ai-chat-nav-params.test.ts re-ran green (57 tests)
  • npx vitest run src/ui/ai-chat-nav-params.test.ts — 18 tests: each key positive and negative, >4 / 0 suggestions, unknown key, wrong type, agent/scope guidance, nested children and areas paths, two entries (same tree and across areas), a non-ai:chat component with arbitrary params still parses, JSON Schema projection is closed
  • pnpm exec vitest run packages/layout/ packages/types/ (in ui/) — 441 files, 10925 passed
  • pnpm --filter @objectstack/spec check:generated — all 14 artifacts up to date; check:liveness, check:empty-state, check:exported-any, check:dual-source-exports exit 0
  • pnpm --filter @objectstack/spec typecheck, ui/packages/{types,layout} type-check exit 0; eslint on touched spec files and both ui packages: 0 errors
  • CI fixes after opening: packages/spec/llms.txt schema counts (16d8dafe); ADR-0122 alias convention, AiChatNavParams = z.input, AiChatNavParamsParsed = z.infer (91fe7925); L1 wording, the scope guidance claims object preference only, since knowledge search has no app filter (0d0002c8)
  • root: check:doc-authoring, check:adr-0087-registration, check:keyed-text-bounds, check:release-spec-changes, check:cross-package-test-inputs, check:pm-skill-id-lint, check:sdui-reference exit 0

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q4EjjQQ6miUUVgzeps8oEr


Generated by Claude Code

@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation protocol:ui tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 27, 2026
@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

10 anchor(s) derived from 1 changed package(s); no hand-written page names any of them. ⚠️ 7 changed file(s) yielded no anchor (packages/spec/api-surface/ui.json, packages/spec/authorable-surface/ui.json, packages/spec/declaration-map/ui.json, …), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

What this run could not see
  • 7 changed file(s) yielded no anchor (packages/spec/api-surface/ui.json, packages/spec/authorable-surface/ui.json, packages/spec/declaration-map/ui.json, …) — pages documenting those are invisible to this run
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 177 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json ff9ee210849b81a2ee5528cde6db71c40cf818c2 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from de551bbc4c5ac7c605dd29307715702c45bc1b33 — the merge of head 0d0002c8c09dcf2069682eaf4c1195a54ecf7947 into base ff9ee210849b81a2ee5528cde6db71c40cf818c2, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin de551bbc4c5ac7c605dd29307715702c45bc1b33 && git checkout de551bbc4c5ac7c605dd29307715702c45bc1b33
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin ff9ee210849b81a2ee5528cde6db71c40cf818c2 0d0002c8c09dcf2069682eaf4c1195a54ecf7947 && git checkout -B drift-repro ff9ee210849b81a2ee5528cde6db71c40cf818c2 && git merge --no-ff 0d0002c8c09dcf2069682eaf4c1195a54ecf7947

node scripts/docs-audit/affected-docs.mjs --json ff9ee210849b81a2ee5528cde6db71c40cf818c2

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

…sed the parsed one (ADR-0122)

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q4EjjQQ6miUUVgzeps8oEr
@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 27, 2026 05:01
@os-zhuang
os-zhuang enabled auto-merge November 27, 2026 05:02
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 27, 2026
Merged via the queue into main with commit 8fbae19 Nov 27, 2026
75 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-qsb5lp branch November 27, 2026 05:59
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
objectstack-ai#37812)

<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DG44bgtJm8kWx4oK68re6GX)_

Fixes objectstack-ai#37733

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户能看到什么变化:用户无感;查阅决策记录目录的人会看到「就记录问
AI」那条记录的状态说明换成了最新写法,写明它修订过不止一次(目录每格有长度上限,后半句照旧截断)。
- 为什么做:这条记录本周又修订了一次,目录由记录自动生成,却没有跟着重新生成;替查阅决策记录的人和读取目录的工具消除目录与记录的不一致。
- 出错会怎样:最多是目录里这一行文字不对,任何功能都不受影响;撤回这一次改动即恢复原样。
- 要你做什么:合入或批准这一次改动(决策记录目录属于须经你手的范围)。

## What changes

`docs/adr/README.md`, the generated ADR index, is regenerated with `node
scripts/adr-index.mjs`. One row moves: the status cell of ADR-0160.

| | ADR-0160 status cell |
|:---|:---|
| before | `Accepted — merged 2026-11-24 (PR objectstack#37115); amended
2026-11-25 (s…` |
| after | `Accepted — merged 2026-11-24 (PR objectstack#37115); amended
2026-11-25, 2…` |

- Cause: the `**Status**:` line of ADR-0160 was rewritten twice without
an index regeneration: by commit eec1040 (PR objectstack-ai#37573, `amended
2026-11-25 and 2026-11-26`) and then by commit 031a19d (PR objectstack-ai#37785,
which added the fifth and sixth amendments, `amended 2026-11-25,
2026-11-26 and 2026-11-27`). Both touched the record only. The index
projects that line clipped to the cell width, so the visible change is
the clipped tail.
- Diff: 1 file, +1 / −1 (line 230). No ADR body, no script, no other
index row.
- The file is generator output. Nothing in it is hand-edited or
hand-trimmed.
- No changeset: `docs/adr/**` ships in no released package, so this pull
request carries `skip-changeset`, declared on the create.

## Tests

No package is touched, so there is no build closure to make and no
package test or typecheck to run. The generator's own self-test ran
inside `pnpm check:adr-index`: 60 assertions, green.

## Acceptance notes

- Card acceptance, "`adr:index` regenerated on main; its check passes
with no other index change": `node scripts/adr-index.mjs --check` exits
1 (stale) on `main` and exits 0 on this branch at its head 4976072
(the area's re-run after objectstack-ai#37785 landed), and the net diff against `main`
is the ADR-0160 row alone. "No other index change" is a measured reading
here, not an assumption.
- Idempotent: a second `node scripts/adr-index.mjs` on the regenerated
tree prints `unchanged` and leaves the same blob (ef06360 at
4976072; 803949a was the first head's).
- The row does not show the new date itself. The generator clips the
status cell at a fixed width and the clip lands inside `, 2026-11-26 and
2026-11-27`.
- `main` moved while this was in flight. The branch carries one merge
commit, 0315963 (`main` at c826e8a, which brought in objectstack-ai#37785), and
the index was regenerated on top of it in 4976072. `main` has since
moved four more commits to 9b50fed (objectstack-ai#37798, objectstack-ai#37783, objectstack-ai#37821, objectstack-ai#37826);
none of them touches `docs/adr/`, `ui/docs/adr/` or the generator, so
the index stays current against today's `main`.
- Governed surface: `docs/adr/**` is Tier H. This pull request is opened
as a draft and is left as one; landing it is the maintainer's act.
- Noted, not filed: the index went stale with nothing red because its
check is report-only by ruling. The last index regeneration on `main`,
commit 972114d, did not carry the new ADR-0160 status text, so that
index was generated on a tree without eec1040 and the file then
text-merged. That is the expected cost of a report-only check, not a
defect.

## Verification

Read first, one file:

1. `docs/adr/README.md`, line 230, the only hunk of the net diff. The
risk to check is that the row is exactly what the generator prints for
the current `**Status**:` line of ADR-0160, and that nothing else moved.

Two-minute check: on this branch run `node scripts/adr-index.mjs
--check`. Expected: the line `adr-index: OK — docs/adr/README.md is
current and every record parsed.` and exit 0. On `main` the same command
prints `docs/adr/README.md is stale` and exits 1.

<details>
<summary>Premise on main (objectstack cac93cc, first head)</summary>

```text
$ node scripts/adr-index.mjs --check
adr-index: ✗ docs/adr/README.md is stale — run `node scripts/adr-index.mjs` (pnpm adr:index) and commit the result.
exit 1
```

</details>

<details>
<summary>Regeneration and its check (objectstack b234dce, first head;
re-run at 4976072 after the merge of main)</summary>

```text
$ node scripts/adr-index.mjs
adr-index: wrote docs/adr/README.md (251 lines).
exit 0
$ git diff --numstat
1	1	docs/adr/README.md
$ node scripts/adr-index.mjs --check
adr-index: OK — docs/adr/README.md is current and every record parsed.
exit 0
$ node scripts/adr-index.mjs
adr-index: unchanged docs/adr/README.md (251 lines).
exit 0
$ node scripts/pm/overlap-check.mjs
overlap-check: claude/area-o1C-37733 (b234dce) changes 1 file(s); against origin/main (44ccf94) and 0 PR head(s)
  ✓ origin/main: merges cleanly
VERDICT clean exit 0
```

</details>

<details>
<summary>Local gates on objectstack b234dce (first head): the 21
commands that dispatch-gates derives for this diff. The head 4976072
is judged by its check-runs: 25 success, 19 skipped, 0 failed</summary>

Each exit code was captured before any pipe. `node
scripts/pm/dispatch-gates.mjs --ran` answers: `21 derived famil(ies)
accounted for — 21 run, 0 NOT-MEASURED`, exit 0.

```text
exit 0  node scripts/check-adr-links.mjs
exit 0  node scripts/check-adr-links.mjs --self-test
exit 0  node scripts/check-closing-keyword-parity.mjs
exit 0  node scripts/check-closing-keyword-parity.mjs --self-test
exit 0  node scripts/check-comment-mask-corpus.mjs
exit 0  node scripts/ci/plan-test-core-shards.mjs --self-test
exit 0  pnpm --filter @objectstack/lint run check:doc-formula-expressions
exit 0  pnpm check:adr-anchors
exit 0  pnpm check:adr-index
exit 0  pnpm check:adr-symbol-anchors
exit 0  pnpm check:ci-filter-parity
exit 0  pnpm check:closed-ceremony-text
exit 0  pnpm check:cross-package-test-inputs
exit 0  pnpm check:doc-authoring
exit 0  pnpm check:driver-memory-census
exit 0  pnpm check:gitlink-declared
exit 0  pnpm check:nul-bytes
exit 0  pnpm check:pm-governed-merges
exit 0  pnpm check:pm-prior-rulings
exit 0  pnpm check:refd-timer-probe
exit 0  pnpm check:watch-hint-literal
```

`pnpm check:adr-index` printed: `adr-index --report: OK —
docs/adr/README.md is current, every record parsed, self-test 60
assertions green.`

The `check:doc-formula-expressions` line is its second run. The first
exited 3, PREREQUISITE NOT MET, because `@objectstack/formula` and
`@objectstack/lint` were not built in this worktree. Both were then
built under the shared verify lock (`VERDICT command-exit 0`) and the
gate was run again. Every other family is left to CI on this pull
request.

</details>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP

<!-- signed: repo:objectstack#1 · os-elon-musk ·
session_016WV4cwoXEE1amuRAGHdPBs -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
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 protocol:ui size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants