Files
TheTree_mock/docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015/p04-current-acceptance-status.py
T

37 lines
6.3 KiB
Python

import ast,pathlib,json,hashlib,datetime,subprocess
R=pathlib.Path('/Users/korizatou114/Projects/とりにく工房ゲーム制作部');E=R/'docs/plans/original-completion-2026-10-02/execution/p04-01-current-recheck-20261015'
W=pathlib.Path('/Users/korizatou114/Projects/TheTree-managed-worktrees/p04-01/P04-01-implement')
source=(W/'tools/check_p04_order_evidence.py').read_bytes();tree=ast.parse(source);required=next(ast.literal_eval(n.value) for n in tree.body if isinstance(n,ast.Assign) and any(isinstance(t,ast.Name) and t.id=='REQUIRED' for t in n.targets));assert len(required)==15
existing={
'dependency_stop':['ROOT_APPROVED_DEPENDENCY_MIDNIGHT_RESULT.json','ROOT_APPROVED_DEPENDENCY_FORMAL_RESULT.json'],
'shift_completion':['ROOT_APPROVED_SHIFT_CURRENT_RESULT.json'],
'recovery_completion':['ROOT_APPROVED_DEPENDENCY_MIDNIGHT_RESULT.json','ROOT_APPROVED_DEPENDENCY_FORMAL_RESULT.json'],
'same_minute_replay':['ROOT_SAME_MINUTE_RESEND_FORMAL_RESULT.json'],
'paused_midnight':['ROOT_APPROVED_DEPENDENCY_MIDNIGHT_RESULT.json','ROOT_APPROVED_DEPENDENCY_FORMAL_RESULT.json'],
'midnight_settlement':['ROOT_PAID_SHIFT_MIDNIGHT_FORMAL_RESULT.json'],
'save_restore':['ROOT_PAID_SHIFT_MIDNIGHT_FORMAL_RESULT.json','ROOT_SAME_MINUTE_RESEND_FORMAL_RESULT.json']}
missing={
'power_stop':'S1 is staff EV outage evidence; actual running paid service power-stop evidence and applicability still needed.',
'destruction_stop':'Applicable exact-product service destruction boundary raw still needs joining or collection.',
'dependency_stop':'Bind existing exact raw to whole collector and verify target/config/input/environment applicability.',
'shift_completion':'Bind actual1080 phase-order raw to whole collector; do not substitute payroll-only handover.',
'recovery_completion':'Bind dependency recovery one completion/payment to whole collector; staff EV recovery is distinct.',
'same_minute_replay':'Bind actual service request same-minute command raw and typed state invariance to whole collector; this is not settlement recall.',
'closure_release':'D034 paid service queue release + started service continuation needs matching raw; S1 cancelled rescue alone is insufficient.',
'exit_release':'Applicable guest-exit reservation release raw and once-only evidence.',
'patience_release':'Applicable natural patience-expiry reservation release raw and once-only evidence.',
'paused_midnight':'Bind existing same-service/held-reservation/one recovered payment and formal restart raw.',
'midnight_settlement':'S2a: actual sale at1440 + nonzero payroll/upkeep, payroll transaction joined by staff/day to real duty. Existing1442 sale cannot prove1440.',
'midnight_replay':'S2a: actual public advance_to(1440) call while current_minute1440, original and restored state, no duplicate transaction.',
'save_restore':'S2a: formal restore exact1440 sale/settlement state and actual same1440 coordinator recall; existing formal raw is reusable only for its tested scenario.',
'night_staff_absent':'S2b: actual1081 WAITING_FOR_STAFF with zero night staff; distinct scenario from existing staffed18:00.',
'overtime_task':'S2b: interrupt0 task crosses real shift with overtime and real duty recorded once.'}
rows=[]
for name,(domain,authorities,measurements) in required.items():
refs=[]
for f in existing.get(name,[]):
p=E/f;assert p.is_file();b=p.read_bytes();refs.append({'path':str(p.relative_to(R)),'sha256':hashlib.sha256(b).hexdigest()})
rows.append({'condition':name,'domain':domain,'authority_refs':authorities,'required_measurements':measurements,'existing_bounded_evidence':refs,'remaining':missing[name],'whole_condition_accepted':False})
out={'plan_id':'P04-01','updated_at_jst':datetime.datetime.now(datetime.timezone(datetime.timedelta(hours=9))).isoformat(),'state':'in_progress','original_work':'閉店、停電、破壊、退出、課金、シフト交代、00:00決算の順序を明記する。','original_acceptance':'順序境界で停止中課金、二重決算、予約の孤立がない。','denominator':{'packages':30,'original_delivery_units':88,'new_original_units':0,'partial_credit':False},'scope':'Current acceptance map, not acceptance certificate. All15 frozen checker conditions retained verbatim. Bounded raw is not whole acceptance.','dependencies':['P03','original/approved authority and exact target source/input/config/environment bindings','all required raw then mandatory validation then independent whole review then ordinary integration/final'], 'current_worker_submitted':'dd20d5b96cfbd2ae70ce00b6e7587a273077f8b5','required_conditions_source':{'path':str(W/'tools/check_p04_order_evidence.py'),'sha256':hashlib.sha256(source).hexdigest(),'retained_A_untested':True},'conditions':rows,'EV':{'existing_actual_evidence':'execution/p04-01-current-recheck-20261015/ROOT_S1_NATIVE_R02_RESULT.json','raw_source_files':1338,'result':'S1 raw collected: required_items reservation precedes travel; actual paired elevator; total reserve outage; valid safe landing once; no-safe-landing remaining4->4 with same active reservation; actual later release;14formal same-state restores','remaining':'whole collector linkage, original reachability/code applicability, independent whole acceptance','whole_condition_accepted':False},'version_roles':{'registered_base':'deb1bcb2374eb378b840ca345db952bd8572cb6e','execution_origin':'9767b0a28ca8d252520307dbbac60a1d8cfb87ab','product_source_pins':'ROOT_S1_NATIVE_R02_RESULT.json -> exact runner-input/source_before(1338) and source_after','product_content_anchor':'5f6bc11d6bb6e92d22d787989b219fef3a435bc1','actual_final_HEAD_FS_binding':'pending A finalization; current checker partialA is unverified'},'next':'S2a midnight sale/payroll/upkeep/duty + public same1440 settlement recall + formal separate PID restore, code preparation under actual Opus direction','remaining_stages':['S2a','S2b night absence/overtime','S3 missing service boundaries and applicability','all raw dynamic collector','A actual candidate HEAD/tree/FS binding and fixtures','registered whole validation','independent whole review','ordinary integration/final'],'original_unit_completion_credit':0,'historical_initial_audit':'execution/p04-01-current-recheck-20261015/recheck.json'}
(E/'CURRENT_ACCEPTANCE_STATUS.json').write_text(json.dumps(out,ensure_ascii=False,indent=2)+'\n');(E/'p04-current-acceptance-status.py').write_bytes(pathlib.Path(__file__).read_bytes());print('Current map:15 original conditions + EV,0 acceptance credit')