Repository navigation
feat(cli): bases step two — theme commands call the base's themes adapter (prototype) - #11596
josephfarina wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
6aa9f77 to
6283120
Compare
There was a problem hiding this comment.
Approval waits on an engineering owner. This pull request writes new requirements into draft spec:AST-114 (the adapter entry and step contract, the rule that a base serves a step only to the commands that call it, and the not-exported reason) and adds new @astryxdesign/cli surface, while its non-Core theme path departs from current spec:AST-050 FR2, FR5 and FR8 without amending that record. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request (the author may do so as an engineering owner) and by naming the record that amends spec:AST-050 for non-Core bases.
Blocking findings to fix, independent of that decision:
theme build --outthrough a symlinked folder inside the project writes outside it, becauseapi/theme/base/base.mjs:135-143checks the path lexically instead of withassertWithinon real paths as Core'sconfineOutputdoes (architecture:cli-surfaceINV10).- The base build re-implements Core's output confinement and
--checkcomparison instead of callingconfineOutputandstaleBuildOutputs, so a CRLF checkout of a correct build fails--checkas outdated (spec:AST-050FR8). pnpm check:cli-structure, which the lint workflow runs, fails with five errors:api/base/has no FunctionDoc, typedefs or test, andapi/base/call-step.mjsandapi/theme/base/base.mjsread and write files outside the subject's adapter (INV20, INV21).- The base dispatch lives in the theme handler, so
themeBuildandthemeAddcalled through@astryxdesign/cli/apion a non-Core base still compile with Core and write Core's module body around the base's built module (INV22). - After a successful
theme buildandtheme addon a non-Core base,astryx doctorfailstheme-ownersbecauseresolveRecordedThemestill looks for<slug>.js, and the fix it names is the build and add that were just run (spec:AST-050FR11). - The generated TypeScript module on a base no longer exports
ThemeSlug, whichspec:AST-050FR2 lists among the module's public exports, because the CLI checks only forthemesanddefaultThemeSlug. - A typed
unsupportedfailure answersERR_BASE_CAPABILITYwithout therequirementmember that the response type and the README promise on that code. - The new changeset says a plain path "still" serves every step, and the unchanged
cli-bases.mdchangeset still says commands do not call base adapters, so the release notes contradict the change and each other.
Smaller notes are inline.
Claims and files checked
- Claim: theme targets, build, add, use and remove call the base's themes adapter on a non-Core base: verified (new bases tests; same commands run on a fixture project).
- Claim: the CLI does every write and writes nothing on a failure: verified (
base.mjsapplyWrites,_adapter.mjswriteThemeApp; tests for a throwingcompileand a malformedappModule). - Claim: builds write inside the project as one atomic write: false for a symlinked folder (finding 1).
- Claim:
--checkcompares the returned files, writes nothing and exits 1 when stale: verified in text and JSON, but CRLF is reported stale (finding 2). - Claim:
{module, steps}serves only the listed steps and an unlisted export is never called: verified (resolve.mjsbaseOf; listed-steps test). - Claim: a plain path "still" serves every step: false wording; on the base branch a plain path served no step (finding 8).
- Claim: the authoring entry publishes the step contracts: verified for the three themes steps.
- Claim: a throw or malformed value fails with
ERR_BASE_ADAPTERnaming base, step and module: verified (tests). - Claim: a listed step the module does not export refuses with
not-exported: verified (test), also for a plain path. - Claim: typed failures map to the command's codes with the message, location and fix: verified (
call-step.mjs), butunsupportedlacksrequirement(finding 7). - Claim:
--family,--watchand--outwith several files fail withERR_THEME_INVALID: verified (theme.mjs);--family-keyalone is accepted (inline note). - Claim: a local theme's module is
<slug>.{js,mjs,ts,tsx}and its stylesheet is null unless<slug>.cssexists: verified (theme-imports.mjs). - Claim: add, use and remove write the CLI header and record followed by the adapter's source, with no Core wiring snippet: verified.
- Claim: nothing changes on a Core run: verified (theme, discovery, config, doctor-theme and bases suites pass).
- Claim: the listed gates pass: bases tests (40), README, knowledge, changeset, API-type and lint checks re-run and pass;
check:cli-structure, not listed, fails (finding 3); strict typecheck not reproduced. - Files:
api/theme/base/base.mjsfindings 1, 2, 6;api/base/call-step.mjsfindings 3, 7;commands/theme.mjsfinding 4;api/theme/_adapter.mjsfinding 5;foundation/discovery/theme-imports.mjsfinding 4;.changeset/cli-bases-themes.mdfinding 8;docs/specs/AST-114-bases/spec.mdowner decision plus an inline formatting note;foundation/bases/requirements.mjsinline note. - Files clear:
README.md,api/doctor/theme-checks.mjs,api/integration/pack-check.mjs,api/theme/add/add.mjs,api/theme/build/build.mjs,api/theme/remove/remove.mjs,api/theme/targets/targets.mjs,api/theme/theme.type.mjs,api/theme/use/use.mjs,authoring/index.d.ts,authoring/integration/adapter.ts,authoring/integration/integration.doc.mjs,authoring/integration/schema.mjs,authoring/integration/type.ts,clients/cli/bases.test.mjs,clients/cli/lib/base-gate.mjs,clients/cli/lib/manifest.mjs,foundation/bases/resolve.mjs,foundation/bases/steps.mjs,foundation/config/theme-state.mjs,foundation/response/base.d.ts,foundation/response/error-codes.doc.mjs,foundation/response/error-codes.mjs(their new public types wait on the owner decision).
| const root = findPackageRoot(cwd) ?? cwd; | ||
| const outDir = options.out ? path.resolve(cwd, options.out) : path.dirname(source); | ||
| const rel = path.relative(root, outDir); | ||
| if (rel.startsWith('..') || path.isAbsolute(rel)) { | ||
| throw new AstryxError( | ||
| `--out ${options.out} is outside the project. Name a folder inside it.`, | ||
| undefined, | ||
| ERROR_CODES.ERR_PATH_TRAVERSAL, | ||
| ); |
There was a problem hiding this comment.
This check is lexical, and applyWrites refuses only a symlinked file, not a symlinked folder. With --out linked, where linked is a symlink inside the project to a folder outside it, the build exits 0 and writes matcha.ts outside the project (architecture:cli-surface INV10: output paths pass assertWithin, which canonicalises symlinks). Core's confineOutput in build/build.mjs already does this. Calling it also fixes the message: with no --out, a source outside the project currently fails with --out undefined is outside the project.
| // A file that cannot be read is missing. | ||
| } | ||
| if (current == null) stale.push({path: write.shown, reason: 'missing'}); | ||
| else if (current !== write.contents) stale.push({path: write.shown, reason: 'outdated'}); |
There was a problem hiding this comment.
This verbatim comparison re-implements Core's staleBuildOutputs / normalizeThemeBuildForCompare without the CRLF handling. A CRLF checkout of a correct build is reported outdated and exits 1, against spec:AST-050 FR8 ("treat CRLF and LF line endings as the same text"). Calling the shared helper keeps one path.
| check: value => { | ||
| if (typeof value.source !== 'string') return 'source is not a string.'; | ||
| for (const name of ['themes', 'defaultThemeSlug']) { | ||
| if (!new RegExp(`\\bexport\\s+(?:const|let|var)\\s+${name}\\b`, 'u').test(value.source)) { | ||
| return `source does not export ${name}.`; | ||
| } | ||
| } |
There was a problem hiding this comment.
In a TypeScript project, spec:AST-050 FR2 lists ThemeSlug among the generated module's public exports, and this check accepts a source without it. App code that imports ThemeSlug stops compiling when the project moves to a base. Require it here, or append export type ThemeSlug = keyof typeof themes; after the adapter's source.
| : failure.code === 'conflict' | ||
| ? ERROR_CODES.ERR_FILE_EXISTS | ||
| : ERROR_CODES.ERR_BASE_CAPABILITY; |
There was a problem hiding this comment.
A typed unsupported failure becomes ERR_BASE_CAPABILITY with only error and code. The response type (foundation/response/base.d.ts) and the README say requirement is present on that code, so a consumer that reads requirement.missing gets undefined. Give unsupported its own code, or build a requirement for it.
| * @position api/base — the one place a command reaches a base's code | ||
| */ | ||
|
|
||
| import * as fs from 'node:fs'; |
There was a problem hiding this comment.
pnpm check:cli-structure (run by check:repo in the lint workflow) fails here and on api/theme/base/base.mjs:14: both modules import node:fs outside the subject's adapter (INV21), and api/base/ has no FunctionDoc, typedefs or test (INV20). The check passes on the base branch.
| '@astryxdesign/cli': patch | ||
| --- | ||
|
|
||
| [feat] On a base other than Core, `theme targets`, `theme build`, and `theme add`, `use`, and `remove` call the base's `themes` adapter: `targets` returns the theming targets, `compile` returns the built files, and `appModule` returns the generated module's source. The CLI does every write. A base may list the steps an adapter serves with `adapters: {themes: {module, steps}}`; a plain path still serves every step. `@astryxdesign/cli/authoring` publishes the step contracts. A step that throws or returns a malformed result fails with the new `ERR_BASE_ADAPTER`, and a listed step the module does not export refuses with `reason: "not-exported"`. |
There was a problem hiding this comment.
"a plain path still serves every step": on the base branch a plain path serves no step (baseOf returns steps: []). The unchanged .changeset/cli-bases.md also still says "Commands do not call base adapters yet, so a base other than Core serves no platform step", and both notes ship in the same release. Suggest dropping "still" and amending cli-bases.md.
| module: | ||
|
|
||
| Error: astryx theme build needs the themes.compile step; the active base @acme/native-ui lists it but ./adapters/themes.mjs does not export it. | ||
| A |
There was a problem hiding this comment.
Non-blocking: this one-space A after the indented example ends the FR8 list item, so "A typed name … MUST fail this way" renders outside FR8. Indent it to two spaces and join it with the next line.
| const noun = requirement.missing.length === 1 ? 'step' : 'steps'; | ||
| if (requirement.reason === 'not-exported') { | ||
| const it = requirement.missing.length === 1 ? 'it' : 'them'; | ||
| return `${part} needs the ${steps} ${noun}; the active base ${requirement.base.name} lists ${it} but ${requirement.module} does not export ${it}.`; |
There was a problem hiding this comment.
Non-blocking: with a plain-path adapter, this line says the base "lists" the step, but the base listed nothing; it declared a path that serves every step. Wording such as "serves it through ./adapters/themes.mjs, which does not export it" fits both forms.
6283120 to
85e3b24
Compare
There was a problem hiding this comment.
Approval waits on an engineering owner. This pull request writes new requirements into draft spec:AST-114 (the adapter entry and step contract, the rule that a base serves a step only to the commands that call it, and the not-exported reason) and adds new @astryxdesign/cli surface, while its non-Core theme path departs from current spec:AST-050 FR2, FR5 and FR8 without amending that record. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request (the author may do so as an engineering owner) and by naming the record that amends spec:AST-050 for non-Core bases.
Blocking findings to fix, independent of that decision:
theme build --outthrough a symlinked folder inside the project writes outside it, becauseapi/theme/base/base.mjs:135-144checks the path lexically instead of withassertWithinon real paths as Core'sconfineOutputdoes (architecture:cli-surfaceINV10).- The base build re-implements Core's output confinement and
--checkcomparison instead of callingconfineOutputandstaleBuildOutputs, so a CRLF checkout of a correct build fails--checkas outdated (spec:AST-050FR8). pnpm check:cli-structure, which the lint workflow runs, fails with five errors:api/base/has no FunctionDoc, typedefs or test, andapi/base/call-step.mjsandapi/theme/base/base.mjsread and write files outside the subject's adapter (INV20, INV21).- The base dispatch lives in the theme handler, so
themeBuildandthemeAddcalled through@astryxdesign/cli/apion a non-Core base still compile with Core and write Core's module body around the base's built module (INV22). - After a successful
theme buildandtheme addon a non-Core base,astryx doctorfailstheme-ownersbecauseresolveRecordedThemestill looks for<slug>.js, and the fix it names is the build and add that were just run (spec:AST-050FR11). - The generated TypeScript module on a base no longer exports
ThemeSlug, whichspec:AST-050FR2 lists among the module's public exports, because the CLI checks only forthemesanddefaultThemeSlug. - A typed
unsupportedfailure answersERR_BASE_CAPABILITYwithout therequirementmember that the response type and the README promise on that code. - The new changeset says a plain path "still" serves every step, and the unchanged
cli-bases.mdchangeset still says commands do not call base adapters, so the release notes contradict the change and each other. - Miss: a base build writes every returned file over whatever is there, so a theme source named for its theme (
ocean.tswithname: 'ocean') or an unrelated file in the--outfolder is silently replaced, where Core's build refuses withERR_THEME_INVALIDorERR_FILE_EXISTS(api/theme/base/base.mjs:191-197,spec:AST-050FR8).
The earlier inline comments still apply; new smaller notes are inline.
Claims and files checked
- Claim: theme targets, build, add, use and remove call the base's themes adapter on a non-Core base: verified (bases tests; the same commands on a fixture project).
- Claim: the CLI does every write and writes nothing on a failure: verified for failures (tests for a throwing compile, a typed failure and a malformed appModule); successful writes can replace the source (finding 9).
- Claim: builds write inside the project as one atomic write: false for a symlinked folder (finding 1).
- Claim:
--checkcompares the returned files, writes nothing and exits 1 when stale: verified in text and JSON, but CRLF is reported stale (finding 2). - Claim:
{module, steps}serves only the listed steps and an unlisted export is never called: verified (listed-steps test). - Claim: a plain path "still" serves every step: false wording; on the base branch a plain path served no step (finding 8).
- Claim: the authoring entry publishes the step contracts: verified for the three themes steps; authoring and JSON API typechecks pass.
- Claim: a throw or malformed value fails with
ERR_BASE_ADAPTERnaming base, step and module: verified (tests). - Claim: a listed step the module does not export refuses with
not-exported: verified (test), also for a plain path. - Claim: typed failures map to the command's codes with the message, location and fix: verified, but
unsupportedlacksrequirement(finding 7). - Claim:
--family,--watchand--outwith several files fail withERR_THEME_INVALID: verified;--family-keyalone is accepted (non-blocking). - Claim: a local theme's module is
<slug>.{js,mjs,ts,tsx}and its stylesheet is null unless<slug>.cssexists: verified. - Claim: add, use and remove write the CLI header and record followed by the adapter's source, with no Core wiring snippet: verified.
- Claim: nothing changes on a Core run: verified (the seven published themes build identical outputs; theme, discovery, config, doctor-theme and bases suites pass).
- Claim: the listed gates pass: bases tests, README, knowledge, changeset, API-type and authoring checks re-run and pass;
check:cli-structure, not listed, fails (finding 3); the strict typecheck stops only on two templates that import an unbuilt theme package. - Files with findings:
api/theme/base/base.mjs(1, 2, 6, 9),api/base/call-step.mjs(3, 7),commands/theme.mjs(4),api/theme/_adapter.mjs(5),foundation/discovery/theme-imports.mjs(4),.changeset/cli-bases-themes.md(8),docs/specs/AST-114-bases/spec.md(owner decision, formatting note),foundation/bases/requirements.mjs(wording note). - Files clear:
README.md,api/doctor/theme-checks.mjs,api/integration/pack-check.mjs,api/theme/add/add.mjs,api/theme/build/build.mjs,api/theme/remove/remove.mjs,api/theme/targets/targets.mjs,api/theme/theme.type.mjs,api/theme/use/use.mjs,authoring/index.d.ts,authoring/integration/adapter.ts,authoring/integration/integration.doc.mjs,authoring/integration/schema.mjs,authoring/integration/type.ts,clients/cli/bases.test.mjs,clients/cli/lib/base-gate.mjs,clients/cli/lib/manifest.mjs,foundation/bases/resolve.mjs,foundation/bases/steps.mjs,foundation/config/theme-state.mjs,foundation/response/base.d.ts,foundation/response/error-codes.doc.mjs,foundation/response/error-codes.mjs(their new public types wait on the owner decision).
| writes.map(write => ({ | ||
| path: write.path, | ||
| contents: write.contents, | ||
| createOnly: false, |
There was a problem hiding this comment.
Miss from the earlier review: createOnly: false with no check of what each path holds. A theme source named for its theme (src/themes/ocean/ocean.ts, name: 'ocean') is replaced by the built module, exit 0, and with --out lib an unrelated lib/matcha.ts is overwritten too. Core's build refuses the source with ERR_THEME_INVALID and other existing files with ERR_FILE_EXISTS (theme-build.doc.mjs), and spec:AST-050 FR8 lets a build replace only its own earlier outputs. Refuse an output path equal to the source, and refuse to replace a file the CLI cannot show it wrote.
| ? declared | ||
| : path.basename(source).replace(/\.[^.]+$/u, ''); | ||
| const root = findPackageRoot(cwd) ?? cwd; | ||
| const outDir = options.out ? path.resolve(cwd, options.out) : path.dirname(source); |
There was a problem hiding this comment.
Non-blocking: on a base --out names a folder, but help still shows Core's text ("Output CSS file path"). --out dist/theme.css, the form the theme packages use, creates a folder dist/theme.css/ holding matcha.ts. Refuse a path ending in a file extension, or say in the option's text that a base takes a folder.
| async read(file) { | ||
| const resolved = path.resolve(projectDir ?? cwd, String(file)); | ||
| const inside = roots.some(root => { | ||
| const rel = path.relative(root, resolved); |
There was a problem hiding this comment.
Non-blocking: read is described as confined to the project and the base package, but this check is lexical, so a symlink inside the project reads a file outside both. Compare real paths (fs.realpathSync) or say the confinement is lexical.
85e3b24 to
f41a21b
Compare
There was a problem hiding this comment.
Approval waits on an engineering owner. This pull request writes new requirements into draft spec:AST-114 (the adapter entry and step contract, the rule that a base serves a step only to the commands that call it, and the not-exported reason) and adds new @astryxdesign/cli surface, while its non-Core theme path departs from current spec:AST-050 FR2, FR5 and FR8 without amending that record. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request (the author may do so as an engineering owner) and by naming the record that amends spec:AST-050 for non-Core bases.
Blocking findings to fix, independent of that decision; each still reproduces on this head, and the earlier inline comments, the non-blocking ones included, still apply:
theme build --outthrough a symlinked folder inside the project writes outside it, becauseapi/theme/base/base.mjs:136-144checks the path lexically instead of withassertWithinon real paths as Core'sconfineOutputdoes (architecture:cli-surfaceINV10).- The base build re-implements Core's output confinement and
--checkcomparison instead of callingconfineOutputandstaleBuildOutputs, so a CRLF checkout of a correct build fails--checkas outdated (spec:AST-050FR8). pnpm check:cli-structure, which the lint workflow runs, fails with five errors:api/base/has no FunctionDoc, typedefs or test, andapi/base/call-step.mjsandapi/theme/base/base.mjsread and write files outside the subject's adapter (INV20, INV21).- The base dispatch lives in the theme handler, so
themeBuildandthemeAddcalled through@astryxdesign/cli/apion a non-Core base still compile with Core and write Core's module body around the base's built module (INV22). - After a successful
theme buildandtheme addon a non-Core base,astryx doctorfailstheme-ownersbecauseresolveRecordedThemestill looks for<slug>.js, and the fix it names is the build and add that were just run (spec:AST-050FR11). - The generated TypeScript module on a base no longer exports
ThemeSlug, whichspec:AST-050FR2 lists among the module's public exports, because the CLI checks only forthemesanddefaultThemeSlug. - A typed
unsupportedfailure answersERR_BASE_CAPABILITYwithout therequirementmember that the README promises on that code. - The new changeset says a plain path "still" serves every step, and the unchanged
cli-bases.mdchangeset still says commands do not call base adapters, so the release notes contradict the change and each other. - Miss: a base build writes every returned file over whatever is there, so a theme source named for its theme (
ocean.tswithname: 'ocean') or an unrelated file in the--outfolder is silently replaced, where Core's build refuses withERR_THEME_INVALIDorERR_FILE_EXISTS(api/theme/base/base.mjs:191-197,spec:AST-050FR8).
Claims and files checked
- Claim: theme targets, build, add, use and remove call the base's themes adapter on a non-Core base: verified (bases tests; the same commands on a fixture project).
- Claim: targets keeps the CLI's filter, exact match and near-miss suggestions, with an empty class when the base gives none: verified (bases test).
- Claim: builds write every returned file inside the project as one atomic write: false for a symlinked folder (finding 1), and the write can replace the source (finding 9).
- Claim:
--checkcompares the returned files, writes nothing and exits 1 when stale: verified in text and JSON, but CRLF is reported stale (finding 2). - Claim: the JSON receipts are
theme.build.baseandtheme.build.check: verified. - Claim:
--family,--watchand--outwith several files fail withERR_THEME_INVALID: verified;--family-keyalone is accepted (non-blocking). - Claim: a local theme's module is
<slug>.{js,mjs,ts,tsx}and its stylesheet is null unless<slug>.cssexists: verified. - Claim: add, use and remove write the CLI header and record followed by the adapter's source, with relative specifiers and no Core wiring snippet: verified.
- Claim: typed failures map to the command's codes with the message, location and fix: verified, but
unsupportedlacksrequirement(finding 7). - Claim: a throw or malformed value fails with
ERR_BASE_ADAPTERnaming base, step and module, and writes nothing: verified (tests). - Claim: a listed step the module does not export refuses with
not-exported, and an unlisted export is never called: verified (tests). - Claim: nothing changes on a Core run: verified (the seven published themes build identical outputs; the CLI suites match the base branch).
- Claim: the listed gates pass: the bases tests and the CLI theme, config, discovery and doctor suites, README, knowledge, changeset, API-type and authoring checks and eslint re-run and pass (the full test suite was not re-run);
check:cli-structure, not listed, fails (finding 3); the strict typecheck stops only on two templates that import an unbuilt theme package. - Changeset claim: the theme commands call the adapter, the authoring entry publishes the step contracts, and the new error code and refusal reason exist: verified; "a plain path still serves every step": false (finding 8).
- Files with findings:
api/theme/base/base.mjs(1, 2, 6, 9),api/base/call-step.mjs(3, 7),commands/theme.mjs(4),api/theme/_adapter.mjs(5),foundation/discovery/theme-imports.mjs(4),api/theme/add/add.mjs,use/use.mjs,remove/remove.mjs,targets/targets.mjs(4, undocumented options),.changeset/cli-bases-themes.md(8),docs/specs/AST-114-bases/spec.md(owner decision, formatting note),foundation/bases/requirements.mjs(wording note). - Files clear:
README.md,api/doctor/theme-checks.mjs,api/integration/pack-check.mjs,api/theme/build/build.mjs,api/theme/theme.type.mjs,authoring/index.d.ts,authoring/integration/adapter.ts,authoring/integration/integration.doc.mjs,authoring/integration/schema.mjs,authoring/integration/type.ts,clients/cli/bases.test.mjs,clients/cli/lib/base-gate.mjs,clients/cli/lib/manifest.mjs,foundation/bases/resolve.mjs,foundation/bases/steps.mjs,foundation/config/theme-state.mjs,foundation/response/base.d.ts,foundation/response/error-codes.doc.mjs,foundation/response/error-codes.mjs(their new public types wait on the owner decision).
d84b672 to
5e76029
Compare
f41a21b to
73b8987
Compare
There was a problem hiding this comment.
Approval waits on an engineering owner. This pull request writes new requirements into draft spec:AST-114 (the adapter entry and step contract, the rule that a base serves a step only to the commands that call it, and the not-exported reason) and adds new @astryxdesign/cli surface, while its non-Core theme path departs from current spec:AST-050 FR2, FR5 and FR8 without amending that record. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request (the author may do so as an engineering owner) and by naming the record that amends spec:AST-050 for non-Core bases.
Blocking findings to fix, independent of that decision; each still reproduces on this head, and the earlier inline comments, the non-blocking ones included, still apply:
theme build --outthrough a symlinked folder inside the project writes outside it, becauseapi/theme/base/base.mjs:136-144checks the path lexically instead of withassertWithinon real paths as Core'sconfineOutputdoes (architecture:cli-surfaceINV10).- The base build re-implements Core's output confinement and
--checkcomparison instead of callingconfineOutputandstaleBuildOutputs, so a CRLF checkout of a correct build fails--checkas outdated (spec:AST-050FR8). pnpm check:cli-structure, which the lint workflow runs, fails with five errors:api/base/has no FunctionDoc, typedefs or test, andapi/base/call-step.mjsandapi/theme/base/base.mjsread and write files outside the subject's adapter (INV20, INV21).- The base dispatch lives in the theme handler, so
themeBuildandthemeAddcalled through@astryxdesign/cli/apion a non-Core base still compile with Core and write Core's module body around the base's built module (INV22). - After a successful
theme buildandtheme addon a non-Core base,astryx doctorfailstheme-ownersbecauseresolveRecordedThemestill looks for<slug>.js, and the fix it names is the build and add that were just run (spec:AST-050FR11). - The generated TypeScript module on a base no longer exports
ThemeSlug, whichspec:AST-050FR2 lists among the module's public exports, because the CLI checks only forthemesanddefaultThemeSlug. - A typed
unsupportedfailure answersERR_BASE_CAPABILITYwithout therequirementmember that the README promises on that code. - The new changeset says a plain path "still" serves every step, and the unchanged
cli-bases.mdchangeset still says commands do not call base adapters, so the release notes contradict the change and each other. - Miss: a base build writes every returned file over whatever is there, so a theme source named for its theme (
ocean.tswithname: 'ocean') or an unrelated file in the--outfolder is silently replaced, where Core's build refuses withERR_THEME_INVALIDorERR_FILE_EXISTS(api/theme/base/base.mjs:191-197,spec:AST-050FR8).
Claims and files checked
- Claim: theme targets, build, add, use and remove call the base's themes adapter on a non-Core base: verified (bases tests; the same commands on a fixture project).
- Claim: targets keeps the CLI's filter, exact match and near-miss suggestions, with an empty class when the base gives none: verified (bases test).
- Claim: build loads the source with no Core interception and passes the export, its name and the theme name to compile: verified (base build code and test).
- Claim: builds write every returned file inside the project as one atomic write: false for a symlinked folder (finding 1), and the write can replace the source (finding 9).
- Claim:
--checkcompares the returned files, writes nothing and exits 1 when stale: verified in text and JSON, but CRLF is reported stale (finding 2). - Claim: the JSON receipts are
theme.build.baseandtheme.build.check: verified. - Claim:
--family,--watchand--outwith several files fail withERR_THEME_INVALID: verified;--family-keyalone is accepted (non-blocking). - Claim: a local theme's module is
<slug>.{js,mjs,ts,tsx}and its stylesheet is null unless<slug>.cssexists: verified. - Claim: add, use and remove write the CLI header and record followed by the adapter's source, with relative specifiers and no Core wiring snippet: verified.
- Claim: typed failures map to the command's codes with the message, location and fix: verified, but
unsupportedlacksrequirement(finding 7). - Claim: a throw or malformed value fails with
ERR_BASE_ADAPTERnaming base, step and module, and writes nothing: verified (tests). - Claim: a listed step the module does not export refuses with
not-exported, and an unlisted export is never called: verified (tests). - Claim: nothing changes on a Core run: verified (the seven published themes build identical outputs; the CLI theme, config, discovery, doctor and bases suites pass).
- Claim: the listed gates pass: the bases tests (41, not 40), README, knowledge, changeset, API-type and authoring checks re-run and pass; the strict typecheck, eslint and the full test suite were not re-run;
check:cli-structure, not listed, fails (finding 3). - Claim: the editor and preview commands stay refused on a non-Core base: verified (bases test).
- Changeset claim: the theme commands call the adapter, the authoring entry publishes the step contracts, and the new error code and refusal reason exist: verified; "a plain path still serves every step": false (finding 8).
- Files with findings:
api/theme/base/base.mjs(1, 2, 6, 9),api/base/call-step.mjs(3, 7),commands/theme.mjs(4),api/theme/_adapter.mjs(5),foundation/discovery/theme-imports.mjs(4),api/theme/add/add.mjs,use/use.mjs,remove/remove.mjs,targets/targets.mjs(4, undocumented options),.changeset/cli-bases-themes.md(8),docs/specs/AST-114-bases/spec.md(owner decision, formatting note),foundation/bases/requirements.mjs(wording note). - Files clear:
README.md,api/doctor/theme-checks.mjs,api/integration/pack-check.mjs,api/theme/build/build.mjs,api/theme/theme.type.mjs,authoring/index.d.ts,authoring/integration/adapter.ts,authoring/integration/integration.doc.mjs,authoring/integration/schema.mjs,authoring/integration/type.ts,clients/cli/bases.test.mjs,clients/cli/lib/base-gate.mjs,clients/cli/lib/manifest.mjs,foundation/bases/resolve.mjs,foundation/bases/steps.mjs,foundation/config/theme-state.mjs,foundation/response/base.d.ts,foundation/response/error-codes.doc.mjs,foundation/response/error-codes.mjs(their new public types wait on the owner decision).
5e76029 to
d83050b
Compare
73b8987 to
bbc4fed
Compare
There was a problem hiding this comment.
Approval waits on an engineering owner. This pull request writes new requirements into draft spec:AST-114 (the adapter entry and step contract, the rule that a base serves a step only to the commands that call it, and the not-exported reason) and adds new @astryxdesign/cli surface, while its non-Core theme path departs from current spec:AST-050 FR2, FR5 and FR8 without amending that record. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request (the author may do so as an engineering owner) and by naming the record that amends spec:AST-050 for non-Core bases.
Blocking findings to fix, independent of that decision; each still reproduces on this head, and the earlier inline comments, the non-blocking ones included, still apply:
theme build --outthrough a symlinked folder inside the project writes outside it, becauseapi/theme/base/base.mjs:136-144checks the path lexically instead of withassertWithinon real paths as Core'sconfineOutputdoes (architecture:cli-surfaceINV10).- The base build re-implements Core's output confinement and
--checkcomparison instead of callingconfineOutputandstaleBuildOutputs, so a CRLF checkout of a correct build fails--checkas outdated (spec:AST-050FR8). pnpm check:cli-structure, which the lint workflow runs, fails with five errors:api/base/has no FunctionDoc, typedefs or test, andapi/base/call-step.mjsandapi/theme/base/base.mjsread and write files outside the subject's adapter (INV20, INV21).- The base dispatch lives in the theme handler, so
themeBuildandthemeAddcalled through@astryxdesign/cli/apion a non-Core base still compile with Core and write Core's module body around the base's built module (INV22). - After a successful
theme buildandtheme addon a non-Core base,astryx doctorfailstheme-ownersbecauseresolveRecordedThemestill looks for<slug>.js, and the fix it names is the build and add that were just run (spec:AST-050FR11). - The generated TypeScript module on a base no longer exports
ThemeSlug, whichspec:AST-050FR2 lists among the module's public exports, because the CLI checks only forthemesanddefaultThemeSlug. - A typed
unsupportedfailure answersERR_BASE_CAPABILITYwithout therequirementmember that the README promises on that code. - The new changeset says a plain path "still" serves every step, and the unchanged
cli-bases.mdchangeset still says commands do not call base adapters, so the release notes contradict the change and each other. - Miss: a base build writes every returned file over whatever is there, so a theme source named for its theme (
ocean.tswithname: 'ocean') or an unrelated file in the--outfolder is silently replaced, where Core's build refuses withERR_THEME_INVALIDorERR_FILE_EXISTS(api/theme/base/base.mjs:191-197,spec:AST-050FR8).
Claims and files checked
- Claim: theme targets, build, add, use and remove call the base's themes adapter on a non-Core base: verified (bases tests; the same commands on a fixture project).
- Claim: targets keeps the CLI's filter, exact match and near-miss suggestions, with an empty class when the base gives none: verified (bases test).
- Claim: build loads the source with no Core interception and passes the export, its name and the theme name to compile: verified (base build code and test).
- Claim: builds write every returned file inside the project as one atomic write: false for a symlinked folder (first finding), and the write can replace the source (last finding).
- Claim:
--checkcompares the returned files, writes nothing and exits 1 when stale: verified in text and JSON, but CRLF is reported stale (second finding). - Claim: the JSON receipts are
theme.build.baseandtheme.build.check: verified. - Claim:
--family,--watchand--outwith several files fail withERR_THEME_INVALID: verified;--family-keyalone is accepted (non-blocking). - Claim: a local theme's module is
<slug>.{js,mjs,ts,tsx}and its stylesheet is null unless<slug>.cssexists: verified. - Claim: add, use and remove write the CLI header and record followed by the adapter's source, with relative specifiers and no Core wiring snippet: verified.
- Claim: typed failures map to the command's codes with the message, location and fix: verified, but
unsupportedlacksrequirement(seventh finding). - Claim: a throw or malformed value fails with
ERR_BASE_ADAPTERnaming base, step and module, and writes nothing: verified (tests). - Claim: a listed step the module does not export refuses with
not-exported, and an unlisted export is never called: verified (tests). - Claim: nothing changes on a Core run: verified (the seven published themes build identical outputs; the CLI theme, config, discovery, doctor and bases suites give the same results before and after).
- Claim: the listed gates pass: the bases tests (41, not 40), README, knowledge, changeset, API-type, authoring, strict-typecheck and eslint checks re-run and pass on the changed files; the full test suite was not re-run;
check:cli-structure, not listed, fails (third finding). - Claim: the editor and preview commands stay refused on a non-Core base: verified (bases test).
- Changeset claim: the theme commands call the adapter, the authoring entry publishes the step contracts, and the new error code and refusal reason exist: verified; "a plain path still serves every step": false (eighth finding).
- Files with findings:
api/theme/base/base.mjs,api/base/call-step.mjs,commands/theme.mjs,api/theme/_adapter.mjs,foundation/discovery/theme-imports.mjs,api/theme/add/add.mjs,use/use.mjs,remove/remove.mjs,targets/targets.mjs(undocumented options),.changeset/cli-bases-themes.md,docs/specs/AST-114-bases/spec.md(owner decision, formatting note),foundation/bases/requirements.mjs(wording note). - Files clear:
README.md,api/doctor/theme-checks.mjs,api/integration/pack-check.mjs,api/theme/build/build.mjs,api/theme/theme.type.mjs,authoring/index.d.ts,authoring/integration/adapter.ts,authoring/integration/integration.doc.mjs,authoring/integration/schema.mjs,authoring/integration/type.ts,clients/cli/bases.test.mjs,clients/cli/lib/base-gate.mjs,clients/cli/lib/manifest.mjs,foundation/bases/resolve.mjs,foundation/bases/steps.mjs,foundation/config/theme-state.mjs,foundation/response/base.d.ts,foundation/response/error-codes.doc.mjs,foundation/response/error-codes.mjs(their new public types wait on the owner decision).
bbc4fed to
bd0717d
Compare
bd0717d to
9c61aa4
Compare
There was a problem hiding this comment.
Approval waits on an engineering owner. This pull request writes new requirements into draft spec:AST-114 (the adapter entry and step contract, the rule that a base serves a step only to the commands that call it, and the not-exported reason) and adds new @astryxdesign/cli surface, while its non-Core theme path departs from current spec:AST-050 FR2, FR5 and FR8 without amending that record. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request (the author may do so as an engineering owner) and by naming the record that amends spec:AST-050 for non-Core bases.
Blocking findings to fix, independent of that decision; each still reproduces on this head, and the earlier inline comments, the non-blocking ones included, still apply:
theme build --outthrough a symlinked folder inside the project writes outside it, becauseapi/theme/base/base.mjs:136-144checks the path lexically instead of withassertWithinon real paths as Core'sconfineOutputdoes (architecture:cli-surfaceINV10).- The base build re-implements Core's output confinement and
--checkcomparison instead of callingconfineOutputandstaleBuildOutputs, so a CRLF checkout of a correct build fails--checkas outdated (spec:AST-050FR8). pnpm check:cli-structure, which the lint workflow runs, fails with five errors:api/base/has no FunctionDoc, typedefs or test, andapi/base/call-step.mjsandapi/theme/base/base.mjsread and write files outside the subject's adapter (INV20, INV21).- The base dispatch lives in the theme handler, so
themeBuildandthemeAddcalled through@astryxdesign/cli/apion a non-Core base still compile with Core and write Core's module body around the base's built module (INV22). - After a successful
theme buildandtheme addon a non-Core base,astryx doctorfailstheme-ownersbecauseresolveRecordedThemestill looks for<slug>.js, and the fix it names is the build and add that were just run (spec:AST-050FR11). - The generated TypeScript module on a base no longer exports
ThemeSlug, whichspec:AST-050FR2 lists among the module's public exports, because the CLI checks only forthemesanddefaultThemeSlug. - A typed
unsupportedfailure answersERR_BASE_CAPABILITYwithout therequirementmember that the README promises on that code. - The new changeset says a plain path "still" serves every step, and the base branch's
cli-bases.mdchangeset still says commands do not call base adapters, so the release notes contradict the change and each other. - Miss: a base build writes every returned file over whatever is there, so a theme source named for its theme (
ocean.tswithname: 'ocean') or an unrelated file in the--outfolder is silently replaced, where Core's build refuses withERR_THEME_INVALIDorERR_FILE_EXISTS(api/theme/base/base.mjs:191-197,spec:AST-050FR8).
Claims and files checked
- Claim: theme targets, build, add, use and remove call the base's themes adapter on a non-Core base: verified (bases tests; the same commands on a fixture project).
- Claim: targets keeps the CLI's filter, exact match and near-miss suggestions, with an empty class when the base gives none: verified (bases test).
- Claim: build loads the source with no Core interception and passes the export, its name and the theme name to compile: verified (base build code and test).
- Claim: builds write every returned file inside the project as one atomic write: false for a symlinked folder (first finding), and the write can replace the source (last finding).
- Claim:
--checkcompares the returned files, writes nothing and exits 1 when stale: verified in text and JSON, but CRLF is reported stale (second finding). - Claim: the JSON receipts are
theme.build.baseandtheme.build.check: verified. - Claim:
--family,--watchand--outwith several files fail withERR_THEME_INVALID: verified;--family-keyalone is accepted (non-blocking). - Claim: a local theme's module is
<slug>.{js,mjs,ts,tsx}and its stylesheet is null unless<slug>.cssexists: verified. - Claim: add, use and remove write the CLI header and record followed by the adapter's source, with relative specifiers and no Core wiring snippet: verified.
- Claim: typed failures map to the command's codes with the message, location and fix: verified, but
unsupportedlacksrequirement(seventh finding). - Claim: a throw or malformed value fails with
ERR_BASE_ADAPTERnaming base, step and module, and writes nothing: verified (tests). - Claim: a listed step the module does not export refuses with
not-exported, and an unlisted export is never called: verified (tests). - Claim: nothing changes on a Core run: verified (the seven published themes build identical outputs; the CLI theme, config, discovery, doctor and bases suites pass before and after).
- Claim: the listed gates pass: the bases tests (41, not 40), README, knowledge, changeset, API-type, authoring and eslint checks re-run and pass on the changed files; strict typecheck reports only two errors in page templates whose theme package was not built, none in a changed file; the full test suite was not re-run;
check:cli-structure, not listed, fails (third finding). - Claim: the editor and preview commands stay refused on a non-Core base: verified (bases test).
- Claim: package themes on a non-Core base still use Core's module and stylesheet exports, and integration validation does not check
base: matches the code and the record's FR3 gap line. - Changeset claim: the theme commands call the adapter, the authoring entry publishes the step contracts, and the new error code and refusal reason exist: verified; "a plain path still serves every step": false (eighth finding).
- Files with findings:
api/theme/base/base.mjs,api/base/call-step.mjs,commands/theme.mjs,api/theme/_adapter.mjs,foundation/discovery/theme-imports.mjs,api/theme/add/add.mjs,use/use.mjs,remove/remove.mjs,targets/targets.mjs(undocumented options),.changeset/cli-bases-themes.md,docs/specs/AST-114-bases/spec.md(owner decision, formatting note),foundation/bases/requirements.mjs(wording note). - Files clear:
README.md,api/doctor/theme-checks.mjs,api/integration/pack-check.mjs,api/theme/build/build.mjs,api/theme/theme.type.mjs,authoring/index.d.ts,authoring/integration/adapter.ts,authoring/integration/integration.doc.mjs,authoring/integration/schema.mjs,authoring/integration/type.ts,clients/cli/bases.test.mjs,clients/cli/lib/base-gate.mjs,clients/cli/lib/manifest.mjs,foundation/bases/resolve.mjs,foundation/bases/steps.mjs,foundation/config/theme-state.mjs,foundation/response/base.d.ts,foundation/response/error-codes.doc.mjs,foundation/response/error-codes.mjs(their new public types wait on the owner decision).
076b668 to
3d56cb9
Compare
9c61aa4 to
abefb42
Compare
There was a problem hiding this comment.
Approval waits on an engineering owner. This pull request writes new requirements into draft spec:AST-114 (the adapter entry and step contract, the rule that a base serves a step only to the commands that call it, and the not-exported reason) and adds new @astryxdesign/cli surface, while its non-Core theme path departs from current spec:AST-050 FR2, FR5 and FR8 (FR8 now also refuses a .d.ts or .css.map --out) without amending that record. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request (the author may do so as an engineering owner) and by naming the record that amends spec:AST-050 for non-Core bases.
Blocking findings to fix, independent of that decision; the earlier inline comments, the non-blocking ones included, still apply at this head:
theme build --outthrough a symlinked folder inside the project writes outside it, becauseapi/theme/base/base.mjs:136-144checks the path lexically instead of withassertWithinon real paths as Core'sconfineOutputdoes (architecture:cli-surfaceINV10).- The base build copies Core's
--checkcomparison instead of callingstaleBuildOutputs, so a CRLF checkout of a correct build fails--checkas outdated (spec:AST-050FR8). pnpm check:cli-structure, whichcheck:reporuns, fails with five errors:api/base/has no FunctionDoc, typedefs or test, andapi/base/call-step.mjsandapi/theme/base/base.mjsimportnode:fsoutside the subject's adapter (INV20, INV21).- The base dispatch lives in the theme handler, so
themeBuildandthemeAddcalled through@astryxdesign/cli/apion a non-Core base still follow Core: the build goes to Core's compiler and the add refuses the base-built module as not built (INV22). - After a successful
theme buildandtheme addon a non-Core base,astryx doctorfailstheme-ownersfor a.tsmodule andtheme-modulefor a.jsmodule, each naming a fix that does not clear it (spec:AST-050FR11). - The generated TypeScript module on a base no longer exports
ThemeSlug, whichspec:AST-050FR2 lists among the module's public exports, because the CLI checks only forthemesanddefaultThemeSlug. - A typed
unsupportedfailure answersERR_BASE_CAPABILITYwithout therequirementmember that the README promises on that code. - The new changeset says a plain path "still" serves every step, and the base branch's
cli-bases.mdchangeset still says commands do not call base adapters, so the release notes contradict the change and each other. - Miss: a base build writes every returned file over whatever is there, so a theme source named for its theme (
ocean.tswithname: 'ocean') or an unrelated file in the--outfolder is silently replaced, where Core's build refuses (api/theme/base/base.mjs:190-197,spec:AST-050FR8). - Regression:
theme removeof the only added theme on a non-Core base refuses with "has changes the CLI did not write", becauseremoveLastThemecompares the module with Core's rendering and never receives the base's renderer (api/theme/_adapter.mjs:1482,spec:AST-050FR4).
Claims and files checked
Review mode: full; reason: rebase
- Claim: theme targets, build, add, use and remove call the base's themes adapter on a non-Core base: verified (bases tests; the same commands on a fixture project).
- Claim: targets keeps the CLI's filter, exact match and near-miss suggestions, with an empty class when the base gives none: verified (bases test).
- Claim: build loads the source with no Core interception and passes the file, export, value and theme name to compile: verified (base build code and test).
- Claim: builds write every returned file inside the project as one atomic write: false for a symlinked folder (first finding), and the write can replace the source (ninth finding).
- Claim:
--checkcompares the returned files, writes nothing and exits 1 when stale: verified, but CRLF is reported stale (second finding). - Claim: the JSON receipts are
theme.build.baseandtheme.build.check: verified. - Claim:
--family,--watchand--outwith several files fail withERR_THEME_INVALID: verified in the base build handler;--family-keyalone is accepted (non-blocking). - Claim: add, use and remove keep Core's record logic; a local module is
<slug>.{js,mjs,ts,tsx}and the stylesheet is null unless<slug>.cssexists: verified for add and use; removal of the only theme fails (tenth finding). - Claim: the CLI writes its header and record followed by the adapter's source, with relative specifiers: verified (bases test).
- Claim: the first-add wiring snippet is not printed on another base: verified (first add on a fixture project).
- Claim: typed failures map to the command's codes with the message, location and fix: verified, but
unsupportedlacksrequirement(seventh finding). - Claim: a throw or malformed value fails with
ERR_BASE_ADAPTERnaming base, step and module, and writes nothing: verified for a single build and an add; a batch keeps the themes built before the failure (non-blocking). - Claim: a listed step the module does not export refuses with
not-exported, and an unlisted export is never called: verified (tests). - Claim: nothing changes on a Core run: verified (the CLI theme, theme editor, doctor, config, discovery, bases, integration and CLI-client suites pass, 10,151 tests, none failing).
- Claim: the listed gates pass: the bases tests pass (43 at this head, not 40), and the README, changeset, API-type and authoring checks and eslint on the changed files pass; the strict typecheck stops only on two page templates that need a built theme package; the full test suite, the knowledge check and the API-types verify script were not re-run;
check:cli-structure, not listed, fails (third finding). - Claim: the editor and preview commands stay refused on a non-Core base: verified (bases test).
- Claim: package themes on a non-Core base still use Core's module and stylesheet exports, and integration validation does not check
base: matches the code and the record's FR3 gap line. - Claim: the record edits carry no project status and no new open questions: verified; the remaining gap lines name their requirement and the mismatch.
- Changeset claim: the theme commands call the adapter, the CLI does every write, the authoring entry publishes the step contracts, and the new error code and refusal reason exist: verified; "a plain path still serves every step": false (eighth finding).
- Files with findings:
api/theme/base/base.mjs,api/base/call-step.mjs,commands/theme.mjs,api/theme/_adapter.mjs,api/doctor/theme-checks.mjs(doctor finding),api/theme/add/add.mjs,use/use.mjs,remove/remove.mjs,targets/targets.mjs(undocumented options),.changeset/cli-bases-themes.md,docs/specs/AST-114-bases/spec.md(owner decision, formatting note),foundation/bases/requirements.mjs(wording note),foundation/response/error-codes.mjs(union note). - Files clear:
README.md,foundation/discovery/theme-imports.mjs,api/integration/pack-check.mjs,api/theme/build/build.mjs,api/theme/theme.type.mjs,authoring/index.d.ts,authoring/integration/adapter.ts,authoring/integration/integration.doc.mjs,authoring/integration/schema.mjs,authoring/integration/type.ts,clients/cli/bases.test.mjs,clients/cli/lib/base-gate.mjs,clients/cli/lib/manifest.mjs,foundation/bases/resolve.mjs,foundation/bases/steps.mjs,foundation/config/theme-state.mjs,foundation/response/base.d.ts,foundation/response/error-codes.doc.mjs(their new public types wait on the owner decision).
0560680 to
4ca5d82
Compare
01346c2 to
fa1234e
Compare
There was a problem hiding this comment.
Approval waits on an engineering owner. This pull request writes new requirements into draft spec:AST-114 (the adapter entry and step contract, the rule that a base serves a step only to the commands that call it, and the not-exported reason) and adds new @astryxdesign/cli surface, while its non-Core theme path departs from current spec:AST-050 FR2, FR5 and FR8 without amending that record. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request (the author may do so as an engineering owner) and by naming the record that amends spec:AST-050 for non-Core bases.
Blocking findings to fix, independent of that decision; the earlier inline comments, the non-blocking ones included, still apply at this head:
theme build --outthrough a symlinked folder inside the project writes outside it, becauseapi/theme/base/base.mjs:136-144checks the path lexically instead of withassertWithinon real paths as Core'sconfineOutputdoes (architecture:cli-surfaceINV10).- The base build copies Core's
--checkcomparison instead of callingstaleBuildOutputs, so a CRLF checkout of a correct build fails--checkas outdated (spec:AST-050FR8). pnpm check:cli-structure, whichcheck:reporuns, fails with five errors:api/base/has no FunctionDoc, typedefs or test, andapi/base/call-step.mjsandapi/theme/base/base.mjsimportnode:fsoutside the subject's adapter (INV20, INV21).- The base dispatch lives in the theme handler, so
themeBuildandthemeAddcalled through@astryxdesign/cli/apion a non-Core base still follow Core: the build writes Core's CSS outputs and the add refuses the base-built module as not built (INV22). - After a successful
theme buildandtheme addon a non-Core base,astryx doctorfailstheme-ownersfor a.tsmodule andtheme-modulefor a.jsmodule, each naming a fix that does not clear it (spec:AST-050FR11). - The generated TypeScript module on a base no longer exports
ThemeSlug, whichspec:AST-050FR2 lists among the module's public exports, because the CLI checks only forthemesanddefaultThemeSlug. - A typed
unsupportedfailure answersERR_BASE_CAPABILITYwithout therequirementmember that the README promises on that code. - The new changeset says a plain path "still" serves every step, and the base branch's
cli-bases.mdchangeset still says commands do not call base adapters, so the release notes contradict the change and each other. - Miss: a base build writes every returned file over whatever is there, so a theme source named for its theme (
ocean.tswithname: 'ocean') or an unrelated file in the--outfolder is silently replaced, where Core's build refuses (api/theme/base/base.mjs:190-197,spec:AST-050FR8). - Regression:
theme removeof the only added theme on a non-Core base refuses with "has changes the CLI did not write", becauseremoveLastThemecompares the module with Core's rendering and never receives the base's renderer (api/theme/_adapter.mjs:1482,spec:AST-050FR4).
Claims and files checked
Review mode: full; reason: rebase
- Claim: theme targets, build, add, use and remove call the base's themes adapter on a non-Core base: verified (bases tests; the same commands on a fixture project).
- Claim: targets keeps the CLI's filter, exact match and near-miss suggestions, with an empty class when the base gives none: verified (bases test).
- Claim: build loads the source with no Core interception and passes the file, export, value and theme name to compile: verified (base build code and test).
- Claim: builds write every returned file inside the project as one atomic write: false for a symlinked folder (first finding), and the write can replace the source (ninth finding).
- Claim:
--checkcompares the returned files, writes nothing and exits 1 when stale: verified, but CRLF is reported stale (second finding). - Claim: the JSON receipts are
theme.build.baseandtheme.build.check: verified. - Claim:
--family,--watchand--outwith several files fail withERR_THEME_INVALID: verified in the base build handler;--family-keyalone is accepted (non-blocking). - Claim: add, use and remove keep Core's record logic; a local module is
<slug>.{js,mjs,ts,tsx}and the stylesheet is null unless<slug>.cssexists: verified for add and use; removal of the only theme fails (tenth finding). - Claim: the CLI writes its header and record followed by the adapter's source, with relative specifiers: verified (bases test; fixture run).
- Claim: the first-add wiring snippet is not printed on another base: verified (first add on a fixture project).
- Claim: typed failures map to the command's codes with the message, location and fix: verified, but
unsupportedlacksrequirement(seventh finding). - Claim: a throw or malformed value fails with
ERR_BASE_ADAPTERnaming base, step and module, and writes nothing: verified for a single build and an add; a batch keeps the themes built before the failure (non-blocking). - Claim: a listed step the module does not export refuses with
not-exported, and an unlisted export is never called: verified (tests). - Claim: nothing changes on a Core run: verified (the CLI theme, theme editor, doctor, config, discovery, bases, integration and CLI-client suites pass, 10,151 tests, none failing).
- Claim: the listed gates pass: the bases tests pass (43 at this head, not 40), and the README, changeset, API-type and authoring checks and eslint on the changed files pass; the strict typecheck, the full test suite, the knowledge check and the API-types verify script were not re-run;
check:cli-structure, not listed, fails (third finding). - Claim: the editor and preview commands stay refused on a non-Core base: verified (bases test).
- Claim: package themes on a non-Core base still use Core's module and stylesheet exports, and integration validation does not check
base: matches the code and the record's FR3 gap line. - Claim: the record edits carry no project status and no new open questions: verified; the remaining gap lines name their requirement and the mismatch.
- Changeset claim: the theme commands call the adapter, the CLI does every write, the authoring entry publishes the step contracts, and the new error code and refusal reason exist: verified; "a plain path still serves every step": false (eighth finding).
- Files with findings:
api/theme/base/base.mjs,api/base/call-step.mjs,commands/theme.mjs,api/theme/_adapter.mjs,api/doctor/theme-checks.mjs(doctor finding),api/theme/add/add.mjs,use/use.mjs,remove/remove.mjs,targets/targets.mjs(undocumented options),.changeset/cli-bases-themes.md,docs/specs/AST-114-bases/spec.md(owner decision, formatting note),foundation/bases/requirements.mjs(wording note),foundation/response/error-codes.mjs(union note). - Files clear:
README.md,foundation/discovery/theme-imports.mjs,api/integration/pack-check.mjs,api/theme/build/build.mjs,api/theme/theme.type.mjs,authoring/index.d.ts,authoring/integration/adapter.ts,authoring/integration/integration.doc.mjs,authoring/integration/schema.mjs,authoring/integration/type.ts,clients/cli/bases.test.mjs,clients/cli/lib/base-gate.mjs,clients/cli/lib/manifest.mjs,foundation/bases/resolve.mjs,foundation/bases/steps.mjs,foundation/config/theme-state.mjs,foundation/response/base.d.ts,foundation/response/error-codes.doc.mjs(their new public types wait on the owner decision).
4ca5d82 to
e475dfc
Compare
fa1234e to
62b933d
Compare
There was a problem hiding this comment.
Approval waits on an engineering owner. This pull request writes new requirements into draft spec:AST-114 (the adapter entry and step contract, the caller-only step rule and the not-exported reason), adds new @astryxdesign/cli surface, and departs from current spec:AST-050 FR2, FR5 and FR8 on non-Core bases without amending that record. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request and naming the record that amends spec:AST-050 for non-Core bases; the author may do so as an engineering owner.
Blocking findings to fix, whatever that decision is (the earlier inline comments, the non-blocking ones included, still apply at this head):
theme build --outthrough a symlinked folder inside the project writes outside it, becauseapi/theme/base/base.mjs:136-144checks the path lexically instead of withassertWithinon real paths, as Core'sconfineOutputdoes (architecture:cli-surfaceINV10).- The base build copies Core's
--checkcomparison instead of callingstaleBuildOutputs, so--checkreports a CRLF checkout of a correct build as outdated (spec:AST-050FR8). pnpm check:cli-structure, whichcheck:reporuns, fails with five errors:api/base/has no FunctionDoc, typedefs or test, andapi/base/call-step.mjsandapi/theme/base/base.mjsimportnode:fsoutside the subject's adapter (INV20, INV21).- The base dispatch lives in the theme handler, so on a non-Core base
themeBuildcalled through@astryxdesign/cli/apiwrites Core's CSS outputs, andthemeAddwrites Core's module body instead of the base'sappModulesource (INV22). - After a successful
theme buildandtheme addon a non-Core base,astryx doctorfailstheme-ownersfor a.tsmodule andtheme-modulefor a.jsmodule, and each check names a fix that does not clear it (spec:AST-050FR11). - On a base, the generated TypeScript module no longer exports
ThemeSlug, whichspec:AST-050FR2 lists among the module's public exports, because the CLI checks only forthemesanddefaultThemeSlug. - A typed
unsupportedfailure answersERR_BASE_CAPABILITYwithout therequirementmember that the README promises on that code. - The new changeset says a plain path "still" serves every step, and the base branch's
cli-bases.mdchangeset still says commands do not call base adapters, so the release notes contradict the change and each other. - Miss: a base build writes every returned file over whatever is there, so a theme source named for its theme (
ocean.tswithname: 'ocean') or an unrelated file in the--outfolder is silently replaced, where Core's build refuses (api/theme/base/base.mjs:190-197,spec:AST-050FR8). - Regression:
theme removeof the only added theme on a non-Core base refuses with "has changes the CLI did not write", becauseremoveLastThemecompares the module with Core's rendering and never receives the base's renderer (api/theme/_adapter.mjs:1482,spec:AST-050FR4).
Claims and files checked
Review mode: full; reason: rebase
- Claim: theme targets, build, add, use and remove call the base's themes adapter on a non-Core base: verified (bases tests; the same commands on a fixture project).
- Claim: targets keeps the CLI's filter, exact match and near-miss suggestions, with an empty class when the base gives none: verified (bases test).
- Claim: build loads the source with no Core interception and passes the file, export, value and theme name to compile: verified (base build code and test).
- Claim: a build writes every returned file inside the project as one atomic write: false for a symlinked folder (first finding), and the write can replace the source (ninth finding).
- Claim:
--checkcompares the returned files, writes nothing and exits 1 when stale: verified, but a CRLF copy is reported stale (second finding). - Claim: the JSON receipts are
theme.build.baseandtheme.build.check: verified. - Claim:
--family,--watchand--outwith several files fail withERR_THEME_INVALID: verified in the base build handler;--family-keyalone is accepted (non-blocking). - Claim: add, use and remove keep Core's record logic, a local module is
<slug>.{js,mjs,ts,tsx}, and the stylesheet is null unless<slug>.cssexists: verified for add and use; removing the only theme fails (tenth finding). - Claim: the CLI writes its header and record, followed by the adapter's source with relative specifiers: verified (bases test; fixture run).
- Claim: the first-add wiring snippet is not printed on another base: verified (first add on a fixture project).
- Claim: typed failures map to the command's codes with the message, location and fix: verified, but
unsupportedlacksrequirement(seventh finding). - Claim: a throw or a malformed value fails with
ERR_BASE_ADAPTER, naming base, step and module, and writes nothing: verified for a single build and an add; a batch keeps the themes built before the failure (non-blocking). - Claim: a listed step that the module does not export refuses with
not-exported, and an unlisted export is never called: verified (tests). - Claim: nothing changes on a Core run: verified for the CLI theme, theme editor, doctor, config, discovery, bases, integration and CLI-client suites (10,636 pass). The 14 theme-editor tests that fail in the review environment fail identically without this change.
- Claim: the listed gates pass: the bases tests pass (43 at this head, not 40), and the README, changeset, API-type sync, json-api and authoring typechecks and the knowledge check pass. The strict typecheck reports only two template imports of an unbuilt theme package, outside this change. The full test suite and the API-types verify script were not re-run.
check:cli-structure, which the description does not list, fails (third finding). - Claim: the editor and preview commands stay refused on a non-Core base: verified (bases test).
- Claim: package themes on a non-Core base still use Core's module and stylesheet exports, and integration validation does not check
base: matches the code and the record's FR3 gap line. - Claim: the record edits carry no project status and no new open questions: verified; the remaining gap lines name their requirement and the mismatch.
- Changeset claim: the theme commands call the adapter, the CLI does every write, the authoring entry publishes the step contracts, and the new error code and refusal reason exist: verified. "A plain path still serves every step": false (eighth finding).
- Files with findings:
api/theme/base/base.mjs,api/base/call-step.mjs,commands/theme.mjs,api/theme/_adapter.mjs,api/doctor/theme-checks.mjs(doctor finding),api/theme/add/add.mjs,use/use.mjs,remove/remove.mjs,targets/targets.mjs(undocumented options),.changeset/cli-bases-themes.md,docs/specs/AST-114-bases/spec.md(owner decision, formatting note),foundation/bases/requirements.mjs(wording note),foundation/response/error-codes.mjs(union note). - Files clear:
README.md,foundation/discovery/theme-imports.mjs,api/integration/pack-check.mjs,api/theme/build/build.mjs,api/theme/theme.type.mjs,authoring/index.d.ts,authoring/integration/adapter.ts,authoring/integration/integration.doc.mjs,authoring/integration/schema.mjs,authoring/integration/type.ts,clients/cli/bases.test.mjs,clients/cli/lib/base-gate.mjs,clients/cli/lib/manifest.mjs,foundation/bases/resolve.mjs,foundation/bases/steps.mjs,foundation/config/theme-state.mjs,foundation/response/base.d.ts,foundation/response/error-codes.doc.mjs(their new public types wait on the owner decision).
|
|
||
| const stepCall = runStepCall(); | ||
| if (stepCall) { | ||
| return buildOnBase(files, options, stepCall, json, words); |
There was a problem hiding this comment.
The handler dispatches to buildOnBase here instead of calling the themeBuild its CommandDoc names (architecture:cli-surface INV22). On the same native-base project, themeBuild called through @astryxdesign/cli/api ignores the base and writes Core's matcha.css, .css.d.ts, .js and .d.ts. API themeAdd writes Core's module body (_astryxTheme0, ThemeSlug) instead of the base's appModule source, so the API and the CLI write different modules for one project. Moving the base dispatch into themeBuild, themeAdd, themeUse, themeRemove and themeTargets keeps one path.
e475dfc to
4ab47e6
Compare
62b933d to
38396aa
Compare
There was a problem hiding this comment.
Approval waits on an engineering owner. This pull request writes new requirements into draft spec:AST-114 (the adapter entry and step contract, the caller-only step rule and the not-exported reason), adds new @astryxdesign/cli surface, and departs from current spec:AST-050 FR2, FR5 and FR8 on non-Core bases without amending that record. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request and naming the record that amends spec:AST-050 for non-Core bases; the author may do so as an engineering owner.
Blocking findings to fix, whatever that decision is (the earlier inline comments, the non-blocking ones included, still apply at this head):
theme build --outthrough a symlinked folder inside the project writes outside it, becauseapi/theme/base/base.mjs:136-144checks the path lexically instead of withassertWithinon real paths, as Core'sconfineOutputdoes (architecture:cli-surfaceINV10).- The base build copies Core's
--checkcomparison instead of callingstaleBuildOutputs, so--checkreports a CRLF checkout of a correct build as outdated (spec:AST-050FR8). pnpm check:cli-structure, whichcheck:reporuns, fails with five errors:api/base/has no FunctionDoc, typedefs or test, andapi/base/call-step.mjsandapi/theme/base/base.mjsimportnode:fsoutside the subject's adapter (INV20, INV21).- The base dispatch lives in the theme handler, so on a non-Core base
themeBuildcalled through@astryxdesign/cli/apiwrites Core's CSS outputs, andthemeAddwrites Core's module body instead of the base'sappModulesource (INV22). - After a successful
theme buildandtheme addon a non-Core base,astryx doctorfailstheme-ownersfor a.tsmodule andtheme-modulefor a.jsmodule, and each check names a fix that does not clear it (spec:AST-050FR11). - On a base, the generated TypeScript module no longer exports
ThemeSlug, whichspec:AST-050FR2 lists among the module's public exports, because the CLI checks only forthemesanddefaultThemeSlug. - A typed
unsupportedfailure answersERR_BASE_CAPABILITYwithout therequirementmember that the README promises on that code. - The new changeset says a plain path "still" serves every step, and the base branch's
cli-bases.mdchangeset still says commands do not call base adapters, so the release notes contradict the change and each other. - Miss: a base build writes every returned file over whatever is there, so a theme source named for its theme (
ocean.tswithname: 'ocean') or an unrelated file in the--outfolder is silently replaced, where Core's build refuses (api/theme/base/base.mjs:190-197,spec:AST-050FR8). - Regression:
theme removeof the only added theme on a non-Core base refuses with "has changes the CLI did not write", becauseremoveLastThemecompares the module with Core's rendering and never receives the base's renderer (api/theme/_adapter.mjs:1482,spec:AST-050FR4).
Claims and files checked
Review mode: full; reason: rebase
- Claim: theme targets, build, add, use and remove call the base's themes adapter on a non-Core base: verified (bases tests; the same commands on a fixture project).
- Claim: targets keeps the CLI's filter, exact match and near-miss suggestions, with an empty class when the base gives none: verified (bases test).
- Claim: build loads the source with no Core interception and passes the file, export, value and theme name to compile: verified (base build code and test).
- Claim: a build writes every returned file inside the project as one atomic write: false for a symlinked folder (first finding), and the write can replace the source (ninth finding).
- Claim:
--checkcompares the returned files, writes nothing and exits 1 when stale: verified, but a CRLF copy is reported stale (second finding). - Claim: the JSON receipts are
theme.build.baseandtheme.build.check: verified. - Claim:
--family,--watchand--outwith several files fail withERR_THEME_INVALID: verified in the base build handler;--family-keyalone is accepted (non-blocking). - Claim: add, use and remove keep Core's record logic, a local module is
<slug>.{js,mjs,ts,tsx}, and the stylesheet is null unless<slug>.cssexists: verified for add and use; removing the only theme fails (tenth finding). - Claim: the CLI writes its header and record, followed by the adapter's source with relative specifiers: verified (bases test; fixture run).
- Claim: the first-add wiring snippet is not printed on another base: verified (first add on a fixture project).
- Claim: typed failures map to the command's codes with the message, location and fix: verified, but
unsupportedlacksrequirement(seventh finding). - Claim: a throw or a malformed value fails with
ERR_BASE_ADAPTER, naming base, step and module, and writes nothing: verified for a single build and an add; a batch keeps the themes built before the failure (non-blocking). - Claim: a listed step that the module does not export refuses with
not-exported, and an unlisted export is never called: verified (tests). - Claim: nothing changes on a Core run: verified for the CLI theme, theme editor, doctor, config, discovery, bases, integration and CLI-client suites (10,912 tests pass).
- Claim: the listed gates pass: the bases tests pass (43 at this head, not 40); the README, changeset, API-type sync, json-api and authoring typechecks, the published-types verify script and the knowledge check pass. The strict typecheck reports only two template imports of an unbuilt theme package, outside this change. The full test suite was not re-run.
check:cli-structure, which the description does not list, fails (third finding). - Claim: the editor and preview commands stay refused on a non-Core base: verified (bases test).
- Claim: package themes on a non-Core base still use Core's module and stylesheet exports, and integration validation does not check
base: matches the code and the record's FR3 gap line. - Claim: the record edits carry no project status and no new open questions: verified; the remaining gap lines name their requirement and the mismatch.
- Changeset claim: the theme commands call the adapter, the CLI does every write, the authoring entry publishes the step contracts, and the new error code and refusal reason exist: verified. "A plain path still serves every step": false (eighth finding).
- Files with findings:
api/theme/base/base.mjs,api/base/call-step.mjs,commands/theme.mjs,api/theme/_adapter.mjs,api/doctor/theme-checks.mjs(doctor finding),api/theme/add/add.mjs,use/use.mjs,remove/remove.mjs,targets/targets.mjs(undocumented options),.changeset/cli-bases-themes.md,docs/specs/AST-114-bases/spec.md(owner decision, formatting note),foundation/bases/requirements.mjs(wording note),foundation/response/error-codes.mjs(union note). - Files clear:
README.md,foundation/discovery/theme-imports.mjs,api/integration/pack-check.mjs,api/theme/build/build.mjs,api/theme/theme.type.mjs,authoring/index.d.ts,authoring/integration/adapter.ts,authoring/integration/integration.doc.mjs,authoring/integration/schema.mjs,authoring/integration/type.ts,clients/cli/bases.test.mjs,clients/cli/lib/base-gate.mjs,clients/cli/lib/manifest.mjs,foundation/bases/resolve.mjs,foundation/bases/steps.mjs,foundation/config/theme-state.mjs,foundation/response/base.d.ts,foundation/response/error-codes.doc.mjs(their new public types wait on the owner decision).
38396aa to
fc31ae0
Compare
There was a problem hiding this comment.
Approval waits on an engineering owner. This pull request writes new requirements into draft spec:AST-114 (the adapter entry and step contract, the caller-only step rule and the not-exported reason), adds new @astryxdesign/cli surface, and departs from current spec:AST-050 FR2, FR5 and FR8 on non-Core bases without amending that record. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request and naming the record that amends spec:AST-050 for non-Core bases; the author may do so as an engineering owner.
Blocking findings to fix, whatever that decision is (the earlier inline comments, the non-blocking ones included, still apply at this head):
theme build --outthrough a symlinked folder inside the project writes outside it, becauseapi/theme/base/base.mjs:136-144checks the path lexically instead of withassertWithinon real paths, as Core'sconfineOutputdoes (architecture:cli-surfaceINV10).- The base build copies Core's
--checkcomparison instead of callingstaleBuildOutputs, so--checkreports a CRLF checkout of a correct build as outdated (spec:AST-050FR8). pnpm check:cli-structure, whichcheck:reporuns, fails with five errors:api/base/has no FunctionDoc, typedefs or test, andapi/base/call-step.mjsandapi/theme/base/base.mjsimportnode:fsoutside the subject's adapter (INV20, INV21).- The base dispatch lives in the theme handler, so on a non-Core base
themeBuildcalled through@astryxdesign/cli/apiwrites Core's CSS outputs, andthemeAddwrites Core's module body instead of the base'sappModulesource (INV22). - After a successful
theme buildandtheme addon a non-Core base,astryx doctorfailstheme-ownersfor a.tsmodule andtheme-modulefor a.jsmodule, and each check names a fix that does not clear it (spec:AST-050FR11). - On a base, the generated TypeScript module no longer exports
ThemeSlug, whichspec:AST-050FR2 lists among the module's public exports, because the CLI checks only forthemesanddefaultThemeSlug. - A typed
unsupportedfailure answersERR_BASE_CAPABILITYwithout therequirementmember that the README promises on that code. - The new changeset says a plain path "still" serves every step, and the base branch's
cli-bases.mdchangeset still says commands do not call base adapters, so the release notes contradict the change and each other. - Miss: a base build writes every returned file over whatever is there, so a theme source named for its theme (
matcha.tswithname: 'matcha') or an unrelated file in the--outfolder is silently replaced, where Core's build refuses (api/theme/base/base.mjs:190-197,spec:AST-050FR8). - Regression:
theme removeof the only added theme on a non-Core base refuses with "has changes the CLI did not write", becauseremoveLastThemecompares the module with Core's rendering and never receives the base's renderer (api/theme/_adapter.mjs:1482,spec:AST-050FR4).
Claims and files checked
Review mode: full; reason: rebase
- Claim: theme targets, build, add, use and remove call the base's themes adapter on a non-Core base: verified (bases tests; the same commands on a fixture project).
- Claim: targets keeps the CLI's filter, exact match and near-miss suggestions, with an empty class when the base gives none: verified (bases test).
- Claim: build loads the source with no Core interception and passes the file, export, value and theme name to compile: verified (base build code and test).
- Claim: a build writes every returned file inside the project as one atomic write: false for a symlinked folder (first finding), and the write can replace the source (ninth finding).
- Claim:
--checkcompares the returned files, writes nothing and exits 1 when stale: verified, but a CRLF copy is reported stale (second finding). - Claim: the JSON receipts are
theme.build.baseandtheme.build.check: verified. - Claim:
--family,--watchand--outwith several files fail withERR_THEME_INVALID: verified in the base build handler;--family-keyalone is accepted (non-blocking). - Claim: add, use and remove keep Core's record logic, a local module is
<slug>.{js,mjs,ts,tsx}, and the stylesheet is null unless<slug>.cssexists: verified for add and use; removing the only theme fails (tenth finding). - Claim: the CLI writes its header and record, followed by the adapter's source with relative specifiers: verified (bases test; fixture run).
- Claim: the first-add wiring snippet is not printed on another base: verified (first add on a fixture project).
- Claim: typed failures map to the command's codes with the message, location and fix: verified, but
unsupportedlacksrequirement(seventh finding). - Claim: a throw or a malformed value fails with
ERR_BASE_ADAPTER, naming base, step and module, and writes nothing: verified for a single build and an add; a batch keeps the themes built before the failure (non-blocking). - Claim: a listed step that the module does not export refuses with
not-exported, and an unlisted export is never called: verified (tests). - Claim: nothing changes on a Core run: verified for the CLI theme, theme editor, doctor, config, discovery, bases, integration and CLI-client suites (10,898 tests pass; the 14 theme-editor tests that fail here fail the same way on the base branch).
- Claim: the listed gates pass: the bases tests pass (43 at this head, not 40); the README check, changeset check, json-api and authoring typechecks and the knowledge check pass. The full test suite, the strict typecheck, the API-type sync, the published-types verify script and eslint were not re-run.
check:cli-structure, which the description does not list, fails (third finding). - Claim: the changed step-one tests now show a plain-path adapter's commands in help without loading it, and a run loads it (
failed-to-loadwhen it throws on import): verified (bases test). - Claim: the editor and preview commands stay refused on a non-Core base: verified (bases test).
- Claim: package themes on a non-Core base still use Core's module and stylesheet exports, and integration validation does not check
base: matches the code and the record's FR3 gap line. - Claim: the record edits carry no project status and no new open questions: verified; the remaining gap lines name their requirement and the mismatch.
- Changeset claim: the theme commands call the adapter, the CLI does every write, the authoring entry publishes the step contracts, and the new error code and refusal reason exist: verified. "A plain path still serves every step": false (eighth finding).
- Files with findings:
api/theme/base/base.mjs,api/base/call-step.mjs,commands/theme.mjs,api/theme/_adapter.mjs,api/doctor/theme-checks.mjs(doctor finding),api/theme/add/add.mjs,use/use.mjs,remove/remove.mjs,targets/targets.mjs(undocumented options),.changeset/cli-bases-themes.md,docs/specs/AST-114-bases/spec.md(owner decision, formatting note),foundation/bases/requirements.mjs(wording note),foundation/response/error-codes.mjs(union note). - Files clear:
README.md,foundation/discovery/theme-imports.mjs,api/integration/pack-check.mjs,api/theme/build/build.mjs,api/theme/theme.type.mjs,authoring/index.d.ts,authoring/integration/adapter.ts,authoring/integration/integration.doc.mjs,authoring/integration/schema.mjs,authoring/integration/type.ts,clients/cli/bases.test.mjs,clients/cli/lib/base-gate.mjs,clients/cli/lib/manifest.mjs,foundation/bases/resolve.mjs,foundation/bases/steps.mjs,foundation/config/theme-state.mjs,foundation/response/base.d.ts,foundation/response/error-codes.doc.mjs(their new public types wait on the owner decision).
fc31ae0 to
52759b9
Compare
There was a problem hiding this comment.
Approval waits on an engineering owner. This pull request writes new requirements into draft spec:AST-114 (the adapter entry and step contract, the caller-only step rule and the not-exported reason), adds new @astryxdesign/cli surface, and departs from current spec:AST-050 FR2, FR5 and FR8 on non-Core bases without amending that record. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request and naming the record that amends spec:AST-050 for non-Core bases; the author may do so as an engineering owner.
Blocking findings to fix, whatever that decision is (the earlier inline comments, the non-blocking ones included, still apply at this head):
theme build --outthrough a symlinked folder inside the project writes outside it, becauseapi/theme/base/base.mjs:136-144checks the path lexically instead of withassertWithinon real paths, as Core'sconfineOutputdoes (architecture:cli-surfaceINV10).- The base build copies Core's
--checkcomparison instead of callingstaleBuildOutputs, so--checkreports a CRLF checkout of a correct build as outdated (spec:AST-050FR8). pnpm check:cli-structure, whichcheck:reporuns, fails with five errors:api/base/has no FunctionDoc, typedefs or test, andapi/base/call-step.mjsandapi/theme/base/base.mjsimportnode:fsoutside the subject's adapter (INV20, INV21).- The base dispatch lives in the theme handler, so on a non-Core base
themeBuildcalled through@astryxdesign/cli/apiwrites Core's CSS outputs, andthemeAddwrites Core's module body instead of the base'sappModulesource (INV22). - After a successful
theme buildandtheme addon a non-Core base,astryx doctorfailstheme-ownersfor a.tsmodule andtheme-modulefor a.jsmodule, and each check names a fix that does not clear it (spec:AST-050FR11). - On a base, the generated TypeScript module no longer exports
ThemeSlug, whichspec:AST-050FR2 lists among the module's public exports, because the CLI checks only forthemesanddefaultThemeSlug. - A typed
unsupportedfailure answersERR_BASE_CAPABILITYwithout therequirementmember thatarchitecture:cli-surfaceINV2 and the README promise on that code. - The new changeset says a plain path "still" serves every step, while
main's unreleasedcli-bases.mdchangeset says commands do not call base adapters, so the release notes contradict the change and each other. - Miss: a base build writes every returned file over whatever is there, so a theme source named for its theme (
matcha.tswithname: 'matcha') or an unrelated file in the--outfolder is silently replaced, where Core's build refuses (api/theme/base/base.mjs:190-197,spec:AST-050FR8). - Regression:
theme removeof the only added theme on a non-Core base refuses with "has changes the CLI did not write", becauseremoveLastThemecompares the module with Core's rendering and never receives the base's renderer (api/theme/_adapter.mjs:1482,spec:AST-050FR4).
Claims and files checked
Review mode: full; reason: merge-touches-pr-files
- Claim: theme targets, build, add, use and remove call the base's themes adapter on a non-Core base: verified (bases tests; the same commands on a fixture project).
- Claim: targets keeps the CLI's filter, exact match and near-miss suggestions, with an empty class when the base gives none: verified (bases test).
- Claim: build loads the source with no Core interception and passes the file, export, value and theme name to compile: verified (base build code and test).
- Claim: a build writes every returned file inside the project as one atomic write: false for a symlinked folder (first finding), and the write can replace the source (ninth finding).
- Claim:
--checkcompares the returned files, writes nothing and exits 1 when stale: verified, but a CRLF copy is reported stale (second finding). - Claim: the JSON receipts are
theme.build.baseandtheme.build.check: verified. - Claim:
--family,--watchand--outwith several files fail withERR_THEME_INVALID: verified in the base build handler;--family-keyalone is accepted (non-blocking). - Claim: add, use and remove keep Core's record logic, a local module is
<slug>.{js,mjs,ts,tsx}, and the stylesheet is null unless<slug>.cssexists: verified for add and use; removing the only theme fails (tenth finding). - Claim: the CLI writes its header and record, followed by the adapter's source with relative specifiers: verified (bases test; fixture run).
- Claim: the first-add wiring snippet is not printed on another base: verified (first add on a fixture project).
- Claim: typed failures map to the command's codes with the message, location and fix: verified, but
unsupportedlacksrequirement(seventh finding). - Claim: a throw or a malformed value fails with
ERR_BASE_ADAPTER, naming base, step and module, and writes nothing: verified for a single build and an add; a batch keeps the themes built before the failure (non-blocking). - Claim: a listed step that the module does not export refuses with
not-exported, and an unlisted export is never called: verified (tests). - Claim: nothing changes on a Core run: verified (the seven published themes build to identical output on both trees; the CLI theme, doctor, config, discovery and bases suites pass).
- Claim: the pull request is based on main after the first step merged: verified.
- Claim: the listed gates pass: the bases tests pass (43 at this head, not 40); the README check, changeset check, json-api and authoring typechecks and the knowledge check pass. The full test suite, the strict typecheck, the API-type sync, the published-types verify script and eslint were not re-run.
check:cli-structure, which the description does not list, fails (third finding). - Claim: the changed step-one tests now show a plain-path adapter's commands in help without loading it, and a run loads it (
failed-to-loadwhen it throws on import): verified (bases test). - Claim: the editor and preview commands stay refused on a non-Core base: verified (bases test).
- Claim: package themes on a non-Core base still use Core's module and stylesheet exports, and integration validation does not check
base: matches the code and the record's FR3 gap line. - Claim: the record edits carry no project status and no new open questions: verified; the remaining gap lines name their requirement and the mismatch.
- Changeset claim: the theme commands call the adapter, the CLI does every write, the authoring entry publishes the step contracts, and the new error code and refusal reason exist: verified. "A plain path still serves every step": false (eighth finding).
- Files with findings:
api/theme/base/base.mjs,api/base/call-step.mjs,commands/theme.mjs,api/theme/_adapter.mjs,api/doctor/theme-checks.mjs(doctor finding),api/theme/add/add.mjs,use/use.mjs,remove/remove.mjs,targets/targets.mjs(undocumented options),.changeset/cli-bases-themes.md,docs/specs/AST-114-bases/spec.md(owner decision, formatting note),foundation/bases/requirements.mjs(wording note),foundation/response/error-codes.mjs(union note). - Files clear:
README.md,foundation/discovery/theme-imports.mjs,api/integration/pack-check.mjs,api/theme/build/build.mjs,api/theme/theme.type.mjs,authoring/index.d.ts,authoring/integration/adapter.ts,authoring/integration/integration.doc.mjs,authoring/integration/schema.mjs,authoring/integration/type.ts,clients/cli/bases.test.mjs,clients/cli/lib/base-gate.mjs,clients/cli/lib/manifest.mjs,foundation/bases/resolve.mjs,foundation/bases/steps.mjs,foundation/config/theme-state.mjs,foundation/response/base.d.ts,foundation/response/error-codes.doc.mjs(their new public types wait on the owner decision).
…pter
On a base other than Core, theme targets, theme build, and theme add/use/remove
call the base's themes adapter (targets, compile, appModule). The CLI does
every write. Adds the optional {module, steps} adapter form, published step
contract types, ERR_BASE_ADAPTER, and the not-exported refusal reason. A base
serves a step only to the commands that call it.
52759b9 to
b3809cf
Compare
PR Analysis Report
Generated by PR Enrichment workflow | View current CI run |
There was a problem hiding this comment.
Approval waits on an engineering owner. This pull request writes new requirements into draft spec:AST-114 (the adapter entry and step contract, the caller-only step rule and the not-exported reason), adds new @astryxdesign/cli surface, and departs from current spec:AST-050 FR2, FR5 and FR8 on non-Core bases without amending that record. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request and naming the record that amends spec:AST-050 for non-Core bases; the author may do so as an engineering owner. Every finding below still reproduces at this head.
Blocking findings to fix, whatever that decision is (the earlier inline comments, the non-blocking ones included, still apply at this head):
theme build --outthrough a symlinked folder inside the project writes outside it, becauseapi/theme/base/base.mjs:136-144checks the path lexically instead of withassertWithinon real paths, as Core'sconfineOutputdoes (architecture:cli-surfaceINV10).- The base build copies Core's
--checkcomparison instead of callingstaleBuildOutputs, so--checkreports a CRLF checkout of a correct build as outdated (spec:AST-050FR8). pnpm check:cli-structure, whichcheck:reporuns, fails with five errors:api/base/has no FunctionDoc, typedefs or test, andapi/base/call-step.mjsandapi/theme/base/base.mjsimportnode:fsoutside the subject's adapter (INV20, INV21).- The base dispatch lives in the theme handler (
clients/cli/commands/theme.mjs:1491-1494), so on a non-Core basethemeBuildcalled through@astryxdesign/cli/apiwrites Core's CSS outputs, andthemeAddwrites Core's module body instead of the base'sappModulesource (INV22). - After a successful
theme buildandtheme addon a non-Core base,astryx doctorfailstheme-ownersfor a.tsmodule andtheme-modulefor a.jsmodule, and each check names a fix that does not clear it (api/theme/_adapter.mjs:383,spec:AST-050FR11). - On a base, the generated TypeScript module no longer exports
ThemeSlug, whichspec:AST-050FR2 lists among the module's public exports, because the CLI checks only forthemesanddefaultThemeSlug. - A typed
unsupportedfailure answersERR_BASE_CAPABILITYwithout therequirementmember thatarchitecture:cli-surfaceINV2 and the README promise on that code. - The new changeset says a plain path "still" serves every step, while
main's unreleasedcli-bases.mdchangeset says commands do not call base adapters, so the release notes contradict the change and each other. - Miss: a base build writes every returned file over whatever is there, so a theme source named for its theme (
matcha.tswithname: 'matcha') or an unrelated file in the--outfolder is silently replaced, wherespec:AST-050FR8 says a build never replaces any file but its own outputs and Core's build refuses withERR_FILE_EXISTS(api/theme/base/base.mjs:190-197). - Regression:
theme removeof the only added theme on a non-Core base refuses with "has changes the CLI did not write", becauseremoveLastThemecompares the module with Core's rendering and never receives the base's renderer (api/theme/_adapter.mjs:1482,spec:AST-050FR4).
Claims and files checked
Review mode: full; reason: merge-touches-pr-files
- Claim: theme targets, build, add, use and remove call the base's themes adapter on a non-Core base: verified (bases tests; the same commands on a fixture project).
- Claim: targets keeps the CLI's filter, exact match and near-miss suggestions, with an empty class when the base gives none: verified (bases test).
- Claim: build loads the source with no Core interception and passes the file, export, value and theme name to compile: verified (base build code and test).
- Claim: a build writes every returned file inside the project as one atomic write: false for a symlinked folder (first finding), and the write can replace the source (ninth finding).
- Claim:
--checkcompares the returned files, writes nothing and exits 1 when stale: verified, but a CRLF copy is reported stale (second finding). - Claim: the JSON receipts are
theme.build.baseandtheme.build.check: verified. - Claim:
--family,--watchand--outwith several files fail withERR_THEME_INVALID: verified in the base build handler;--family-keyalone is accepted (non-blocking). - Claim: add, use and remove keep Core's record logic, a local module is
<slug>.{js,mjs,ts,tsx}, and the stylesheet is null unless<slug>.cssexists: verified for add and use; removing the only theme fails (tenth finding). - Claim: the CLI writes its header and record, followed by the adapter's source with relative specifiers: verified (bases test; fixture run).
- Claim: the first-add wiring snippet is not printed on another base: verified (first add on a fixture project).
- Claim: typed failures map to the command's codes with the message, location and fix: verified, but
unsupportedlacksrequirement(seventh finding). - Claim: a throw or a malformed value fails with
ERR_BASE_ADAPTER, naming base, step and module, and writes nothing: verified for a single build and an add; a batch keeps the themes built before the failure (non-blocking). - Claim: a listed step that the module does not export refuses with
not-exported, and an unlisted export is never called: verified (tests). - Claim: nothing changes on a Core run: verified (the seven published themes build to identical output on both trees; the CLI theme, doctor, config, discovery, bases and pack-check suites pass).
- Claim: the pull request is based on main after the first step merged: verified.
- Claim: the listed gates pass: the bases tests pass (55 at this head, not 40); the API-type sync, json-api and authoring typechecks, strict typecheck, README check, published-types verify, knowledge check, changeset check and eslint on the changed files pass. The full test suite was not re-run.
check:cli-structure, which the description does not list, fails (third finding). - Claim: the changed step-one tests now show a plain-path adapter's commands in help without loading it, and a run loads it (
failed-to-loadwhen it throws on import): verified (bases test). - Claim: the editor and preview commands stay refused on a non-Core base: verified (bases test).
- Claim: package themes on a non-Core base still use Core's module and stylesheet exports, and integration validation does not check
base: matches the code and the record's FR3 gap line. - Claim: the record edits carry no project status and no new open questions: verified; the remaining gap lines name their requirement and the mismatch.
- Changeset claim: the theme commands call the adapter, the CLI does every write, the authoring entry publishes the step contracts, and the new error code and refusal reason exist: verified. "A plain path still serves every step": false (eighth finding).
- Files with findings:
api/theme/base/base.mjs,api/base/call-step.mjs,commands/theme.mjs,api/theme/_adapter.mjs,api/doctor/theme-checks.mjs(doctor finding),api/theme/add/add.mjs,use/use.mjs,remove/remove.mjs,targets/targets.mjs(undocumented options),.changeset/cli-bases-themes.md,docs/specs/AST-114-bases/spec.md(owner decision, formatting note),foundation/bases/requirements.mjs(wording note),foundation/response/error-codes.mjs(union note). - Files clear:
README.md,foundation/discovery/theme-imports.mjs,api/integration/pack-check.mjs,api/theme/build/build.mjs,api/theme/theme.type.mjs,authoring/index.d.ts,authoring/integration/adapter.ts,authoring/integration/integration.doc.mjs,authoring/integration/schema.mjs,authoring/integration/type.ts,clients/cli/bases.test.mjs,clients/cli/lib/base-gate.mjs,clients/cli/lib/manifest.mjs,foundation/bases/resolve.mjs,foundation/bases/steps.mjs,foundation/config/theme-state.mjs,foundation/response/base.d.ts,foundation/response/error-codes.doc.mjs(their new public types wait on the owner decision).
|
Closing for now: this prototype is paused by the maintainer until a design decision. The branch stays as it is, and the work comes back as a new pull request if the step design is chosen. |
HOLD: prototype paused by the maintainer until at least 2026-11-19; not for merge until he approves it.
Prototype — draft, not for merge. Based on main, after the first step merged. Wires the
themescapability end to end as the proof for bases step two; other capabilities stay unserved.What a native base author writes
astryx.integration.mjs:adapters/themes.mjs(types from@astryxdesign/cli/authoring:ThemesAdapter,Step,StepResult, …):An adapter never writes, prints, or exits. It returns
{ok: true, value, warnings?, notices?}or{ok: false, failure: {code, message, at?, fix?}}.What each command does with it
theme targets [filter]: callstargets. The CLI still does the filter, the exact-component match, and the near-miss suggestions.classNameis''when the base gives none.theme build <file>: the CLI loads the source with no Core interception and callscompile({theme: {file, exportName, value}, name, iconsSpecifier?}). It writes every returned file beside the source, or into the--outfolder, inside the project, as one atomic write.--checkcompares the returned contents with what is on disk and writes nothing; exit 1 when stale. The JSON receipt istheme.build.base(for--check,theme.build.check).--family,--watch, and--outwith several files fail withERR_THEME_INVALID.theme add | use | remove: same record logic as Core. A local theme's module is<slug>.{js,mjs,ts,tsx}beside the source; its stylesheet isnullunless<slug>.cssexists. The CLI callsappModule({themes, defaultSlug})with specifiers relative to the generated module (TS extension dropped). Then it writessrc/astryx-themes.tsas the CLI's own@generatedheader and@astryx-theme-record, followed by the returned source, so every base keeps a readable record. The first-add wiring snippet (Core's<Theme>) is not printed on another base.invalid-input→ERR_THEME_INVALID,not-found→ the command's not-found code,conflict→ERR_FILE_EXISTS,unsupported→ERR_BASE_CAPABILITY. The message is the base's message plus(file:line), andfixbecomes a suggestion. A throw, a non-StepResult, or a value that breaks the contract → newERR_BASE_ADAPTER, naming the base, step, and module. Nothing is written in either case.not-exported:astryx theme build needs the themes.compile step; the active base @acme/native-ui lists it but ./adapters/themes.mjs does not export it.A function the module exports for a step it does not list is never called.On a Core run nothing changes: every Core call site takes its old path, and the generated module text is the same.
Tests
packages/cli/clients/cli/bases.test.mjs, new block theme commands call the native base's themes adapter. A fixture native base with a real themes adapter and two local theme sources:theme targets: the adapter's targets, the CLI filter, andERR_UNKNOWN_COMPONENTon a miss.theme build: the written file is byte-equal to whatcompilereturned.--checkpasses, then fails after a hand edit and writes nothing. Text output shows the[ok]and[note]lines.invalid-inputfailure becomesERR_THEME_INVALIDwith the base's message, and nothing is written.theme add/add/use/remove: the exact module text (CLI header +appModulesource), the record after each step, and no Core snippet in the text output.ERR_BASE_ADAPTERfor a throwingcompileand for anappModulethat returns{source: 42}. Nothing is written.steps: ['targets', 'compile']with a module that exports onlytargets: help shows targets and build but hides add,buildrefuses withnot-exportedplusmodule,addrefuses withnot-declared, and the manifest lists the served steps.experimental theme editor show|how,preview add, and the bareeditorgroup refuse withnot-declaredand write nothing on a themes base; help hideseditor, and the manifest marks it unavailable whilecompileis available.failed-to-loadwhen it throws on import). In the unit check, a listed-but-missing step isnot-exported.Gates (run on this head)
pnpm sync:api-types✓ ·pnpm typecheck:json-api✓ ·pnpm typecheck:authoring✓ ·pnpm readme:check✓ (README regenerated for the new code)pnpm typecheck:strict✓pnpm test: 13822 passed. Five failed, all known on this box: use-locale/use-collator (ICU), plus packed-self-audit, stored-docs, and importpath, which time out under load and pass when run alone. bases.test passes 40/40.node .github/scripts/cli-api-types-verify.mjs✓ · rootpnpm check:knowledge✓ ·node scripts/check-changesets.mjs✓ · eslint on changed files ✓Not done (prototype limits)
themes.targets,themes.compile, andthemes.appModuleare called, and a base serves each one only to the commands that call it (STEP_CALLERS:theme targets|build|add|use|removeand theirexperimental themetwins). Every other command that needs a step stays hidden and refused, includingexperimental theme editor *andexperimental theme preview add, which declare themes steps but call no adapter. Recorded as an FR6 gap.doctor integration validatedoes not checkbaseyet (FR3 gap kept).Writing rubric results
AST-114 edits only: R1 present tense, describes the system and no project steps ✓ · R2 no research in the record ✓ · R3 no change citations ✓ · R4 no new decisions ✓ · R5 no PR or issue references ✓ · R6 no new open questions ✓ · R7 the remaining gaps use
<FR> gap:lines, no status ✓