209 lines
13 KiB
Python
209 lines
13 KiB
Python
"""Frozen ISMIR 2026 accepted program, abstracts and opt-in review provenance."""
|
|
import argparse
|
|
from collections import Counter
|
|
from datetime import datetime
|
|
import hashlib
|
|
import json
|
|
from pathlib import Path
|
|
import re
|
|
import unicodedata
|
|
|
|
from paper_atlas.io.html import Document, Node, clean
|
|
|
|
SOURCE = 'ismir_program'
|
|
TRACK = 'program_unclassified'
|
|
PAPERS = 'https://ismir2026program.ismir.net/papers.html'
|
|
ACCEPTED = 'https://ismir2026.ismir.net/accepted-papers'
|
|
SNAPSHOTS = {
|
|
'remaining2026-listings-research-v2': ('fea7b710587636db06794ee195cd083634c41e9054a217859d9dd0ccdd1afab9',
|
|
'research_completed_not_coverage_or_import_approval', {
|
|
'ismir-accepted.html': ACCEPTED,
|
|
'ismir-call.html': 'https://ismir2026.ismir.net/authors/call-for-papers'}),
|
|
'ismir2026-script-research-v1': ('5885b4bcfc2fc65374e5dc7a0d74f4eb86a0a36b8689f9fe8edbd10d49a08794',
|
|
'public_script_research_only', {'papers.js': 'https://ismir2026program.ismir.net/static/js/papers.js'}),
|
|
'ismir2026-json-research-v1': ('8be3e23277c199720264d940917118572655d18c0f9ac6db1b9cd30a6561b34d',
|
|
'public_metadata_json_research_only', {'papers.json': 'https://ismir2026program.ismir.net/papers.json'}),
|
|
}
|
|
REVIEW_KEYS = {'meta_review','publish_reviews','review1','review2','review3','review4'}
|
|
|
|
|
|
def digest(raw):
|
|
return hashlib.sha256(raw).hexdigest()
|
|
|
|
|
|
def one(items):
|
|
if len(items) != 1:
|
|
raise ValueError('Expected exactly one reviewed source field')
|
|
return items[0]
|
|
|
|
|
|
def title_key(text):
|
|
return ''.join(c for c in unicodedata.normalize('NFKD', text).casefold() if c.isalnum())
|
|
|
|
|
|
def load_snapshots(root):
|
|
root = Path(root)
|
|
if root.is_symlink():
|
|
raise ValueError('Unsafe snapshot root')
|
|
result = {}
|
|
for name, (expected, status, urls) in SNAPSHOTS.items():
|
|
directory = root/name; path = directory/'manifest.json'
|
|
if directory.is_symlink() or path.is_symlink() or path.stat().st_size > 128*1024:
|
|
raise ValueError('Unsafe snapshot manifest')
|
|
raw = path.read_bytes()
|
|
if digest(raw) != expected:
|
|
raise ValueError('Reviewed manifest hash changed')
|
|
manifest = json.loads(raw)
|
|
if manifest['status'] != status or manifest['database_written'] is not False:
|
|
raise ValueError('Unreviewed snapshot scope')
|
|
files = {'manifest.json': raw}; receipts = {}
|
|
for filename, url in urls.items():
|
|
receipt = one([r for r in manifest['entries'] if r.get('file') == filename])
|
|
path = directory/filename
|
|
if path.is_symlink() or path.stat().st_size > 8*1024**2:
|
|
raise ValueError('Unsafe snapshot source file')
|
|
body = path.read_bytes()
|
|
if (receipt['url'] != url or receipt['final_url'] != url or receipt['http_status'] != 200
|
|
or receipt['bytes'] != len(body) or receipt['sha256'] != digest(body)
|
|
or datetime.fromisoformat(receipt['at']).utcoffset() is None):
|
|
raise ValueError('Source receipt/body disagree')
|
|
files[filename] = body; receipts[filename] = receipt
|
|
result[name] = (files, receipts)
|
|
return result
|
|
|
|
|
|
def author_names(literal):
|
|
# Institution names can contain semicolons; split only outside parentheses.
|
|
parts = []; depth = 0; start = 0
|
|
for index, char in enumerate(literal):
|
|
if char == '(': depth += 1
|
|
elif char == ')':
|
|
depth -= 1
|
|
if depth < 0: raise ValueError('Unbalanced author affiliation')
|
|
elif char == ';' and depth == 0:
|
|
parts.append(literal[start:index]); start = index+1
|
|
if depth:
|
|
raise ValueError('Unbalanced author affiliation')
|
|
parts.append(literal[start:])
|
|
names = [clean(p.split('(', 1)[0]) for p in parts]
|
|
if any(not name for name in names):
|
|
raise ValueError('Missing accepted-list author')
|
|
return names
|
|
|
|
|
|
def accepted_listing(raw):
|
|
doc = Document(raw.decode('utf-8')); tables = []
|
|
for table in doc.root.walk():
|
|
if table.tag != 'table': continue
|
|
rows = []
|
|
for row in table.walk():
|
|
if row.tag == 'tr':
|
|
rows.append([clean(n.text()) for n in row.children if isinstance(n, Node) and n.tag in ('th','td')])
|
|
if rows and rows[0] == ['Paper Title', 'Authors']:
|
|
tables.append(rows)
|
|
rows = one(tables)[1:]; result = {}
|
|
if len(rows) != 140:
|
|
raise ValueError('Incomplete official accepted-list census')
|
|
for row in rows:
|
|
if len(row) != 2 or not row[0] or not row[1] or title_key(row[0]) in result:
|
|
raise ValueError('Missing or ambiguous accepted-list title')
|
|
result[title_key(row[0])] = {'title': row[0], 'authors_literal': row[1], 'author_names': author_names(row[1])}
|
|
return result
|
|
|
|
|
|
def program_observations(rows, listing):
|
|
if not isinstance(rows, list) or len(rows) != 140:
|
|
raise ValueError('Incomplete public program census')
|
|
observations = []; seen = set(); used = set()
|
|
for original in rows:
|
|
if not isinstance(original, dict) or not isinstance(original.get('content'), dict):
|
|
raise ValueError('Invalid public program record')
|
|
pid = original.get('id'); content = original.get('content', {})
|
|
if not isinstance(pid, str) or not re.fullmatch(r'[1-9][0-9]*', pid) or pid in seen or original.get('forum') != pid:
|
|
raise ValueError('Missing/repeated numeric program locator, not an OpenReview ID')
|
|
seen.add(pid); title = content.get('title'); authors = content.get('authors'); abstract = content.get('abstract')
|
|
if (not isinstance(title, str) or not clean(title) or not isinstance(abstract, str) or not abstract.strip()
|
|
or not isinstance(authors, list) or not authors or any(not isinstance(a, str) or not clean(a) for a in authors)):
|
|
raise ValueError('Missing program title, author sequence or abstract')
|
|
key = title_key(title)
|
|
if key not in listing or key in used:
|
|
raise ValueError('Program/accepted-list title membership mismatch')
|
|
used.add(key); accepted = listing[key]
|
|
keywords = content.get('keywords'); presentation = content.get('paper_presentation')
|
|
session = content.get('session'); reviews = original.get('reviews')
|
|
if (not isinstance(keywords, list) or any(not isinstance(k, str) for k in keywords)
|
|
or presentation not in ('Remote','In-person','Remote during oral, In-person during nominee')
|
|
or not isinstance(session, list) or len(session) != 1 or not isinstance(session[0], str) or session[0] != original.get('session')
|
|
or not re.fullmatch(r'(?:[1-9]|1[0-4])', session[0])):
|
|
raise ValueError('Unreviewed source keywords, presentation or session')
|
|
if (not isinstance(reviews, dict) or set(reviews) != REVIEW_KEYS
|
|
or any(not isinstance(v, str) for v in reviews.values())
|
|
or reviews['publish_reviews'] not in ('Yes','No')):
|
|
raise ValueError('Unreviewed opt-in review structure')
|
|
review_text = [reviews[k] for k in REVIEW_KEYS-{'publish_reviews'}]
|
|
if (reviews['publish_reviews'] == 'No' and any(review_text)) or (reviews['publish_reviews'] == 'Yes' and not any(review_text)):
|
|
raise ValueError('Review publication preference/body disagree')
|
|
flags = []
|
|
if title != accepted['title']: flags.append('program_and_accepted_title_literal_versions_differ')
|
|
if authors != accepted['author_names']: flags.append('program_and_accepted_author_sequence_versions_differ')
|
|
observations.append({'original': original, 'accepted_listing': accepted, 'review_flags': flags})
|
|
if (used != listing.keys() or sum('program_and_accepted_title_literal_versions_differ' in o['review_flags'] for o in observations) != 2
|
|
or {o['original']['id'] for o in observations if 'program_and_accepted_author_sequence_versions_differ' in o['review_flags']} != {'60','126','433'}
|
|
or Counter(o['original']['reviews']['publish_reviews'] for o in observations) != {'Yes':101,'No':39}):
|
|
raise ValueError('Unreviewed source-version or opt-in census')
|
|
return observations
|
|
|
|
|
|
def collect(out, *, snapshots):
|
|
out = Path(out)
|
|
if out.exists(): raise ValueError('Output exists; inspect previous operation before retrying')
|
|
out.mkdir(parents=True)
|
|
try:
|
|
sources = load_snapshots(snapshots)
|
|
official, _ = sources['remaining2026-listings-research-v2']; script, _ = sources['ismir2026-script-research-v1']
|
|
program, receipts = sources['ismir2026-json-research-v1']; receipt = receipts['papers.json']
|
|
if b"d3.json('papers.json')" not in script['papers.js'] or b'href="poster_${openreview.id}.html"' not in script['papers.js']:
|
|
raise ValueError('Unreviewed public program data path or poster link template')
|
|
observations = program_observations(json.loads(program['papers.json']), accepted_listing(official['ismir-accepted.html']))
|
|
evidence = out/'evidence'; evidence.mkdir()
|
|
for name, (files, _) in sources.items():
|
|
directory = evidence/name; directory.mkdir()
|
|
for filename, body in files.items(): (directory/filename).write_bytes(body)
|
|
rows = []
|
|
for observation in observations:
|
|
original = observation['original']; content = original['content']; pid = original['id']
|
|
tags = [{'namespace':SOURCE+':presentation','value':content['paper_presentation']}]
|
|
tags += [{'namespace':SOURCE+':keyword','value':value} for value in dict.fromkeys(clean(k) for k in content['keywords'] if clean(k))]
|
|
rows.append({'source':SOURCE,'external_id':'2026/'+pid,'url':'https://ismir2026program.ismir.net/poster_'+pid+'.html',
|
|
'title':content['title'],'authors':content['authors'],'abstract':content['abstract'],
|
|
'identifiers':{},'submission_identifiers':[],'venue':'ISMIR','year':2026,'track':TRACK,'status':'accepted',
|
|
'raw_decision':'Present in official ISMIR2026 accepted list and public virtual program; not an original signed decision.',
|
|
'evidence_url':ACCEPTED,'observed_at':receipt['at'],'tags':tags,
|
|
'metadata':{'program_entry':original,'accepted_listing':observation['accepted_listing'],'review_flags':observation['review_flags'],
|
|
'program_receipt':receipt,'source_evidence':{'file':'evidence/ismir2026-json-research-v1/papers.json','sha256':receipt['sha256'],'url':receipt['url']},
|
|
'original_decision_signature_verified':False,'paper_type':None,
|
|
'id_scope':'Numeric miniconf id/forum fields are program locators, not original OpenReview submission IDs; no inferred DOI or arxiv ID.',
|
|
'track_scope':'Unclassified regular accepted-list program; no workshop or research-method class inferred from topic/session/remote presentation.',
|
|
'review_scope':'101 source-opt-in review sets retained as raw public text;39No contain no review text. Reviewer recommendations/meta-review prose are not separately inferred final negative decisions.',
|
|
'abstract_transform':'Original JSON abstract string retained verbatim, including math, newlines and Unicode; no markup flattening or PDF extraction.',
|
|
'program_listing_scope':'Source versions remain separate.2title literal differences and3author-list differences flagged, not silently fused or resolved.',
|
|
'scope':'Pending work/history review. Poster URL follows frozen official JS template; poster pages not downloaded. No work merge, aliases, negative decision or final coverage/dedup claim.'}})
|
|
path = out/'ismir-program-2026-unclassified.jsonl';raw=''.join(json.dumps(r,ensure_ascii=False)+'\n' for r in rows).encode();path.write_bytes(raw)
|
|
manifest={'source':SOURCE,'parser_version':1,'venue':'ISMIR','year':2026,'track':TRACK,'count':140,'file':str(path),
|
|
'file_sha256':digest(raw),'list_url':ACCEPTED,'status':'partial','missing_abstract_count':0,'source_expected_count':140}
|
|
path.with_suffix('.manifest.json').write_text(json.dumps(manifest,indent=2)+'\n')
|
|
report={'status':'collected_pending_identity_review','records':140,'files':[manifest],'missing_abstract_count':0,
|
|
'literal_title_version_differences':2,'author_sequence_version_differences':3,'review_optin_yes':101,'review_optin_no':39,
|
|
'database_written':False,'network_requests':0,'pdfs_downloaded':False,'approved_for_import':0,
|
|
'public_rejected_availability':'unknown_accepted_program_reviews_are_not_a_rejected_export',
|
|
'scope':'140accepted observations;101opt-in review sets, not101rejected records. Source keyword/presentation tags are namespace-scoped; no original OpenReview ID assumption or source-version fusion.'}
|
|
part=out/'collection-report.json.part';part.write_text(json.dumps(report,ensure_ascii=False,indent=2)+'\n');part.replace(out/'collection-report.json');return report
|
|
except Exception as error:
|
|
(out/'failed.json').write_text(json.dumps({'status':'failed_not_complete','error_type':type(error).__name__,'database_written':False})+'\n')
|
|
raise
|
|
|
|
|
|
def main(argv=None, *, prog=None):
|
|
parser=argparse.ArgumentParser(prog=prog,description=__doc__);parser.add_argument('--snapshots',required=True);parser.add_argument('--out',required=True)
|
|
args=parser.parse_args(argv);print(json.dumps(collect(args.out,snapshots=args.snapshots),ensure_ascii=False))
|