Skip to content

Proof: seal the dual proof join of five evidence chains (V5b2d) - #522

Merged
lemone112 merged 3 commits into
mainfrom
v5b2d-dual-proof-receipt
Aug 4, 2026
Merged

Proof: seal the dual proof join of five evidence chains (V5b2d)#522
lemone112 merged 3 commits into
mainfrom
v5b2d-dual-proof-receipt

Conversation

@lemone112

@lemone112 lemone112 commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Срез V5b2d: DualProofReceiptV1 join

Структурный dual candidate доказывает только побайтное согласие двух engine transcripts; каждый source-bound receipt доказывает только provenance одного lane; каждый semantic receipt — только один transcript против независимого верификатора. Только join связывает все пять evidence chains в один sealed dual proof.

Что сделано

RED (95effe4): hostile contract из 8 тестов против заглушки — 6 падают по NotImplementedError, seal-гейты проверяются через TypeError.

GREEN (2d0d224): полный join в dual_proof.py (~240 строк):

  • join_dual_proof_v1 — единственный minter; прямой конструктор без module token поднимает TypeError; receipt immutable;
  • ровно пять входов в canonical порядке (candidate, Arb lane, MPFI lane, два semantic receipts);
  • каждое cross-chain coordinate проверяется: comparator/run-claim/transcript identities обоих lanes против claim; каждый semantic receipt связывает job, comparator, run claim, transcript своего lane и decision digest claim; lane receipts и semantic receipts попарно различны;
  • отказы: foreign_input (арность/неканонический тип), foreign_binding (несогласованные bindings или порядок MPFI→Arb);
  • identity: SHA256(labcolors.proof-region.dual-proof-receipt.v1\0 || u64be(len) || claim || arb || mpfi || sem1 || sem2);
  • full-domain gate: claim_spans_full_domain_v1 истинен только при domain_point_count == 2^24; reduced-domain proof несёт full_domain=False и никогда не авторизует family mint;
  • PROTOCOL.md обновлён: устаревший абзац «этих admitted типов текущий release не содержит» заменён грамматикой join.

Тестовый harness

Two-phase minting: discovery pass через harness._execute() учится manifest'у, выводимому controller'ом (comparator derivation детерминирован и job-независим), honest pass исполняется с _ReplayedRunBackend. Fixture job несёт 8 RESOURCE_LIMIT точек, поэтому dual_job() строит reduced-domain manifest (504 clean точки) через semantic replay scan.

Доказательства

  • RED под WSL (Ubuntu, Python 3.12.3): 8 тестов, 6 fail по заглушке — коммит 95effe4;
  • GREEN под WSL: 8/8 OK за 60.3s — коммит 2d0d224;
  • Полный v1 suite под WSL: 261 тест, 256 зелёных; 4 провала test_build.py идентичны на base-коммите (stash-проверка) — environment-зависимые пины, вне диффа этого PR;
  • compileall: dual_proof.py, semantic/, arb/, mpfi/, tests/ — OK.

Замечание про красный rerun #519

Rerun 30797490032 (c73f2f3) упал на WASM size budget: старый пин 376554B против реального артефакта 376907B. Дрейф уже закрыт в main через #514 (be009ce); актуальный CI на main — run 30893495847 (c327eb3) — зелёный. Красный статус merge commit #519 — артефакт rerun исторического коммита, не дефект кода.

Summary by CodeRabbit

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

    • Добавлена сборка единого dual proof из структурированных, source-bound и semantic-доказательств.
    • Для каждого proof автоматически формируется уникальная identity.
    • Добавлена проверка полноты домена перед выдачей full-domain proof.
  • Исправления

    • Некорректные, переставленные, повторные или несвязанные доказательства теперь отклоняются с типизированной причиной.
    • Усилена проверка соответствия идентификаторов, типов и канонического порядка доказательств.

Claude Code added 2 commits August 4, 2026 13:06
The join of the structural candidate with both source-bound receipts and both semantic receipts is the only authority that may seal a DualProofReceiptV1. RED on WSL: 6 join tests fail against the stub; both lanes seal real receipts on a reduced fully-resolved domain and the honest chain admits one structural candidate.
@coderabbitai

coderabbitai Bot commented Aug 4, 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: 12 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: bb3b9302-4497-40aa-9e00-214b1235c2b7

📥 Commits

Reviewing files that changed from the base of the PR and between 2d0d224 and 376a620.

📒 Files selected for processing (4)
  • .github/workflows/ci-worker.yml
  • proof/region/v1/PROTOCOL.md
  • proof/region/v1/dual_proof.py
  • proof/region/v1/tests/test_dual_proof.py

Walkthrough

Добавлен DualProofReceiptV1, который объединяет структурированный кандидат, два source-bound receipt и два semantic receipt. Join проверяет типы, bindings, порядок lanes и full-domain claim. Некорректные входы получают типизированные причины отказа.

Changes

Dual proof receipt

Layer / File(s) Summary
Контракт sealed receipt
proof/region/v1/PROTOCOL.md, proof/region/v1/dual_proof.py
Описаны пять evidence chains, immutable receipt, module-owned minting, typed rejection и SHA-256 identity.
Binding и full-domain проверки
proof/region/v1/dual_proof.py
Добавлены cross-chain coordinate checks, порядок Arb → MPFI, повторная проверка identity и проверка полного домена V1.
Join и hostile validation
proof/region/v1/dual_proof.py, proof/region/v1/tests/test_dual_proof.py
join_dual_proof_v1 принимает пять объектов и выпускает receipt после проверки. Тесты покрывают позитивный join, foreign inputs, foreign bindings, sealed construction и reduced-domain claims.

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

