Skip to content

feat: close WCAG22 feasibility transports - #317

Merged
lemone112 merged 11 commits into
mainfrom
agent/issue-295-transport-conformance
Jul 14, 2026
Merged

feat: close WCAG22 feasibility transports#317
lemone112 merged 11 commits into
mainfrom
agent/issue-295-transport-conformance

Conversation

@lemone112

@lemone112 lemone112 commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Outcome

Closes #295 after exact-head review, merge, and the #228 handoff.

Completes Slice B as one vertical public capability:

  • one internal labcolors-protocol owns strict bounded bytes → Core → canonical wire projection and the sole wcag22-feasibility feature edge;
  • WASM/npm and UniFFI/Swift remain mechanical byte shells over the same Success(Feasibility) | Failure(Error) algebra;
  • conformance pack 5.0.0 adds exactly one feasibility family while all six prior family files remain byte-identical;
  • public consumers receive the Core-owned ordered domain once plus candidate-major LSB0 matrix/partition, never a 256 × E DTO graph;
  • exact-limit and limit+1 preflight, opaque client IDs, NotApplicable, conflict/resource failures, and all current Core error branches are typed and mutation-gated;
  • npm rejects every non-Uint8Array JavaScript value before consulting WASM, while genuine cross-realm byte arrays remain valid;
  • Swift validates every one of the 256 ordered neutral candidates before relating array position to packed matrix rows;
  • whole-call WASM and Swift/UniFFI evidence records request/output/copy/provenance facts without inventing latency or memory thresholds.

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

  • the immutable BUG/A11Y: ввести доказуемый versioned WCAG 2.2 sRGB8 evaluator #284 V1 baseline and build recipe remain byte-identical;
  • the append-only ARCH/CONTRAST: оценить WCAG22 relations на конечной sRGB8 neutral axis #295 V2 canonical Linux measurement is exactly 521240 B, SHA-256 d37841bfb2615d05c8366b08dcc7e5aed1bbd3cf27c3db67896108c5ec9c9ca0, with zero discretionary headroom;
  • the post-review whole-call artifact covers 10 boundary shapes × 5 fresh processes and is committed byte-exact as SHA-256 ba34b5717e752a5f4ef8a388ef6b69613e799539bb887f26eedc5647542667e1;
  • CI independently fingerprints the built WASM, verifies the committed whole-call artifact, and rejects record mode;
  • the immutable Slice-A checker replays in its exact clean 6001cf41 snapshot; a separate fail-closed applicability verifier binds the current full Core source tree and sourced dependency records;
  • wall time, RSS, WASM pages, gzip size, and noncanonical-platform measurements remain observations, never invented product thresholds.

Validation

  • workspace Rust tests, MSRV, clippy -D warnings, rustfmt, rustdoc, audit, feature-graph and anti-vacuum gates pass on the implementation head;
  • npm package suite: 126 tests with the exact canonical Linux WASM; TypeScript typecheck passes;
  • protocol/conformance/FFI/Swift differential, property, mutation, boundary and compile-fail suites pass;
  • strict benchmark applicability/self-test, canonical artifact schema/mutation tests, docs drift and git diff --check pass;
  • final exact-head CI 29312468216 and Native 29312468211 are green on 0a9ebcfe09f9bb3b32c6532051fcc6b84cc841fd; 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

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

    • Добавлена оценка выполнимости WCAG 2.2 (feasibility) для конечного домена sRGB8 с типизированным результатом и доказательством/ошибками.
    • API доступно в npm/wasm и через Rust FFI/Swift, включая проверку лимита размера входного конверта.
    • Conformance pack обновлён до 5.0.0 и дополнен семейством wcag22-feasibility.
  • Улучшения

    • Усилены проверки каноничности, воспроизводимости и целостности outcome по всей цепочке поставки.
    • Обновлены конформанс-наблюдения и отчётность по Swift и WASM evidence, включая контроль бюджета размера.
  • Документация

    • Обновлены README, CHANGELOG и материалы миграции/верификации для pack 5.0.0 и feasibility V1.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

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.

Changes

WCAG 2.2 feasibility transport

