Skip to content

Proof: seal shared source materializer - #510

Closed
lemone112 wants to merge 5 commits into
agent/build-transportfrom
agent/mpfi-source-materialization
Closed

Proof: seal shared source materializer#510
lemone112 wants to merge 5 commits into
agent/build-transportfrom
agent/mpfi-source-materialization

Conversation

@lemone112

@lemone112 lemone112 commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Суть

Выносит единственный engine-neutral materializer допущенных source-архивов в provenance и закрывает два общих provenance-нарушения:

  • производные identity больше не кэшируются в изменяемом __dict__; подмена identity не может сменить capability coordinate;
  • hostile nominal coordinate всегда становится typed FOREIGN_BINDING до BUILD, а KeyboardInterrupt не поглощается.

Arb сохраняет только свой USTAR layout и aggregate capability; MPFI сможет использовать тот же checked materializer, не импортируя Arb и не дублируя security-critical replay.

Корень

У frozen dataclass остаётся изменяемый __dict__. cached_property позволял внедрить ложную derived identity, а узкая обработка nominal exception оставляла raw RuntimeError на public replay path.

Инварианты

  • Replay заново сопоставляет exact admitted archive и retained coordinates.
  • Materializer не зависит от engine, receipt, executor или cgroup.
  • Поддельная/изменённая source-coordinate не достигает backend.
  • Внешний inventory oracle остаётся независимым от Arb gate.

Проверка на текущей голове

  • RED: cache poisoning возвращал внедрённую identity; hostile coordinate выпускал raw RuntimeError.
  • Characterization/differential: извлечение всех трёх exact source snapshots совпадает с прежним нормализатором.
  • Property: перестановка regular members не меняет materialized output.
  • Anti-vacuum: forged coordinate отклоняется как BuildRejectedV1(CONTRACT_VIOLATION) до backend.
  • Arb gate: 184 tests, exact 11 expected skips; normal и -O.
  • Независимый outer build oracle: 42 tests; normal и -O.
  • Full discovery: 150 tests, 1 platform skip; normal и -O.
  • git show --check чист.

Граф

База: #508. Этот срез намеренно независим от #509; следующий source-lock срез — #511. Workflow и runner не меняются.

@coderabbitai

coderabbitai Bot commented Aug 1, 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: 7a3e6b94-6050-49ed-a744-87185fd45f4e

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

Общий provenance materializer повторно проверяет допущенные source archive и возвращает канонические файлы. Arb pipeline использует этот API вместо локальной распаковки. Добавлены проверки capability, TAR-содержимого, identity и интеграционных контрактов.

Changes

Материализация допущенных исходников

