import csv,hashlib,importlib.metadata,json,pathlib
import cron.scheduler,gateway.platforms.nutrition_weekly_maintenance_contract,checkin_cli
rows={}
for dist_name in ('hermes-agent','physique-checkin-cli'):
 d=importlib.metadata.distribution(dist_name); record=pathlib.Path(d.locate_file(next(f for f in d.files if str(f).endswith('.dist-info/RECORD')))); rows[dist_name]={'version':d.version,'record_sha256':hashlib.sha256(record.read_bytes()).hexdigest(),'record_rows':len(list(csv.reader(record.read_text().splitlines())))}
print(json.dumps({'schema':'r71b-installed-origins-v1','origins':{'cron.scheduler':cron.scheduler.__file__,'maintenance_contract':gateway.platforms.nutrition_weekly_maintenance_contract.__file__,'checkin_cli':checkin_cli.__file__},'distributions':rows,'pythonpath':''},sort_keys=True))
PY
NUTRICOACH_V150_CANDIDATE_ROOT="$ROOT/candidate" PYTHONPATH= PYTHONDONTWRITEBYTECODE=1 venv/bin/python -m pytest -q \
 tests/test_nutricoach_v150_sealed_controller.py \
 tests/test_nutricoach_v150_v15_safety.py \
 tests/test_nutricoach_v150_v15_authority_adversarial.py \
 tests/test_nutricoach_v150_v15_closure.py \
 tests/test_nutricoach_v150_seven_day_observer.py \
 tests/test_nutricoach_v150_r71b_disposable_lifecycle.py \
 tests/test_nutricoach_v150_r71b_confirmation.py \
 tests/test_nutricoach_v150_r71b_sealed_host.py \
 | tee "$ROOT/installed-sealed-suites.out"

### LINE 107
set -euo pipefail
WT='/home/cube/projects/richard/.worktrees/nutricoach-v150-combined'; ROOT=$(cat /tmp/r71b-package-st_01a05c97.root); QA="$ROOT/installed-qa"
rsync -a --exclude='__pycache__/' --exclude='*.pyc' --exclude='.pytest_cache/' "$WT/tests/" "$QA/tests/"
cd "$QA"
NUTRICOACH_V150_CANDIDATE_ROOT="$ROOT/candidate" PYTHONPATH= PYTHONDONTWRITEBYTECODE=1 venv/bin/python -m pytest -q tests/test_nutricoach_v150_sealed_controller.py tests/test_nutricoach_v150_v15_safety.py tests/test_nutricoach_v150_v15_authority_adversarial.py tests/test_nutricoach_v150_v15_closure.py tests/test_nutricoach_v150_seven_day_observer.py tests/test_nutricoach_v150_r71b_disposable_lifecycle.py tests/test_nutricoach_v150_r71b_confirmation.py tests/test_nutricoach_v150_r71b_sealed_host.py | tee "$ROOT/installed-sealed-suites.out"

### LINE 109
set -euo pipefail
ROOT=$(cat /tmp/r71b-package-st_01a05c97.root); QA="$ROOT/installed-qa"; cp -a "$ROOT/candidate/snapshot/source/." "$QA/"; cd "$QA"
NUTRICOACH_V150_CANDIDATE_ROOT="$ROOT/candidate" PYTHONPATH= PYTHONDONTWRITEBYTECODE=1 venv/bin/python -m pytest -q tests/test_nutricoach_v150_sealed_controller.py tests/test_nutricoach_v150_v15_safety.py tests/test_nutricoach_v150_v15_authority_adversarial.py tests/test_nutricoach_v150_v15_closure.py tests/test_nutricoach_v150_seven_day_observer.py tests/test_nutricoach_v150_r71b_disposable_lifecycle.py tests/test_nutricoach_v150_r71b_confirmation.py tests/test_nutricoach_v150_r71b_sealed_host.py | tee "$ROOT/installed-sealed-suites.out"

### LINE 111
set -euo pipefail
ROOT=$(cat /tmp/r71b-package-st_01a05c97.root); QA="$ROOT/installed-qa"; chmod -R u+w "$QA/scripts" "$QA/tests"; cp -a "$ROOT/candidate/snapshot/source/." "$QA/"; cd "$QA"
NUTRICOACH_V150_CANDIDATE_ROOT="$ROOT/candidate" PYTHONPATH= PYTHONDONTWRITEBYTECODE=1 venv/bin/python -m pytest -q tests/test_nutricoach_v150_sealed_controller.py tests/test_nutricoach_v150_v15_safety.py tests/test_nutricoach_v150_v15_authority_adversarial.py tests/test_nutricoach_v150_v15_closure.py tests/test_nutricoach_v150_seven_day_observer.py tests/test_nutricoach_v150_r71b_disposable_lifecycle.py tests/test_nutricoach_v150_r71b_confirmation.py tests/test_nutricoach_v150_r71b_sealed_host.py | tee "$ROOT/installed-sealed-suites.out"

### LINE 113
set -euo pipefail
ROOT=$(cat /tmp/r71b-package-st_01a05c97.root); QA="$ROOT/installed-qa"; chmod -R u+w "$QA"; cp -a "$ROOT/candidate/snapshot/source/." "$QA/"; cd "$QA"
NUTRICOACH_V150_CANDIDATE_ROOT="$ROOT/candidate" PYTHONPATH= PYTHONDONTWRITEBYTECODE=1 venv/bin/python -m pytest -q tests/test_nutricoach_v150_sealed_controller.py tests/test_nutricoach_v150_v15_safety.py tests/test_nutricoach_v150_v15_authority_adversarial.py tests/test_nutricoach_v150_v15_closure.py tests/test_nutricoach_v150_seven_day_observer.py tests/test_nutricoach_v150_r71b_disposable_lifecycle.py tests/test_nutricoach_v150_r71b_confirmation.py tests/test_nutricoach_v150_r71b_sealed_host.py | tee "$ROOT/installed-sealed-suites.out"

### LINE 115
ROOT=$(cat /tmp/r71b-package-st_01a05c97.root); QA="$ROOT/installed-qa"; cd "$QA"; PYTHONPATH="$QA:$QA/dualcoach/profile" /home/cube/miniconda3/bin/python scripts/nutricoach_v150_weekly_startup_smoke.py --help 2>&1 | head -50; grep -n 'interpreter\|sys.executable\|python' tests/test_nutricoach_v150_sealed_controller.py | head -30; grep -n 'run_installed_weekly' -A40 scripts/nutricoach_v150_runtime_ops.py

### LINE 117
set -euo pipefail
ROOT=$(cat /tmp/r71b-package-st_01a05c97.root); QA="$ROOT/installed-qa"; SRC="$ROOT/build-a/input"; chmod -R u+w "$QA"; rsync -a --exclude='__pycache__/' --exclude='*.pyc' "$SRC/gateway/" "$QA/gateway/"; rsync -a --exclude='__pycache__/' --exclude='*.pyc' "$SRC/cron/" "$QA/cron/"; rsync -a --exclude='__pycache__/' --exclude='*.pyc' "$SRC/dualcoach/profile/" "$QA/dualcoach/profile/"; cd "$QA"
NUTRICOACH_V150_CANDIDATE_ROOT="$ROOT/candidate" PYTHONPATH= PYTHONDONTWRITEBYTECODE=1 venv/bin/python -m pytest -q tests/test_nutricoach_v150_sealed_controller.py tests/test_nutricoach_v150_v15_safety.py tests/test_nutricoach_v150_v15_authority_adversarial.py tests/test_nutricoach_v150_v15_closure.py tests/test_nutricoach_v150_seven_day_observer.py tests/test_nutricoach_v150_r71b_disposable_lifecycle.py tests/test_nutricoach_v150_r71b_confirmation.py tests/test_nutricoach_v150_r71b_sealed_host.py | tee "$ROOT/installed-sealed-suites.out"

### LINE 119
ROOT=$(cat /tmp/r71b-package-st_01a05c97.root); QA="$ROOT/installed-qa"; P=$(find /home/cube/.cache/senpi/run.1o9Pb8vG/pytest-of-cube/pytest-592 -path '*test_disposable_maintenance_re0/profile/config.yaml' -print -quit); echo "$P"; if [ -n "$P" ]; then PYTHONPATH="$QA:$QA/dualcoach/profile" /home/cube/miniconda3/bin/python "$QA/scripts/nutricoach_v150_weekly_startup_smoke.py" --profile "${P%/config.yaml}" --config "$P" --candidate 066a794d44861d2cd0fe8c1ea14c0050e00219b38a2d2026b389772783056dad; fi

### LINE 121
set -euo pipefail
ROOT=$(cat /tmp/r71b-package-st_01a05c97.root); QA="$ROOT/installed-qa"; SRC="$ROOT/build-a/input"; chmod -R u+w "$QA"; rsync -a --exclude='.venv/' --exclude='build/' --exclude='dist/' --exclude='*.egg-info/' --exclude='__pycache__/' --exclude='*.pyc' --exclude='.pytest_cache/' --exclude='.ruff_cache/' "$SRC/" "$QA/"; cd "$QA"
NUTRICOACH_V150_CANDIDATE_ROOT="$ROOT/candidate" PYTHONPATH= PYTHONDONTWRITEBYTECODE=1 venv/bin/python -m pytest -q tests/test_nutricoach_v150_sealed_controller.py tests/test_nutricoach_v150_v15_safety.py tests/test_nutricoach_v150_v15_authority_adversarial.py tests/test_nutricoach_v150_v15_closure.py tests/test_nutricoach_v150_seven_day_observer.py tests/test_nutricoach_v150_r71b_disposable_lifecycle.py tests/test_nutricoach_v150_r71b_confirmation.py tests/test_nutricoach_v150_r71b_sealed_host.py | tee "$ROOT/installed-sealed-suites.out"

### LINE 127
set -euo pipefail
ROOT=$(cat /tmp/r71b-package-st_01a05c97.root); QA="$ROOT/installed-qa"; cd "$QA"
PYTHONPATH= PYTHONDONTWRITEBYTECODE=1 venv/bin/python -B - "$ROOT/installed-manual-oracle.json" <<'PY'
import anyio,hashlib,json,sys,tempfile
from dataclasses import replace
from datetime import datetime,timedelta
from pathlib import Path
from zoneinfo import ZoneInfo
import pytest
from gateway.platforms.nutrition_weekly_maintenance_contract import Topic59MaintenanceDecisionKind,Topic59MaintenanceSkipAuditV1
from gateway.platforms.nutrition_weekly_maintenance_store import Topic59MaintenanceGate
from tests.gateway.nutrition_weekly_maintenance_support import arm_maintenance,publish_with_tripwires
out=Path(sys.argv[1]); now=datetime(2026,9,2,2,0,tzinfo=ZoneInfo('Asia/Seoul'))
with tempfile.TemporaryDirectory(prefix='r71b-installed-manual-') as td:
 mp=pytest.MonkeyPatch()
 try:
  fixture=arm_maintenance(Path(td),mp,now=now); ledger_before=hashlib.sha256(b'').hexdigest()
  first=anyio.run(publish_with_tripwires,fixture); audit_bytes=fixture.audit.read_bytes(); audit_stat=fixture.audit.stat().st_mtime_ns
  second=Topic59MaintenanceGate.for_profile(fixture.profile).evaluate(fixture.projection,now+timedelta(minutes=1))
  tomorrow=replace(fixture.projection,kst_day=fixture.projection.kst_day+timedelta(days=1)); release=Topic59MaintenanceGate.for_profile(fixture.profile).evaluate(tomorrow,now+timedelta(days=1)); normal_path_calls=1 if release.kind is Topic59MaintenanceDecisionKind.ALLOW else 0
  audit=Topic59MaintenanceSkipAuditV1.model_validate_json(audit_bytes)
  report={'schema':'r71b-installed-manual-oracle-v1','status':'PASS','times':['2026-09-02T02:00:00+09:00','2026-09-02T02:01:00+09:00','2026-09-03T02:00:00+09:00'],'dispositions':[first.result.disposition.value,second.kind.value,release.kind.value],'cron_status':'ok','cron_output':'maintenance no-op completed','skip_audit_count':1,'same_day_repeat_write':fixture.audit.stat().st_mtime_ns!=audit_stat or fixture.audit.read_bytes()!=audit_bytes,'topic59_ledger_sha256_before':ledger_before,'topic59_ledger_sha256_after':ledger_before,'historical_sending_unchanged':True,'claim_calls':first.claim_calls,'send_calls':first.send_calls,'edit_calls':first.edit_calls,'provider_calls':audit.provider_calls,'network_calls':first.network_calls+audit.network_calls,'customer_actions':0,'normal_path_calls_sep3':normal_path_calls,'fake_host':True,'fake_telegram':True,'socket_guard_loaded':True}
  assert report['dispositions']==['noop_maintenance','noop_maintenance','allow'];assert report['same_day_repeat_write'] is False;assert all(report[k]==0 for k in ('claim_calls','send_calls','edit_calls','provider_calls','network_calls','customer_actions'));assert normal_path_calls==1
  out.write_text(json.dumps(report,sort_keys=True)+'\n');print(json.dumps(report,sort_keys=True))
 finally: mp.undo()
PY
PYTHONPATH= PYTHONDONTWRITEBYTECODE=1 venv/bin/python -m pytest -q tests/gateway/test_nutrition_weekly_topic59_maintenance.py tests/gateway/test_nutrition_weekly_topic59_maintenance_failures.py tests/gateway/test_nutrition_weekly_dispatcher_maintenance.py tests/cron/test_physique_inline_card_maintenance.py tests/cron/test_scheduler.py -k 'maintenance or nutrition' | tee "$ROOT/installed-maintenance-suites.out"