Layer / File(s) Summary
Protocol и Core projection
crates/labcolors-protocol/*
Добавлены V1 request/outcome-типы, typed errors, byte limits, canonical encoding, декодирование и проекция Core-результатов.
Conformance pack 5
crates/labcolors-conformance/*, conformance/vectors/*
Pack повышен до 5.0.0 и дополнен семейством wcag22-feasibility из 13 canonical vectors с byte-exact воспроизведением.
FFI, WASM и npm boundaries
crates/labcolors-ffi/*, crates/labcolors-wasm/*, packages/colors/index.*
Добавлены raw/typed API, size preflight, TypeScript-контракты и parity-проверки.
Swift boundary и observations
bindings/swift/*
Добавлены Codable-модели, строгая валидация, typed outcomes, conformance tests и whole-call evidence.
Release validation и WASM evidence
scripts/*, packages/colors/bench/*, packages/colors/test/*
Добавлены family/release validators, immutable benchmark checks, WASM boundary artifact и budget V2.
CI и документация
.github/workflows/*, README.md, CHANGELOG.md, docs/*, conformance/README.md
Уточнены capability boundaries, historical applicability, transport contract, migration notes и verification map.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 53.73% 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
Linked Issues check ✅ Passed Изменения покрывают требования #295: bounded protocol, canonical evidence, terminal states, proofs, лимиты, тесты и ownership транспорта.
Out of Scope Changes check ✅ Passed Существенных изменений вне целей #295 не видно: все правки поддерживают протокол, конформанс, тесты, CI и документацию.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Заголовок кратко и точно отражает основное изменение: закрытие транспортного контура WCAG22 feasibility.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/issue-295-transport-conformance

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

@lemone112
lemone112 marked this pull request as ready for review July 14, 2026 03:37
@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: 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

📥 Commits

Reviewing files that changed from the base of the PR and between 6001cf4 and 92b2dba.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (44)
  • .github/workflows/ci.yml
  • .github/workflows/native-conformance.yml
  • CHANGELOG.md
  • README.md
  • bindings/swift/.gitignore
  • bindings/swift/Package.swift
  • bindings/swift/README.md
  • bindings/swift/Sources/LabColors/.gitkeep
  • bindings/swift/Sources/LabColors/Wcag22FeasibilityProtocol.swift
  • bindings/swift/Tests/LabColorsConformanceTests/ConformanceTests.swift
  • bindings/swift/ci/check-observation.sh
  • bindings/swift/ci/run-conformance.sh
  • conformance/README.md
  • conformance/vectors/manifest.json
  • conformance/vectors/wcag22-feasibility.json
  • crates/labcolors-conformance/Cargo.toml
  • crates/labcolors-conformance/src/bin/gen.rs
  • crates/labcolors-conformance/src/lib.rs
  • crates/labcolors-conformance/tests/pack_v5_contract.rs
  • crates/labcolors-conformance/tests/reference_runner.rs
  • crates/labcolors-ffi/Cargo.toml
  • crates/labcolors-ffi/src/lib.rs
  • crates/labcolors-protocol/Cargo.toml
  • crates/labcolors-protocol/src/lib.rs
  • crates/labcolors-protocol/tests/protocol.rs
  • crates/labcolors-wasm/Cargo.toml
  • crates/labcolors-wasm/src/lib.rs
  • crates/labcolors-wasm/tests/wasm_parity.rs
  • docs/NAMING.md
  • docs/migrations/exact-alpha-glow.md
  • docs/verification-map.md
  • packages/colors/README.md
  • packages/colors/bench/wasm-size-budget-v2.json
  • packages/colors/bench/wcag22-feasibility-boundary.bench.mjs
  • packages/colors/bench/wcag22-feasibility-wasm-boundary-v1.json
  • packages/colors/index.d.ts
  • packages/colors/index.js
  • packages/colors/test/release-contract.test.mjs
  • packages/colors/test/wcag22-feasibility-boundary.test.mjs
  • packages/colors/test/wcag22-feasibility.test.mjs
  • scripts/check-wasm-size-budget.mjs
  • scripts/check_wcag22_feasibility_applicability.py
  • scripts/prepare-npm-package.mjs
  • scripts/verify-package-release.mjs

Comment thread .github/workflows/ci.yml Outdated
Comment thread bindings/swift/ci/check-observation.sh Outdated
Comment thread bindings/swift/README.md
Comment thread bindings/swift/Sources/LabColors/Wcag22FeasibilityProtocol.swift
Comment thread conformance/README.md Outdated
Comment thread packages/colors/test/wcag22-feasibility.test.mjs
Comment thread scripts/check_wcag22_feasibility_applicability.py Outdated
Comment thread scripts/verify-package-release.mjs
@lemone112

Copy link
Copy Markdown
Collaborator Author

Disposition of the outside-diff JSON finding: verified again on head 375ec90. packages/colors/bench/wcag22-feasibility-wasm-boundary-v1.json is exactly one LF-terminated line, jq -e 'type == "object"' passes, its SHA-256 is ccd5e71d42c0e756078091ca24080fa72a7144c6bb263563b054aff302f377bc, and the final bytes are the object terminators followed by 0a. There is no second token or trailing JSON data, so changing the immutable artifact would be incorrect.

@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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 92b2dba and 375ec90.

📒 Files selected for processing (16)
  • .github/workflows/ci.yml
  • bindings/swift/README.md
  • bindings/swift/Sources/LabColors/Wcag22FeasibilityProtocol.swift
  • bindings/swift/Tests/LabColorsConformanceTests/ConformanceTests.swift
  • bindings/swift/ci/check-observation.sh
  • conformance/README.md
  • packages/colors/README.md
  • packages/colors/adapt-theme.d.ts
  • packages/colors/apply-theme.d.ts
  • packages/colors/index.d.ts
  • packages/colors/test/release-contract.test.mjs
  • packages/colors/test/wcag22-feasibility.test.mjs
  • packages/colors/tsconfig.json
  • packages/colors/watch-theme.d.ts
  • scripts/check_wcag22_feasibility_applicability.py
  • scripts/verify-package-release.mjs

Comment thread packages/colors/README.md Outdated
@lemone112

Copy link
Copy Markdown
Collaborator Author

Addressed the outside-diff feasibility-corpus provenance finding in bdcb864. conformance/README.md now defines 7/2/0 and 92/59 as exact cardinalities over the complete 256-point neutral axis, names every accepted byte range, identifies the exact-rational oracle and content-bound fixture, and states that any adjacent byte or normative-ratio change recomputes the set. The oracle independently reproduces all five counts and passes 16 self-tests; release-contract tests prevent the documentation from collapsing back to unexplained constants.

Fresh independent review: CLEAN.

@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

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 packageManifest binding. The committed evidence now binds SHA-256 a3fa15d4ee232abb8ff392a47bd1b2768198255106e9435da2ab2ef0777c9fdf; parsed old/new artifacts are identical after removing that single field. Schema/mutation/CI-contract tests pass, and exact-head Linux --verify must re-run every scenario and match the exact WASM plus deterministic projection before merge. Independent review: CLEAN.

@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
lemone112 merged commit 94efeee into main Jul 14, 2026
11 checks passed
@lemone112
lemone112 deleted the agent/issue-295-transport-conformance branch July 14, 2026 06:53
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.

ARCH/CONTRAST: оценить WCAG22 relations на конечной sRGB8 neutral axis

1 participant