Deliver complete P08 review sources through frozen file references

This commit is contained in:
Takeshi
2026-10-14 09:50:56 +09:00
parent e65d6b8c49
commit 5afa8205bf
2 changed files with 28 additions and 1 deletions
@@ -98,6 +98,25 @@ def packet_with_actual_evidence(self, task_id, role, sha=None):
packet_core.git = actual_git
else:
packet = original_packet(self, task_id, role, sha)
if role == 'reviewer' and self.config['project'] == 'the-tree-p08-03-code' and task_id == 'P08-03':
import hashlib
frozen = Path(os.environ['OWNER_P08_PREPARED_REVIEW'])
prefix, data = packet.split('\nDATA:\n', 1)
body = json.loads(data)
context = frozen / '.owner-review-context'
context.mkdir(exist_ok=True)
manifest = {'candidate': sha, 'complete_sources': {}, 'validation_sources': {}}
for key in ('sources', 'validation_sources'):
for name in body[key]:
path = frozen / name
require(path.is_file() and not path.is_symlink(), 'committed reviewer source available')
raw = path.read_bytes()
manifest['complete_sources' if key == 'sources' else key][name] = {'path': name, 'bytes': len(raw), 'sha256': hashlib.sha256(raw).hexdigest()}
body[key] = {'complete_manifest': '.owner-review-context/source-manifest.json', 'section': 'complete_sources' if key == 'sources' else key, 'instruction': 'Read complete files directly from this frozen checkout; no source omitted or truncated.'}
(context / 'source-manifest.json').write_text(json.dumps(manifest, ensure_ascii=False, indent=2))
(context / 'complete-diff.txt').write_text(body['diff'])
body['diff'] = {'path': '.owner-review-context/complete-diff.txt', 'instruction': 'Read complete candidate diff; all original content preserved.'}
packet = prefix + '\nDATA:\n' + json.dumps(body, ensure_ascii=False)
extra = os.environ.get('OWNER_REVIEW_SUPPLEMENT')
if role == 'reviewer' and extra:
prefix, data = packet.split('\nDATA:\n', 1)
@@ -8,5 +8,13 @@
"acceptance_changed": false,
"final_full_regression": "pending; preflight issues require independent judgment before expensive regression",
"text_compatibility": "preserves original Runner git stdout.strip normalization; registered spec SHA verified unchanged",
"spec_sha256": "7941da4edbd3c43a636a4a3d834d57c095b56da988fa3a056e55b22d3a5d50e9"
"spec_sha256": "7941da4edbd3c43a636a4a3d834d57c095b56da988fa3a056e55b22d3a5d50e9",
"provider_attempt_r02": {
"status": "failed_before_inference",
"reason": "Prompt is too long",
"input_tokens": 0,
"output_tokens": 0,
"run": "b36a14f2e2de4557b4e2a4fc8af0d342"
},
"packet_delivery": "Complete source manifest and full diff file in same frozen checkout; no file or content omitted; reviewer Read/Grep/Glob enabled"
}