Merge commit 'a5d2491204f0604d07bfd1f1c41344a08e6f4835' into HEAD

This commit is contained in:
Agent Control Runner
2026-10-20 19:46:30 +09:00
3 changed files with 12260 additions and 0 deletions
@@ -0,0 +1,48 @@
# P14-03 Runner ゲート:来歴と前提
この文書は、Runner の task contract に入れられない来歴を記録します(contract は `additionalProperties=false` のため)。
## 誰が実装したか
- P14-03 の製品実装は、2026-10-20 に Claude Desktop セッションが `main` 上で直接行いました。
- これは、ユーザーが更新した体制の下での作業です。ユーザーは承認判断も委任しています。
- 該当する commit は次のとおりで、すべて `83b170a4c7176761b0b18d8e9292017d990e80a9` の祖先です。
- `0754f41`: shaft 全体の待ち時間を経路費用に反映
- `a8edd3c`: 保存契約 v2、乗車中の客を籠内で退館させない修正
- `4036434`: 新PID pair suite、UID、policy pin
- `83b170a`: roster のみの suite で見つかった回帰の修正
- この実装は Runner の worker(codex / opencode / agy)が行ったものではありません。
- task contract の `worker: "codex"` は、Runner が今後修正を求めた場合の担当を予約する欄です。過去の実装者を示すものではありません。
## base と、今回の提出差分
- base commit は `e8b3dbe7a40a5fafb4b7e760a59536919c8c9f5a` です。この時点で、`83b170a` の製品 source をすべて含んでいます。base 以降の commit は記録だけで、source は変えていません。
- 今回 Runner に提出する差分は、このディレクトリの3ファイルだけです。製品 source には触れません。
- `verify_p14_03_evidence.py`
- `EVIDENCE_BUNDLE_MANIFEST.json`
- `PROVENANCE.md`
## 外部の前提
前提は Runner 登録済みの task ではないため、`depends_on` には入れていません。代わりに、tracked な記録として verifier で SHA を固定しています。
- P06-01 の受入記録: `execution/p06-01-a06/ACCEPTANCE.json`(`6f471e3f…3484`)
- P14-02 の受入記録: `execution/p14-02-warp/ACCEPTANCE.json`(`ac7bfd6f…7307`)
- 決定 A06・A07・A08: `decisions.json`(`8b7dba98…a068c`)
## 再実行しないもの
次の4つは実行済みで、Runner で再実行はしません。verifier は、既知の SHA に固定したうえで、それぞれの結合を確認します。
| 証拠 | 主な内容 | 固定している SHA |
|---|---|---|
| 正式全回帰 | run `7203a119…`、192/192 suite、22,198 checks | ended `705fb2c1…5f7b` |
| Root の別PID pair | run `9bb640c7…`、5/5 pair | ended `8e23cb61…eb62` |
| 代表性能 r02 | 収集と機能検証は合格、版間比較が成立 | execution `553971f5…9fc1` |
| 独立 Opus の whole-unit レビュー | PASS | 依頼 `0e53d1c1…77cd`、出力 `15046de3…0794` |
## 主張しないこと
- 絶対性能予算は満たしていません。x1 の1分 tick は両版とも約 827 ms で、4 ms の予算を超えています。
- 次のものは未測定です: x3 frame、stall、描画、Windows。
- 代表負荷で、実際の職員が業務用 shaft を使う場面は実施していません。
- 原本88成果のうち完了数は、Runner の final が出るまで21件のままにします。
@@ -0,0 +1,161 @@
#!/usr/bin/env python3
"""P14-03 evidence binding verifier (Runner validation; read-only, no engine).
Binds the already-collected P14-03 evidence to the exact source under
validation without re-running it. Evidence is read from an evidence root
(default: $BUILD_OUTPUT_DIR/p14-03-evidence) that Root populates byte-for-byte
from artifacts/original-completion-2026-10-02/. Every evidence file must match
the tracked EVIDENCE_BUNDLE_MANIFEST.json next to this script, and the key
receipts are pinned to known immutable SHA256 values, so a replaced or
regenerated file is detected even if it carries passed/PASS fields.
Checks:
manifest every listed evidence file present, size and SHA equal
formal pinned input/ended/all-tests SHAs; run passed completely; the
source under validation (tools/run_all_tests.source_refs) equals
the run's selected source map; roster equals the standard roster
of that source; every row passed, its source SHA equals the map,
its raw log SHA equals the bundled log; marker contract and engine
pinned and equal to the tracked contract
pairs pinned ended SHA; protocol, commit, 5/5, 10 distinct PIDs; bound
to the same formal run
perf pinned execution SHA; passed and comparison established; bound to
formal and pair runs; pinned engine/input/probe; each report equals
its execution record and its raw stdout line
review pinned request and output SHAs; output names the request SHA and
states PASS on the candidate
prereqs tracked P06-01 / P14-02 acceptance records and decisions (A06,
A07, A08) pinned
Absolute performance budgets are not asserted (x1 exceeds 4 ms in both
versions; x3/stall/render/Windows unmeasured). Exit 0 only if all hold.
"""
import argparse, hashlib, importlib.util, json, os, sys
from pathlib import Path
sys.dont_write_bytecode = True
HERE = Path(__file__).resolve().parent
CANDIDATE = '83b170a4c7176761b0b18d8e9292017d990e80a9'
FULL, PAIR = 'p14-03-formal-regression-83b170a-r01', 'p14-03-root-owned-pairs-83b170a-r01'
PERF, REVIEW = 'p14-03-representative-perf-r01/run-r02', 'p14-03-whole-unit-review-r01'
PIN = {
'full_input': '5bc9760c0c114a80a3c9e93634e733fc8fa93d4eeea5d8bcfda85d8e4eebd094',
'full_ended': '705fb2c12007bab125548742dc8d9b07918e30cae3a63c7d89e965c43b8b5f7b',
'full_all_tests': '31da4c4672f4321469183996e12fb23064b3772a69e8330052ab3e2ea66044f1',
'pair_ended': '8e23cb61679e35d6ed92e312c8f2b860237170935f1d0ff010196f10b6e5eb62',
'perf_execution': '553971f55635e529b48634ef86ad7d4198c8bafe04d5a6a5ef778a4de0439fc1',
'review_request': '0e53d1c1868caa165cd3df8f56d04821798c2bf2d8cb93d9d3793c5171ba77cd',
'review_output': '15046de363106ece8fdbba2f58e2b701fd6102200e2c22505bddc82d20c70794',
'engine': 'c7cccbf8fb143e34e02fd6521e09be2c2b974f0d5db080b19071c9c570718ccf',
'fixture': 'eb4f770071eb07cd7e136fe54c3f78768cc8de7a4264e62a9af1f06a8f90f9bd',
'probe': '95e5967835cb05ad96e8e6f257689d0bd831792aa9c228c022e3af81448ff76a',
'p06_01_acceptance': '6f471e3f32460758b8a617051a507f780d70b33f254a7910dfada87a8c5c3484',
'p14_02_acceptance': 'ac7bfd6fb88cb8ac8c195c8051ebe22ba95a6a6393342de089aae88fdcc73307',
'decisions': '8b7dba984d5b1cc0091e8faf8fddb2ab357dd79f1bd093eba46c23c2f62a068c',
}
def sha(path):
return hashlib.sha256(Path(path).read_bytes()).hexdigest()
def read(path):
return json.loads(Path(path).read_bytes())
def main():
p = argparse.ArgumentParser(description=__doc__)
p.add_argument('--project-root', type=Path, default=Path('.'))
p.add_argument('--evidence-root', type=Path)
p.add_argument('--json', type=Path)
args = p.parse_args()
root = args.project_root.resolve()
ev = args.evidence_root or (Path(os.environ['BUILD_OUTPUT_DIR']) / 'p14-03-evidence' if os.environ.get('BUILD_OUTPUT_DIR') else None)
checks = []
def check(name, ok, detail=None):
checks.append({'name': name, 'passed': bool(ok), 'detail': detail})
return bool(ok)
def finish():
result = {'candidate': CANDIDATE, 'passed': bool(checks) and all(c['passed'] for c in checks), 'checks': checks,
'absolute_performance_budget_met': False,
'not_measured_or_unmet': ['x1 one-minute wall time exceeds 4 ms in both versions', 'x3 frame', 'main-thread stall',
'rendering', 'Windows', 'real staff use of the service shaft in the representative input']}
text = json.dumps(result, ensure_ascii=False, indent=2)
if args.json:
args.json.write_text(text + '\n')
print(text)
return 0 if result['passed'] else 1
if not check('evidence root provided', ev is not None and Path(ev).is_dir(), str(ev)):
return finish()
ev = Path(ev).resolve()
manifest = read(HERE / 'EVIDENCE_BUNDLE_MANIFEST.json')
bad = [n for n, q in manifest['files'].items() if not (ev / n).is_file() or (ev / n).stat().st_size != q['bytes'] or sha(ev / n) != q['sha256']]
check('every manifest file present and byte-identical', not bad, {'files': len(manifest['files']), 'mismatched': bad[:20]})
for key, rel in [('full_input', FULL + '/runner-input.json'), ('full_ended', FULL + '/runner-ended.json'),
('full_all_tests', FULL + '/all-tests.json'), ('pair_ended', PAIR + '/runner-ended.json'),
('perf_execution', PERF + '/execution.json'), ('review_request', REVIEW + '/REVIEW_REQUEST.md'),
('review_output', REVIEW + '/review-output.md')]:
check('pinned ' + key, (ev / rel).is_file() and sha(ev / rel) == PIN[key] and manifest['files'].get(rel, {}).get('sha256') == PIN[key])
if bad:
return finish()
spec = importlib.util.spec_from_file_location('p1403gate_std', root / 'tools/run_all_tests.py')
std = importlib.util.module_from_spec(spec); spec.loader.exec_module(std)
refs = std.source_refs(root)
source_map = {n: q['sha256'] for n, q in refs.items()}
roster = ['tests/run_tests.gd'] + sorted(n for n in refs if n.startswith('tests/') and n.endswith('.gd') and Path(n).name.startswith('test')
and 'export' not in Path(n).parts and n != 'tests/s0/test_kernel_and_save.gd')
fi, fe, rows = read(ev / FULL / 'runner-input.json'), read(ev / FULL / 'runner-ended.json'), read(ev / FULL / 'all-tests.json')
check('formal run passed completely', fe['passed'] is True and fe['engine_ended'] is True and fe['failed_suites'] == 0
and not fe['remaining_unexecuted_tests'] and not fe['missing_marker_paths'] and not fe['guard_errors']
and not fe['cleanup_errors'] and fi['run_id'] == fe['run_id'] and fe['all_tests_sha256'] == PIN['full_all_tests'],
{'suites': fe['actual_suites'], 'checks': fe['actual_all_roster_checks'], 'run_id': fe['run_id']})
check('source under validation equals the formal selected source map', fi['selected_source_map'] == source_map, {'files': len(source_map)})
check('formal roster equals the standard roster of this source', fi['roster'] == roster and [r['test'] for r in rows] == roster, {'suites': len(roster)})
row_bad = [r['test'] for r in rows if not (r['passed'] and r['source_sha256'] == source_map.get(r['test'])
and (ev / FULL / r['log']).is_file() and sha(ev / FULL / r['log']) == r['log_sha256'])]
check('every formal row passed with source and raw log bound', not row_bad, {'mismatched': row_bad[:20]})
contract = root / 'docs/plans/original-completion-2026-10-02/execution/completion_marker_contracts.json'
check('formal marker contract equals the tracked contract', fi['marker_contract_sha256'] == sha(contract))
check('formal run used the pinned engine', fi['engine_sha256'] == PIN['engine'])
pi, pe = read(ev / PAIR / 'runner-input.json'), read(ev / PAIR / 'runner-ended.json')
pids = pe.get('actual_captured_PIDs', [])
check('Root pair run passed 5/5 with 10 distinct owned PIDs', pe.get('protocol') == 'p14-root-owned-pairs-v1' and pe['passed'] is True
and pe['commit'] == CANDIDATE and len(pe['pairs']) == 5 and all(x['passed'] for x in pe['pairs'])
and len(pids) == 10 and len(set(pids)) == 10 and not pe['guard_errors'] and not pe['cleanup_errors'], {'run_id': pe['run_id']})
check('pair run bound to the same formal run', pi['full_run_end_sha256'] == PIN['full_ended'] and pi['full_run_input_sha256'] == PIN['full_input'])
xe, xr = read(ev / PERF / 'execution.json'), read(ev / PERF / 'readiness.json')
check('perf r02 passed with comparison established', xe['passed'] is True and xe['comparison_established'] is True
and xe['source_and_default_player_unchanged'] is True and not xe['cleanup_errors'] and xe['actual_native'] == 4)
check('perf bound to the same formal and pair runs', xr['full_run_binding']['runner_ended_sha256'] == PIN['full_ended']
and xr['pair_run_binding']['runner_ended_sha256'] == PIN['pair_ended'] and xr['after'] == CANDIDATE)
check('perf used pinned engine, input and probe', xr['engine_sha256'] == PIN['engine'] and xr['fixture_sha256'] == PIN['fixture']
and xr['probe_sha256'] == PIN['probe'])
for phase in [x for x in xe['phases'] if x['phase'] == 'measure']:
variant = phase['variant']
report_path = ev / PERF / variant / 'evidence/report.json'
report = read(report_path)
raw = (ev / PERF / variant / 'measure.stdout.log').read_text()
printed = [l[len('P14_03_PERF_REPORT='):] for l in raw.splitlines() if l.startswith('P14_03_PERF_REPORT=')]
check(variant + ' perf report bound to execution and raw stdout', sha(report_path) == phase['report_sha256']
and len(printed) == 1 and json.loads(printed[0]) == report and report['pid'] == phase['actual_pid']
and report['checks'] > 0 and report['failures'] == 0 and report['input_sha256'] == PIN['fixture'])
review = (ev / REVIEW / 'review-output.md').read_text()
check('independent review names the exact request and states PASS on the candidate',
PIN['review_request'] in review and ('判定: PASS(正確候補 ' + CANDIDATE) in review)
base = root / 'docs/plans/original-completion-2026-10-02'
check('P06-01 acceptance record pinned', sha(base / 'execution/p06-01-a06/ACCEPTANCE.json') == PIN['p06_01_acceptance'])
check('P14-02 acceptance record pinned', sha(base / 'execution/p14-02-warp/ACCEPTANCE.json') == PIN['p14_02_acceptance'])
decisions = read(base / 'decisions.json')
check('decisions A06/A07/A08 present and file pinned', sha(base / 'decisions.json') == PIN['decisions']
and {'A06', 'A07', 'A08'} <= {d['id'] for d in decisions['confirmed']})
return finish()
if __name__ == '__main__':
raise SystemExit(main())