feat(core): compile explicit WCAG feasibility domains (#296-A) - #318
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 44 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
WalkthroughДобавлена поддержка WCAG 2.2 feasibility для явно объявленных конечных sRGB8-доменов. Kernel, proof-структуры и assessments параметризованы размером домена, добавлены explicit API, identity-контракт, тесты, capability-проверки и обновлены benchmark и WASM evidence-артефакты. ChangesExplicit WCAG 2.2 feasibility
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related issues
Possibly related PRs
Sequence Diagram(s)sequenceDiagram
participant Client
participant explicit_evaluate
participant evaluate_domain_with
participant PackedDecisionStorage
participant EvaluationProofV1
Client->>explicit_evaluate: RequestV1 с кандидатами и отношениями
explicit_evaluate->>evaluate_domain_with: Полный C × E обход
evaluate_domain_with->>PackedDecisionStorage: Запись matrix и partition bits
PackedDecisionStorage-->>evaluate_domain_with: Packed result
evaluate_domain_with->>EvaluationProofV1: Sealing и digest
EvaluationProofV1-->>explicit_evaluate: Feasible, Infeasible или NotEvaluated
explicit_evaluate-->>Client: FeasibilityV1
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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 `@crates/labcolors-core/contracts/wcag22-feasibility-benchmark-v2.json`:
- Around line 57-75: Проверь subjectManifest скриптами
check_wcag22_feasibility_applicability.py и
check_wcag22_feasibility_benchmark.py --verify-current-subjects; для второго
запуска передай обязательный --artifact-sha256. Если проверки выявят
расхождения, обнови пути, порядок или sha256 в subjectManifest по результатам
скриптов.
In `@crates/labcolors-core/README.md`:
- Around line 61-70: Привяжите нормативную числовую модель в README к конкретным
explicit-тестам, identity fixture или независимому oracle: укажите происхождение
параметров C и E, проверяемый диапазон и чувствительность формул W и B. Отдельно
перечислите проверки для E=0, дубликатов ID и resource limits, включая
подтверждение типизированных ошибок и отсутствия частичного результата.
In `@crates/labcolors-core/src/wcag22_feasibility/explicit.rs`:
- Around line 397-426: Update AssessmentIter::next so an out-of-range
candidate_index produces an explicit, clearly justified expect-style invariant
failure instead of returning None via the ? operator. Preserve normal iteration
for valid indices and document that candidate_index must remain within
self.candidates because this is an internal Core invariant, not untrusted input.
In `@scripts/verify_wcag22_explicit_feasibility_identity.py`:
- Around line 106-207: Update evaluation_preimage to append partition as raw
bytes, matching the Rust core’s explicit feasibility grammar, instead of
wrapping it with field(). Keep the existing digest validation, layout encoding,
and other preimage components unchanged.
🪄 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: 63b6f5fa-eada-42fa-9994-44cb2319cc38
📒 Files selected for processing (17)
.cargo/mutants.toml.github/workflows/ci.ymlcrates/labcolors-core/Cargo.tomlcrates/labcolors-core/README.mdcrates/labcolors-core/benches/wcag22_feasibility_admission.rscrates/labcolors-core/contracts/wcag22-explicit-feasibility-identity-v1.jsoncrates/labcolors-core/contracts/wcag22-feasibility-benchmark-v2.jsoncrates/labcolors-core/src/wcag22_feasibility.rscrates/labcolors-core/src/wcag22_feasibility/explicit.rscrates/labcolors-core/src/wcag22_feasibility_tests.rscrates/labcolors-core/tests/wcag22_explicit_feasibility.rsdocs/NAMING.mddocs/verification-map.mdpackages/colors/test/release-contract.test.mjsscripts/check_wcag22_feasibility_applicability.pyscripts/check_wcag22_feasibility_benchmark.pyscripts/verify_wcag22_explicit_feasibility_identity.py
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@crates/labcolors-core/src/wcag22_feasibility.rs`:
- Around line 1144-1163: NeutralAxisPackingV1::record_feasible performs
unchecked partition indexing without documenting or enforcing its domain
invariant. Update record_feasible to validate the computed byte index and bit
position using safe access, returning Err(()) for out-of-range candidates, or
add an explicit justification if the existing invariant is intentionally relied
upon; prefer matching VariablePackingV1::record_feasible and
DecisionStorage::write_feasible_candidate behavior.
🪄 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: 88083f53-80d0-4ea4-9e17-fa1f31787f6f
📒 Files selected for processing (17)
.github/workflows/ci.ymlCHANGELOG.mdcrates/labcolors-core/Cargo.tomlcrates/labcolors-core/README.mdcrates/labcolors-core/contracts/wcag22-feasibility-benchmark-v2.jsoncrates/labcolors-core/src/wcag22_feasibility.rscrates/labcolors-core/src/wcag22_feasibility/explicit.rscrates/labcolors-core/src/wcag22_feasibility_tests.rscrates/labcolors-core/tests/wcag22_explicit_feasibility.rscrates/labcolors-wasm/Cargo.tomldocs/verification-map.mdpackages/colors/README.mdpackages/colors/bench/wasm-size-budget-v3.jsonpackages/colors/bench/wcag22-feasibility-wasm-boundary-v1.jsonpackages/colors/test/release-contract.test.mjspackages/colors/test/wcag22-feasibility-boundary.test.mjsscripts/check-wasm-size-budget.mjs
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@crates/labcolors-core/src/wcag22_feasibility.rs`:
- Around line 1156-1159: Update the comment near CandidateCardinalityMismatch to
remove the claim that the post-loop cardinality check guards the fixed array
from out-of-bounds access. State that bounds safety relies on the associated
type and exact iterator contract, while the post-loop cardinality check only
validates consistency after record_feasible completes.
🪄 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: 596a497b-6622-4867-844a-f898e618692e
📒 Files selected for processing (10)
.github/workflows/ci.ymlCHANGELOG.mdcrates/labcolors-core/contracts/wcag22-feasibility-benchmark-v2.jsoncrates/labcolors-core/src/wcag22_feasibility.rsdocs/verification-map.mdpackages/colors/README.mdpackages/colors/bench/wasm-size-budget-v3.jsonpackages/colors/bench/wcag22-feasibility-wasm-boundary-v1.jsonpackages/colors/test/release-contract.test.mjsscripts/check-wasm-size-budget.mjs
Что изменено
wcag22_feasibility::explicit::evaluateдля конечного клиентского набораopaque candidate ID + immutable Srgb8;W=C×E, непрерывную LSB0-матрицу и partition без построчного padding;Зачем
#296-A убирает специальный случай «только 256 нейтралей» на уровне математического ядра. Клиент по-прежнему владеет именами и семантикой, Core — полной проверкой всех объявленных физических кандидатов против текущего контекста. Выбор/ранжирование кандидата в этот PR не входит.
Корневая причина
Прежний finite-domain компилятор был корректен, но мощность и представление кандидата были зашиты в зарегистрированную нейтральную ось. Это не позволяло доказуемо компилировать произвольный конечный клиентский домен без дублирования Core-математики.
Проверки
cargo test --workspace --locked --quietcargo clippy -p labcolors-core --all-targets --all-features --locked -- -D warningscargo fmt --all --checknpm test && npm run typecheckвpackages/colorsnode --test scripts/docs-drift.test.mjspython3 scripts/verify_wcag22_explicit_feasibility_identity.py --self-testImplements slice A of #296. Родительский Issue остаётся открыт для selection и transport slices.
Summary by CodeRabbit
Новые возможности
wcag22-explicit-feasibility: оценка выполнимости WCAG 2.2 для клиентского конечного набора кандидатов (с детальными доказательствами, матрицей отказов и assessments).Проверки
Документация