Layer / File(s) Summary
Replay и материализация архива
proof/region/v1/provenance.py, proof/region/v1/tests/test_source_lock.py
provenance повторно проверяет capability, координаты и TAR-содержимое. Materializer проверяет пути, режимы, размеры, SHA-256, дубликаты и полный состав файлов.
Подключение materializer к Arb pipeline
proof/region/v1/arb/pipeline.py, proof/region/v1/PROTOCOL.md
Arb pipeline вызывает materialize_admitted_source_files_v1 и удаляет локальную _normalized_source_entries_v1. Протокол описывает новый поток допуска и границы ответственности.
Проверка контрактов и интеграции
proof/region/v1/arb/tests/*, proof/region/v1/tests/test_build.py, proof/region/v1/tests/test_mpfi_source_lock.py
Тесты проверяют ошибки provenance, подмену tree_identity, стабильность sealed bundle, MPFI-архив и отсутствие устаревшего pipeline API. Обновлены инвентарь тестов и эталонные хеши.

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

Sequence Diagram(s)

sequenceDiagram
  participant ArbPipeline
  participant Provenance
  participant SourceArchive
  ArbPipeline->>Provenance: materialize_admitted_source_files_v1
  Provenance->>SourceArchive: повторно допустить capability и replay TAR
  SourceArchive-->>Provenance: проверенный TAR-поток
  Provenance-->>ArbPipeline: отсортированные regular files
  ArbPipeline->>ArbPipeline: сформировать sealed build input bundle
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 27.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
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 Заголовок точно описывает основной срез изменений: использование общего materializer для запечатывания исходных данных.
✨ 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/mpfi-source-materialization

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

@lemone112

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

Проверь exact head a35d0eb: ownership shared archive replay/materialization, absence of engine leakage, fail-closed retained coordinates, public error mapping, deterministic output и anti-vacuum тесты. Workflow/runner не трогать.

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

@lemone112 Принято. Проверю exact head a35d0eb по указанным инвариантам. Workflow и runner не буду включать в область проверки.

✅ 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 `@proof/region/v1/tests/test_source_lock.py`:
- Around line 522-532: В блоке finally теста вокруг
materialize_admitted_source_files_v1 всегда удаляйте ключ identity из
lock.__dict__, затем восстанавливайте cached_identity только если исходное
значение действительно существовало; сохраните восстановление original_role без
изменений.
🪄 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: 6c957745-50a2-49bd-a420-289351fae2f8

📥 Commits

Reviewing files that changed from the base of the PR and between b950f3e and a35d0eb.

📒 Files selected for processing (9)
  • proof/region/v1/PROTOCOL.md
  • proof/region/v1/arb/pipeline.py
  • proof/region/v1/arb/tests/gate.py
  • proof/region/v1/arb/tests/test_pipeline.py
  • proof/region/v1/arb/tests/test_transport.py
  • proof/region/v1/provenance.py
  • proof/region/v1/tests/test_build.py
  • proof/region/v1/tests/test_mpfi_source_lock.py
  • proof/region/v1/tests/test_source_lock.py

Comment thread proof/region/v1/tests/test_source_lock.py
@lemone112

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

Исправлен единственный актуальный замеченный defect fixture cleanup в exact head 4346501. Проверь, что cache restoration не оставляет stale identity и не меняет production semantics.

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '=== Exact commits ==='
git show -s --format='a35d0eb %H%n%s%n%n4346501 %H%n%s' a35d0eb 4346501

echo '=== Files changed after a35d0eb ==='
git diff --name-status a35d0eb..4346501

echo '=== Full range diff ==='
git diff --find-renames --find-copies --no-ext-diff a35d0eb..4346501 -- .

echo '=== Python structure of changed files ==='
git diff --name-only a35d0eb..4346501 -- '*.py' | while IFS= read -r file; do
  echo "--- $file"
  ast-grep outline "$file" --items all --type function,class 2>/dev/null || true
done

echo '=== Cache/identity restoration references in changed Python files ==='
git diff --name-only a35d0eb..4346501 -- '*.py' | while IFS= read -r file; do
  echo "--- $file"
  rg -n -C 5 -i 'cache|restore|identity|fixture|patch|mock' "$file" || true
done

Length of output: 22102


@lemone112 Проверил exact head 4346501.

Не нашёл замечаний в указанном scope.

  • Commit изменяет только proof/region/v1/tests/test_source_lock.py.
  • Cleanup удаляет identity, вычисленный для hostile role, до восстановления fixture.
  • Для ранее cached fixture cleanup восстанавливает исходный identity.
  • Для ранее uncached fixture cleanup оставляет identity отсутствующим.
  • Добавленные assertions проверяют оба состояния.
  • Production files после a35d0eb не изменялись. Production semantics не меняются.
✅ 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 force-pushed the agent/mpfi-observer-placement branch from b950f3e to c63b3d5 Compare August 1, 2026 08:02
@lemone112
lemone112 force-pushed the agent/mpfi-source-materialization branch from 4346501 to 57c4817 Compare August 1, 2026 08:04
@lemone112

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

Stack rebased safely onto #509/#508; exact new head 57c4817. Review shared materializer diff and final inventory pins; no workflow/runner scope.

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

head_commit="57c4817"
previous_head="4346501"
original_head="a35d0eb"

echo '=== Exact commit identities ==='
git show -s --format='%H%n%P%n%s%n%ad' --date=iso-strict "$head_commit" "$previous_head" "$original_head"

echo '=== Requested head status ==='
git status --short
git rev-parse HEAD
git merge-base "$head_commit" "$previous_head" || true
git merge-base "$head_commit" "$original_head" || true

echo '=== Changed files: prior reviewed head to requested head ==='
git diff --name-status --find-renames --find-copies "$previous_head..$head_commit"

echo '=== Changed files: original materializer head to requested head ==='
git diff --name-status --find-renames --find-copies "$original_head..$head_commit"

echo '=== Scoped production and test diff, excluding workflow/runner ==='
git diff --find-renames --find-copies --no-ext-diff "$original_head..$head_commit" -- \
  'proof/region/v1/provenance.py' \
  'proof/region/v1/arb/pipeline.py' \
  'proof/region/v1/arb/tests/test_pipeline.py' \
  'proof/region/v1/arb/tests/test_transport.py' \
  'proof/region/v1/tests/test_source_lock.py' \
  'proof/region/v1/tests/test_build.py' \
  'proof/region/v1/tests/test_mpfi_source_lock.py' \
  'proof/region/v1/arb/tests/gate.py' \
  'proof/region/v1/PROTOCOL.md'

echo '=== Structure of candidate implementation and tests ==='
for file in \
  proof/region/v1/provenance.py \
  proof/region/v1/arb/pipeline.py \
  proof/region/v1/tests/test_source_lock.py \
  proof/region/v1/tests/test_build.py \
  proof/region/v1/arb/tests/gate.py \
  proof/region/v1/arb/tests/test_transport.py \
  proof/region/v1/tests/test_mpfi_source_lock.py
do
  if test -f "$file"; then
    echo "--- $file"
    ast-grep outline "$file" --items all --type function,class || true
  fi
done

echo '=== Shared materializer, replay, error mapping, and consumer references ==='
rg -n -C 5 \
  'materialize_admitted_source_files_v1|replay_admitted_source_archive_v1|source_archive_replay_coordinates_v1|ProvenanceErrorV1|FOREIGN_BINDING|CONTRACT_VIOLATION|_normalized_source_entries_v1' \
  proof/region/v1/provenance.py \
  proof/region/v1/arb/pipeline.py \
  proof/region/v1/tests/test_source_lock.py \
  proof/region/v1/tests/test_build.py \
  proof/region/v1/arb/tests/test_transport.py \
  proof/region/v1/tests/test_mpfi_source_lock.py \
  2>/dev/null || true

echo '=== Inventory and gate pin references ==='
rg -n -C 4 \
  'sha256|SHA-256|inventory|test.*count|172|173|gate' \
  proof/region/v1/arb/tests/gate.py \
  proof/region/v1/tests/test_build.py \
  2>/dev/null || true

echo '=== Engine leakage check: provenance must not import Arb or engine-specific code ==='
rg -n -i -C 3 \
  '(^|\s)(import|from)\s+.*\barb\b|arb\.|pipeline|ustar|build' \
  proof/region/v1/provenance.py || true

Length of output: 3329


🏁 Script executed:

#!/bin/bash
set -u

head_commit="57c4817"

echo '=== Requested commit ==='
if ! git rev-parse --verify "${head_commit}^{commit}" >/dev/null 2>&1; then
  echo "ERROR: requested commit ${head_commit} is unavailable"
  exit 1
fi
git show -s --format='commit=%H%nparents=%P%nsubject=%s%nauthor-date=%ad' --date=iso-strict "$head_commit"
parent_commit="$(git rev-parse "${head_commit}^")"
echo "parent=${parent_commit}"
echo "checked-out=$(git rev-parse HEAD)"

echo '=== Files changed by requested commit ==='
git diff-tree --no-commit-id --name-status -r --find-renames --find-copies "$head_commit"

echo '=== Full scoped diff against direct parent ==='
git diff --find-renames --find-copies --no-ext-diff "${parent_commit}..${head_commit}" -- \
  'proof/region/v1/provenance.py' \
  'proof/region/v1/arb/pipeline.py' \
  'proof/region/v1/arb/tests/test_pipeline.py' \
  'proof/region/v1/arb/tests/test_transport.py' \
  'proof/region/v1/tests/test_source_lock.py' \
  'proof/region/v1/tests/test_build.py' \
  'proof/region/v1/tests/test_mpfi_source_lock.py' \
  'proof/region/v1/arb/tests/gate.py' \
  'proof/region/v1/PROTOCOL.md'

echo '=== Locate relevant files ==='
fd -t f -a '^(provenance|pipeline|test_source_lock|test_build|test_mpfi_source_lock|test_transport|gate)\.py$' proof/region/v1 2>/dev/null || true

echo '=== Structures ==='
for file in \
  proof/region/v1/provenance.py \
  proof/region/v1/arb/pipeline.py \
  proof/region/v1/tests/test_source_lock.py \
  proof/region/v1/tests/test_build.py \
  proof/region/v1/arb/tests/gate.py \
  proof/region/v1/arb/tests/test_transport.py \
  proof/region/v1/tests/test_mpfi_source_lock.py
do
  if test -f "$file"; then
    echo "--- $file"
    ast-grep outline "$file" --items all --type function,class 2>/dev/null || true
  fi
done

echo '=== Materializer and public-error flow ==='
rg -n -C 7 \
  'materialize_admitted_source_files_v1|replay_admitted_source_archive_v1|source_archive_replay_coordinates_v1|class ProvenanceErrorV1|FOREIGN_BINDING|CONTRACT_VIOLATION|BuildRejectedV1|_normalized_source_entries_v1' \
  proof/region/v1 2>/dev/null || true

echo '=== Relevant implementation excerpts ==='
for file in proof/region/v1/provenance.py proof/region/v1/arb/pipeline.py; do
  if test -f "$file"; then
    echo "--- $file"
    rg -n -A 150 -B 12 \
      '^(def materialize_admitted_source_files_v1|def replay_admitted_source_archive_v1|def source_archive_replay_coordinates_v1|def _seal_build_input_bundle_v1|class ProvenanceErrorV1)' \
      "$file" || true
  fi
done

echo '=== Inventory pin and anti-vacuum assertions ==='
rg -n -C 6 \
  'sha256|SHA-256|inventory|test.*count|materialize_admitted_source_files_v1|forged|duplicate|missing|permut|mode|digest|coordinate' \
  proof/region/v1/arb/tests/gate.py \
  proof/region/v1/tests/test_build.py \
  proof/region/v1/tests/test_source_lock.py \
  proof/region/v1/tests/test_mpfi_source_lock.py \
  proof/region/v1/arb/tests/test_pipeline.py \
  proof/region/v1/arb/tests/test_transport.py \
  2>/dev/null || true

echo '=== Engine-leakage check in shared provenance ==='
rg -n -i -C 4 \
  '(^|\s)(import|from)\s+.*\barb\b|arb\.|pipeline|BuildRejectedV1|aggregate|backend|transport' \
  proof/region/v1/provenance.py || true

Length of output: 185607


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head_commit="57c4817"
parent_commit="$(git rev-parse "${head_commit}^")"

echo '=== Commit metadata and direct changed files ==='
git show -s --format='commit=%H%nparents=%P%nsubject=%s' "$head_commit"
git diff-tree --no-commit-id --name-status -r "$head_commit"
git show --stat --oneline --summary "$head_commit"

echo '=== Verify excluded scope is unchanged in direct commit ==='
git diff-tree --no-commit-id --name-only -r "$head_commit" | \
  rg -n '(^|/)(\.github|workflow|workflows|runner)(/|$)|runner\.(py|sh)$' || true

echo '=== Public mapping: materializer failure to build rejection ==='
rg -n -C 16 \
  'def build\(|_seal_build_input_bundle_v1\(|ProvenanceErrorV1|BuildRejectedV1|CONTRACT_VIOLATION|backend\.|run_build' \
  proof/region/v1/arb/pipeline.py \
  proof/region/v1/arb/tests/test_pipeline.py

echo '=== Forged-coordinate assertion body ==='
sed -n '830,860p' proof/region/v1/arb/tests/test_pipeline.py

echo '=== Final inventory pins and independent verifier ==='
sed -n '1,55p' proof/region/v1/arb/tests/gate.py
sed -n '35,55p' proof/region/v1/tests/test_build.py
sed -n '265,286p' proof/region/v1/tests/test_build.py

echo '=== Direct diff for inventory pin files ==='
git diff --no-ext-diff "${parent_commit}..${head_commit}" -- \
  proof/region/v1/arb/tests/gate.py \
  proof/region/v1/tests/test_build.py

echo '=== Materializer test methods ==='
ast-grep outline proof/region/v1/tests/test_source_lock.py \
  --items all --type function --match 'test_shared_materializer|test_.*replay' || true
sed -n '475,635p' proof/region/v1/tests/test_source_lock.py

echo '=== Shared module imports ==='
sed -n '1,80p' proof/region/v1/provenance.py

Length of output: 74522


@lemone112 Проверил exact head 57c48175e11bbd4e6605ae2c9eb061f24133917b.

Замечаний в указанном scope нет.

  • Commit изменяет только proof/region/v1/tests/test_source_lock.py.
  • Fixture cleanup восстанавливает cached identity.
  • Fixture cleanup удаляет временный identity для ранее uncached lock.
  • Production semantics не меняются.
  • provenance.materialize_admitted_source_files_v1 владеет replay и materialization.
  • provenance.py не импортирует Arb pipeline, transport или build-specific API.
  • Arb сохраняет ownership USTAR layout и input limits после materialization.
  • Retained coordinates fail closed через ProvenanceReasonV1.FOREIGN_BINDING.
  • Pipeline maps ProvenanceErrorV1 to BuildRejectedV1(CONTRACT_VIOLATION).
  • Тест проверяет отсутствие backend requests при forged tree_identity.
  • Materializer output сортируется и имеет tests для permutation, content, mode, duplicate и missing member cases.
  • Gate inventory SHA-256 и независимый outer oracle совпадают: 9379820ed55168ba29bc51ccbc45f2366282d1b4deeab186dea29a611f227d43.
  • Final inventory pin содержит 173 tests и отдельный order hash.
  • Workflow и runner files не изменены.

Тесты не запускались. Sandbox запрещает выполнение repository code.

You are interacting with an AI system.

@lemone112
lemone112 force-pushed the agent/mpfi-source-materialization branch from 57c4817 to dda9e73 Compare August 1, 2026 11:11
@lemone112 lemone112 changed the title Proof: вынести общий source materializer Proof: seal shared source materializer Aug 1, 2026
@lemone112
lemone112 changed the base branch from agent/mpfi-observer-placement to agent/build-transport August 1, 2026 11:11

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

Fresh exact head dda9e73, retargeted directly to #508. Review only the current diff: derived identity must not be writable cache state; hostile ordinary input must totalize to the typed provenance outcome while BaseException still propagates; the shared materializer must remain engine-neutral; outer inventory oracle must remain independent. No workflow or runner change is in scope.

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

head_commit="dda9e73"

echo '=== Commit identity ==='
git rev-parse --verify "${head_commit}^{commit}"
git show -s --format='commit=%H%nparents=%P%nsubject=%s' "$head_commit"
parent_commit="$(git rev-parse "${head_commit}^")"
echo "parent=${parent_commit}"
echo "checked_out=$(git rev-parse HEAD)"

echo '=== Direct changed files ==='
git diff-tree --no-commit-id --name-status -r --find-renames --find-copies "$head_commit"

echo '=== Excluded workflow/runner paths changed by this commit ==='
git diff-tree --no-commit-id --name-only -r "$head_commit" | \
  rg -n '(^|/)(\.github|workflow|workflows|runner)(/|$)|(^|/)runner\.(py|sh)$' || true

echo '=== Direct diff ==='
git diff --find-renames --find-copies --no-ext-diff "${parent_commit}..${head_commit}" -- .

echo '=== Candidate file structure ==='
for file in \
  proof/region/v1/provenance.py \
  proof/region/v1/arb/pipeline.py \
  proof/region/v1/tests/test_source_lock.py \
  proof/region/v1/tests/test_build.py \
  proof/region/v1/arb/tests/gate.py
do
  if test -f "$file"; then
    echo "--- $file"
    ast-grep outline "$file" --items all --type function,class 2>/dev/null || true
  fi
done

echo '=== Derived identity, cache mutation, and exception boundaries ==='
rg -n -C 12 \
  'identity|cache|cached|setattr|delattr|__dict__|except\s+(Exception|BaseException)|ProvenanceErrorV1|ProvenanceReasonV1|FOREIGN_BINDING|CONTRACT_VIOLATION' \
  proof/region/v1/provenance.py \
  proof/region/v1/tests/test_source_lock.py \
  proof/region/v1/tests/test_build.py \
  2>/dev/null || true

echo '=== Shared materializer consumers and engine-leakage scan ==='
rg -n -C 8 \
  'materialize_admitted_source_files_v1|replay_admitted_source_archive_v1|source_archive_replay_coordinates_v1|(^|\s)(import|from)\s+.*\barb\b|arb\.|pipeline|BuildRejectedV1|backend|transport|aggregate' \
  proof/region/v1/provenance.py \
  proof/region/v1/arb/pipeline.py \
  proof/region/v1/tests/test_source_lock.py \
  proof/region/v1/tests/test_build.py \
  2>/dev/null || true

echo '=== Inventory oracle and pin independence ==='
rg -n -C 12 \
  'inventory|sha256|SHA-256|test.*count|order.*hash|gate|outer|oracle|subprocess|independent|materialize_admitted_source_files_v1' \
  proof/region/v1/arb/tests/gate.py \
  proof/region/v1/tests/test_build.py \
  2>/dev/null || true

Length of output: 196445


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head_commit="dda9e73"
parent_commit="$(git rev-parse "${head_commit}^")"

echo '=== Direct changed files only ==='
git diff-tree --no-commit-id --name-status -r "$head_commit"

echo '=== Direct diff, narrowed to provenance and relevant tests ==='
git diff --no-ext-diff --unified=80 "${parent_commit}..${head_commit}" -- \
  proof/region/v1/provenance.py \
  proof/region/v1/tests/test_source_lock.py \
  proof/region/v1/tests/test_build.py \
  proof/region/v1/arb/tests/gate.py \
  proof/region/v1/arb/pipeline.py

echo '=== Provenance imports and public materializer/replay region ==='
sed -n '1,110p' proof/region/v1/provenance.py
rg -n -A 240 -B 30 \
  '^(def (source_archive_replay_coordinates_v1|replay_admitted_source_archive_v1|materialize_admitted_source_files_v1)|class ProvenanceErrorV1)' \
  proof/region/v1/provenance.py

echo '=== Identity/cache and ordinary-hostile-input test methods ==='
rg -n \
  'def test_.*(identity|cache|hostile|ordinary|base_exception|BaseException|materializ|replay)' \
  proof/region/v1/tests/test_source_lock.py
rg -n -A 100 -B 15 \
  'def test_.*(identity|cache|hostile|ordinary|base_exception|BaseException|materializ|replay)' \
  proof/region/v1/tests/test_source_lock.py

echo '=== Exact writes to derived identity fields in changed source and tests ==='
rg -n -C 8 \
  '(setattr|delattr|__dict__|object\.__setattr__|identity\s*=|\.identity)' \
  proof/region/v1/provenance.py \
  proof/region/v1/tests/test_source_lock.py

echo '=== Exception clauses in relevant shared source and tests ==='
rg -n -C 8 \
  'except\s+(Exception|BaseException)|raise\s+(KeyboardInterrupt|SystemExit)|assertRaises.*(KeyboardInterrupt|SystemExit|BaseException|ProvenanceErrorV1)' \
  proof/region/v1/provenance.py \
  proof/region/v1/tests/test_source_lock.py

echo '=== Engine-neutral import proof ==='
rg -n \
  '^(import|from) ' proof/region/v1/provenance.py
rg -n -i -C 3 \
  '\barb\b|pipeline|receipt|build_input|build_transport|BuildRejectedV1|Docker|backend|runner|workflow' \
  proof/region/v1/provenance.py || true

Length of output: 185081


@lemone112 Проверил exact head dda9e73 относительно прямого родителя.

Замечаний в указанном scope нет.

  • identity больше не использует cached_property. SourceReleaseLockV1, ArbSourceLockV1, MpfiSourceLockV1, AdmittedArbSourcesV1 и AdmittedMpfiSourcesV1 вычисляют identity при каждом доступе.
  • Внедрённое значение __dict__["identity"] не меняет derived identity. Тест проверяет это независимо вычисленным preimage.
  • replay_admitted_source_archive_v1 повторно выбрасывает ProvenanceErrorV1.
  • replay_admitted_source_archive_v1 преобразует обычный Exception от hostile nominal coordinate в ProvenanceErrorV1(FOREIGN_BINDING).
  • BaseException не перехватывается. Тест подтверждает propagation KeyboardInterrupt.
  • provenance.py не импортирует Arb pipeline, receipt, transport, backend, workflow или runner API.
  • Shared materializer остаётся владельцем replay и exact regular-file materialization. Engine выбирает layout после materialization.
  • Materializer tests сохраняют проверки retained coordinates, permutation, content, mode, duplicate и missing members.
  • Outer inventory oracle остаётся независимым. test_build.py хранит отдельные literal pins для inventory hash, order hash и count. Он не использует EXPECTED_TEST_INVENTORY_SHA256 из gate.
  • Direct diff не меняет workflow или runner.

Тесты не запускались. Проверка была статической.

You are interacting with an AI system.

@lemone112
lemone112 force-pushed the agent/build-transport branch from 7a82231 to 284ee16 Compare August 1, 2026 12:55
@lemone112
lemone112 force-pushed the agent/mpfi-source-materialization branch from dda9e73 to 7155024 Compare August 1, 2026 14:08

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 1, 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.

…t/mpfi-source-materialization

# Conflicts:
#	proof/region/v1/tests/test_build.py

Copy link
Copy Markdown
Collaborator Author

Этот materializer-срез поглощён терминальным PR #514 (base main, exact head 6e8bb6445cf5564bad1b590690a43a235f4dbfbd). Shared provenance/input SSOT сохранён и повторно проверен в terminal chain. Закрываю как superseded; код не удалён.

@lemone112 lemone112 closed this Aug 2, 2026
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