Skip to content

feat(core): compile explicit WCAG feasibility domains (#296-A) - #318

Merged
lemone112 merged 15 commits into
mainfrom
agent/issue-296a-explicit-domain
Jul 14, 2026
Merged

feat(core): compile explicit WCAG feasibility domains (#296-A)#318
lemone112 merged 15 commits into
mainfrom
agent/issue-296a-explicit-domain

Conversation

@lemone112

@lemone112 lemone112 commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Что изменено

  • добавлен Core-only вход wcag22_feasibility::explicit::evaluate для конечного клиентского набора opaque candidate ID + immutable Srgb8;
  • прежняя нейтральная ось и явный набор сведены к одному приватному kernel полной компиляции;
  • Core выводит и preflight-ит W=C×E, непрерывную LSB0-матрицу и partition без построчного padding;
  • введены запечатанное доказательство, точная byte-identity grammar и независимый Python-оракул;
  • сохранены байты и публичное поведение neutral V1; Protocol/WASM/FFI намеренно не расширены в этом slice;
  • V2 benchmark evidence повторно допускает общий variable-domain kernel, V1 остаётся исторически неизменным;
  • новый модуль включён в штатный mutation-scope, а verification/docs описывают фактическую границу релиза.

Зачем

#296-A убирает специальный случай «только 256 нейтралей» на уровне математического ядра. Клиент по-прежнему владеет именами и семантикой, Core — полной проверкой всех объявленных физических кандидатов против текущего контекста. Выбор/ранжирование кандидата в этот PR не входит.

Корневая причина

Прежний finite-domain компилятор был корректен, но мощность и представление кандидата были зашиты в зарегистрированную нейтральную ось. Это не позволяло доказуемо компилировать произвольный конечный клиентский домен без дублирования Core-математики.

Проверки

  • cargo test --workspace --locked --quiet
  • cargo clippy -p labcolors-core --all-targets --all-features --locked -- -D warnings
  • cargo fmt --all --check
  • npm test && npm run typecheck в packages/colors
  • node --test scripts/docs-drift.test.mjs
  • python3 scripts/verify_wcag22_explicit_feasibility_identity.py --self-test
  • 12 public explicit-domain tests, 26 private kernel tests, full neutral↔explicit differential, deterministic property tests, compile-fail sealing, allocation/tail-bit/max-profile negative controls.

Implements slice A of #296. Родительский Issue остаётся открыт для selection и transport slices.

Summary by CodeRabbit

  • Новые возможности

    • Добавлена опция wcag22-explicit-feasibility: оценка выполнимости WCAG 2.2 для клиентского конечного набора кандидатов (с детальными доказательствами, матрицей отказов и assessments).
  • Проверки

    • Расширены контрактные фикстуры и усилены байтовые identity-проверки (v2) для feasibility и admission.
    • Обновлены проверки CI по boundary/применимости и пересобраны ожидания evidence.
    • Переключён контроль размера WASM на budget v3.
  • Документация

    • Обновлены README и добавлен пример для explicit feasibility.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 44 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 628152e3-bae5-40c9-866d-8e4967829243

📥 Commits

Reviewing files that changed from the base of the PR and between 783fd16 and f5d6d9e.

📒 Files selected for processing (5)
  • .github/workflows/ci.yml
  • crates/labcolors-core/contracts/wcag22-feasibility-benchmark-v2.json
  • crates/labcolors-core/src/wcag22_feasibility.rs
  • docs/verification-map.md
  • packages/colors/test/release-contract.test.mjs

Walkthrough

Добавлена поддержка WCAG 2.2 feasibility для явно объявленных конечных sRGB8-доменов. Kernel, proof-структуры и assessments параметризованы размером домена, добавлены explicit API, identity-контракт, тесты, capability-проверки и обновлены benchmark и WASM evidence-артефакты.

Changes

Explicit WCAG 2.2 feasibility

Layer / File(s) Summary
Параметризованный kernel и packed proof
crates/labcolors-core/src/wcag22_feasibility.rs, crates/labcolors-core/src/wcag22_feasibility_tests.rs
Перебор, layout, storage, проверка packed-результатов и assessments переведены на конечный домен с переменным числом кандидатов.
Explicit API и терминальные результаты
crates/labcolors-core/src/wcag22_feasibility/explicit.rs, crates/labcolors-core/Cargo.toml
Добавлены типы explicit-доменов, candidate IDs, proof views, assessments и результаты Feasible, Infeasible, NotEvaluated.
Identity-контракт и тестирование
crates/labcolors-core/contracts/*, scripts/verify_wcag22_explicit_feasibility_identity.py, crates/labcolors-core/tests/*
Добавлены канонические digest-функции, JSON-фикстура, mutation self-tests, property-based проверки, проверки лимитов и downstream API.
Benchmark V2, CI и release evidence
.github/workflows/ci.yml, scripts/check_wcag22_feasibility_*.py, packages/colors/bench/*, packages/colors/test/*, scripts/check-wasm-size-budget.mjs
Benchmark и applicability проверки переведены на V2, capability projection и исторические worktree-проверки обновлены, а WASM budget и boundary evidence переведены на текущие артефакты.
Документация и конфигурация
README.md, docs/*, CHANGELOG.md, .cargo/mutants.toml, crates/labcolors-wasm/Cargo.toml
Документация описывает explicit API и модель стоимости; добавлены release-описания, mutation coverage и уточнена transport boundary.

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
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 57.78% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Заголовок точно отражает основное изменение: добавление Core-only явного WCAG feasibility для клиентских конечных доменов.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/issue-296a-explicit-domain

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 94efeee and 055a740.

📒 Files selected for processing (17)
  • .cargo/mutants.toml
  • .github/workflows/ci.yml
  • crates/labcolors-core/Cargo.toml
  • crates/labcolors-core/README.md
  • crates/labcolors-core/benches/wcag22_feasibility_admission.rs
  • crates/labcolors-core/contracts/wcag22-explicit-feasibility-identity-v1.json
  • crates/labcolors-core/contracts/wcag22-feasibility-benchmark-v2.json
  • crates/labcolors-core/src/wcag22_feasibility.rs
  • crates/labcolors-core/src/wcag22_feasibility/explicit.rs
  • crates/labcolors-core/src/wcag22_feasibility_tests.rs
  • crates/labcolors-core/tests/wcag22_explicit_feasibility.rs
  • docs/NAMING.md
  • docs/verification-map.md
  • packages/colors/test/release-contract.test.mjs
  • scripts/check_wcag22_feasibility_applicability.py
  • scripts/check_wcag22_feasibility_benchmark.py
  • scripts/verify_wcag22_explicit_feasibility_identity.py

Comment thread crates/labcolors-core/README.md
Comment thread crates/labcolors-core/src/wcag22_feasibility/explicit.rs
Comment thread scripts/verify_wcag22_explicit_feasibility_identity.py

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between ca38660 and 4ab2120.

📒 Files selected for processing (17)
  • .github/workflows/ci.yml
  • CHANGELOG.md
  • crates/labcolors-core/Cargo.toml
  • crates/labcolors-core/README.md
  • crates/labcolors-core/contracts/wcag22-feasibility-benchmark-v2.json
  • crates/labcolors-core/src/wcag22_feasibility.rs
  • crates/labcolors-core/src/wcag22_feasibility/explicit.rs
  • crates/labcolors-core/src/wcag22_feasibility_tests.rs
  • crates/labcolors-core/tests/wcag22_explicit_feasibility.rs
  • crates/labcolors-wasm/Cargo.toml
  • docs/verification-map.md
  • packages/colors/README.md
  • packages/colors/bench/wasm-size-budget-v3.json
  • packages/colors/bench/wcag22-feasibility-wasm-boundary-v1.json
  • packages/colors/test/release-contract.test.mjs
  • packages/colors/test/wcag22-feasibility-boundary.test.mjs
  • scripts/check-wasm-size-budget.mjs

Comment thread crates/labcolors-core/src/wcag22_feasibility.rs
@lemone112

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@lemone112

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4ab2120 and 783fd16.

📒 Files selected for processing (10)
  • .github/workflows/ci.yml
  • CHANGELOG.md
  • crates/labcolors-core/contracts/wcag22-feasibility-benchmark-v2.json
  • crates/labcolors-core/src/wcag22_feasibility.rs
  • docs/verification-map.md
  • packages/colors/README.md
  • packages/colors/bench/wasm-size-budget-v3.json
  • packages/colors/bench/wcag22-feasibility-wasm-boundary-v1.json
  • packages/colors/test/release-contract.test.mjs
  • scripts/check-wasm-size-budget.mjs

Comment thread crates/labcolors-core/src/wcag22_feasibility.rs Outdated
@lemone112
lemone112 merged commit 4afe61b into main Jul 14, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant