diff --git a/.agents/skills/champ/SKILL.md b/.agents/skills/champ/SKILL.md index 2096e7e..f40abd4 100644 --- a/.agents/skills/champ/SKILL.md +++ b/.agents/skills/champ/SKILL.md @@ -16,7 +16,7 @@ The subagent persona is a superstar senior SWE. They love concrete specification ## Subagent Workflow 1. **Pick a Task**: Select an uncompleted task from `PLAN.md`. Mark it as in progress `[/]` using the `plan-manager` skill if available. -2. **Diagnostic Cluster Triage (for WPT tasks)**: When tackling WPT conformance tasks, run `node scripts/wpt_cluster_failures.ts --spec=` to inspect top failure clusters and prioritize high-frequency patterns. +2. **Diagnostic Cluster Triage (for WPT tasks)**: When tackling WPT conformance tasks, run `node scripts/wpt/node/cluster.ts --spec=` to inspect top failure clusters and prioritize high-frequency patterns. 3. **Red Phase**: Write a failing test in the appropriate test file (or create a new one in `tests/`) that demonstrates the missing feature or bug. 4. **Green Phase**: Implement the code in `src/` to make the test pass, adding explicit spec anchor citations in comments. 5. **Verify**: Run the targeted test to ensure it passes. diff --git a/.agents/skills/coherence-auditor/SKILL.md b/.agents/skills/coherence-auditor/SKILL.md index 0f9a858..02335d0 100644 --- a/.agents/skills/coherence-auditor/SKILL.md +++ b/.agents/skills/coherence-auditor/SKILL.md @@ -43,11 +43,11 @@ Use this skill when you need to audit the consistency, link integrity, codebase - **Generated Code Separation**: Verify that all machine-generated spec files reside in `src/data/gen/` (e.g. `src/data/gen/properties.ts`, `src/data/gen/units.ts`, etc.). Flag any generated files placed directly in `src/data/` or other non-gen folders. - **Extraction Scripts Directory**: Verify that all external test suite extraction scripts reside in `scripts/external_suites/` and use the `extract_.ts` naming pattern. Flag any extraction scripts placed directly in `scripts/` or missing the `extract_` verb prefix. - **Filename Case Standard**: - - Enforce **snake_case** for administrative/utility scripts in `scripts/` (e.g. `prune_resolved_failures.ts`, `generate_all.ts`) and codegen scripts in `scripts/codegen/`. + - Enforce **snake_case** for administrative/utility scripts in `scripts/` (e.g. `scripts/baselines/prune_resolved_failures.ts`, `scripts/codegen/generate_all.ts`) and codegen scripts in `scripts/codegen/`. - Enforce **kebab-case** for public package files, test runners in `tests/` (e.g., `external-lightning.test.ts`, `wpt-extracted.test.ts`), JSON fixtures in `tests/fixtures/`, and baseline files (which must reside in `tests/fixtures/baselines/`). - Flag any deviations or inconsistent mixing of case conventions within the same category. - - **Test Failure & Skip Taxonomy**: Audit terms used for skipping/categorizing failures (`exclude` for unexecutable HTML suites, `knownFailures` for baseline failures checked and pruned by `prune_resolved_failures.ts`, and `knownSkips` for mapped skips with explicit spec reason strings). - - **Script & Command Alignment**: Ensure script filenames correspond logically to npm script names in `package.json` (e.g. `codegen` $\to$ `scripts/generate_all.ts`, `external:extract` $\to$ `scripts/extract_external_suites.ts`, `baselines:prune` $\to$ `scripts/prune_resolved_failures.ts`). + - **Test Failure & Skip Taxonomy**: Audit terms used for skipping/categorizing failures (`exclude` for unexecutable HTML suites, `knownFailures` for baseline failures checked and pruned by `scripts/baselines/prune_resolved_failures.ts`, and `knownSkips` for mapped skips with explicit spec reason strings). + - **Script & Command Alignment**: Ensure script filenames correspond logically to npm script names in `package.json` (e.g. `codegen` $\to$ `scripts/codegen/generate_all.ts`, `external:extract` $\to$ `scripts/external_suites/extract_all.ts`, `baselines:prune` $\to$ `scripts/baselines/prune_resolved_failures.ts`). 3. **Index & Link Integrity Verification**: - **Automated Link & Spec Path Validation**: Run `node .agents/skills/coherence-auditor/scripts/validate_links.ts` to automatically detect broken relative markdown links, invalid spec submodule paths, and missing script/source file references across all docs. diff --git a/.gemini/context.md b/.gemini/context.md deleted file mode 100644 index 78f7bc0..0000000 --- a/.gemini/context.md +++ /dev/null @@ -1,49 +0,0 @@ -## Persona -You are acting as **Champ**, a superstar senior SWE. You love concrete specifications because there's no question as how to measure success. And you embrace all the conformance tests like hugs. - -## Workflow -For every task you pick from `.gemini/tasks.md`: -1. **Red Phase**: Write a failing test in the appropriate test file (or create a new one) that demonstrates the missing feature or bug. -2. **Green Phase**: Implement the code in `src/` to make the test pass. -3. **Verify**: Run the test to ensure it passes. -4. **Preflight**: Run `pnpm run preflight` to ensure all tests pass and types are correct. -5. **Commit**: Commit the targeted changes with a human-readable, lowercase message describing the action. Do NOT use `git add .` or `git commit -a`. - -## Constraints -- Follow the "Executable Specification" pattern with spec citations in comments. -- File Editing: Do NOT use bash redirection or scratch scripts for editing files. Use the specialized tools: `replace_file_content`, `multi_replace_file_content`, or `write_to_file`. - -## Metacognition & Knowledge Management - -### Core Directives -1. **Know Thyself**: Understand your role as an autonomous agent. -2. **Manage Tasks**: You are empowered to modify your own task list under appropriate conditions. -3. **Interact with User**: Work autonomously in yolo mode. The user trusts you. Notify the user only when needed. -4. **Get Unstuck**: Use strategies to overcome obstacles without constant user intervention. -5. **Learn and Remember**: Utilize knowledge management practices to retain and reuse information. -6. **Don't cheat**: You have integrity. Don't find shortcuts to make tests pass or mark a task complete that you don't feel is truly complete. Be honest. - -### Knowledge Management Rules -- **Store Learnings:** Document significant findings, successful approaches, or pitfalls in a shared location. You should consider appending to a `research.md` file in the `.gemini/` directory. -- **Critical Thinking:** Analyze failures. Why didn't something work as expected? Document this. - -## Context for Current Development Phase (Phase 55) - -### Key Assumptions and Constraints -- The implementation assumes a standard-compliant CSS engine where `CSSGroupingRule` already handles list management for nested rules. -- The move of `cssFloat` assumes that `CSSStyleProperties` (or `CSSStyleDeclaration`) is the correct target for property-level accessors in the target architecture. -- Precision improvements in `Token.value` assume the underlying type can represent the required bit-depth of modern CSS numeric values (typically double-precision). - -### Architectural Decisions -- **Inheritance**: `CSSScopeRule` inherits from `CSSGroupingRule` to reuse existing rule-list management and serialization logic, aligning with the CSS Nesting specification. -- **Parsing Order**: Moving `!important` extraction earlier in the syntax pipeline prevents premature validation failures in blocks that would otherwise be considered invalid if `!important` were treated as part of the declaration body. -- **Error Handling**: Shifting from 'hard' parse errors to `` fallbacks for Media Queries ensures better forward compatibility with future MQ extensions. - -### Risks and Failure Modes -- **Specificity Regressions**: Replacing `&` with `:where(:scope)` is critical for zero specificity; failing to use `:where()` would incorrectly inflate the specificity of unparented nested declarations. -- **Cyclic Dependencies**: `var()` fallback logic must be carefully implemented to avoid infinite recursion or stack overflows during resolution. -- **Typed OM Immutability**: Changing `CSSMatrixComponent` to use `DOMMatrix` must ensure that existing code doesn't attempt to mutate the matrix if the implementation expects immutability for OM objects. - -### Reuse Guidelines -- Use existing `CSSGroupingRule` serialization methods when implementing `CSSScopeRule`. -- Leverage the existing `Token` structure for `Token.value` updates to minimize disruption to the lexical analyzer. \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 3f3ca0a..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "search.exclude": { - "**/node_modules": true, - "submodules/": true - } -} \ No newline at end of file diff --git a/AGENTS.md b/AGENTS.md index 3caed56..a57617f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -46,7 +46,7 @@ We intentionally deviate from some specifications for pragmatism, performance, o ### Automation Over Hardcoding As CSS specifications evolve, this codebase must evolve with them. We prioritize automation over manual maintenance for spec-derived data. - **Rule**: Whenever adding support for new properties, values, units, or features that are documented in external data sources (like `mdn-data` or `@webref/css`), ALWAYS prefer updating or creating a code generation script in `scripts/codegen/` rather than hardcoding lists in implementation files. -- **Rule**: Ensure that any new generation script is added to the master script `scripts/generate_all.ts` and that the `pnpm run codegen` command functions correctly. +- **Rule**: Ensure that any new generation script is added to the master script `scripts/codegen/generate_all.ts` and that the `pnpm run codegen` command functions correctly. - **Rule**: The `maintain` script in `package.json` must always include `pnpm run codegen` to ensure that updating submodules automatically updates our generated data. ## Instructions for Agents diff --git a/LOOP.md b/LOOP.md index a1613d1..6a2e97d 100644 --- a/LOOP.md +++ b/LOOP.md @@ -27,7 +27,7 @@ graph TD * *Role*: Implements features, writes tests, runs `pnpm run preflight`, and commits changes to git following the [champ skill](file:///usr/local/google/home/paulirish/code/cssom/.agents/skills/champ/SKILL.md). * *Standards*: * **Spec Anchor Citations**: Must cite exact normative specification anchors in code comments (e.g. `// cssom-1 § 6.5.3 #insert-a-css-rule`) mapping implementation to standard algorithms. - * **Mandatory Pre/Post Cluster Triage & Delta Reconciliation**: When working on WPT conformance waves, start with `node scripts/wpt_cluster_failures.ts --spec=` to record the baseline failure cluster. After implementation, run `wpt_cluster_failures` again. If the test increase is noticeably smaller than the targeted cluster, the developer **MUST diagnose the top remaining failure cluster** and fix any near-miss harness/serialization gaps (e.g. computed color formatting) before declaring the phase complete. + * **Mandatory Pre/Post Cluster Triage & Delta Reconciliation**: When working on WPT conformance waves, start with `node scripts/wpt/node/cluster.ts --spec=` to record the baseline failure cluster. After implementation, run `cluster.ts` again. If the test increase is noticeably smaller than the targeted cluster, the developer **MUST diagnose the top remaining failure cluster** and fix any near-miss harness/serialization gaps (e.g. computed color formatting) before declaring the phase complete. * *Constraint*: Naturally optimistic. Wants compilation and test runs to pass as quickly as possible. 3. **The Reviewer (`codex_reviewer_cmd`)**: * *Role*: Senior engineer persona. Has command execution permissions and runs `git show HEAD` to audit styling, typing, spec citations, and safety. diff --git a/MAINTENANCE.md b/MAINTENANCE.md index a532592..969d0e2 100644 --- a/MAINTENANCE.md +++ b/MAINTENANCE.md @@ -36,7 +36,7 @@ This runs `git submodule update --init --remote && pnpm run submodules:update` t ```bash pnpm run fixtures:generate ``` -This runs `node scripts/extract_external_suites.ts`. +This runs `node scripts/external_suites/extract_all.ts`. **3. Run Tests:** ```bash diff --git a/PLAN.md b/PLAN.md index 9b8d16f..fa47189 100644 --- a/PLAN.md +++ b/PLAN.md @@ -865,7 +865,7 @@ Objective: Organize code generation scripts into a subfolder and provide a singl ### Tasks - [x] **Create `scripts/codegen/` directory**: Created the directory. - [x] **Move Scripts**: Moved all `generate_*.ts` scripts from `scripts/` to `scripts/codegen/`. -- [x] **Create Master Script**: Created `scripts/generate_all.ts` that runs all scripts in `scripts/codegen/` sequentially. +- [x] **Create Master Script**: Created `scripts/codegen/generate_all.ts` that runs all scripts in `scripts/codegen/` sequentially. - [x] **Add Npm Script**: Added a `codegen` script to `package.json` that invokes the master script. - [x] **Verify**: Ran `pnpm run codegen` and ensured all data files are correctly generated in `src/data/`. @@ -1246,7 +1246,7 @@ Objective: Centralize CSS unit definitions in a single configuration file with s - [x] **Define Unified Units Config**: Extracted dynamically from MDN data and specifications instead of maintaining a hardcoded local JSON file. - [x] **Cross-Reference Specifications**: Parsed specifications programmatically inside codegen (Values 4, Contain 3, Conditional 5). - [x] **Implement Units Codegen**: Created `scripts/codegen/generate_units_code.ts` to generate TypeScript types (`CSSUnit` in `src/data/gen/units.ts`) and conversion factors. -- [x] **Integrate and Verify**: Linked codegen to the master `scripts/generate_all.ts` generator and verified with `pnpm run preflight`. +- [x] **Integrate and Verify**: Linked codegen to the master `scripts/codegen/generate_all.ts` generator and verified with `pnpm run preflight`. ## Phase 59: Preparing for Release & OSPO Compliance [x] @@ -1396,11 +1396,11 @@ Objective: Build a Node-based VM sandbox runner using `linkedom` to execute brow - [x] **HTMLElement attributeStyleMap**: Define `HTMLElement.prototype.attributeStyleMap` and `Element.prototype.computedStyleMap()` getters using our `StylePropertyMap` wrapper. #### 2. Sandbox VM Execution Script [x] -- [x] **Runner script**: Create `scripts/run_wpt_node.ts` to crawl selected WPT subfolders (like `css-typed-om/` and `css-properties-values-api/`), execute their internal script tags inside a `vm` context, mock `testharness.js` functions, and collect test results. +- [x] **Runner script**: Create `scripts/wpt/node/run.ts` to crawl selected WPT subfolders (like `css-typed-om/` and `css-properties-values-api/`), execute their internal script tags inside a `vm` context, mock `testharness.js` functions, and collect test results. - [x] **Sandbox configuration**: Support a config file (`tests/wpt-node-config.json`) defining allowlisted/skipped suites and baseline failures. #### 3. Integrate into Preflight [x] -- [x] **Preflight hook**: Hook `scripts/run_wpt_node.ts` into our node test run to enforce dynamic browser WPT checks. +- [x] **Preflight hook**: Hook `scripts/wpt/node/run.ts` into our node test run to enforce dynamic browser WPT checks. --- @@ -1411,11 +1411,11 @@ Objective: Build a diagnostic utility script to detect which of our 1,300+ skipp ### Tasks #### 1. Implement Skip Verification Script [x] -- [x] **Verification script**: Create a script `scripts/prune_resolved_failures.ts` that loads all test runners, bypasses their skip lists, executes the tests, and reports which ones are now passing. +- [x] **Verification script**: Create a script `scripts/baselines/prune_resolved_failures.ts` that loads all test runners, bypasses their skip lists, executes the tests, and reports which ones are now passing. - [x] **Baseline pruner**: Support a write-back flag or step in the script to automatically remove passing cases from `lightning-known-failures.json` and `wpt-cssom-known-failures.json`. #### 2. Run and Prune Obsolete Skips [x] -- [x] **Identify and Prune**: Run `node scripts/prune_resolved_failures.ts` and verify which tests are passing. Prune the passing tests from all lists. +- [x] **Identify and Prune**: Run `node scripts/baselines/prune_resolved_failures.ts` and verify which tests are passing. Prune the passing tests from all lists. - [x] **Preflight check**: Confirm that our preflight still passes and the newly unskipped tests are verified correctly. @@ -1559,10 +1559,10 @@ Objective: Run WPT tests dynamically using a lightweight harness shim, eliminati Objective: Merge redundant WPT shims and DOM setups into a single, clean helper file (`tests/wpt-shim.ts`) and reuse it across both Node unit tests and the sandbox CLI script. ### Tasks -- [x] **Consolidate shims**: Move any unique shims from `scripts/run_wpt_node.ts` (such as `promise_test()`, `assert_not_equals()`, `assert_array_equals()`, `assert_class_string()`, `assert_unreached()`) into `tests/wpt-shim.ts`. +- [x] **Consolidate shims**: Move any unique shims from `scripts/wpt/node/run.ts` (such as `promise_test()`, `assert_not_equals()`, `assert_array_equals()`, `assert_class_string()`, `assert_unreached()`) into `tests/wpt-shim.ts`. - [x] **Consolidate DOM setups**: Integrate the `HTMLStyleElement` `.sheet` mock patching from `the tests/wpt-sandbox-setup.ts` and the `ComputedStylePropertyMapReadOnly` class from it into `tests/wpt-shim.ts`. - [x] **Cleanup setup files**: Delete `the tests/wpt-global-setup.ts` and `the tests/wpt-sandbox-setup.ts` and update any imports. -- [x] **Refactor `scripts/run_wpt_node.ts`**: Make `run_wpt_node.ts` use the unified shims and prototype patches from `tests/wpt-shim.ts`. +- [x] **Refactor `scripts/wpt/node/run.ts`**: Make `run_wpt_node.ts` use the unified shims and prototype patches from `tests/wpt-shim.ts`. - [x] **Verify preflight**: Run `pnpm run preflight` to confirm both test suites and the CLI script compile and pass. --- @@ -1587,7 +1587,7 @@ Objective: Eliminate the verbose 9.5k line static JSON baseline configuration fi ### Tasks - [x] **Dynamic WPT crawling**: Update `tests/wpt-sandbox.test.ts` to crawl the `css-typed-om` directory dynamically at runtime instead of loading a static `include` array. -- [x] **Compact JSON Formatting**: Implement custom single-line-array serialization in `scripts/run_wpt_node_crawler.ts` (`--update-baseline`) to store each file's failures on a single line. +- [x] **Compact JSON Formatting**: Implement custom single-line-array serialization in `scripts/wpt/node/crawl.ts` (`--update-baseline`) to store each file's failures on a single line. - [x] **Dynamic exclusion**: Identify files that fail to initialize (syntax/load errors) and automatically populate them into the `exclude` list during baseline runs. - [x] **Verify preflight**: Run `pnpm run preflight` to confirm all 358 WPT test files run successfully in 9 seconds with the new compact JSON format (~335 lines). @@ -1600,7 +1600,7 @@ Objective: Manually expand syntax validation in `src/typed-om.ts` by adding simp ### Tasks - [x] **Identify Candidate Properties**: Analyze the WPT failures in `tests/fixtures/baselines/wpt-sandbox-known-failures.json` to find properties that fail because they allow invalid types (e.g. `writing-mode`, `direction`, `pointer-events`, `unicode-bidi`, `display`, `position`, etc.). - [x] **Define Houdini-Compliant Syntaxes**: Add these properties to `STANDARD_PROPERTIES_SYNTAX` inside `src/typed-om.ts`. Ensure their syntax strings use only basic types, `|` alternatives, or basic multipliers (no space separators, groupings, `||`, or `&&`). -- [x] **Verify and Baseline**: Run `node scripts/update_wpt_baseline.ts` to execute the suite and confirm the resolved test cases are automatically removed from `tests/fixtures/baselines/wpt-sandbox-known-failures.json`. +- [x] **Verify and Baseline**: Run `node scripts/wpt/node/crawl.ts --update-baseline` to execute the suite and confirm the resolved test cases are automatically removed from `tests/fixtures/baselines/wpt-sandbox-known-failures.json`. - [x] **Address Code Review Findings**: - [x] Remove complex/space-separated properties that cause false-positives from `STANDARD_PROPERTIES_SYNTAX` (`display`, `font-style`, `font-variant-ligatures`, `font-variant-numeric`, `font-variant-east-asian`, `grid-auto-flow`, `text-overflow`, `text-emphasis-position`, `text-underline-position`, `list-style-type`, `overflow-clip-margin`). - [x] Correct `transform-style` syntax by removing the invalid `auto` keyword. @@ -1617,7 +1617,7 @@ Objective: Migrate the massive, duplicate-heavy external test baselines (`lightn ### Tasks - [x] **Define Unified Normalizer**: Extract or share the whitespace normalizer logic. - [x] **Refactor Test Runners**: Update `tests/external-lightning.test.ts` and `tests/wpt-cssom.test.ts` to perform checks against Sets populated with the collapsed string keys. -- [x] **Refactor Baseline Maintenance Scripts**: Update `scripts/prune_resolved_failures.ts` and `scripts/generate_lightning_baseline.ts` to read/write collapsed string array baselines. +- [x] **Refactor Baseline Maintenance Scripts**: Update `scripts/baselines/prune_resolved_failures.ts` and `scripts/baselines/generate_lightning_baseline.ts` to read/write collapsed string array baselines. - [x] **Regenerate Baselines**: Execute the baseline updates and confirm the new compact baselines are generated and all tests remain green. --- @@ -1662,7 +1662,7 @@ Objective: Implement missing CSS Typed OM classes (`CSSPositionValue`, `CSSTrans Objective: Automate conformance logging of WPT sandbox tests to track progress over time. ### Tasks -- [x] **Progress Tracking Script**: Create `scripts/run_wpt_node_crawler.ts` (`--update-progress`) to execute WPT tests and append current statistics to `wpt-progress.md` only when they change. +- [x] **Progress Tracking Script**: Create `scripts/wpt/node/crawl.ts` (`--update-progress`) to execute WPT tests and append current statistics to `wpt-progress.md` only when they change. - [x] **Git Pre-commit Hook**: Implement `.git/hooks/pre-commit` to automatically run progress tracking and stage the updated log file when `src/typed-om.ts` changes. - [x] **Initialize Log**: Run the script and commit the initial baseline log (`5890/12150` passed, 48.48% pass rate). - [x] **Historical Backfill**: Backfill the progress log table with past test execution numbers from transcripts. @@ -1762,7 +1762,7 @@ Objective: Verify our WPT shim conformance against WPT's own unit tests, then sc - [x] Configure includes/excludes lists for these spec folders in `tests/wpt-node-config.json`. - [x] **Unified Multi-Spec Progress Logging**: - [x] Create `wpt-progress.md` logging progress across multiple specs. - - [x] Update progress logging script (`scripts/run_wpt_node_crawler.ts`) to run multiple spec folders, aggregate their test totals, and log progress using the following multi-column layout with spec totals in headers: + - [x] Update progress logging script (`scripts/wpt/node/crawl.ts`) to run multiple spec folders, aggregate their test totals, and log progress using the following multi-column layout with spec totals in headers: ```markdown | Date & Time (UTC) | Commit | Typed OM (12150) | CSSOM (600) | Nesting (120) | Syntax (350) | Selectors (500) | MQ (200) | Overall | Pass Rate | | :--- | :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | @@ -1815,7 +1815,7 @@ Objective: Resolve unbaselined failures in the expanded specifications by comple - [x] **Memory Leak & CPU Performance Safety**: - [x] Guarded globally-shared linkedom prototypes (`Element.prototype`, `CSSStyleDeclaration.prototype`) with a recursion guard to prevent stack overflow/extreme CPU locks. - [x] Removed global `window` closure leaks inside `Node.prototype.appendChild` and `insertBefore` mocks by resolving contexts dynamically via `ownerDocument.defaultView`. - - [x] Implemented automatic worker-queue throttling inside `scripts/run_wpt_node_crawler.ts` using `os.loadavg()` and `os.freemem()` monitoring to prevent vm freeze. + - [x] Implemented automatic worker-queue throttling inside `scripts/wpt/node/crawl.ts` using `os.loadavg()` and `os.freemem()` monitoring to prevent vm freeze. - [x] Guarded heavy crawler runner in `tests/wpt-sandbox.test.ts` with `RUN_SANDBOX_WPT=true` env flag to keep normal preflight check memory footprint minimal. - [x] Replaced shell `exec` with direct binary `execFile` and injected a 3.5s `unref()` self-termination fail-safe timer in workers to stop background loops. - [x] Injected event loop yields (5ms between assertions, 20ms between task spawns) to lower CPU and memory footprint during crawler runs. @@ -1894,8 +1894,8 @@ Objective: Resolve high-frequency failure clusters in `css-nesting` and `css-var - Ensure whitespace preservation in custom property value tokens. - Fix `var()` fallback parsing and serialization in `src/parser.ts` and `src/serializer.ts`. - [x] **Verification**: - - Run `node scripts/wpt_cluster_failures.ts --spec=css-nesting` and verify pass rate jumps. - - Run `node scripts/wpt_cluster_failures.ts --spec=css-variables` and verify pass rate jumps. + - Run `node scripts/wpt/node/cluster.ts --spec=css-nesting` and verify pass rate jumps. + - Run `node scripts/wpt/node/cluster.ts --spec=css-variables` and verify pass rate jumps. - Run `pnpm run preflight` to ensure 0 regressions. --- @@ -1910,7 +1910,7 @@ Objective: Drive WPT `selectors/` conformance (>3,100 tests) by implementing for ### Tasks - [x] **Diagnostic Failure Clustering on `selectors`**: - - Run `node scripts/wpt_cluster_failures.ts --spec=selectors` to identify top error patterns across the 3,103 tests. + - Run `node scripts/wpt/node/cluster.ts --spec=selectors` to identify top error patterns across the 3,103 tests. - [x] **Forgiving Selector List Parsing (`:is()`, `:where()`)**: - Implement forgiving parsing per Selectors 4 #forgiving-selector: invalid or unsupported selectors in the argument list do not invalidate the entire selector or the pseudo-class. - [x] **Complex Pseudo-Class & Pseudo-Element Arguments**: @@ -1923,7 +1923,7 @@ Objective: Drive WPT `selectors/` conformance (>3,100 tests) by implementing for - Add comprehensive quickstarts for dual-path TS/ESM execution, CSSOM rule traversal, Typed OM math & units, and Houdini custom properties. - Document `getComputedStyle` intentional non-goal and adopt `wpt:node` vs. `wpt:browser` taxonomy. - [x] **Verification**: - - Run `node scripts/wpt_cluster_failures.ts --spec=selectors` and measure conformance improvement. + - Run `node scripts/wpt/node/cluster.ts --spec=selectors` and measure conformance improvement. - Run `pnpm run preflight` to guarantee 0 regressions across all suites. --- @@ -1941,7 +1941,7 @@ Objective: Drive WPT `css/cssom/` conformance (>770 tests) by hardening styleshe ### Tasks - [x] **Diagnostic Failure Clustering on `cssom`**: - - Run `node scripts/wpt_cluster_failures.ts --spec=cssom` to identify top failure clusters across the 775 tests in `submodules/web-platform-tests/css/cssom`. + - Run `node scripts/wpt/node/cluster.ts --spec=cssom` to identify top failure clusters across the 775 tests in `submodules/web-platform-tests/css/cssom`. - [x] **Rule Index Boundary & Hierarchy Validation (`insertRule` / `deleteRule`)**: - In `src/CSSOM.ts`, implement strict `IndexSizeError` (when index < 0 or > rules.length) and `HierarchyRequestError` (e.g. attempting to insert `@import` after style rules or `@namespace` rules) per CSSOM 1 § 6.5.3. - Ensure `CSSRule.parentStyleSheet` and `CSSRule.parentRule` back-references are updated when rules are inserted or removed. @@ -1949,7 +1949,7 @@ Objective: Drive WPT `css/cssom/` conformance (>770 tests) by hardening styleshe - In `src/CSSStyleDeclaration.ts`, handle case-insensitive `"important"` priority values, whitespace handling, and normalize priority strings in `setProperty()`. - Ensure canonical property name iteration order and `cssText` roundtripping. - [x] **Verification**: - - Run `node scripts/wpt_cluster_failures.ts --spec=cssom` and verify conformance improvement. + - Run `node scripts/wpt/node/cluster.ts --spec=cssom` and verify conformance improvement. - Run `pnpm run preflight` to guarantee 0 regressions across all suites. --- @@ -1972,17 +1972,17 @@ Objective: Push WPT `css/cssom/` conformance higher toward our practical ceiling - [x] **`CSS.escape()` Implementation**: - Implement the official CSSOM § 3 string escaping algorithm in `src/CSSOM.ts` / `src/index.ts`, passing `escape.html` (9 tests). - [x] **`CSSStyleRule.selectorText` Dynamic Setter**: - - In `src/CSSStyleRule.ts` / `src/CSSOM.ts`, implement the setter for `selectorText`: validate and re-parse the incoming selector text, updating internal rule AST or throwing `SyntaxError` on invalid input per § 6.4.1. + - In `src/CSSOM.ts`, implement the setter for `selectorText`: validate and re-parse the incoming selector text, updating internal rule AST or throwing `SyntaxError` on invalid input per § 6.4.1. - [x] **Rule ASTs & `cssText` Serialization**: - Implement full serialization for `CSSCounterStyleRule.cssText` (single-line format without unformatted linebreaks per CSS Counter Styles 3). - Implement `CSSFontFeatureValuesRule` and `@font-feature-values` sub-rules. - Implement `CSSNamespaceRule` and ensure `Object.prototype.toString.call(CSSNamespaceRule.prototype)` returns `"[object CSSNamespaceRule]"`. - [x] **Constructable Stylesheet `replace()` & `replaceSync()`**: - - In `src/CSSStyleSheet.ts`, implement `replace(text)` returning a `Promise` that parses asynchronously, and `replaceSync(text)` with proper disallow-modification locks. + - In `src/CSSOM.ts`, implement `replace(text)` returning a `Promise` that parses asynchronously, and `replaceSync(text)` with proper disallow-modification locks. - [x] **WPT IDL Test Harness Shims**: - In `tests/wpt-shim.ts`, implement `assert_idl_attribute` and `document.implementation.createDocument`. - [x] **Verification**: - - Run: `node scripts/wpt_cluster_failures.ts --spec=cssom` and verify pass rate increases significantly. + - Run: `node scripts/wpt/node/cluster.ts --spec=cssom` and verify pass rate increases significantly. - Run: `pnpm run preflight` to guarantee 0 regressions across all suites. --- @@ -2020,7 +2020,7 @@ Objective: Implement a pure-AST static selector matcher and declarative cascade - [x] **WPT Test Sandbox Integration (`tests/wpt-shim.ts`)**: - Bind `win.getComputedStyle = (el) => getCascadedStyle(el)` exclusively inside `tests/wpt-shim.ts` as a declarative cascade oracle to satisfy WPT assertion checks without introducing API ambiguity in public package exports. - [x] **Verification**: - - Run `node scripts/wpt_cluster_failures.ts --spec=selectors` and `node scripts/wpt_cluster_failures.ts --spec=css-variables` to verify dramatic pass rate jumps. + - Run `node scripts/wpt/node/cluster.ts --spec=selectors` and `node scripts/wpt/node/cluster.ts --spec=css-variables` to verify dramatic pass rate jumps. - Run `pnpm run preflight` to guarantee 0 regressions across all 197+ test suites. --- @@ -2040,10 +2040,13 @@ Objective: Generate standard property syntax definitions for all 800+ CSS proper - [x] **Property Syntax Codegen (`scripts/codegen/generate_standard_syntax.ts`)**: - Read `node_modules/@webref/css/css.json` containing all 815 standard CSS properties. - Convert standard W3C syntax expressions into Houdini-compliant syntax definitions (``, ``, ``, ``, ``, `