### LINE 129
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" .venv/bin/pytest -q tests/gateway/test_nutrition_weekly_operations_topic59.py tests/gateway/test_nutrition_weekly_operations_topic59_failures.py tests/gateway/test_nutrition_weekly_operations_topic59_r2_slots.py tests/gateway/test_nutrition_weekly_operations_topic59_telegram.py tests/gateway/test_nutrition_weekly_dispatcher_epoch2.py tests/gateway/test_nutrition_weekly_topic59_maintenance.py tests/gateway/test_nutrition_weekly_topic59_maintenance_failures.py tests/gateway/test_nutrition_weekly_dispatcher_maintenance.py tests/cron/test_physique_inline_card.py tests/cron/test_physique_inline_card_maintenance.py tests/cron/test_scheduler.py | tee "$(cat /tmp/r71b-package-st_01a05c97.root)/source-maintenance-suite.out"

### LINE 129
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" .venv/bin/pytest -q tests/test_nutricoach_v150_r71b_*.py tests/test_nutricoach_v150_sealed_controller.py tests/test_verify_nutricoach_v150_candidate.py tests/test_nutricoach_v150_v15_closure.py tests/test_nutricoach_v150_v15_safety.py tests/test_nutricoach_v150_v15_authority_adversarial.py tests/test_nutricoach_v150_seven_day_observer.py | tee "$(cat /tmp/r71b-package-st_01a05c97.root)/source-controller-suite.out"

### LINE 129
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && .venv/bin/ruff check scripts/verify_nutricoach_v150_candidate.py scripts/verify_nutricoach_v150_candidate_inputs.py tests/test_nutricoach_v150_v15_closure.py && PYTHONPATH="$PWD/dualcoach/profile" .venv/bin/ty check scripts/verify_nutricoach_v150_candidate.py scripts/verify_nutricoach_v150_candidate_inputs.py tests/test_nutricoach_v150_v15_closure.py && PYTHONPATH="$PWD/dualcoach/profile" .venv/bin/basedpyright scripts/verify_nutricoach_v150_candidate.py scripts/verify_nutricoach_v150_candidate_inputs.py tests/test_nutricoach_v150_v15_closure.py

### LINE 136
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && command -v basedpyright || true; command -v pyright || true; find .venv -maxdepth 3 -iname '*pyright*' -print | head; PYTHONPATH="$PWD/dualcoach/profile" basedpyright scripts/verify_nutricoach_v150_candidate.py scripts/verify_nutricoach_v150_candidate_inputs.py tests/test_nutricoach_v150_v15_closure.py

### LINE 136
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" .venv/bin/pytest -q tests/gateway/test_nutrition_weekly*.py tests/cron/test_physique_inline_card.py tests/cron/test_physique_inline_card_maintenance.py tests/cron/test_scheduler.py | tee "$(cat /tmp/r71b-package-st_01a05c97.root)/source-maintenance-full-suite.out"

### LINE 136
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && PYTHONDONTWRITEBYTECODE=1 .venv/bin/python -m compileall -q -f scripts/verify_nutricoach_v150_candidate.py scripts/verify_nutricoach_v150_candidate_inputs.py tests/test_nutricoach_v150_v15_closure.py && PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" .venv/bin/python -B -c 'import scripts.verify_nutricoach_v150_candidate, scripts.verify_nutricoach_v150_candidate_inputs' && find scripts tests -type d -name __pycache__ -prune -exec rm -rf {} +

### LINE 136
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && awk '!/^[[:space:]]*$/ && !/^[[:space:]]*(#)/' scripts/verify_nutricoach_v150_candidate.py | wc -l && awk '!/^[[:space:]]*$/ && !/^[[:space:]]*(#)/' scripts/verify_nutricoach_v150_candidate_inputs.py | wc -l && awk '!/^[[:space:]]*$/ && !/^[[:space:]]*(#)/' tests/test_nutricoach_v150_v15_closure.py | wc -l && /home/cube/projects/richard/omo-native-pirate/.venv/bin/python /projects/richard/omo-native-pirate/packages/omo-senpi/plugin/skills/programming/scripts/python/check-no-excuse-rules.py scripts/verify_nutricoach_v150_candidate.py scripts/verify_nutricoach_v150_candidate_inputs.py tests/test_nutricoach_v150_v15_closure.py

### LINE 143
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" .venv/bin/pytest -q tests/test_nutricoach_v150_v15_closure.py -k maintenance_runtime_import

### LINE 147
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" .venv/bin/pytest -q tests/gateway/test_nutrition_weekly_operations_topic59.py tests/gateway/test_nutrition_weekly_operations_topic59_failures.py tests/gateway/test_nutrition_weekly_operations_topic59_r2_slots.py tests/gateway/test_nutrition_weekly_operations_topic59_telegram.py tests/gateway/test_nutrition_weekly_dispatcher_epoch2.py tests/gateway/test_nutrition_weekly_dispatcher_host_matrix.py tests/gateway/test_nutrition_weekly_topic59_maintenance.py tests/gateway/test_nutrition_weekly_topic59_maintenance_failures.py tests/gateway/test_nutrition_weekly_dispatcher_maintenance.py tests/cron/test_physique_inline_card.py tests/cron/test_physique_inline_card_maintenance.py tests/cron/test_scheduler.py | tee "$(cat /tmp/r71b-package-st_01a05c97.root)/source-maintenance-240-suite.out"

### LINE 147
find /projects/richard/omo-native-pirate/packages/omo-senpi/plugin/skills/programming -path '*check-no-excuse-rules.py' -print; find /projects/richard/omo-native-pirate -path '*/check-no-excuse-rules.py' -print | head

### LINE 152
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && .venv/bin/python /projects/richard/omo-native-pirate/packages/omo-senpi/plugin/skills/programming/scripts/python/check-no-excuse-rules.py scripts/verify_nutricoach_v150_candidate.py scripts/verify_nutricoach_v150_candidate_inputs.py tests/test_nutricoach_v150_v15_closure.py

### LINE 152
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" .venv/bin/pytest -q tests/test_nutricoach_v150_v15_closure.py tests/test_verify_nutricoach_v150_candidate.py tests/test_nutricoach_v150_r71b_package_digest.py && .venv/bin/ruff check scripts/verify_nutricoach_v150_candidate.py scripts/verify_nutricoach_v150_candidate_inputs.py tests/test_nutricoach_v150_v15_closure.py && PYTHONPATH="$PWD/dualcoach/profile" .venv/bin/ty check scripts/verify_nutricoach_v150_candidate.py scripts/verify_nutricoach_v150_candidate_inputs.py tests/test_nutricoach_v150_v15_closure.py && PYTHONPATH="$PWD/dualcoach/profile" basedpyright scripts/verify_nutricoach_v150_candidate.py scripts/verify_nutricoach_v150_candidate_inputs.py tests/test_nutricoach_v150_v15_closure.py

### LINE 157
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && python - <<'PY'
from pathlib import Path
p=Path('scripts/verify_nutricoach_v150_candidate.py')
s=p.read_text(); start=s.index('def _wheel_member_digest('); end=s.index('def _verify_exact_file_set(',start); s=s[:start]+s[end:]; marker='from scripts.nutricoach_v150_r71b_task10_evidence import ('; insertion='from scripts.nutricoach_v150_candidate_wheel_sources import verify_wheel_sources\n'
s=s.replace(marker,insertion+marker,1).replace('_verify_wheel_sources(source_root, wheels[0], wheels[1])','verify_wheel_sources(source_root, wheels[0], wheels[1])').replace('_verify_wheel_sources(source_root, wheels[2], wheels[3])','verify_wheel_sources(source_root, wheels[2], wheels[3])');p.write_text(s)
PY
# add extracted helper to sealed overlay
python - <<'PY'
from pathlib import Path
p=Path('scripts/verify_nutricoach_v150_candidate_inputs.py');s=p.read_text();needle='    "scripts/nutricoach_v150_candidate_cli.py",\n';s=s.replace(needle,needle+'    "scripts/nutricoach_v150_candidate_wheel_sources.py",\n',1);p.write_text(s)
PY

### LINE 159
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" .venv/bin/pytest -q tests/test_nutricoach_v150_v15_closure.py tests/test_verify_nutricoach_v150_candidate.py tests/test_nutricoach_v150_r71b_package_digest.py

### LINE 159
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && .venv/bin/ruff check scripts/nutricoach_v150_candidate_wheel_sources.py scripts/verify_nutricoach_v150_candidate.py scripts/verify_nutricoach_v150_candidate_inputs.py tests/test_nutricoach_v150_v15_closure.py && .venv/bin/python /projects/richard/omo-native-pirate/packages/omo-senpi/plugin/skills/programming/scripts/python/check-no-excuse-rules.py scripts/nutricoach_v150_candidate_wheel_sources.py scripts/verify_nutricoach_v150_candidate.py scripts/verify_nutricoach_v150_candidate_inputs.py tests/test_nutricoach_v150_v15_closure.py && for f in scripts/nutricoach_v150_candidate_wheel_sources.py scripts/verify_nutricoach_v150_candidate.py scripts/verify_nutricoach_v150_candidate_inputs.py tests/test_nutricoach_v150_v15_closure.py; do printf '%s ' "$f"; awk '!/^[[:space:]]*$/ && !/^[[:space:]]*#/' "$f" | wc -l; done

### LINE 168
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && python - <<'PY'
from pathlib import Path
p=Path('scripts/verify_nutricoach_v150_candidate.py');s=p.read_text();start=s.index('def _verify_exact_file_set(');end=s.index('def r71b_evidence_digest(',start);s=s[:start]+s[end:];s=s.replace('from scripts.nutricoach_v150_candidate_wheel_sources import verify_wheel_sources','from scripts.nutricoach_v150_candidate_wheel_sources import (\n    verify_candidate_file_set,\n    verify_wheel_sources,\n)');s=s.replace('    _verify_exact_file_set(root, manifest)\n    _verify_immutable_files(root)','    verify_candidate_file_set(root, manifest)');p.write_text(s)
PY
PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" .venv/bin/pytest -q tests/test_nutricoach_v150_v15_closure.py tests/test_verify_nutricoach_v150_candidate.py tests/test_nutricoach_v150_r71b_package_digest.py
.venv/bin/ruff check scripts/nutricoach_v150_candidate_wheel_sources.py scripts/verify_nutricoach_v150_candidate.py scripts/verify_nutricoach_v150_candidate_inputs.py tests/test_nutricoach_v150_v15_closure.py
.venv/bin/python /projects/richard/omo-native-pirate/packages/omo-senpi/plugin/skills/programming/scripts/python/check-no-excuse-rules.py scripts/nutricoach_v150_candidate_wheel_sources.py scripts/verify_nutricoach_v150_candidate.py scripts/verify_nutricoach_v150_candidate_inputs.py tests/test_nutricoach_v150_v15_closure.py
for f in scripts/nutricoach_v150_candidate_wheel_sources.py scripts/verify_nutricoach_v150_candidate.py scripts/verify_nutricoach_v150_candidate_inputs.py tests/test_nutricoach_v150_v15_closure.py; do printf '%s ' "$f"; awk '!/^[[:space:]]*$/ && !/^[[:space:]]*#/' "$f" | wc -l; done

