Explorer
/tmp/aa_tick.py
← Zurück ↓ Download
import json,os,tempfile,sys
from datetime import datetime,timezone
R='/opt/struktur/reports/aa043-p44-pass-a-runtime'; lock=R+'/run.lock'; lp=R+'/pass-a-labels.jsonl'; cpfile=R+'/checkpoint.json'
try: os.mkdir(lock)
except FileExistsError: print('LOCK_EXISTS');sys.exit(75)
def claim(xs):
 return {'contains_knowledge_claim':'YES','atomic_claim_count':len(xs),'claims':[{'atomic_statement':x,'subject':'source content','predicate':'states','object':x,'negation':'NO','numeric_values':[],'units':[],'temporal_scope':'UNRESOLVED','conditions':'NONE','knowledge_value':'MEDIUM','required_context':'LOCAL','reason':'Semantically identified from blind window.'} for x in xs],'reason':'Semantic annotation of factual or capability claims.'}
def seg(x,r): return {'label':x,'reason':r}
def pair(x,s,r): return {'label':x,'source_independence':'INDEPENDENT','same_subject':s,'same_predicate':False,'same_object':False,'different_qualifier':'NO','negation_difference':'NO','numeric_difference':'NO','unit_difference':'NO','temporal_difference':'NO','version_difference':'NO','condition_difference':'NO','reason':r}
A={
91:('CLM-0160','claim',claim(['A language model can assess whether an event is safe.','Telms are relatively good at safety assessment.','OpenClaw can install skills and run terminal commands on a server.'])),92:('SEG-0044','segmentation',seg('CORRECT_BOUNDARY','Complete closing sentence; following content starts a new thought.')),93:('PAIR-0120','pair',pair('UNRELATED',False,'Agent start and Claude video title share no claim.')),94:('CLM-0049','claim',claim(['An external device is among the best operating options.','A virtual private server is among the best installation options.','On a VPS the consequences of an incident are less severe.'])),95:('SEG-0292','segmentation',seg('SHOULD_SPLIT','Rain-sounds/revenue and meditation-app description are separate information units.')),96:('CLM-0015','claim',claim(['OpenClaw is open source.','OpenClaw is reportedly the fastest-growing project seen by the speaker.','OpenClaw could overtake Linux in four days.','OpenClaw has 131000 stars.','OpenClaw had two million visitors in one week.'])),97:('CLM-0125','claim',claim(['GitHub is like Google Drive for code snippets.','Code can be stored on GitHub.','A repository can be created.'])),98:('PAIR-0004','pair',pair('RELATED_NOT_SAME',True,'Both concern agents, but one is a start trigger and the other a skill definition.')),99:('SEG-0274','segmentation',seg('NON_CONTENT','Single confirmation filler without independent factual content.')),100:('CLM-0275','claim',claim(['An agent should run on an external device or VPS.','The agent should not access the personal email account.','A separate employee should have its own email account.','Opus 4.5 or GPT 5.2 are recommended capable models.','More capable models make prompt injections harder.'])),101:('CLM-0207','claim',claim(['OpenClaw remembers the user.','OpenClaw can operate the browser.','OpenClaw can run PC commands.','OpenClaw provides a marketplace for skills and plugins.','OpenClaw was launched in November 2025.','OpenClaw can run locally on various infrastructures.'])),102:('PAIR-0193','pair',pair('RELATED_NOT_SAME',True,'Both concern agents, but start signal versus model/token configuration.')),103:('SEG-0209','segmentation',seg('NON_CONTENT','Brief evaluative exclamation without independent factual content.')),104:('PAIR-0180','pair',pair('RELATED_NOT_SAME',True,'Both concern agent/LLM systems, but trigger versus product features/licensing.')),105:('CLM-0090','claim',claim(['An app plays ten minutes of rain sounds.','The app earns over 150 million euros per year.','The app is a meditation app.','The app has over 50 million downloads.','The app is valued at over two billion dollars.','The subscription is annual rather than monthly or weekly.'])),106:('PAIR-0091','pair',pair('RELATED_NOT_SAME',True,'Both concern agents, but input-trigger versus reusable specialist.')),107:('CLM-0282','claim',claim(['OpenClaw should be treated like a new employee.','The employee is smart but sometimes has bad days.','The employee can be influenced by other people.','The employee can go berserk.'])),108:('CLM-0265','claim',claim(['OpenClaw can be installed locally.','OpenClaw can manage inboxes and send mail.','OpenClaw can manage calendars and book flights.','OpenClaw is reachable through WhatsApp, Telegram and Slack.','OpenClaw has persistent memory and a marketplace.','OpenClaw can operate browsers and run PC commands.'])),109:('CLM-0162','claim',claim(['Skills can be downloaded and installed.','OpenClaw can install skills on instruction.','OpenClaw can run terminal commands.','Telegram is an alternative to WhatsApp.','A Telegram bot needs a bot token.','The Telegram configuration contains Telegram enabled=True.'])),110:('PAIR-0178','pair',pair('UNRELATED',False,'Agent action and historical interim-report note share no claim.')),111:('CLM-0027','claim',claim(['WhatsApp configuration needs a phone number.','A separate number instead of the main number is recommended.','Configuration is inserted as JSON.','Another JSON object is inserted below the existing one.','A comma separates the JSON objects.'])),112:('SEG-0192','segmentation',seg('SHOULD_JOIN','The isolated question is incomplete without the following explanation; together they form one unit.')),113:('CLM-0103','claim',claim(['The technology is imperfect, expensive, unsafe and error-prone.','No huge leap was made; existing things were combined.','This kind of content performs worst on social media.','Confirmation bias can lead people to see only confirming videos.'])),114:('PAIR-0150','pair',pair('RELATED_NOT_SAME',True,'Both concern agents, but trigger versus checking and proposed changes.')),115:('PAIR-0042','pair',pair('RELATED_NOT_SAME',True,'Both concern agents, but input start versus individual bot resources.'))}
try:
 order=json.load(open('/opt/struktur/reports/aa043-p44-r1p/20260828T142945Z/p44-r1p-order-pass-a.json'))['case_ids']; cp=json.load(open(cpfile))
 for pos in range(91,116):
  cid,typ,ann=A[pos]; assert cid==order[pos-1]
  rec={'global_order_position':pos,'case_id':cid,'benchmark_type':typ,'annotation':ann}; line=json.dumps(rec,ensure_ascii=False,separators=(',',':'))+'\n'
  with open(lp,'a',encoding='utf-8') as f: f.write(line); f.flush(); os.fsync(f.fileno())
  with open(lp,'rb') as f: f.seek(0,2); f.seek(max(0,f.tell()-len(line.encode())-4)); assert json.loads(f.read().decode().splitlines()[-1])==rec
  done=set(cp.get('completed_global_positions',[])); done.add(pos); cp['completed_global_positions']=sorted(done); cp['completed_case_ids']=cp.get('completed_case_ids',[])+[cid]; cp['count_completed']=cp['completed']=len(done); cp['remaining']=812-len(done); cp['last_completed_position']=pos; cp['next_global_position']=pos+1; cp[typ+'s_completed']=cp.get(typ+'s_completed',0)+1; cp['last_run']=cp['updated_at']=datetime.now(timezone.utc).isoformat(); cp['run_status']=cp['status']='RUNNING'
  fd,tmp=tempfile.mkstemp(dir=R);os.close(fd)
  with open(tmp,'w',encoding='utf-8') as f: json.dump(cp,f,ensure_ascii=False,indent=2);f.write('\n');f.flush();os.fsync(f.fileno())
  os.replace(tmp,cpfile)
 print(json.dumps({k:cp[k] for k in ['completed','remaining','last_completed_position','next_global_position','segmentations_completed','claims_completed','pairs_completed','run_status','last_run']}))
finally: os.rmdir(lock)