From 4a43188d968814447a79309a000b09c4b09143c5 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 6 Sep 2026 19:51:41 +0000 Subject: [PATCH 1/2] docs(plugin-kanban): compile every README snippet, leave the UNGATED_DOCS ledger Batch 26 of the objectui#5174 burn-down. `packages/plugin-kanban/README.md` leaves `UNGATED_DOCS` and all five of its ts blocks now compile against the built types. The page's entire debt was PARSE debt -- 6 diagnostics over 2 codes (TS1109 x5, TS1011 x1) in exactly two blocks, and the removed ledger entry's reason string described it accurately. Schema API block: the leading pseudo-object was an interface-shaped props table that TypeScript could not parse. It is now a real binding annotated with the SHIPPED `KanbanSchema`, with `columns` bound through the page's own `KanbanColumn` interface -- so that interface is load-bearing instead of a local shape that compiles green whatever it says. The two documented interfaces are untouched and still match the shipped types 7 keys of 7 each. Example with Callbacks block: the elided `columns: [...]` becomes a `declare const` stand-in typed from the shipped surface, and the binding is annotated `KanbanSchema`, so the four `onCardMove` parameters are now contextually typed by the shipped signature rather than implicit any. No fragment marker was added: declared fragments stay at 158. No packages/** source touched, no public type widened, no gate loosened -- the gate file's only change is the two lines of that one ledger entry, and the strictness region hashes identically on both sides. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr --- packages/plugin-kanban/README.md | 29 ++++++++++++++++++++++------- scripts/check-doc-snippet-types.mjs | 2 -- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/packages/plugin-kanban/README.md b/packages/plugin-kanban/README.md index 612b92e268..7835839ac6 100644 --- a/packages/plugin-kanban/README.md +++ b/packages/plugin-kanban/README.md @@ -103,12 +103,23 @@ const schema: KanbanSchema = { ## Schema API ```typescript -{ +import type { KanbanSchema } from '@object-ui/plugin-kanban'; + +declare const columns: KanbanColumn[]; + +// The board document. `type` is the only required member — `columns`, +// `onCardMove` and `className` are all optional. The annotation is the type +// this package ships, so the section below is compiled against it rather than +// read as prose: an invented or renamed key, or a callback whose parameters +// drift from the shipped signature, fails here. +const board: KanbanSchema = { type: 'kanban', - columns?: KanbanColumn[], // Array of columns - onCardMove?: (cardId, fromColumnId, toColumnId, newIndex) => void, - className?: string // Tailwind classes -} + columns, // Array of columns + onCardMove: (cardId, fromColumnId, toColumnId, newIndex) => { + // see "Example with Callbacks" below + }, + className: 'h-full', // Tailwind classes +}; // Column structure interface KanbanColumn { @@ -183,9 +194,13 @@ pnpm build ## Example with Callbacks ```typescript -const schema = { +import type { KanbanColumn, KanbanSchema } from '@object-ui/plugin-kanban'; + +declare const columns: KanbanColumn[]; + +const schema: KanbanSchema = { type: 'kanban', - columns: [...], + columns, onCardMove: (cardId, fromColumnId, toColumnId, newIndex) => { console.log(`Card ${cardId} moved from ${fromColumnId} to ${toColumnId} at index ${newIndex}`); // Update your backend or state here diff --git a/scripts/check-doc-snippet-types.mjs b/scripts/check-doc-snippet-types.mjs index e84025fbb6..fe7e896c25 100644 --- a/scripts/check-doc-snippet-types.mjs +++ b/scripts/check-doc-snippet-types.mjs @@ -716,8 +716,6 @@ const UNGATED_DOCS = { '5 undefined-name diagnostic(s) — blocks continue an earlier block, or use ambient names the page never defines; 1 unresolved-module diagnostic(s); plus TS17000x1 TS2322x1 — candidate real defects, un-triaged', 'packages/plugin-editor/README.md': '6 parse diagnostic(s) — blocks fenced `ts` that are bare object literals or elided bodies', - 'packages/plugin-kanban/README.md': - '6 parse diagnostic(s) — blocks fenced `ts` that are bare object literals or elided bodies', 'packages/plugin-map/README.md': '1 parse diagnostic(s) — blocks fenced `ts` that are bare object literals or elided bodies; 1 undefined-name diagnostic(s) — blocks continue an earlier block, or use ambient names the page never defines; plus TS2322x1 — candidate real defects, un-triaged', 'packages/plugin-markdown/README.md': From d9bb7b9823a8526965ee992f7bcf12db4a76d3a1 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 6 Sep 2026 20:00:56 +0000 Subject: [PATCH 2/2] docs(plugin-kanban): correct what the KanbanSchema annotation actually checks Probe P4 falsified the claim the previous commit's comment made. Adding a key the shipped `KanbanSchema` does not declare (`swimlanes: []`) to the annotated board literal does NOT turn the gate red: `KanbanSchema` extends `BaseSchema`, which declares `[key: string]: any` ("This index signature allows type-specific extensions", packages/types base.d.ts), so TypeScript's excess-property check cannot fire on this type family at all. What the annotation does check is measured and real -- the type of every member the shipped type declares. Probe P5 retypes the stand-in to `string[]` and gets TS2322 "Type 'string[]' is not assignable to type 'KanbanColumn[]'"; probe P3 deletes the stand-in and gets TS18004 on the shorthand property. So the comment now states the narrower true thing and names the bound, instead of promising a rejection the compiler will never deliver. A README that claims a check nobody performs is the failure this gate exists to prevent, and it would have shipped inside the very block this batch was repairing. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr --- packages/plugin-kanban/README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/plugin-kanban/README.md b/packages/plugin-kanban/README.md index 7835839ac6..74d3d42d63 100644 --- a/packages/plugin-kanban/README.md +++ b/packages/plugin-kanban/README.md @@ -109,9 +109,12 @@ declare const columns: KanbanColumn[]; // The board document. `type` is the only required member — `columns`, // `onCardMove` and `className` are all optional. The annotation is the type -// this package ships, so the section below is compiled against it rather than -// read as prose: an invented or renamed key, or a callback whose parameters -// drift from the shipped signature, fails here. +// this package ships, so each member below is compiled against it rather than +// read as prose: a `columns` array of the wrong shape, or an `onCardMove` +// whose parameters drift from the shipped signature, fails here. An unknown +// key does not — `KanbanSchema` extends `BaseSchema`, whose index signature +// deliberately accepts type-specific extensions, so the compiler is not what +// catches a misspelt board key. const board: KanbanSchema = { type: 'kanban', columns, // Array of columns