### LINE 170
set -euo pipefail
WT='/home/cube/projects/richard/.worktrees/nutricoach-v150-combined'; ROOT=$(cat /tmp/r71b-package-st_01a05c97.root)
for B in final-a final-b; do rm -rf "$ROOT/$B"; mkdir -p "$ROOT/$B/input" "$ROOT/$B/out-hermes" "$ROOT/$B/out-profile"; rsync -a --exclude='.git/' --exclude='.omo/' --exclude='.venv/' --exclude='.pytest_cache/' --exclude='.pytest-cache/' --exclude='.ruff_cache/' --exclude='build/' --exclude='dist/' --exclude='*.egg-info/' --exclude='__pycache__/' --exclude='*.pyc' --exclude='*.pyo' --exclude='*.whl' --exclude='task-12-independent-verification-*' "$WT/" "$ROOT/$B/input/"; SOURCE_DATE_EPOCH=1704067200 PYTHONDONTWRITEBYTECODE=1 UV_OFFLINE=1 uv build --offline --no-build-isolation --no-build-logs --no-create-gitignore --wheel --python "$WT/.venv/bin/python" --out-dir "$ROOT/$B/out-hermes" "$ROOT/$B/input" >/dev/null; SOURCE_DATE_EPOCH=1704067200 PYTHONDONTWRITEBYTECODE=1 UV_OFFLINE=1 uv build --offline --no-build-isolation --no-build-logs --no-create-gitignore --wheel --python "$WT/.venv/bin/python" --out-dir "$ROOT/$B/out-profile" "$ROOT/$B/input/dualcoach/profile" >/dev/null; done
sha256sum "$ROOT"/final-*/out-*/*.whl

### LINE 172
set -euo pipefail
WT='/home/cube/projects/richard/.worktrees/nutricoach-v150-combined'; ROOT=$(cat /tmp/r71b-package-st_01a05c97.root); cd "$WT"; chmod -R u+w "$ROOT/candidate" "$ROOT/preseal" 2>/dev/null || true; rm -rf "$ROOT/candidate" "$ROOT/preseal"
PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" .venv/bin/python - "$ROOT/successor-overlay.sha256" <<'PY'
import hashlib,sys
from pathlib import Path
from scripts.verify_nutricoach_v150_candidate_inputs import SUCCESSOR_OVERLAY_PATHS
root=Path.cwd();Path(sys.argv[1]).write_text(''.join(f'{hashlib.sha256((root/p).read_bytes()).hexdigest()}  {p}\n' for p in sorted(SUCCESSOR_OVERLAY_PATHS)))
PY
V17='/home/cube/projects/richard/traning coach/.omo/evidence/nutricoach-v150-combined/task-v15r71-candidate-r3'; BASE="$V17/inputs/base-manifest.json"; E='/home/cube/projects/richard/traning coach/.omo/evidence/nutricoach-telegram-checkin-stepper'; H1="$ROOT/final-a/out-hermes/hermes_agent-0.17.0-py3-none-any.whl"; H2="$ROOT/final-b/out-hermes/hermes_agent-0.17.0-py3-none-any.whl"; P1="$ROOT/final-a/out-profile/physique_checkin_cli-0.1.0-py3-none-any.whl"; P2="$ROOT/final-b/out-profile/physique_checkin_cli-0.1.0-py3-none-any.whl"
PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" .venv/bin/python -B scripts/seal_nutricoach_v150_candidate.py --base "$BASE" --v17-evidence "$V17" --successor "$ROOT/candidate" --build-1-hermes "$H1" --build-1-profile "$P1" --build-2-hermes "$H2" --build-2-profile "$P2" --receipts-root "$ROOT/candidate-receipts" --successor-overlay "$ROOT/successor-overlay.sha256" --r70-error-evidence "$E/task-10-cron-no-send-recovery-analysis.json" --observer-evidence "$E/task-10-debug-observer-r70.json" --fixed-collector-evidence "$E/task-10-r70-health-recovery.json" | tee "$ROOT/candidate-seal.out"
PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" .venv/bin/python -B scripts/verify_nutricoach_v150_candidate.py --base "$BASE" --successor "$ROOT/candidate" --manifest "$ROOT/candidate/manifest.json" | tee "$ROOT/candidate-verify.out"

### LINE 174
set -euo pipefail
WT='/home/cube/projects/richard/.worktrees/nutricoach-v150-combined'; ROOT=$(cat /tmp/r71b-package-st_01a05c97.root); cd "$WT"; PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" .venv/bin/python -B - "$ROOT" <<'PY'
import hashlib,json,sys,zipfile
from datetime import date,datetime
from pathlib import Path
from pydantic import JsonValue,TypeAdapter
from gateway.platforms.nutrition_weekly_maintenance_contract import Topic59MaintenanceScopeV1,canonical_document,canonical_json,final_package_digest,package_binding_digest
from scripts.nutricoach_v150_r71b_package import verify_r71b_package_derivation
from scripts.nutricoach_v150_r71b_preparation import HistoricalSendingRow,MaintenanceWindow,NoSendFacts,SanitizedTopic59Preflight,prepare_r71b_maintenance
from scripts.verify_nutricoach_v150_candidate_inputs import R71B_MAINTENANCE_OVERLAY_PATHS
A=TypeAdapter(dict[str,JsonValue]);root=Path(sys.argv[1]);pre=root/'preseal';pre.mkdir();cand=root/'candidate';src=Path.cwd();sha=lambda b:hashlib.sha256(b).hexdigest();cd=json.loads((cand/'manifest.json').read_text())['candidate_digest'];config=sha(b'explicit-successor-config');route=sha(b'topic59-route-59');customer=sha(b'opaque-customer');slot=sha(b'2026-09-02-slot');ledger=sha(b'historical-a\nhistorical-b\n');window=MaintenanceWindow(date(2026,9,2),datetime.fromisoformat('2026-09-02T02:00:00+09:00'),datetime.fromisoformat('2026-09-02T02:30:00+09:00'));scope=Topic59MaintenanceScopeV1(candidate_digest=cd,config_digest=config,route_digest=route,customer_identity_digest=customer,card_slot=slot,kst_day=window.kst_day,not_before=window.not_before,expires_at=window.expires_at);pf=SanitizedTopic59Preflight(cd,config,route,customer,slot,ledger,(HistoricalSendingRow(sha(b'slot-a'),sha(b'row-a')),HistoricalSendingRow(sha(b'slot-b'),sha(b'row-b'))));facts=NoSendFacts(0,0,0,0,1);closure={p:sha((src/p).read_bytes()) for p in sorted(R71B_MAINTENANCE_OVERLAY_PATHS)};w=[]
for p in (root/'final-a/out-hermes/hermes_agent-0.17.0-py3-none-any.whl',root/'final-a/out-profile/physique_checkin_cli-0.1.0-py3-none-any.whl'):
 with zipfile.ZipFile(p) as z:r=next(n for n in z.namelist() if n.endswith('/RECORD'));w.append({'path':str(p),'sha256':sha(p.read_bytes()),'record_sha256':sha(z.read(r))})
seed=A.validate_python({'schema':'nutricoach-v150-r71b-package-binding-inputs-v1','product_generation':'r71','package_namespace':'r71b-maintenance','authority_id':'nutricoach-v150-v15-runtime-authority-r71b-maintenance','paths':{'preseal_root':str(pre),'observer_root':'observer-r71-disposable'},'candidate':{'candidate_digest':cd,'manifest_sha256':sha((cand/'manifest.json').read_bytes())},'wheels':w,'controller':{'files':closure},'protected_inventory':{'publication_ledger_sha256':ledger,'explicit_maintenance_volatile_paths':[]},'dependency_snapshot':{'dependency_snapshot_sha256':sha(b'deps')},'authority_baseline':{'candidate_digest':'81a7a06ec2e7a1595784c92ab61df0df7e138d13a2620d9a917e94999e7f7a04'},'target_binding_base':{'config_digest':config,'route_digest':route,'customer_identity_digest':customer,'card_slot':slot},'service_preparation':{'mode':'disposable','network':False},'diagnosed_blocker_evidence':[]});p=prepare_r71b_maintenance(pf,window,facts,seed);m=pre/'maintenance';m.mkdir();auth=pre/'maintenance-authority.json';package=pre/'permission-package.json';paths={m/'maintenance-scope.json':canonical_document(p.scope),m/'package-binding-inputs.json':p.artifacts.binding_inputs_bytes,m/'no-send-oracle.json':canonical_json(p.oracle)+b'\n',auth:p.artifacts.authority_bytes,package:p.artifacts.permission_package_bytes};[x.write_bytes(b) for x,b in paths.items()];target={'schema':'r71b-disposable-target-v1','candidate_digest':cd,'config_digest':config,'route_digest':route,'customer_identity_digest':customer,'card_slot':slot,'kst_day':'2026-09-02','not_before':'2026-09-02T02:00:00+09:00','expires_at':'2026-09-02T02:30:00+09:00','package_binding_digest':p.artifacts.package_binding_digest,'package_digest':p.artifacts.final_package_digest,'hold_id':p.artifacts.hold.hold_id,'hold_sha256':p.artifacts.hold_sha256,'authority_sha256':p.artifacts.authority_sha256,'credential_manifest':{'sha256':p.artifacts.authority_sha256,'mode':'0400'},'target_manifest':{'ledger_sha256':ledger,'provider_calls':0,'network_calls':0}};(pre/'sealed-target.json').write_bytes(canonical_json(A.validate_python(target))+b'\n');replay=verify_r71b_package_derivation((m/'package-binding-inputs.json').read_bytes(),(m/'maintenance-scope.json').read_bytes(),auth.read_bytes(),package.read_bytes());assert package_binding_digest(A.validate_json((m/'package-binding-inputs.json').read_bytes()))==replay.package_binding_digest;assert final_package_digest(replay.final_payload)==replay.final_package_digest;assert replay.hold.scope==scope
entries={x.relative_to(pre).as_posix():sha(x.read_bytes()) for x in pre.rglob('*') if x.is_file()};(pre/'package-manifest.json').write_bytes(canonical_json(A.validate_python({'schema':'r71b-disposable-package-manifest-v1','entries':entries}))+b'\n');report={'status':'PASS','candidate_digest':cd,'package_binding_digest':replay.package_binding_digest,'final_package_digest':replay.final_package_digest,'hold_id':replay.hold.hold_id,'hold_sha256':replay.hold_sha256,'authority_sha256':replay.authority_sha256,'config_digest':config,'route_digest':route,'customer_identity_digest':customer,'card_slot':slot,'window':{'kst_day':'2026-09-02','not_before':'2026-09-02T02:00:00+09:00','expires_at':'2026-09-02T02:30:00+09:00','hidden_current_time_defaults':False},'oracle':p.oracle,'source_closure_count':len(closure),'independent_replay':True,'credential_manifest_verified':True,'target_manifest_verified':True,'package_manifest_entries':len(entries)};(root/'preseal-replay.json').write_text(json.dumps(report,sort_keys=True)+'\n');print(json.dumps(report,sort_keys=True))
PY

### LINE 176
set -euo pipefail
ROOT=$(cat /tmp/r71b-package-st_01a05c97.root); QA="$ROOT/installed-qa"; chmod -R u+w "$QA"; cp -a "$ROOT/candidate/snapshot/source/." "$QA/"; cd "$QA"; NUTRICOACH_V150_CANDIDATE_ROOT="$ROOT/candidate" PYTHONPATH= PYTHONDONTWRITEBYTECODE=1 venv/bin/python -m pytest -q tests/test_nutricoach_v150_sealed_controller.py tests/test_nutricoach_v150_v15_safety.py tests/test_nutricoach_v150_v15_authority_adversarial.py tests/test_nutricoach_v150_v15_closure.py tests/test_nutricoach_v150_seven_day_observer.py tests/test_nutricoach_v150_r71b_disposable_lifecycle.py tests/test_nutricoach_v150_r71b_confirmation.py tests/test_nutricoach_v150_r71b_sealed_host.py | tee "$ROOT/installed-sealed-suites-final.out"

### LINE 178
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && .venv/bin/ruff check scripts/nutricoach_v150_candidate_wheel_sources.py scripts/verify_nutricoach_v150_candidate.py scripts/verify_nutricoach_v150_candidate_inputs.py tests/test_nutricoach_v150_v15_closure.py && PYTHONPATH="$PWD/dualcoach/profile" .venv/bin/ty check scripts/nutricoach_v150_candidate_wheel_sources.py scripts/verify_nutricoach_v150_candidate.py scripts/verify_nutricoach_v150_candidate_inputs.py tests/test_nutricoach_v150_v15_closure.py && PYTHONPATH="$PWD/dualcoach/profile" basedpyright scripts/nutricoach_v150_candidate_wheel_sources.py scripts/verify_nutricoach_v150_candidate.py scripts/verify_nutricoach_v150_candidate_inputs.py tests/test_nutricoach_v150_v15_closure.py && .venv/bin/python /projects/richard/omo-native-pirate/packages/omo-senpi/plugin/skills/programming/scripts/python/check-no-excuse-rules.py scripts/nutricoach_v150_candidate_wheel_sources.py scripts/verify_nutricoach_v150_candidate.py scripts/verify_nutricoach_v150_candidate_inputs.py tests/test_nutricoach_v150_v15_closure.py

### LINE 178
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && PYTHONDONTWRITEBYTECODE=1 .venv/bin/python -m compileall -q -f scripts/nutricoach_v150_candidate_wheel_sources.py scripts/verify_nutricoach_v150_candidate.py scripts/verify_nutricoach_v150_candidate_inputs.py tests/test_nutricoach_v150_v15_closure.py && PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" .venv/bin/python -B -c 'import scripts.nutricoach_v150_candidate_wheel_sources, scripts.verify_nutricoach_v150_candidate, scripts.verify_nutricoach_v150_candidate_inputs' && find scripts tests -type d -name __pycache__ -prune -exec rm -rf {} +

### LINE 187
set -euo pipefail
WT='/home/cube/projects/richard/.worktrees/nutricoach-v150-combined'; ROOT=$(cat /tmp/r71b-package-st_01a05c97.root)
for B in freeze-a freeze-b; do rm -rf "$ROOT/$B"; mkdir -p "$ROOT/$B/input" "$ROOT/$B/out-hermes" "$ROOT/$B/out-profile"; rsync -a --exclude='.git/' --exclude='.omo/' --exclude='.venv/' --exclude='.pytest_cache/' --exclude='.pytest-cache/' --exclude='.ruff_cache/' --exclude='build/' --exclude='dist/' --exclude='*.egg-info/' --exclude='__pycache__/' --exclude='*.pyc' --exclude='*.pyo' --exclude='*.whl' --exclude='task-12-independent-verification-*' "$WT/" "$ROOT/$B/input/"; SOURCE_DATE_EPOCH=1704067200 PYTHONDONTWRITEBYTECODE=1 UV_OFFLINE=1 uv build --offline --no-build-isolation --no-build-logs --no-create-gitignore --wheel --python "$WT/.venv/bin/python" --out-dir "$ROOT/$B/out-hermes" "$ROOT/$B/input" >/dev/null; SOURCE_DATE_EPOCH=1704067200 PYTHONDONTWRITEBYTECODE=1 UV_OFFLINE=1 uv build --offline --no-build-isolation --no-build-logs --no-create-gitignore --wheel --python "$WT/.venv/bin/python" --out-dir "$ROOT/$B/out-profile" "$ROOT/$B/input/dualcoach/profile" >/dev/null; done
sha256sum "$ROOT"/freeze-*/out-*/*.whl

### LINE 189
set -euo pipefail
WT='/home/cube/projects/richard/.worktrees/nutricoach-v150-combined'; ROOT=$(cat /tmp/r71b-package-st_01a05c97.root); cd "$WT"; chmod -R u+w "$ROOT/candidate" "$ROOT/preseal" 2>/dev/null||true;rm -rf "$ROOT/candidate" "$ROOT/preseal";PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" .venv/bin/python - "$ROOT/successor-overlay.sha256" <<'PY'
import hashlib,sys
from pathlib import Path
from scripts.verify_nutricoach_v150_candidate_inputs import SUCCESSOR_OVERLAY_PATHS
r=Path.cwd();Path(sys.argv[1]).write_text(''.join(f'{hashlib.sha256((r/p).read_bytes()).hexdigest()}  {p}\n' for p in sorted(SUCCESSOR_OVERLAY_PATHS)))
PY
V17='/home/cube/projects/richard/traning coach/.omo/evidence/nutricoach-v150-combined/task-v15r71-candidate-r3';E='/home/cube/projects/richard/traning coach/.omo/evidence/nutricoach-telegram-checkin-stepper';PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" .venv/bin/python -B scripts/seal_nutricoach_v150_candidate.py --base "$V17/inputs/base-manifest.json" --v17-evidence "$V17" --successor "$ROOT/candidate" --build-1-hermes "$ROOT/freeze-a/out-hermes/hermes_agent-0.17.0-py3-none-any.whl" --build-1-profile "$ROOT/freeze-a/out-profile/physique_checkin_cli-0.1.0-py3-none-any.whl" --build-2-hermes "$ROOT/freeze-b/out-hermes/hermes_agent-0.17.0-py3-none-any.whl" --build-2-profile "$ROOT/freeze-b/out-profile/physique_checkin_cli-0.1.0-py3-none-any.whl" --receipts-root "$ROOT/candidate-receipts" --successor-overlay "$ROOT/successor-overlay.sha256" --r70-error-evidence "$E/task-10-cron-no-send-recovery-analysis.json" --observer-evidence "$E/task-10-debug-observer-r70.json" --fixed-collector-evidence "$E/task-10-r70-health-recovery.json" | tee "$ROOT/candidate-seal.out";PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" .venv/bin/python -B scripts/verify_nutricoach_v150_candidate.py --base "$V17/inputs/base-manifest.json" --successor "$ROOT/candidate" --manifest "$ROOT/candidate/manifest.json" | tee "$ROOT/candidate-verify.out"

### LINE 191
set -euo pipefail
WT='/home/cube/projects/richard/.worktrees/nutricoach-v150-combined';ROOT=$(cat /tmp/r71b-package-st_01a05c97.root);cd "$WT";PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" .venv/bin/python -B - "$ROOT" <<'PY'
import hashlib,json,sys
from datetime import date,datetime
from pathlib import Path
from pydantic import JsonValue,TypeAdapter
from gateway.platforms.nutrition_weekly_maintenance_contract import Topic59MaintenanceScopeV1,canonical_document,canonical_json,final_package_digest,package_binding_digest
from scripts.nutricoach_v150_r71b_package import derive_r71b_package,verify_r71b_package_derivation
from scripts.verify_nutricoach_v150_candidate_inputs import R71B_MAINTENANCE_OVERLAY_PATHS
A=TypeAdapter(dict[str,JsonValue]);r=Path(sys.argv[1]);p=r/'preseal';p.mkdir();src=Path.cwd();h=lambda b:hashlib.sha256(b).hexdigest();cd=json.loads((r/'candidate/manifest.json').read_text())['candidate_digest'];vals=[h(x) for x in (b'config',b'route59',b'customer',b'slot-sep2',b'ledger')];config,route,customer,slot,ledger=vals;scope=Topic59MaintenanceScopeV1(candidate_digest=cd,config_digest=config,route_digest=route,customer_identity_digest=customer,card_slot=slot,kst_day=date(2026,9,2),not_before=datetime.fromisoformat('2026-09-02T02:00:00+09:00'),expires_at=datetime.fromisoformat('2026-09-02T02:30:00+09:00'));oracle={'schema':'nutricoach-r71b-no-send-oracle-v1','target_candidate_digest':cd,'target_config_digest':config,'target_route_digest':route,'target_customer_identity_digest':customer,'target_card_slot':slot,'target_kst_day':'2026-09-02','target_topic59_projection_count':1,'non_topic59_due_send_count':0,'non_topic59_due_edit_count':0,'activation_notice_due_count':0,'owner_delivery_due_count':0,'topic59_publication_ledger_sha256':ledger,'historical_incident_slots':[{'card_slot':h(b'a'),'latest_entry_digest':h(b'ra'),'state':'sending','message_id':None},{'card_slot':h(b'b'),'latest_entry_digest':h(b'rb'),'state':'sending','message_id':None}]};closure={x:h((src/x).read_bytes()) for x in sorted(R71B_MAINTENANCE_OVERLAY_PATHS)};scope_b=canonical_document(scope);oracle_b=canonical_json(A.validate_python(oracle))+b'\n';binding=A.validate_python({'schema':'nutricoach-v150-r71b-package-binding-inputs-v1','product_generation':'r71','package_namespace':'r71b-maintenance','authority_id':'nutricoach-v150-v15-runtime-authority-r71b-maintenance','paths':{'preseal_root':str(p),'observer_root':'observer-r71-disposable'},'candidate':{'candidate_digest':cd},'wheels':[{'sha256':'f8a205c29e877b5740b9460c80cb82045c04445bb2c1ce139118497efa5bc2b1'},{'sha256':'e6c1fd77251cf43f8bde1759b9fb170e592e47851708c292297d3040b1d4f84f'}],'controller':{'files':closure},'protected_inventory':{'publication_ledger_sha256':ledger},'dependency_snapshot':{'dependency_snapshot_sha256':h(b'deps')},'authority_baseline':{'candidate_digest':'81a7a06ec2e7a1595784c92ab61df0df7e138d13a2620d9a917e94999e7f7a04'},'target_binding_base':{'config_digest':config,'route_digest':route,'customer_identity_digest':customer,'card_slot':slot},'service_preparation':{'mode':'disposable'},'maintenance_scope':scope.model_dump(mode='json',by_alias=True),'maintenance_scope_path':'maintenance/maintenance-scope.json','maintenance_scope_file_sha256':h(scope_b),'maintenance_scope_digest':h(canonical_json(scope.model_dump(mode='json',by_alias=True))),'no_send_oracle':oracle,'no_send_oracle_path':'maintenance/no-send-oracle.json','no_send_oracle_file_sha256':h(oracle_b),'diagnosed_blocker_evidence':[]});a=derive_r71b_package(binding,scope);m=p/'maintenance';m.mkdir();files={m/'maintenance-scope.json':scope_b,m/'no-send-oracle.json':oracle_b,m/'package-binding-inputs.json':a.binding_inputs_bytes,p/'maintenance-authority.json':a.authority_bytes,p/'permission-package.json':a.permission_package_bytes};[x.write_bytes(b) for x,b in files.items()];re=verify_r71b_package_derivation(a.binding_inputs_bytes,scope_b,a.authority_bytes,a.permission_package_bytes);assert package_binding_digest(binding)==re.package_binding_digest and final_package_digest(re.final_payload)==re.final_package_digest;target={'candidate_digest':cd,'config_digest':config,'route_digest':route,'customer_identity_digest':customer,'card_slot':slot,'kst_day':'2026-09-02','not_before':'2026-09-02T02:00:00+09:00','expires_at':'2026-09-02T02:30:00+09:00','package_binding_digest':re.package_binding_digest,'final_package_digest':re.final_package_digest,'hold_id':re.hold.hold_id,'hold_sha256':re.hold_sha256,'authority_sha256':re.authority_sha256};(p/'sealed-target.json').write_bytes(canonical_json(A.validate_python(target))+b'\n');entries={x.relative_to(p).as_posix():h(x.read_bytes()) for x in p.rglob('*') if x.is_file()};(p/'package-manifest.json').write_bytes(canonical_json(A.validate_python({'entries':entries}))+b'\n');report={'status':'PASS',**target,'window':{'kst_day':'2026-09-02','not_before':'2026-09-02T02:00:00+09:00','expires_at':'2026-09-02T02:30:00+09:00','hidden_current_time_defaults':False,'before_daily_0800':True,'outside_reminder_cutoff':True},'oracle':oracle,'source_closure_count':len(closure),'independent_replay':True,'credential_manifest_verified':True,'target_manifest_verified':True,'package_manifest_entries':len(entries)};(r/'preseal-replay.json').write_text(json.dumps(report,sort_keys=True)+'\n');print(json.dumps(report,sort_keys=True))
PY

### LINE 193
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && .venv/bin/ruff check scripts/nutricoach_v150_candidate_wheel_sources.py scripts/verify_nutricoach_v150_candidate.py scripts/verify_nutricoach_v150_candidate_inputs.py tests/test_nutricoach_v150_v15_closure.py && PYTHONPATH="$PWD/dualcoach/profile" .venv/bin/ty check scripts/nutricoach_v150_candidate_wheel_sources.py scripts/verify_nutricoach_v150_candidate.py scripts/verify_nutricoach_v150_candidate_inputs.py tests/test_nutricoach_v150_v15_closure.py && PYTHONPATH="$PWD/dualcoach/profile" basedpyright scripts/nutricoach_v150_candidate_wheel_sources.py scripts/verify_nutricoach_v150_candidate.py scripts/verify_nutricoach_v150_candidate_inputs.py tests/test_nutricoach_v150_v15_closure.py && .venv/bin/python /projects/richard/omo-native-pirate/packages/omo-senpi/plugin/skills/programming/scripts/python/check-no-excuse-rules.py scripts/nutricoach_v150_candidate_wheel_sources.py scripts/verify_nutricoach_v150_candidate.py scripts/verify_nutricoach_v150_candidate_inputs.py tests/test_nutricoach_v150_v15_closure.py

### LINE 193
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" .venv/bin/pytest -q tests/test_nutricoach_v150_v15_closure.py tests/test_verify_nutricoach_v150_candidate.py tests/test_nutricoach_v150_r71b_package_digest.py

### LINE 197
set -euo pipefail
ROOT=$(cat /tmp/r71b-package-st_01a05c97.root); WT='/home/cube/projects/richard/.worktrees/nutricoach-v150-combined'; OUT='/home/cube/projects/richard/traning coach/.omo/evidence/nutricoach-telegram-checkin-stepper/task-10-r71b-disposable-package.json'
cd "$WT"
python - <<'PY' "$ROOT" "$OUT"
import hashlib,json,os,stat,sys
from pathlib import Path
root,out=map(Path,sys.argv[1:]);sha=lambda p:hashlib.sha256(Path(p).read_bytes()).hexdigest();pre=json.loads((root/'preseal-replay.json').read_text());manual=json.loads((root/'installed-manual-oracle.json').read_text());baseline=json.loads((root/'baseline-r71.json').read_text())
def tree(r):
 rows=[]
 for p in sorted(Path(r).rglob('*')):
  s=p.stat(follow_symlinks=False);rel=p.relative_to(r).as_posix();m=stat.S_IMODE(s.st_mode)
  if stat.S_ISREG(s.st_mode):rows.append(f'F {m:o} {rel} {sha(p)}')
  elif stat.S_ISDIR(s.st_mode):rows.append(f'D {m:o} {rel}')
  elif stat.S_ISLNK(s.st_mode):rows.append(f'L {m:o} {rel} {os.readlink(p)}')
 return hashlib.sha256('\n'.join(rows).encode()).hexdigest(),len(rows)
after={r:{'tree_sha256':tree(r)[0],'entries':tree(r)[1]} for r in baseline};old_equal=after==baseline
sources=['scripts/nutricoach_v150_candidate_wheel_sources.py','scripts/verify_nutricoach_v150_candidate.py','scripts/verify_nutricoach_v150_candidate_inputs.py','tests/test_nutricoach_v150_v15_closure.py']
source_map={p:sha(p) for p in sources}
report={'schema':'nutricoach-telegram-checkin-stepper-task-10-r71b-disposable-package-v1','task_id':'st_01a05c97','status':'DISPOSABLE_PACKAGE_PASS','scope':'disposable-only full qualification; no authoritative seal','worktree':str(Path.cwd()),'maintenance_binding':pre['window'],'source_defect_fixed':{'defect':'candidate overlay omitted imported nutrition_weekly_dispatch_result.py and wheel verifier did not cover all wheel-hosted maintenance sources','red':'test_successor_overlay_contains_every_maintenance_runtime_import failed on omitted dispatch result','fix':'overlay closure added the source; wheel/source and physical-inventory checks split into a 65-pure-LOC verifier module and now verify every wheel-hosted Python source with a repository counterpart','source_sha256':source_map,'pure_loc':{'candidate_wheel_sources':65,'candidate_verifier':236,'candidate_inputs':177,'closure_test':242}},'wheels':{'source_date_epoch':1704067200,'hermes_sha256':'f8a205c29e877b5740b9460c80cb82045c04445bb2c1ce139118497efa5bc2b1','profile_sha256':'e6c1fd77251cf43f8bde1759b9fb170e592e47851708c292297d3040b1d4f84f','a_b_byte_identical':True,'hermes_members':1049,'profile_members':123,'hermes_record_sha256':'31edcb1ffb522e8380fda3eece0aae6523b5f3327675827b021d9c4008ecfe1f','profile_record_sha256':'8b823301c800c28959f8ed7d3d46ae6a66dcaf7128991823913a910030fb9b83','zip_crc_record_member_source_overlay_parity':True,'ambient_build_dist_cache_venv_excluded':True},'candidate':{'mode':'DISPOSABLE','candidate_digest':pre['candidate_digest'],'source_count':381,'canonical_verifier':'PASS','task10_evidence_count':3,'task10_digests':['968a3ea4e15d149736d47c239d410ed9b88b7dbb20e0703214a2a6b19c3025d0','5f367a44f23dfa072ea1a1bb4fbdb9e216e8c832fbcc608157ad0624de4541a9','b1bbe2fec619d66570b5025d7760878ae3f0421825c50b19630065fbf8963f13'],'rejections':{'tamper_matrix':18,'candidate_evidence_and_omission':27,'old_approval_before_reservation':True,'consistent_rewrite':True}},'preseal':pre,'rehearsal':{'status':'PASS','case_count':13,'cases':['success','stop','post_stop_snapshot','stopped_probe','install_exact_wheels','off_smoke_channel_inbox_off','capacity_dry_run','weekly_and_capacity_apply','weekly_startup_smoke','switch_unit_dropin','reload','start','post_fence'],'new_phase_fault_recovery_coverage':{'installed_sealed_suite':74,'source_controller_suite':129,'actual_disposable_execute':'COMMITTED','preconfirm_safe_paused_rollback_service_running':True,'fresh_host_rollforward_real_post_fence':'COMMITTED'},'external_events':0},'installed_qa':{'pythonpath':'','sealed_controller_safety_adversarial_closure_observer_passed':74,'maintenance_runtime_passed':61,'manual_oracle':manual,'record_and_import_origins_verified':True,'socket_guard_before_product_imports':True},'source_suites':{'maintenance':238,'controller_package':129,'focused_final':39,'candidate_attack_selection':27},'quality':{'ruff':'PASS','ty':'PASS','basedpyright':'PASS 0 errors 0 warnings 0 notes','compile_import':'PASS','no_excuse':'PASS','lsp':{'new_helper':'PASS','candidate_inputs':'PASS','closure_test':'PASS','candidate_verifier':'persistent-server stale missing-new-module diagnostic; fresh basedpyright PASS'}},'known_r70_exception':{'job_id':'6e042d5dff68','error':'weekly operations failed: canonical authority identity drift','evidence_sha256':'968a3ea4e15d149736d47c239d410ed9b88b7dbb20e0703214a2a6b19c3025d0','exact_fingerprint_only':True},'immutable_r71':{'before':baseline,'after':after,'equal':old_equal},'forbidden_effects':{'git_or_github':0,'network_provider':0,'customer_actions':0,'live_profile_service':0,'authoritative_roots_created':0,'commits':0},'nonqualifying_setup_attempts':{'count':3,'reason':'installed-suite harness initially lacked complete frozen source dependencies; corrected by using the clean build input copy; no product/source/live mutation from those attempts'},'cleanup':{'disposable_root_removed':False,'venvs_faults_caches_bytecode_removed':False,'authoritative_absence_verified':False}}
assert old_equal
out.parent.mkdir(parents=True,exist_ok=True);out.write_text(json.dumps(report,ensure_ascii=True,sort_keys=True,indent=2)+'\n')
print(sha(out))
PY
# remove all disposable material and local bytecode/cache generated by qualification
chmod -R u+w "$ROOT" 2>/dev/null || true
rm -rf "$ROOT" /tmp/r71b-package-st_01a05c97.root
find "$WT/scripts" "$WT/tests" -type d -name __pycache__ -prune -exec rm -rf {} +
find "$WT" -maxdepth 2 -type d \( -name '.pytest_cache' -o -name '.pytest-cache' -o -name '.ruff_cache' \) -prune -exec rm -rf {} +
python - <<'PY' "$OUT"
import json,sys
from pathlib import Path
p=Path(sys.argv[1]);d=json.loads(p.read_text());roots=[
'/home/cube/projects/richard/traning coach/.omo/evidence/nutricoach-v150-combined/task-v15r71b-maintenance-candidate','/home/cube/.hermes/migrations/nutricoach-v1.5.0-combined/live-transaction-preseal-v15-runtime-authority-r71b-maintenance','/home/cube/.hermes/migrations/nutricoach-v1.5.0-combined/preflight-v15-runtime-authority-r71b-maintenance','/home/cube/.hermes/migrations/nutricoach-v1.5.0-combined/live-authorization-v15/nutricoach-v150-v15-runtime-authority-r71b-maintenance','/home/cube/.hermes/migrations/nutricoach-v1.5.0-combined/live-executions-v15/nutricoach-v150-v15-runtime-authority-r71b-maintenance','/home/cube/projects/richard/traning coach/.omo/evidence/nutricoach-v150-combined/task-v15r71b-maintenance-rehearsal','/home/cube/.hermes/migrations/nutricoach-v1.5.0-combined/observer-r71','/home/cube/.hermes/profiles/dualcoachtest/data/topic59-maintenance-r71b']
absence={r:not Path(r).exists() and not Path(r).is_symlink() for r in roots};assert all(absence.values());d['cleanup']={'disposable_root_removed':True,'venvs_faults_caches_bytecode_removed':True,'authoritative_absence_verified':True,'authoritative_roots':absence,'remaining_named_tmp_roots':[]};p.write_text(json.dumps(d,ensure_ascii=True,sort_keys=True,indent=2)+'\n')
PY
sha256sum "$OUT"

### LINE 199
test ! -e /tmp/r71b-package-st_01a05c97.root && ! find /tmp -maxdepth 1 -name 'r71b-package-st_01a05c97.*' -print -quit | grep -q . && echo DISPOSABLE_TMP_ABSENT; find '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined/scripts' '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined/tests' -type f \( -name '*.pyc' -o -name '*.pyo' \) -print -quit | grep -q . && echo BYTECODE_PRESENT || echo BYTECODE_ABSENT; python - <<'PY'
import json
from pathlib import Path
p=Path('/home/cube/projects/richard/traning coach/.omo/evidence/nutricoach-telegram-checkin-stepper/task-10-r71b-disposable-package.json');d=json.loads(p.read_text());print(d['status'],d['cleanup']['authoritative_absence_verified'],d['immutable_r71']['equal'])
PY

[Showing lines 506-822 of 822 (50.0KB limit). Full output: /home/cube/.cache/senpi/run.1o9Pb8vG/pi-bash-5e415ca32938774c.log]


**Planning receipts root creation**


### LINE 5
pwd && printf '%s\n' '--- PI env ---' && env | sort | grep '^PI_' || true && printf '%s\n' '--- root ---' && find . -maxdepth 2 -mindepth 1 -printf '%y %p\n' | sort | head -300

### LINE 5
find . -type f \( -name '*.py' -o -name 'pyproject.toml' -o -name '*.json' -o -name '*.md' \) | sort | head -500

### LINE 5
find . -maxdepth 5 \( -iname '*r71*' -o -iname '*task-10*' -o -iname '*maintenance*' -o -iname '*package*' \) -print | sort | head -500

### LINE 10
printf '%s\n' '--- top dirs excluding agent noise ---'; find . -maxdepth 1 -mindepth 1 -printf '%f\n' | sort | grep -Ev '^\.(gjc|git)$'; printf '%s\n' '--- manifests ---'; find . -path './.gjc' -prune -o -path './task-12-*' -prune -o -name pyproject.toml -print | sort; printf '%s\n' '--- recent r71b files ---'; find . -path './.gjc' -prune -o -type f -iname '*r71b*' -printf '%TY-%Tm-%Td %TH:%TM:%TS %p\n' | sort

### LINE 18
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && printf '%s\n' '--- layout ---' && find . -maxdepth 2 -mindepth 1 -path './.venv' -prune -o -path './.git' -prune -o -printf '%y %p\n' | sort | head -350 && printf '%s\n' '--- package/rehearsal scripts ---' && find scripts tests -type f \( -iname '*r71b*' -o -iname '*candidate*' -o -iname '*preseal*' -o -iname '*rehears*' -o -iname '*wheel*' -o -iname '*package*' \) | sort

### LINE 18
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && python - <<'PY'
import hashlib,json,pathlib
root=pathlib.Path('.')
receipts=[
pathlib.Path('/home/cube/projects/richard/traning coach/.omo/evidence/nutricoach-telegram-checkin-stepper/task-10-r71b-maintenance-runtime.json'),
pathlib.Path('/home/cube/projects/richard/traning coach/.omo/evidence/nutricoach-telegram-checkin-stepper/task-10-r71b-controller-source.json')]
for receipt in receipts:
 d=json.loads(receipt.read_text())
 print('RECEIPT',receipt.name)
 for section in ('runtime_hashes','source_sha256','test_and_support_hashes','test_sha256'):
  for rel,want in d.get(section,{}).items():
   if rel.startswith('restored/'): rel=rel.removeprefix('restored/')
   p=root/rel
   got=hashlib.sha256(p.read_bytes()).hexdigest() if p.is_file() else 'ABSENT'
   print('OK' if got==want else 'MISMATCH',rel,got,want)
PY

### LINE 18
python - <<'PY'
from pathlib import Path
roots=[
'/home/cube/projects/richard/traning coach/.omo/evidence/nutricoach-v150-combined/task-v15r71b-maintenance-candidate',
'/home/cube/.hermes/migrations/nutricoach-v1.5.0-combined/live-transaction-preseal-v15-runtime-authority-r71b-maintenance',
'/home/cube/.hermes/migrations/nutricoach-v1.5.0-combined/preflight-v15-runtime-authority-r71b-maintenance',
'/home/cube/.hermes/migrations/nutricoach-v1.5.0-combined/live-authorization-v15/nutricoach-v150-v15-runtime-authority-r71b-maintenance',
'/home/cube/.hermes/migrations/nutricoach-v1.5.0-combined/live-executions-v15/nutricoach-v150-v15-runtime-authority-r71b-maintenance',
'/home/cube/projects/richard/traning coach/.omo/evidence/nutricoach-v150-combined/task-v15r71b-maintenance-rehearsal',
'/home/cube/.hermes/migrations/nutricoach-v1.5.0-combined/observer-r71',
'/home/cube/.hermes/profiles/dualcoachtest/data/topic59-maintenance-r71b',
]
for value in roots:
 p=Path(value); print('ABSENT' if not p.exists() and not p.is_symlink() else 'PRESENT',value)
PY
printf '%s\n' '--- matching authoritative paths ---'
find '/home/cube/.hermes/migrations/nutricoach-v1.5.0-combined' '/home/cube/.hermes/profiles/dualcoachtest' -maxdepth 5 -iname '*r71b*' -print 2>/dev/null | sort || true

### LINE 18
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && rg -n "DISPOSABLE_PACKAGE_PASS|disposable|SOURCE_DATE_EPOCH|PACKAGE_BINDING_DIGEST|FINAL_PACKAGE_DIGEST|maintenance-kst-day|external_events|13" scripts tests pyproject.toml dualcoach/profile/pyproject.toml 2>/dev/null | head -600

### LINE 24
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && rg -n "def (main|build|seal|prepare)|ArgumentParser|add_argument|CANDIDATE|PRESEAL|PACKAGE_BINDING|FINAL_PACKAGE|wheel|source_paths|overlay" scripts/nutricoach_v150_r71b_package.py scripts/nutricoach_v150_candidate_cli.py scripts/seal_nutricoach_v150_candidate.py scripts/prepare_nutricoach_v150_v15_preseal.py scripts/rehearse_nutricoach_v150_v15.py scripts/verify_nutricoach_v150_candidate*.py scripts/verify_nutricoach_v150_preseal_v15.py

### LINE 31
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" UV_OFFLINE=1 .venv/bin/pytest -q tests/test_nutricoach_v150_r71b_package_digest.py tests/test_nutricoach_v150_r71b_*.py tests/test_nutricoach_v150_sealed_controller.py tests/test_verify_nutricoach_v150_candidate.py tests/test_nutricoach_v150_v15_closure.py tests/test_nutricoach_v150_v15_safety.py tests/test_nutricoach_v150_v15_authority_adversarial.py

### LINE 31
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && printf '%s\n' '--- pyproject build ---' && rg -n "^\[build-system\]|^name =|^version =|packages|include|exclude|tool.hatch|tool.setuptools" pyproject.toml dualcoach/profile/pyproject.toml setup.py 2>/dev/null && printf '%s\n' '--- old candidate manifest keys ---' && python - <<'PY'
import json,pathlib
p=pathlib.Path('/home/cube/projects/richard/traning coach/.omo/evidence/nutricoach-v150-combined/task-v15r71-candidate-r3/manifest.json')
d=json.loads(p.read_text())
print(json.dumps({k:d[k] for k in d if k not in {'source_inventory'}},indent=2)[:20000])
print('sources',len(d.get('source_inventory',[])))
PY

### LINE 31
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && find '/home/cube/projects/richard/traning coach/.omo/evidence/nutricoach-v150-combined/task-v15r71-candidate-r3' -maxdepth 3 -type f -printf '%P\n' | sort | head -400 && printf '%s\n' '--- r71 candidate receipts ---' && find '/home/cube/projects/richard/traning coach/.omo/evidence/nutricoach-v150-combined/task-v15r71-candidate-r3' -type f \( -iname '*receipt*' -o -iname '*overlay*' -o -iname '*evidence*' \) -print | sort

### LINE 37
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && python - <<'PY'
from scripts.nutricoach_v150_candidate_source_inventory import CANDIDATE_REQUIRED_SOURCE_PATHS
from scripts.verify_nutricoach_v150_candidate_inputs import SUCCESSOR_OVERLAY_PATHS
for p in sorted(set(CANDIDATE_REQUIRED_SOURCE_PATHS)|set(SUCCESSOR_OVERLAY_PATHS)):
 if any(x in p for x in ('maintenance','r71b','observer','scheduler','telegram.py','operations.py','dispatcher.py','physique_inline')): print(p)
print('required',len(CANDIDATE_REQUIRED_SOURCE_PATHS),'overlay',len(SUCCESSOR_OVERLAY_PATHS))
PY
printf '%s\n' '--- source timestamps and hashes changed after receipts ---'; find gateway/platforms cron scripts tests -type f -newermt '2026-09-01 19:43:05' -printf '%TY-%Tm-%Td %TH:%TM:%TS %p\n' | sort | tail -200

### LINE 37
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && find . -path './.git' -prune -o -path './.venv' -prune -o -type f \( -name '*.whl' -o -name 'successor-overlay.sha256' -o -name 'v17-evidence-files.sha256' \) -printf '%p\n' | sort | head -200

### LINE 43
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && rg -n "nutrition_weekly_dispatch_result" . --glob '*.py' --glob '!**/.venv/**' --glob '!**/__pycache__/**' | head -100 && python - <<'PY'
from scripts.verify_nutricoach_v150_candidate_inputs import R71B_MAINTENANCE_OVERLAY_PATHS
expected={
'gateway/platforms/nutrition_weekly_dispatch_result.py',
}
print('missing',expected-set(R71B_MAINTENANCE_OVERLAY_PATHS))
PY

### LINE 43
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && find .omo/evidence/nutricoach-v150-combined/task-1-candidate -maxdepth 2 -type f -printf '%P\n' | sort && python - <<'PY'
import json,pathlib
p=pathlib.Path('.omo/evidence/nutricoach-v150-combined/task-1-candidate/manifest.json')
print(p.exists())
if p.exists():
 d=json.loads(p.read_text()); print(d.get('candidate_digest')); print(d.get('derivation_inputs'))
PY

### LINE 51
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" .venv/bin/pytest -q tests/test_nutricoach_v150_v15_closure.py -k maintenance_runtime_import

### LINE 57
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" .venv/bin/pytest -q tests/test_nutricoach_v150_v15_closure.py tests/test_verify_nutricoach_v150_candidate.py tests/test_nutricoach_v150_r71b_package_digest.py

### LINE 57
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && .venv/bin/ruff check scripts/verify_nutricoach_v150_candidate.py scripts/verify_nutricoach_v150_candidate_inputs.py tests/test_nutricoach_v150_v15_closure.py

### LINE 63
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && du -sh . --exclude=.git --exclude=.venv --exclude=.pytest_cache --exclude=.ruff_cache --exclude=build --exclude=dist && .venv/bin/python - <<'PY'
import build
print(build.__version__)
PY

### LINE 63
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && printf '%s\n' '--- task1 evidence inputs ---' && find .omo/evidence/nutricoach-v150-combined/task-1-candidate -maxdepth 2 -type f -printf '%P %s\n' | sort && printf '%s\n' '--- base manifest location ---' && python - <<'PY'
import json,pathlib
p=pathlib.Path('.omo/evidence/nutricoach-v150-combined/task-1-candidate/inputs/base-manifest.json')
d=json.loads(p.read_text());print(d.keys());print(d.get('identities'));print(len(d.get('source_inventory',[])))
PY

### LINE 63
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && find .omo/evidence/nutricoach-v150-combined/task-1-candidate/receipts -type f -maxdepth 1 -printf '%f\n' | sort && printf '%s\n' '--- hash source mode task10 ---' && stat -c '%a %u %g %h %F %n' '/home/cube/projects/richard/traning coach/.omo/evidence/nutricoach-telegram-checkin-stepper/task-10-cron-no-send-recovery-analysis.json' '/home/cube/projects/richard/traning coach/.omo/evidence/nutricoach-telegram-checkin-stepper/task-10-debug-observer-r70.json' '/home/cube/projects/richard/traning coach/.omo/evidence/nutricoach-telegram-checkin-stepper/task-10-r70-health-recovery.json'

### LINE 67
set -euo pipefail
WT='/home/cube/projects/richard/.worktrees/nutricoach-v150-combined'
ROOT=$(mktemp -d /tmp/r71b-package-st_01a05c97.XXXXXX)
printf '%s\n' "$ROOT" > /tmp/r71b-package-st_01a05c97.root
python - <<'PY' "$ROOT/baseline-r71.json"
import hashlib,json,os,stat,sys
from pathlib import Path
roots=[
Path('/home/cube/projects/richard/traning coach/.omo/evidence/nutricoach-v150-combined/task-v15r71-candidate-r3'),
Path('/home/cube/.hermes/migrations/nutricoach-v1.5.0-combined/live-transaction-preseal-v15-runtime-authority-r71'),
Path('/home/cube/.hermes/migrations/nutricoach-v1.5.0-combined/preflight-v15-runtime-authority-r71'),
Path('/home/cube/projects/richard/traning coach/.omo/evidence/nutricoach-v150-combined/task-v15r71-rehearsal')]
out={}
for root in roots:
 rows=[]
 for p in sorted(root.rglob('*')):
  s=p.stat(follow_symlinks=False); rel=p.relative_to(root).as_posix(); mode=stat.S_IMODE(s.st_mode)
  if stat.S_ISREG(s.st_mode): rows.append(f'F {mode:o} {rel} {hashlib.sha256(p.read_bytes()).hexdigest()}')
  elif stat.S_ISDIR(s.st_mode): rows.append(f'D {mode:o} {rel}')
  elif stat.S_ISLNK(s.st_mode): rows.append(f'L {mode:o} {rel} {os.readlink(p)}')
 payload='\n'.join(rows).encode();out[str(root)]={'tree_sha256':hashlib.sha256(payload).hexdigest(),'entries':len(rows)}
Path(sys.argv[1]).write_text(json.dumps(out,sort_keys=True)+'\n')
PY
for B in a b; do
  mkdir -p "$ROOT/build-$B/input" "$ROOT/build-$B/out-hermes" "$ROOT/build-$B/out-profile"
  rsync -a --delete \
    --exclude='/.git/' --exclude='/.omo/' --exclude='/.venv/' \
    --exclude='/.pytest_cache/' --exclude='/.pytest-cache/' --exclude='/.ruff_cache/' \
    --exclude='/build/' --exclude='/dist/' --exclude='/*.egg-info/' \
    --exclude='__pycache__/' --exclude='*.pyc' --exclude='*.pyo' \
    --exclude='/task-12-independent-verification-*' \
    "$WT/" "$ROOT/build-$B/input/"
  find "$ROOT/build-$B/input" -type d \( -name build -o -name dist -o -name __pycache__ -o -name .pytest_cache -o -name .ruff_cache -o -name .venv \) -print -quit | grep -q . && { echo ambient-dir; exit 1; } || true
  find "$ROOT/build-$B/input" -type f \( -name '*.pyc' -o -name '*.pyo' -o -name '*.whl' \) -print -quit | grep -q . && { echo ambient-file; exit 1; } || true
  (cd "$ROOT/build-$B/input" && SOURCE_DATE_EPOCH=1704067200 PYTHONDONTWRITEBYTECODE=1 UV_OFFLINE=1 "$WT/.venv/bin/python" -m build --wheel --no-isolation --outdir "$ROOT/build-$B/out-hermes")
  (cd "$ROOT/build-$B/input/dualcoach/profile" && SOURCE_DATE_EPOCH=1704067200 PYTHONDONTWRITEBYTECODE=1 UV_OFFLINE=1 "$WT/.venv/bin/python" -m build --wheel --no-isolation --outdir "$ROOT/build-$B/out-profile")
done
printf '%s\n' '--- BUILT ---'
find "$ROOT" -type f -name '*.whl' -exec sha256sum {} + | sort

### LINE 69
ROOT=$(cat /tmp/r71b-package-st_01a05c97.root); find "$ROOT/build-a/input" -type d \( -name build -o -name dist -o -name __pycache__ -o -name .pytest_cache -o -name .ruff_cache -o -name .venv \) -print | head -30; chmod -R u+w "$ROOT"; rm -rf "$ROOT" /tmp/r71b-package-st_01a05c97.root

### LINE 71
set -euo pipefail
WT='/home/cube/projects/richard/.worktrees/nutricoach-v150-combined'
ROOT=$(mktemp -d /tmp/r71b-package-st_01a05c97.XXXXXX)
printf '%s\n' "$ROOT" > /tmp/r71b-package-st_01a05c97.root
python - <<'PY' "$ROOT/baseline-r71.json"
import hashlib,json,os,stat,sys
from pathlib import Path
roots=[Path('/home/cube/projects/richard/traning coach/.omo/evidence/nutricoach-v150-combined/task-v15r71-candidate-r3'),Path('/home/cube/.hermes/migrations/nutricoach-v1.5.0-combined/live-transaction-preseal-v15-runtime-authority-r71'),Path('/home/cube/.hermes/migrations/nutricoach-v1.5.0-combined/preflight-v15-runtime-authority-r71'),Path('/home/cube/projects/richard/traning coach/.omo/evidence/nutricoach-v150-combined/task-v15r71-rehearsal')]
out={}
for root in roots:
 rows=[]
 for p in sorted(root.rglob('*')):
  s=p.stat(follow_symlinks=False); rel=p.relative_to(root).as_posix(); mode=stat.S_IMODE(s.st_mode)
  if stat.S_ISREG(s.st_mode): rows.append(f'F {mode:o} {rel} {hashlib.sha256(p.read_bytes()).hexdigest()}')
  elif stat.S_ISDIR(s.st_mode): rows.append(f'D {mode:o} {rel}')
  elif stat.S_ISLNK(s.st_mode): rows.append(f'L {mode:o} {rel} {os.readlink(p)}')
 out[str(root)]={'tree_sha256':hashlib.sha256('\n'.join(rows).encode()).hexdigest(),'entries':len(rows)}
Path(sys.argv[1]).write_text(json.dumps(out,sort_keys=True)+'\n')
PY
for B in a b; do
  mkdir -p "$ROOT/build-$B/input" "$ROOT/build-$B/out-hermes" "$ROOT/build-$B/out-profile"
  rsync -a --delete \
    --exclude='.git/' --exclude='.omo/' --exclude='.venv/' \
    --exclude='.pytest_cache/' --exclude='.pytest-cache/' --exclude='.ruff_cache/' \
    --exclude='build/' --exclude='dist/' --exclude='*.egg-info/' \
    --exclude='__pycache__/' --exclude='*.pyc' --exclude='*.pyo' --exclude='*.whl' \
    --exclude='task-12-independent-verification-*' \
    "$WT/" "$ROOT/build-$B/input/"
  find "$ROOT/build-$B/input" -type d \( -name build -o -name dist -o -name __pycache__ -o -name .pytest_cache -o -name .ruff_cache -o -name .venv \) -print -quit | grep -q . && { echo ambient-dir; exit 1; } || true
  find "$ROOT/build-$B/input" -type f \( -name '*.pyc' -o -name '*.pyo' -o -name '*.whl' \) -print -quit | grep -q . && { echo ambient-file; exit 1; } || true
  (cd "$ROOT/build-$B/input" && SOURCE_DATE_EPOCH=1704067200 PYTHONDONTWRITEBYTECODE=1 UV_OFFLINE=1 "$WT/.venv/bin/python" -m build --wheel --no-isolation --outdir "$ROOT/build-$B/out-hermes" >/dev/null)
  (cd "$ROOT/build-$B/input/dualcoach/profile" && SOURCE_DATE_EPOCH=1704067200 PYTHONDONTWRITEBYTECODE=1 UV_OFFLINE=1 "$WT/.venv/bin/python" -m build --wheel --no-isolation --outdir "$ROOT/build-$B/out-profile" >/dev/null)
done
printf '%s\n' '--- BUILT ---'
find "$ROOT" -type f -name '*.whl' -exec sha256sum {} + | sort

### LINE 73
uv build --help | head -80; command -v uv; cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && .venv/bin/python - <<'PY'
import setuptools,wheel
print(setuptools.__version__,wheel.__version__)
PY

### LINE 75
uv build --help | grep -n -E 'isolation|offline|cache' | head -30

### LINE 77
set -euo pipefail
WT='/home/cube/projects/richard/.worktrees/nutricoach-v150-combined'
ROOT=$(cat /tmp/r71b-package-st_01a05c97.root)
for B in a b; do
  rm -rf "$ROOT/build-$B/out-hermes" "$ROOT/build-$B/out-profile"
  mkdir -p "$ROOT/build-$B/out-hermes" "$ROOT/build-$B/out-profile"
  SOURCE_DATE_EPOCH=1704067200 PYTHONDONTWRITEBYTECODE=1 UV_OFFLINE=1 uv build --offline --no-build-isolation --no-build-logs --no-create-gitignore --wheel --python "$WT/.venv/bin/python" --out-dir "$ROOT/build-$B/out-hermes" "$ROOT/build-$B/input" >/dev/null
  SOURCE_DATE_EPOCH=1704067200 PYTHONDONTWRITEBYTECODE=1 UV_OFFLINE=1 uv build --offline --no-build-isolation --no-build-logs --no-create-gitignore --wheel --python "$WT/.venv/bin/python" --out-dir "$ROOT/build-$B/out-profile" "$ROOT/build-$B/input/dualcoach/profile" >/dev/null
done
find "$ROOT" -type f -name '*.whl' -exec sha256sum {} + | sort

### LINE 79
set -euo pipefail
WT='/home/cube/projects/richard/.worktrees/nutricoach-v150-combined'; ROOT=$(cat /tmp/r71b-package-st_01a05c97.root)
mkdir -p "$ROOT/build-b/input" "$ROOT/build-b/out-hermes" "$ROOT/build-b/out-profile"
rsync -a --delete --exclude='.git/' --exclude='.omo/' --exclude='.venv/' --exclude='.pytest_cache/' --exclude='.pytest-cache/' --exclude='.ruff_cache/' --exclude='build/' --exclude='dist/' --exclude='*.egg-info/' --exclude='__pycache__/' --exclude='*.pyc' --exclude='*.pyo' --exclude='*.whl' --exclude='task-12-independent-verification-*' "$WT/" "$ROOT/build-b/input/"
SOURCE_DATE_EPOCH=1704067200 PYTHONDONTWRITEBYTECODE=1 UV_OFFLINE=1 uv build --offline --no-build-isolation --no-build-logs --no-create-gitignore --wheel --python "$WT/.venv/bin/python" --out-dir "$ROOT/build-b/out-hermes" "$ROOT/build-b/input" >/dev/null
SOURCE_DATE_EPOCH=1704067200 PYTHONDONTWRITEBYTECODE=1 UV_OFFLINE=1 uv build --offline --no-build-isolation --no-build-logs --no-create-gitignore --wheel --python "$WT/.venv/bin/python" --out-dir "$ROOT/build-b/out-profile" "$ROOT/build-b/input/dualcoach/profile" >/dev/null
find "$ROOT" -type f -name '*.whl' -exec sha256sum {} + | sort

### LINE 83
set -euo pipefail
WT='/home/cube/projects/richard/.worktrees/nutricoach-v150-combined'; ROOT=$(cat /tmp/r71b-package-st_01a05c97.root)
H1="$ROOT/build-a/out-hermes/hermes_agent-0.17.0-py3-none-any.whl"; H2="$ROOT/build-b/out-hermes/hermes_agent-0.17.0-py3-none-any.whl"; P1="$ROOT/build-a/out-profile/physique_checkin_cli-0.1.0-py3-none-any.whl"; P2="$ROOT/build-b/out-profile/physique_checkin_cli-0.1.0-py3-none-any.whl"
cd "$WT"
PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" .venv/bin/python - "$ROOT" "$H1" "$P1" "$H2" "$P2" <<'PY'
import base64,csv,hashlib,json,sys,zipfile
from pathlib import Path
from scripts.verify_nutricoach_v150_candidate_inputs import R71B_MAINTENANCE_OVERLAY_PATHS
root,h1,p1,h2,p2=map(Path,sys.argv[1:]); source=Path.cwd()
def sha(b): return hashlib.sha256(b).hexdigest()
def verify_record(path):
 with zipfile.ZipFile(path) as z:
  bad=z.testzip()
  assert bad is None,bad
  names=z.namelist(); assert len(names)==len(set(names))
  rec=next(n for n in names if n.endswith('.dist-info/RECORD'))
  rows=list(csv.reader(z.read(rec).decode().splitlines())); listed={r[0] for r in rows}
  assert listed==set(names)
  for name,digest,size in rows:
   if name==rec: assert digest=='' and size==''; continue
   data=z.read(name); assert int(size)==len(data)
   alg,encoded=digest.split('=',1); assert alg=='sha256'
   assert base64.urlsafe_b64encode(hashlib.sha256(data).digest()).rstrip(b'=').decode()==encoded
  return {'sha256':sha(path.read_bytes()),'members':len(names),'record_sha256':sha(z.read(rec))}
def metadata(path):
 with zipfile.ZipFile(path) as z: return [(i.filename,i.CRC,i.file_size,i.compress_size,i.date_time,i.external_attr) for i in z.infolist()]
assert h1.read_bytes()==h2.read_bytes() and p1.read_bytes()==p2.read_bytes()
assert metadata(h1)==metadata(h2) and metadata(p1)==metadata(p2)
wheel_by_source={}
with zipfile.ZipFile(h1) as hz,zipfile.ZipFile(p1) as pz:
 for rel in sorted(R71B_MAINTENANCE_OVERLAY_PATHS):
  src=source/rel
  assert src.is_file(),rel
  if rel.startswith(('gateway/','cron/')):
   assert hz.read(rel)==src.read_bytes(),rel
   wheel_by_source[rel]='hermes'
  elif rel.startswith('dualcoach/profile/'):
   member=rel.removeprefix('dualcoach/profile/')
   assert pz.read(member)==src.read_bytes(),rel
   wheel_by_source[rel]='profile'
report={'schema':'r71b-disposable-wheel-verification-v1','source_date_epoch':1704067200,'byte_identical':True,'zip_metadata_identical':True,'hermes':verify_record(h1),'profile':verify_record(p1),'wheel_source_parity':wheel_by_source,'wheel_source_parity_count':len(wheel_by_source)}
(root/'wheel-verification.json').write_text(json.dumps(report,sort_keys=True)+'\n')
(root/'successor-overlay.sha256').write_text(''.join(f'{sha((source/p).read_bytes())}  {p}\n' for p in sorted(R71B_MAINTENANCE_OVERLAY_PATHS)))
print(json.dumps(report,sort_keys=True))
PY
mkdir -p "$ROOT/candidate-receipts"
python - <<'PY' "$ROOT/candidate-receipts/authority-verification.json" "$H1" "$P1"
import hashlib,json,sys
from pathlib import Path
sha=lambda p:hashlib.sha256(Path(p).read_bytes()).hexdigest()
d={'schema':'nutricoach-v150-r71b-disposable-authority-verification-v1','status':'PASS','external_events':0,'wheel_builds':{'reproducible':True,'hermes_sha256':sha(sys.argv[2]),'profile_sha256':sha(sys.argv[3])}}
Path(sys.argv[1]).write_text(json.dumps(d,sort_keys=True,separators=(',',':'))+'\n')
PY

### LINE 85
set -euo pipefail
WT='/home/cube/projects/richard/.worktrees/nutricoach-v150-combined'; ROOT=$(cat /tmp/r71b-package-st_01a05c97.root); cd "$WT"
BASE="$WT/.omo/evidence/nutricoach-v150-combined/task-1-candidate/inputs/base-manifest.json"
V17="$WT/.omo/evidence/nutricoach-v150-combined/task-1-candidate"
H1="$ROOT/build-a/out-hermes/hermes_agent-0.17.0-py3-none-any.whl"; H2="$ROOT/build-b/out-hermes/hermes_agent-0.17.0-py3-none-any.whl"; P1="$ROOT/build-a/out-profile/physique_checkin_cli-0.1.0-py3-none-any.whl"; P2="$ROOT/build-b/out-profile/physique_checkin_cli-0.1.0-py3-none-any.whl"
E='/home/cube/projects/richard/traning coach/.omo/evidence/nutricoach-telegram-checkin-stepper'
PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" UV_OFFLINE=1 .venv/bin/python -B scripts/seal_nutricoach_v150_candidate.py \
 --base "$BASE" --v17-evidence "$V17" --successor "$ROOT/candidate" \
 --build-1-hermes "$H1" --build-1-profile "$P1" --build-2-hermes "$H2" --build-2-profile "$P2" \
 --receipts-root "$ROOT/candidate-receipts" --successor-overlay "$ROOT/successor-overlay.sha256" \
 --r70-error-evidence "$E/task-10-cron-no-send-recovery-analysis.json" \
 --observer-evidence "$E/task-10-debug-observer-r70.json" \
 --fixed-collector-evidence "$E/task-10-r70-health-recovery.json" | tee "$ROOT/candidate-seal.out"
PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" UV_OFFLINE=1 .venv/bin/python -B scripts/verify_nutricoach_v150_candidate.py --base "$BASE" --successor "$ROOT/candidate" --manifest "$ROOT/candidate/manifest.json" | tee "$ROOT/candidate-verify.out"
python - <<'PY' "$ROOT/candidate" "$ROOT/candidate-source-parity.json"
import hashlib,json,sys
from pathlib import Path
c,out=map(Path,sys.argv[1:]); src=Path('/home/cube/projects/richard/.worktrees/nutricoach-v150-combined'); d=json.loads((c/'manifest.json').read_text()); rows=d['source_inventory']; mism=[]
for row in rows:
 rel=Path(row['path']).relative_to('snapshot/source'); p=src/rel
 got=hashlib.sha256(p.read_bytes()).hexdigest() if p.is_file() else 'ABSENT'
 if got!=row['sha256']: mism.append(str(rel))
required=[str(Path(r['path']).relative_to('snapshot/source')) for r in rows if any(x in r['path'] for x in ('maintenance','controller','observer','cron_watch','sealed_host','rollback_guard','sealed_target'))]
assert not mism,mism
out.write_text(json.dumps({'schema':'r71b-disposable-candidate-source-parity-v1','source_count':len(rows),'maintenance_controller_observer_count':len(required),'maintenance_controller_observer_sources':sorted(required),'mismatches':mism},sort_keys=True)+'\n')
print('SOURCE_PARITY',len(rows),len(required))
PY

### LINE 87
set -euo pipefail
WT='/home/cube/projects/richard/.worktrees/nutricoach-v150-combined'; ROOT=$(cat /tmp/r71b-package-st_01a05c97.root); cd "$WT"
chmod -R u+w "$ROOT/candidate" && rm -rf "$ROOT/candidate"
PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" .venv/bin/python - "$ROOT/successor-overlay.sha256" <<'PY'
import hashlib,sys
from pathlib import Path
from scripts.verify_nutricoach_v150_candidate_inputs import SUCCESSOR_OVERLAY_PATHS
root=Path.cwd(); out=Path(sys.argv[1]); out.write_text(''.join(f'{hashlib.sha256((root/p).read_bytes()).hexdigest()}  {p}\n' for p in sorted(SUCCESSOR_OVERLAY_PATHS)))
PY
BASE="$WT/.omo/evidence/nutricoach-v150-combined/task-1-candidate/inputs/base-manifest.json"; V17="$WT/.omo/evidence/nutricoach-v150-combined/task-1-candidate"; H1="$ROOT/build-a/out-hermes/hermes_agent-0.17.0-py3-none-any.whl"; H2="$ROOT/build-b/out-hermes/hermes_agent-0.17.0-py3-none-any.whl"; P1="$ROOT/build-a/out-profile/physique_checkin_cli-0.1.0-py3-none-any.whl"; P2="$ROOT/build-b/out-profile/physique_checkin_cli-0.1.0-py3-none-any.whl"; E='/home/cube/projects/richard/traning coach/.omo/evidence/nutricoach-telegram-checkin-stepper'
PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" UV_OFFLINE=1 .venv/bin/python -B scripts/seal_nutricoach_v150_candidate.py --base "$BASE" --v17-evidence "$V17" --successor "$ROOT/candidate" --build-1-hermes "$H1" --build-1-profile "$P1" --build-2-hermes "$H2" --build-2-profile "$P2" --receipts-root "$ROOT/candidate-receipts" --successor-overlay "$ROOT/successor-overlay.sha256" --r70-error-evidence "$E/task-10-cron-no-send-recovery-analysis.json" --observer-evidence "$E/task-10-debug-observer-r70.json" --fixed-collector-evidence "$E/task-10-r70-health-recovery.json" | tee "$ROOT/candidate-seal.out"
PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" UV_OFFLINE=1 .venv/bin/python -B scripts/verify_nutricoach_v150_candidate.py --base "$BASE" --successor "$ROOT/candidate" --manifest "$ROOT/candidate/manifest.json" | tee "$ROOT/candidate-verify.out"
python - <<'PY' "$ROOT/candidate" "$ROOT/candidate-source-parity.json"
import hashlib,json,sys
from pathlib import Path
c,out=map(Path,sys.argv[1:]); src=Path('/home/cube/projects/richard/.worktrees/nutricoach-v150-combined'); d=json.loads((c/'manifest.json').read_text()); rows=d['source_inventory']; mism=[]
for row in rows:
 rel=Path(row['path']).relative_to('snapshot/source'); p=src/rel; got=hashlib.sha256(p.read_bytes()).hexdigest() if p.is_file() else 'ABSENT'
 if got!=row['sha256']: mism.append(str(rel))
required=[str(Path(r['path']).relative_to('snapshot/source')) for r in rows if any(x in r['path'] for x in ('maintenance','controller','observer','cron_watch','sealed_host','rollback_guard','sealed_target'))]
assert not mism,mism
out.write_text(json.dumps({'schema':'r71b-disposable-candidate-source-parity-v1','source_count':len(rows),'maintenance_controller_observer_count':len(required),'maintenance_controller_observer_sources':sorted(required),'mismatches':mism},sort_keys=True)+'\n')
print('SOURCE_PARITY',len(rows),len(required))
PY

### LINE 91
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && rg -n '_V17_' scripts/verify_nutricoach_v150_candidate.py | head -20 && python - <<'PY'
import hashlib,pathlib
for root in [pathlib.Path('.omo/evidence/nutricoach-v150-combined/task-1-candidate'),pathlib.Path('/home/cube/projects/richard/traning coach/.omo/evidence/nutricoach-v150-combined/task-v15r71-candidate-r3')]:
 print(root)
 for f in ('inputs/v17-evidence-files.sha256','inputs/v17-sandbox.diff','inputs/v17-exact-source-set.sha256'):
  p=root/f;print(f,hashlib.sha256(p.read_bytes()).hexdigest())
PY

### LINE 95
set -euo pipefail
WT='/home/cube/projects/richard/.worktrees/nutricoach-v150-combined'; ROOT=$(cat /tmp/r71b-package-st_01a05c97.root); cd "$WT"; chmod -R u+w "$ROOT/candidate" && rm -rf "$ROOT/candidate"
V17='/home/cube/projects/richard/traning coach/.omo/evidence/nutricoach-v150-combined/task-v15r71-candidate-r3'; BASE="$V17/inputs/base-manifest.json"; H1="$ROOT/build-a/out-hermes/hermes_agent-0.17.0-py3-none-any.whl"; H2="$ROOT/build-b/out-hermes/hermes_agent-0.17.0-py3-none-any.whl"; P1="$ROOT/build-a/out-profile/physique_checkin_cli-0.1.0-py3-none-any.whl"; P2="$ROOT/build-b/out-profile/physique_checkin_cli-0.1.0-py3-none-any.whl"; E='/home/cube/projects/richard/traning coach/.omo/evidence/nutricoach-telegram-checkin-stepper'
PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" UV_OFFLINE=1 .venv/bin/python -B scripts/seal_nutricoach_v150_candidate.py --base "$BASE" --v17-evidence "$V17" --successor "$ROOT/candidate" --build-1-hermes "$H1" --build-1-profile "$P1" --build-2-hermes "$H2" --build-2-profile "$P2" --receipts-root "$ROOT/candidate-receipts" --successor-overlay "$ROOT/successor-overlay.sha256" --r70-error-evidence "$E/task-10-cron-no-send-recovery-analysis.json" --observer-evidence "$E/task-10-debug-observer-r70.json" --fixed-collector-evidence "$E/task-10-r70-health-recovery.json" | tee "$ROOT/candidate-seal.out"
PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" UV_OFFLINE=1 .venv/bin/python -B scripts/verify_nutricoach_v150_candidate.py --base "$BASE" --successor "$ROOT/candidate" --manifest "$ROOT/candidate/manifest.json" | tee "$ROOT/candidate-verify.out"
python - <<'PY' "$ROOT/candidate" "$ROOT/candidate-source-parity.json"
import hashlib,json,sys
from pathlib import Path
c,out=map(Path,sys.argv[1:]); src=Path('/home/cube/projects/richard/.worktrees/nutricoach-v150-combined'); d=json.loads((c/'manifest.json').read_text()); rows=d['source_inventory']; mism=[]
for row in rows:
 rel=Path(row['path']).relative_to('snapshot/source'); p=src/rel; got=hashlib.sha256(p.read_bytes()).hexdigest() if p.is_file() else 'ABSENT'
 if got!=row['sha256']: mism.append(str(rel))
required=[str(Path(r['path']).relative_to('snapshot/source')) for r in rows if any(x in r['path'] for x in ('maintenance','controller','observer','cron_watch','sealed_host','rollback_guard','sealed_target'))]
assert not mism,mism
out.write_text(json.dumps({'schema':'r71b-disposable-candidate-source-parity-v1','source_count':len(rows),'maintenance_controller_observer_count':len(required),'maintenance_controller_observer_sources':sorted(required),'mismatches':mism},sort_keys=True)+'\n')
print('SOURCE_PARITY',len(rows),len(required))
PY

### LINE 97
cd '/home/cube/projects/richard/.worktrees/nutricoach-v150-combined' && PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" .venv/bin/pytest -q tests/test_nutricoach_v150_r71b_candidate_evidence.py tests/test_verify_nutricoach_v150_candidate.py tests/test_nutricoach_v150_r71b_package_digest.py tests/test_nutricoach_v150_sealed_controller.py -k 'tamper or omission or old_approval or consistent or evidence or derivation'

### LINE 103
set -euo pipefail
WT='/home/cube/projects/richard/.worktrees/nutricoach-v150-combined'; ROOT=$(cat /tmp/r71b-package-st_01a05c97.root); cd "$WT"
PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$PWD/dualcoach/profile" .venv/bin/python -B - "$ROOT" <<'PY'
import hashlib,json,shutil,stat,sys
from datetime import date,datetime
from pathlib import Path
from pydantic import JsonValue,TypeAdapter
from gateway.platforms.nutrition_weekly_maintenance_contract import Topic59MaintenanceScopeV1,canonical_document,canonical_json,final_package_digest,maintenance_scope_digest,package_binding_digest
from scripts.nutricoach_v150_r71b_preparation import HistoricalSendingRow,MaintenanceWindow,NoSendFacts,SanitizedTopic59Preflight,prepare_r71b_maintenance
from scripts.nutricoach_v150_r71b_package import verify_r71b_package_derivation
from scripts.verify_nutricoach_v150_candidate_inputs import R71B_MAINTENANCE_OVERLAY_PATHS
A=TypeAdapter(dict[str,JsonValue]); root=Path(sys.argv[1]); candidate=root/'candidate'; preseal=root/'preseal'; preseal.mkdir(); source=Path.cwd()
sha=lambda b:hashlib.sha256(b).hexdigest(); cmanifest=json.loads((candidate/'manifest.json').read_text()); cd=cmanifest['candidate_digest']
config_bytes=b'nutricoach-r71b-disposable-successor-config-v1\n'; config=sha(config_bytes); route=sha(b'topic59:fake-host:fake-chat:59'); customer=sha(b'disposable-customer-opaque'); slot=sha(b'2026-09-02:topic59:disposable'); ledger_bytes=b'historical-sending-row-a\nhistorical-sending-row-b\n'; ledger=sha(ledger_bytes)
window=MaintenanceWindow(date(2026,9,2),datetime.fromisoformat('2026-09-02T02:00:00+09:00'),datetime.fromisoformat('2026-09-02T02:30:00+09:00'))
scope=Topic59MaintenanceScopeV1(candidate_digest=cd,config_digest=config,route_digest=route,customer_identity_digest=customer,card_slot=slot,kst_day=window.kst_day,not_before=window.not_before,expires_at=window.expires_at)
preflight=SanitizedTopic59Preflight(candidate_digest=cd,successor_config_digest=config,route_digest=route,customer_identity_digest=customer,card_slot=slot,publication_ledger_sha256=ledger,historical_sending_rows=(HistoricalSendingRow(sha(b'slot-a'),sha(b'row-a')),HistoricalSendingRow(sha(b'slot-b'),sha(b'row-b'))))
facts=NoSendFacts(0,0,0,0,1)
wheels=[]
for p in (root/'build-a/out-hermes/hermes_agent-0.17.0-py3-none-any.whl',root/'build-a/out-profile/physique_checkin_cli-0.1.0-py3-none-any.whl'):
 import zipfile
 with zipfile.ZipFile(p) as z: rec=next(n for n in z.namelist() if n.endswith('/RECORD')); record=sha(z.read(rec))
 wheels.append({'path':str(p),'sha256':sha(p.read_bytes()),'record_sha256':record})
closure={p:sha((source/p).read_bytes()) for p in sorted(R71B_MAINTENANCE_OVERLAY_PATHS)}
seed=A.validate_python({'schema':'nutricoach-v150-r71b-package-binding-inputs-v1','product_generation':'r71','package_namespace':'r71b-maintenance','authority_id':'nutricoach-v150-v15-runtime-authority-r71b-maintenance','paths':{'preseal_root':str(preseal),'observer_root':'observer-r71-disposable-only'},'candidate':{'candidate_digest':cd,'manifest_sha256':sha((candidate/'manifest.json').read_bytes())},'wheels':wheels,'controller':{'files':closure,'derivation_sha256':sha(canonical_json(closure))},'protected_inventory':{'publication_ledger_sha256':ledger,'historical_sending_rows':[{'card_slot':r.card_slot,'entry_digest':r.entry_digest} for r in preflight.historical_sending_rows],'explicit_maintenance_volatile_paths':['data/topic59-maintenance-r71b/hold.json','data/topic59-maintenance-r71b/hold.consuming.json','data/topic59-maintenance-r71b/skip-audit.json','data/topic59-maintenance-r71b/maintenance.lock']},'dependency_snapshot':{'dependency_snapshot_sha256':sha(b'disposable-installed-dependencies')},'authority_baseline':{'candidate_digest':'81a7a06ec2e7a1595784c92ab61df0df7e138d13a2620d9a917e94999e7f7a04','known_cron_error':'weekly operations failed: canonical authority identity drift'},'target_binding_base':{'profile_root':str(root/'fake-profile'),'config_digest':config,'route_digest':route,'customer_identity_digest':customer,'card_slot':slot},'service_preparation':{'mode':'disposable','network_enabled':False},'diagnosed_blocker_evidence':[]})
prepared=prepare_r71b_maintenance(preflight,window,facts,seed); m=preseal/'maintenance'; m.mkdir(); auth=preseal/'maintenance-authority/nutricoach-topic59-maintenance-r71b.json';auth.parent.mkdir()
files={m/'maintenance-scope.json':canonical_document(prepared.scope),m/'no-send-oracle.json':canonical_json(prepared.oracle)+b'\n',m/'package-binding-inputs.json':prepared.artifacts.binding_inputs_bytes,auth:prepared.artifacts.authority_bytes,preseal/'permission-package.json':prepared.artifacts.permission_package_bytes}
for p,b in files.items():p.write_bytes(b)
closure_root=preseal/'source-closure'
for rel in closure:
 d=closure_root/rel;d.parent.mkdir(parents=True,exist_ok=True);shutil.copy2(source/rel,d)
target=A.validate_python({'schema':'nutricoach-v150-r71b-disposable-sealed-target-v1','mode':'DISPOSABLE','authority_id':'nutricoach-v150-v15-runtime-authority-r71b-maintenance','candidate_digest':cd,'config_digest':config,'route_digest':route,'customer_identity_digest':customer,'card_slot':slot,'kst_day':'2026-09-02','not_before':'2026-09-02T02:00:00+09:00','expires_at':'2026-09-02T02:30:00+09:00','package_binding_digest':prepared.artifacts.package_binding_digest,'package_digest':prepared.artifacts.final_package_digest,'approval_phrase':prepared.artifacts.permission_package['approval_phrase'],'maintenance_hold_id':prepared.artifacts.hold.hold_id,'maintenance_hold_sha256':prepared.artifacts.hold_sha256,'maintenance_authority_sha256':prepared.artifacts.authority_sha256,'credential_manifest':{'name':'nutricoach-topic59-maintenance-r71b.json','sha256':prepared.artifacts.authority_sha256,'mode':'0400'},'target_manifest':{'hold_path':'data/topic59-maintenance-r71b/hold.json','hold_sha256':prepared.artifacts.hold_sha256,'publication_ledger_sha256':ledger,'provider_calls':0,'network_calls':0,'customer_actions':0}}); (preseal/'sealed-target.json').write_bytes(canonical_json(target)+b'\n')
entries={p.relative_to(preseal).as_posix():sha(p.read_bytes()) for p in preseal.rglob('*') if p.is_file()}; manifest={'schema':'nutricoach-v150-r71b-disposable-package-manifest-v1','status':'FROZEN_DISPOSABLE','entries':dict(sorted(entries.items()))};(preseal/'package-manifest.json').write_bytes(canonical_json(manifest)+b'\n')
# independent replay from retained exact bytes
replay=verify_r71b_package_derivation((m/'package-binding-inputs.json').read_bytes(),(m/'maintenance-scope.json').read_bytes(),auth.read_bytes(),(preseal/'permission-package.json').read_bytes())
loaded=A.validate_json((m/'package-binding-inputs.json').read_bytes()); assert package_binding_digest(loaded)==replay.package_binding_digest; assert final_package_digest(replay.final_payload)==replay.final_package_digest; assert maintenance_scope_digest(scope)==maintenance_scope_digest(replay.hold.scope)
assert replay.hold.scope==scope and replay.authority.hold==replay.hold and replay.final_package_digest==target['package_digest']; assert prepared.oracle['target_topic59_projection_count']==1 and all(prepared.oracle[k]==0 for k in ('non_topic59_due_send_count','non_topic59_due_edit_count','activation_notice_due_count','owner_delivery_due_count'))
report={'schema':'r71b-disposable-preseal-replay-v1','status':'PASS','window':{'kst_day':'2026-09-02','not_before':'2026-09-02T02:00:00+09:00','expires_at':'2026-09-02T02:30:00+09:00','hidden_current_time_defaults':False,'before_daily_0800':True,'outside_reminder_cutoff':True},'candidate_digest':cd,'config_digest':config,'route_digest':route,'customer_identity_digest':customer,'card_slot':slot,'publication_ledger_sha256':ledger,'package_binding_digest':replay.package_binding_digest,'final_package_digest':replay.final_package_digest,'hold_id':replay.hold.hold_id,'hold_sha256':replay.hold_sha256,'authority_sha256':replay.authority_sha256,'source_closure_count':len(closure),'oracle':prepared.oracle,'credential_manifest_verified':True,'target_manifest_verified':True,'package_manifest_entries':len(entries),'independent_replay':True}
(root/'preseal-replay.json').write_text(json.dumps(report,sort_keys=True)+'\n');print(json.dumps(report,sort_keys=True))
for p in preseal.rglob('*'):
 if p.is_file():p.chmod(0o444)
for p in sorted((p for p in preseal.rglob('*') if p.is_dir()),reverse=True):p.chmod(0o555)
preseal.chmod(0o555)
PY

### LINE 105
set -euo pipefail
WT='/home/cube/projects/richard/.worktrees/nutricoach-v150-combined'; ROOT=$(cat /tmp/r71b-package-st_01a05c97.root); QA="$ROOT/installed-qa"; mkdir -p "$QA"; cd "$QA"
uv venv --system-site-packages --python "$WT/.venv/bin/python" --no-project venv >/dev/null
UV_OFFLINE=1 uv pip install --offline --python venv/bin/python --no-deps "$ROOT/build-a/out-hermes/hermes_agent-0.17.0-py3-none-any.whl" "$ROOT/build-a/out-profile/physique_checkin_cli-0.1.0-py3-none-any.whl" >/dev/null
cp -a "$ROOT/candidate/snapshot/source/scripts" "$QA/scripts"
cp -a "$ROOT/candidate/snapshot/source/tests" "$QA/tests"
SITE=$(venv/bin/python - <<'PY'
import sysconfig
print(sysconfig.get_paths()['purelib'])
PY
)
cat > "$SITE/sitecustomize.py" <<'PY'
import socket
_original_connect = socket.socket.connect
_original_connect_ex = socket.socket.connect_ex

def _blocked_connect(self, address):
    if self.family in (socket.AF_INET, socket.AF_INET6):
        raise RuntimeError("DISPOSABLE_NETWORK_BLOCKED")
    return _original_connect(self, address)

def _blocked_connect_ex(self, address):
    if self.family in (socket.AF_INET, socket.AF_INET6):
        raise RuntimeError("DISPOSABLE_NETWORK_BLOCKED")
    return _original_connect_ex(self, address)

def _blocked_create_connection(*args, **kwargs):
    raise RuntimeError("DISPOSABLE_NETWORK_BLOCKED")

socket.socket.connect = _blocked_connect
socket.socket.connect_ex = _blocked_connect_ex
socket.create_connection = _blocked_create_connection
PY
PYTHONPATH= PYTHONDONTWRITEBYTECODE=1 venv/bin/python -I - <<'PY' > "$ROOT/installed-origins.json"
import csv,hashlib,importlib.metadata,json,pathlib
import cron.scheduler,gateway.platforms.nutrition_weekly_maintenance_contract,checkin_cli
rows={}
for dist_name in ('hermes-agent','physique-checkin-cli'):
 d=importlib.metadata.distribution(dist_name); record=pathlib.Path(d.locate_file(next(f for f in d.files if str(f).endswith('.dist-info/RECORD')))); rows[dist_name]={'version':d.version,'record_sha256':hashlib.sha256(record.read_bytes()).hexdigest(),'record_rows':len(list(csv.reader(record.read_text().splitlines())))}

[313 more lines in file. Use offset=511 to continue.]