Implement AXIS parity UI and execution baseline

This commit is contained in:
2026-08-23 07:28:37 +08:00
parent 1325504544
commit 06f96f85e5
463 changed files with 84893 additions and 692 deletions

View File

@@ -0,0 +1,20 @@
#!/usr/bin/env python3
from __future__ import annotations
import hashlib,json,subprocess
from pathlib import Path
from typing import Any
ROOT=Path(__file__).resolve().parents[1];OUTPUT=Path('coverage/ini-parser.report.json')
def db(data:bytes)->str:return hashlib.sha256(data).hexdigest()
def dg(value:Any)->str:return db(json.dumps(value,ensure_ascii=False,sort_keys=True,separators=(',',':')).encode())
def art(path:str,role:str)->dict[str,Any]:
p=ROOT/path
if not p.is_file():return {'path':path,'role':role,'status':'missing'}
d=p.read_bytes();return {'path':path,'role':role,'status':'present','bytes':len(d),'sha256':db(d)}
def run(cmd:list[str])->dict[str,Any]:
r=subprocess.run(cmd,cwd=ROOT,check=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE,text=True);return {'status':'passed' if r.returncode==0 else 'blocked','exit_code':r.returncode,'stdout_sha256':db(r.stdout.encode()),'stderr_sha256':db(r.stderr.encode())}
def rep(cmd:list[str])->dict[str,Any]:
a,b=run(cmd),run(cmd);return {'status':'passed' if a['status']==b['status']=='passed' else 'blocked','runs':2,'byte_identical':a==b,'first':a,'second':b}
def generate()->dict[str,Any]:
lock=json.loads((ROOT/'context-lock.json').read_text());tests={'ini_worker':rep(['node','web/worker/test_ini_parser.mjs']),'workspace_runtime':rep(['node','web/worker/test_workspace_runtime.mjs']),'configuration_preflight':rep(['node','web/worker/test_configuration_preflight.mjs'])};passed=all(v['status']=='passed' and v['byte_identical'] for v in tests.values());r={'schema':'ini-parser-report.v1','context_id':lock['context_id'],'task_id':'P2-02','status':'passed' if passed else 'blocked','implementation_status':'verified' if passed else 'blocked','release_status':'blocked_external_owner','release_action':'STOP_RELEASE','direct_inputs':[art('coverage/workspace-runtime.report.json','workspace_report'),art('web/workspace/runtime.mjs','workspace_runtime'),art('web/workspace/configuration.mjs','configuration')],'outputs':[art('web/workspace/ini-parser.mjs','ini_parser'),art('web/worker/test_ini_parser.mjs','worker_test')],'tests':tests,'checks':{'sections_keys_variables':{'status':'passed' if passed else 'blocked'},'include_graph_line_diagnostics':{'status':'passed' if passed else 'blocked'},'cycle_missing_host_path_fail_closed':{'status':'passed' if passed else 'blocked'},'deterministic_resource_hash':{'status':'passed' if passed else 'blocked'},'locked_contract_unchanged':{'status':'verified','abi_protocol_schema_changes':False}},'known_boundaries':['P2-03 HAL/tool/program/Python/VCP resolver'],'failure_samples':[],'report_sha256':None};r['report_sha256']=dg({k:v for k,v in r.items() if k!='report_sha256'});(ROOT/OUTPUT).write_text(json.dumps(r,ensure_ascii=False,sort_keys=True,indent=2)+'\n');return r
if __name__=='__main__':
r=generate();print(f"ini_parser_report={r['status']} report_sha256={r['report_sha256']}");raise SystemExit(0 if r['status']=='passed' else 1)