Repository navigation
Conversation
clauderic
force-pushed
the
executable-specs
branch
from
October 20, 2026 11:44
529bddb to
9c19b1d
Compare
2 tasks done
clauderic
force-pushed
the
executable-specs
branch
from
October 20, 2026 12:46
ba0a668 to
c95d9c1
Compare
2 tasks done
clauderic
force-pushed
the
executable-specs
branch
from
October 20, 2026 13:15
c95d9c1 to
6110f13
Compare
clauderic
changed the base branch from
web-components-without-assets
to
offense-end-at-eof
October 20, 2026 13:15
clauderic
added this pull request to stack #1353
October 20, 2026 13:15
charlespwd
reviewed
Oct 20, 2026
clauderic
force-pushed
the
executable-specs
branch
2 times, most recently
from
October 20, 2026 15:28
8e89fa0 to
b209a11
Compare
clauderic
force-pushed
the
executable-specs
branch
2 times, most recently
from
October 20, 2026 16:23
4065875 to
b07c810
Compare
clauderic
force-pushed
the
executable-specs
branch
from
October 20, 2026 16:24
b07c810 to
ed01460
Compare
clauderic
force-pushed
the
executable-specs
branch
3 times, most recently
from
October 20, 2026 18:02
cd2693c to
d07a87e
Compare
1 task done
AssetSizeCSS and AssetSizeJavaScript called fetch directly to get the size of a remote file, so the only way to fake it was vi.mock. They now get it from a new optional `remoteFileSize` dependency, which defaults to the same HEAD request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 tasks done
clauderic
force-pushed
the
executable-specs
branch
from
October 21, 2026 00:24
d07a87e to
b03dd6a
Compare
clauderic
removed this pull request from stack #1353
October 21, 2026 00:28
clauderic
added this pull request to stack #1358
October 21, 2026 00:29
1 task done
clauderic
removed this pull request from stack #1358
October 21, 2026 00:47
clauderic
added this pull request to stack #1360
October 21, 2026 00:48
clauderic
force-pushed
the
executable-specs
branch
from
October 21, 2026 12:59
b03dd6a to
d6f62c1
Compare
clauderic
force-pushed
the
executable-specs
branch
from
October 21, 2026 14:49
d6f62c1 to
e7b5e9c
Compare
Each check gets a language-neutral spec in specs/checks: a YAML list of cases, each a theme and every offense the check reports on it, with fixes and suggestions given as the resulting files. They live at the repo root because they're the contract every implementation runs. specs/checks/README.md describes the format: docsets, check options, app mode, several checks at once, autofix, the theme graph, generated files and remote files. packages/theme-check-common/src/specs.spec.ts runs them with the rest of the suite, and fails if a check has no spec. Every check() call the check tests made became a spec case, recorded from the suite, re-run from the YAML and compared. A test was deleted when all of its calls became cases and everything it asserted was a function of what those calls returned. Statement, branch and function coverage of theme-check-common is unchanged. These stay in TypeScript: - tests that call no check, or assert on thrown errors or a reporter; - tests that need a dependency a spec can't state yet: JSON schemas, block or section schemas, doc definitions, or a custom file system; - the two ValidScopedCSSClass tests of running without the theme graph, since a spec always has one; - the two ValidStaticBlockType tests, which run every check and reach code in other checks that no other test does. Its spec has the same cases for the check alone; - the LiquidSyntaxError parity scenarios. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The theme graph gets the same kind of specs as the checks: YAML in specs/graph/, run by packages/theme-graph/src/specs.spec.ts. Each case is a small theme and every edge the graph has for it, with positions as [line, character]. Cases about entry points or modules list those too. The 12 cases replace 11 of the 12 buildThemeGraph tests, which checked the skeleton and theme-app-extension fixtures with arrayContaining. Every fixture file is in some case verbatim, with the same outgoing edges it had in the fixture's graph, and theme-graph's coverage only goes up. The 'have a root URI' test stays, and so does the skeleton fixture it uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
clauderic
force-pushed
the
executable-specs
branch
from
October 22, 2026 00:51
e7b5e9c to
b98ccf5
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #1357, a parser fix. Review that first; this PR's base moves to
mainonce it merges. The specs record the end-of-file positions that #1352 fixed.What are you adding in this PR?
The check tests become executable, language-neutral specs: one YAML file per check in
specs/checks/, at the repo root because every implementation runs them. Each case is a theme and every offense the check reports on it:src/specs.spec.tsruns every spec as part ofpnpm test, so they run in CI on every platform the suite does. It fails if a check has no spec.[line, character]in UTF-16, and the text it highlights. The runner cuts the highlight out of the file at the range the check reported, so the two pin the range even when the text repeats. Fixes and suggestions are given as the resulting file.[{ repeat: a, times: 20971521 }], and so is a highlight of one.specs/checks/README.mdcovers the rest of the format: docsets, check options, app mode, several checks in one case, autofix, the theme graph (references), generated files and remote files.The specs replace the tests they cover:
The theme graph gets the same kind of specs, in
specs/graph/. Each case is a small theme and every edge the graph has for it:src/specs.spec.tsin theme-graph runs them.specs/graph/README.mdcovers the format.buildThemeGraphtests, which checked two fixture themes witharrayContaining.have a root URItest stays, and so does the skeleton fixture it uses.There are three commits:
remoteFileSizedependency. The one production change, described below.How the conversion was done, and checked
check()call in the check tests was recorded from the running suite: its theme, checks, options, dependencies and offenses.expectin it was about what those calls returned. The script checks this with the TypeScript compiler API, not by matching text.A small production change
Before, AssetSizeCSS and AssetSizeJavaScript called
fetchdirectly, so their tests could only fake remote sizes withvi.mock. There's now an optionalremoteFileSizedependency, which defaults to the same HEAD request. A spec states a remote file infiles, keyed by its URL, and the check sees only its size. It has a minor changeset.What stays in TypeScript
file://sections/file.liquid, which isn't a theme path.parity/.What's next? Any followup issues?
What did you learn?
Comparing coverage before and after the deletions caught two tests the conversion shouldn't have deleted: ValidScopedCSSClass running without the theme graph. Their cases passed, but only because the specs runner always provides the graph, so they no longer tested that path. They're back in TypeScript.
Converting the asset-size tests also turned up one that only passed because an earlier test's
mockReturnValue(true)survivedvi.clearAllMocks().Tophatting
npx vitest run packages/theme-check-common/src/specs.spec.tsruns just the specs.npx vitest run packages/theme-graph/src/specs.spec.tsruns the 13 graph cases.message,startorhighlightin a spec file.Before you deploy
changeset🤖 Generated with Claude Code