feat: close WCAG22 feasibility transports - #317
Conversation
WalkthroughДобавлены versioned WCAG 2.2 feasibility protocol и bounded transport через Core, FFI, WASM, npm и Swift. Conformance pack обновлён до 5.0.0, добавлены canonical vectors, release validators, benchmark evidence и CI capability/evidence gates. ChangesWCAG 2.2 feasibility transport
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 10
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/colors/bench/wcag22-feasibility-wasm-boundary-v1.json (1)
2-2: 🗄️ Data Integrity & Integration | 🔴 Critical | ⚡ Quick winУдалите лишний токен после корневого JSON-объекта.
Строка 2 делает артефакт невалидным JSON: загрузчики benchmark и release gates завершатся ошибкой разбора trailing data.
Предлагаемое исправление
-2🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/colors/bench/wcag22-feasibility-wasm-boundary-v1.json` at line 2, Удалите лишний токен после корневого JSON-объекта в артефакте wcag22-feasibility-wasm-boundary-v1.json, оставив ровно один валидный корневой JSON-объект без trailing data.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/ci.yml:
- Around line 258-289: Консолидируй список consumer-крейтов, который сейчас
дублируется в Python-проверке и Bash-цикле в CI. Определи единый источник списка
и используй его для проверок зависимостей и feature tree, чтобы добавление
нового consumer автоматически охватывалось обоими гейтами.
In `@bindings/swift/ci/check-observation.sh`:
- Line 76: Измените проверки в check-observation.sh, включая участки вокруг
wholeCall.maxRequestBytes и отмеченные диапазоны, чтобы ожидаемый предел
вычислялся из benchmark.profileLimits, а не из проверяемого evidence. Явно
сравнивайте вычисленное значение с evidence.wholeCall.maxRequestBytes и добавьте
мутацию, которая подтверждает отклонение при несоответствии. Используйте
benchmark.profileLimits как единственный источник истины для транспортного
предела.
In `@bindings/swift/README.md`:
- Around line 94-106: Update the outdated current pack version reference near
the earlier README section from pack 2.0.0 to pack 5.0.0, keeping the existing
pack 5.0.0 reference in the feasibility protocol section consistent.
In `@bindings/swift/Sources/LabColors/Wcag22FeasibilityProtocol.swift`:
- Around line 854-880: Update the public evaluateWcag22Feasibility(_: [UInt8])
overload to delegate to the internal evaluateWcag22Feasibility(_: Data, using:)
helper instead of duplicating the size check, bridge dispatch, and decoding
logic. Preserve the existing preflight behavior by passing the request through
the shared helper and using Wcag22FeasibilityBridge.live.
In `@bindings/swift/Tests/LabColorsConformanceTests/ConformanceTests.swift`:
- Around line 654-670: Remove all force casts from the mutation-test fixture
parsing in mutated and its analogous implementation around the other referenced
mutation test. Replace each force cast with a conditional cast wrapped in
XCTUnwrap so unexpected fixture shapes produce assertion failures while
preserving the existing domain, failureMatrix, and proof mutation flow.
- Around line 492-495: Update the assertion in ConformanceTests around
evaluateWcag22FeasibilityRawV1 to compare the returned raw Data directly with
the expected canonical FFI bytes, rather than decoding through
String(decoding:as:). Preserve the existing case-specific failure context while
ensuring invalid UTF-8 bytes cannot be normalized or hidden.
In `@conformance/README.md`:
- Around line 81-82: Исправьте описание истории manifest.numericalCapabilities в
conformance README: укажите, что поле введено в pack 3.0.0, а в pack 4.0.0
переведено на proof-capable schema V2; сохраните упоминание pack 5.0.0 только в
соответствии с фактической историей.
In `@packages/colors/test/wcag22-feasibility.test.mjs`:
- Around line 155-272: Update the test “feasibility TypeScript is exhaustive and
excludes forged/proportional states” to compile its consumer against the
published packages/colors/pkg/labcolors.d.ts artifact instead of generating
declarations from TS_RESULT_TYPES in lib.rs. Remove the temporary Rust
declaration extraction and fixture labcolors.d.ts setup, while preserving the
existing consumer assertions and TypeScript compilation flow.
In `@scripts/check_wcag22_feasibility_applicability.py`:
- Around line 300-305: Validate that the parsed JSON payload is a mapping/object
immediately after json.loads in the artifact parsing flow, before calling
payload.get("schemaVersion"), and raise ApplicabilityError for arrays, null, and
scalar roots. Preserve the existing schemaVersion validation for object
payloads.
In `@scripts/verify-package-release.mjs`:
- Around line 693-703: Replace the length-only checks in the proof validation
loop around exactKeys and byteArray with independent recomputation of
domainDigest, relationSetDigest, evaluationId, and proofSha256 from their
canonical preimages and proof artifact. Compare each supplied digest to the
recomputed value, including all validation paths at the additional referenced
ranges, so arbitrary 32-byte values cannot pass release validation.
---
Outside diff comments:
In `@packages/colors/bench/wcag22-feasibility-wasm-boundary-v1.json`:
- Line 2: Удалите лишний токен после корневого JSON-объекта в артефакте
wcag22-feasibility-wasm-boundary-v1.json, оставив ровно один валидный корневой
JSON-объект без trailing data.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: d720fa8e-17d9-4c91-b450-54c4e5c6d8db
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (44)
.github/workflows/ci.yml.github/workflows/native-conformance.ymlCHANGELOG.mdREADME.mdbindings/swift/.gitignorebindings/swift/Package.swiftbindings/swift/README.mdbindings/swift/Sources/LabColors/.gitkeepbindings/swift/Sources/LabColors/Wcag22FeasibilityProtocol.swiftbindings/swift/Tests/LabColorsConformanceTests/ConformanceTests.swiftbindings/swift/ci/check-observation.shbindings/swift/ci/run-conformance.shconformance/README.mdconformance/vectors/manifest.jsonconformance/vectors/wcag22-feasibility.jsoncrates/labcolors-conformance/Cargo.tomlcrates/labcolors-conformance/src/bin/gen.rscrates/labcolors-conformance/src/lib.rscrates/labcolors-conformance/tests/pack_v5_contract.rscrates/labcolors-conformance/tests/reference_runner.rscrates/labcolors-ffi/Cargo.tomlcrates/labcolors-ffi/src/lib.rscrates/labcolors-protocol/Cargo.tomlcrates/labcolors-protocol/src/lib.rscrates/labcolors-protocol/tests/protocol.rscrates/labcolors-wasm/Cargo.tomlcrates/labcolors-wasm/src/lib.rscrates/labcolors-wasm/tests/wasm_parity.rsdocs/NAMING.mddocs/migrations/exact-alpha-glow.mddocs/verification-map.mdpackages/colors/README.mdpackages/colors/bench/wasm-size-budget-v2.jsonpackages/colors/bench/wcag22-feasibility-boundary.bench.mjspackages/colors/bench/wcag22-feasibility-wasm-boundary-v1.jsonpackages/colors/index.d.tspackages/colors/index.jspackages/colors/test/release-contract.test.mjspackages/colors/test/wcag22-feasibility-boundary.test.mjspackages/colors/test/wcag22-feasibility.test.mjsscripts/check-wasm-size-budget.mjsscripts/check_wcag22_feasibility_applicability.pyscripts/prepare-npm-package.mjsscripts/verify-package-release.mjs
|
Disposition of the outside-diff JSON finding: verified again on head 375ec90. |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
conformance/README.md (1)
59-63: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winУкажите происхождение и смысл числовых параметров corpus.
Значения
7/2/0,92и59перечислены без определения метрики, диапазона/границ, чувствительности к изменению входа и ссылки на независимую проверку. Добавьте для каждого числа краткое объяснение и источник в генераторе или тестах.As per coding guidelines: документация должна указывать происхождение числовых параметров, диапазон, sensitivity и тест.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@conformance/README.md` around lines 59 - 63, Обновите описание corpus в README: для чисел 7/2/0, 92 и 59 укажите определяемую метрику, диапазон и граничные значения, чувствительность к изменению входных данных, а также независимый тест или символ генератора, откуда они получены. Сохраните существующее описание критериев и отдельно поясните, что означает каждая числовая группа.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/colors/README.md`:
- Around line 17-21: Документируйте минимально поддерживаемую версию TypeScript
для потребителей в README рядом с описанием публичного index.d.ts и
esnext.disposable. Обновите release-gate так, чтобы он явно проверял smoke-test
на этой минимальной версии при skipLibCheck: false, тем самым закрепив границу
контракта вместо проверки только произвольной зафиксированной версии.
---
Outside diff comments:
In `@conformance/README.md`:
- Around line 59-63: Обновите описание corpus в README: для чисел 7/2/0, 92 и 59
укажите определяемую метрику, диапазон и граничные значения, чувствительность к
изменению входных данных, а также независимый тест или символ генератора, откуда
они получены. Сохраните существующее описание критериев и отдельно поясните, что
означает каждая числовая группа.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: bb209dae-5489-45a9-b1f4-7f2b7067e8de
📒 Files selected for processing (16)
.github/workflows/ci.ymlbindings/swift/README.mdbindings/swift/Sources/LabColors/Wcag22FeasibilityProtocol.swiftbindings/swift/Tests/LabColorsConformanceTests/ConformanceTests.swiftbindings/swift/ci/check-observation.shconformance/README.mdpackages/colors/README.mdpackages/colors/adapt-theme.d.tspackages/colors/apply-theme.d.tspackages/colors/index.d.tspackages/colors/test/release-contract.test.mjspackages/colors/test/wcag22-feasibility.test.mjspackages/colors/tsconfig.jsonpackages/colors/watch-theme.d.tsscripts/check_wcag22_feasibility_applicability.pyscripts/verify-package-release.mjs
|
Addressed the outside-diff feasibility-corpus provenance finding in bdcb864. Fresh independent review: CLEAN. |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
CI provenance fix in 0a9ebcf: adding the exact TypeScript floor changed only the dev-only package-manifest bytes, so the fail-closed whole-call verifier correctly rejected the stale |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Outcome
Closes #295 after exact-head review, merge, and the #228 handoff.
Completes Slice B as one vertical public capability:
labcolors-protocolowns strict bounded bytes → Core → canonical wire projection and the solewcag22-feasibilityfeature edge;Success(Feasibility) | Failure(Error)algebra;256 × EDTO graph;Uint8ArrayJavaScript value before consulting WASM, while genuine cross-realm byte arrays remain valid;No selection, client-semantic inference, appearance scoring, emitted colour, adaptive runtime, or Core feasibility mathematics changed.
Root cause
Slice A was complete, but the delivery boundary had no shared versioned protocol, UniFFI obtained the capability accidentally through Core defaults, and neither binding could transport the complete proof algebra without duplicating policy. This change restores one feature owner and one bytes-to-wire authority.
Final evidence
521240 B, SHA-256d37841bfb2615d05c8366b08dcc7e5aed1bbd3cf27c3db67896108c5ec9c9ca0, with zero discretionary headroom;ba34b5717e752a5f4ef8a388ef6b69613e799539bb887f26eedc5647542667e1;6001cf41snapshot; a separate fail-closed applicability verifier binds the current full Core source tree and sourced dependency records;Validation
-D warnings, rustfmt, rustdoc, audit, feature-graph and anti-vacuum gates pass on the implementation head;git diff --checkpass;29312468216and Native29312468211are green on0a9ebcfe09f9bb3b32c6532051fcc6b84cc841fd; architecture, numerical, API, documentation and performance reviews are clean; CodeRabbit approved and no review thread remains unresolved.Compatibility / non-goals
This PR does not change
Contract/Floor/solve/solve_many/solve_dj, Pair/Ladder/Material/Glow,legalFloor/wcagRatio, emitted colours, or adaptive runtime traces. Selection, polarity, LPC/Oklab/CAM appearance scoring, arbitrary client domains, and research claims remain with later owners beginning at #296.Summary by CodeRabbit
Новые возможности
wcag22-feasibility.Улучшения
Документация