Skip to content

fix(driver): reject unknown gamuts and align validation error types - #237

Merged
pbroom merged 1 commit into
mainfrom
fix/api-doc-findings-validation
Oct 10, 2026
Merged

pbroom merged 1 commit into
mainfrom
fix/api-doc-findings-validation

Conversation

@pbroom

@pbroom pbroom commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

Validate the active gamut with core's assertGamutTarget in
createColorState, setColorActiveGamut, createMultiColorModel,
setMultiColorActiveGamut and getColorDisplayStyles, so 'p3' throws the
same TypeError as the core plane queries instead of rendering sRGB.
The reducers also reject a missing gamut.

sampleSliderGradient now throws a RangeError for steps below 2, and the
multi-color entry builders throw a TypeError for colors that are neither
strings nor objects instead of storing an empty color.

Found while documenting the public API in #235. Each finding was reproduced against the built package before the fix, has a regression test, and its affected JSDoc examples were recomputed. lint, build, test, format:check, typecheck, size, check:artifacts, check:preprod and agents:check:strict pass.

Part of the color-kit assessment stack.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
color-kit Ready Ready Preview Oct 10, 2026 8:11pm UTC

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-08T03:29:53.457055Z 4012f07 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This was referenced Oct 8, 2026

@pbroom pbroom left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the full incremental PR and its corrections at 800d6526182f84f1cbd1d384b6a162dcd795dbec. Gamut validation and error types reviewed; no remaining finding. No remaining actionable findings in the reviewed scope.

Independent correction re-reviews and stack preservation verification passed. At the integrated tip, lint, full build/DTS, 2,208 tests, formatting, strict agent checks and 14 built-site Chrome tests passed. All recorded actionable review threads are addressed. Hosted CI is being verified separately; this review does not authorize merge or release.

pbroom commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner Author

Merge activity

  • Oct 10, 6:47 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Oct 10, 8:08 PM UTC: Graphite rebased this pull request as part of a merge.
  • Oct 10, 8:08 PM UTC: @pbroom merged this pull request with Graphite.

@pbroom
pbroom changed the base branch from docs/s1-shell to graphite-base/237 October 10, 2026 20:04
@pbroom
pbroom changed the base branch from graphite-base/237 to main October 10, 2026 20:06
Validate the active gamut with core's assertGamutTarget in
createColorState, setColorActiveGamut, createMultiColorModel,
setMultiColorActiveGamut and getColorDisplayStyles, so 'p3' throws the
same TypeError as the core plane queries instead of rendering sRGB.
The reducers also reject a missing gamut.

sampleSliderGradient now throws a RangeError for steps below 2, and the
multi-color entry builders throw a TypeError for colors that are neither
strings nor objects instead of storing an empty color.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@pbroom
pbroom force-pushed the fix/api-doc-findings-validation branch from 6a34dbd to 657eb67 Compare October 10, 2026 20:07
@pbroom
pbroom merged commit 248e324 into main Oct 10, 2026
6 of 7 checks passed
@pbroom
pbroom deleted the fix/api-doc-findings-validation branch October 10, 2026 20:08
pbroom added a commit that referenced this pull request Oct 10, 2026
## Summary

Docs overhaul slice S2: a generated API reference built into the site. It replaces the TypeDoc HTML output that used to live in `/reference`.

- **Generator** (`apps/docs/scripts/api`). It runs TypeDoc JSON for every entry point in `packages/color-kit/package.json#exports`.
  - The JSON is normalized into `src/generated/api.json`, plus page files per entry and per symbol, typed by `src/api/model.ts`. All of these are gitignored and built by `pnpm docs:api`.
  - Each declaration gets one page, in its most specific entry. Other entries list it as a re-export.
  - Links resolve at generation time.
- **Routes**, all prerendered:
  - `/api`.
  - `/api/:entry`: domains, kind glyphs, a narrative MDX slot and re-exports.
  - `/api/:entry/:Symbol`: declaration, params, returns, throws, build-time highlighted examples, a notes MDX slot, see also, "also exported from" and a source link at the commit.
- **`<Signature>`** implements the S1 contract. It comes with `<Params>`, `<TypeLink>` and a responsive layout with one parameter per line.
- **⌘K**: symbol hits come from the API routes, ranked by name, word and initials.
- **Drift test** checks three things:
  - every export in the facade `.d.ts` has a page
  - every exports subpath is documented
  - every `/api` link resolves

