Repository navigation
Version palette generation receipts - #7679
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report
|
There was a problem hiding this comment.
Changes requested for one small documentation gap; the receipt change itself looks right: generatorVersion and candidateFormatVersion satisfy AST-008 FR6, the format comes from the same serializer that produced the hashed bytes, and candidate bytes, digests, and every existing receipt field are unchanged. Because generationReceipt is part of the stable theme.palette.generate response, AST-017 DEC-4 also asks for consumer documentation of new fields in the same change, and today they are described only in the TonalPaletteGenerationReceipt typedef and the changeset. Please name both fields and their values in the theme.palette.generate entry of packages/cli/foundation/response/response-types.doc.mjs (then run pnpm -F @astryxdesign/cli readme), and ideally in the themePaletteGenerate() returns text; adding that response to response-types.doc.test.mjs would keep future receipt fields from landing undocumented.
[Automated review]
| * @property {1} schemaVersion | ||
| * @property {'astryx-oklch-v1'} recipe Recipe that produced the candidate. | ||
| * @property {string} candidateSha256 SHA-256 over the candidate bytes as written. | ||
| * @property {'palette-generator-v1'} generatorVersion Generator |
There was a problem hiding this comment.
generatorVersion and candidateFormatVersion are new members of the stable theme.palette.generate response, so AST-017 DEC-4 needs them in the consumer reference too, not only in this typedef. Please name both, with their values, in the theme.palette.generate entry of packages/cli/foundation/response/response-types.doc.mjs and regenerate the CLI README table (pnpm -F @astryxdesign/cli readme).
Summary: Palette generation receipts now name the generator implementation (`generatorVersion: palette-generator-v1`) and the format of the candidate bytes they hash (`candidateFormatVersion`: `palette-typescript-v1` for a TypeScript output, `palette-json-v1` for a JSON output or a printed candidate), as AST-008 FR6 requires. The serializer returns the format together with the exact bytes it produced, so the recorded format always matches the hashed output. `candidateSha256` and every existing receipt field keep their values and order. The version constants are module exports beside `PALETTE_PREVIEW_VERSION`; the public API barrel is unchanged. Test Plan: pnpm exec vitest run packages/cli/api/theme/palette/generate scripts/palette-receipt-test-utils.test.mjs scripts/generate-neutral-palette-refs.test.mjs scripts/check-theme-template.test.mjs; tsc --project packages/cli/tsconfig.strict.json; eslint and prettier --check on changed files; pnpm check:changesets. Reviewers: Subscribers: Tasks: Tags:
d879020 to
57e216e
Compare
There was a problem hiding this comment.
Recommending approval: generatorVersion and candidateFormatVersion give each palette receipt the implementation and output-format identity that AST-008 FR6 asks for, the format comes from the same serializer that produced the hashed bytes, and candidate bytes, digests and every existing receipt field are unchanged. Both fields are now documented in the theme.palette.generate response reference, the generated CLI README table and the themePaletteGenerate() returns text, with a contract test guarding them, which resolves the earlier documentation request. Nothing further is needed here; the theme receipts can be regenerated in their own pull requests as planned.
[Automated review]
Summary: Palette generation receipts now name the generator implementation (`generatorVersion: palette-generator-v1`) and the format of the candidate bytes they hash (`candidateFormatVersion`: `palette-typescript-v1` for a TypeScript output, `palette-json-v1` for a JSON output or a printed candidate), as AST-008 FR6 requires. The serializer returns the format together with the exact bytes it produced, so the recorded format always matches the hashed output. `candidateSha256` and every existing receipt field keep their values and order. The version constants are module exports beside `PALETTE_PREVIEW_VERSION`; the public API barrel is unchanged. Test Plan: pnpm exec vitest run packages/cli/api/theme/palette/generate scripts/palette-receipt-test-utils.test.mjs scripts/generate-neutral-palette-refs.test.mjs scripts/check-theme-template.test.mjs; tsc --project packages/cli/tsconfig.strict.json; eslint and prettier --check on changed files; pnpm check:changesets. Reviewers: Subscribers: Tasks: Tags:
* Share palette generation test infrastructure * Record generator and format versions in palette receipts (#7679) Summary: Palette generation receipts now name the generator implementation (`generatorVersion: palette-generator-v1`) and the format of the candidate bytes they hash (`candidateFormatVersion`: `palette-typescript-v1` for a TypeScript output, `palette-json-v1` for a JSON output or a printed candidate), as AST-008 FR6 requires. The serializer returns the format together with the exact bytes it produced, so the recorded format always matches the hashed output. `candidateSha256` and every existing receipt field keep their values and order. The version constants are module exports beside `PALETTE_PREVIEW_VERSION`; the public API barrel is unchanged. Test Plan: pnpm exec vitest run packages/cli/api/theme/palette/generate scripts/palette-receipt-test-utils.test.mjs scripts/generate-neutral-palette-refs.test.mjs scripts/check-theme-template.test.mjs; tsc --project packages/cli/tsconfig.strict.json; eslint and prettier --check on changed files; pnpm check:changesets. Reviewers: Subscribers: Tasks: Tags:
Operational problem
spec:AST-008/FR6requires detached palette-generation receipts to name the recipe and implementation versions and every output-format version. Existing receipts name the versioned recipe and preview format but omit the generator implementation and candidate serialization formats.Without those identities, two generators or serializers could produce different candidate bytes while leaving the receipt unable to say which implementation and format were hashed.
Change
palette-generator-v1,palette-typescript-v1, andpalette-json-v1identities.generatorVersionandcandidateFormatVersionimmediately before the existingcandidateSha256..ts; JSON for.jsonand in-memory output.theme.mjsAPI unchanged; the constants remain local to the generator modules.Theme-specific receipt regeneration remains in each owning theme PR so this infrastructure change contains no palette values.
Failure proof
The previous
TonalPaletteGenerationReceiptshape containedschemaVersion,recipe, digests, request, and diagnostics, but no implementation or candidate-format version. That was incomplete againstspec:AST-008/FR6even when candidate bytes reproduced.Success proof
Unchanged product behavior
Testing
pnpm check:changesetspnpm check:knowledge