"""Publish the preselected large source pool and live checkpoint links."""
import html,json
from pathlib import Path
R=Path(__file__).resolve().parents[1];O=R/'results/r112/species-scaleup';s=json.loads((O/'selection.json').read_text());first=[];seen=set()
for r in s['records']:
 if r['source_species'] in seen:continue
 seen.add(r['source_species']);first.append(r)
cards=''.join('<figure><img loading="lazy" data-src="images/'+html.escape(x['annotation_id'])+'.png" alt="Development source crop '+html.escape(x['source_species'])+'"><figcaption>'+html.escape(x['source_species'])+' · '+html.escape(x['annotation_id'])+'</figcaption></figure>' for x in first)
page='''<!doctype html><html lang="en"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Expanded UDE development sources</title><style>body{font:16px/1.55 system-ui;background:#f4f6f0;color:#193b37;margin:0}main{max-width:1100px;margin:auto;padding:24px}a{color:#096c58}.notice,section{background:white;border:1px solid #cddbd2;padding:16px;margin:14px 0}.notice{border-left:5px solid #bc851b}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px}figure{margin:0}img{width:100%;height:180px;object-fit:contain;background:#eef2ed}figcaption{font-size:.85rem}</style><main><nav><a href="/results/r112/">Synthetic training</a> · <a href="/results/r112/ude-sampling-metadata/">Site audit and archive download</a></nav><h1>Expanded development source pool</h1><p class="notice"><strong>Development candidates, not completed labeled synthetic data.</strong> The published source names were assigned and reviewed by the UDE team, but have not been independently reconciled with Academy taxonomy. Original crops may contain neighboring organisms; rough source shapes are not verified instance masks. Location components are conservative proxies, not proof of independent biological samples.</p><p>Before opening these crops, selected 4,000 metadata records across 80 source-name strings and 30 source genera: 50 crops per string, at most 10 per conservative location component and three per original slide. At least 18 conservative location components contribute to each string. Twenty-six selected crops were used in an earlier, already-consumed comparison; all 4,000 are development material. Source names with simple morphotype, alternate-name or genus-spelling flags were excluded, but this rule does not resolve synonyms or establish taxonomy. Prior candidate test components and unresolved sites were excluded.</p><p id="worker">Waiting for a worker checkpoint…</p><p id="extract"></p><p><small>Progress files are checkpoints and do not prove a process is live. If the transfer or worker stops, a later run must resume; partial archives are never used as complete data.</small></p><p><a href="selection.json">Frozen crop selection</a> · <a href="selection-verify.json">Selection replay</a> · <a href="worker-status.json">Worker checkpoint</a> · <a href="progress.json">Extraction checkpoint</a> · <a href="assets.json">Source provenance, when complete</a> · <a href="verify.json">Archive/pixel verification, when complete</a> · <a href="/results/r112/ude-sampling-metadata/exposure-report.json">Location exposure policy</a></p><section><h2>Location-separated development partitions</h2><p>The selected crops are partitioned by conservative location components: 2,830 training, 604 tuning and 566 check crops; all 80 source-name strings appear in each. These are development partitions, not independent biological or Academy tests. The locations and some crops were used earlier, and model-generated masks are not independently validated.</p><pre>from diatom_pilot.ude_scaleup_dataset import UDEScaleupDataset
training = UDEScaleupDataset("training")
tuning = UDEScaleupDataset("tuning")
check = UDEScaleupDataset("check")</pre><p>The reader requires an explicit partition and only offers the unverified mask proposals after the full proposal job has been checked.</p><p><a href="location-partitions.json">Partition provenance</a> · <a href="partition-verify.json">Partition verification</a> · <a href="reader-verify.json">Reader checks</a> · <a href="/diatom_pilot/ude_scaleup_dataset.py">Reader source</a></p></section><section><h2>Source-mask proposal job</h2><p>Three unverified model proposals have been generated for each of 4,000 source crops; agreement is not biological correctness.</p><p><a href="mask-hypotheses/">Inspect proposals and examples</a></p></section><section><h2>80-name source-crop baseline</h2><p>A linear classifier matched 190 of 604 tuning source names (top five: 390); these are prepared development crops, not Academy scan results. The separate check partition was not used.</p><p><a href="real-crop-baseline/">Inspect all predictions and verification</a></p></section><section><h2>Synthetic versus real training</h2><p>With one weak-mask composite per source, the mixed classifier matched 176/604 tuning names versus 190/604 real-only. Some composites have visible seams; this renderer is not validated.</p><p><a href="synthetic-crop-comparison/">Inspect the comparison and paired examples</a></p></section><section><h2>Seam repair and augmentation control</h2><p>Removing background wrap seams did not improve the mixed classifier: 173/604 name matches compared with 190/604 real-only and 193/604 with ordinary augmentation. These are development comparisons on reused tuning crops.</p><p><a href="seam-repair-comparison/">Inspect paired inputs and predictions</a></p></section><section><h2>Source detail and mask review</h2><p>An audit of all 2,830 training composites selects low-change insertions, source edges outside proposed masks and fixed references for visual inspection. These image measurements are review prompts, not mask accuracy scores.</p><p><a href="render-detail-audit/">Review source outlines, backgrounds and composites</a></p></section><section><h2>Capped contrast proxy</h2><p>A development-only rendering variant raises faint pixel changes in 496 of 2,830 source/background pairs, while retaining a randomly assigned unadjusted group. It also introduces some clipping and can amplify mask artifacts.</p><p><a href="contrast-proxy-study/">Inspect paired examples and measurements</a></p></section><section><h2>Expanded crowded development scenes</h2><p>283 fields use all 2,830 training sources, with 4–16 insertions per field, separate unverified overlapping supports and unknown background.</p><p><a href="/results/r112/scaleup-crowded-scenes/">Inspect every field and the dataset reader</a></p></section><section><h2>Separated-support development scenes</h2><p>192 complementary fields have one to three inserted sources with no intersections between their projected supports; Academy background organisms remain unknown and may overlap them.</p><p><a href="/results/r112/scaleup-separated-scenes/">Inspect all fields and source records</a></p></section><section><h2>Mask review practice</h2><p>Compare three model proposals for each of 160 source crops. Feedback is saved in the browser and can be downloaded; reviewer experience and uncertainty are preserved, and choices are not automatically promoted to training labels.</p><p><a href="/results/r112/source-mask-review/">Open outline review</a> · <a href="/results/r112/source-mask-review/verify.json">Batch verification</a></p></section><section><h2>Additional source-name breadth and split exposure</h2><p>1,096 crops cover 137 additional source-name strings. The full set includes 164 crops from the earlier check-location groups and 148 from tuning-location groups; it cannot be combined with that split for a location-unseen comparison.</p><p><a href="/results/r112/species-breadth/">Inspect the new source pool and exposure audit</a></p></section><section><h2>Rough polygon comparison</h2><p>All 28 published polygon-shaped source annotations were compared with model proposals. The source shapes are deliberately rough and can contain margins, so agreement is not mask accuracy.</p><p><a href="polygon-mask-audit/">Inspect all polygon and mask comparisons</a></p></section><h2>First selected source crops</h2><p>These 80 source names were selected by metadata order; images appear when their individually CRC-checked crops have been extracted. The complete verified archive retains the original PNG bytes.</p><div class="grid">'''+cards+'''</div><script>async function poll(){for(const [file,id] of [['worker-status.json','worker'],['progress.json','extract']]){try{let r=await fetch(file+'?t='+Date.now(),{cache:'no-store'});if(!r.ok)throw Error();let p=await r.json();document.getElementById(id).textContent=file==='progress.json'?'Extracted '+p.completed+' / '+p.total+' crops; last checkpoint '+p.elapsed_seconds+' seconds after extraction began.':'Worker checkpoint: '+p.phase+' at '+p.updated_utc;}catch(e){document.getElementById(id).textContent=file==='worker-status.json'?'No worker checkpoint available.':'Extraction has not produced a checkpoint.';}}for(const im of document.querySelectorAll('img[data-src]')){if(!im.src||im.dataset.failed==='1'){let url=im.dataset.src;fetch(url,{method:'HEAD',cache:'no-store'}).then(r=>{if(r.ok){im.dataset.failed='0';im.src=url}else im.dataset.failed='1'}).catch(()=>im.dataset.failed='1')}}}poll();setInterval(poll,15000)</script></main></html>''';(O/'index.html').write_text(page);print('published selection and monitor')
