SPB Git

Repository Public Research preview

enroll_wpai0001.py 4.5 KB 35 lines python

1#!/usr/bin/env python32"""Enrol WP-AI-0001 in the UQO-WP-REVIEW pipeline: registry entry, blinded record, status file, constraints.3Computes pages / n_refs / git head at run time. Idempotent (replaces an existing WP-AI-0001 entry)."""4import json, os, re, subprocess, datetime5ROOT=os.path.expanduser('~/Desktop/UQO/Recherche/Recherche-UQO'); REV=f'{ROOT}/UQO-WP-REVIEW'6PID='WP-AI-0001'; PATH='ia/wp-ai-0001'; SRC=f'{ROOT}/{PATH}'7def sh(c): return subprocess.check_output(c,shell=True,text=True).strip()8head=sh(f'git -C {SRC} rev-parse --short HEAD'); dirty=int(sh(f'git -C {SRC} status --porcelain | wc -l'))9pages=int(sh(f'pdfinfo {SRC}/paper/main.pdf | awk \'/^Pages/{{print $2}}\''))10nrefs=len(re.findall(r'^@\w+\{', open(f'{SRC}/paper/references.bib').read(), re.M))11tex=open(f'{SRC}/paper/main.tex').read()12ver=re.search(r'\\newcommand\{\\WPversion\}\{(.*?)\}',tex).group(1); date=re.search(r'\\newcommand\{\\WPdate\}\{(.*?)\}',tex).group(1); jel=re.search(r'\\newcommand\{\\WPjel\}\{(.*?)\}',tex).group(1)13title=re.search(r'\\newcommand\{\\WPtitle\}\{(.*?)\}',tex).group(1); sub=re.search(r'\\newcommand\{\\WPsubtitle\}\{(.*?)\}',tex).group(1)14now=datetime.datetime.now().astimezone().isoformat(timespec='seconds')15readme=open(f'{SRC}/README.md').read(); m=re.search(r'\*\*TL;DR\*\*\s*—\s*(.*?)\n\n',readme,re.S); tldr=re.sub(r'\s*\n>\s*',' ',m.group(1)).strip() if m else ''16entry={"id":PID,"number":None,"series":"UQO","alt_ids":["wp-ai-0001","AI-0001"],"title":title,"short_title":"Neural Organ Transplant","subtitle":sub,17 "authors":["Simon-Pierre Boucher"],"discipline":"ai","paper_type":"computational","path":PATH,"git_remote":"gitsrv:srv/git/wpai0001_uqo.git","git_head":head,"git_dirty_files":dirty,"git_tags":[],18 "baseline_tag":"review-baseline-20261103","review_branch":"review-20261103","worktree":f"UQO-WP-REVIEW/worktrees/{PID}",19 "manuscript":{"main_tex":"paper/main.tex","pdf":"paper/main.pdf","pages":pages,"pdf_mtime":datetime.date.today().isoformat(),"engine":"pdflatex (paper/.latexmkrc)","bib":["paper/references.bib"],"n_refs":nrefs,"bib_system":"natbib","version_macro":ver,"date_macro":date,"jel":jel},20 "code":{"languages":["python","shell"],"entrypoints":sorted(os.listdir(f'{SRC}/scripts')),"env_files":["pyproject.toml"],"has_makefile":False},21 "data":{"summary":"synthetic micro-world splits regenerated from seeds (hashes in manifests); Tier-1 task lists in src; open-weight checkpoints from the HF hub (not committed)","data_dir_mb":0.0,"data_n_files":1,"data_gitignored":True,"raw_preserved":"n/a (synthetic)","sources":"to be completed by Referee D (Stage B)"},22 "compute_home":"laptop (M5 Max, MPS + MLX); Tier-2 pairs on M3U96b (~/wpai0001)","status":"complete",23 "dissemination":{"ssrn_id":None,"ssrn_status":"not on SSRN","target_journals":[],"submitted":False},24 "known_limitations":["Tier-0 capability is a per-step map once the trace is visible; donor-in-the-loop graft; conventional learning perfect on the same items; Tier-1 three models, four tasks"],25 "readme_tldr":tldr,"prior_reviews":[],"review_status":{"stage":"0","gate_passed":None,"last_update":now},"checksums_file":f"UQO-WP-REVIEW/manuscripts/{PID}/original/SHA256SUMS","in_scope":True}26reg=json.load(open(f'{REV}/registry/working_papers.json'))27reg['papers']=[p for p in reg['papers'] if p['id']!=PID]+[entry]; reg['n_in_scope']=sum(1 for p in reg['papers'] if p.get('in_scope')); reg['generated_update']=now28json.dump(reg,open(f'{REV}/registry/working_papers.json','w'),indent=1,ensure_ascii=False)29# blinded record = entry without review/status/known_limitations/prior_reviews30rec={k:v for k,v in entry.items() if k not in ('review_status','status','known_limitations','prior_reviews','in_scope','git_remote','git_dirty_files','git_tags','baseline_tag','review_branch','checksums_file','alt_ids','short_title','readme_tldr')}31os.makedirs(f'{REV}/peer_reviews/_briefs/records',exist_ok=True); json.dump(rec,open(f'{REV}/peer_reviews/_briefs/records/{PID}.json','w'),indent=1,ensure_ascii=False)32st={"id":PID,"path":PATH,"stage":"0","gate_passed":[],"timestamp":now,"blocking_items":[],"engine_unavailable":[],"api_budget_usd":{"ceiling":0,"spent":0},"notes":[f"{now}: enrolled by the author for the full pipeline (Stages A–G), standing instructions: C–G autonomous, 0 USD, review branch pushed, main untouched, one paper at a time, ≤ 7 concurrent subagents."],"authorization_pending":[],"authorizations":{}}33json.dump(st,open(f'{REV}/status/{PID}.json','w'),indent=1)34print('enrolled',PID,'head',head,'pages',pages,'refs',nrefs,'version',ver)35
Files main
Menu

Theme