Rebased onto #241 with no conflicts. The generated reference reflects the #237–#241 surface; for example, `PlaneWithSense` has no page.

## Verified

- On this branch: `pnpm build` and `pnpm test`.
  - Builds 523 prerendered routes.
  - Bundle check passes: the largest chunk is 194.8 kB against a 200 kB limit, and home initial JS is 91.0 kB gzip against a 110 kB limit.
  - Docs tests pass: 584 tests.
- At the stack top (#244): lint, format:check, typecheck, size, check:artifacts, check:preprod and agents:check:strict all pass.
- Browser checks at the stack top:
  - `/api/plane/sense` and `/api/core/Color` render.
  - ⌘K returns symbol hits and opens the selected page.
  - No horizontal scroll at 375 px.
  - No console errors or hydration warnings.

Part of the color-kit assessment stack.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
pbroom added a commit that referenced this pull request Oct 10, 2026
Delete the last legacy page (_legacy/api/plane-api.mdx); its quick start
now lives in src/examples/plane and its prose in the plane narrative and
concepts.

The content link test now resolves internal links against the route
registry built from the generated API data, so /api links must name a
generated page (canonical entry only) instead of a barrel export parsed
from source. Member anchors stay with the API drift test.

Reflect the #237-#241 behaviour fixes: the headless picker guide notes
that the driver rejects 'p3' and adds a typed-input section showing that
percentages in an expression are positions in the range; the core
narrative notes saturate/desaturate are uncapped above 0.4; the plane
narrative notes planeHue returns an OKLCH hue.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
pbroom added a commit that referenced this pull request Oct 10, 2026
## Summary

Docs overhaul slice S4: concept pages, guides and narratives for each entry point. A small commit on top finishes the integration with S2, S3 and #237–#241.

**Content**

- Five concepts:
  - OKLCH-canonical colors
  - requested vs displayed
  - planes and queries
  - gamut and tolerance
  - contrast
- Five guides, each with one live example under `src/examples/{guides,driver}`:
  - a headless picker with `color-kit/driver`
  - `color-kit/react`
  - contrast-aware palettes
  - GPU and three.js interop
  - performance
- A narrative `index.mdx` for each of the core, plane, interop, compute, hct and driver entry points.
- A polished `/start` quick start.
- The mined legacy MDX is deleted.

**Integration commit**

- Deletes the last legacy page, `_legacy/api/plane-api.mdx`, which had the stray "normalized" aside. Its quick start is now in S3's `src/examples/plane/quick-start.tsx`. No `_legacy` files remain.
- Rewrites the content link test to check against the route registry built from the generated API data. Every `/api` link must name a generated page, which means the canonical entry only, so root re-exports fail. Member anchors stay with S2's drift test.
- Brings the content in line with #237–#241:
  - The headless picker guide notes that the driver rejects `'p3'` with the same `TypeError` as core.
  - A new "Typed input" section shows that a `%` in an expression is a position in the range, so `50% * 2` on `[100, 200]` gives 300.
  - The core narrative says `saturate`/`desaturate` clamp chroma only at 0.
  - The plane narrative says `planeHue` returns an OKLCH hue.
  - No content references `PlaneWithSense`.

## Verified

- `pnpm build` and `pnpm test` pass. Docs tests pass: 792 tests, including the content link test and the API drift test.
- A negative check confirms that `/api/core/definePlane` and `/api/core/PlaneWithSense` fail the link test.
- The new snippet values were checked against the built facade.
- These gates pass: lint, format:check, typecheck, size, check:artifacts, check:preprod and agents:check:strict.
- Docs chunk budget: the largest chunk is 194.8 kB against a 200 kB limit.
- Docs home budget: home initial JS is 101.6 kB gzip against a 110 kB limit.
- Browser checks on the built site:
  - home hero drag
  - `/start`
  - `/concepts/planes-and-queries`
  - `/guides/headless-picker`
  - `/api/plane/sense`
  - `/api/core/Color`
  - ⌘K
  - light and dark themes
  - 375 px with no horizontal scroll
  - no console errors or hydration warnings

Part of the color-kit assessment stack.

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

This branch was successfully deployed

1 active deployment
Preview — 657eb678 Deployed Oct 10, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant