Skip to content

Proof: замкнуть Arb source → BUILD → RUN единым receipt - #500

Closed
lemone112 wants to merge 4 commits into
agent/v5b2c1-arb-source-buildfrom
agent/v5b2c2-arb-receipt
Closed

Proof: замкнуть Arb source → BUILD → RUN единым receipt#500
lemone112 wants to merge 4 commits into
agent/v5b2c1-arb-source-buildfrom
agent/v5b2c2-arb-receipt

Conversation

@lemone112

@lemone112 lemone112 commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Что изменено

  • единый SourceBoundArbControllerV1 связывает допущенные исходники, канонический USTAR bundle, две побайтово равные сборки, точный RUN, content-resolved replay и provenance claim;
  • старые раздельные snapshot/RUN authority удалены;
  • receipt невозможно выпустить при несовпадении source/build/job/process/limits/output;
  • archive coordinates теперь повторно выводятся из принадлежащих capability archive_bytes, а duplicate/case-colliding manifest отвергается;
  • controller authority проверена настоящим fork: child отклоняется, не расходуя parent authority;
  • workflow разделяет быстрый контракт и phase-specific native receipt/executor gates;
  • публичный reference описывает уже отгруженный receipt и честно отделяет отсутствующий MPFI semantic proof.

Почему

Раздельные snapshot и pipeline RUN могли доказывать совместимые фрагменты, но не одну причинную цепь. Корень проблемы — независимые authority-точки и возможность сравнить retained source coordinates с ними же. Этот срез заменяет их одним линейным контроллером и повторным admission исходных bytes.

Влияние

Это доказательство происхождения и причинности, а не сертификат математической корректности формулы. Публичный product API не меняется. Следующий слой сможет независимо добавить MPFI evaluator и semantic verifier поверх одного source-bound receipt.

Проверки

  • fast gate normal и python -O: 142 теста, точный manifest из 11 native-skips, inventory 6e73ade1e7d5b21d50fe9826a1b39e4043e63bcd090b504dbee5e1c38515e373;
  • общий provenance/protocol gate normal и python -O: 41/41;
  • mutation anti-vacuum: удаление PID guard делает fork-тест красным;
  • независимый повторный review: PASS, доказанных P0–P2 нет;
  • py_compile и git diff --check;
  • patch SHA-256 финальных исправлений review: 0b3d46eab103b309ad504c8dfc5cba9ce7d9c64a91bd37716c901c21661f760a;
  • единственный CodeRabbit-цикл: 5 подтверждённых замечаний исправлены, 1 неверное отклонено с обоснованием, 6/6 threads resolved.

До Ready for review

После merge родительского #499 ветка будет перебазирована на main; затем обязателен non-vacuous native receipt/executor gate на свежей одноразовой Linux x86_64 VM.

Summary by CodeRabbit

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

    • Добавлен контролируемый offline-процесс «источник → сборка → запуск» с формированием проверяемых квитанций.
    • Введена герметичная передача исходных данных с проверкой целостности, размера и контрольных сумм.
    • Добавлены структурированные статусы ошибок для проблем сборки, передачи данных, запуска и проверки результатов.
    • Уточнены ограничения платформы и правила воспроизводимости выполнения.
  • Документация

    • Обновлено описание протокола, границ доказательств, replay-проверок и доступных типов подтверждений.
  • Тесты

    • Расширены проверки целостности, воспроизводимости, отказоустойчивости и интеграционного сценария receipt.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f1640ccc-a47c-47d0-89ff-48ccadfef2ae

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

PR переводит Arb V1 на source-bound поток SOURCE → BUILD → RUN: исходники запечатываются в канонический bundle, BUILD выполняется через контролируемый stdin-транспорт, а one-shot controller формирует связанный evaluator receipt. Обновлены протокол, workflow и тестовые gates.

Changes

Source-bound Arb receipt

Layer / File(s) Summary
Протокол и provenance-контракты
proof/region/v1/PROTOCOL.md, proof/region/v1/provenance.py, proof/region/v1/arb/executor.py
Уточнены границы structural evidence и mathematical proof, добавлены канонические manifest/replay coordinates и строгая платформа linux-x86_64.
Sealed BUILD transport и pipeline
proof/region/v1/arb/pipeline.py, proof/region/v1/arb/build.sh
BUILD получает канонический sealed bundle через stdin, отслеживает transfer progress и typed failures, а две сборки проверяются на воспроизводимость.
One-shot receipt controller
proof/region/v1/arb/receipt.py
Добавлены source/build/run identities, immutable replay evidence и SourceBoundArbControllerV1, связывающий BUILD, RUN и SourceBoundEvaluatorReceiptV1.
Workflow и валидация
.github/workflows/arb.yml, proof/region/v1/arb/tests/*
Workflow и native gate переключены на receipt-режим; обновлены pipeline-, transport-, receipt- и интеграционные тесты.

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

Possibly related PRs

  • Labpics-Team/lab-colors#498: использует разделение RunClaimV1 и evaluator receipt, связанное с новым source-bound controller.
  • Labpics-Team/lab-colors#499: затрагивает ту же Arb provenance-инфраструктуру, включая snapshot и source/archive replay coordinates.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 5.10% 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 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 Заголовок точно отражает основное изменение: единый receipt для связки Arb source → BUILD → RUN.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/v5b2c2-arb-receipt

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

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 30, 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: 6

🤖 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/arb/pipeline.py`:
- Around line 430-441: В функции _canonical_tar_v1 вычислите paths один раз до
проверки и переиспользуйте его для проверки сортировки и уникальности вместо
повторных генераторов. Сохраните текущую проверку канонического непустого набора
и последующее поведение без изменений.
- Around line 2029-2034: В блоке finally безопасно закрывайте process.stdin:
перехватывайте BrokenPipeError/OSError при вызове close(), чтобы ошибка
завершившегося контейнера не нарушала typed-контракт наблюдателя. Сохраните
последующее освобождение bundle_view и закрытие selector независимо от
результата закрытия stdin.

In `@proof/region/v1/arb/receipt.py`:
- Line 340: Переименуйте поле dataclass `_identity` в
`SourceBoundEvaluatorReceiptV1`, чтобы оно не затеняло модульную функцию
`_identity`; обновите все обращения к полю в `replay_evidence_is_well_bound_v1`
и `SourceBoundEvaluatorReceiptV1.__init__`, сохранив вызовы функции `_identity`
без изменений.

In `@proof/region/v1/arb/tests/test_pipeline.py`:
- Around line 783-793: Усилить
test_snapshot_modes_are_normalized_independently_of_host_umask: после сборки
извлечь sealed bundle из результата и проверить режимы его tar-членов либо
сравнить sha256/identity с эталонной сборкой, выполненной при другом umask.
Сохранить проверку типа результата, но добавить утверждение, которое упадёт при
регрессии нормализации режимов.

In `@proof/region/v1/arb/tests/test_receipt.py`:
- Around line 565-610: Сделайте дочернюю ветку в
test_controller_rejects_a_forked_child_without_consuming_parent_authority
устойчивой к сбоям: перенесите os.close(read_fd) внутрь try, охватывающего весь
код после fork, и обеспечьте запись диагностической ошибки при любом исключении.
Замените неограниченное чтение из read_fd на чтение с таймаутом через select или
эквивалентный механизм, чтобы тест завершался с явной ошибкой вместо вечного
зависания.

In `@proof/region/v1/arb/tests/test_transport.py`:
- Around line 313-322: Replace the inline __import__("inspect") and
__import__("dataclasses") calls in the affected tests with module-level imports
for inspect and dataclasses, then update the existing usages to reference those
imported modules directly while preserving the current assertions.
🪄 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: cebf02a6-4d55-42d6-b7a5-37b27d57bee5

📥 Commits

Reviewing files that changed from the base of the PR and between de1a7cf and 21e5093.

📒 Files selected for processing (15)
  • .github/workflows/arb.yml
  • proof/region/v1/PROTOCOL.md
  • proof/region/v1/arb/build.sh
  • proof/region/v1/arb/executor.py
  • proof/region/v1/arb/pipeline.py
  • proof/region/v1/arb/receipt.py
  • proof/region/v1/arb/snapshot.py
  • proof/region/v1/arb/tests/gate.py
  • proof/region/v1/arb/tests/native_gate.py
  • proof/region/v1/arb/tests/test_build_recipe.py
  • proof/region/v1/arb/tests/test_pipeline.py
  • proof/region/v1/arb/tests/test_receipt.py
  • proof/region/v1/arb/tests/test_snapshot.py
  • proof/region/v1/arb/tests/test_transport.py
  • proof/region/v1/provenance.py
💤 Files with no reviewable changes (2)
  • proof/region/v1/arb/tests/test_snapshot.py
  • proof/region/v1/arb/snapshot.py

Comment thread proof/region/v1/arb/pipeline.py
Comment thread proof/region/v1/arb/pipeline.py Outdated
Comment thread proof/region/v1/arb/receipt.py
Comment thread proof/region/v1/arb/tests/test_pipeline.py Outdated
Comment thread proof/region/v1/arb/tests/test_receipt.py
Comment thread proof/region/v1/arb/tests/test_transport.py Outdated
@lemone112

Copy link
Copy Markdown
Collaborator Author

Superseded терминальным срезом #514 (Design Freeze M2a): весь объём этого PR — единый receipt-контур Arb source → BUILD → RUN — полностью входит в diff #514 (agent/mpfi-m2a-profilemain, head 0e96b037dfb45888e8e95113e85a95a9504d98df), включая все шесть ступеней нативной лестницы отказов, версионированный source-bound контракт SourceBoundArbControllerV1 для Arb и MPFI lanes и финальный native BUILD→RUN receipt. Дальнейшая жизнь этой ветки создавала бы вторую точку истины на тот же receipt-контур, поэтому PR закрывается без merge; вся доказательная база (fast gates, mutation truth, native BUILD→RUN receipts) приложена к #514.

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