Sequence Diagram(s)

sequenceDiagram
  participant ARBController
  participant MPFIController
  participant SemanticReplay
  participant join_dual_proof_v1
  participant DualProofReceiptV1
  ARBController->>join_dual_proof_v1: передаёт Arb source-bound receipt
  MPFIController->>join_dual_proof_v1: передаёт MPFI source-bound receipt
  SemanticReplay->>join_dual_proof_v1: передаёт два SemanticVerificationReceiptV1
  join_dual_proof_v1->>join_dual_proof_v1: проверяет типы, bindings и порядок Arb → MPFI
  join_dual_proof_v1->>DualProofReceiptV1: создаёт sealed receipt и SHA-256 identity
Loading

Possibly related PRs

  • Labpics-Team/lab-colors#497: предоставляет DualComparisonCandidateV1, protocol bindings и порядок ARB → MPFI.
  • Labpics-Team/lab-colors#521: добавляет SemanticVerificationReceiptV1, который входит в состав dual proof join.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Заголовок точно описывает основное изменение: добавление и фиксацию объединения пяти цепочек доказательств в dual proof.
✨ 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 v5b2d-dual-proof-receipt

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

@lemone112

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 4, 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: 5

🤖 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 `@proof/region/v1/dual_proof.py`:
- Around line 225-234: Сделайте public path вокруг claim_spans_full_domain_v1
total: при неканоническом claim возвращайте типизированный DualProofRejectedV1
вместо TypeError, сохранив bool для валидного claim. Обновите использование
full_domain в соответствующей логике так, чтобы там применялся приватный
предикат для уже канонического claim и full_domain оставался bool.
- Around line 128-142: Close inheritance for DualProofReceiptV1 as required by
the protocol: mark the class with typing.final and add __init_subclass__ that
rejects subclass creation, while preserving the existing _SEAL_TOKEN validation
in __new__. Update imports to include final and use the same rejection behavior
established by SemanticVerificationReceiptV1.
- Line 16: Declare the repository’s minimum supported Python version as 3.11 or
newer in the appropriate project configuration, so usage of StrEnum and
datetime.UTC is supported. Ensure the target declaration is consistent with the
repository’s existing packaging or tooling configuration.

In `@proof/region/v1/tests/test_dual_proof.py`:
- Around line 410-424: Extend test_complete_dual_chain_seals_one_receipt to
assert that proof.binds returns False when given at least one foreign or
mismatched receipt, while preserving the existing valid-chain assertion and
identity checks.
- Around line 46-48: Явно загрузите модуль `test_pipeline` до вызова
`_load_harness` для `ARB_HARNESS`, чтобы присваивание `ARB_PIPELINE_HARNESS =
sys.modules["test_pipeline"]` не зависело от побочного эффекта импорта
`arb/tests/test_receipt.py` и не приводило к `KeyError`.
🪄 Autofix

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: bd40c165-fbac-47a3-90b4-c5950714a3df

📥 Commits

Reviewing files that changed from the base of the PR and between c327eb3 and 2d0d224.

📒 Files selected for processing (3)
  • proof/region/v1/PROTOCOL.md
  • proof/region/v1/dual_proof.py
  • proof/region/v1/tests/test_dual_proof.py

Comment thread proof/region/v1/dual_proof.py
Comment thread proof/region/v1/dual_proof.py
Comment thread proof/region/v1/dual_proof.py Outdated
Comment thread proof/region/v1/tests/test_dual_proof.py
Comment thread proof/region/v1/tests/test_dual_proof.py
…ed floor rejection, explicit harness load (V5b2d)
@lemone112

Copy link
Copy Markdown
Collaborator Author

Все 5 находок review закрыты в 376a620:

  1. Наследование DualProofReceiptV1 закрыто: @Final + init_subclass (паттерн SemanticVerificationReceiptV1); тест Forgery теперь проверяет отказ создания подкласса.
  2. claim_spans_full_domain_v1 стал total: неканонический claim возвращает typed DualProofRejectedV1 (foreign_input) вместо TypeError; внутри receipt используется приватный тотальный предикат; добавлен negative-тест.
  3. Минимум интерпретатора Python 3.11 задекларирован в ci-worker.yml рядом с пином PYTHON_PROOF_IMAGE (StrEnum, datetime.UTC); упаковка в репо отсутствует, пин образа — существующая tooling-конфигурация.
  4. binds покрыт negative-проверками: переставленные lanes, переставленные semantic receipts, чужой candidate.
  5. test_pipeline загружается явно через _load_harness до arb-харнесса; зависимость от побочного импорта убрана.

Доказательство: 8/8 OK в 60.6s под WSL (Ubuntu, Python 3.12.3), compileall чист.

@lemone112

Copy link
Copy Markdown
Collaborator Author

@coderabbitai resolve

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
✅ Action performed

Comments resolved and changes approved.

@lemone112
lemone112 merged commit 8a05b4a into main Aug 4, 2026
10 checks passed
@lemone112
lemone112 deleted the v5b2d-dual-proof-receipt branch August 4, 2026 11:52
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