Repository navigation
experimental theme: set refuses an option that does not apply instead of dropping it - #13273
josephfarina wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet.
Non-blocking follow-ups:
- A
contrast-acceptedline typed in the wrong order (set contrast-accepted ac '<reason>' --on button --ground button --mode light) now gets "ac takes no --ground", because the--groundcheck runs before the word-order repairs; skipping that check whencontrast-acceptedis among the typed words would keep the repair path useful. - The new test's rows use a theme that does not exist and leave out
--groundand--mode, so on the base they fail with a different error instead of the silent success the description reports; one row on the fixture theme with the full place plus--pngwould show the old drop. - The CLI help for
--state,--onlyand--pngdoes not say they are refused withcontrast-accepted; only the function doc does.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim (changeset):
setrefuses--groundwith any thing butcontrast-acceptedwithERR_INVALID_ARGUMENT: verified,packages/cli/api/theme-edit/_edit.mjs:2228-2232, test row attheme-contrast-accepted-as-designed.test.mjs:401. - Claim (changeset):
setrefuses--state,--onlyor--pngwithcontrast-accepted: verified,_edit.mjs:2217-2226, test rows at:398-400. - Claim (changeset): these options were dropped before: verified; at the base only the contrast-accepted path reads
--ground, and that path never reads the other three; a fixture run on the base wrote--color-accentwith--ground cardignored. - Claim (changeset): an experimental patch change: verified, matches the experimental-surface rule for a patch Changeset.
- Claim (description):
set t background-color '#fff' --on card --ground pagesucceeded and ignored--groundbefore, and is refused now: verified from the code path and the fixture run. - Claim (description): the regression test covers options that do not apply: verified, it fails on the base and passes here.
- Claim (description): no new public API, default or interaction is hidden, and no separable tagalong: verified, no command, option or default changes.
- Claim (description): no internal context in public text: verified.
- Claim (description): touched tests, eslint and the strict typecheck pass: touched test file and eslint verified; the typecheck reports no error in the changed files.
- File
.changeset/experimental-theme-set-option-pairs.md: clear. - File
packages/cli/api/theme-edit/_edit.mjs: non-blocking note on the word-order repairs. - File
packages/cli/api/theme-edit/theme-contrast-accepted-as-designed.test.mjs: non-blocking note on the test rows. - File
packages/cli/api/theme-edit/themeEditSet.doc.mjs: clear; consistent with the code.
| ); | ||
| return acceptContrast(theme, String(value ?? ''), options); | ||
| } | ||
| if (/** @type {any} */ (options).ground != null) |
There was a problem hiding this comment.
Non-blocking: this check runs before change, so the word-order repairs in the catch below never see a set that carries --ground. set contrast-accepted ac '<reason>' --on button --when variant:primary --ground button --mode light now answers "ac takes no --ground", though contrast-accepted was typed and ac is the theme. Skipping this refusal when contrast-accepted is one of the typed words (and letting swappedOrder and themeLeftOut carry --ground in their flag lists) would keep the repair path useful.
| ['contrast-accepted', "matches the original's label", {state: 'hover'}], | ||
| ['contrast-accepted', "matches the original's label", {only: true}], | ||
| ['contrast-accepted', "matches the original's label", {png: true}], | ||
| ['background-color', '#ffffff', {ground: 'card'}], |
There was a problem hiding this comment.
Non-blocking: every row runs on a theme that does not exist, and the contrast-accepted rows leave out --ground and --mode, so on the base they fail with ERR_MISSING_ARGUMENT (or an unknown-theme error) rather than the silent success this pull request fixes. One row on the fixture theme ac with {...PLACE, png: true} would write an acceptance on the base and be refused here.
5d139fe to
5cff489
Compare
7757caf to
10ab7a1
Compare
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet.
Non-blocking follow-ups:
--groundis refused before the thing is checked, so a mistyped line that carries it (set ac contrast-acepted …,set contrast-accepted ac …, or a line with the theme left out) is told "X takes no --ground" instead of the unknown-thing or unknown-theme answer and repair line it got before; refusing--groundonly once the thing is known, and letting the repairs carry it, would keep those answers.- The new test's rows use a theme that does not exist and leave out
--groundand--mode, so on the base they fail withERR_MISSING_ARGUMENTinstead of the silent success the description reports; one row on the fixture theme with the full place plus--pngwould show the old drop. - The CLI help for
--state,--onlyand--pngdoes not say they are refused withcontrast-accepted; only the function doc does.
Claims and files checked
Review mode: full; reason: rebase
- Claim (changeset):
setrefuses--groundwith any thing butcontrast-acceptedwithERR_INVALID_ARGUMENT: verified,packages/cli/api/theme-edit/_edit.mjs:2228-2232, test rowtheme-contrast-accepted-as-designed.test.mjs:409, and runs on a fixture theme for a token, a CSS property and a dial. - Claim (changeset):
setrefuses--state,--onlyor--pngwithcontrast-accepted: verified,_edit.mjs:2217-2226, test rows:406-408, fixture runs. - Claim (changeset): these options were dropped before: verified; on the base each such line wrote its change with the option ignored.
- Claim (changeset): an experimental patch change: verified,
[experimental]with apatchbump. - Claim (description):
set t background-color '#fff' --on card --ground pagesucceeded and ignored--groundbefore, and is refused now: verified on both trees. - Claim (description):
contrast-accepteddropped--state,--onlyand--pngthe same way: verified on the base. - Claim (description): each option now composes with the thing or is refused: verified for every documented
setoption; the plain accept line still writes. - Claim (description): the regression test covers options that do not apply: verified, it fails on the base and passes here (see the follow-up on what it reproduces).
- Claim (description): one defect, no tagalong, no hidden public API, default or interaction, no internal context: verified.
- Claim (description): touched tests, eslint and the CLI strict typecheck pass: the touched test file and eslint verified; the typecheck reports no error in a changed file; no other test reaches the new guard.
- File
.changeset/experimental-theme-set-option-pairs.md: clear; matches the code and the doc line. - File
packages/cli/api/theme-edit/_edit.mjs: non-blocking note on the refusal's placement before the thing is checked. - File
packages/cli/api/theme-edit/theme-contrast-accepted-as-designed.test.mjs: non-blocking note on the test rows. - File
packages/cli/api/theme-edit/themeEditSet.doc.mjs: clear; lists exactly the two refused cases.
|
/approve-spec 10ab7a1 |
5cff489 to
eb3534f
Compare
10ab7a1 to
03b0d68
Compare
|
/approve-spec 03b0d68 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet.
Non-blocking follow-ups:
--groundis refused before the thing is checked, so a mistyped line that carries it (set ac contrast-acepted …,set contrast-accepted ac …, or a line with the theme left out) is told "X takes no --ground" instead of the unknown-thing or unknown-theme answer and repair line it got before; refusing--groundonly once the thing is known, and letting the repairs carry it, would keep those answers.- The new test's rows use a theme that does not exist and leave out
--groundand--mode, so on the base they fail withERR_MISSING_ARGUMENTinstead of the silent success the description reports; one row on the fixture theme with the full place plus--pngwould show the old drop. - The CLI help for
--state,--onlyand--pngdoes not say they are refused withcontrast-accepted; only the function doc does.
Claims and files checked
Review mode: full; reason: rebase
- Claim (changeset):
setrefuses--groundwith any thing butcontrast-acceptedwithERR_INVALID_ARGUMENT: verified,packages/cli/api/theme-edit/_edit.mjs:2244-2248, test rowtheme-contrast-accepted-as-designed.test.mjs:409, and runs on a fixture theme for a CSS property, a token and a dial. - Claim (changeset):
setrefuses--state,--onlyor--pngwithcontrast-accepted: verified,_edit.mjs:2233-2241, test rows:406-408, fixture runs. - Claim (changeset): these options were dropped before: verified; on the base each such line wrote its change with the option ignored, and
--pngtook no pictures. - Claim (changeset): an experimental patch change: verified,
[experimental]with apatchbump. - Claim (description):
set t background-color '#fff' --on card --ground pagesucceeded and ignored--groundbefore, and is refused now: verified on both trees. - Claim (description):
contrast-accepteddropped--state,--onlyand--pngthe same way: verified on the base. - Claim (description): each option now composes with the thing or is refused: verified for every documented
setoption; the plain accept line still writes. - Claim (description): the regression test covers options that do not apply: verified, it fails on the base and passes here (see the follow-up on what it reproduces).
- Claim (description): one defect, no tagalong, no hidden public API, default or interaction, no internal context: verified.
- Claim (description): touched tests, the stack's theme-editor tests, eslint and the CLI strict typecheck pass: the touched test file and eslint verified; the typecheck reports no error in a changed file; no other test passes
--groundor puts--state,--onlyor--pngoncontrast-accepted, so the guard cannot change them. - Claim (description): the gate lines (preflight pass, replay worse 0): they name an earlier head whose patch is identical to this one; not rerun here.
- File
.changeset/experimental-theme-set-option-pairs.md: clear; matches the code and the doc line. - File
packages/cli/api/theme-edit/_edit.mjs: non-blocking note on the refusal's placement before the thing is checked. - File
packages/cli/api/theme-edit/theme-contrast-accepted-as-designed.test.mjs: non-blocking note on the test rows. - File
packages/cli/api/theme-edit/themeEditSet.doc.mjs: clear; lists exactly the two refused cases.
03b0d68 to
222770c
Compare
|
/approve-spec 222770c |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet.
Non-blocking follow-ups:
--groundis refused before the thing is checked, so a mistyped line that carries it (set contrast-accepted ac …,set ac contrast-acepted …, or a line with the theme left out) is told "X takes no --ground" instead of the unknown-theme or unknown-thing answer and repair line it got before; refusing--groundonly once the thing is known, and letting the repairs carry it, would keep those answers.- The new test's rows use a theme that does not exist and leave out
--groundand--mode, so on the base they fail withERR_MISSING_ARGUMENTinstead of the silent success the description reports; one row on the fixture theme with the full place plus--pngwould show the old drop. - The CLI help for
--state,--onlyand--pngdoes not say they are refused withcontrast-accepted; only the function doc does.
Claims and files checked
Review mode: full; reason: rebase
- Claim (Changeset):
setrefuses--groundwith any thing butcontrast-accepted, withERR_INVALID_ARGUMENT: verified,packages/cli/api/theme-edit/_edit.mjs:2244-2248, test rowtheme-contrast-accepted-as-designed.test.mjs:425, and fixture runs for a CSS property, a token and a dial. - Claim (Changeset):
setrefuses--state,--onlyor--pngwithcontrast-accepted: verified,_edit.mjs:2233-2241, test rows:422-424, fixture runs. - Claim (Changeset): these options were dropped before: verified; on the base each such line wrote its change with the option ignored, and
--pngtook no pictures. - Claim (Changeset): an experimental patch change: verified,
[experimental]with apatchbump. - Claim (description):
set t background-color '#fff' --on card --ground pagesucceeded and ignored--groundbefore, and is refused now: verified on both trees. - Claim (description):
contrast-accepteddropped--state,--onlyand--pngthe same way: verified on the base. - Claim (description): each option now composes with the thing or says why not: verified for every documented
setoption; the other cells are refused or saved with a note, and the plain accept line still writes. - Claim (description): the regression test covers options that do not apply: verified, it fails on the base and passes here (see the follow-up on what it reproduces).
- Claim (description): one defect, no tagalong, no hidden public API, default, visual or interaction, no internal context: verified.
- Claim (description): the touched tests, eslint and the CLI strict typecheck pass, and the stack's theme-editor tests are unaffected: the touched test file and eslint verified; the typecheck reports no error in a changed file; no other test passes
--groundor usescontrast-accepted, so the guard cannot change them. - Claim (description): the gate lines: verified in part; the pull request's own patch is unchanged from the earlier head it names, and the scoped checks pass here; the replay count itself was not rerun.
- File
.changeset/experimental-theme-set-option-pairs.md: clear; matches the code and the doc line. - File
packages/cli/api/theme-edit/_edit.mjs: non-blocking note on the refusal's placement before the thing is checked. - File
packages/cli/api/theme-edit/theme-contrast-accepted-as-designed.test.mjs: non-blocking note on the test rows. - File
packages/cli/api/theme-edit/themeEditSet.doc.mjs: clear; lists exactly the two refused cases.
222770c to
75a5f8c
Compare
|
/approve-spec 75a5f8c |
There was a problem hiding this comment.
Changes requested: the option refusals look right, but one description claim is false at this head.
- Regression: the Testing and Gate sections say this head passes the CLI strict typecheck and preflight, but since the rebase the tree fails
pnpm -F @astryxdesign/cli typecheck:strictwith TS7006 atpackages/cli/api/theme-edit/_settings.mjs:12779, because the base's newest commit putkeptRecordsandkeptAsDesignedbetweenoneNotePerCause's JSDoc and its declaration; fix that in the parent branch and rebase, or correct those two lines.
The earlier non-blocking follow-ups still apply: the --ground refusal runs before the thing is checked, so mistyped lines lose their unknown-theme or unknown-thing answer; the new test's rows fail on the base for a missing argument rather than reproducing the silent drop; and set --help does not say --state, --only and --png are refused with contrast-accepted.
Claims and files checked
Review mode: full; reason: rebase
- Claim (Changeset):
setrefuses--groundwith any thing butcontrast-accepted, withERR_INVALID_ARGUMENT: verified,packages/cli/api/theme-edit/_edit.mjs:2244-2248, test rowtheme-contrast-accepted-as-designed.test.mjs:467, and fixture runs for a CSS property, a token and a dial. - Claim (Changeset):
setrefuses--state,--onlyor--pngwithcontrast-accepted: verified,_edit.mjs:2233-2241, test rows:464-466, fixture runs. - Claim (Changeset): these options were dropped before: verified; on the base each such line wrote its change with the option ignored, and
--pngtook no pictures. - Claim (Changeset): an experimental patch change: verified,
[experimental]with apatchbump. - Claim (description): a property line with
--groundsucceeded and ignored it before, and is refused now: verified on both trees with the description's own line. - Claim (description):
contrast-accepteddropped--state,--onlyand--pngthe same way: verified on the base. - Claim (description): each of these options now composes with the thing or says why not: verified for the four options the change touches; the plain accept line still writes.
- Claim (description): the regression test covers options that do not apply: verified, it fails on the base and passes here (see the follow-up on what it reproduces).
- Claim (description): one defect, no tagalong, no hidden public API, default, visual or interaction, no internal context: verified.
- Claim (description): the touched tests and eslint pass: verified, 20 of 20 in the touched file and eslint clean on the changed files.
- Claim (description): the stack's theme-editor tests pass: the touched file verified; no other test passes
--groundor usescontrast-accepted, so the guard cannot change them. - Claim (description): the CLI strict typecheck passes on this tree: false, TS7006 at
packages/cli/api/theme-edit/_settings.mjs:12779, which the base tree shares. - Claim (description): preflight passes at this head: false, its typecheck step runs the same strict typecheck for a change under
packages/cli; the replay count was not rerun. - File
.changeset/experimental-theme-set-option-pairs.md: clear; matches the code and the doc line. - File
packages/cli/api/theme-edit/_edit.mjs: non-blocking note on the refusal's placement before the thing is checked. - File
packages/cli/api/theme-edit/theme-contrast-accepted-as-designed.test.mjs: non-blocking note on the test rows. - File
packages/cli/api/theme-edit/themeEditSet.doc.mjs: clear; lists exactly the two refused cases.
b3f8879 to
e0c3a28
Compare
75a5f8c to
38b1e43
Compare
|
/approve-spec 38b1e43 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. The refusals give each stray option pair a decided result, and the typecheck failure behind the last review's change request is gone now that the base is re-folded.
Non-blocking follow-ups from earlier reviews still apply: the --ground refusal runs before the thing is checked, so a mistyped line loses its unknown-theme or unknown-thing answer; the new test's rows fail on the base for a missing argument rather than reproducing the silent drop; and set --help does not say --state, --only and --png are refused with contrast-accepted.
Claims and files checked
Review mode: full; reason: rebase
- Claim (Changeset):
setrefuses--groundwith any thing butcontrast-accepted, withERR_INVALID_ARGUMENT: verified,packages/cli/api/theme-edit/_edit.mjs:2244-2248, test rowtheme-contrast-accepted-as-designed.test.mjs:467, and fixture runs for a CSS property, a token and a dial. - Claim (Changeset):
setrefuses--state,--onlyor--pngwithcontrast-accepted: verified,_edit.mjs:2233-2241, test rows:464-466, fixture runs. - Claim (Changeset): these options were dropped before: verified; on the base each such line wrote its change with the option ignored, and
--pngtook no pictures. - Claim (Changeset): an experimental patch change: verified,
[experimental]with apatchbump. - Claim (description): a property line with
--groundsucceeded and ignored it before, and is refused now: verified on both trees. - Claim (description):
contrast-accepteddropped--state,--onlyand--pngthe same way: verified on the base. - Claim (description): each option now composes with the thing or says why not: verified against every option
setdeclares; the plain accept line still writes. - Claim (description): the regression test covers options that do not apply: verified, it fails on the base and passes here (see the follow-up on what it reproduces).
- Claim (description): one defect, no tagalong, no hidden public API, default, visual or interaction, no internal context: verified.
- Claim (description): the touched tests and eslint pass: verified, 20 of 20 in the touched file and eslint clean on the changed files.
- Claim (description): the stack's theme-editor tests pass: the touched file verified; no other test passes
--groundor usescontrast-accepted, so the guard cannot change them. - Claim (description): the CLI strict typecheck passes on this tree: verified, it exits 0 once the packages it reads are built.
- Claim (description): preflight passes at this head: verified for the parts rerun here (the builds the typecheck reads, both CLI typechecks, eslint, the touched tests, the changeset check); the rest of preflight and the replay count were not rerun.
- File
.changeset/experimental-theme-set-option-pairs.md: clear; matches the code and the doc line. - File
packages/cli/api/theme-edit/_edit.mjs: non-blocking note on the refusal's placement before the thing is checked. - File
packages/cli/api/theme-edit/theme-contrast-accepted-as-designed.test.mjs: non-blocking note on the test rows. - File
packages/cli/api/theme-edit/themeEditSet.doc.mjs: clear; lists exactly the two refused cases.
e0c3a28 to
c5f922e
Compare
38b1e43 to
a44450c
Compare
|
/approve-spec a44450c |
There was a problem hiding this comment.
Approved pending CI: the head commit skips CI, so no test, lint or typecheck workflow has run on this revision.
The four option pairs now have the decided result the CLI admission rules require: --ground with any thing but contrast-accepted, and --state, --only or --png with contrast-accepted, are refused with ERR_INVALID_ARGUMENT and write nothing, while a call whose options all apply is unchanged. The new test fails on the base and passes here, and a fixture probe confirms each pair writes no file. No blocking finding.
Three non-blocking follow-ups still stand from earlier reviews:
- The
--groundrefusal runs before the thing is checked, so a line carrying--groundloses the unknown-theme and word-order repairs it had before:set nosuch background-color '#ffffff' --on card --ground pageanswered "There is no theme "nosuch"" on the base and now answers "background-color takes no --ground". - Every row of the new test runs on a theme that does not exist, and the
contrast-acceptedrows leave out--groundand--mode, so on the base they fail for a missing argument rather than reproducing the silent drop; one row on the fixture theme with{...PLACE, png: true}would. set --helpstill describes--state,--onlyand--pngwithout sayingcontrast-acceptedrefuses them; only the function doc's error list carries it.
Claims and files checked
Review mode: full; reason: rebase
- Claim (release note):
setrefuses--groundwith any thing butcontrast-accepted, withERR_INVALID_ARGUMENT: verified,packages/cli/api/theme-edit/_edit.mjs:2249-2253, test rowtheme-contrast-accepted-as-designed.test.mjs:467, and fixture runs for a CSS property, a token and a dial. - Claim (release note):
setrefuses--state,--onlyor--pngwithcontrast-accepted: verified,_edit.mjs:2238-2246, test rows:464-466, fixture runs. - Claim (release note): those options were dropped before: verified; on the base each such call wrote its change with the option ignored, and
--pngtook no pictures. - Claim (release note): an experimental patch change: verified,
[experimental]with apatchbump, and the changeset check passes. - Claim (description): a property line with
--groundsucceeded and ignored it before, and is refused now: verified on both trees. - Claim (description):
contrast-accepteddropped--state,--onlyand--pngthe same way: verified on the base. - Claim (description): each option now composes with the thing or says why not: verified against every option
setdeclares; the plain accept line still writes. - Claim (description): the regression test covers options that do not apply: verified, it fails on the base and passes here (see the follow-up on what it reproduces).
- Claim (description): one defect, no separable tagalong, no hidden public API, default, visual or interaction, no internal context: verified.
- Claim (description): the touched tests and eslint pass: verified, 20 of 20 in the touched file, eslint clean on the changed files.
- Claim (description): the stack's theme-editor tests pass: the touched file verified; no other test in the CLI package passes
--groundor setscontrast-accepted, so the guard cannot change them. - Claim (description): the CLI strict typecheck passes on this tree: verified, exit 0 once the packages it reads are built; the template-docs typecheck passes too.
- Claim (description): preflight passes at this head, with the pull request's own diff unchanged by patch id: the patch id is verified identical to the previous revision's, and the parts of preflight rerun here pass (the builds the typecheck reads, both CLI typechecks, eslint, the touched tests, the changeset check); the rest of preflight and the replay count were not rerun.
- File
.changeset/experimental-theme-set-option-pairs.md: clear; matches the code and the doc line. - File
packages/cli/api/theme-edit/_edit.mjs: non-blocking note on the refusal's placement before the thing is checked. - File
packages/cli/api/theme-edit/theme-contrast-accepted-as-designed.test.mjs: non-blocking note on what the test rows reproduce. - File
packages/cli/api/theme-edit/themeEditSet.doc.mjs: clear; lists exactly the two refused cases.
… of dropping it --ground names the part under the text for contrast-accepted, and every other set thing dropped it without a word; contrast-accepted dropped --state, --only and --png the same way. Each is now refused with ERR_INVALID_ARGUMENT, so an option either composes with the thing or says why not. [skip ci]
a44450c to
5bbdd33
Compare
|
/approve-spec 5bbdd33 |
There was a problem hiding this comment.
Approved pending CI: the head commit skips CI, so no test, lint or typecheck workflow has run on this revision.
The four option pairs have the decided result the CLI admission rules require: --ground with any thing but contrast-accepted, and --state, --only or --png with contrast-accepted, are refused with ERR_INVALID_ARGUMENT and write nothing, while a call whose options all apply is unchanged. This revision only rebases onto the parent branch's new tip; the touched tests and the parent branch's new kept-contrast test pass on it. No blocking finding.
Three non-blocking follow-ups still stand from earlier reviews:
- The
--groundrefusal runs before the thing is checked, so a line carrying--groundloses the unknown-theme and word-order repairs it had before:set nosuch background-color '#ffffff' --on card --ground pageanswered "There is no theme "nosuch"" on the base and now answers "background-color takes no --ground". - Every row of the new test runs on a theme that does not exist, and the
contrast-acceptedrows leave out--groundand--mode, so on the base they fail for a missing argument rather than reproducing the silent drop; one row on the fixture theme with{...PLACE, png: true}would. set --helpstill describes--state,--onlyand--pngwithout sayingcontrast-acceptedrefuses them; only the function doc's error list carries it.
Claims and files checked
Review mode: carry-forward; reason: none
- Claim (release note):
setrefuses--groundwith any thing butcontrast-accepted, withERR_INVALID_ARGUMENT: verified,packages/cli/api/theme-edit/_edit.mjs:2249-2253, test rowtheme-contrast-accepted-as-designed.test.mjs:467, and fixture runs for a CSS property, a token and a dial. - Claim (release note):
setrefuses--state,--onlyor--pngwithcontrast-accepted: verified,_edit.mjs:2238-2246, test rows:464-466, fixture runs. - Claim (release note): those options were dropped before: verified; on the base each such call wrote its change with the option ignored, and
--pngtook no pictures. - Claim (release note): an experimental patch change: verified,
[experimental]with apatchbump, and the changeset check passes on this revision. - Claim (description): a property line with
--groundsucceeded and ignored it before, and is refused now: verified on both trees. - Claim (description):
contrast-accepteddropped--state,--onlyand--pngthe same way: verified on the base. - Claim (description): each option now composes with the thing or says why not: verified against every option
setdeclares; the plain accept line still writes. - Claim (description): the regression test covers options that do not apply: verified, it fails on the base and passes on this revision (see the follow-up on what it reproduces).
- Claim (description): one defect, no separable tagalong, no hidden public API, default, visual or interaction, no internal context: verified.
- Claim (description): the touched tests, the stack's theme-editor tests, the CLI strict typecheck and eslint pass on this layer's tree: verified on this revision; the touched file and the parent branch's new kept-contrast test pass, eslint is clean on the changed files, and the strict typecheck passes once the packages it reads are built; no other CLI test passes
--groundto another thing or an extra option tocontrast-accepted, so the guard cannot change them. - Claim (description): this revision is rebased onto #13272's fix with the pull request's own diff unchanged: verified, the base is #13272's head and the pull request's own patch is identical to the previous revision's.
- Claim (description): preflight passes and replay reports no regression on this revision: the parts of preflight rerun here pass (the builds the typecheck reads, both CLI typechecks, eslint, the touched tests, the changeset check); the rest of preflight and the replay count were not rerun.
- File
.changeset/experimental-theme-set-option-pairs.md: clear; matches the code and the doc line. - File
packages/cli/api/theme-edit/_edit.mjs: non-blocking note on the refusal's placement before the thing is checked. - File
packages/cli/api/theme-edit/theme-contrast-accepted-as-designed.test.mjs: non-blocking note on what the test rows reproduce. - File
packages/cli/api/theme-edit/themeEditSet.doc.mjs: clear; lists exactly the two refused cases.
|
/approve-spec a00e926 |
There was a problem hiding this comment.
Approved pending CI: the head commit skips CI, so no test, lint or typecheck workflow has run on this revision.
This revision only rewords the release note, which stays accurate: --ground with any thing but contrast-accepted, and --state, --only or --png with contrast-accepted, are refused with ERR_INVALID_ARGUMENT and write nothing, and the touched tests and the changeset check pass on it. No blocking finding; three non-blocking follow-ups from earlier reviews still stand:
- The
--groundrefusal runs before the theme is found, so a line that names a missing theme and carries--groundloses the unknown-theme answer:set nosuch background-color '#ffffff' --on card --ground pageanswered "There is no theme "nosuch"" on the base and now answers "background-color takes no --ground". - Every row of the new test runs on a theme that does not exist, and the
contrast-acceptedrows leave out--groundand--mode, so on the base they fail for a missing argument rather than reproducing the silent drop; one row on the fixture theme with{...PLACE, png: true}would. set --helpstill describes--state,--onlyand--pngwithout sayingcontrast-acceptedrefuses them; only the function doc's error list carries it.
Claims and files checked
Review mode: incremental; reason: none
- Changed rules (0): none.
- Claim (release note):
setrefuses--groundwith any thing butcontrast-accepted, withERR_INVALID_ARGUMENT: verified,packages/cli/api/theme-edit/_edit.mjs:2249-2253and test rowtheme-contrast-accepted-as-designed.test.mjs:467. - Claim (release note):
setrefuses--state,--onlyor--pngwithcontrast-accepted: verified,_edit.mjs:2238-2246and test rows:464-466. - Claim (release note): an experimental patch change: verified,
[experimental]with apatchbump; the changeset check and Prettier pass on this revision. - Claim (title and description): those options were dropped without a word before: verified on the base with fixture runs; each such call wrote its change with the option ignored, and
--pngtook no pictures. - Claim (description): a property line with
--groundsucceeded and ignored it before, and is refused now: verified,_edit.mjs:2249and the base behaviour above. - Claim (description): each option now composes with the thing or says why not: verified against every option
setdeclares; a call whose options all apply passes the guard, because the CLI sendsonlyandpngas false andgroundonly when given. - Claim (description): the regression test covers options that do not apply: verified, it passes on this revision and fails on the base (see the follow-up on what it reproduces).
- Claim (description): one defect, no separable tagalong, no hidden public API, default, visual or interaction, no internal context: verified.
- Claim (description): the touched tests, the stack's theme-editor tests, the CLI strict typecheck and eslint pass on this layer's tree: the touched test file (20 of 20), the parent branch's kept-contrast test and eslint pass on this revision; the strict typecheck passed on the same code before this revision, which changes only the release note; no other CLI test reaches the guard, and the rest of the theme-editor suite was not rerun.
- Claim (description): preflight passes and replay reports no regression, with only release-note text changed since the previous revision: the release-note-only change is verified; the parts of preflight rerun here pass (changeset check, eslint, touched tests); the rest of preflight and the replay count were not rerun.
- File
.changeset/experimental-theme-set-option-pairs.md: clear; the reworded note matches the code and the doc line. - File
packages/cli/api/theme-edit/_edit.mjs: non-blocking note on the refusal running before the theme is found. - File
packages/cli/api/theme-edit/theme-contrast-accepted-as-designed.test.mjs: non-blocking note on what the test rows reproduce. - File
packages/cli/api/theme-edit/themeEditSet.doc.mjs: clear; lists exactly the two refused cases.
…apply instead of dropping it
…apply instead of dropping it
User impact
setrefuses an option that does not apply, instead of dropping it silently.Problem and solution fit
--groundnames the part under the text forcontrast-accepted; every othersetthing dropped it without a word.contrast-accepteddropped--state,--onlyand--pngthe same way. Each is now refused withERR_INVALID_ARGUMENT, so an option either composes with the thing or says why not.Evidence
set t background-color '#fff' --on card --ground pagesucceeded and ignored--ground.ERR_INVALID_ARGUMENT.theme-contrast-accepted-as-designed.test.mjs(options that do not apply).Scope
Components: theme editor (set)
Testing
The touched tests, the stack's theme-editor tests, the CLI strict typecheck and eslint, on this layer's tree.
Gate
preflight: pass a00e926 (release note text only since 5bbdd33)
replay: worse 0 at a00e926 (release note text only since 5bbdd33)