Repository navigation
docs(spec): the DashboardWidgetOptionsSchema doc comment says a misspelled options key compiles and parses, and a wrong value is the type error - #21275
Conversation
…sspelled options key compiles and parses The bag ends in .passthrough(), so an undeclared key such as sortDirection or granularity is admitted by both z.input and the parser. A wrong value for a declared key is the type error; the misspelled key is named by the unconsumed-widget-option warning at the authoring doors. Claude-Session: https://claude.ai/code/session_01UtnxvdiN376GF3sgXwAw4d Co-authored-by: Claude <noreply@anthropic.com>
… add the patch changeset Claude-Session: https://claude.ai/code/session_01UtnxvdiN376GF3sgXwAw4d Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check
What this run could not see
Coarse fallback — 137 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
Contract reviewServed-tier: Inputs: card #21210 (body and all 3 comments: triage ① Derived judgments
② Semver level
(correct for a comment-only edit under an unchanged schema) ③ Boundary flags
Check-runs on
|
Fixes #21210
Clause-②: no
What changed
packages/spec/src/ui/dashboard.zod.ts: theDashboardWidgetOptionsSchemadoc comment said that a misspelled widgetoptionskey (sortDirection,granularity) "is now an author-time type error". That is false. The bag ends in.passthrough(), so such a key compiles and parses. The paragraph now says three things:sortOrder: 'sideways') is the author-time type error and the parse error.unconsumed-widget-optionwarning fromos validate,os buildandos lintnames the misspelled key. It is a warning, so none of the three commands fails on it..changeset/21210-widget-options-docblock.mdis'@objectstack/spec': patchwithClause-②: no. The comment ships to npm in two places. It is insrc/**/*.zod.ts. After the build it is also in the publisheddist/ui/index.d.tsanddist/ui/index.d.mts, where the new sentence is measured. The schema's shape does not change.The measurements behind each clause (HEAD
9c765bf4f5)tsc --noEmitran against the BUILT spec, with TypeScript 6.0.3,strictandNodeNext.--listFilesshows 33 files underpackages/spec/distand 0 underpackages/spec/src. Each case is written twice: once as aDashboardWidgetOptionsannotation, and once insidedefineStack({ dashboards }).{ sortBy: 'total_amount', sortDirection: 'desc' }compiles clean.{ granularity: 'month' }compiles clean.{ sortBy: 'total_amount', sortOrder: 'sideways' }is TS2322 at both sites:Type '"sideways"' is not assignable to type '"asc" | "desc" | undefined'.{ dateGranularity: 'month', sortBy: 'total_amount', sortOrder: 'desc', limit: 10 }, compiles clean.defineStackwith one object, one dataset and one dashboard. The dashboard has a control widget with only declared keys, a widget withsortDirectionand a widget withgranularity.os validateexits 0 with 2 warnings.--jsonreportsrule: unconsumed-widget-optionandseverity: warningatdashboards[0].widgets[1].optionsanddashboards[0].widgets[2].options.os buildexits 0 with the same 2 warnings, and names the rule.os lintexits 0 withWarnings (2), and names the rule.sortOrder: 'sideways'makesos validateexit 1 withdashboards.0.widgets.0.options.sortOrder: Invalid value 'sideways'. Expected one of: asc, desc.packages/lint/src/authoring-rules.ts(tier: 'advisory',commands: ALL).Census of the same claim
git grep -i "author-time type error"overpackages/spec/src,content/docsandskills:packages/spec/src/ui/dashboard.zod.tsis corrected in this PR.content/docs/ui/dashboards.mdxis already correct onmain. It says a misspelled key parses and the warning names it.skills/objectstack-ui/rules/dashboards.mdhas the claim at this branch's base30c530e5c0. PR docs(skills): the dashboards rule stops teaching unread widget options extras #21205 already corrected it onmain(f148852752;git merge-base --is-ancestor f148852752 origin/mainexits 0). No separate Tier H PR is needed, and this PR does not touchskills/**.content/docs/references/**has 0 hits. build-docs does not lift a schema-level doc comment into the reference page. It lifts only the module header and the.describe()text.check:docsis green after the edit with no regenerated diff, so no reference page changes in this PR.Verification (HEAD
9c765bf4f5)pnpm --filter @objectstack/spec build: exit 0 (lock verdictcommand-exit 0).pnpm --filter @objectstack/spec check:generated: all 15 generated artifacts are up to date, read against the dist that build produced.pnpm --filter @objectstack/spec typecheck: exit 0.pnpm --filter @objectstack/spec exec vitest run --project local --maxWorkers=2: 597 files and 17465 tests passed, 1 todo.node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands(no paths) derives 79 families. All 79 ran and exited 0. The--ranreconcile reads 79 derived, 79 run, 0 NOT-MEASURED, 0 UNRUN.check:dual-build-cjs-loadsfirst exited 3 (PREREQUISITE NOT MET, because 9 packages had nodist/). After those packages were built, it exited 0..tsfile.--print-configresolves that file, so it is in the linted population, with 5 rules.--format jsonreports 1 file, 0 errors and 0 warnings. The config enables no type-aware linting (noparserOptions.project, noprojectService), so a comment edit in this file cannot change any other file's result. The repo-widepnpm lintis left to CI.Acceptance notes
os validateprints the warning text without the rule code in its human output.os buildandos lintprintunconsumed-widget-option, andos validate --jsoncarries it. The doc comment uses the code as the warning's name, and all three commands carry that code in their machine output. Noted here, not filed.Generated by Claude Code