Repository navigation
docs(guides,plugins,tooling): clear three .mdx pages off the doc-snippet ledger (#5174 batch 5) - #7294
Merged
Conversation
This was referenced Sep 2, 2026
yinlianghui
marked this pull request as ready for review
September 2, 2026 05:07
This was referenced Sep 2, 2026
os-justin
pushed a commit
that referenced
this pull request
Sep 5, 2026
…n both faces `packages/plugin-chatbot/src/index.tsx:173–178` reads `message.avatar || userAvatarUrl` and `message.avatarFallback || userAvatarFallback` (and the assistant twins), the authoring-to-runtime seam spreads every unlisted key through (`chatMessageAdapter.ts`, `...passthrough`), and the SDUI renderer feeds the authored `messages[]` straight in — so a per-message avatar override renders and is documented, and no authoring-facing type declared it. objectui#4424's `RuntimeOnlyMessageKeys` named only the three keys API mode lifts out of the stream. Measured on 446d93d before the change, through the built types dist: `ChatMessage` has no index signature (objectui#5155 — none is added), so an author annotating `ChatbotSchema.messages` got TS2353 on a value that renders (five on `plugin-chatbot.mdx`); `ChatMessageSchema` is a plain strip-mode `z.object`, so the value parsed green through `ChatMessageSchema`, `ChatbotSchema` and `safeValidateSchema` and was DROPPED from the parsed output, and `avatar: 42` was admitted-and-stripped. After: the parse keeps the value and refuses a non-string at the key. Pin: `__tests__/chat-message-avatar-keys-7295.test.ts` — read-site text and read-set derivation off disk, mirror-shape membership, acceptance with the value surviving through the mirror, `ChatbotSchema` and the published entry point, refusal at the key (and at `messages.0.KEY` through the entry point), invariant type-level pins (string, optional, not any, equal to the chatbot-level keys they override, no index signature), a control key the plugin never reads (`avatarUrl`) that stays undeclared on both faces and is still admitted-and-stripped, and the three doc blocks' annotations. Docs: the three `plugin-chatbot.mdx` example blocks PR #7294 left unannotated (`supportChat`, `salesBot`, `multiAgentChat`) are annotated `ChatbotSchema` again. No `UNGATED_DOCS` row for that page exists on main, so `scripts/` is untouched. `packages/plugin-chatbot/**` untouched; `SeamChatMessage` inherits both keys through its `ChatMessage` half. Changeset: `@object-ui/types` patch — the accept set only widens toward what already renders. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BAZFhALsQsGqxui8sNqM8s
akarma-synetal
pushed a commit
to akarma-synetal/objectui
that referenced
this pull request
Sep 9, 2026
…n both faces (objectui#7295) (objectstack-ai#7732) * fix(types): declare `avatar` and `avatarFallback` on `ChatMessage`, on both faces `packages/plugin-chatbot/src/index.tsx:173–178` reads `message.avatar || userAvatarUrl` and `message.avatarFallback || userAvatarFallback` (and the assistant twins), the authoring-to-runtime seam spreads every unlisted key through (`chatMessageAdapter.ts`, `...passthrough`), and the SDUI renderer feeds the authored `messages[]` straight in — so a per-message avatar override renders and is documented, and no authoring-facing type declared it. objectui#4424's `RuntimeOnlyMessageKeys` named only the three keys API mode lifts out of the stream. Measured on 446d93d before the change, through the built types dist: `ChatMessage` has no index signature (objectui#5155 — none is added), so an author annotating `ChatbotSchema.messages` got TS2353 on a value that renders (five on `plugin-chatbot.mdx`); `ChatMessageSchema` is a plain strip-mode `z.object`, so the value parsed green through `ChatMessageSchema`, `ChatbotSchema` and `safeValidateSchema` and was DROPPED from the parsed output, and `avatar: 42` was admitted-and-stripped. After: the parse keeps the value and refuses a non-string at the key. Pin: `__tests__/chat-message-avatar-keys-7295.test.ts` — read-site text and read-set derivation off disk, mirror-shape membership, acceptance with the value surviving through the mirror, `ChatbotSchema` and the published entry point, refusal at the key (and at `messages.0.KEY` through the entry point), invariant type-level pins (string, optional, not any, equal to the chatbot-level keys they override, no index signature), a control key the plugin never reads (`avatarUrl`) that stays undeclared on both faces and is still admitted-and-stripped, and the three doc blocks' annotations. Docs: the three `plugin-chatbot.mdx` example blocks PR objectstack-ai#7294 left unannotated (`supportChat`, `salesBot`, `multiAgentChat`) are annotated `ChatbotSchema` again. No `UNGATED_DOCS` row for that page exists on main, so `scripts/` is untouched. `packages/plugin-chatbot/**` untouched; `SeamChatMessage` inherits both keys through its `ChatMessage` half. Changeset: `@object-ui/types` patch — the accept set only widens toward what already renders. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BAZFhALsQsGqxui8sNqM8s * fix(types): spell the optionality helper without the empty-object type in the objectui#7295 pin `@typescript-eslint/no-empty-object-type` flags the `{}` in `IsOptional`: the intent is "an object with no keys is assignable to `Pick<T, K>` only when `K` is optional", so the helper now says `Record<string, never>`. Verified to still discriminate: true for `avatar` / `avatarFallback`, false for the required `id` / `content`. No other change; `@object-ui/types#lint` is back to 0 errors. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BAZFhALsQsGqxui8sNqM8s --------- Co-authored-by: Claude <noreply@anthropic.com>
This was referenced Sep 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #5174
Batch 5 of the
UNGATED_DOCSburn-down — the first batch into the.mdxhalf. Batches 1-4 (#5341 #5951 #5967 #5983 #5991) cleared everycontent/docs.mdpage; this one takes the three highest-density.mdxentries and delivers all three whole.Per page
content/docs/guide/objectos-integration.mdxcontent/docs/plugins/plugin-chatbot.mdxcontent/docs/plugins/plugin-map.mdxPages were chosen by descending ts/tsx block count over the 12
.mdxledger entries, re-derived from the script with its ownTS_FENCE_LANGUAGESset and fence walk — not from the dispatch's list.Invariants
UNGATED_DOCSentriescontent/docs.mdxentries remaining--build-filtergit diff origin/main -- scripts/check-doc-snippet-types.mjsis 15 deleted lines and 0 added.sha256 b87e347626a6cbab30b904eaf7d3eb72f6804122505bdf9ec8f2f2c8136e95a3The defects, and where they were
objectos-integration.mdxis a getting-started integration guide, and four of the adapter APIs it documents do not exist. All four were hidden underneath a single unresolved name — the page never importedObjectStackAdapter, soTS2304was the only thing the gate could say. Resolving that name is what exposed them:new ObjectStackAdapter({ headers: ... })— the whole "Multi-Tenancy Support" section. The constructor config is a sealed object literal type with no index signature;headersis not on it. Repaired to the real route, thefetchhook the adapter uses for every call it makes.new ObjectStackAdapter({ websocket: ... })andadapter.subscribe(...)— the "Real-time Updates with WebSockets" section. There is no WebSocket transport and no server-push subscription anywhere in@object-ui/data-objectstack;subscribeis not a member. The real mechanism isonMutation, which notifies of writes this adapter instance performed and returns its own unsubscribe function. Section repaired and retitled "Reacting to Data Changes", and it now says out loud what the adapter does not do.cache: { enabled, strategies }—cacheexists but takes onlymaxSizeandttl. Repaired to the two real keys.viewTypes/fieldNameson anobject-viewnode — both have zero read sites in the packages.ObjectViewreadsdefaultViewType(a declared member ofObjectViewSchema) andcolumns(string[]orListColumn[]). Corrected to those two.A reader copying any of the first three got a rejected config or a
TypeError.Lid check — POSITIVE on two pages, and reported as measured
The dispatch required a re-run after resolving unresolved names. Results, per page:
objectos-integration.mdx— POSITIVE. Adding the missingObjectStackAdapterimport to three blocks turned oneTS2304intoTS2353onheaders,TS2353onwebsocket,TS2339onsubscribeandTS2353oncache.enabled. Defects 1-3 above are entirely lid.plugin-chatbot.mdx— POSITIVE. Annotating the schema and message literals surfaced 5 xTS2353onavatarFallback(see below).plugin-map.mdx— NEGATIVE. After giving the eight unparseable schema literalsconstbindings and annotating themObjectMapSchema, nothing new appeared — 0 diagnostics underneath. Reported as a negative result.What the green does not mean
BaseSchemacarries[key: string]: any(base.d.ts:357), andChatbotSchema,ObjectMapSchemaandObjectViewSchemaall extend it. A wrong top-level key on any of these literals is structurally invisible — which is exactly why defect 4 above had to be found by grepping read sites rather than by the compiler. The green certifies the types of declared members, never the existence of a key.plugin-chatbotexample blocks (supportChat,salesBot,multiAgentChat) and twoplugin-mapstatic-data blocks are deliberately left unannotated — see the two contract gaps below. Their green says only "this parses and its expressions type".ChatbotSchemaandObjectMapSchemamember types,ChatMessage(both the authoring and the plugin shape),ChatToolInvocation.state,ObjectViewSchema.defaultViewType,ObjectMapConfig, and theObjectStackAdapterconstructor config, which is a sealed literal type and is where all three repaired defects were caught.Two contract gaps found, NOT fixed here (outside this PR's surface)
Both are package-type defects, not documentation defects. The documentation is correct in each case and is left as it stands.
avatar/avatarFallbackare honoured but undeclared.Chatbotresolvesmessage.avatarFallback || userAvatarFallback(packages/plugin-chatbot/src/index.tsx:177-178), andauthoredToRuntimeMessagecarries the keys across the seam via its...passthroughspread — so authoring them inchatbotmetadata works end to end. But no authoring-facing type declares them:@object-ui/types'ChatMessagedoes not, and neither doesSeamChatMessage(itsRuntimeOnlyMessageKeyscovers onlybuildProgress,blueprintProgress,charts). Only the plugin's own runtimeChatMessagehas them. Annotating the three affected blocks would have meant deleting working, documented behaviour, so they stay unannotated.ObjectMapSchema.objectNameis required but the component treats it as optional.ObjectMapbranches onschema.staticDatafirst (ObjectMap.tsx:153) and guardsobjectNameeverywhere else, so the documented static-data route needs noobjectName— yet the type demands one. The static-data example blocks are therefore left unannotated.Gate verdicts
Before (pristine
origin/mainledger, 43 entries):After, at merge commit
fe053c7b6:All run at
fe053c7b6, aftergit merge origin/main(never rebased):check:doc-snippetsSemantic phase: 312 of 312 block(s) judged, 0 failed.check:doc-fencescheck:doc-typescheck:doc-linkscheck:control-bytescheck:readme-exportscheck:skills-pathscheck:shell-escape-residuecheck-changeset-presenceThe vitest run is the two suites the dispatch named plus the five other files that
git grepshows namecheck-doc-snippet-types— pin suites inexamples/schema-catalog,plugin-gantt,reactandtypesthat an edit to this script could have hijacked.Declared narrowing
pnpm lintwas not run repo-wide; the narrowing is measured, not assumed. ESLint's own answer for the four changed files (--format json, 4 files returned): the three.mdxfiles reportFile ignored because no matching configuration was supplied— they are outside eslint's configured surface entirely, since everyfilespattern ineslint.config.jsis**/*.{ts,tsx}. The one file it does lint,scripts/check-doc-snippet-types.mjs, is clean at 0 errors, 0 warnings.eslint.config.jsdeclares noprojectServiceand noproject:, so type-aware linting is not enabled and this diff cannot move the lint verdict on any file it did not touch.One further note on measurement honesty:
check:readme-exportsfirst exited 1 with 45 findings, every one of them the stringits type entry ./dist/index.d.ts is not on disk -- run pnpm build first, all inplugin-aiandplugin-gantt— packages outside this gate's build closure. That was an unbuilt tree, not a red gate. Those two closures were built and it is now genuinely green.https://claude.ai/code/session_01BGMDbrVa8JjZcCQ7DWYH1b
Generated by Claude Code