Skip to content

feat(adapters): platform/release closure for the atomic operation (#296-C3) - #325

Merged
lemone112 merged 8 commits into
mainfrom
agent/issue-296c3-platform-closure
Jul 15, 2026
Merged

feat(adapters): platform/release closure for the atomic operation (#296-C3)#325
lemone112 merged 8 commits into
mainfrom
agent/issue-296c3-platform-closure

Conversation

@lemone112

@lemone112 lemone112 commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Scope

#296-C3: проекция замороженных байтов атомарной операции wcag22-explicit-selection-v1 параллельно через compiler-WASM/npm и UniFFI/Swift; один pack/release manifest; clean-consumer smoke обеих операций. Завершает #296.

Adapters

  • compiler-WASM/npm: evaluateWcag22ExplicitSelection + wcag22ExplicitSelectionMaxBytes в @labpics/colors/compiler с тем же hostile-preflight (тип/oversize/detached до избегаемой ABI-копии); полная TS-поверхность операции; повекторный реплей всех 15 закоммиченных векторов через реальный собранный WASM; wasm32-паритет compiler-крейта (family + envelope ceiling).
  • UniFFI/Swift: механическое байтовое трио в labcolors-ffi; типизированная decode-only Codable-проекция (818 строк, sealed-законы зеркалят feasibility: структурная валидация партиции/матрицы/счётчиков/receipt-привязок); ConformanceTests: 15/15 байт-точный реплей, limit+1 bridge-spy, 6 структурных мутаций, 23-веточный error-algebra roundtrip.
  • Оба адаптера — механические шеллы одной protocol-границы: не сортируют, не хешируют, не выбирают.

Топология и release

  • CI-гейт фич перевёрнут: каждый protocol-потребитель (compiler, ffi, conformance) ОБЯЗАН резолвить wcag22-explicit-selection; runtime-роль остаётся protocol-free (byte-identical WASM).
  • Clean-consumer smoke упакованного тарболла прогоняет обе операции во всех четырёх точках (clean-install, role-isolation, Node-floor).
  • Evidence: size-budget V6 (компилерная роль растёт — capability добавлена; канонические Linux-размеры из CI) и whole-call V5 будут закоммичены в этот PR до merge (той же throwaway-процедурой, CI verify-only).

Closes #296 (после зелёного exact-head и merge).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Новые возможности
    • Добавлена атомарная операция WCAG 2.2 explicit-selection для выбора кандидата в заданном порядке (JavaScript/WASM и Swift/FFI).
    • Появились публичные ...MaxBytes() и evaluate..., включая корректный отказ при oversize.
    • Результаты и ошибки строго типизированы, с каноническим JSON-представлением и валидацией.
  • Документация
    • Обновлены changelog, карта верификации и описание семейства wcag22-explicit-selection (векторы).
  • Тесты
    • Добавлены байт-точные conformance, wasm-паритет и smoke-валидации для explicit-selection.
  • Bug Fixes
    • Пересмотрены CI-проверки и семантика требований capability-граней для compiler/границ evidence.

lemone112 and others added 2 commits July 15, 2026 20:53
… FFI (#296-C3, part 1)

Compiler-крейт и labcolors-ffi включают protocol-фичу wcag22-explicit-selection
и экспортируют зеркальное трио (evaluate/max-bytes/envelope-too-large) с теми
же законами, что у feasibility. npm: evaluateWcag22ExplicitSelection с hostile-
preflight, полная TS-поверхность, повекторный реплей 15 закоммиченных векторов
через реальный собранный WASM, wasm32-паритет compiler-крейта. CI-гейт
топологии перевёрнут: каждый protocol-потребитель обязан резолвить операцию;
runtime остаётся protocol-free. Clean-consumer smoke прогоняет обе операции во
всех четырёх точках. Документация приведена к C3-реальности.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
swift-foundation JSONEncoder не сохраняет порядок вставки ключей (Darwin и
Linux одинаково); байт-точность serde-порядка пинуется сырым FFI-реплеем в
тесте (a), а Codable-паритет сверяется нормализацией обеих сторон одним
sortedKeys-сериализатором + обратным decode.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lemone112

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 15, 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: 55 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: 7f86aef3-acd5-4b95-b242-9bd872a150a3

📥 Commits

Reviewing files that changed from the base of the PR and between 01239c4 and eeca5d9.

📒 Files selected for processing (1)
  • scripts/verify-package-release.mjs

Walkthrough

Добавлена атомарная операция wcag22-explicit-selection-v1 для compiler-WASM/npm и UniFFI/Swift. Реализованы типизированные протоколы, строгая валидация, byte-exact conformance, release smoke-проверки, capability wiring и обновлённые WASM evidence-бюджеты.

Changes

Публикация explicit-selection V1

Layer / File(s) Summary
Swift-протокол и типизированная валидация
bindings/swift/Sources/LabColors/*, bindings/swift/Package.swift, bindings/swift/.gitignore
Добавлены модели результатов и ошибок, Codable-кодирование, структурная валидация, size preflight и публичный API explicit-selection.
Conformance и каноническая сериализация
bindings/swift/Tests/*, crates/labcolors-compiler/tests/*, packages/colors/test/*
Добавлены byte-exact replay, canonical decode→re-encode, oversize, structural mutation и error round-trip проверки для 15 векторов.
WASM/npm и UniFFI/FFI адаптеры
crates/labcolors-compiler/*, crates/labcolors-ffi/*, packages/colors/compiler.*
Операция экспортирована через WASM/npm и UniFFI/FFI с каноническими outcome-конвертациями, oversize helpers и TypeScript-типами.
Capability wiring и release-проверки
.github/workflows/ci.yml, packages/colors/test/release-contract.test.mjs, scripts/verify-package-release.mjs
Обновлены feature-resolution проверки, release-контракты и smoke-потоки для explicit-selection.
Документация и WASM evidence
CHANGELOG.md, conformance/README.md, docs/verification-map.md, packages/colors/README.md, packages/colors/bench/*, scripts/check-wasm-size-budget.mjs
Зафиксированы опубликованные адаптеры и replay; evidence обновлён до v5, а size budget — до v6.1?

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Заголовок кратко и по делу отражает публикацию atomic-операции и релизно-платформенное закрытие PR.
Linked Issues check ✅ Passed Изменения соответствуют #296: добавлены atomic explicit-selection, публикация через compiler/Swift, проверки, манифесты и smoke-тесты.
Out of Scope Changes check ✅ Passed В PR не видно заметных изменений вне заявленной публикации адаптеров, CI, документации и тестов для #296-C3.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/issue-296c3-platform-closure

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

@coderabbitai

coderabbitai Bot commented Jul 15, 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.

…-record

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@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 (2)
.github/workflows/ci.yml (1)

351-364: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

wasm32-специфичная проверка не покрывает protocol-фичу explicit-selection.

Для compiler_tree (target wasm32-unknown-unknown) проверяется только labcolors-core feature "wcag22-explicit-feasibility", но не labcolors-protocol feature "wcag22-explicit-selection" — хотя именно wasm32-таргет собирается в публикуемый npm-адаптер. Это симметрично со старой проверкой feasibility (строки 361-362), так что не регрессия, но раз PR фокусируется на публикации через WASM, стоит закрыть и этот путь явной проверкой protocol-фичи, чтобы поймать дрейф feature unification специфично для wasm32.

♻️ Предложение усилить проверку
           if 'labcolors-core feature "wcag22-explicit-feasibility"' not in compiler_tree:
               raise SystemExit("compiler role lacks the published explicit capability")
+          if 'labcolors-protocol feature "wcag22-explicit-selection"' not in compiler_tree:
+              raise SystemExit("compiler role lacks the published explicit-selection protocol feature (wasm32)")
🤖 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 @.github/workflows/ci.yml around lines 351 - 364, Extend the wasm32
compiler_tree validation around the existing wcag22 feature checks to require
labcolors-protocol feature "wcag22-explicit-selection" as well. Preserve the
current labcolors-wasm rejection and feasibility checks, and fail with a clear
message when the protocol feature is absent.
conformance/README.md (1)

14-22: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Раздел «Версионирование» противоречит обновлённой строке таблицы (55) в этом же файле.

Здесь (строки 19-22) утверждается: «семейство воспроизводится только внутри conformance-крейта — ни один публикуемый adapter (compiler WASM, UniFFI/Swift) его не читает, их поверхность остаётся feasibility-only». Это прямо противоречит обновлённой строке таблицы (55): «воспроизводится нативно и обоими адаптерами», и противоречит CHANGELOG.md, где явно зафиксировано, что после #296-C3 «семейство воспроизводят нативный reference runner и оба публикуемых адаптера... побайтно». Раздел «Версионирование» нужно синхронизировать с фактическим состоянием после #296-C3, иначе документ содержит взаимоисключающие утверждения об одном и том же факте.

📝 Предлагаемая правка
   семейство `wcag22-explicit-selection`: канонические request/outcome JSON
   атомарной операции `wcag22-explicit-selection-v1`. Байты семи прежних
-  семейств сохранены; семейство воспроизводится только внутри
-  conformance-крейта — ни один публикуемый adapter (compiler WASM,
-  UniFFI/Swift) его не читает, их поверхность остаётся feasibility-only.
+  семейств сохранены; после `#296-C3` семейство воспроизводится нативным
+  reference runner и обоими публикуемыми адаптерами (compiler WASM/npm,
+  UniFFI/Swift) побайтно.
🤖 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 14 - 22, Синхронизируй раздел
«Версионирование» с фактическим состоянием после `#296-C3`: обнови утверждение о
семействе wcag22-explicit-selection-v1, указав, что его побайтно воспроизводят
нативный reference runner и оба публикуемых адаптера, включая compiler WASM и
UniFFI/Swift. Удали устаревшее утверждение о conformance-only воспроизведении и
feasibility-only поверхности адаптеров, сохранив остальные сведения о версии и
прежних семействах.
🤖 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 `@scripts/verify-package-release.mjs`:
- Around line 1259-1273: Выровняйте wcag22ExplicitSelectionSmokeFixture с
wcag22FeasibilitySmokeFixture: перед поиском canonical case вызовите
validateWcag22FeasibilityFamily или соответствующий валидатор explicit-selection
family. Сохраните текущий выбор caseId и ошибку при его отсутствии, чтобы
функция возвращала данные только после проверки целостности и схемы семейства.

---

Outside diff comments:
In @.github/workflows/ci.yml:
- Around line 351-364: Extend the wasm32 compiler_tree validation around the
existing wcag22 feature checks to require labcolors-protocol feature
"wcag22-explicit-selection" as well. Preserve the current labcolors-wasm
rejection and feasibility checks, and fail with a clear message when the
protocol feature is absent.

In `@conformance/README.md`:
- Around line 14-22: Синхронизируй раздел «Версионирование» с фактическим
состоянием после `#296-C3`: обнови утверждение о семействе
wcag22-explicit-selection-v1, указав, что его побайтно воспроизводят нативный
reference runner и оба публикуемых адаптера, включая compiler WASM и
UniFFI/Swift. Удали устаревшее утверждение о conformance-only воспроизведении и
feasibility-only поверхности адаптеров, сохранив остальные сведения о версии и
прежних семействах.
🪄 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: 37164871-c53a-435d-88dd-c6508798be56

📥 Commits

Reviewing files that changed from the base of the PR and between 713a5cb and 423a451.

📒 Files selected for processing (22)
  • .github/workflows/ci.yml
  • CHANGELOG.md
  • bindings/swift/.gitignore
  • bindings/swift/Package.swift
  • bindings/swift/Sources/LabColors/Wcag22ExplicitSelectionProtocol.swift
  • bindings/swift/Sources/LabColors/Wcag22FeasibilityProtocol.swift
  • bindings/swift/Tests/LabColorsConformanceTests/ConformanceTests.swift
  • conformance/README.md
  • crates/labcolors-compiler/Cargo.toml
  • crates/labcolors-compiler/src/lib.rs
  • crates/labcolors-compiler/tests/wasm_parity.rs
  • crates/labcolors-ffi/Cargo.toml
  • crates/labcolors-ffi/src/lib.rs
  • docs/verification-map.md
  • packages/colors/README.md
  • packages/colors/compiler.d.ts
  • packages/colors/compiler.js
  • packages/colors/test/compiler-boundary.test.mjs
  • packages/colors/test/release-contract.test.mjs
  • packages/colors/test/wcag22-explicit-selection.test.mjs
  • packages/colors/test/wcag22-feasibility.test.mjs
  • scripts/verify-package-release.mjs

Comment thread scripts/verify-package-release.mjs

@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 `@packages/colors/bench/wcag22-feasibility-boundary.bench.mjs`:
- Around line 43-47: Resolve the missing V5 golden artifact in the benchmark
flow: either add the expected wcag22-feasibility-wasm-boundary-v5.json artifact
and update the related boundary test to consistently use V5, or revert
defaultMeasurementPath and MEASUREMENT_ARTIFACT_ID to the existing V4 artifact
references so --verify no longer targets a missing file.
🪄 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: 658f6c15-1942-48f2-b2e2-3357a4b24fa9

📥 Commits

Reviewing files that changed from the base of the PR and between 423a451 and 4888a5e.

📒 Files selected for processing (1)
  • packages/colors/bench/wcag22-feasibility-boundary.bench.mjs

Comment thread packages/colors/bench/wcag22-feasibility-boundary.bench.mjs
lemone112 and others added 3 commits July 15, 2026 23:53
…aw, budget V6

Hostile-ревью: (1) TS-контракт source:feasibility недотипизирован — закоммиченный
вектор error-feasibility-priority-over-policy был непредставим; добавлен
Wcag22ExplicitFeasibilityCoreErrorV1 с explicit invalid-кодами, представимость
пинуется в type-smoke упакованного потребителя. (2) Swift-валидатор не проверял
канонический порядок relations/adjacent (candidates проверялись) — добавлен
validateCanonicalRelations в оба терминальных пути. Архитектурное ревью: D2
(type-smoke без новых типов) закрыт, D3/D4 стейл-формулировки сняты.

Size-бюджет V6: runtime-измерение байт-идентично C1 (454385/8cd65f00), compiler
C3 = 229658/34e2a561 (canonical Linux, learn-прогон 29447057635), zero headroom,
цепочка V1..V5 immutable. TS-правка не меняет байты WASM (проверено локальной
пересборкой: sha идентичен).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ability

Волна V6 была случайно снята cleanup-ом ревью-агента до попадания в 4dcf558
(сообщение того коммита ошибочно заявляло V6). Повторная выкладка с дважды
подтверждёнными каноническими значениями (learn-прогоны 29447057635 и
29450518198, байт-в-байт): runtime 454385/8cd65f00 (= C1), compiler
229658/34e2a561 (C3-capability), цепочка V1..V5 immutable, файл V6
детерминированно регенерирован (sha 761af605 подтверждён).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
V5 (97cb5478db09) записан на каноническом linux-x64 throwaway-веткой и
закоммичен verify-only: биндит admission V5, pack 129158d2, бюджет V6 и новый
exact compiler-WASM 229658/34e2a561 (published capability). Проекция V5 == V4;
история V1–V4 нетронута. ci.yml/npm-пины → V5, имена шагов → #296-C3.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…xture

CodeRabbit: паритет с feasibility-фикстурой — форма каждого вектора, уникальные
caseId, парсинг вложенного JSON и selected-инвариант канонического кейса.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lemone112

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 15, 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 `@scripts/verify-package-release.mjs`:
- Around line 1271-1289: Validate that each vector in the family is a non-null
object before calling Object.keys or accessing caseId, and route invalid values
including null through the existing fail(...) schema-drift handling. Add a
negative test containing null in the family to verify strict decoding remains
controlled.
🪄 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: 80dd1ac7-9228-4e7b-bcb5-0ffba5c42477

📥 Commits

Reviewing files that changed from the base of the PR and between 4dcf558 and 01239c4.

📒 Files selected for processing (8)
  • .github/workflows/ci.yml
  • packages/colors/bench/wasm-size-budget-v6.json
  • packages/colors/bench/wcag22-feasibility-boundary.bench.mjs
  • packages/colors/bench/wcag22-feasibility-wasm-boundary-v5.json
  • packages/colors/test/release-contract.test.mjs
  • packages/colors/test/wcag22-feasibility-boundary.test.mjs
  • scripts/check-wasm-size-budget.mjs
  • scripts/verify-package-release.mjs

Comment thread scripts/verify-package-release.mjs
…xture

CodeRabbit: Object.keys(null) кидал бы необработанный TypeError вместо
контролируемого fail() на strict-пути верификатора.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lemone112
lemone112 merged commit 9819bbd into main Jul 15, 2026
11 checks passed
@lemone112
lemone112 deleted the agent/issue-296c3-platform-closure branch July 15, 2026 21:48
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/SELECTION: explicit finite sRGB8 feasibility + client-owned selection

1 participant